@ocap/util
Version:
utils shared across multiple forge js libs, works in both node.js and browser
12 lines (11 loc) • 398 B
TypeScript
interface RetryOptions {
retryLimit?: number;
backoff?: {
baseDelay: number;
maxDelay: number;
};
shouldRetry?: (error: unknown) => boolean;
onError?: (error: unknown, attempt: number) => Promise<void> | void;
}
export declare function withRetry<T>(handle: () => Promise<T>, { retryLimit, backoff, shouldRetry, onError, }?: RetryOptions): Promise<T>;
export {};