mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-13 21:06:14 +08:00
Merge pull request #29054 from eugirdor/feature/got/https-requestoptions
[got] Allow use of https.RequestOptions
This commit is contained in:
@@ -258,3 +258,5 @@ got('todomvc', {
|
||||
got(new url.URL('http://todomvc.com'));
|
||||
|
||||
got(url.parse('http://todomvc.com'));
|
||||
|
||||
got('https://todomvc.com', { rejectUnauthorized: false });
|
||||
|
||||
4
types/got/index.d.ts
vendored
4
types/got/index.d.ts
vendored
@@ -75,7 +75,7 @@ declare const got: got.GotFn &
|
||||
CancelError: typeof CancelError;
|
||||
};
|
||||
|
||||
interface InternalRequestOptions extends http.RequestOptions {
|
||||
interface InternalRequestOptions extends https.RequestOptions {
|
||||
// Redeclare options with `any` type for allow specify types incompatible with http.RequestOptions.
|
||||
timeout?: any;
|
||||
agent?: any;
|
||||
@@ -93,7 +93,7 @@ declare namespace got {
|
||||
|
||||
type GotStreamFn = (url: GotUrl, options?: GotOptions<string | null>) => GotEmitter & nodeStream.Duplex;
|
||||
|
||||
type GotUrl = string | http.RequestOptions | Url | URL;
|
||||
type GotUrl = string | https.RequestOptions | Url | URL;
|
||||
|
||||
interface GotBodyOptions<E extends string | null> extends GotOptions<E> {
|
||||
body?: string | Buffer | nodeStream.Readable;
|
||||
|
||||
Reference in New Issue
Block a user