UNPKG

1.12 kBTypeScriptView Raw
1// Type definitions for gulp-watch v4.1.1
2// Project: https://github.com/floatdrop/gulp-watch
3// Definitions by: Tanguy Krotoff <https://github.com/tkrotoff>
4// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
6/// <reference types="node" />
7
8import * as File from "vinyl";
9import { SrcOptions } from "vinyl-fs";
10
11interface IOptions extends SrcOptions {
12 ignoreInitial?: boolean | undefined;
13 events?: Array<string> | undefined;
14 base?: string | undefined;
15 name?: string | undefined;
16 verbose?: boolean | undefined;
17 readDelay?: number | undefined;
18}
19
20interface IWatchStream extends NodeJS.ReadWriteStream {
21 add(path: string | Array<string>): NodeJS.ReadWriteStream;
22 unwatch(path: string | Array<string>): NodeJS.ReadWriteStream;
23 close(): NodeJS.ReadWriteStream;
24}
25
26type Cb = (file: File & { event: "add" | "change" | "unlink" }) => void;
27
28declare function watch(glob: string | Array<string>, callback?: Cb): IWatchStream;
29declare function watch(glob: string | Array<string>, options?: IOptions, callback?: Cb): IWatchStream;
30declare namespace watch { }
31export = watch;