Installation
npm install --save @types/requestretry
Summary
This package contains type definitions for requestretry (https://github.com/FGRibreau/node-request-retry).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/requestretry.
import request = require("request");
import http = require("http");
declare namespace requestretry {
type RetryStrategy = (err: Error, response: http.IncomingMessage, body: any) => boolean;
type DelayStrategy = (err: Error, response: http.IncomingMessage, body: any) => number;
interface RequestPromise extends request.Request {
then: Promise<any>["then"];
catch: Promise<any>["catch"];
promise(): Promise<any>;
}
interface RetryRequestAPI extends request.RequestAPI<RequestPromise, RequestRetryOptions, request.RequiredUriUrl> {
RetryStrategies: {
"HttpError": RetryStrategy;
"HTTPOrNetworkError": RetryStrategy;
"NetworkError": RetryStrategy;
};
}
interface RequestRetryOptions extends request.CoreOptions {
maxAttempts?: number | undefined;
promiseFactory?(resolver: any): any;
retryDelay?: number | undefined;
retryStrategy?: RetryStrategy | undefined;
delayStrategy?: DelayStrategy | undefined;
fullResponse?: boolean | undefined;
skipHeaderSanitize?: boolean | undefined;
}
}
declare let requestretry: requestretry.RetryRequestAPI;
export = requestretry;
Additional Details
Credits
These definitions were written by Eric Byers, Andrew Throener, Aniket Patel, and Aram Elchyan.