import CircuitBreaker from 'opossum'; export interface CircuitBreakerOptions { timeout?: number; errorThresholdPercentage?: number; resetTimeout?: number; rollingCountTimeout?: number; rollingCountBuckets?: number; name?: string; volumeThreshold?: number; errorFilter?: (error: Error) => boolean; } /** * Circuit breaker factory for external service calls */ export declare class CircuitBreakerFactory { private static readonly breakers; /** * Create or get a circuit breaker for a service */ static getBreaker(name: string, fn: (...args: T) => Promise, options?: CircuitBreakerOptions): CircuitBreaker; /** * Attach event listeners for metrics and logging */ private static attachEventListeners; /** * Get circuit breaker statistics */ static getStats(name: string): CircuitBreaker.Stats | undefined; /** * Get all circuit breakers */ static getAllBreakers(): Map; /** * Shutdown all circuit breakers */ static shutdown(): void; /** * Reset all circuit breakers (for testing) */ static reset(): void; } /** * Decorator to apply circuit breaker to a method */ export declare function withCircuitBreaker(name: string, options?: CircuitBreakerOptions): MethodDecorator; /** * Wrap a function with a circuit breaker */ export declare function wrapWithCircuitBreaker(name: string, fn: (...args: T) => Promise, options?: CircuitBreakerOptions): (...args: T) => Promise;