@incubrain/helpers
Version:
9 lines (8 loc) • 445 B
TypeScript
/**
* Retries an asynchronous operation with exponential backoff.
* @param operation The async function to retry.
* @param maxAttempts The maximum number of attempts.
* @param initialDelay The initial delay in milliseconds.
* @returns A promise that resolves with the operation result or rejects if all attempts fail.
*/
export declare function retry<T>(operation: () => Promise<T>, maxAttempts: number, initialDelay: number): Promise<T>;