import type { IncomingMessage, ServerResponse } from 'node:http'; /** * Signals that the remote client closed the HTTP exchange before the Node * adapter finished reading or writing the body. * * @remarks * This error represents a transport-level disconnect, not an application * failure. Higher layers may safely suppress logging for this error when the * client socket is already gone and no meaningful response can still be sent. */ export declare class NodeClientAbortError extends Error { /** * Creates the canonical Node transport abort error used across request-body * reads and response-body writes. */ constructor(); } /** * Type guard for the canonical client-abort error used by the Node adapter. * * @remarks * Runtime hosts use this guard before logging so only explicitly classified * client disconnects are muted. All other failures continue through the normal * error-reporting path. */ export declare function isNodeClientAbortError(error: unknown): error is NodeClientAbortError; /** * Bridges Node's `IncomingMessage` / `ServerResponse` pair to the Web * `Request` / `Response` contract used by the shared routing pipeline. * * @remarks * This class is the Node transport boundary. It owns the translation of request * headers and bodies into Web primitives and the reverse translation of Web * responses back onto Node streams, including client-abort normalization. */ export declare class NodeHttpRequestBridge { /** * Converts one incoming Node request into the Web `Request` shape consumed by * the shared server adapter. * * @remarks * Non-GET/HEAD requests retain streaming semantics via a `ReadableStream` so * large request bodies do not need to be buffered before route handling begins. */ createWebRequest(req: IncomingMessage, runtimeOrigin: string): Request; /** * Sends a Web `Response` through Node's `ServerResponse` without buffering the * full body in memory first. * * @remarks * Streaming responses matter for large payloads and long-lived transports such * as server-sent events. The bridge therefore forwards the `ReadableStream` * directly into the Node writable response instead of materializing an * intermediate `ArrayBuffer`. */ sendNodeResponse(res: ServerResponse, response: Response): Promise; }