import { EventualServiceClient } from "./service-client.js"; import type { SendSignalProps, Signal } from "./signals.js"; import type { Workflow, WorkflowOutput } from "./workflow.js"; export declare enum ExecutionStatus { IN_PROGRESS = "IN_PROGRESS", SUCCEEDED = "SUCCEEDED", FAILED = "FAILED" } export declare function isExecutionStatus(s: string): s is ExecutionStatus; export type ExecutionID = `${WorkflowName}/${ID}`; export interface ExecutionParent { /** * Seq number when this execution is the child of another workflow. */ seq: number; /** * Id of the parent workflow, while present. */ executionId: ExecutionID; } interface ExecutionBase { id: ExecutionID; status: ExecutionStatus; startTime: string; workflowName: string; inputHash?: string; parent?: ExecutionParent; } export type Execution = InProgressExecution | SucceededExecution | FailedExecution; export interface InProgressExecution extends ExecutionBase { status: ExecutionStatus.IN_PROGRESS; } export interface SucceededExecution extends ExecutionBase { status: ExecutionStatus.SUCCEEDED; endTime: string; result?: Result; } export interface FailedExecution extends ExecutionBase { status: ExecutionStatus.FAILED; endTime: string; error: string; message: string; } export declare function isFailedExecution(execution: Execution): execution is FailedExecution; export declare function isSucceededExecution(execution: Execution): execution is SucceededExecution; /** * A reference to a running execution. * * Note: This object should be usable within a workflow. It should only contain deterministic logic * {@link EventualCall}s or {@link EventualProperty}s via the {@link EventualHook}. */ export declare class ExecutionHandle { executionId: ExecutionID; private serviceClient?; constructor(executionId: ExecutionID, serviceClient?: EventualServiceClient | undefined); /** * @return the {@link Execution} with the status, result, error, and other data based on the current status. */ getStatus(): Promise>>; /** * Send a {@link signal} to this execution. */ sendSignal(signal: string | Signal, ...args: SendSignalProps): Promise; } /** * A reference to an execution started by another workflow. */ export interface ChildExecution { /** * Allows a {@link workflow} to send a signal to the workflow {@link Execution}. * * ```ts * const mySignal = signal("MySignal"); * const childWf = workflow(...); * workflow("wf", async () => { * const child = childWf(); * child.sendSignal(mySignal); * await child; * }) * ``` * * @param id an optional, execution unique ID, will be used to de-dupe the signal at the target execution. */ sendSignal(signal: string | Signal, ...args: SendSignalProps): Promise; } export {}; //# sourceMappingURL=execution.d.ts.map