1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | import stream = require('stream');
|
14 |
|
15 | declare function through2(transform?: through2.TransformFunction, flush?: through2.FlushCallback): stream.Transform;
|
16 | declare function through2(opts?: stream.DuplexOptions, transform?: through2.TransformFunction, flush?: through2.FlushCallback): stream.Transform;
|
17 |
|
18 | declare namespace through2 {
|
19 | interface Through2Constructor extends stream.Transform {
|
20 | new (opts?: stream.DuplexOptions): stream.Transform;
|
21 | (opts?: stream.DuplexOptions): stream.Transform;
|
22 | }
|
23 |
|
24 | type TransformCallback = (err?: any, data?: any) => void;
|
25 | type TransformFunction = (this: stream.Transform, chunk: any, enc: BufferEncoding, callback: TransformCallback) => void;
|
26 | type FlushCallback = (this: stream.Transform, flushCallback: () => void) => void;
|
27 |
|
28 | |
29 |
|
30 |
|
31 | function obj(transform?: TransformFunction, flush?: FlushCallback): stream.Transform;
|
32 |
|
33 | |
34 |
|
35 |
|
36 |
|
37 | function ctor(transform?: TransformFunction, flush?: FlushCallback): Through2Constructor;
|
38 | function ctor(opts?: stream.DuplexOptions, transform?: TransformFunction, flush?: FlushCallback): Through2Constructor;
|
39 | }
|
40 |
|
41 | export = through2;
|