forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulp-plumber.d.ts
51 lines (44 loc) · 1.77 KB
/
gulp-plumber.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Type definitions for gulp-plumber
// Project: https://github.com/floatdrop/gulp-plumber
// Definitions by: Joe Skeen <http://github.com/joeskeen>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
/** Prevent pipe breaking caused by errors from gulp plugins */
declare module 'gulp-plumber' {
/** Prevent pipe breaking caused by errors from gulp plugins */
interface GulpPlumber {
/**
* Returns Stream, that fixes pipe methods on Streams that are next in pipeline.
*
* @param options Sets options as described in the Options interface
*/
(options?: Options): NodeJS.ReadWriteStream;
/**
* Returns Stream, that fixes pipe methods on Streams that are next in pipeline.
*
* @param errorHandler the function to be attached to the stream on('error')
*/
(errorHandler: ErrorHandlerFunction): NodeJS.ReadWriteStream;
/** returns default behaviour for pipeline after it was piped */
stop(): NodeJS.ReadWriteStream;
}
interface Options {
/**
* Handle errors in underlying streams and output them to console. Default true.
* If function passed, it will be attached to stream on('error')
* If false passed, error handler will not be attached
* If undefined passed, default error handler will be attached
*/
errorHandler?: ErrorHandlerFunction | boolean;
/** Monkeypatch pipe functions in underlying streams in pipeline. Default true. */
inherit?: boolean;
}
/** an error handler function to be attached to the stream on('error') */
interface ErrorHandlerFunction {
/** an error handler function to be attached to the stream on('error') */
(error: any): void;
}
/** Prevent pipe breaking caused by errors from gulp plugins */
var gulpPlumber: GulpPlumber;
export = gulpPlumber;
}