Socket
Socket
Sign inDemoInstall

@types/superagent

Package Overview
Dependencies
Maintainers
1
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/superagent - npm Package Compare versions

Comparing version 8.1.3 to 8.1.4

superagent/lib/node/http2wrapper.d.ts

17

superagent/lib/node/index.d.ts

@@ -5,3 +5,2 @@ import * as http from "http";

import { Stream } from "stream";
import { UrlObject } from "url";
import methods = require("methods");

@@ -15,7 +14,8 @@

import ResponseBase = require("./response");
import { AgentOptions as SAgentOptions, CBHandler } from "../../types";
import { AgentOptions as SAgentOptions, CBHandler, URLType } from "../../types";
import { Request as Http2Request } from "./http2wrapper";
type HttpMethod<Req extends request.Request> =
| ((url: string, callback?: CBHandler) => Req)
| ((url: string, data?: string | Record<string, any>, callback?: CBHandler) => Req);
| ((url: URLType, callback?: CBHandler) => Req)
| ((url: URLType, data?: string | Record<string, any>, callback?: CBHandler) => Req);

@@ -27,3 +27,3 @@ type RequestMethods<Req extends request.Request> = {

declare class SARequest extends Stream implements RequestBase {
constructor(method: string, url: string | URL | UrlObject);
constructor(method: string, url: URLType);

@@ -33,2 +33,4 @@ method: string;

cookies: string;
req: http.ClientRequest | Http2Request;
res: http.IncomingMessage | (http2.IncomingHttpHeaders & http2.IncomingHttpStatusHeader);

@@ -147,4 +149,5 @@ [Symbol.toStringTag]: string;

interface SuperAgentStatic<Req extends Request = Request> extends SuperAgent<Req> {
(url: string): Request;
(method: string, url: string): Request;
(url: URLType): Request;
(method: string, url: URLType): Request;
(url: URLType, cb: CBHandler): void;

@@ -151,0 +154,0 @@ Request: typeof SARequest;

@@ -1,5 +0,4 @@

/// <reference types="node" />
import { IncomingMessage } from "http";
import { Stream } from "stream";
import { Request } from "./index";

@@ -12,2 +11,3 @@ interface HTTPError extends Error {

}
declare class Response extends Stream implements Pick<IncomingMessage, "setEncoding"> {

@@ -35,3 +35,3 @@ constructor(request: Request);

redirect: boolean;
request: InstanceType<typeof Request>;
request: Request;
serverError: boolean;

@@ -38,0 +38,0 @@ status: number;

{
"name": "@types/superagent",
"version": "8.1.3",
"version": "8.1.4",
"description": "TypeScript definitions for superagent",

@@ -82,4 +82,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/superagent",

},
"typesPublisherContentHash": "1c245243cbbb48e72d67b5dd5f59de0367490dfd1774e80ca587496a330456c2",
"typesPublisherContentHash": "15add25217a53e14127d56beba4791343c6cf10355c5b9e415a440709daa96b1",
"typeScriptVersion": "4.6"
}

@@ -11,3 +11,3 @@ # Installation

### Additional Details
* Last updated: Wed, 24 Jan 2024 22:35:49 GMT
* Last updated: Mon, 26 Feb 2024 20:07:44 GMT
* Dependencies: [@types/cookiejar](https://npmjs.com/package/@types/cookiejar), [@types/methods](https://npmjs.com/package/@types/methods), [@types/node](https://npmjs.com/package/@types/node)

@@ -14,0 +14,0 @@

import Response = require("./lib/node/response");
import { UrlObject } from "url";

@@ -12,1 +13,3 @@ export interface AgentOptions {

export type CBHandler = (err: any, res: Response) => void;
export type URLType = string | URL | UrlObject;
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc