/** * Filesystem Watcher * * Monitors a directory tree for changes using Bun's fs.watch. * Debounces rapid events and filters ignored paths. * Emits FileChangeEvents to a callback. */ import type { FileChangeEvent } from '../vcs/types.js'; export interface FileWatcherConfig { rootPath: string; ignorePatterns: string[]; debounceMs: number; onEvent: (event: FileChangeEvent) => void | Promise; } export interface ScanProgress { phase: 'discovering' | 'hashing' | 'done'; current: number; total: number; message: string; } export declare class FileWatcher { private config; private watchers; private debounceTimers; private knownFiles; private running; constructor(config: FileWatcherConfig); /** * Scans the directory tree and builds an initial map of all tracked files. * Returns the list of FileChangeEvents for the initial state (all adds). */ scan(opts?: { onProgress?: (progress: ScanProgress) => void; }): Promise; /** * Starts watching the directory tree for changes. */ start(): void; /** * Stops all watchers. */ stop(): void; /** * Returns the current known file map (path → contentHash). */ getKnownFiles(): Map; private debouncedHandle; private handleChange; private walkDir; } //# sourceMappingURL=fs-watcher.d.ts.map