import { type HooksState } from "./Hooks.js"; import { type FunctionComponent, type KeyedProperties, type Template, type TreeProperties } from "./JSX.js"; /** * A symbol for node render context. */ declare const CONTEXT_SYMBOL: unique symbol; /** * A symbol for shadow context. */ declare const SHADOW_CONTEXT_SYMBOL: unique symbol; declare const ContextKind: { LITERAL: number; VNODE: number; REF: number; }; type ContextKind = (typeof ContextKind)[keyof typeof ContextKind]; /** * The node context interface. */ export type Context = { node: Node; kind: ContextKind; type: FunctionComponent | string | null; root?: Context; owner?: Context; parent?: Context; children: Context[]; contexts: WeakMap; properties?: KeyedProperties & TreeProperties & Record; state?: HooksState; end?: Context; key?: unknown; keys?: Map; refs?: Map; shadow: boolean; _pos: number; }; /** * Create a node context. * @param kind The kind of the context. * @param type The type of the context. * @param node The node scope of the context. * @param root The render root context. * @param owner The render owner context. * @returns A context object for the node. */ export declare const createContext: (kind: ContextKind, type: Context["type"], node: Node, shadow?: boolean, root?: Context, owner?: Context) => Context; /** * Get (or create) the root context attached to a node. * @param node The scope of the context. * @param shadowRoot If the context is a shadow root. * @returns The context object (if it exists). */ export declare const getRootContext: (node: T & { [CONTEXT_SYMBOL]?: Context; [SHADOW_CONTEXT_SYMBOL]?: Context; }, shadowRoot?: boolean) => Context; /** * Render a set of nodes into the render root, with some checks for Nodes in order to avoid * useless changes in the tree and to mantain or update the state of compatible Nodes. * * @param context The render context of the root. * @param template The child (or the children) to render in Virtual DOM format or already generated. * @param rootContext The current root context of the render. * @param namespace The current namespace uri of the render. * @param fragment The fragment context to update. * @returns The resulting child nodes list. */ export declare const internalRender: (context: Context, template: Template, rootContext?: Context, namespace?: string, fragment?: Context) => Context[]; /** * Render a set of Nodes into another, with some checks for Nodes in order to avoid * useless changes in the tree and to mantain or update the state of compatible Nodes. * * @param input The child (or the children) to render in Virtual DOM format or already generated. * @param root The root Node for the render. * @returns The resulting child Nodes. */ export declare const render: (input: Template, root?: Node) => Node | Node[] | undefined; export {};