diff --git a/types/pump/index.d.ts b/types/pump/index.d.ts index 6e8cc7fc8e..456860fbf8 100644 --- a/types/pump/index.d.ts +++ b/types/pump/index.d.ts @@ -1,14 +1,14 @@ -// Type definitions for pump 1.0 +// Type definitions for pump 1.1 // Project: https://github.com/mafintosh/pump -// Definitions by: Tomek Łaziuk +// Definitions by: Tomek Łaziuk , Jason Cordial // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// -declare function pump(streams: pump.Stream[], callback?: pump.Callback): pump.Stream[]; +declare function pump(streams: pump.Stream[], callback?: pump.Callback): pump.Stream; // callback have to be passed as last argument -declare function pump(...streams: Array): pump.Stream[]; +declare function pump(...streams: Array): pump.Stream; declare namespace pump { type Callback = (err: Error) => any; diff --git a/types/pump/pump-tests.ts b/types/pump/pump-tests.ts index cf3393de21..77de4983e5 100644 --- a/types/pump/pump-tests.ts +++ b/types/pump/pump-tests.ts @@ -47,6 +47,8 @@ setTimeout(() => { throw new Error('timeout'); }, 5000); +// $ExpectType Stream pump(createReadStream('/dev/random'), toHex(), createWriteStream('/dev/null')); +// $ExpectType Stream pump([createReadStream('/dev/random'), toHex(), createWriteStream('/dev/null')]);