/** * @since 1.0.0 */ import type * as Cause from "effect/Cause"; import * as Context from "effect/Context"; import * as Effect from "effect/Effect"; import * as Exit from "effect/Exit"; import * as Layer from "effect/Layer"; import * as Schedule from "effect/Schedule"; import * as Schema from "effect/Schema"; import * as Scope from "effect/Scope"; import type * as Activity from "./Activity.js"; import type { DurableClock } from "./DurableClock.js"; import type * as DurableDeferred from "./DurableDeferred.js"; import * as Workflow from "./Workflow.js"; declare const WorkflowEngine_base: Context.TagClass(workflow: Workflow.Workflow, execute: (payload: Payload["Type"], executionId: string) => Effect.Effect) => Effect.Effect | Scope.Scope> | Payload["Context"] | Success["Context"] | Error["Context"]>; /** * Execute a registered workflow. */ readonly execute: (workflow: Workflow.Workflow, options: { readonly executionId: string; readonly payload: Payload["Type"]; readonly discard?: Discard | undefined; readonly suspendedRetrySchedule?: Schedule.Schedule | undefined; }) => Effect.Effect; /** * Execute a registered workflow. */ readonly poll: (workflow: Workflow.Workflow, executionId: string) => Effect.Effect | undefined, never, Success["Context"] | Error["Context"]>; /** * Interrupt a registered workflow. */ readonly interrupt: (workflow: Workflow.Any, executionId: string) => Effect.Effect; /** * Resume a registered workflow. */ readonly resume: (workflow: Workflow.Any, executionId: string) => Effect.Effect; /** * Execute an activity from a workflow. */ readonly activityExecute: (activity: Activity.Activity, attempt: number) => Effect.Effect, never, Success["Context"] | Error["Context"] | R | WorkflowInstance>; /** * Try to retrieve the result of an DurableDeferred */ readonly deferredResult: (deferred: DurableDeferred.DurableDeferred) => Effect.Effect | undefined, never, WorkflowInstance>; /** * Set the result of a DurableDeferred, and then resume any waiting * workflows. */ readonly deferredDone: (deferred: DurableDeferred.DurableDeferred, options: { readonly workflowName: string; readonly executionId: string; readonly deferredName: string; readonly exit: Exit.Exit; }) => Effect.Effect; /** * Schedule a wake up for a DurableClock */ readonly scheduleClock: (workflow: Workflow.Any, options: { readonly executionId: string; readonly clock: DurableClock; }) => Effect.Effect; }>; /** * @since 4.0.0 * @category Services */ export declare class WorkflowEngine extends WorkflowEngine_base { } declare const WorkflowInstance_base: Context.TagClass | undefined; readonly activityState: { count: number; readonly latch: Effect.Latch; }; }>; /** * @since 4.0.0 * @category Services */ export declare class WorkflowInstance extends WorkflowInstance_base { static initial(workflow: Workflow.Any, executionId: string): WorkflowInstance["Type"]; } /** * @since 4.0.0 * @category Encoded */ export interface Encoded { readonly register: (workflow: Workflow.Any, execute: (payload: object, executionId: string) => Effect.Effect) => Effect.Effect; readonly execute: (workflow: Workflow.Any, options: { readonly executionId: string; readonly payload: object; readonly discard: Discard; readonly parent?: WorkflowInstance["Type"] | undefined; }) => Effect.Effect>; readonly poll: (workflow: Workflow.Any, executionId: string) => Effect.Effect | undefined>; readonly interrupt: (workflow: Workflow.Any, executionId: string) => Effect.Effect; readonly resume: (workflow: Workflow.Any, executionId: string) => Effect.Effect; readonly activityExecute: (activity: Activity.Any, attempt: number) => Effect.Effect, never, WorkflowInstance>; readonly deferredResult: (deferred: DurableDeferred.Any) => Effect.Effect | undefined, never, WorkflowInstance>; readonly deferredDone: (options: { readonly workflowName: string; readonly executionId: string; readonly deferredName: string; readonly exit: Exit.Exit; }) => Effect.Effect; readonly scheduleClock: (workflow: Workflow.Any, options: { readonly executionId: string; readonly clock: DurableClock; }) => Effect.Effect; } /** * @since 4.0.0 * @category Constructors */ export declare const makeUnsafe: (options: Encoded) => WorkflowEngine["Type"]; /** * @since 1.0.0 * @category In-memory */ export declare const layerMemory: Layer.Layer; export {}; //# sourceMappingURL=WorkflowEngine.d.ts.map