diff --git a/index.d.ts b/index.d.ts index 2b6f50e..9b38a35 100644 --- a/index.d.ts +++ b/index.d.ts @@ -182,6 +182,12 @@ declare class Transform< constructor(opts?: TransformOptions) } +type Pipeline = [ + src: Readable, + ...transforms: Duplex[], + dest: S +] + declare namespace Stream { export { Stream, @@ -192,13 +198,16 @@ declare namespace Stream { Transform as PassThrough } - export function pipeline(streams: Stream[], done?: StreamCallback): Stream + export function pipeline( + streams: Pipeline, + cb?: StreamCallback + ): S - export function pipeline( - ...args: [stream: Stream, ...streams: Stream[], done: StreamCallback] - ): Stream + export function pipeline(...args: [...Pipeline]): S - export function pipeline(stream: Stream, ...streams: Stream[]): Stream + export function pipeline( + ...args: [...Pipeline, cb: StreamCallback] + ): S export function finished( stream: Stream,