Skip to content

Commit 2808e2e

Browse files
authored
Fix new JSZip() and JSZip#loadAsync types
* Constructor no longer takes arguments. * `loadAsync()` can take a `Promise`.
1 parent 112fcdb commit 2808e2e

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

index.d.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ interface OutputByType {
5656
// compressedContent: string|ArrayBuffer|Uint8Array|Buffer;
5757
// }
5858

59-
type InputFileFormat = InputByType[keyof InputByType];
59+
type InputFileFormat = InputByType[keyof InputByType] | Promise<InputFileFormat>;
6060

6161
declare namespace JSZip {
6262
type InputType = keyof InputByType;
@@ -245,15 +245,7 @@ interface JSZip {
245245
/**
246246
* Create JSZip instance
247247
*/
248-
249-
/**
250-
* Create JSZip instance
251-
* If no parameters given an empty zip archive will be created
252-
*
253-
* @param data Serialized zip archive
254-
* @param options Description of the serialized zip archive
255-
*/
256-
new (data?: InputFileFormat, options?: JSZip.JSZipLoadOptions): this;
248+
new(): this;
257249

258250
(): JSZip;
259251

0 commit comments

Comments
 (0)