export interface RetryOptions { maxRetries?: number; maxRetryAfter?: number; onRetry?: (attempt: number, delay: number) => void; } /** * Retries a function when it encounters a rate limit error (429). * Uses the retry-after header to determine how long to wait before retrying. * * @param fn - The async function to execute with retry logic * @param options - Configuration options for retry behavior * @param options.maxRetries - Maximum number of retry attempts (default: 5) * @param options.maxRetryAfter - Maximum wait time in ms regardless of retry-after header value (default: 70000) * @param options.onRetry - Optional callback invoked before each retry with attempt number and delay in ms * @returns The result of the function if successful * @throws The original error if it's not a rate limit error, if max retries exceeded, or if retry-after header is missing */ export declare const retryWithBackoff: (fn: () => Promise, options?: RetryOptions) => Promise;