export { serve, serveNode, telefunc }; import { HttpResponse } from './runTelefunc.js'; import { Telefunc } from './context/getContext.js'; import type { Readable, Writable } from 'node:stream'; type HttpRequest = { /** The URL of the HTTP Request */ url: string; /** The method of the HTTP Request ('GET', 'POST', ...) */ method: string; /** The body of HTTP Request. */ body: string; /** The HTTP request headers */ headers: Record | [string, string][] | Headers; /** The context object, see https://telefunc.com/getContext */ context?: Telefunc.Context; } | { /** The request object. */ request: Request; /** The context object, see https://telefunc.com/getContext */ context?: Telefunc.Context; } | { /** The URL of the HTTP Request */ url: string; /** The method of the HTTP Request ('GET', 'POST', ...) */ method: string; /** The Node.js `req` readable stream. */ readable: Readable; /** The HTTP request headers */ headers: Record | [string, string][] | Headers; /** The context object, see https://telefunc.com/getContext */ context?: Telefunc.Context; }; /** Get HTTP Response for a telefunction remote call HTTP Request. * @returns HTTP Response */ declare function serve(httpRequest: HttpRequest): Promise; /** `serve()` for adapters holding the Node.js `res`, so that a client disconnect aborts `request.signal`. */ declare function serveNode(httpRequest: Extract, response: Writable): Promise; /** @deprecated `telefunc()` is deprecated, use `new Telefunc()` instead, see https://telefunc.com/Telefunc */ declare function telefunc(httpRequest: HttpRequest): Promise;