/** * Dirty-key tracker: subscribe to Redis keyspace notifications and record * modified/deleted keys in the migration registry (SPEC_F §F.6). * * Programmatic API: * const tracker = await startDirtyTracker({ from, to, runId }); * // ... run bulk import and other Redis writes ... * await tracker.stop(); */ /** Reported for each tracked keyspace event. */ export interface DirtyTrackerProgress { runId: string; key: string; event: string; totalEvents: number; at: string; } export interface DirtyTrackerOptions { /** Source Redis URL. Default `'redis://127.0.0.1:6379'`. */ from?: string; /** SQLite DB path (must already exist or be created by bulk). */ to: string; /** Migration run identifier. */ runId: string; /** PRAGMA preset. Default `'default'`. */ pragmaTemplate?: string; /** CONFIG command name (in case it was renamed). Default `'CONFIG'`. */ configCommand?: string; /** Called for each tracked keyspace event. */ onProgress?: (progress: DirtyTrackerProgress) => void | Promise; } export interface DirtyTracker { /** Unsubscribe and disconnect. Safe to call multiple times. */ stop(): Promise; } /** * Start the dirty-key tracker: connect a subscriber client and record every * keyspace event into the migration registry. * * Resolves once the subscription is active. Call `stop()` to disconnect. * * @throws {Error} If keyspace notifications are not enabled on Redis. */ export declare function startDirtyTracker({ from, to, runId, pragmaTemplate, configCommand, onProgress, }?: DirtyTrackerOptions): Promise;