import "./_dnt.polyfills.js"; import "./_dnt.polyfills.js"; import { CLEANUP, COMPONENT, KEYED, REACTIVE_ATTRIBUTES, SINGLE_KEYED } from "./symbols.js"; type Child = any; export type ComponentNode = HTMLElement & { [COMPONENT]: (anchor: ComponentNode) => any; }; declare global { interface HTMLElement { [REACTIVE_ATTRIBUTES]?: Function[]; [CLEANUP]?: Function[]; } } export declare const Fragment: unique symbol; export declare function createElement(type: string | Function, props: null | Record, ...children: any[]): Node; interface Root { render(el: Child): Node; root: Node | null; unmount(): void; } export declare function createRoot(target: HTMLElement): Root; export declare function update(target: Node): any; export declare function memo(fn: (anchor: Node) => any, shouldMemo: () => boolean): (anchor: Node) => any; export declare function createList(fn: (key: (renderFn: () => any, keyValue: any) => any) => any[]): { [KEYED]: boolean; items: { renderFn: () => any; key: any; }[]; }; /** * Creates a keyed element or component that only re-renders when the key changes. * The component instance and its internal state are preserved as long as the key remains the same. * * @param renderFn - Function that returns the element/component to render * @param keyValue - Unique key to identify this element/component * @returns A marker object for the keyed element * * @example * return ( *
* {() => createKey(() => , activeTab)} *
* ); * } * // When activeTab changes, Counter remounts (count resets to 0) * // When activeTab stays the same, Counter instance is preserved (count increments) * ``` */ export declare function createKey(renderFn: () => any, keyValue: any): { [SINGLE_KEYED]: boolean; renderFn: () => any; key: any; }; export declare function createAbortSignal(target: Node): AbortSignal; export declare function createAbortSignalOnUpdate(target: Node): AbortSignal; /** * Dispatch a fresh "suspend" event from a descendant node. * Returns true if not prevented. */ export declare function suspend(target: Node): boolean; /** * Dispatch a fresh "unsuspend" event from a descendant node. * Returns true if not prevented. */ export declare function unsuspend(target: Node): boolean; /** * Suspense component * Shows fallback while one or more descendants are suspended. * Child components that perform async work should call suspend(node) before starting * and unsuspend(node) when resolved. Multiple overlapping suspensions are reference-counted. * * This implementation relies on the updated component build queue: * - Suspense host builds first, installs listeners. * - Descendant component builds that trigger suspend will bubble upward correctly. */ export declare function Suspense(this: ComponentNode, props: JSX.PropsWithChildren<{ fallback: () => JSX.Element; }>): JSX.Element; export {};