UNPKG

864 BTypeScriptView Raw
1/// <reference types="node" />
2
3import * as File from "vinyl";
4import { SrcOptions } from "vinyl-fs";
5
6interface IOptions extends SrcOptions {
7 ignoreInitial?: boolean | undefined;
8 events?: string[] | undefined;
9 base?: string | undefined;
10 name?: string | undefined;
11 verbose?: boolean | undefined;
12 readDelay?: number | undefined;
13}
14
15interface IWatchStream extends NodeJS.ReadWriteStream {
16 add(path: string | string[]): NodeJS.ReadWriteStream;
17 unwatch(path: string | string[]): NodeJS.ReadWriteStream;
18 close(): NodeJS.ReadWriteStream;
19}
20
21type Cb = (file: File & { event: "add" | "change" | "unlink" }) => void;
22
23declare function watch(glob: string | string[], callback?: Cb): IWatchStream;
24declare function watch(glob: string | string[], options?: IOptions, callback?: Cb): IWatchStream;
25declare namespace watch {}
26export = watch;