import type { Awaitable, CommandCatalog, Domain } from './types.js'; export type WorkflowMode = 'parallel' | 'serial' | 'latest' | 'leading' | 'drop'; export interface WorkflowContext { readonly signal: AbortSignal; delay(milliseconds: number): Promise; retry(operation: (attempt: number) => Awaitable, options?: RetryOptions): Promise; fork(operation: (context: WorkflowContext) => Awaitable): WorkflowTask; } export interface RetryOptions { readonly attempts?: number; readonly delayMs?: number | ((attempt: number) => number); readonly shouldRetry?: (error: unknown, attempt: number) => boolean; } export interface WorkflowTask { readonly result: Promise; cancel(reason?: unknown): void; } export interface Workflow { start(input: Input): WorkflowTask; cancelAll(reason?: unknown): void; active(): number; } export declare function forgeWorkflow(operation: (context: WorkflowContext, input: Input) => Awaitable, options?: { readonly mode?: WorkflowMode; readonly debounceMs?: number; readonly throttleMs?: number; }): Workflow; export declare function waitForDomain>(domain: Domain, predicate: (state: Readonly) => boolean, options?: { readonly timeoutMs?: number; readonly signal?: AbortSignal; }): Promise>; //# sourceMappingURL=workflows.d.ts.map