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<string, string | string[] | number | boolean | undefined>;
export type HttpRequestHeaders = Record<string, string> & ((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<string | symbol, unknown>;
    context: Record<string, string>;
    readonly query: Record<string, string | string[]>;
    readonly path: string;
    readonly headers: HttpRequestHeaders;
    body?: Buffer;
    parsedBody?: unknown;
    uploadedFiles: UploadedFiles;
    pathParams: Record<string, string>;
    remoteAddress: string;
    socket: Pick<Socket, 'remoteAddress'>;
    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<string>;
    readBody(): Promise<Buffer>;
    readBodyBuffer(): Promise<Buffer>;
    get stream(): Readable;
    setBodyLimits(limits: Partial<HttpRequestBodyLimits>): 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