/** * Why: the structural DOM adapter between the query facade and defuss-morph. * Morph ships no insert/remove/parse-string primitives of its own, so this * module composes morph's parser (htmlStringToVNodes), renderer, reconciler * (morph), and delegated-event APIs into the exact operations the chain API * needs — and performs only the final native writes itself: insertBefore, * removeChild, cloneNode, text assignment. * * It is deliberately an adapter, not another reconciler: everything here can * move upstream into defuss-morph later without changing the chain API. */ import type { DomContent, MorphApi, Position, QueryRoot, RenderInput } from "./types.js"; /** Duck-typed Node check; `instanceof Node` fails across realms. */ export declare const isNode: (value: unknown) => value is Node; /** Element check (nodeType 1) — the target kind most chain methods need. */ export declare const isElement: (value: unknown) => value is Element; /** Anything with addEventListener — the widest input `df$()` accepts. */ export declare const isTarget: (value: unknown) => value is EventTarget; /** * The document owning any context value (window, node, or the ambient * document). Throws when none is reachable, e.g. SSR without a context. */ export declare const documentOf: (value?: unknown) => Document; /** The Element subset of a selection; most mutators ignore non-elements. */ export declare const elements: (items: Iterable) => Element[]; /** Whitespace-split class/event token lists from string or array input. */ export declare const tokens: (input: string | readonly string[]) => string[]; /** * Write root for content: an element's shadow root, except custom elements * (hyphenated tags), whose slotted light DOM is morph's update surface. */ export declare const rootOf: (el: Element) => Element | ShadowRoot; /** * Create the structural adapter over an injected morph API. Capability * checks run at call time (`requireMorph`), so `df$` selection and ready * callbacks work before the morph engine has loaded. */ export declare function createDomAdapter(api: MorphApi): { create: (content: DomContent, context: QueryRoot, clone?: boolean) => Node[]; insert: (target: Node, content: DomContent, position?: Position, clone?: boolean) => Node[]; replace: (target: Node, content: DomContent, clone?: boolean) => Node[]; remove: (node: Node) => void; morph: (target: Element, content: RenderInput, options?: import("./types.js").MorphOptions) => void | Promise; text: (target: Node, value: string) => void; }; export type MorphDom = ReturnType; //# sourceMappingURL=dom.d.ts.map