/** Represents an URL. */ export declare class URL { /** * Creates and returns a URL object referencing the URL specified using an absolute URL * string, or a relative URL string and a base URL string. */ constructor(url: string, base?: string | URL); /** The fragment identifier of the URL. */ hash: string; /** * The domain (hostname). If a port was specified, followed by a colon and the port * of the URL. */ host: string; /** The domain of the URL. */ hostname: string; /** * The whole URL as string. * * This has the same result as calling `.toString()`. */ href: string; /** * Returns a string containing the origin of the URL (its scheme, domain * and port). */ readonly origin: string; /** The password specified before the domain name. */ password: string; /** The pathname preceded by an initial '/'. */ pathname: string; /** The port number of the URL. */ port: string; /** The protocol of the URL, including the final colon. */ protocol: string; /** * A string indicating the parameter string of the URL. If any parameters are provided, * this string includes all of them, beginning with the leading `?` character. */ search: string; /** * A URLSearchParams object which can be used to access the individual query * parameters found in `search`. */ readonly searchParams: URLSearchParams; /** The username specified before the domain name. */ username: string; /** * Returns a string containing the whole URL. * * This has the same result as accessing the `.href` property. */ toJSON(): string; /** * Returns a string containing the whole URL. * * This has the same result as accessing the `.href` property. */ toString(): string; } /** * The URLSearchParams interface defines utility methods to work with the query * string of a URL. */ export declare class URLSearchParams { /** Creates a new instance. */ constructor(init?: string[][] | Record | string | URLSearchParams); /** * Appends a specified key/value pair as a new search parameter. */ append(name: string, value: string): void; /** * Deletes the given search parameter, and its associated value, from the list of all search parameters. */ delete(name: string): void; /** * Returns the first value associated to the given search parameter. */ get(name: string): string | null; /** * Returns all the values association with a given search parameter. */ getAll(name: string): string[]; /** * Returns a Boolean indicating if such a search parameter exists. */ has(name: string): boolean; /** * Sets the value associated to a given search parameter to the given value. If there were several values, delete the others. */ set(name: string, value: string): void; /** * Sorts all key/value pairs, if any, by their keys. */ sort(): void; /** * Returns a string containing a query string suitable for use in a URL. Does not include the question mark. */ toString(): string; /** * Allows iteration through all values contained in this object via a callback function. */ forEach(callbackfn: (value: string, key: string, parent: URLSearchParams) => void, thisArg?: any): void; }