UNPKG

@ocap/util

Version:

utils shared across multiple forge js libs, works in both node.js and browser

18 lines 428 B
//#region src/retry.d.ts interface RetryOptions { retryLimit?: number; backoff?: { baseDelay: number; maxDelay: number; }; shouldRetry?: (error: unknown) => boolean; onError?: (error: unknown, attempt: number) => Promise<void> | void; } declare function withRetry<T>(handle: () => Promise<T>, { retryLimit, backoff, shouldRetry, onError }?: RetryOptions): Promise<T>; //#endregion export { withRetry };