/** * §5.8 shipped compression posture for the direct segment endpoint: * negotiate `Content-Encoding` from the request's `Accept-Encoding` * (zstd preferred, gzip fallback, identity when the client offers * neither), feature-detecting the runtime's codecs — zero dependencies. * * Segment bytes are stored and content-addressed UNCOMPRESSED (§5.1); * this is a per-response serving concern only. It is never applied to * stored objects or the signed-URL path (§5.8: presigned GETs serve the * addressed bytes verbatim; edge compression is a deployment concern). * * Decision data (2026-07-03, 100k-row bench table, Bun 1.3): rows * segments 6.2× in 8 ms (zstd) / 7.7× in 42 ms (gzip); sqlite images * 3.4× in 14 ms (zstd) / 51 ms (gzip); client decompression ≤ 8 ms. */ export type SegmentContentEncoding = 'zstd' | 'gzip'; export interface EncodedSegmentBody { readonly bytes: Uint8Array; /** Absent ⇒ identity (no `Content-Encoding` header). */ readonly contentEncoding?: SegmentContentEncoding; } /** * Compress a buffered segment body per §5.8. Returns the original bytes * (identity) when the client offered no supported encoding, the body is * tiny, or the runtime has no codec. */ export declare function encodeSegmentBody(bytes: Uint8Array, acceptEncoding: string | undefined): EncodedSegmentBody;