import type { HealthCheck, HealthMonitoring } from '../interfaces/core.js'; import { HealthMonitoringDecorator } from './base.js'; export type { HealthCheck }; /** * Circuit breaker configuration */ export type CircuitBreakerConfig = { failureThreshold: number; successThreshold: number; timeout: number; resetTimeoutMs: number; }; declare enum CircuitState { CLOSED = "CLOSED", OPEN = "OPEN", HALF_OPEN = "HALF_OPEN" } /** * Circuit breaker for health monitoring * Prevents cascade failures by stopping requests to unhealthy providers * Automatically recovers when provider becomes healthy again * Implements state machine: CLOSED -> OPEN -> HALF_OPEN -> CLOSED */ export declare class CircuitBreakerHealthMonitoring extends HealthMonitoringDecorator { private readonly config; private state; private failureCount; private successCount; private nextAttempt; constructor(wrapped: HealthMonitoring, config?: CircuitBreakerConfig); healthCheck(): Promise; /** * Handle successful health check */ private onSuccess; /** * Handle failed health check */ private onFailure; /** * Get current circuit state (useful for monitoring) */ getState(): CircuitState; } //# sourceMappingURL=circuit-breaker.d.ts.map