/** Minimal structural type for a Node/Express-style request. */ interface NodeRequestLike { method?: string; url?: string; originalUrl?: string; headers: Record; /** Raw request body. Cloud Functions v2 provides this as a Buffer. */ rawBody?: Buffer | Uint8Array; /** Parsed body (Express/Functions populate this for JSON/urlencoded). */ body?: unknown; } /** Minimal structural type for a Node/Express-style response. */ interface NodeResponseLike { statusCode: number; setHeader(name: string, value: string): void; end(chunk?: string | Uint8Array): void; } /** A Web-standard handler: takes a Fetch `Request`, returns a `Response`. */ type WebHandler = (request: Request) => Promise | Response; /** A Node/Express-style handler: `(req, res)`. */ type NodeHandler = (req: NodeRequestLike, res: NodeResponseLike) => Promise; /** * Wrap a Web-standard handler so it runs as a Node/Express-style `(req, res)` * handler. Works for Express and any runtime with a compatible req/res * (Node `http.ServerResponse` exposes `statusCode`/`setHeader`/`end`). */ declare function toExpress(handler: WebHandler): NodeHandler; /** * Wrap a Web-standard handler for Firebase Cloud Functions v2 `onRequest`. * Identical bridge to {@link toExpress} (Functions v2 req/res are Express-based); * provided as a named export for intent at the call site. */ declare const toCloudFunction: typeof toExpress; export { type NodeHandler, type NodeRequestLike, type NodeResponseLike, type WebHandler, toCloudFunction, toExpress };