export declare const DEFAULT_DEBOUNCE_MS = 150; export declare function debounce(fn: () => void | Promise, delayMs?: number): { trigger: () => void; cancel: () => void; }; export declare function isWatchRelevant(filename: string | Buffer | null | undefined): boolean; /** * Root the watcher at the project, not the entry's own directory: with the common * `src/main.ts` layout, tsconfig.json (whose JSX options change how sources transpile) * and `../` imports live one level up. Nearest package.json or tsconfig.json walking up * wins; entries with no project marker fall back to their own directory. */ export declare function watchRootFor(entryPath: string, stopDir?: string): string; /** * Watch a directory tree with one non-recursive `fs.watch` per directory, skipping * node_modules/dist/.git and never following symlinks. `fs.watch({recursive})` has no * exclusion API, so on a real project it would descend into node_modules — tens of * thousands of inotify watches. Whenever an event fires in a directory it is re-scanned, * which picks up newly created subdirectories. Returns a stop function. */ export declare function watchTree(root: string, onEvent: (filename: string | Buffer | null | undefined) => void): () => void; /** * Serialize an async job: while one run is in flight, triggers coalesce into exactly * one trailing rerun (verify/preview runs share one kernel — overlapping runs would * interleave output and reorder reports). */ export declare function createSerialRunner(run: (fresh: boolean) => Promise): { start: (fresh: boolean) => void; trigger: () => void; };