@types/promise-retry
TypeScript definitions for promise-retry
Last updated 3 years ago by types .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install @types/promise-retry 
SYNC missed versions from official npm registry.

Installation

npm install --save @types/promise-retry

Summary

This package contains type definitions for promise-retry (https://github.com/IndigoUnited/node-promise-retry).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/promise-retry.

index.d.ts

// Type definitions for promise-retry 1.1
// Project: https://github.com/IndigoUnited/node-promise-retry
// Definitions by: Jamie Birch <https://github.com/shirakaba>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3

import { OperationOptions } from "retry";
/**
 * A function that is retryable, by having implicitly-bound params for both an error handler and an attempt number.
 *
 * @param retry The retry callback upon any rejection. Essentially throws the error on in the form of a { retried: err }
 * wrapper, and tags it with a 'code' field of value "EPROMISERETRY" so that it is recognised as needing retrying. Call
 * this from the catch() block when you want to retry a rejected attempt.
 * @param attempt The number of the attempt.
 * @returns A Promise for anything (eg. a HTTP response).
 */
type RetryableFn<ResolutionType> = (retry: (error: any) => never, attempt: number) => Promise<ResolutionType>;
/**
 * Wrap all functions of the object with retry. The params can be entered in either order, just like in the original library.
 *
 * @param retryableFn The function to retry.
 * @param options The options for how long/often to retry the function for.
 * @returns The Promise resolved by the input retryableFn, or rejected (if not retried) from its catch block.
 */
declare function promiseRetry<ResolutionType>(
    retryableFn: RetryableFn<ResolutionType>,
    options?: OperationOptions,
): Promise<ResolutionType>;
declare function promiseRetry<ResolutionType>(
    options: OperationOptions,
    retryableFn: RetryableFn<ResolutionType>,
): Promise<ResolutionType>;
export = promiseRetry;

Additional Details

  • Last updated: Sun, 24 Sep 2023 06:37:28 GMT
  • Dependencies: @types/retry
  • Global values: none

Credits

These definitions were written by Jamie Birch.

Current Tags

  • 1.1.4                                ...           latest (3 years ago)
  • 1.1.0                                ...           ts2.0 (8 years ago)
  • 1.1.0                                ...           ts2.1 (8 years ago)
  • 1.1.0                                ...           ts2.2 (8 years ago)
  • 1.1.3                                ...           ts2.3 (7 years ago)
  • 1.1.3                                ...           ts2.4 (7 years ago)
  • 1.1.3                                ...           ts2.5 (7 years ago)
  • 1.1.3                                ...           ts2.6 (7 years ago)
  • 1.1.3                                ...           ts2.7 (7 years ago)
  • 1.1.3                                ...           ts2.8 (7 years ago)
  • 1.1.3                                ...           ts2.9 (7 years ago)
  • 1.1.3                                ...           ts3.0 (7 years ago)
  • 1.1.3                                ...           ts3.1 (7 years ago)
  • 1.1.3                                ...           ts3.2 (7 years ago)
  • 1.1.3                                ...           ts3.3 (7 years ago)
  • 1.1.3                                ...           ts3.4 (7 years ago)
  • 1.1.3                                ...           ts3.5 (7 years ago)
  • 1.1.3                                ...           ts3.6 (7 years ago)
  • 1.1.3                                ...           ts3.7 (7 years ago)
  • 1.1.3                                ...           ts3.8 (7 years ago)
  • 1.1.3                                ...           ts3.9 (7 years ago)
  • 1.1.3                                ...           ts4.0 (7 years ago)
  • 1.1.3                                ...           ts4.1 (7 years ago)
  • 1.1.3                                ...           ts4.2 (7 years ago)
  • 1.1.3                                ...           ts4.3 (7 years ago)
  • 1.1.3                                ...           ts4.4 (7 years ago)
  • 1.1.4                                ...           ts4.5 (3 years ago)
  • 1.1.4                                ...           ts4.6 (3 years ago)
  • 1.1.4                                ...           ts4.7 (3 years ago)
  • 1.1.4                                ...           ts4.8 (3 years ago)
  • 1.1.4                                ...           ts4.9 (3 years ago)
  • 1.1.4                                ...           ts5.0 (3 years ago)
  • 1.1.4                                ...           ts5.1 (3 years ago)
  • 1.1.4                                ...           ts5.2 (3 years ago)
  • 1.1.4                                ...           ts5.3 (3 years ago)

5 Versions

  • 1.1.4                                ...           3 years ago
  • 1.1.3                                ...           7 years ago
  • 1.1.2                                ...           8 years ago
  • 1.1.1                                ...           8 years ago
  • 1.1.0                                ...           8 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 0
Dependencies (1)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org | Home |