/** * template/result.ts — Branded result objects produced by the template authoring APIs. * * Runtime code (factories, brand guards) lives here next to the template engine that * consumes it; pure binding-shape types live in `binding-types.ts`. All branding goes * through `utils/brand.ts` (`Symbol.for`) — see that module for why. */ import { type Signal } from '@vielzeug/ripple'; export type Ref = Signal; export declare function ref(): Ref; export type RefCallback = (el: T | null) => void; export type DirectiveResult = { mount: (anchor: Comment, registerCleanup: (fn: () => void) => void) => void; }; /** * Creates a registered DirectiveResult. All directive factories must use this * function — only objects created here pass `isDirectiveResult()`. */ export declare const createDirectiveResult: (mount: DirectiveResult["mount"]) => DirectiveResult; export declare const isDirectiveResult: (value: unknown) => value is DirectiveResult; /** * The output of an `html` tagged template call. * * Each `html` call produces an independent fragment — there is no shared mutable * state between instances, so the same template can be safely rendered multiple * times (e.g. inside `each()`). * * `mount()` is the entire public surface: insertion and reactive wiring in one * step, so the two can never get out of sync (the old public `fragment` + `apply` * pair made it possible to insert without wiring, or wire without inserting). */ export interface HTMLResult { /** * Insert the template's nodes before `anchor` (or append to `parent` when * `anchor` is null) and wire up all reactive effects. Returns the inserted * nodes so callers can remove them later. */ mount(parent: ParentNode, anchor: Node | null, registerCleanup: (fn: () => void) => void): Node[]; } export declare const isHtmlResult: (value: unknown) => value is CompiledHTMLResult; export declare function createHtmlResult(fragment: DocumentFragment, applyFn: (registerCleanup: (fn: () => void) => void) => void): CompiledHTMLResult; //# sourceMappingURL=result.d.ts.map