Skip to content

Commit

Permalink
Add missing TypeScript type for gzipSize.fileSync (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
bradtgmurray authored and sindresorhus committed May 21, 2019
1 parent a55e5bb commit 429b6f1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions index.d.ts
Expand Up @@ -84,6 +84,13 @@ declare const gzipSize: {
@returns The size of the file.
*/
file(path: string, options?: gzipSize.Options): Promise<number>;

/**
Synchronously get the gzipped size of a file.
@returns The size of the file.
*/
fileSync(path: string, options?: gzipSize.Options): number;
};

export = gzipSize;
2 changes: 2 additions & 0 deletions index.test-d.ts
Expand Up @@ -14,3 +14,5 @@ const gstream = fs
expectType<number | undefined>(gstream.gzipSize);
expectType<Promise<number>>(gzipSize.file('index.d.ts'));
expectType<Promise<number>>(gzipSize.file('index.d.ts', {chunkSize: 1}));
expectType<number>(gzipSize.fileSync('index.d.ts'));
expectType<number>(gzipSize.fileSync('index.d.ts', {chunkSize: 1}));

0 comments on commit 429b6f1

Please sign in to comment.