import { CircuitState } from '../CircuitBreakerPolicy.js'; /** * The breaker determines when the circuit breaker should open. */ export interface IBreaker { /** * Gets or sets the internal state of the breaker. Used for serialization * with {@link CircuitBreaker.toJSON}. */ state: unknown; /** * Called when a call succeeds. */ success(state: CircuitState): void; /** * Called when a call fails. Returns true if the circuit should open. */ failure(state: CircuitState): boolean; } export * from './ConsecutiveBreaker.js'; export * from './CountBreaker.js'; export * from './SamplingBreaker.js';