UNPKG

actor-kit

Version:

Actor Kit is a library for running state machines in Cloudflare Workers, leveraging XState for robust state management. It provides a framework for managing the logic, lifecycle, persistence, synchronization, and access control of actors in a distributed

28 lines (27 loc) 1 kB
import { u as AnyActorKitStateMachine, v as CallerSnapshotFrom } from "./types-C31KX9CW.mjs"; import { t as createActorKitContext } from "./createActorKitContext-Dfz-tllh.mjs"; import React from "react"; import { StoryContext, StoryFn } from "@storybook/react"; //#region src/withActorKit.d.ts declare const withActorKit: <TMachine extends AnyActorKitStateMachine>({ actorType, context }: { actorType: string; context: ReturnType<typeof createActorKitContext<TMachine>>; }) => (Story: StoryFn, storyContext: StoryContext) => React.ReactElement; //#endregion //#region src/storybook.d.ts interface ActorKitParameters<TMachine extends AnyActorKitStateMachine> { actorKit: { [K: string]: { [actorId: string]: CallerSnapshotFrom<TMachine>; }; }; } type StoryWithActorKit<TMachine extends AnyActorKitStateMachine> = { parameters: ActorKitParameters<TMachine>; }; //#endregion export { ActorKitParameters, StoryWithActorKit, withActorKit }; //# sourceMappingURL=storybook.d.mts.map