UNPKG

@aurios/jason

Version:

A simple, lightweight, and embeddable JSON document database built on Bun.

11 lines (10 loc) 543 B
/** * Retries an async operation a specified number of times, with exponential backoff between retries. * * @param fn - The async operation to retry. * @param maxRetries - The maximum number of retries. Defaults to 10. * @param baseDelay - The initial delay in milliseconds. Defaults to 10. * @returns The result of the successfully executed operation. * @throws The error that caused the last retry to fail. */ export declare function retryAsyncOperation<T>(fn: () => Promise<T>, maxRetries?: number, baseDelay?: number): Promise<T>;