@types/got
Advanced tools
Comparing version 7.1.8 to 8.3.0
@@ -1,5 +0,6 @@ | ||
// Type definitions for got 7.1 | ||
// Type definitions for got 8.3 | ||
// Project: https://github.com/sindresorhus/got#readme | ||
// Definitions by: BendingBender <https://github.com/BendingBender> | ||
// Linus Unnebäck <https://github.com/LinusU> | ||
// Konstantin Ikonnikov <https://github.com/ikokostya> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
@@ -10,4 +11,5 @@ // TypeScript Version: 2.3 | ||
import { Url } from 'url'; | ||
import { Url, URL } from 'url'; | ||
import * as http from 'http'; | ||
import * as https from 'https'; | ||
import * as nodeStream from 'stream'; | ||
@@ -49,2 +51,6 @@ | ||
declare class CancelError extends StdError { | ||
name: 'CancelError'; | ||
} | ||
declare class StdError extends Error { | ||
@@ -64,11 +70,18 @@ code?: string; | ||
{ | ||
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 | ||
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; | ||
}; | ||
interface InternalRequestOptions extends http.RequestOptions { | ||
// Redeclare options with `any` type for allow specify types incompatible with http.RequestOptions. | ||
timeout?: any; | ||
agent?: any; | ||
} | ||
declare namespace got { | ||
@@ -86,3 +99,3 @@ interface GotFn { | ||
type GotUrl = string | http.RequestOptions | Url; | ||
type GotUrl = string | http.RequestOptions | Url | URL; | ||
@@ -105,7 +118,3 @@ interface GotBodyOptions<E extends string | null> extends GotOptions<E> { | ||
interface TimoutRequestOptions extends http.RequestOptions { | ||
timeout?: any; | ||
} | ||
interface GotOptions<E extends string | null> extends TimoutRequestOptions { | ||
interface GotOptions<E extends string | null> extends InternalRequestOptions { | ||
encoding?: E; | ||
@@ -118,2 +127,5 @@ query?: string | object; | ||
useElectronNet?: boolean; | ||
cache?: Map<string, any>; | ||
agent?: http.Agent | boolean | AgentOptions; | ||
throwHttpErrors?: boolean; | ||
} | ||
@@ -127,2 +139,7 @@ | ||
interface AgentOptions { | ||
http: http.Agent; | ||
https: https.Agent; | ||
} | ||
type RetryFunction = (retry: number, error: any) => number; | ||
@@ -134,2 +151,3 @@ | ||
requestUrl: string; | ||
fromCache: boolean; | ||
redirectUrls?: string[]; | ||
@@ -145,2 +163,4 @@ } | ||
addListener(event: 'error', listener: (error: GotError, body?: any, res?: http.IncomingMessage) => void): this; | ||
addListener(event: 'downloadProgress', listener: (progress: Progress) => void): this; | ||
addListener(event: 'uploadProgress', listener: (progress: Progress) => void): this; | ||
@@ -151,2 +171,4 @@ on(event: 'request', listener: (req: http.ClientRequest) => void): this; | ||
on(event: 'error', listener: (error: GotError, body?: any, res?: http.IncomingMessage) => void): this; | ||
on(event: 'downloadProgress', listener: (progress: Progress) => void): this; | ||
on(event: 'uploadProgress', listener: (progress: Progress) => void): this; | ||
@@ -157,2 +179,4 @@ once(event: 'request', listener: (req: http.ClientRequest) => void): this; | ||
once(event: 'error', listener: (error: GotError, body?: any, res?: http.IncomingMessage) => void): this; | ||
once(event: 'downloadProgress', listener: (progress: Progress) => void): this; | ||
once(event: 'uploadProgress', listener: (progress: Progress) => void): this; | ||
@@ -163,2 +187,4 @@ prependListener(event: 'request', listener: (req: http.ClientRequest) => void): this; | ||
prependListener(event: 'error', listener: (error: GotError, body?: any, res?: http.IncomingMessage) => void): this; | ||
prependListener(event: 'downloadProgress', listener: (progress: Progress) => void): this; | ||
prependListener(event: 'uploadProgress', listener: (progress: Progress) => void): this; | ||
@@ -169,2 +195,4 @@ prependOnceListener(event: 'request', listener: (req: http.ClientRequest) => void): this; | ||
prependOnceListener(event: 'error', listener: (error: GotError, body?: any, res?: http.IncomingMessage) => void): this; | ||
prependOnceListener(event: 'downloadProgress', listener: (progress: Progress) => void): this; | ||
prependOnceListener(event: 'uploadProgress', listener: (progress: Progress) => void): this; | ||
@@ -175,5 +203,13 @@ removeListener(event: 'request', listener: (req: http.ClientRequest) => void): this; | ||
removeListener(event: 'error', listener: (error: GotError, body?: any, res?: http.IncomingMessage) => void): this; | ||
removeListener(event: 'downloadProgress', listener: (progress: Progress) => void): this; | ||
removeListener(event: 'uploadProgress', listener: (progress: Progress) => void): this; | ||
} | ||
type GotError = RequestError | ReadError | ParseError | HTTPError | MaxRedirectsError | UnsupportedProtocolError; | ||
type GotError = RequestError | ReadError | ParseError | HTTPError | MaxRedirectsError | UnsupportedProtocolError | CancelError; | ||
interface Progress { | ||
percent: number; | ||
transferred: number; | ||
total: number | null; | ||
} | ||
} |
{ | ||
"name": "@types/got", | ||
"version": "7.1.8", | ||
"version": "8.3.0", | ||
"description": "TypeScript definitions for got", | ||
@@ -16,2 +16,7 @@ "license": "MIT", | ||
"githubUsername": "LinusU" | ||
}, | ||
{ | ||
"name": "Konstantin Ikonnikov", | ||
"url": "https://github.com/ikokostya", | ||
"githubUsername": "ikokostya" | ||
} | ||
@@ -28,4 +33,4 @@ ], | ||
}, | ||
"typesPublisherContentHash": "3423d92561867f349c3a6716dc28ec35e6bbea7208edbacf6608aa266806a36c", | ||
"typesPublisherContentHash": "225788d444bf67b4c13e4b5bcce38bbbf85fdfa77ae3c2a3b6b8abcc2eb849d3", | ||
"typeScriptVersion": "2.3" | ||
} |
@@ -11,7 +11,7 @@ # Installation | ||
Additional Details | ||
* Last updated: Thu, 15 Mar 2018 23:17:55 GMT | ||
* Dependencies: url, http, stream, node | ||
* Last updated: Wed, 18 Apr 2018 17:04:44 GMT | ||
* Dependencies: url, http, https, stream, node | ||
* Global values: none | ||
# Credits | ||
These definitions were written by BendingBender <https://github.com/BendingBender>, Linus Unnebäck <https://github.com/LinusU>. | ||
These definitions were written by BendingBender <https://github.com/BendingBender>, Linus Unnebäck <https://github.com/LinusU>, Konstantin Ikonnikov <https://github.com/ikokostya>. |
Sorry, the diff of this file is not supported yet
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
11426
168