/// import { IncomingMessage, ServerResponse } from 'http'; import { HttpError } from 'http-errors'; import { WebApplication, FomexError } from './WebApplication'; import { WebResponse, ResponseBody } from './WebResponse'; import { WebRequest } from './WebRequest'; import { Context } from './Context'; import { CookieApi } from '../utils/cookie'; export declare type WebContextHelper = WebContext & Props; export declare class WebContext extends Context { readonly app: WebApplication; readonly request: WebRequest; readonly response: WebResponse; protected readonly req: IncomingMessage; protected readonly res: ServerResponse; protected _cookies?: CookieApi; constructor(app: WebApplication, request: WebRequest, response: WebResponse); throw(statusCode: number, msg?: string | Error): HttpError; throw(msg: string | Error): HttpError; send(body: ResponseBody): void; send(statusCode: number, body?: ResponseBody): void; get cookies(): CookieApi; onerror(err: FomexError | null): void; protected inspect(): { request: Record; response: Record; app: { subdomainOffset: number; proxy: boolean; env: string; }; originalUrl: string; req: string; res: string; socket: string; }; protected toJSON(): { request: Record; response: Record; app: { subdomainOffset: number; proxy: boolean; env: string; }; originalUrl: string; req: string; res: string; socket: string; }; }