export type ExURL = { /** * Full URL (optimized) */ href: string; /** * Full URL that before parse */ _originUrlString: string; /** * Full URL without hash */ withoutHash: string; /** * Full URL without hash and Authentication */ withoutHashAndAuth: string; /** * Protocol or URI scheme (includes ":") * - case-insensitive */ protocol: string; /** * Whether protocol is HTTP or HTTPS */ isHTTP: boolean; /** * Whether protocol is HTTPS */ isSecure: boolean; /** * User name of authentication */ username: string | null; /** * Password of authentication */ password: string | null; /** * Host name * * - case-insensitive * - encode non-ASCII characters * - without port number */ hostname: string; /** * Port number */ port: string | null; /** * Path part * * It is only `/` if pathname is empty * * - case-sensitive */ pathname: string | null; /** * Array of path */ paths: string[]; /** * Depth of paths */ depth: number; /** * Directory name of paths * * It is null if it is `/` only */ dirname: string | null; /** * Base name of paths (File name without file extension) */ basename: string | null; /** * Whether index page (It's true if basename is null) */ isIndex: boolean; /** * File extension name (inclues ".") */ extname: string | null; /** * Search query (without `?`) * * - case-sensitive */ query: string | null; /** * Hash (includes `#`) * * - case-sensitive */ hash: string | null; /** * path name without file extension and "index" */ stem: string; }; export type ParseURLOptions = { disableQueries?: boolean; baseUrl?: string; indexAsParent?: boolean; }; /** * Parses a URL string into an ExURL object, filtering out non-HTTP URLs * that lack a hostname and protocol. If the input is already an ExURL object, * it is returned as-is without re-parsing. * @param url - The URL string to parse, or an already-parsed ExURL object. * @param options - Optional parsing options forwarded to the underlying parser. * @returns The parsed ExURL object, or `null` if the URL is not a valid HTTP URL * and has no hostname or protocol. */ export declare function tryParseUrl(url: string | ExURL, options?: ParseURLOptions): ExURL | null; /** * Parse URL string to ExURL object * @param url URL string to parse * @param options Parse options * @returns ExURL object */ export declare function parseUrl(url: string, options?: ParseURLOptions): ExURL;