@types/promise-retry
Advanced tools
Comparing version 1.1.3 to 1.1.4
@@ -17,3 +17,3 @@ // Type definitions for promise-retry 1.1 | ||
*/ | ||
type RetryableFn<ResolutionType> = ((retry: (error: any) => never, attempt: number) => Promise<ResolutionType>); | ||
type RetryableFn<ResolutionType> = (retry: (error: any) => never, attempt: number) => Promise<ResolutionType>; | ||
/** | ||
@@ -26,4 +26,10 @@ * Wrap all functions of the object with retry. The params can be entered in either order, just like in the original library. | ||
*/ | ||
declare function promiseRetry<ResolutionType>(retryableFn: RetryableFn<ResolutionType>, options?: OperationOptions): Promise<ResolutionType>; | ||
declare function promiseRetry<ResolutionType>(options: OperationOptions, retryableFn: RetryableFn<ResolutionType>): Promise<ResolutionType>; | ||
declare function promiseRetry<ResolutionType>( | ||
retryableFn: RetryableFn<ResolutionType>, | ||
options?: OperationOptions, | ||
): Promise<ResolutionType>; | ||
declare function promiseRetry<ResolutionType>( | ||
options: OperationOptions, | ||
retryableFn: RetryableFn<ResolutionType>, | ||
): Promise<ResolutionType>; | ||
export = promiseRetry; |
{ | ||
"name": "@types/promise-retry", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"description": "TypeScript definitions for promise-retry", | ||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/promise-retry", | ||
"license": "MIT", | ||
@@ -14,6 +15,7 @@ "contributors": [ | ||
"main": "", | ||
"types": "index", | ||
"types": "index.d.ts", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git" | ||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", | ||
"directory": "types/promise-retry" | ||
}, | ||
@@ -24,4 +26,4 @@ "scripts": {}, | ||
}, | ||
"typesPublisherContentHash": "06c40995b0e9e4da646a25aed9dd1d32591ead03ad4ebfdb15646ab86d74f697", | ||
"typeScriptVersion": "2.3" | ||
"typesPublisherContentHash": "92d1c515317a62eaf1775d4dd4fda1f73308fb21c9d78dbf3266a8c25b945eeb", | ||
"typeScriptVersion": "4.5" | ||
} |
@@ -8,10 +8,47 @@ # Installation | ||
# Details | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/promise-retry | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/promise-retry. | ||
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/promise-retry/index.d.ts) | ||
````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 | ||
Additional Details | ||
* Last updated: Thu, 03 Jan 2019 17:45:50 GMT | ||
* Dependencies: @types/retry | ||
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](https://npmjs.com/package/@types/retry) | ||
* Global values: none | ||
# Credits | ||
These definitions were written by Jamie Birch <https://github.com/shirakaba>. | ||
These definitions were written by [Jamie Birch](https://github.com/shirakaba). |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
5998
32
0
54