UNPKG

2.52 kBMarkdownView Raw
1# Installation
2> `npm install --save @types/gulp-plumber`
3
4# Summary
5This package contains type definitions for gulp-plumber (https://github.com/floatdrop/gulp-plumber).
6
7# Details
8Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/gulp-plumber.
9## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/gulp-plumber/index.d.ts)
10````ts
11// Type definitions for gulp-plumber
12// Project: https://github.com/floatdrop/gulp-plumber
13// Definitions by: Joe Skeen <https://github.com/joeskeen>
14// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
15
16/// <reference types="node" />
17
18/** Prevent pipe breaking caused by errors from gulp plugins */
19
20
21/** Prevent pipe breaking caused by errors from gulp plugins */
22interface GulpPlumber {
23 /**
24 * Returns Stream, that fixes pipe methods on Streams that are next in pipeline.
25 *
26 * @param options Sets options as described in the Options interface
27 */
28 (options?: Options): NodeJS.ReadWriteStream;
29 /**
30 * Returns Stream, that fixes pipe methods on Streams that are next in pipeline.
31 *
32 * @param errorHandler the function to be attached to the stream on('error')
33 */
34 (errorHandler: ErrorHandlerFunction): NodeJS.ReadWriteStream;
35 /** returns default behaviour for pipeline after it was piped */
36 stop(): NodeJS.ReadWriteStream;
37}
38
39interface Options {
40 /**
41 * Handle errors in underlying streams and output them to console. Default true.
42 * If function passed, it will be attached to stream on('error')
43 * If false passed, error handler will not be attached
44 * If undefined passed, default error handler will be attached
45 */
46 errorHandler?: ErrorHandlerFunction | boolean | undefined;
47 /** Monkeypatch pipe functions in underlying streams in pipeline. Default true. */
48 inherit?: boolean | undefined;
49}
50
51/** an error handler function to be attached to the stream on('error') */
52interface ErrorHandlerFunction {
53 /** an error handler function to be attached to the stream on('error') */
54 (error: any): void;
55}
56
57/** Prevent pipe breaking caused by errors from gulp plugins */
58declare var gulpPlumber: GulpPlumber;
59
60export = gulpPlumber;
61
62````
63
64### Additional Details
65 * Last updated: Wed, 10 May 2023 21:03:33 GMT
66 * Dependencies: [@types/node](https://npmjs.com/package/@types/node)
67 * Global values: none
68
69# Credits
70These definitions were written by [Joe Skeen](https://github.com/joeskeen).
71
\No newline at end of file