/** * Owns timers + unload hooks for the automatic snapshot cadence. Distinct from * the sync `SyncScheduler` (whose push/pull/dirty-count shape doesn't map to * snapshots) — it borrows only the policy vocabulary. Delegates the actual * snapshot work to `callbacks.fire()`. */ import type { SnapshotPolicy } from './policy.js'; export interface SnapshotSchedulerCallbacks { /** Fire one auto-snapshot cycle (per dirty vault). Swallows its own per-vault errors. */ fire(): Promise; /** Number of vaults with pending writes since the last fire. */ pendingCount(): number; } export declare class SnapshotScheduler { private readonly policy; private readonly callbacks; private debounceTimer; private intervalTimer; private lastFireTime; private firing; private started; private readonly boundVisibility; private readonly boundUnload; constructor(policy: SnapshotPolicy, callbacks: SnapshotSchedulerCallbacks); start(): void; stop(): void; notifyChange(): void; private resetDebounce; private execFire; private handleVisibility; private handleUnload; private flush; private shouldRegisterUnload; }