mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-10 12:10:18 +00:00
Change async-retry options to use retry library types
Since async-retry is passing options parameter directly to the underlying retry library, option types can be reused from it.
This commit is contained in:
committed by
Rafał Sawicki
parent
510793441f
commit
8908cbdb45
@@ -7,6 +7,7 @@ const o: Options = {
|
||||
minTimeout: 3,
|
||||
maxTimeout: 4,
|
||||
randomize: true,
|
||||
forever: false,
|
||||
onRetry: (e: Error) => 42
|
||||
};
|
||||
|
||||
|
||||
12
types/async-retry/index.d.ts
vendored
12
types/async-retry/index.d.ts
vendored
@@ -1,21 +1,19 @@
|
||||
// Type definitions for async-retry 1.3
|
||||
// Type definitions for async-retry 1.4
|
||||
// Project: https://github.com/zeit/async-retry#readme
|
||||
// Definitions by: Albert Wu <https://github.com/albertywu>
|
||||
// Pablo Rodríguez <https://github.com/MeLlamoPablo>
|
||||
// Rafał Sawicki <https://github.com/rafsawicki>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import { OperationOptions } from 'retry';
|
||||
|
||||
declare function AsyncRetry<A>(
|
||||
fn: AsyncRetry.RetryFunction<A>,
|
||||
opts: AsyncRetry.Options
|
||||
): Promise<A>;
|
||||
|
||||
declare namespace AsyncRetry {
|
||||
interface Options {
|
||||
retries?: number;
|
||||
factor?: number;
|
||||
minTimeout?: number;
|
||||
maxTimeout?: number;
|
||||
randomize?: boolean;
|
||||
interface Options extends OperationOptions {
|
||||
onRetry?: (e: Error, attempt: number) => any;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user