/** Dirty bits, one Uint32 per 32 tracked paths. */ export type Chunks = Uint32Array; /** One leaf under a root: its bit index plus the pre-split segments BELOW the * root (empty for a path that IS its own root, e.g. `'item'` or `''`). */ type RootEntry = readonly [bit: number, suffixSegs: readonly string[]]; /** Paths grouped by their top-level segment. If the value at a root is * reference-unchanged between two states, EVERY leaf under it is clean — so the * dirty computation can dismiss the whole subtree with a single `Object.is`, * and never touches its descendants. Sound under TEA's immutable updates + * structural sharing (same ref ⇒ identical descendants). */ interface RootGroup { /** segments to resolve the root value (`[]` = whole state). */ readonly rootSegs: readonly string[]; readonly entries: readonly RootEntry[]; } export interface PathTable { /** bit index -> path */ paths: string[]; /** path -> bit index */ index: Map; /** number of 32-bit chunks needed */ chunkCount: number; /** paths grouped by top-level root, for subtree short-circuiting */ roots: readonly RootGroup[]; } /** Build a path→bit table from the union of a component's dependency paths. */ export declare function buildPathTable(paths: Iterable): PathTable; /** Resolve a dotted path against a state value. Undefined-safe; `''` = whole. */ export declare function resolvePath(state: unknown, path: string): unknown; /** Resolve a value from PRE-SPLIT path segments — no per-call `String.split`. * Used by path-rooted signal handles, which split their base path once at * creation and then read through this on every binding evaluation. */ export declare function resolveSegments(value: unknown, segs: readonly string[]): unknown; /** * Compute the dirty chunk-set: bit `i` is set iff the value at `paths[i]` * differs between `oldS` and `newS` by `Object.is`. Short-circuits when the * whole state reference is unchanged, AND — per root group — when a top-level * subtree's reference is unchanged (so an unchanged subtree's leaves are never * resolved; this is the per-row fast path that keeps `each` updates O(changed * rows) rather than O(all rows × paths)). */ export declare function computeDirty(table: PathTable, oldS: unknown, newS: unknown): Chunks; /** * Allocation-free variant: zero `out` (caller-owned, length `table.chunkCount`) * and fill it with the dirty chunk-set, returning whether ANY bit was set. A * scope owns one buffer and reuses it across updates, so a hot `each` reconcile * doing N row updates per tick allocates zero dirty masks instead of N. */ export declare function computeDirtyInto(table: PathTable, oldS: unknown, newS: unknown, out: Chunks): boolean; /** Whether any dirty bit is set — lets a scope skip its binding loop entirely. */ export declare function anyDirty(chunks: Chunks): boolean; /** A binding's dependency mask: only the chunks it actually touches. Most * bindings touch one chunk, so this stays ~constant regardless of total paths. */ export type SparseMask = ReadonlyArray; /** Build a binding's sparse mask from its dependency paths. */ export declare function bindingMask(depPaths: Iterable, table: PathTable): SparseMask; /** Gate: does the binding depend on any currently-dirty bit? */ export declare function intersects(mask: SparseMask, dirty: Chunks): boolean; export {}; //# sourceMappingURL=mask.d.ts.map