import type { WatchEventSource } from "./watch-engine.ts";
export interface RecursiveWatchWorker {
    on(event: "message", listener: (message: unknown) => void): this;
    on(event: "error", listener: (error: Error) => void): this;
    postMessage(message: unknown): void;
    unref?(): void;
    terminate(): Promise<number>;
}
export type RecursiveWatchWorkerFactory = () => RecursiveWatchWorker;
export type FsWatchEventSourceOptions = {
    readonly platform?: NodeJS.Platform;
    readonly createRecursiveWorker?: RecursiveWatchWorkerFactory;
};
/**
 * Test seam: drops every shared worker registry. Termination is best-effort — a
 * worker that already failed to terminate must not keep a teardown sequence from
 * resetting the table. Returns the termination promises for callers that care.
 */
export declare function resetFsWatchWorkersForTests(): Array<Promise<number>>;
/** Production event source. Watch setup and teardown run off the interactive main thread. */
export declare function createFsWatchEventSource(onError?: (error: unknown, path: string) => void, options?: FsWatchEventSourceOptions): WatchEventSource;
//# sourceMappingURL=watch-event-source.d.ts.map