export { Telefunc }; export type { CloudflareOptions }; import { DurableObject } from 'cloudflare:workers'; import type { Telefunc as TelefuncNamespace } from '../node/server/context/getContext.js'; import type { CloudflareScale } from '../wire-protocol/server/adapter/cloudflare/routing.js'; type CloudflareOptions = { bindingName?: string; kvBindingName?: string; instanceName?: string; context?: (request: Request, env: Cloudflare.Env) => TelefuncNamespace.Context | Promise; scale?: CloudflareScale; locationFallback?: DurableObjectLocationHint; jurisdiction?: DurableObjectJurisdiction; }; type ServeInput = { request: Request; env: Cloudflare.Env; ctx: ExecutionContext; }; interface TelefuncServe { serve(input: ServeInput): Promise; TelefuncDurableObject: new (ctx: DurableObjectState, env: Cloudflare.Env) => DurableObject; } interface Telefunc extends TelefuncServe { } declare class Telefunc { constructor(options?: CloudflareOptions); }