/** * Shared HTTP compression helpers used by the framework adapters. Handles * `Accept-Encoding` negotiation and maps a chosen encoding to a ZipKit codec. */ /** HTTP content codings ZipKit can emit, best-ratio first. */ export type Encoding = 'br' | 'zstd' | 'gzip' | 'deflate'; /** Default server preference order (highest ratio first). */ export declare const DEFAULT_ENCODINGS: Encoding[]; export interface CompressionOptions { /** * Encodings the server is willing to emit, in preference order. The first * one the client also accepts wins. Defaults to `['br','zstd','gzip','deflate']`. */ encodings?: Encoding[]; /** Don't compress responses smaller than this many bytes. Default `1024`. */ threshold?: number; /** Compression level passed to the chosen codec. */ level?: number; } /** * Pick the best mutually-supported encoding from an `Accept-Encoding` header, * or `null` if none match (or the client sent `identity;q=0`-style refusals). */ export declare function negotiate(acceptEncoding: string | null | undefined, encodings?: Encoding[]): Encoding | null; /** Compress a response body for the negotiated `encoding`. */ export declare function compressBody(body: Uint8Array, encoding: Encoding, level?: number): Promise; /** Coerce common body shapes into bytes. */ export declare function toBytes(body: unknown): Uint8Array | null; //# sourceMappingURL=shared.d.ts.map