/** * File Watcher - Reactive File System Monitoring * * Monitors file system changes with: * - File and directory watching * - Change event callbacks (create, modify, delete, rename) * - Debouncing to prevent excessive events * - Multiple watcher management * - Integration with semantic indexing */ import { Stats } from 'fs'; import { EventEmitter } from 'events'; export type WatchEventType = 'create' | 'modify' | 'delete' | 'rename'; export interface WatchEvent { type: WatchEventType; path: string; filename: string; timestamp: number; stats?: Stats; } export interface WatchOptions { recursive?: boolean; persistent?: boolean; debounceMs?: number; ignored?: RegExp[]; includeStats?: boolean; } export type WatchCallback = (event: WatchEvent) => void | Promise; export declare class FileWatcher extends EventEmitter { private watchers; private debounceTimers; private callbacks; private lastEvents; /** * Start watching a file or directory */ watch(targetPath: string, callback: WatchCallback, options?: WatchOptions): Promise; /** * Stop watching a path */ unwatch(watchId: string): Promise; /** * Stop all watchers */ unwatchAll(): Promise; /** * Get list of active watchers */ getWatchers(): Array<{ id: string; path: string; }>; /** * Check if path is being watched */ isWatching(targetPath: string): boolean; /** * Handle watch event with debouncing */ private handleWatchEvent; /** * Process watch event after debouncing */ private processWatchEvent; /** * Generate unique watch ID from path */ private generateWatchId; /** * Extract path from watch ID */ private extractPathFromId; } export declare const fileWatcher: FileWatcher; //# sourceMappingURL=file-watcher.d.ts.map