import { GenericAsyncCallback, GenericCallback } from "../models.mjs"; //#region src/function/retry.d.ts /** * An error thrown when a retry fails */ declare class RetryError extends Error { readonly original: unknown; constructor(message: string, original: unknown); } type RetryOptions = { delay?: number; times?: number; when?: (error: unknown) => boolean; }; /** * Retry a callback a specified number of times, with a delay between attempts * * _Available as `asyncRetry` and `retry.async`_ * * @param callback Callback to retry * @param options Retry options * @returns Callback result */ declare function asyncRetry(callback: Callback, options?: RetryOptions): Promise>>; /** * Retry a callback a specified number of times, with a delay between attempts * * _Available as `asyncRetry` and `retry.async`_ * * @param callback Callback to retry * @param options Retry options * @returns Callback result */ declare function asyncRetry(callback: Callback, options?: RetryOptions): Promise>; /** * Retry a callback a specified number of times * * @param callback Callback to retry * @param options Retry options * @returns Callback result */ declare function retry(callback: Callback, options?: Omit): ReturnType; declare namespace retry { var async: typeof asyncRetry; } //#endregion export { RetryError, RetryOptions, retry };