mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* Adding typings for url-parse * Fixup! import URLSearchParams types * Adding typings for parse function * Changes to tsconfig and tslint * Fixes to the type definitions * Adding missing tslint file * Fixing the typos in the header * Exporting object in a diferent way, adding one more constructor signature and relevant tests * Removing unnecessary lines from typedef
19 lines
553 B
TypeScript
19 lines
553 B
TypeScript
import parse = require("url-parse");
|
|
|
|
const url1 = new URL("foo/bar", "https://github.com/");
|
|
const url2 = parse("https://github.com/foo/bar?baz=true");
|
|
const url3 = parse("https://github.com/foo/bar", true, true);
|
|
const url4 = parse("foo/bar", "https://github.com/");
|
|
const url5 = parse("foo/bar", "https://github.com/", () => "queryParserOverride");
|
|
|
|
url2.hash;
|
|
url2.hostname;
|
|
url2.query.baz;
|
|
|
|
url3.slashes;
|
|
url3.set("protocol", "http://");
|
|
|
|
parse.extractProtocol("https://github.com/foo/bar");
|
|
parse.location("https://github.com/foo/bar");
|
|
parse.qs;
|