import type { Buffers } from '../memory/index.js'; /** ShapeKind ordinals — SHARED across command Op / serialization DeltaOp / reactivity. */ export declare enum ShapeKind { Create = 0, Destroy = 1, Add = 2, Remove = 3, AddPair = 4, RemovePair = 5, SetPayload = 6 } /** A consumer scans only entries appended since its last read. One per Changed filter / observer. */ export interface LogPointer { readonly log: 'write' | 'shape'; /** Last ring slot (in WORDS) this consumer has read up to, exclusive. */ cursor: number; /** Ring generation observed at last read. */ generation: number; /** Spill entries (in WORDS) consumed so far. */ spillCursor: number; } /** Sentinel handed to a visit callback when the ring wrapped past a consumer's cursor. */ export declare const OVERFLOW_SENTINEL = -1; /** * One log ring. Generic over entry word-count (1 or 2 for write; 2 or 3 for shape — ). The ring * length is interpreted in WORDS; `entryWords` is the stride of one logical entry. */ export declare class LogRing { #private; readonly kind: 'write' | 'shape'; readonly entryWords: number; ring: Uint32Array; readonly header: Int32Array; /** Main-thread spill: a growable JS array, NOT ring-bounded. Drained after the ring. */ readonly spill: number[]; constructor(params: { buffers: Buffers; kind: 'write' | 'shape'; entryWords: number; capacityEntries: number; keyPrefix: string; shrinkRings: boolean; }); /** Current ring length in words (the capacity the rolling head wraps against). */ get ringWords(): number; /** Append one already-packed entry (1..3 words). Main thread only. Spills on overflow. */ push(words: readonly number[]): void; /** Append a raw word directly (the corral-merge fast path). Routes to ring or spill. */ pushWord(word: number): void; /** A fresh pointer positioned at the CURRENT head (a late subscriber sees only forward events). */ makePointer(): LogPointer; /**: does this consumer have anything new to read? */ hasUpdatesSince(ptr: LogPointer): boolean; /** *: visit each entry (as a contiguous word-window into ring or spill) appended since * `ptr`. `visit` receives the BASE offset and a source array. On a generation mismatch it receives * the OVERFLOW_SENTINEL once and the pointer is conservatively advanced. */ consume(ptr: LogPointer, visit: (source: Int32Array | Uint32Array | number[], base: number) => void, headLimit?: number): void; /**: record this frame's peak and schedule a next-frame resize if it spilled. */ observePeak(): void; /** * / `minConsumerCursor` is the smallest cursor over all consumers * (so the ring is not recycled past a lagging pointer); `minSpillCursor` is the smallest * spillCursor. Applies a pending resize first. */ frameReset(minConsumerCursor: number, minSpillCursor?: number): void; } /** * A per-worker write-log staging arena: a plain ArrayBuffer-backed Uint32Array the worker * pushes into with no atomics, grown by allocate-copy on its own thread. In single-thread mode there * is exactly one corral (the main "worker"); it is merged trivially every wave. */ export declare class WriteCorral { #private; count: number; constructor(initialEntries?: number); get data(): Uint32Array; /** O(1) push; grows by allocate-copy if full — never throws, never touches a shared ring. */ push(word: number): void; reset(): void; } export declare function nextPow2(n: number): number; //# sourceMappingURL=log.d.ts.map