/** * VMZ DOM client runtime ??precise patches, no VDOM diff (SSR lives in dom-ssr). * * * Direct components expose `__vmzCreate` / `__vmzSerialize` / `__vmzPlan`. * Mount and client patches run that same schedule (SSR/hydrate/resume in dom-ssr). * Field writes only run registered dep patches ??never re-create structure. */ import type { BindingId, DirectInstance, PatchFn } from './direct-api.types.js'; import type { ComponentCtor, EachCtx, ResumeAdoptCtx } from './dom-core.types.js'; export { applyDirectHostBox, INLINE_HOST_CONTENTS, resolveDirectHostBox } from './direct-host-box.js'; export { createUnknownComponentElement, markUnknownComponentHost, serializeUnknownComponentNode, UNKNOWN_COMPONENT_ERROR, } from './unknown-component.js'; export declare function __vmzPrecisionEnable(on?: boolean): void; export declare function __vmzTraceEnable(on?: boolean): void; export declare function __vmzPrecisionReset(): void; export declare function __vmzTraceReset(): void; /** * StableId event snapshot (`vmz.dx.trace.v0` shape without schema stamp ?? * host may wrap via ingestRuntimeTrace). */ export declare function __vmzTraceSnapshot(): { schema: string; events: { stableId: { kind: string; id: string; }; kind: string; dep?: string; t?: number; chunkId?: string | null; }[]; status: string; }; export declare function __vmzPrecisionSnapshot(): { enabled: boolean; writes: number; bindingEvals: number; patchExecs: number; domCreates: number; domMoves: number; domRemoves: number; componentExecs: number; writesByRoot: { [x: string]: number; }; bindingEvalsByDep: { [x: string]: number; }; patchesByDep: { [x: string]: number; }; bindingEvalsByBinding: { [x: string]: number; }; patchesByBinding: { [x: string]: number; }; }; export declare function noteDomCreate(): void; export declare function registerComponents(map: any): void; export declare function getRegisteredComponent(name: any): ComponentCtor; /** * Lazy component loader for EventEntry mixed packs (set by entry-client / entry-event). */ export declare function resolveComponent(name: any): Promise; /** * Mount once; later updates are dep patches only (never re-run structure). * Requires compiler `__vmzCreate` (production Direct emit ??no blueprint fallback). */ export declare function mount(Component: any, container: any, props?: any): Promise; /** * Nested Direct `component` schedules child onMount asynchronously; drain before return * so SSR/hydrate callers see post-mount DOM (e.g. UserCard Ada, not Loading??. */ export declare function settlePendingChildMounts(inst: any): Promise; export declare function runDirectCreate(Component: any, inst: any): any; /** * First default `` owned by this component tree ??skip nested `[data-vmz]` * hosts (Button/Link/Empty label slots). `querySelector('slot')` steals those and * projects parent siblings into the wrong host (commercial Drawer into Create btn). */ export declare function findOwnedDefaultSlot(root: any): any; export declare const directApi: { _inst: DirectInstance | null; _branchBinds: Array<{ deps: string[]; fn: PatchFn; bindingId?: BindingId; }> | null; _itemPatches: PatchFn[] | null; _eachCtx: EachCtx | null; _resumeAdopt: ResumeAdoptCtx | null; el(tag: any): any; text(value: any): Text; adoptEnter(node: any): boolean; adoptLeave(): void; frag(): DocumentFragment; comment(value: any): Comment; insertBefore(parent: any, node: any, ref: any): void; removeNode(node: any): void; /** * Register a generated per-binding patch (0.2.0). No generic get/cf interpreter. */ trackPatch(inst: any, deps: any, patch: any, bindingId?: any): void; untrackPatch(inst: any, deps: any, patch: any, bindingId?: any): void; disposeTree(root: any): void; attr(el: any, name: any, value: any): void; on(el: any, type: any, handler: any): void; /** * Bind a named instance method (no arrow / Function#toString). * Learns `skipFlush` after a sync invocation that schedules no dirty work * (stride / transpose self-apply DOM). */ onMethod(el: any, type: any, methodName: any, opts: any): void; /** * Specialized single-field attr bind (0.1.29): compile-time field name, no generic get closure in artifact. */ specFieldAttr(inst: any, bindingId: any, fieldName: any, el: any, name: any): void; /** * Specialized single-field text bind (0.1.29): compile-time field name in generated artifact. */ specFieldText(inst: any, bindingId: any, fieldName: any, textNode: any): void; setHtml(el: any, value: any): void; bindHtml(inst: any, bindingId: any, deps: any, get: any, el: any): void; /** * Nested component (sync Direct child or island schedule). */ component(hostInst: any, nameOrCtor: any, props: any, client: any): any; /** * Subscribe to a child component event (`@submit` ??event name `submit`). * Orthogonal to function props (`:on-submit` ??prop `onSubmit`). */ onComponentEvent(hostEl: any, eventName: any, handler: any): void; /** * Keep nested Direct child props live with parent field writes. */ bindComponentProp(hostInst: any, hostEl: any, propName: any, deps: any, get: any): void; /** * Project parent children into nested Direct component default ``. * Uses {@link findOwnedDefaultSlot} so nested Button/Link slots are not stolen. */ projectDefaultSlot(hostEl: any, node: any): void; }; /** * Function prop wire: only `onXxx` camelCase is a handler prop. * Component `@event` must never normalize here ??that channel is `onComponentEvent`. */ export declare function eventPropHandlerName(name: any): string; /** * Dispatch a component event to parent subscribers registered via `onComponentEvent`. * Installed on every Direct instance as `inst.emit`. */ export declare function emitComponentEvent(inst: any, eventName: any, ...payload: any[]): void; export declare function isEventPropName(name: any): boolean; export declare const BOOLEAN_HTML_ATTRS: Set; export declare function applyDomAttr(el: any, name: any, value: any): void; export declare function stripFns(obj: any): {}; /** * Snapshot plain state/prop field values for Island HMR (session). */ export declare function snapshotInstanceState(inst: any): {}; export declare function applyPreservedState(inst: any, state: any): void; /** * Tear down binders and stop patches. Safe to call more than once. * Field writes after destroy no longer update DOM (values may still change). *: also dispose owned DOM trees (child __vmzInst / region __vmzDispose). */ export declare function destroy(inst: any): void; /** *: walk a DOM subtree and run lifetime dispose hooks + nested instance destroy. * Does not mark the *calling* parent destroyed; safe from destroy(inst). */ export declare function disposeDomTree(root: any): void; export declare function scheduleClient(strategy: any, fn: any): void; export declare function isEventEntryStrategy(strategy: any): boolean; export declare function scheduleClientOn(el: any, strategy: any, fn: any): void; /** * AsyncTask cancel protocol (first slice): keyed generation + AbortSignal. * Superseded runs and `destroy(inst)` abort prior work; stale results must not apply. */ export declare function __vmzRunTask(inst: any, key: any, fn: any): Promise; export declare function __vmzCancelTasks(inst: any): void; export declare function __vmzTaskStatus(inst: any, key: any): any; export declare function createInstance(Component: any, props?: any): any; /** * Mark a plain object as intentionally shared across ownership boundaries. */ export declare function __vmzAllowShared(value: any): any; /** * Take exclusive ownership intent: clear multi-owner registry for this object. * Subsequent field assigns re-register from the assigning instance only. */ export declare function __vmzTakeShared(value: any): any; export declare function __vmzSharedCrossComponentDiagnostics(): any[]; export declare function __vmzSharedCrossComponentDiagnosticsReset(): void; /** * Read a nested path under a field root (for compound / update expansion). */ export declare function __vmzReadPath(inst: any, root: any, segs: any): any; /** * Short-circuit logical path assign (`||=` / `&&=` / `??=`). */ export declare function __vmzWritePathLogical(inst: any, root: any, segs: any, kind: any, rhs: any): any; export declare function __vmzWritePath(inst: any, root: any, segs: any, value: any): any; /** * Array-item leaf write without segs array alloc (`rows[i].label = v`). */ export declare function __vmzWritePathItem(inst: any, root: any, idx: any, leaf: any, value: any): any; /** * In-place two-index swap on an owned list field (WriteBarrier Slice 5). * Prefers eachBlock O(1) DOM transpose hook; otherwise schedules a list replace. */ export declare function __vmzListTranspose(inst: any, root: any, ia: any, ib: any): void; /** * Compound leaf write (`rows[i].label += x`) ??one item touch, no separate ReadPath. */ export declare function __vmzWritePathCompound(inst: any, root: any, segs: any, op: any, rhs: any): any; /** * Array-item compound without segs array alloc (`rows[i].label += x`). */ export declare function __vmzWritePathCompoundItem(inst: any, root: any, idx: any, leaf: any, op: any, rhs: any): any; /** * Stride compound over an owned array (`for (i=start; i