1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | import * as Koa from "koa";
|
14 | import * as zlib from "zlib";
|
15 |
|
16 |
|
17 |
|
18 |
|
19 | declare function koaCompress(options?: koaCompress.CompressOptions): Koa.Middleware;
|
20 |
|
21 | declare namespace koaCompress {
|
22 | export interface CompressOptions {
|
23 | |
24 |
|
25 |
|
26 | filter?: ((mimeType: string) => boolean) | undefined;
|
27 |
|
28 | /**
|
29 | * Minimum response size in bytes to compress. Default 1024 bytes or 1kb.
|
30 | */
|
31 | threshold?: number | string | undefined;
|
32 |
|
33 | /**
|
34 | * An optional string, which specifies what encoders to use for requests
|
35 | * without Accept-Encoding. Default: 'idenity'.
|
36 | */
|
37 | defaultEncoding?: string | undefined;
|
38 |
|
39 | /**
|
40 | * Options for brotli compression.
|
41 | */
|
42 | br?: zlib.BrotliOptions | false | undefined;
|
43 |
|
44 | /**
|
45 | * Options for gzip compression.
|
46 | */
|
47 | gzip?: zlib.ZlibOptions | false | undefined;
|
48 |
|
49 | /**
|
50 | * Options for deflate compression.
|
51 | */
|
52 | deflate?: zlib.ZlibOptions | false | undefined;
|
53 | }
|
54 | }
|
55 |
|
56 | export = koaCompress;
|
57 |
|
\ | No newline at end of file |