@types/follow-redirects
- Version 1.14.4
- Published
- 8.29 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
Functions
Interfaces
Type Aliases
Variables
variable http
const http: Pick<any, string | number | symbol> & RedirectScheme< coreHttp.RequestOptions, coreHttp.ClientRequest, coreHttp.IncomingMessage >;
variable https
const https: Pick<any, string | number | symbol> & RedirectScheme< coreHttps.RequestOptions, coreHttp.ClientRequest, coreHttp.IncomingMessage >;
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: ( url: string | URL | (Options & FollowOptions<Options>), options?: | (Options & FollowOptions<Options>) | ((res: Response & FollowResponse) => void), callback?: (res: Response & FollowResponse) => void) => RedirectableRequest<Request, Response>;
This function has two overloads:
get(options: string | URL | Options, callback)get(url: string | URL, options: Options, callback)
method request
request: ( url: string | URL | (Options & FollowOptions<Options>), options?: | (Options & FollowOptions<Options>) | ((res: Response & FollowResponse) => void), callback?: (res: Response & FollowResponse) => void) => RedirectableRequest<Request, Response>;
This function has two overloads:
request(options: string | URL | Options, callback)request(url: string | URL, options: Options, callback)
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 oneto 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>
- Updated .
Package analyzed in 4267 ms. - Missing or incorrect documentation? Open an issue for this package.