import { Event } from '../../../base/common/event'; import { Disposable, DisposableStore } from '../../../base/common/lifecycle'; import { FileChangeType, IFileChange } from '../../../platform/files/common/files'; export interface IRecursiveWatcher { /** * A normalized file change event from the raw events * the watcher emits. */ readonly onDidChangeFile: Event; /** * An event to indicate a message that should get logged. */ readonly onDidLogMessage: Event; /** * An event to indicate an error occurred from the watcher * that is unrecoverable. Listeners should restart the * watcher if possible. */ readonly onDidError: Event; /** * Configures the watcher to watch according to the * requests. Any existing watched path that is not * in the array, will be removed from watching and * any new path will be added to watching. */ watch(requests: IWatchRequest[]): Promise; /** * Enable verbose logging in the watcher. */ setVerboseLogging(enabled: boolean): Promise; /** * Stop all watchers. */ stop(): Promise; } export declare abstract class AbstractRecursiveWatcherClient extends Disposable { private readonly onFileChanges; private readonly onLogMessage; private verboseLogging; private static readonly MAX_RESTARTS; private watcher; private readonly watcherDisposables; private requests; private restartCounter; constructor(onFileChanges: (changes: IDiskFileChange[]) => void, onLogMessage: (msg: ILogMessage) => void, verboseLogging: boolean); protected abstract createWatcher(disposables: DisposableStore): IRecursiveWatcher; protected init(): void; protected onError(error: string): void; private restart; watch(requests: IWatchRequest[]): Promise; setVerboseLogging(verboseLogging: boolean): Promise; private error; dispose(): void; } export interface IWatchRequest { /** * The path to watch. */ path: string; /** * A set of glob patterns or paths to exclude from watching. */ excludes: string[]; /** * @deprecated this only exists for WSL1 support and should never * be used in any other case. */ pollingInterval?: number; } export interface IDiskFileChange { type: FileChangeType; path: string; } export interface ILogMessage { type: 'trace' | 'warn' | 'error' | 'info' | 'debug'; message: string; } export declare function toFileChanges(changes: IDiskFileChange[]): IFileChange[]; export declare function coalesceEvents(changes: IDiskFileChange[]): IDiskFileChange[]; //# sourceMappingURL=watcher.d.ts.map