Skip to content

Commit 4f60849

Browse files
committed
feat(rust-plugins): add plugin options types
1 parent d827e41 commit 4f60849

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

rust-plugins/compress/options.d.ts

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,34 @@
11
export interface IPluginOptions {
2-
algorithm?: "gzip" | "brotli" | "deflateRaw";
2+
/**
3+
* Compression algorithm
4+
* @default brotli
5+
*/
6+
algorithm?: "gzip" | "brotli" | "deflateRaw" | "deflate";
7+
/**
8+
* Compression level
9+
* @default 6
10+
*/
11+
level?: number;
12+
/**
13+
* Compression threshold
14+
*
15+
* **NOTE**: This option is in bytes.
16+
*
17+
* @default 1024
18+
*/
19+
threshold?: number;
20+
/**
21+
* Compression filter
22+
*
23+
* **NOTE**: This option is a regular expression string, not a regular expression object.
24+
* Deserialization will cause a panic if use regex object. For example,
25+
*
26+
* @default '\\.(js|mjs|json|css|html)$'
27+
*/
328
filter?: string;
29+
/**
30+
* Delete original file
31+
* @default false
32+
*/
433
deleteOriginFile?: boolean;
534
}

0 commit comments

Comments
 (0)