/** * The workerd flavor of the Worker bridge, shared by every engine that runs * Workers-compatible bundles (Cloudflare today): the platform services a * workerd isolate builds its init against, and the `WorkerEntrypoint` class * that turns workerd's handler and JSRPC calls into Effect events over the * engine-invariant core in `../WorkerBridge.ts`. * * @internal */ import type * as cf from "@cloudflare/workers-types"; import * as Context from "effect/Context"; import * as Effect from "effect/Effect"; import * as Layer from "effect/Layer"; import { handleRpcExit, type SharedBuildOptions, type WorkerBuild, type WorkerRuntimeContextLike } from "../Worker.ts"; /** workerd's `WorkerEntrypoint` (or `DurableObject`) base class. */ export type WorkerdEntrypointClass = abstract new (ctx: any, env: any) => object; export declare const workerdBuildOptions: SharedBuildOptions; export interface WorkerdWorkerBridgeOptions { readonly entrypoint: any; readonly stack: { readonly name: string; readonly stage: string; }; readonly buildOptions: SharedBuildOptions; /** The workerd handler methods the bridge installs (`fetch`, `queue`, …). */ readonly handlers: readonly string[]; /** Per-event services built from workerd's execution context and env. */ readonly services: (context: cf.ExecutionContext, env: Record, built: WorkerBuild) => Layer.Layer; } /** * Makes the WorkerEntrypoint class and bridges to Effect handler and RPC * calls. */ export declare const makeWorkerBridge: (Base: WorkerdEntrypointClass, options: WorkerdWorkerBridgeOptions) => { new (ctx: any, env: any): { readonly ctx: any; readonly env: any; event(makeEffect: (built: WorkerBuild) => readonly [Effect.Effect, Context.Context], onExit: (exit: Parameters[0], lifetime: Parameters[1] & {}) => Promise): Promise; }; }; //# sourceMappingURL=WorkerBridge.d.ts.map