import type { HttpTransport } from "./http"; import type { RequestOptions, WorkflowAmendmentRequest, WorkflowCompleteResponse, WorkflowDeclarationRequest, WorkflowDeclarationResponse, WorkflowIntent } from "./types"; export declare const WORKFLOW_HEADER = "X-Keel-Workflow-Id"; export interface WorkflowContext { readonly workflowId: string; dispose(): void; [Symbol.dispose](): void; [Symbol.asyncDispose](): Promise; } export interface WorkflowDeclareOptions extends RequestOptions { budget_envelope_id?: string | null; } export interface WorkflowAmendOptions extends RequestOptions { new_max_calls?: number | null; new_expected_calls?: number | null; reason_provided?: string | null; } export declare class WorkflowsClient { private readonly http; constructor(http: HttpTransport); declare(request: WorkflowDeclarationRequest, options?: RequestOptions): Promise; declare(workflowId: string, intent: WorkflowIntent, options?: WorkflowDeclareOptions): Promise; amend(workflowId: string, request: WorkflowAmendmentRequest, options?: RequestOptions): Promise; amend(workflowId: string, ifMatchVersion: number, options?: WorkflowAmendOptions): Promise; complete(workflowId: string, options?: RequestOptions): Promise; } export declare function currentWorkflowId(): string | undefined; export declare function workflow(workflowId: string): WorkflowContext; export declare function runInWorkflow(workflowId: string, fn: () => Promise): Promise; export declare function runInWorkflow(workflowId: string, fn: () => T): T;