/// /// /// import { Server } from 'node:http'; import * as internal from 'node:stream'; import { HttpRequestHeaders, HttpRequestQuery, IHttpContext, IHttpCookies } from './context.js'; import { IHttpError, IHttpResponse } from './response.js'; export type HttpKoaMiddlewareCallback = (ctx: any, next: any) => Promise | any; export interface IHttpKoa { listen(...args: any): Server; use(fn: HttpKoaMiddlewareCallback): IHttpKoa; } export declare class HttpKoa { protected app: IHttpKoa; constructor(app: IHttpKoa); use(fn: HttpKoaMiddlewareCallback): IHttpKoa; handler(fn: any): void; listen(...args: any): Server; } export declare class HttpKoaContext implements IHttpContext { protected ctx: any; static defaultAbortMessage: string; query: HttpRequestQuery; headers: HttpRequestHeaders; cookies: IHttpCookies; params: {}; willRender: boolean; state: Record; response: IHttpResponse; aborted: boolean; protected _reply: IHttpResponse | null; constructor(ctx: any); get host(): string; get path(): string; get method(): string; get url(): URL; get href(): string; get origin(): string; get protocol(): string; get secure(): boolean; get ip(): string; get ips(): string[]; get body(): any; get files(): any; is(...types: string[]): string | null | false; accepts(...types: string[]): any; getHeader(key: string): any; json(data: any, status?: number): void; noContent(): void; created(): void; throw(status: number, message: string): never; abort(error: IHttpError): void; abort(status: number, message?: string): void; reply(response: IHttpResponse): void; stream(stream: internal.Readable, mime?: string): void; redirect(url: string, alt?: string): void; view(template: string, data?: {}, status?: number): Promise; shouldRender(): boolean; /** * @deprecated use put() instead * @param key * @param value * @returns */ set(key: any, value: T): T; put(key: any, value: T): T; value(key: any): T | undefined; }