/** * `Range: bytes=...` parsing - the shared owner for every byte-range surface in the framework. * * This lives in core rather than in the middleware package because two unrelated layers need the * exact same answer: `@nifrajs/middleware`'s `rangeResponse` for caller-owned buffers, and * `@nifrajs/web`'s `public/` static handler for files on disk. A second implementation that happens * to agree today is how a media server ends up serving byte 0 of a seek request in one code path and * byte N in the other. * * The input is request-controlled on every call, so the parser is bounded before it is clever: a * capped header length and a capped specifier count keep a malformed range-set from turning a sort * and merge into an allocation amplifier. */ export interface ByteRange { readonly start: number; readonly end: number; } export type ByteRangeResult = { readonly kind: "none"; } | { readonly kind: "unsatisfiable"; } | { readonly kind: "satisfiable"; readonly ranges: readonly ByteRange[]; }; /** * Parse an HTTP `Range: bytes=...` header against a known representation size. * * Three outcomes, and the distinction matters to the caller's status code: `none` means the header * was absent or syntactically invalid and must be ignored (200), `unsatisfiable` means a well-formed * range-set selected nothing (416), `satisfiable` carries the coalesced ranges (206). */ export declare function parseByteRange(value: string | null, size: number): ByteRangeResult; //# sourceMappingURL=range.d.ts.map