Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/got

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/got - npm Package Compare versions

Comparing version 9.2.2 to 9.3.0

52

got/index.d.ts

@@ -1,2 +0,2 @@

// Type definitions for got 9.2
// Type definitions for got 9.3
// Project: https://github.com/sindresorhus/got#readme

@@ -105,8 +105,46 @@ // Definitions by: BendingBender <https://github.com/BendingBender>

type Hook<T> = (options: T) => any;
type Hooks<T> = Record<'beforeRequest', Array<Hook<T>>>;
/**
* Hooks allow modifications during the request lifecycle. Hook functions may be async and are
* run serially.
*
* @see https://github.com/sindresorhus/got#hooks
* @template Options Request options.
* @template Body Response body type.
*/
interface Hooks<Options, Body extends Buffer | string | object> {
beforeRequest?: Array<BeforeRequestHook<Options>>;
beforeRedirect?: Array<BeforeRedirectHook<Options>>;
beforeRetry?: Array<BeforeRetryHook<Options>>;
afterResponse?: Array<AfterResponseHook<Options, Body>>;
}
/**
* @param options Normalized request options.
*/
type BeforeRequestHook<Options> = (options: Options) => any;
/**
* @param options Normalized request options.
*/
type BeforeRedirectHook<Options> = (options: Options) => any;
/**
* @param options Normalized request options.
* @param error Request error.
* @param retryCount Number of retry.
*/
type BeforeRetryHook<Options> = (options: Options, error: GotError, retryCount: number) => any;
/**
* @param response Response object.
* @param retryWithMergedOptions Retries request with the updated options.
*/
type AfterResponseHook<Options, Body extends Buffer | string | object> = (
response: Response<Body>,
retryWithMergedOptions: (updateOptions: Options) => GotPromise<Body>
) => Response<Body> | Promise<Response<Body>>;
interface GotBodyOptions<E extends string | null> extends GotOptions<E> {
body?: string | Buffer | nodeStream.Readable;
hooks?: Hooks<GotBodyOptions<E>>;
hooks?: Hooks<GotBodyOptions<E>, string | Buffer | nodeStream.Readable>;
}

@@ -119,10 +157,10 @@

json: true;
hooks?: Hooks<GotJSONOptions>;
hooks?: Hooks<GotJSONOptions, object>;
}
interface GotFormOptions<E extends string | null> extends GotOptions<E> {
body?: {[key: string]: any};
body?: Record<string, any>;
form: true;
json?: boolean;
hooks?: Hooks<GotFormOptions<E>>;
hooks?: Hooks<GotFormOptions<E>, Record<string, any>>;
}

@@ -129,0 +167,0 @@

4

got/package.json
{
"name": "@types/got",
"version": "9.2.2",
"version": "9.3.0",
"description": "TypeScript definitions for got",

@@ -39,4 +39,4 @@ "license": "MIT",

},
"typesPublisherContentHash": "fd320f37e388a74af1bb96016ee7d9593c422ad9dc4d18eaef59298a81039a4f",
"typesPublisherContentHash": "df4a012b25eac238c78af9a1df6a26cf7a095e2670f3a02eb1f983180bd2a889",
"typeScriptVersion": "2.3"
}

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

Additional Details
* Last updated: Tue, 18 Dec 2018 21:06:51 GMT
* Last updated: Wed, 02 Jan 2019 22:29:07 GMT
* Dependencies: @types/tough-cookie, @types/node

@@ -14,0 +14,0 @@ * Global values: none

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