import { type Locale } from '../../i18n/index.js';
import { EventLog } from '../../workflows/events/append.js';
import { type ResolveWaitInput, type ResolveWaitResult, type ResolveWaitContext } from '../../workflows/wait.js';
import { type RequestCancelInput } from '../../workflows/cancel.js';
import type { CancelRequestedEvent } from '../../workflows/events/types.js';
import type { FrozenCard } from '../../core/types.js';
export type WorkflowCardActionData = {
    operator?: {
        open_id?: string;
    };
    action?: {
        value?: Record<string, string>;
        form_value?: Record<string, string>;
    };
    context?: {
        open_message_id?: string;
    };
    open_message_id?: string;
};
export type WorkflowApprovalHandlerDeps = {
    runsDir?: string;
    makeEventLog?: (runId: string, runsDir: string) => EventLog;
    resolveWaitFn?: (log: EventLog, input: ResolveWaitInput, ctx?: ResolveWaitContext) => Promise<ResolveWaitResult>;
    requestCancelFn?: (log: EventLog, input: RequestCancelInput, actor: 'human') => Promise<CancelRequestedEvent>;
    loadFrozenCardsFn?: (storeId: string) => Map<string, FrozenCard>;
    saveFrozenCardsFn?: (storeId: string, cards: Map<string, FrozenCard>) => void;
};
export type WorkflowApprovalHandlerResult = {
    ok: true;
    duplicate: true;
    cardNonce: string;
} | {
    ok: true;
    duplicate: false;
    cardNonce: string;
    result: ResolveWaitResult | CancelRequestedEvent;
    /** Frozen card body (no buttons) for the dispatcher to in-place patch the
     *  clicked card.  Undefined if rebuild failed — caller falls back to no
     *  patch and the card stays interactive (handler is idempotent via
     *  frozenCards). */
    resolvedCardJson?: string;
} | {
    ok: false;
    error: 'not_approver';
    cardNonce: string;
};
export declare function isWorkflowApprovalAction(action?: string): boolean;
export declare function workflowRunsDir(): string;
export declare function workflowFrozenStoreId(runId: string): string;
export declare function handleWorkflowApprovalAction(data: WorkflowCardActionData, deps?: WorkflowApprovalHandlerDeps, locale?: Locale): Promise<WorkflowApprovalHandlerResult | undefined>;
//# sourceMappingURL=workflow-card-handler.d.ts.map