UNPKG

watch-file-safe

Version:
13 lines (12 loc) 432 B
export declare type EventCallback = (path: string) => void; export declare type Watcher = { onAdd: (cb: EventCallback) => Watcher; onRemove: (cb: EventCallback) => Watcher; onChange: (cb: EventCallback) => Watcher; onReady: (cb: () => void) => Watcher; /** * Return `true` on success, `false` on errors. */ stop: () => Promise<boolean>; }; export default function watchFile(path: string): Watcher;