/// import { SimpleArrayRegistry } from "@gongt/ts-stl-library/pattern/simple-array-registry"; import { FSWatcher, WatchOptions } from "chokidar"; import { Stats } from 'fs'; export declare type Fn = (path: string) => void; export declare type FileEvents = 'add' | 'change' | 'unlink' | 'addDir' | 'unlinkDir' | 'error' | 'ready'; export declare type EventRegistry = Map; export declare class FileWatcher { protected pathList: SimpleArrayRegistry; protected ignoreList: SimpleArrayRegistry; protected opts: WatchOptions; protected originalIgnore: boolean; protected eventHandlers: EventRegistry; protected watcher: FSWatcher; private static FSWatcher; constructor(opts: WatchOptions); protected handleIgnore(path: string, stat?: Stats): boolean; protected restart(): void; isWatching(): boolean; startWatching(): void; protected updateOptions(): void; stopWatching(): void; protected _stopWatching(): void; /** @deprecated */ onChange(d: Fn): void; removeEventListener(event: FileEvents, fn: Fn): void; removeAllListeners(event: FileEvents): void; addEventListener(event: FileEvents, fn: Fn): void; private realAddListener(event, fn); watch(...paths: string[]): void; unwatch(...paths: string[]): void; ignore(...paths: RegExp[]): void; ignoreGlob(...globs: string[]): void; unignore(...paths: RegExp[]): void; unignoreGlob(...globs: string[]): void; }