import { type WatcherBackend } from './watcher-backend.js'; export interface SettledChange { path: string; event: 'add' | 'change' | 'unlink'; } /** * Default delay for settled processing (ms). */ export declare const DEFAULT_SETTLE_DELAY = 1500; /** * Opaque watcher handle returned by startWatcher(). * Consumers cannot access backend-specific methods. */ export interface LimpsWatcher { readonly __brand: 'LimpsWatcher'; } /** * Start a file watcher for specified file types. * * @param watchPaths - Path(s) to watch (file or directory, single or array) * @param onChange - Callback when file changes (path, event) * @param fileExtensions - File extensions to watch (e.g., ['.md', '.jsx', '.tsx']) * @param ignorePatterns - Patterns to ignore (e.g., ['.git', 'node_modules']) * @param debounceDelay - Debounce delay in milliseconds (default: 200ms) * @param settleDelay - Settle delay in milliseconds (default: 1500ms) * @param onSettled - Callback for settled changes * @param maxDepth - Maximum directory recursion depth (default: DEFAULT_MAX_DEPTH) * @param backend - Optional WatcherBackend for dependency injection (tests) * @returns Promise resolving to a LimpsWatcher handle */ export declare function startWatcher(watchPaths: string | string[], onChange: (path: string, event: 'add' | 'change' | 'unlink') => Promise, fileExtensions?: string[], ignorePatterns?: string[], debounceDelay?: number, settleDelay?: number, onSettled?: (changes: SettledChange[]) => Promise, maxDepth?: number, backend?: WatcherBackend): Promise; /** * Stop a file watcher and clear all pending debounce/settle timers. * * Clearing timers is critical: without it, pending setTimeout callbacks fire * after the watcher (and often the DB) are already closed, causing crashes * and orphaned file descriptors. * * @param watcher - LimpsWatcher handle from startWatcher() */ export declare function stopWatcher(watcher: LimpsWatcher): Promise; //# sourceMappingURL=watcher.d.ts.map