@types/superagent

  • Version 8.1.6
  • Published
  • 21.3 kB
  • 3 dependencies
  • MIT license

Install

npm i @types/superagent
yarn add @types/superagent
pnpm add @types/superagent

Overview

TypeScript definitions for superagent

Index

Variables

variable request

const request: request.SuperAgentStatic<request.Request>;

    Interfaces

    interface HTTPError

    interface HTTPError extends Error {}

      property method

      method: string;

        property path

        path: string;

          property status

          status: number;

            property text

            text: string;

              interface ProgressEvent

              interface ProgressEvent {}

                property direction

                direction: 'download' | 'upload';

                  property loaded

                  loaded: number;

                    property percent

                    percent?: number | undefined;

                      property total

                      total?: number | undefined;

                        interface Request

                        interface Request extends SARequest {}

                          interface Response

                          interface Response extends ResponseBase {}

                            interface ResponseError

                            interface ResponseError extends Error {}

                              property response

                              response?: Response | undefined;

                                property status

                                status?: number | undefined;

                                  property timeout

                                  timeout?: boolean | undefined;

                                    interface SuperAgentStatic

                                    interface SuperAgentStatic<Req extends Request = Request> extends SuperAgent<Req> {}

                                      property agent

                                      agent: typeof SAgent &
                                      ((options?: SAgentOptions) => InstanceType<typeof SAgent>);

                                        property buffer

                                        buffer: Record<string, boolean>;

                                          property parse

                                          parse: Record<
                                          string,
                                          (res: Response, cb: (err: any, res: Response) => void) => void
                                          >;

                                            property protocols

                                            protocols: {
                                            'http:': typeof http;
                                            'https:': typeof https;
                                            'http2:': typeof http2;
                                            };

                                              property Request

                                              Request: typeof SARequest;

                                                property Response

                                                Response: typeof ResponseBase;

                                                  property serialize

                                                  serialize: Record<string, (...args: any[]) => string>;

                                                    call signature

                                                    (url: URLType): Request;

                                                      call signature

                                                      (method: string, url: URLType): Request;

                                                        call signature

                                                        (url: URLType, cb: CBHandler): void;

                                                          Type Aliases

                                                          type Agent

                                                          type Agent = SAgent;

                                                            type AgentOptions

                                                            type AgentOptions = SAgentOptions;

                                                              type CallbackHandler

                                                              type CallbackHandler = CBHandler;

                                                                type MultipartValueSingle

                                                                type MultipartValueSingle = Blob | Buffer | ReadStream | string | boolean | number;

                                                                  type Plugin

                                                                  type Plugin = (req: Request) => void;

                                                                    type SuperAgent

                                                                    type SuperAgent<Req extends Request = Request> = RequestMethods<Req> & Stream;

                                                                      type SuperAgentRequest

                                                                      type SuperAgentRequest = Request;

                                                                        Package Files (2)

                                                                        Dependencies (3)

                                                                        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/superagent.

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