Skip to content

Commit

Permalink
use tsdoc comments for hover tips (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
antonk52 authored May 4, 2024
1 parent 14c5bd0 commit 0e04410
Showing 1 changed file with 31 additions and 8 deletions.
39 changes: 31 additions & 8 deletions src/retry-promise.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,51 @@
import {timeout} from "./timeout";

export interface RetryConfig<T = any> {
// number of maximal retry attempts (default: 10)
/**
* number of maximal retry attempts
* @defaultValue 10
*/
retries: number | "INFINITELY";

// wait time between retries in ms (default: 100)
/**
* wait time between retries in ms
* @defaultValue 100
*/
delay: number;

// check the result, will retry until true (default: () => true)
/**
* check the result, will retry until true
* @defaultValue () => true
*/
until: (t: T) => boolean;

// log events (default: () => undefined)
/**
* log events
* @defaultValue () => undefined
*/
logger: (msg: string) => void;

// overall timeout in ms (default: 60 * 1000)
/**
* overall timeout in ms
* @defaultValue 60 * 1000
*/
timeout: number | "INFINITELY";

// increase delay with every retry (default: "FIXED")
/**
* increase delay with every retry
* @defaultValue "FIXED"
*/
backoff: "FIXED" | "EXPONENTIAL" | "LINEAR" | ((attempt: number, delay: number) => number);

// maximal backoff in ms (default: 5 * 60 * 1000)
/**
* maximal backoff in ms
* @defaultValue 5 * 60 * 1000
*/
maxBackOff: number;

// allows to abort retrying for certain errors
/**
* allows to abort retrying for certain errors
*/
retryIf: (error: any) => boolean
}

Expand Down

0 comments on commit 0e04410

Please sign in to comment.