import { HttpController, HttpMediaType, HttpOperation } from '@opra/common'; import { ExecutionContext } from '@opra/core'; import type { HttpAdapter } from './http-adapter.js'; import { MultipartReader } from './impl/multipart-reader.js'; import type { HttpIncoming } from './interfaces/http-incoming.interface.js'; import type { HttpOutgoing } from './interfaces/http-outgoing.interface.js'; export declare class HttpContext extends ExecutionContext { protected _body?: any; protected _multipartReader?: MultipartReader; readonly __contDef: HttpController; readonly __oprDef: HttpOperation; readonly __controller: any; readonly __handler?: Function; readonly __adapter: HttpAdapter; readonly request: HttpIncoming; readonly response: HttpOutgoing; readonly mediaType?: HttpMediaType; readonly cookies: Record; readonly headers: Record; readonly pathParams: Record; readonly queryParams: Record; errors: Error[]; constructor(init: HttpContext.Initiator); /** * Checks if the request is a multipart request. */ get isMultipart(): boolean; /** * Retrieves the multipart reader for the current context. * * @returns A promise that resolves to the multipart reader. * @throws {@link InternalServerError} If the request content is not multipart. * @throws {@link NotAcceptableError} If the endpoint does not accept multipart requests. */ getMultipartReader(): Promise; /** * Retrieves and parses the request body. * * @param args - Optional arguments for body retrieval. * @param args.toFile - Whether to save the body to a file. * @returns A promise that resolves to the parsed body. * @throws {@link BadRequestError} If the body cannot be parsed or validated. */ getBody(args?: { toFile: boolean | string; }): Promise; } export declare namespace HttpContext { interface Initiator extends Omit { __adapter: HttpAdapter; __contDef?: HttpController; __oprDef?: HttpOperation; __controller?: any; __handler?: Function; request: HttpIncoming; response: HttpOutgoing; cookies?: Record; headers?: Record; pathParams?: Record; queryParams?: Record; mediaType?: HttpMediaType; body?: any; } }