mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-24 05:06:02 +08:00
[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:
committed by
Mohamed Hegazy
parent
796bb77b68
commit
3f95ea32d7
15
types/node/v6/index.d.ts
vendored
15
types/node/v6/index.d.ts
vendored
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user