@pkerschbaum/code-oss-file-service
Version:
VS Code ([microsoft/vscode](https://github.com/microsoft/vscode)) includes a rich "`FileService`" and "`DiskFileSystemProvider`" abstraction built on top of Node.js core modules (`fs`, `path`) and Electron's `shell` module. This package allows to use that
11 lines • 833 B
TypeScript
import { CancellationToken } from '../../base/common/cancellation';
import { IDisposable } from '../../base/common/lifecycle';
export declare function watchFile(path: string, onChange: (type: 'added' | 'changed' | 'deleted', path: string) => void, onError: (error: string) => void): IDisposable;
export declare function watchFolder(path: string, onChange: (type: 'added' | 'changed' | 'deleted', path: string) => void, onError: (error: string) => void): IDisposable;
export declare const CHANGE_BUFFER_DELAY = 100;
/**
* Watch the provided `path` for changes and return
* the data in chunks of `Uint8Array` for further use.
*/
export declare function watchFileContents(path: string, onData: (chunk: Uint8Array) => void, token: CancellationToken, bufferSize?: number): Promise<void>;
//# sourceMappingURL=watcher.d.ts.map