import type { IncomingMessage, ServerResponse } from "node:http"; import type { FilesApi } from "../api/index.js"; /** A Node request, optionally carrying Express's `originalUrl` (the pre-mount path). */ export type NodeLikeRequest = IncomingMessage & { originalUrl?: string; }; /** Marshal a Node request into the Web `Request` the gateway consumes. */ export declare const toWebRequest: (req: NodeLikeRequest, signal: AbortSignal) => Request; /** Flush a Web `Response` (status, headers, streamed body) onto the Node response. */ export declare const sendWebResponse: (res: ServerResponse, response: Response) => Promise; /** * An `AbortSignal` that fires when the client disconnects before the response * finishes — for bindings that return the `Response` to the framework to flush * (e.g. Nitro), so there is no `ServerResponse` here to guard `writableFinished` * on. The connection socket's `close` is the one disconnect event that fires * across Node and Bun; once the response is fully sent the socket closes too, * but aborting then is a harmless no-op for an already-settled request. */ export declare const abortSignalForNodeRequest: (req: IncomingMessage) => AbortSignal; /** * Run the gateway against a Node request/response pair: marshal the request, * dispatch, and flush the response, wiring a client disconnect through to the * upstream read. This is the whole binding for `express`/`koa`/`fastify` — each * only has to hand over its underlying `(req, res)`. */ export declare const handleNodeRequest: (router: FilesApi, req: NodeLikeRequest, res: ServerResponse) => Promise; //# sourceMappingURL=node-http.d.ts.map