@types/got
Advanced tools
Comparing version 9.4.1 to 9.4.2
@@ -7,4 +7,5 @@ // Type definitions for got 9.4 | ||
// Stijn Van Nieuwenhuyse <https://github.com/stijnvn> | ||
// Matthew Bull <https://github.com/wingsbob> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// TypeScript Version: 2.3 | ||
// TypeScript Version: 2.8 | ||
@@ -73,15 +74,3 @@ /// <reference types="node"/> | ||
declare const got: got.GotFn & | ||
Record<'get' | 'post' | 'put' | 'patch' | 'head' | 'delete', got.GotFn> & | ||
{ | ||
stream: got.GotStreamFn & Record<'get' | 'post' | 'put' | 'patch' | 'head' | 'delete', got.GotStreamFn>; | ||
RequestError: typeof RequestError; | ||
ReadError: typeof ReadError; | ||
ParseError: typeof ParseError; | ||
HTTPError: typeof HTTPError; | ||
MaxRedirectsError: typeof MaxRedirectsError; | ||
UnsupportedProtocolError: typeof UnsupportedProtocolError; | ||
CancelError: typeof CancelError; | ||
TimeoutError: typeof TimeoutError; | ||
}; | ||
declare const got: got.GotInstance; | ||
@@ -104,2 +93,40 @@ interface InternalRequestOptions extends https.RequestOptions { | ||
interface GotJSONFn { | ||
(url: GotUrl): GotPromise<any>; | ||
(url: GotUrl, options: GotJSONOptions): GotPromise<any>; | ||
} | ||
interface GotFormFn<T extends string | null> { | ||
(url: GotUrl): GotPromise<T extends null ? Buffer : string>; | ||
(url: GotUrl, options: GotFormOptions<T>): GotPromise<T extends null ? Buffer : string>; | ||
} | ||
interface GotBodyFn<T extends string | null> { | ||
(url: GotUrl): GotPromise<T extends null ? Buffer : string>; | ||
(url: GotUrl, options: GotBodyOptions<T>): GotPromise<T extends null ? Buffer : string>; | ||
} | ||
type GotInstance<T = GotFn> = T & | ||
Record<'get' | 'post' | 'put' | 'patch' | 'head' | 'delete', T> & | ||
{ | ||
stream: GotStreamFn & Record<'get' | 'post' | 'put' | 'patch' | 'head' | 'delete', GotStreamFn>; | ||
extend: GotExtend; | ||
RequestError: typeof RequestError; | ||
ReadError: typeof ReadError; | ||
ParseError: typeof ParseError; | ||
HTTPError: typeof HTTPError; | ||
MaxRedirectsError: typeof MaxRedirectsError; | ||
UnsupportedProtocolError: typeof UnsupportedProtocolError; | ||
CancelError: typeof CancelError; | ||
TimeoutError: typeof TimeoutError; | ||
}; | ||
interface GotExtend { | ||
(options: GotJSONOptions): GotInstance<GotJSONFn>; | ||
(options: GotFormOptions<string>): GotInstance<GotFormFn<string>>; | ||
(options: GotFormOptions<null>): GotInstance<GotFormFn<null>>; | ||
(options: GotBodyOptions<string>): GotInstance<GotBodyFn<string>>; | ||
(options: GotBodyOptions<null>): GotInstance<GotBodyFn<null>>; | ||
} | ||
type GotStreamFn = (url: GotUrl, options?: GotOptions<string | null>) => GotEmitter & nodeStream.Duplex; | ||
@@ -106,0 +133,0 @@ |
{ | ||
"name": "@types/got", | ||
"version": "9.4.1", | ||
"version": "9.4.2", | ||
"description": "TypeScript definitions for got", | ||
@@ -26,2 +26,7 @@ "license": "MIT", | ||
"githubUsername": "stijnvn" | ||
}, | ||
{ | ||
"name": "Matthew Bull", | ||
"url": "https://github.com/wingsbob", | ||
"githubUsername": "wingsbob" | ||
} | ||
@@ -41,4 +46,4 @@ ], | ||
}, | ||
"typesPublisherContentHash": "bf78ab4c49da39cec521d751986104fbfcfa56b5fb472f830b9ab331336c3165", | ||
"typeScriptVersion": "2.3" | ||
"typesPublisherContentHash": "e496ed07d4c51aa7101e8e30208f355c99078335abd7b7ea3d55c41cc1e606f9", | ||
"typeScriptVersion": "2.8" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
Additional Details | ||
* Last updated: Mon, 25 Feb 2019 23:39:43 GMT | ||
* Last updated: Mon, 15 Apr 2019 19:58:20 GMT | ||
* Dependencies: @types/tough-cookie, @types/node | ||
@@ -17,2 +17,2 @@ * Global values: none | ||
# Credits | ||
These definitions were written by BendingBender <https://github.com/BendingBender>, Linus Unnebäck <https://github.com/LinusU>, Konstantin Ikonnikov <https://github.com/ikokostya>, Stijn Van Nieuwenhuyse <https://github.com/stijnvn>. | ||
These definitions were written by BendingBender <https://github.com/BendingBender>, Linus Unnebäck <https://github.com/LinusU>, Konstantin Ikonnikov <https://github.com/ikokostya>, Stijn Van Nieuwenhuyse <https://github.com/stijnvn>, Matthew Bull <https://github.com/wingsbob>. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16763
289