@shanyue/promise-utils
Version:
Userful promise utils, include map, filter, retry and sleep
11 lines • 428 B
TypeScript
interface RetryOptions {
readonly times?: number;
readonly onFailedAttempt?: (error: Error) => void | Promise<void>;
}
export declare class AbortError extends Error {
originalError: Error;
constructor(message: string | Error);
}
export declare function retry<T>(run: (attemptCount: number) => Promise<T> | T, { times, onFailedAttempt, }?: RetryOptions): Promise<T>;
export {};
//# sourceMappingURL=retry.d.ts.map