From 429b6f1dfeeff017022dcecda159aede78bb340b Mon Sep 17 00:00:00 2001 From: Brad Murray Date: Tue, 21 May 2019 00:36:09 -0400 Subject: [PATCH] Add missing TypeScript type for `gzipSize.fileSync` (#19) --- index.d.ts | 7 +++++++ index.test-d.ts | 2 ++ 2 files changed, 9 insertions(+) diff --git a/index.d.ts b/index.d.ts index d93f7e6..79fba79 100644 --- a/index.d.ts +++ b/index.d.ts @@ -84,6 +84,13 @@ declare const gzipSize: { @returns The size of the file. */ file(path: string, options?: gzipSize.Options): Promise; + + /** + Synchronously get the gzipped size of a file. + + @returns The size of the file. + */ + fileSync(path: string, options?: gzipSize.Options): number; }; export = gzipSize; diff --git a/index.test-d.ts b/index.test-d.ts index f47f0bb..d39e066 100644 --- a/index.test-d.ts +++ b/index.test-d.ts @@ -14,3 +14,5 @@ const gstream = fs expectType(gstream.gzipSize); expectType>(gzipSize.file('index.d.ts')); expectType>(gzipSize.file('index.d.ts', {chunkSize: 1})); +expectType(gzipSize.fileSync('index.d.ts')); +expectType(gzipSize.fileSync('index.d.ts', {chunkSize: 1}));