/** * Single-flight, debounced batcher between the filesystem watcher and the indexer. * * Watcher events arrive in bursts (editors write temp+rename, Dropbox syncs whole * directories). The scheduler coalesces a burst into one batch of unique paths and * guarantees the runner is never invoked concurrently with itself: events that land * while a run is in flight are queued and processed in one follow-up run. */ export interface IndexScheduler { /** Queue a path for (re)indexing. Duplicate paths within a batch collapse. */ schedule(relativePath: string): void; /** Resolves once no run is in flight, no timer is armed, and nothing is queued. */ idle(): Promise; /** Cancels pending work and waits for any in-flight run to finish. */ close(): Promise; } export declare function createIndexScheduler(run: (paths: string[]) => Promise, debounceMs?: number): IndexScheduler;