/** * Floor for a jittered delay so a low random draw can't turn a retry into an * immediate re-request. Clamped by the computed ceiling, so an explicit * zero-delay config (used by tests) still waits nothing. */ declare const MIN_RETRY_DELAY_MS = 50; type RetryConfig = { maxRetries?: number; baseDelayMs?: number; maxDelayMs?: number; /** Injectable randomness for deterministic tests. Defaults to `Math.random`. */ random?: () => number; }; declare function extractHttpStatusCode(error: unknown): number | undefined; declare function isTransientError(error: unknown): boolean; /** * Exponential backoff with full jitter: the delay is a random point in * `[0, cap]` rather than the cap itself. * * Without jitter, a batch of requests that all fail together retry in lockstep * and hit the server as another simultaneous burst — the same contention that * caused the first failure. Spreading the retries is what breaks that cycle. */ declare function getRetryDelay({ attempt, baseDelayMs, maxDelayMs, random, }: { attempt: number; baseDelayMs: number; maxDelayMs: number; random?: () => number; }): number; declare function executeWithRetry(fn: () => Promise, config?: RetryConfig): Promise; export { executeWithRetry, extractHttpStatusCode, getRetryDelay, isTransientError, MIN_RETRY_DELAY_MS, type RetryConfig, }; //# sourceMappingURL=retry.d.ts.map