export declare class RetryError extends Error { constructor(message: string); } export type RetryCallback = (attempt: number) => Promise | T; export interface RetryOptions { /** * The number of attempts before throwing last error * * (Default is Infinity) */ attempts?: number; /** * The millisecond delay between subsequent retry attempts * * (Default is 1000) */ delay?: number; /** * A multiplier used to increase (or decrease) the delay for subsequent retry attempts. * This option can be used to implement exponential back-off strategies. * * (Default is 1.0) */ multiplier?: number; /** * This option specifies a upper threshold for multiplied delay values. This option should be * set when attempt counts are high and where multipler values are greater than 1.0. * * (Default is Infinity) */ maximumDelay?: number; /** * This option specifies a lower threshold for multiplied delay values. This option should be * set when attempt counts are high and where multipler values are less than 1.0. * * (Default is 0) */ minimumDelay?: number; } export declare namespace Retry { /** Will repeatedly run the given callback until a value is successfully returned. The function will throw the last callback error if attempts exceed the configured threshold */ function run(callback: RetryCallback, options?: RetryOptions): Promise; }