/** * Opt-in request body compression. Wraps an outgoing body in a * `CompressionStream` so the wire payload is smaller and the server * sees the matching `Content-Encoding` header. * * `CompressionStream` is supported on Node 22+, Bun, Deno, and Baseline * 2024 browsers — but only for `gzip`, `deflate`, and `deflate-raw`. * `br` / `zstd` are not in the WHATWG Compression Streams spec; we * capability-test before encoding and refuse silently if a requested * format isn't available. */ export type CompressFormat = "gzip" | "deflate" | "deflate-raw"; /** * Resolve the user's `compressRequestBody` option to a concrete format, * or null if compression should be skipped. * * - `false` / `undefined`: skip. * - `true`: pick the first runtime-supported format, preferring `gzip`. * - A specific format string: only used when supported on this runtime. */ export declare function resolveCompressFormat(option: boolean | CompressFormat | undefined): CompressFormat | null; /** * Wrap a body source in a `CompressionStream`. Returns a tuple of the * compressed `ReadableStream` and the matching * `Content-Encoding` value the caller should set on the request. * * - `string` and `Uint8Array` bodies are encoded into a one-shot * ReadableStream then piped through. * - Existing `ReadableStream` bodies are piped through directly. * - `null` / `undefined` skips entirely (caller falls back to the * original empty body). */ export declare function compressBody(body: BodyInit | null | undefined, format: CompressFormat): { stream: ReadableStream; encoding: CompressFormat; } | null;