Skip to content

Commit

Permalink
Fix new JSZip() and JSZip#loadAsync types
Browse files Browse the repository at this point in the history
* Constructor no longer takes arguments.
* `loadAsync()` can take a `Promise`.
  • Loading branch information
Peeja committed Feb 28, 2021
1 parent 112fcdb commit 2808e2e
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions index.d.ts
Expand Up @@ -56,7 +56,7 @@ interface OutputByType {
// compressedContent: string|ArrayBuffer|Uint8Array|Buffer;
// }

type InputFileFormat = InputByType[keyof InputByType];
type InputFileFormat = InputByType[keyof InputByType] | Promise<InputFileFormat>;

declare namespace JSZip {
type InputType = keyof InputByType;
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 2808e2e

Please sign in to comment.