diff --git a/index.d.ts b/index.d.ts index d3531b51..121ec2f6 100644 --- a/index.d.ts +++ b/index.d.ts @@ -96,7 +96,16 @@ declare namespace JSZip { * The last modification date, defaults to the current date. */ date?: Date; - compression?: string; + /** + * Sets per file compression. The `compressionOptions` parameter depends on the compression type. + */ + compression?: Compression; + /** + * Sets per file compression level. With `STORE` (no compression), this parameter is ignored. With `DEFLATE`, you can give the compression level with `compressionOptions : {level:6}` (or any level between 1 (best speed) and 9 (best compression)). + */ + compressionOptions?: null | { + level: number; + }; comment?: string; /** Set to `true` if (and only if) the input is a "binary string" and has already been prepared with a `0xFF` mask. */ optimizedBinaryString?: boolean; @@ -119,7 +128,13 @@ declare namespace JSZip { } interface JSZipGeneratorOptions { + /** + * Sets compression option for all entries that have not specified their own `compression` option + */ compression?: Compression; + /** + * The `compressionOptions` parameter depends on the compression type. With `STORE` (no compression), this parameter is ignored. With `DEFLATE`, you can give the compression level with `compressionOptions : {level:6}` (or any level between 1 (best speed) and 9 (best compression)). + */ compressionOptions?: null | { level: number; };