import type { SerializedHttpRequest, SerializedHttpResponse, SerializedHttpResponseChunk, SerializedHttpRequestChunk } from "./http.js"; /** * Encode an HTTP request into binary format: * [requestIdLen:2][requestId:N][methodLen:1][method:N][pathLen:2][path:N] * [headerCount:2][for each header: keyLen:2, key:N, valLen:2, val:N] * [bodyLen:4][body:N] */ export declare function encodeHttpRequest(req: SerializedHttpRequest): Uint8Array; /** * Decode binary data into a SerializedHttpRequest. */ export declare function decodeHttpRequest(data: Uint8Array): SerializedHttpRequest; /** * Encode an HTTP response into binary format: * [requestIdLen:2][requestId:N][statusCode:2] * [headerCount:2][for each header: keyLen:2, key:N, valLen:2, val:N] * [bodyLen:4][body:N] */ export declare function encodeHttpResponse(resp: SerializedHttpResponse): Uint8Array; /** * Encode every HTTP response field before the body bytes, using the supplied * body length. Streaming callers hash this prefix and then append body chunks. */ export declare function encodeHttpResponsePrefix(resp: Omit, bodyLength: number): Uint8Array; /** * Decode binary data into a SerializedHttpResponse. */ export declare function decodeHttpResponse(data: Uint8Array): SerializedHttpResponse; /** * Encode an HTTP response chunk into binary format: * [requestIdLen:2][requestId:N][done:1][dataLen:4][data:N] */ export declare function encodeHttpResponseChunk(chunk: SerializedHttpResponseChunk): Uint8Array; /** * Decode binary data into a SerializedHttpResponseChunk. */ export declare function decodeHttpResponseChunk(data: Uint8Array): SerializedHttpResponseChunk; /** * Encode an HTTP request chunk into binary format: * [requestIdLen:2][requestId:N][done:1][dataLen:4][data:N] */ export declare function encodeHttpRequestChunk(chunk: SerializedHttpRequestChunk): Uint8Array; /** * Decode binary data into a SerializedHttpRequestChunk. */ export declare function decodeHttpRequestChunk(data: Uint8Array): SerializedHttpRequestChunk; //# sourceMappingURL=request-codec.d.ts.map