export interface RetryConfig { maxRetries: number; baseDelayMs: number; maxDelayMs: number; } /** Resolve retry configuration from env, with safe fallbacks. Exported for tests. */ export declare function resolveRetryConfig(): RetryConfig; /** * Decide whether a failed attempt is worth retrying. * * Retry policy is intentionally conservative for non-idempotent verbs to avoid * silently duplicating writes when the server's response was lost or delayed: * - 429 (Too Many Requests) is always retried — the server explicitly * rejected the request before processing it, so it is safe regardless of * verb. * - For GET only, 5xx responses, network failures, and timeouts are retried * because GET is idempotent. * - 4xx responses (other than 429) are never retried — the client must change * the request before another attempt makes sense. * * Exported for unit testing. */ export declare function isRetryable(method: string, status: number | undefined, isNetworkOrTimeout: boolean): boolean; /** * Parse a `Retry-After` header value into milliseconds. * * Accepts either a non-negative number of seconds or an HTTP-date. Returns * null when the value is absent or unparseable. Negative computed delays are * clamped to 0. Exported for unit testing. */ export declare function parseRetryAfter(value: string | null, now?: number): number | null; /** * Compute the next backoff delay using full jitter: * delay = random(0, min(maxMs, baseMs * 2^attempt)) * * Full jitter (vs. exponential-only) reduces thundering-herd risk when many * clients retry in lockstep. Exported for unit testing. */ export declare function computeBackoffMs(attempt: number, baseMs: number, maxMs: number, random?: () => number): number; /** * Backoff sleep. With a `signal`, the wait ends the moment it fires — a * cancelled caller does not sit out a 5 s `Retry-After` (issue #231); the * rejection carries the signal's reason. */ export declare function sleep(ms: number, signal?: AbortSignal): Promise; //# sourceMappingURL=retry.d.ts.map