import type { RetryConfig } from '../types/index.js'; /** * Retry strategy with exponential backoff * * Automatically retries failed operations with increasing delays between attempts. */ export declare class RetryStrategy { private config; /** * Creates a new RetryStrategy * * @param config - Retry configuration options * * @example * ```typescript * const strategy = new RetryStrategy({ * maxRetries: 3, * initialDelay: 1000, * backoffMultiplier: 2 * }); * ``` */ constructor(config?: RetryConfig); /** * Executes a function with retry logic * * @param fn - Async function to execute * @returns Promise with function result * @throws Error from the function if all retries are exhausted * * @example * ```typescript * const result = await strategy.execute(async () => { * return await someApiCall(); * }); * ``` */ execute(fn: () => Promise): Promise; /** * Calculates delay for next retry attempt using exponential backoff * * @param attemptNumber - Current attempt number (0-indexed) * @returns Delay in milliseconds * * @example * ```typescript * strategy.calculateDelay(0); // 1000ms * strategy.calculateDelay(1); // 2000ms * strategy.calculateDelay(2); // 4000ms * ``` */ calculateDelay(attemptNumber: number): number; /** * Determines if error should trigger retry * * Retries on network errors and specific HTTP status codes (5xx, 408, 429). * Does not retry on client errors (4xx except 408, 429). * * @param error - Error object * @returns true if should retry */ shouldRetry(error: unknown): boolean; /** * Sleep for specified milliseconds * * @param ms - Milliseconds to sleep */ private sleep; } //# sourceMappingURL=retry.d.ts.map