From 308ec150ad5dcf3d2425e3bb7bb5477ffee1c7a8 Mon Sep 17 00:00:00 2001 From: Gerhard Stoebich <18708370+Flarna@users.noreply.github.com> Date: Tue, 15 Jan 2019 10:02:49 +0100 Subject: [PATCH] [node] add zlib.bytesWritten --- types/node/index.d.ts | 2 ++ types/node/node-tests.ts | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/types/node/index.d.ts b/types/node/index.d.ts index 417782b2f3..ffa98c32fb 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -1781,7 +1781,9 @@ declare module "zlib" { } interface Zlib { + /** @deprecated Use bytesWritten instead. */ readonly bytesRead: number; + readonly bytesWritten: number; close(callback?: () => void): void; flush(kind?: number | (() => void), callback?: () => void): void; } diff --git a/types/node/node-tests.ts b/types/node/node-tests.ts index f351ba8139..3a8622802a 100644 --- a/types/node/node-tests.ts +++ b/types/node/node-tests.ts @@ -4172,6 +4172,11 @@ import * as constants from 'constants'; const deflate = zlib.deflateSync('test'); const inflate = zlib.inflateSync(deflate.toString()); } + + { + const gzip = zlib.createGzip(); + const written: number = gzip.bytesWritten; + } } ///////////////////////////////////////////////////////////