import { ConnectionError } from '../types'; export interface RetryConfig { maxAttempts: number; baseDelayMs: number; maxDelayMs: number; classifyFn?: (error: ConnectionError | string) => 'retryable' | 'non-retryable'; } /** * Classify a connection error as retryable or non-retryable. * * Non-retryable errors are terminal conditions that will not resolve by * retrying (e.g. authorization failures or disabled features). */ export declare function classifyError(error: ConnectionError | string): 'retryable' | 'non-retryable'; /** Convenience boolean wrapper around {@link classifyError}. */ export declare function isRetryableError(error: ConnectionError | string): boolean; /** * Execute `fn` with automatic retries using exponential back-off. * * - Respects the provided `AbortSignal`; aborts immediately if signalled. * - Non-retryable errors (per `config.classifyFn` or the default * {@link classifyError}) are thrown without retrying. * - Back-off: `baseDelayMs * 2^attempt`, capped at `maxDelayMs`, with 50 % * jitter (actual delay is between 50 % and 100 % of the computed value). * - Delays use {@link abortableSleep} so they are cancellable via the signal. */ export declare function withRetry(fn: () => Promise, config: RetryConfig, parentSignal: AbortSignal): Promise; //# sourceMappingURL=retry-policy.d.ts.map