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