diff --git a/types/http-proxy-agent/index.d.ts b/types/http-proxy-agent/index.d.ts index b518fddf0c..fe9d962c5f 100644 --- a/types/http-proxy-agent/index.d.ts +++ b/types/http-proxy-agent/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: mrmlnc // steprescott // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 /// @@ -10,7 +11,7 @@ import { Agent } from 'http'; import { Url } from 'url'; declare class HttpProxyAgent extends Agent { - constructor(options: string | Url); + constructor(options: string | Partial); proxy: Url; secureProxy: boolean; diff --git a/types/http-proxy/index.d.ts b/types/http-proxy/index.d.ts index 8d5c233f87..b9bd3d9b02 100644 --- a/types/http-proxy/index.d.ts +++ b/types/http-proxy/index.d.ts @@ -5,6 +5,7 @@ // Daniel Schmidt // Jordan Abreu // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 /// @@ -15,7 +16,7 @@ import * as events from "events"; import * as url from "url"; import * as stream from "stream"; -type ProxyTargetUrl = string | url.Url; +type ProxyTargetUrl = string | Partial; type ErrorCallback = ( err: Error, diff --git a/types/node/url.d.ts b/types/node/url.d.ts index 51dcd69ab7..e5b7e28566 100644 --- a/types/node/url.d.ts +++ b/types/node/url.d.ts @@ -1,29 +1,36 @@ declare module "url" { import { ParsedUrlQuery, ParsedUrlQueryInput } from 'querystring'; - interface UrlObjectCommon { - auth?: string; - hash?: string; - host?: string; - hostname?: string; - href?: string; - path?: string; - pathname?: string; - protocol?: string; - search?: string; - slashes?: boolean; - } - // Input to `url.format` - interface UrlObject extends UrlObjectCommon { - port?: string | number; + interface UrlObject { + auth?: string | null; + hash?: string | null; + host?: string | null; + hostname?: string | null; + href?: string | null; + path?: string | null; + pathname?: string | null; + protocol?: string | null; + search?: string | null; + slashes?: boolean | null; + port?: string | number | null; query?: string | null | ParsedUrlQueryInput; } // Output of `url.parse` - interface Url extends UrlObjectCommon { - port?: string; - query?: string | null | ParsedUrlQuery; + interface Url { + auth: string | null; + hash: string | null; + host: string | null; + hostname: string | null; + href: string; + path: string | null; + pathname: string | null; + protocol: string | null; + search: string | null; + slashes: boolean | null; + port: string | null; + query: string | null | ParsedUrlQuery; } interface UrlWithParsedQuery extends Url {