import { z } from "zod";
/**
 * Circuit breaker for GDS adapter fault tolerance.
 *
 * Three states: CLOSED (normal), OPEN (blocking), HALF_OPEN (probing).
 * Opens after consecutive failures exceed threshold, resets after
 * a cooldown period.
 */
export type CircuitState = "closed" | "open" | "half-open";
export declare const CircuitBreakerConfigSchema: z.ZodObject<{
    failureThreshold: z.ZodNumber;
    cooldownMs: z.ZodNumber;
    successThreshold: z.ZodNumber;
}, z.core.$strip>;
export type CircuitBreakerConfig = z.infer<typeof CircuitBreakerConfigSchema>;
export declare class CircuitBreaker {
    private state;
    private failureCount;
    private successCount;
    private lastFailureTime;
    private readonly config;
    constructor(config?: Partial<CircuitBreakerConfig>);
    /** Current circuit state. */
    getState(): CircuitState;
    /** Whether a request is allowed to proceed. */
    isAllowed(): boolean;
    /** Record a successful call. */
    recordSuccess(): void;
    /** Record a failed call. */
    recordFailure(): void;
    /** Force reset to closed state. */
    reset(): void;
    /** Get failure count. */
    getFailureCount(): number;
    /** Get last failure timestamp. */
    getLastFailureTime(): number;
}
//# sourceMappingURL=circuit-breaker.d.ts.map