JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5882
  • Score
    100M100P100Q128549F
  • License MIT

TypeScript definitions for requestretry

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@types/requestretry) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    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.

    index.d.ts

    /// <reference types="node" />
    
    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.