/** * Per-client schema-fence watcher. Watches the fence via the injected * {@link CoordinationProvider}; on `draining` it drains in-flight writes * and reports presence (its ack); emits a same-instance signal on every * state transition (for UI). Driven by an interval in production and by * explicit `check()`/`beat()` in tests. * * The transport is the coordination port: the default * {@link StoreCoordinationProvider} maps `reportPresence` → * `_meta/schema-fence:client:` and `readFence` → `_meta/schema-fence`, * so behavior is byte-for-byte the same; `by-tabs` / `by-peer` swap in * real-time push transports. */ import { type FenceState } from './fence.js'; import type { CoordinationProvider } from '../../port/by/index.js'; export interface FenceWatcherEvent { readonly currentSchemaVersion: number; readonly fenceState: FenceState; } export declare class FenceWatcher { #private; constructor(opts: { coordination: CoordinationProvider; vault: string; clientId: string; sessionId?: string; onFlush: () => Promise; now?: () => number; emit?: (e: FenceWatcherEvent) => void; }); /** Publish liveness (and the current ack) without changing quiesce state. */ beat(): Promise; /** Poll the fence; quiesce on draining; emit on transitions. */ check(): Promise; start(intervalMs: number): void; stop(): void; }