import type { WorkflowStatus } from '../types.ts'; import { type UpdateResponse } from '../updates.ts'; import type { EngineInternals } from './internals.ts'; export declare const TERMINAL_STATUSES: ReadonlySet; export type GuardCallbacks = { deleteRequestIfUnconsumed: (workflowId: string, updateId: string) => Promise; getUpdateResponse: (updateId: string) => Promise; }; /** Throw {@link WorkflowTerminalError} if the workflow is in a terminal state. */ export declare function guardTerminalWorkflow(internals: EngineInternals, workflowId: string, _callbacks: GuardCallbacks): Promise; /** * Re-check terminal state after persisting a coordinated update request. * This closes the race where the workflow completes between the preflight * guard and request creation, which would otherwise leave the caller * waiting for a response that can never arrive. */ export declare function guardTerminalWorkflowAfterCoordinatedRequest(internals: EngineInternals, workflowId: string, updateId: string, callbacks: GuardCallbacks): Promise;