From 2808e2ed5db93cc3338c829a0f8bff2d1e333d76 Mon Sep 17 00:00:00 2001 From: Petra Jaros Date: Sat, 27 Feb 2021 21:49:51 -0500 Subject: [PATCH] Fix `new JSZip()` and `JSZip#loadAsync` types * Constructor no longer takes arguments. * `loadAsync()` can take a `Promise`. --- index.d.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/index.d.ts b/index.d.ts index d3531b51..3458489e 100644 --- a/index.d.ts +++ b/index.d.ts @@ -56,7 +56,7 @@ interface OutputByType { // compressedContent: string|ArrayBuffer|Uint8Array|Buffer; // } -type InputFileFormat = InputByType[keyof InputByType]; +type InputFileFormat = InputByType[keyof InputByType] | Promise; declare namespace JSZip { type InputType = keyof InputByType; @@ -245,15 +245,7 @@ interface JSZip { /** * Create JSZip instance */ - - /** - * Create JSZip instance - * If no parameters given an empty zip archive will be created - * - * @param data Serialized zip archive - * @param options Description of the serialized zip archive - */ - new (data?: InputFileFormat, options?: JSZip.JSZipLoadOptions): this; + new(): this; (): JSZip;