/** * Low-level DOM utilities used throughout the runtime and binding layers. */ import { type Readable } from '@vielzeug/ripple'; /** * Resolves a value that may be a plain value, a getter function, or a reactive * signal — the one shared three-way branch used by `classMap`/`styleMap`/`bind()`. */ export declare const resolveMaybeReactive: (value: T | Readable | (() => T)) => T; /** * Characters that can break out of a CSS declaration in an inline style value or property name. * Semicolons end the current declaration; braces are meaningful in stylesheet rules but not * inline style values, and signal an injection attempt there. */ export declare const UNSAFE_CSS_CHARS: RegExp; export declare const sanitizeCssToken: (value: string) => string; export declare const runAll: (fns: (() => void)[]) => void; export declare const removeNodes: (nodes: Node[]) => void; /** * Tracks "whatever is currently rendered in one spot" — a list of live DOM nodes plus the * cleanup functions that were registered while mounting them. `clear()` tears both down and * resets to empty, ready for the next render. * * Every directive/binding that swaps its rendered content when a reactive source changes * (`when()`, `unsafeHtml()`, `each()`'s empty-list fallback, `applyHtmlBinding()`) needs exactly this * bookkeeping — this is the one shared implementation instead of four independently-maintained * `currentNodes`/`currentCleanups` variable pairs. */ export type ReplaceableSlot = { /** Tears down every registered cleanup and removes every tracked node, then resets to empty. */ clear(): void; /** Currently tracked nodes — read after mounting to know what's live. */ readonly nodes: Node[]; /** Pass as the `registerCleanup` callback to whatever mounts the next render. */ registerCleanup(fn: () => void): void; /** Replace the tracked node list (call once mounting the next render is complete). */ setNodes(nodes: Node[]): void; }; export declare const createReplaceableSlot: () => ReplaceableSlot; export declare const setAttr: (el: Element, name: string, val: unknown) => void; export declare const listen: (el: EventTarget | null | undefined, name: string, handler: EventListener, options?: AddEventListenerOptions) => (() => void); export declare const toKebab: (str: string) => string; export declare const isStructuredValue: (value: unknown) => value is object; //# sourceMappingURL=dom.d.ts.map