export interface CircuitBreakerConfig { maxConsecutiveFailures: number; maxSameErrorCount: number; cooldownMs: number; } export interface CircuitBreakerState { consecutiveFailures: number; errorHistory: Map; isOpen: boolean; lastFailure?: Date; totalFailures: number; } export declare const DEFAULT_CIRCUIT_BREAKER_CONFIG: CircuitBreakerConfig; export declare class CircuitBreaker { private config; private state; constructor(config?: Partial); /** * Hash an error message to track similar errors. * Normalizes variable parts (line numbers, timestamps, hex, stack traces) * while preserving semantically meaningful content like error messages. */ private hashError; /** * Record a successful iteration - resets consecutive failures */ recordSuccess(): void; /** * Record a failed iteration * @returns true if circuit should trip (open) */ recordFailure(errorMessage: string): boolean; /** * Determine if the circuit should trip */ private shouldTrip; /** * Check if circuit is open (tripped) */ isTripped(): boolean; /** * Get the reason why the circuit tripped */ getTripReason(): string | null; /** * Reset the circuit breaker completely */ reset(): void; /** * Get current state for logging/debugging */ getState(): Readonly; /** * Get statistics for display */ getStats(): { consecutiveFailures: number; totalFailures: number; uniqueErrors: number; isOpen: boolean; }; } //# sourceMappingURL=circuit-breaker.d.ts.map