/** * Internal method to parse a URL string and update the current components. * * @param url - The URL string to parse. * @param partial - If true, only update components present in the input. */ export declare function parseURL(url: string): URLComponents; /** * An interface representing the components of a URL. */ export interface URLComponents { protocol?: string; username?: string; password?: string; hostname?: string; port?: string; path?: string; queryItems?: Record; fragment?: string; } /** * A class for parsing, updating, and building URLs. * * The class does not use the built‑in URL class or named regex capture groups. */ export declare class URL { protocol: string; hostname: string; path: string; username?: string; password?: string; port?: string; queryItems?: Record | undefined; fragment?: string; /** * Creates a new SimpleURL instance. * @param url - (Optional) A URL string to initialize the instance. */ constructor(url: string); /** * Returns the full URL string built from the current components. */ toString(): string; /** * Convenience method to update the protocol. */ setProtocol(newProtocol: string): this; /** * Convenience method to update the username. */ setUsername(newUsername?: string): this; /** * Convenience method to update the password. */ setPassword(newPassword?: string): this; /** * Convenience method to update the hostname. */ setHostname(newHostname: string): this; /** * Convenience method to update the port. */ setPort(newPort?: string): this; /** * Convenience method to update the pathname. */ setPath(newPathname: string): this; addPathComponent(component: string): this; /** * Replace the entire query object. */ setQueryItems(newQuery?: Record): this; /** * Update or add a single query parameter. */ setQueryItem(key: string, value: string | string[]): this; /** * Remove a query parameter. */ removeQueryItem(key: string): this; /** * Convenience method to update the hash (fragment). */ setFragment(newHash: string): this; /** * Update the current URL components. * * Accepts either: * - A URL string, which may be a full URL (e.g., "https://example.com/path?foo=bar") * or a partial URL (e.g., "/new/path?foo=bar#section"). In this case, only the components * present in the string will be updated. * - A partial UrlComponents object. * * @param input - A URL string or a partial UrlComponents object. */ update(input: string | Partial): this; } //# sourceMappingURL=URL.d.ts.map