/**
 * Circuit Breaker Pattern
 * Fault tolerance with version tracking and automatic recovery
 * Sealed namespace for immutability
 */
export type CircuitState = 'closed' | 'open' | 'half-open';
export type CircuitBreakerConfig = {
    failureThreshold: number;
    successThreshold: number;
    timeout: number;
    resetTimeout: number;
    volumeThreshold: number;
};
export type CircuitBreakerState = {
    workerName: string;
    version: string;
    state: CircuitState;
    failureCount: number;
    successCount: number;
    totalRequests: number;
    lastFailureTime: Date | null;
    lastSuccessTime: Date | null;
    lastStateChange: Date;
    nextRetryTime: Date | null;
    errorRate: number;
};
export type CircuitBreakerEvent = {
    workerName: string;
    version: string;
    event: 'opened' | 'closed' | 'half-open' | 'success' | 'failure' | 'rejected';
    state: CircuitState;
    timestamp: Date;
    reason?: string;
    error?: Error;
};
/**
 * Circuit Breaker - Sealed namespace
 */
export declare const CircuitBreaker: Readonly<{
    /**
     * Initialize circuit breaker for a worker version
     */
    initialize(workerName: string, version: string): void;
    /**
     * Check if circuit allows execution
     */
    canExecute(workerName: string, version: string): boolean;
    /**
     * Record successful execution
     */
    recordSuccess(workerName: string, version: string): void;
    /**
     * Record failed execution
     */
    recordFailure(workerName: string, version: string, error: Error): void;
    /**
     * Record rejected execution (when circuit is open)
     */
    recordRejection(workerName: string, version: string): void;
    /**
     * Get circuit state
     */
    getState(workerName: string, version: string): CircuitBreakerState | null;
    /**
     * Get all circuit states
     */
    getAllStates(): ReadonlyArray<CircuitBreakerState>;
    /**
     * Get circuit states by worker name (all versions)
     */
    getStatesByWorker(workerName: string): ReadonlyArray<CircuitBreakerState>;
    /**
     * Get event history
     */
    getEventHistory(workerName: string, version: string, limit?: number): ReadonlyArray<CircuitBreakerEvent>;
    /**
     * Manually reset circuit to closed state
     */
    reset(workerName: string, version: string): void;
    /**
     * Manually force circuit to open state
     */
    forceOpen(workerName: string, version: string, reason: string): void;
    /**
     * Delete circuit breaker
     */
    delete(workerName: string, version: string): void;
    /**
     * Delete all circuit breakers for a worker (all versions)
     */
    deleteWorker(workerName: string): void;
    /**
     * Get summary statistics
     */
    getSummary(): {
        totalCircuits: number;
        openCircuits: number;
        halfOpenCircuits: number;
        closedCircuits: number;
        circuitsByWorker: Record<string, number>;
    };
    /**
     * Shutdown and clear all circuits
     */
    shutdown(): void;
}>;
//# sourceMappingURL=CircuitBreaker.d.ts.map