From f6a5b6257e933cf5cabccc33d637eb7bc9970b03 Mon Sep 17 00:00:00 2001 From: Matthew Date: Sat, 13 Apr 2019 20:30:44 +0100 Subject: [PATCH] remove unneccessary aliases --- types/got/index.d.ts | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/types/got/index.d.ts b/types/got/index.d.ts index 43ed5a5f35..e8890429ce 100644 --- a/types/got/index.d.ts +++ b/types/got/index.d.ts @@ -69,7 +69,7 @@ declare class StdError extends Error { response?: any; } -declare const got: got.DefaultGotInstance; +declare const got: got.GotInstance; interface InternalRequestOptions extends https.RequestOptions { // Redeclare options with `any` type for allow specify types incompatible with http.RequestOptions. @@ -94,28 +94,25 @@ declare namespace got { type GotInstance = 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; - }; - - type DefaultGotInstance = GotInstance; - type JSONGotInstance = GotInstance; + { + 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): JSONGotInstance; - (options: GotFormOptions): DefaultGotInstance; - (options: GotBodyOptions): DefaultGotInstance; - (options: GotFormOptions): DefaultGotInstance; - (options: GotBodyOptions): DefaultGotInstance; + (options: GotJSONOptions): GotInstance; + (options: GotFormOptions): GotInstance; + (options: GotBodyOptions): GotInstance; + (options: GotFormOptions): GotInstance; + (options: GotBodyOptions): GotInstance; } type GotStreamFn = (url: GotUrl, options?: GotOptions) => GotEmitter & nodeStream.Duplex;