forked from fastify/fastify-compress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
27 lines (23 loc) · 793 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { Plugin, FastifyReply, FastifyRequest } from 'fastify'
import { Server, IncomingMessage, ServerResponse } from 'http'
import { Stream } from 'stream';
type EncodingToken = 'br' | 'deflate' | 'gzip' | 'identity'
declare namespace fastifyCompress {
interface FastifyCompressOptions {
global?: boolean
threshold?: number
customTypes?: RegExp
brotli?: NodeModule
zlib?: NodeModule
inflateIfDeflated?: boolean
onUnsupportedEncoding?: (encoding: string, request: FastifyRequest<ServerResponse>, reply: FastifyReply<ServerResponse>) => string | Buffer | Stream
encodings?: Array<EncodingToken>
}
}
declare const fastifyCompress: Plugin<
Server,
IncomingMessage,
ServerResponse,
fastifyCompress.FastifyCompressOptions
>
export = fastifyCompress