import { O as MachineServerOptions, S as EnvFromMachine, _ as Caller, c as ActorServer, j as ScreamingSnakeToKebab, r as ActorKitEnv, u as AnyActorKitStateMachine, v as CallerSnapshotFrom } from "./types-C31KX9CW.mjs"; import { z } from "zod"; import { Operation } from "fast-json-patch"; import * as xstate from "xstate"; import { AnyEventObject } from "xstate"; //#region src/createActorKitRouter.d.ts declare const createActorKitRouter: (routes: Array>>) => (request: Request, env: Env, _ctx?: unknown) => Promise; //#endregion //#region src/createMachineServer.d.ts declare const createMachineServer: , TMachine extends AnyActorKitStateMachine>({ machine, schemas, options }: { machine: TMachine; schemas: { clientEvent: z.ZodSchema; serviceEvent: z.ZodSchema; inputProps: TInputSchema; }; options?: MachineServerOptions; }) => new (state: DurableObjectState, env: EnvFromMachine) => ActorServer; //#endregion //#region src/fromActorKit.d.ts type KebabToScreamingSnake = string extends S ? string : S extends `${infer Head}-${infer Tail}` ? `${Uppercase}_${KebabToScreamingSnake}` : Uppercase; type FromActorKitEmitted = { type: `${KebabToScreamingSnake}_UPDATED`; actorType: TActorType; actorId: string; snapshot: CallerSnapshotFrom; operations: Operation[]; } | { type: `${KebabToScreamingSnake}_ERROR`; actorType: TActorType; actorId: string; error: Error; }; interface ActorKitNamespaceLike { idFromName(name: string): unknown; get(id: unknown): { fetch(request: Request): Promise; spawn?(props: { actorType: string; actorId: string; caller: Caller; input: Record; }): Promise | void; [key: string]: unknown; }; } interface FromActorKitInput { server: ActorKitNamespaceLike; actorId: string; actorInput: Record; caller: Caller; signingKey: string; eventSchema: TEventSchema; } declare function fromActorKit(actorType: TActorType): xstate.CallbackActorLogic & { type: string; }, FromActorKitInput, xstate.EventObject>; //#endregion export { type FromActorKitEmitted, type FromActorKitInput, createActorKitRouter, createMachineServer, fromActorKit }; //# sourceMappingURL=worker.d.mts.map