import { Readable } from 'stream'; import { BodyOptions } from './body-protocol'; type BodyType = 'json' | 'text' | 'raw' | 'urlencoded'; /** `'100kb'` → 102400. */ export declare function parseBytes(value: number | string): number; /** * Reads the body of a request into `request.body`: JSON (`application/json`), text (`text/plain`), a Buffer * (`application/octet-stream`) or a form (`application/x-www-form-urlencoded`, nested with brackets). Other * requests get `{}`. Failures are {@link HttpError}s: 400 for a malformed body, 413 for a large one, 415 for * an unsupported charset or encoding. */ export declare class BodyParser { protected readonly options: BodyOptions; protected readonly limit: number; protected readonly inflate: boolean; protected readonly strict: boolean; protected readonly parameterLimit: number; protected readonly depth: number; constructor(options?: BodyOptions); parse(request: any, response?: any): Promise; /** * The body of the request as the client sent it (decompressed, at most `limit` bytes), whatever its content type, * without parsing it: for signatures computed over the raw bytes, as webhooks have. The request must not have been read. */ raw(request: any): Promise; protected contentType(header: string | undefined): { type: string; charset?: string; }; protected charset(type: BodyType, charset?: string): string; protected isKnownCharset(charset: string): boolean; protected convert(type: BodyType, body: Buffer, charset: string): unknown; protected decoder(request: Readable, encoding: string): Readable; /** The body, decompressed, at most `limit` bytes. */ protected read(request: Readable, headers: Record): Promise; } export {}; //# sourceMappingURL=body-parser.d.ts.map