import type { Socket } from 'node:net'; import { Readable } from 'node:stream'; import { type FormBodyLimits } from './form-body'; import type { UploadedFiles } from './uploads'; export type KnownHttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; export type HttpMethod = KnownHttpMethod | (string & {}); export type HttpHeaderInput = Record; export type HttpRequestHeaders = Record & ((headers: HttpHeaderInput) => HttpRequest); export interface MultipartRequestPart { name: string; value?: string | number | boolean; file?: Buffer | string; fileName?: string; contentType?: string; } export interface HttpRequestBodyLimits extends FormBodyLimits { maxBodyBytes: number; maxCompressedBodyBytes: number; } export interface HttpRequestBodyCapture { body: Buffer; totalBytes: number; } export declare const defaultHttpRequestBodyLimits: HttpRequestBodyLimits; export declare class HttpRequest extends Readable { readonly method: HttpMethod; readonly url: string; private readonly bodyStream?; readonly store: Record; context: Record; readonly query: Record; readonly path: string; readonly headers: HttpRequestHeaders; body?: Buffer; parsedBody?: unknown; uploadedFiles: UploadedFiles; pathParams: Record; remoteAddress: string; socket: Pick; trustProxyHeaders: boolean; bodyLimits: HttpRequestBodyLimits; private bodyRead?; private streamAttached; private streamEnded; private cachedBodyPushed; private bodyGuardBypass; private attachedStream?; private cachedBodyDecoded; private bodyCaptureLimit?; private bodyCaptureChunks; private bodyCaptureBytes; private bodyCaptureTotalBytes; constructor(method: HttpMethod, url: string, headers?: HttpHeaderInput, body?: Buffer | string | object, bodyStream?: Readable | undefined); static GET(url: string, headers?: HttpHeaderInput): HttpRequest; static POST(url: string, body?: Buffer | string | object, headers?: HttpHeaderInput): HttpRequest; static PUT(url: string, body?: Buffer | string | object, headers?: HttpHeaderInput): HttpRequest; static PATCH(url: string, body?: Buffer | string | object, headers?: HttpHeaderInput): HttpRequest; static DELETE(url: string, headers?: HttpHeaderInput): HttpRequest; static OPTIONS(url: string, headers?: HttpHeaderInput): HttpRequest; static HEAD(url: string, headers?: HttpHeaderInput): HttpRequest; build(): this; header(name: string, value: string | number | boolean): this; json(body: object): this; multiPart(parts: MultipartRequestPart[]): this; getRemoteAddress(): string; readBodyText(): Promise; readBody(): Promise; readBodyBuffer(): Promise; get stream(): Readable; setBodyLimits(limits: Partial): void; enableBodyGuardBypass(): void; enableBodyCapture(maxBytes: number): void; getBodyCapture(): HttpRequestBodyCapture | undefined; _read(): void; private attachReadable; private createBodyReadStream; } export declare class HttpRequestStream extends HttpRequest { } //# sourceMappingURL=request.d.ts.map