interface ArrowTemplate { (parent: ParentNode): ParentNode; (): DocumentFragment; isT: boolean; key: (key: ArrowTemplateKey) => ArrowTemplate; id: (id: ArrowTemplateId) => ArrowTemplate; _c: () => Chunk; _k: ArrowTemplateKey; _i?: ArrowTemplateId; } type ArrowTemplateKey = string | number | undefined; type ArrowTemplateId = string | number | undefined; type ParentNode = Node | DocumentFragment; interface Chunk { paths: [number[], string[]]; dom: DocumentFragment; ref: DOMRef; _t: ArrowTemplate; k?: ArrowTemplateKey; i?: ArrowTemplateId; e: number; g: string; b: boolean; r: boolean; st: boolean; bkn?: Chunk; v?: Array<[Element, string]> | null; u?: Array<() => void> | null; s?: ReturnType[2]; mk?: number; next?: Chunk; } interface DOMRef { f: ChildNode | null; l: ChildNode | null; } /** * The target of a reactive object. */ type ReactiveTarget = Record | unknown[]; interface ReactiveAPI { /** * Adds an observer to a given property. * @param p - The property to watch. * @param c - The callback to call when the property changes. * @returns */ $on:

(p: P, c: PropertyObserver) => void; /** * Removes an observer from a given property. * @param p - The property to stop watching. * @param c - The callback to stop calling when the property changes. * @returns */ $off:

(p: P, c: PropertyObserver) => void; } /** * A reactive object is a proxy of an original object. */ interface Computed extends Readonly> { } type ReactiveValue = T extends Computed ? TValue : T extends ReactiveTarget ? Reactive | T : T; type Reactive = { [P in keyof T]: ReactiveValue; } & ReactiveAPI; /** * A callback used to observe a property changes on a reactive object. */ interface PropertyObserver { (newValue?: T, oldValue?: T): void; } type Props = { [P in keyof T]: T[P] extends ReactiveTarget ? Props | T[P] : T[P]; }; type EventMap = Record; type Events = { [K in keyof T]?: (payload: T[K]) => void; }; type Emit = (event: K, payload: T[K]) => void; type AsyncFactory = (() => Promise | TValue) | ((props: Props) => Promise | TValue) | ((props: Props, emit: Emit) => Promise | TValue) | ((props: undefined, emit: Emit) => Promise | TValue); type ComponentFactory = (props?: Props, emit?: Emit) => ArrowTemplate; interface AsyncComponentOptions { fallback?: unknown; onError?: (error: unknown, props: Props, emit: Emit) => unknown; render?: (value: TValue, props: Props, emit: Emit) => unknown; serialize?: (value: TValue, props: Props, emit: Emit) => TSnapshot; deserialize?: (snapshot: TSnapshot, props: Props) => TValue; idPrefix?: string; } type AsyncComponentInstaller = (factory: AsyncFactory, options?: AsyncComponentOptions) => Component | ComponentWithProps; interface ComponentCall { h: ComponentFactory; p: Props | undefined; e: Events | undefined; k: ArrowTemplateKey; key: (key: ArrowTemplateKey) => ComponentCall; } interface Component { (props?: undefined, events?: Events): ComponentCall; } interface ComponentWithProps { (props: S, events?: Events): ComponentCall; } type SourceBox = Reactive<{ 0: Props | undefined; 1: ComponentFactory; 2: Events | undefined; }>; declare function installAsyncComponentInstaller(installer: AsyncComponentInstaller | null): void; declare function createPropsProxy(source: Props | undefined, factory: ComponentFactory, events?: Events): [Props, Emit, SourceBox]; type NodeMap = WeakMap; type HydrationHook = (map: NodeMap, visited: WeakSet) => void; interface HydrationCapture { hooks: WeakMap; } type HydrationCaptureProvider = () => HydrationCapture | null; declare function installHydrationCaptureProvider(provider: HydrationCaptureProvider | null): void; declare function createHydrationCapture(): HydrationCapture; declare function adoptCapturedChunk(capture: HydrationCapture, chunk: Chunk, map: NodeMap, visited?: WeakSet): void; export { adoptCapturedChunk, createHydrationCapture, installAsyncComponentInstaller, installHydrationCaptureProvider }; export type { ArrowTemplate, HydrationCapture, ParentNode };