UNPKG

2.37 kBTypeScriptView Raw
1declare module 'stream/promises' {
2 import { FinishedOptions, PipelineSource, PipelineTransform, PipelineDestination, PipelinePromise, PipelineOptions } from 'node:stream';
3 function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options?: FinishedOptions): Promise<void>;
4 function pipeline<A extends PipelineSource<any>, B extends PipelineDestination<A, any>>(source: A, destination: B, options?: PipelineOptions): PipelinePromise<B>;
5 function pipeline<A extends PipelineSource<any>, T1 extends PipelineTransform<A, any>, B extends PipelineDestination<T1, any>>(
6 source: A,
7 transform1: T1,
8 destination: B,
9 options?: PipelineOptions
10 ): PipelinePromise<B>;
11 function pipeline<A extends PipelineSource<any>, T1 extends PipelineTransform<A, any>, T2 extends PipelineTransform<T1, any>, B extends PipelineDestination<T2, any>>(
12 source: A,
13 transform1: T1,
14 transform2: T2,
15 destination: B,
16 options?: PipelineOptions
17 ): PipelinePromise<B>;
18 function pipeline<
19 A extends PipelineSource<any>,
20 T1 extends PipelineTransform<A, any>,
21 T2 extends PipelineTransform<T1, any>,
22 T3 extends PipelineTransform<T2, any>,
23 B extends PipelineDestination<T3, any>
24 >(source: A, transform1: T1, transform2: T2, transform3: T3, destination: B, options?: PipelineOptions): PipelinePromise<B>;
25 function pipeline<
26 A extends PipelineSource<any>,
27 T1 extends PipelineTransform<A, any>,
28 T2 extends PipelineTransform<T1, any>,
29 T3 extends PipelineTransform<T2, any>,
30 T4 extends PipelineTransform<T3, any>,
31 B extends PipelineDestination<T4, any>
32 >(source: A, transform1: T1, transform2: T2, transform3: T3, transform4: T4, destination: B, options?: PipelineOptions): PipelinePromise<B>;
33 function pipeline(streams: ReadonlyArray<NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream>, options?: PipelineOptions): Promise<void>;
34 function pipeline(
35 stream1: NodeJS.ReadableStream,
36 stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream,
37 ...streams: Array<NodeJS.ReadWriteStream | NodeJS.WritableStream | PipelineOptions>
38 ): Promise<void>;
39}
40declare module 'node:stream/promises' {
41 export * from 'stream/promises';
42}