/** The abstraction that oak uses when dealing with requests and responses * within the Node.js runtime. * * @module */ import * as dntShim from "./_dnt.shims.js"; import type { Listener, OakServer, ServerRequest } from "./types.js"; export type IncomingMessage = { headers: Record; method: string | null; socket: { address(): { addr: null | { address: string; }; }; }; url: string | null; on(method: "data", listener: (chunk: Uint8Array) => void): void; on(method: "error", listener: (err: Error) => void): void; on(method: "end", listener: () => void): void; }; export type ServerResponse = { destroy(error?: Error): void; end(callback?: () => void): void; setHeader(key: string, value: string): void; write(chunk: unknown, callback?: (err: Error | null) => void): void; writeHead(status: number, statusText?: string): void; }; export declare class NodeRequest implements ServerRequest { #private; get remoteAddr(): string | undefined; get headers(): dntShim.Headers; get method(): string; get url(): string; constructor(request: IncomingMessage, response: ServerResponse); error(reason?: any): void; getBody(): ReadableStream | null; respond(response: dntShim.Response): Promise; } export declare class Server implements OakServer { #private; constructor(_app: unknown, options: dntShim.Deno.ListenOptions | dntShim.Deno.ListenTlsOptions); close(): void; listen(): Promise; [Symbol.asyncIterator](): AsyncIterableIterator; static type: "node"; }