import { EventEmitter } from 'eventemitter3'; import type { Redis } from 'ioredis'; import { type Collection, type Db } from 'mongodb'; import { type QueueOptions } from 'prom-utils'; import type { ChangeOptions, ChangeStreamOptions, Events, JSONSchema, OperationType, ProcessChangeStreamRecords, ProcessInitialScanRecords, ScanOptions, State, SyncOptions } from './types.js'; /** * Get Redis keys used for the collection. */ export declare const getKeys: (collection: Collection, options: SyncOptions) => { scanCompletedKey: string; lastScanIdKey: string; changeStreamTokenKey: string; schemaKey: string; lastChangeProcessedAtKey: string; lastScanProcessedAtKey: string; resyncKey: string; }; export declare function initSync(redis: Redis, collection: Collection, options?: SyncOptions): { runInitialScan: (processRecords: ProcessInitialScanRecords, options?: QueueOptions & ScanOptions) => Promise<{ start: () => Promise; stop: () => Promise; restart: () => Promise; state: Pick<{ get: () => State; change: (newState: State) => void; waitForChange: (...newStates: State[]) => Promise; is: (...states: State[]) => boolean; canChange: (newState: State) => boolean; maybeChange: (newState: State) => boolean; getElapsedTime: () => number; }, "get" | "is">; }>; processChangeStream: (processRecords: ProcessChangeStreamRecords, options?: QueueOptions & ChangeStreamOptions) => Promise<{ start: () => Promise; stop: () => Promise; restart: () => Promise; state: Pick<{ get: () => State; change: (newState: State) => void; waitForChange: (...newStates: State[]) => Promise; is: (...states: State[]) => boolean; canChange: (newState: State) => boolean; maybeChange: (newState: State) => boolean; getElapsedTime: () => number; }, "get" | "is">; }>; reset: () => Promise; getCollectionSchema: (db: Db) => Promise; detectSchemaChange: (db: Db, options?: ChangeOptions) => Promise<{ start: () => void; stop: () => void; }>; detectResync: (resyncCheckInterval?: number) => { start: () => void; stop: () => void; }; keys: { scanCompletedKey: string; lastScanIdKey: string; changeStreamTokenKey: string; schemaKey: string; lastChangeProcessedAtKey: string; lastScanProcessedAtKey: string; resyncKey: string; }; emitter: EventEmitter; };