From bb3258459618b7bff477218a193035b9d452bede Mon Sep 17 00:00:00 2001 From: Jeremy Mowery Date: Sun, 27 May 2018 16:11:28 -0700 Subject: [PATCH 1/2] Add stream.PassThrough as super interface in unzip The unzip entry interface actually extends stream.PassThrough as seen here: https://github.com/EvanOxfeld/node-unzip/blob/master/lib/entry.js#L8 --- types/unzip/index.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types/unzip/index.d.ts b/types/unzip/index.d.ts index 8971ff28df..877388ae5a 100644 --- a/types/unzip/index.d.ts +++ b/types/unzip/index.d.ts @@ -4,6 +4,8 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// +import stream = require('stream'); + export function Extract(options: { path: string }): NodeJS.WritableStream; export function Parse(): NodeJS.WritableStream; @@ -24,7 +26,7 @@ export function Parse(): NodeJS.WritableStream; * }); * ``` */ -export interface Entry { +export interface Entry extends stream.PassThrough { path: string; type: 'Directory' | 'File'; size: number; From 8e6c3ead4b1fb0917016d3f38c96f0f3030e491c Mon Sep 17 00:00:00 2001 From: Jeremy Mowery Date: Sun, 27 May 2018 16:57:41 -0700 Subject: [PATCH 2/2] Fix incorrect pipe interface Pipe is more general than the original typings imply. The original type appears to have been inferred, it does not exist as an override here: https://github.com/EvanOxfeld/node-unzip/blob/master/lib/entry.js --- types/unzip/index.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/types/unzip/index.d.ts b/types/unzip/index.d.ts index 877388ae5a..42bfacd973 100644 --- a/types/unzip/index.d.ts +++ b/types/unzip/index.d.ts @@ -30,6 +30,5 @@ export interface Entry extends stream.PassThrough { path: string; type: 'Directory' | 'File'; size: number; - pipe: (stream: NodeJS.WritableStream) => void; autodrain: () => void; }