Installation
npm install --save @types/async-retry
Summary
This package contains type definitions for async-retry (https://github.com/vercel/async-retry).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/async-retry.
import { WrapOptions } from "retry";
declare function AsyncRetry<TRet, TErr = unknown>(
fn: AsyncRetry.RetryFunction<TRet, TErr>,
opts?: AsyncRetry.Options<TErr> | number[],
): Promise<TRet>;
declare namespace AsyncRetry {
interface Options<TErr = unknown> extends Omit<WrapOptions, "randomize"> {
onRetry?: ((e: TErr, attempt: number) => any) | undefined;
randomize?: boolean | undefined;
}
type RetryFunction<TRet, TErr = unknown> = (bail: (e: TErr) => void, attempt: number) => TRet | Promise<TRet>;
}
export = AsyncRetry;
Additional Details
- Last updated: Wed, 02 Oct 2024 18:10:02 GMT
- Dependencies: @types/retry
Credits
These definitions were written by Albert Wu, Pablo Rodríguez, Rafał Sawicki, and BendingBender.