123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- import {OperationOptions} from 'retry';
- declare class AbortErrorClass extends Error {
- readonly name: 'AbortError';
- readonly originalError: Error;
-
- constructor(message: string | Error);
- }
- declare namespace pRetry {
- interface FailedAttemptError extends Error {
- readonly attemptNumber: number;
- readonly retriesLeft: number;
- }
- interface Options extends OperationOptions {
-
- readonly onFailedAttempt?: (error: FailedAttemptError) => void | Promise<void>;
- }
- type AbortError = AbortErrorClass;
- }
- declare const pRetry: {
-
- <T>(
- input: (attemptCount: number) => PromiseLike<T> | T,
- options?: pRetry.Options
- ): Promise<T>;
- AbortError: typeof AbortErrorClass;
-
- default: typeof pRetry;
- };
- export = pRetry;
|