Skip to content

Commit 2e1e970

Browse files
authored
Merge pull request #722 from KyleJonesWinsted/master
Update compression typings for JSZipFileOptions and JSZipGeneratorOptions
2 parents 121eec0 + c3f10e7 commit 2e1e970

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

index.d.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,16 @@ declare namespace JSZip {
101101
* The last modification date, defaults to the current date.
102102
*/
103103
date?: Date;
104-
compression?: string;
104+
/**
105+
* Sets per file compression. The `compressionOptions` parameter depends on the compression type.
106+
*/
107+
compression?: Compression;
108+
/**
109+
* 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)).
110+
*/
111+
compressionOptions?: null | {
112+
level: number;
113+
};
105114
comment?: string;
106115
/** Set to `true` if (and only if) the input is a "binary string" and has already been prepared with a `0xFF` mask. */
107116
optimizedBinaryString?: boolean;
@@ -124,7 +133,13 @@ declare namespace JSZip {
124133
}
125134

126135
interface JSZipGeneratorOptions<T extends OutputType = OutputType> {
136+
/**
137+
* Sets compression option for all entries that have not specified their own `compression` option
138+
*/
127139
compression?: Compression;
140+
/**
141+
* 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)).
142+
*/
128143
compressionOptions?: null | {
129144
level: number;
130145
};

0 commit comments

Comments
 (0)