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
40 lines (39 loc) • 1.07 kB
text/typescript
import { b as ClientEventFrom, u as AnyActorKitStateMachine, v as CallerSnapshotFrom, y as CallerType } from "./types-C31KX9CW.mjs";
import { StateValueFrom } from "xstate";
//#region src/createAccessToken.d.ts
declare const createAccessToken: ({
signingKey,
actorId,
actorType,
callerId,
callerType
}: {
signingKey: string;
actorId: string;
actorType: string;
callerId: string;
callerType: CallerType;
}) => Promise<string>;
//#endregion
//#region src/createActorFetch.d.ts
declare function createActorFetch<TMachine extends AnyActorKitStateMachine>({
actorType,
host
}: {
actorType: string;
host: string;
}): (props: {
actorId: string;
accessToken: string;
input?: Record<string, unknown>;
waitForEvent?: ClientEventFrom<TMachine>;
waitForState?: StateValueFrom<TMachine>;
timeout?: number;
errorOnWaitTimeout?: boolean;
}, options?: RequestInit) => Promise<{
snapshot: CallerSnapshotFrom<TMachine>;
checksum: string;
}>;
//#endregion
export { createAccessToken, createActorFetch };
//# sourceMappingURL=server.d.mts.map