import { IncomingMessage, ServerResponse } from 'http'; import { ZlibOptions } from 'zlib'; export declare function isCompressible(contentType: string): boolean; /** * Picks the best encoding of `available` for the given Accept-Encoding header. * On equal quality, encodings in `preferred` win (in their order), otherwise the order of the header. */ export declare function negotiateEncoding(header: string, available: string[], preferred: string[]): string | undefined; export interface CompressionOptions extends ZlibOptions { /** * Responses smaller than this (in bytes, if known) are not compressed. * * @default 1024 */ threshold?: number; } /** * Compresses the response with br, gzip, or deflate (negotiated via Accept-Encoding), if * - the Content-Type is compressible * - it has no `Cache-Control: no-transform` * - it's larger than threshold (if the size is known) * - it's not already encoded (Content-Encoding) * - it's not a HEAD request or a 204/304 response * * Adds `Vary: Accept-Encoding` to compressible responses. * * Must be called before anything is written to the response. * `options` are passed to zlib's gzip/deflate, brotli uses quality 4. */ export declare function compressResponse(request: IncomingMessage, response: ServerResponse, options?: CompressionOptions): void; export declare type __ΩCompressionOptions = any[];