Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated compression typings for JSZipFileOptions and JSZipGeneratorOptions #722

Merged
merged 3 commits into from Apr 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 16 additions & 1 deletion index.d.ts
Expand Up @@ -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;
Expand All @@ -119,7 +128,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