import { type SignalDoc } from './build-context.js'; import type { SignalScope } from './runtime.js'; import type { Renderable } from './element.js'; export interface SignalMount { /** apply a new state; only bindings whose deps changed re-run and commit. */ update(next: unknown): void; /** run teardowns (foreign unmount, subscriptions). */ dispose(): void; /** live agent-affordance variants (tagged-send handlers currently mounted). */ getDescriptors(): Array<{ variant: string; }>; } /** Where a `mountSignal` call attaches its built nodes. A `container` element * (the common case — append, or replace its children on hydration) OR an * `anchor` comment, for adapters like `@llui/vike` that mount a nested layer as * siblings of a slot anchor without owning the parent element. The owned region * is bracketed by the anchor and a synthesized end sentinel; `dispose()` removes * exactly that region (leaving the anchor + outer siblings intact). */ export type MountTarget = { container: Element; mode?: 'append' | 'replace'; } | { anchor: Comment; mode?: 'append' | 'replace'; }; /** * Mount a signal view: build the nodes (collecting bindings), attach them at the * target, and wire a chunked-mask reconciler over the collected bindings. * * For a `container` target, 'append' (fresh mount) leaves existing children and * 'replace' swaps server HTML out atomically (hydration). For an `anchor` target, * the nodes are inserted immediately after the anchor comment and bracketed by a * synthesized end sentinel — `dispose()` removes that bracketed region. * * `seedContexts` seeds the build's root context values (see `runBuild`); used by * adapters mounting a nested build whose providers live in a different pass. */ export declare function mountSignal(target: Element | MountTarget, initial: unknown, build: () => Renderable, modeOrSeed?: 'append' | 'replace' | ReadonlyMap, seedContexts?: ReadonlyMap, getState?: () => unknown): SignalMount; /** The shared build core: run the view build against `doc` and wire the scope — * WITHOUT attaching to any container or applying the initial state. The returned * `mount(state)` runs the binding commits (and the first structural reconcile, * which inserts `show`/`each` content and registers onMount work); callers MUST * insert `nodes` into the live document BEFORE calling `mount` so onMount focus / * portal / dismissable behavior sees attached nodes — except SSR, which mounts a * detached tree purely to bake initial values into the serialized HTML. */ export declare function renderSignalTree(doc: SignalDoc, build: () => Renderable, seedContexts?: ReadonlyMap, ssr?: boolean, getState?: () => unknown): { nodes: readonly Node[]; scope: SignalScope; mount: (state: unknown) => void; teardowns: Array<() => void>; mounts: Array<(root: Element) => void | (() => void)>; getDescriptors: () => Array<{ variant: string; }>; }; //# sourceMappingURL=mount.d.ts.map