[node] Narrow down type that can be passed to url.format(). (#16850)

* Narrow down type that can be passed to url.format().

* Add format(URL).

* [node] Fix build error.
universal-analytics package has invalid tslint.json.

* [node] Fix build error.
universal-analytics package has invalid version number.
This commit is contained in:
Leonard Thieu
2017-06-01 15:05:57 -04:00
committed by Mohamed Hegazy
parent 796bb77b68
commit 3f95ea32d7
5 changed files with 41 additions and 4 deletions

View File

@@ -1801,8 +1801,21 @@ declare module "url" {
path?: string;
}
export interface UrlObject {
protocol?: string;
slashes?: boolean;
auth?: string;
host?: string;
hostname?: string;
port?: string | number;
pathname?: string;
search?: string;
query?: { [key: string]: any; };
hash?: string;
}
export function parse(urlStr: string, parseQueryString?: boolean, slashesDenoteHost?: boolean): Url;
export function format(url: Url): string;
export function format(urlObject: UrlObject): string;
export function resolve(from: string, to: string): string;
}