UNPKG

magnitude-core

Version:
17 lines (16 loc) 528 B
type RetryOptions = { retries?: number; delay?: number; maxDelay?: number; exponential?: boolean | number; throwOnExhaustion?: boolean; retryIf?: (error: Error) => boolean; onRetry?: (error: Error, attempt: number) => void; }; export declare function retry<T>(fn: () => Promise<T>, options: RetryOptions & { throwOnExhaustion: false; }): Promise<T | null>; export declare function retry<T>(fn: () => Promise<T>, options?: RetryOptions & { throwOnExhaustion?: true; }): Promise<T>; export {};