Skip to content

Commit

Permalink
Merge pull request #722 from KyleJonesWinsted/master
Browse files Browse the repository at this point in the history
Update compression typings for JSZipFileOptions and JSZipGeneratorOptions
  • Loading branch information
Stuk committed Apr 4, 2022
2 parents 121eec0 + c3f10e7 commit 2e1e970
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion index.d.ts
Expand Up @@ -101,7 +101,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;
Expand All @@ -124,7 +133,13 @@ declare namespace JSZip {
}

interface JSZipGeneratorOptions<T extends OutputType = OutputType> {
/**
* 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;
};
Expand Down

0 comments on commit 2e1e970

Please sign in to comment.