Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@nertzy
Forked from Jason-Rev/url-parse.d.ts
Last active September 26, 2016 16:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nertzy/d3110cae677913c476e8b4895eeaf412 to your computer and use it in GitHub Desktop.
Save nertzy/d3110cae677913c476e8b4895eeaf412 to your computer and use it in GitHub Desktop.
Typings for npm url-parse
declare module "url-parse" {
interface Query {
[index: string]: string;
}
interface QueryParser {
(query: string): any;
}
interface ParsedUrl {
(url: string, baseURL?: string, parseQuery?: boolean|QueryParser): ParsedUrl;
new (url: string, baseURL?: string, parseQuery?: boolean|QueryParser): ParsedUrl;
protocol: string; // protocol: Requested protocol without slashes (e.g. http:).
username: string; // username: Username of basic authentication.
password: string; // password: Password of basic authentication.
auth: string; // auth: Authentication information portion (e.g. username:password).
host: string; // host: Host name with port number.
hostname: string; // hostname: Host name without port number.
port: string; // port: Optional port number.
pathname: string; // pathname: URL path.
query: Query; // query: Parsed object containing query string, unless parsing is set to false.
hash: string; // hash: The "fragment" portion of the URL including the pound-sign (#).
href: string; // href: The full URL.
toString(): string;
set(key: string, value: string|Object|number): ParsedUrl;
}
const URL: ParsedUrl;
export = URL;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment