import { type PathTable, type SparseMask } from './mask.js'; /** A binding-evaluation failure surfaced to a `setOnBindingError` hook. Shape * matches the agent's dispatch-envelope `drain.errors` entries. */ export interface BindingError { kind: string; key?: string; message: string; stack?: string; } /** Run `fn` with `handler` active for any binding throw it triggers. */ export declare function withBindingErrors(handler: ((e: BindingError) => void) | null, fn: () => void): void; /** The behavioral half of a binding: the accessor + the DOM write. The scope * holds these alongside a PARALLEL `masks` array (one {@link SparseMask} per * binding, lockstep by index) instead of wrapping each pair into a * `{ mask, produce, commit }` object — `each` builds one scope per ROW, so the * per-binding wrapper was an allocation per binding per row (2 extra objects * per jfb row, 20k on a create-10k). The caller's spec objects (compiler * `BindingSpec`s / `DirectRow.bindings`) are stored as-is. */ export interface SignalBinding { /** evaluate the compiled accessor expression against the current state */ produce(state: unknown): V; /** apply the produced value (DOM mutation) — called only when it changed */ commit(value: V): void; } export interface SignalScope { /** mount: run every binding once against the initial state */ mount(state: unknown): void; /** update: gate by dirty bits, commit only changed values, then propagate to * child scopes (mounted content of conditional/structural primitives). */ update(oldState: unknown, newState: unknown): void; /** register a child scope that should receive the same state updates (e.g. * `show`/`branch` content that reads the owning component's state). */ addChild(child: SignalScope): void; removeChild(child: SignalScope): void; } /** * Create a Phase-2 reconciler over a flat binding array gated by a chunked-mask * path table, plus a set of child scopes that receive propagated updates. * `masks` is lockstep with `bindings` (masks[i] gates bindings[i]) and is * typically a shared per-template array (the each-site ScopeShape memo). */ export declare function createSignalScope(table: PathTable, bindings: readonly SignalBinding[], masks: readonly SparseMask[]): SignalScope; //# sourceMappingURL=runtime.d.ts.map