@types/follow-redirects

  • Version 1.13.1
  • Published
  • 7.98 kB
  • 1 dependency
  • MIT license

Install

npm i @types/follow-redirects
yarn add @types/follow-redirects
pnpm add @types/follow-redirects

Overview

TypeScript definitions for follow-redirects

Index

Variables

variable http

const http: Pick<any, string | number | symbol> & RedirectScheme<any, any, any>;

    variable https

    const https: Pick<any, string | number | symbol> & RedirectScheme<any, any, any>;

      Functions

      function wrap

      wrap: <T extends { [key: string]: Scheme<any, any, any> }>(
      protocols: T
      ) => { [K in keyof T]: WrappedScheme<T[K]> };

        Interfaces

        interface FollowOptions

        interface FollowOptions<Options> {}

          property agents

          agents?:
          | {
          http?: coreHttp.Agent | undefined;
          https?: coreHttps.Agent | undefined;
          }
          | undefined;

            property beforeRedirect

            beforeRedirect?:
            | ((
            options: Options & FollowOptions<Options>,
            responseDetails: ResponseDetails
            ) => void)
            | undefined;

              property followRedirects

              followRedirects?: boolean | undefined;

                property maxBodyLength

                maxBodyLength?: number | undefined;

                  property maxRedirects

                  maxRedirects?: number | undefined;

                    property trackRedirects

                    trackRedirects?: boolean | undefined;

                      interface FollowResponse

                      interface FollowResponse {}

                        property redirects

                        redirects: Redirect[];

                          property responseUrl

                          responseUrl: string;

                            interface Redirect

                            interface Redirect {}

                              property headers

                              headers: coreHttp.IncomingHttpHeaders;

                                property statusCode

                                statusCode: number;

                                  property url

                                  url: string;

                                    interface RedirectableRequest

                                    interface RedirectableRequest<Request extends WrappableRequest, Response>
                                    extends Writable {}

                                      property abort

                                      abort: Request['abort'];

                                        property flushHeaders

                                        flushHeaders: Request['flushHeaders'];

                                          property getHeader

                                          getHeader: Request['getHeader'];

                                            property removeHeader

                                            removeHeader: Request['removeHeader'];

                                              property setHeader

                                              setHeader: Request['setHeader'];

                                                property setNoDelay

                                                setNoDelay: Request['setNoDelay'];

                                                  property setSocketKeepAlive

                                                  setSocketKeepAlive: Request['setSocketKeepAlive'];

                                                    property setTimeout

                                                    setTimeout: Request['setTimeout'];

                                                      method addListener

                                                      addListener: {
                                                      (event: string, listener: (...args: any[]) => void): this;
                                                      (event: 'response', listener: (response: Response) => void): this;
                                                      (event: 'error', listener: (err: Error) => void): this;
                                                      };

                                                        method emit

                                                        emit: {
                                                        (event: string | symbol, ...args: any[]): boolean;
                                                        (event: 'response', response: Response): boolean;
                                                        (event: 'error', err: Error): boolean;
                                                        };

                                                          method on

                                                          on: {
                                                          (event: string, listener: (...args: any[]) => void): this;
                                                          (event: 'response', listener: (response: Response) => void): this;
                                                          (event: 'error', listener: (err: Error) => void): this;
                                                          };

                                                            method once

                                                            once: {
                                                            (event: string, listener: (...args: any[]) => void): this;
                                                            (event: 'response', listener: (response: Response) => void): this;
                                                            (event: 'error', listener: (err: Error) => void): this;
                                                            };

                                                              method prependListener

                                                              prependListener: {
                                                              (event: string, listener: (...args: any[]) => void): this;
                                                              (event: 'response', listener: (response: Response) => void): this;
                                                              (event: 'error', listener: (err: Error) => void): this;
                                                              };

                                                                method prependOnceListener

                                                                prependOnceListener: {
                                                                (event: string, listener: (...args: any[]) => void): this;
                                                                (event: 'response', listener: (response: Response) => void): this;
                                                                (event: 'error', listener: (err: Error) => void): this;
                                                                };

                                                                  interface RedirectScheme

                                                                  interface RedirectScheme<Options, Request extends WrappableRequest, Response> {}

                                                                    method get

                                                                    get: (
                                                                    options: string | (Options & FollowOptions<Options>),
                                                                    callback?: (res: Response & FollowResponse) => void
                                                                    ) => RedirectableRequest<Request, Response>;

                                                                      method request

                                                                      request: (
                                                                      options: string | (Options & FollowOptions<Options>),
                                                                      callback?: (res: Response & FollowResponse) => void
                                                                      ) => RedirectableRequest<Request, Response>;

                                                                        interface ResponseDetails

                                                                        interface ResponseDetails {}

                                                                          property headers

                                                                          headers: coreHttp.IncomingHttpHeaders;

                                                                            interface Scheme

                                                                            interface Scheme<Options, Request extends WrappableRequest, Response> {}

                                                                              method request

                                                                              request: (options: Options, callback?: (res: Response) => any) => Request;

                                                                                interface WrappableRequest

                                                                                interface WrappableRequest {}

                                                                                  method abort

                                                                                  abort: (...args: any[]) => any;

                                                                                    method flushHeaders

                                                                                    flushHeaders: (...args: any[]) => any;

                                                                                      method getHeader

                                                                                      getHeader: (...args: any[]) => any;

                                                                                        method removeHeader

                                                                                        removeHeader: (...args: any[]) => any;

                                                                                          method setHeader

                                                                                          setHeader: (...args: any[]) => any;

                                                                                            method setNoDelay

                                                                                            setNoDelay: (...args: any[]) => any;

                                                                                              method setSocketKeepAlive

                                                                                              setSocketKeepAlive: (...args: any[]) => any;

                                                                                                method setTimeout

                                                                                                setTimeout: (...args: any[]) => any;

                                                                                                  interface WrappableResponse

                                                                                                  interface WrappableResponse {}

                                                                                                    property headers

                                                                                                    headers: {
                                                                                                    location?: string | undefined;
                                                                                                    };

                                                                                                      property statusCode

                                                                                                      statusCode?: number | undefined;

                                                                                                        method destroy

                                                                                                        destroy: () => any;

                                                                                                          Type Aliases

                                                                                                          type Override

                                                                                                          type Override<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U;

                                                                                                            type WrappedScheme

                                                                                                            type WrappedScheme<T extends Scheme<any, any, any>> = Override<
                                                                                                            T,
                                                                                                            RedirectScheme<
                                                                                                            T extends Scheme<infer Options, any, any> ? Options : never,
                                                                                                            T extends Scheme<any, infer Request, any> ? Request : never,
                                                                                                            T extends Scheme<any, any, infer Response> ? Response : never
                                                                                                            >
                                                                                                            >;

                                                                                                              Package Files (1)

                                                                                                              Dependencies (1)

                                                                                                              Dev Dependencies (0)

                                                                                                              No dev dependencies.

                                                                                                              Peer Dependencies (0)

                                                                                                              No peer dependencies.

                                                                                                              Badge

                                                                                                              To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                              You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/follow-redirects.

                                                                                                              • Markdown
                                                                                                                [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/follow-redirects)
                                                                                                              • HTML
                                                                                                                <a href="https://www.jsdocs.io/package/@types/follow-redirects"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>