/** HTTP/1.1 over a relayed byte stream (docs/design/net.md ยง Client: service worker). */ export interface RequestHeadOptions { method: string; /** Origin-form request target: path plus query. */ path: string; /** `Host` header value โ€” the target's, never the gateway's. */ host: string; headers: Headers; /** Body length when known; omitted means no body. */ contentLength?: number; /** Cookies to present, already serialized as `a=1; b=2`. */ cookie?: string; /** The target's own origin (`http://host:port`), used for `Origin` and to * rebase `Referer`. Omit to send neither. */ origin?: string; /** The incoming `Referer`, rebased onto `origin` when both are present. */ referer?: string; } /** Serialize a request head. */ export declare function encodeRequestHead(options: RequestHeadOptions): Uint8Array; export interface ResponseHead { status: number; statusText: string; headers: Headers; /** Every `Set-Cookie` value, kept separate โ€” `Headers` folds duplicates and a folded cookie header is not recoverable. */ setCookie: string[]; /** How the body ends. */ framing: "length" | "chunked" | "eof" | "none"; contentLength: number; /** Bytes already read past the head, the start of the body. */ rest: Uint8Array; } /** Parse a response head out of `buffer`, or `null` when more bytes are needed. */ export declare function parseResponseHead(buffer: Uint8Array, method: string): ResponseHead | null; /** Decode a chunked body incrementally. */ export declare class ChunkedDecoder { private buffer; private remaining; private state; get done(): boolean; push(bytes: Uint8Array): Uint8Array[]; } export declare function concat(a: Uint8Array, b: Uint8Array): Uint8Array; /** Turn a stream of body bytes into a `ReadableStream`, respecting the head's framing. */ export declare function bodyStream(head: ResponseHead, prefix: Uint8Array, source: AsyncGenerator, /** Called once the body has ended, however it ended โ€” the hook that retires * the underlying socket instead of stranding it. */ onDone?: () => void): ReadableStream> | null; //# sourceMappingURL=http1.d.ts.map