# @types/promise-fn-retry

> TypeScript definitions for promise-fn-retry

Latest version **1.0.4** (published 2024-09-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/promise-fn-retry
pnpm add @types/promise-fn-retry
yarn add @types/promise-fn-retry
bun add @types/promise-fn-retry
```

## Health

**Score 40/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2024-09-23 |
| First published | 2022-05-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51390 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/promise-fn-retry
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/promise-fn-retry
- npm.io page: https://npm.io/package/@types/promise-fn-retry

## Recent versions

- 1.0.4 (latest) — 2024-09-23
- 1.0.3 (ts4.5) — 2023-11-07
- 1.0.0 (ts3.9) — 2022-05-17
- 1.0.2 — 2023-10-18
- 1.0.1 — 2023-09-24

## README

# Installation
> `npm install --save @types/promise-fn-retry`

# Summary
This package contains type definitions for promise-fn-retry (https://github.com/felippemauricio/promise-fn-retry).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/promise-fn-retry.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/promise-fn-retry/index.d.ts)
````ts
declare namespace retry {
    interface RetryOptions {
        /**
         * The number of times the lib will retry execute the promiseFn.
         *
         * @default 1
         */
        times?: number;
        /**
         * The first wait time to delay.
         *
         * @default 100
         */
        initialDelayTime?: number;
        /**
         * This callback is executed on each retry. It's useful to log your errors to a log
         * service for example.
         *
         * @default null
         */
        onRetry?: ((err: unknown, optionsParsed: RetryControlOptions) => void) | null;
        /**
         * This callback is executed before each retry to determine if it's necessary retrying.
         * If the function returns true, the next retry will be executed, else the retrying will
         * be canceled.
         *
         * @default null
         */
        shouldRetry?: ((err: unknown) => boolean) | null;
    }

    interface RetryControlOptions extends RetryOptions {
        /**
         * The number of retries that are already made.
         */
        retained: number;
        /**
         * The current delay time that is used in current retry.
         */
        currentDelay: number | null;
    }
}

declare function retry<T>(
    requestFn: () => Promise<T>,
    options?: retry.RetryOptions,
): Promise<T>;

export = retry;

````

### Additional Details
 * Last updated: Mon, 23 Sep 2024 18:39:57 GMT
 * Dependencies: none

# Credits
These definitions were written by [Jonathan Chang](https://github.com/Jono-Chang).

---
_Source: https://npm.io/package/@types/promise-fn-retry · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
