forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulp-if.d.ts
64 lines (58 loc) · 3.17 KB
/
gulp-if.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
52
53
54
55
56
57
58
59
60
61
62
63
64
// Type definitions for gulp-if
// Project: https://github.com/robrich/gulp-if
// Definitions by: Asana <https://asana.com>, Joe Skeen <http://github.com/joeskeen>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts"/>
/// <reference path="../vinyl/vinyl.d.ts"/>
declare module 'gulp-if' {
import fs = require('fs');
import vinyl = require('vinyl');
interface GulpIf {
/**
* gulp-if will pipe data to stream whenever condition is truthy.
* If condition is falsey and elseStream is passed, data will pipe to elseStream
* After data is piped to stream or elseStream or neither, data is piped down-stream.
*
* @param condition whether input should be piped to stream
* @param stream the stream to pipe to if condition is true
* @param elseStream (optional) the stream to pipe to if condition is false
*/
(condition: boolean, stream: NodeJS.ReadWriteStream, elseStream?: NodeJS.ReadWriteStream): NodeJS.ReadWriteStream;
/**
* gulp-if will pipe data to stream whenever condition is truthy.
* If condition is falsey and elseStream is passed, data will pipe to elseStream
* After data is piped to stream or elseStream or neither, data is piped down-stream.
*
* @param condition a Node Stat filter condition to be executed on the vinyl file's Stats object
* @param stream the stream to pipe to if condition is true
* @param elseStream (optional) the stream to pipe to if condition is false
*/
(condition: StatFilterCondition, stream: NodeJS.ReadWriteStream, elseStream?: NodeJS.ReadWriteStream): NodeJS.ReadWriteStream;
/**
* gulp-if will pipe data to stream whenever condition is truthy.
* If condition is falsey and elseStream is passed, data will pipe to elseStream
* After data is piped to stream or elseStream or neither, data is piped down-stream.
*
* @param condition a function taking a vinyl file and returning a boolean
* @param stream the stream to pipe to if condition is true
* @param elseStream (optional) the stream to pipe to if condition is false
*/
(condition: (fs: vinyl) => boolean, stream: NodeJS.ReadWriteStream, elseStream?: NodeJS.ReadWriteStream): NodeJS.ReadWriteStream;
/**
* gulp-if will pipe data to stream whenever condition is truthy.
* If condition is falsey and elseStream is passed, data will pipe to elseStream
* After data is piped to stream or elseStream or neither, data is piped down-stream.
*
* @param condition a RegularExpression that works on the file.path
* @param stream the stream to pipe to if condition is true
* @param elseStream (optional) the stream to pipe to if condition is false
*/
(condition: RegExp, stream: NodeJS.ReadWriteStream, elseStream?: NodeJS.ReadWriteStream): NodeJS.ReadWriteStream;
}
interface StatFilterCondition {
isDirectory?: boolean;
isFile?: boolean;
}
var gulpIf: GulpIf;
export = gulpIf;
}