import type { ExecutionConfig, CallbackType, CacheProvider } from '@mondaydotcomorg/atp-protocol';
import type { ProvenanceState, ProvenanceSnapshot } from '@mondaydotcomorg/atp-provenance';
/**
 * Callback request sent to client when execution is paused
 */
export interface CallbackRequest {
    type: CallbackType;
    operation: string;
    payload: Record<string, unknown>;
}
/**
 * Callback execution record for replay
 */
export interface CallbackRecord {
    type: CallbackType;
    operation: string;
    payload: Record<string, unknown>;
    result?: unknown;
    timestamp: number;
    sequenceNumber: number;
}
/**
 * Paused execution state
 */
export interface PausedExecution {
    executionId: string;
    code: string;
    config: ExecutionConfig;
    clientId: string;
    callbackRequest: CallbackRequest;
    pausedAt: number;
    callbackHistory: CallbackRecord[];
    currentCallbackIndex: number;
    context: {
        variables?: Record<string, unknown>;
        codeTransformed?: boolean;
    };
    provenanceState?: ProvenanceState | ProvenanceSnapshot;
}
/**
 * Execution state manager using CacheProvider
 * Works with any CacheProvider (MemoryCache, RedisCache, etc.)
 */
export declare class ExecutionStateManager {
    private cache;
    private keyPrefix;
    private ttl;
    private maxPauseDuration;
    private metrics;
    constructor(cache: CacheProvider, options?: {
        keyPrefix?: string;
        ttl?: number;
        maxPauseDuration?: number;
    });
    /**
     * Saves paused execution state
     */
    pause(state: PausedExecution): Promise<void>;
    /**
     * Retrieves paused execution state
     */
    get(executionId: string): Promise<PausedExecution | null>;
    /**
     * Deletes execution state
     */
    delete(executionId: string): Promise<void>;
    /**
     * Gets the full cache key for an execution ID
     */
    private getKey;
    /**
     * Closes connections and cleanup
     */
    close(): Promise<void>;
    /**
     * Gets storage type from cache provider
     */
    getStorageType(): string;
    /**
     * Gets pause/resume metrics
     */
    getMetrics(): {
        successRate: string;
        expiredRate: string;
        totalPauses: number;
        totalResumes: number;
        totalExpired: number;
        totalFailed: number;
    };
    /**
     * Resets metrics (useful for testing)
     */
    resetMetrics(): void;
}
//# sourceMappingURL=index.d.ts.map