import type { JsonValue } from "../json.js"; export interface ParsedRequest { method: string; /** The `?op=` query action for the byte paths (`download` / `upload` / `proxy`). */ action: string | null; /** Origin derived from the request URL, used as the default CSRF allowlist. */ requestOrigin: string; /** The request URL's path — the endpoint an upload token is bound to. */ path: string; query: URLSearchParams; origin: string | null; rangeHeader: string | null; /** The `If-Range` validator guarding `rangeHeader`, if any. */ ifRangeHeader: string | null; /** Parsed JSON body for a POST action; `undefined` otherwise. */ json: JsonValue | undefined; /** Raw body stream for a byte-path PUT; `null` otherwise. */ bodyStream: ReadableStream | null; contentType: string | null; contentLength: number | undefined; signal: AbortSignal; } export type ResultModel = { kind: "json"; status: number; body: unknown; headers?: Record; } | { kind: "redirect"; status: number; location: string; } | { kind: "stream"; status: number; headers: Record; /** `null` answers a `HEAD`: the headers the `GET` would send, no body. */ stream: ReadableStream | null; }; /** Default cap on a JSON request body (1 MiB). */ export declare const DEFAULT_MAX_JSON_BODY_SIZE: number; export declare const parseRequest: (req: Request, maxJsonBodySize?: number) => Promise; export declare const buildResponse: (model: ResultModel) => Response; //# sourceMappingURL=web.d.ts.map