index.d.ts 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714
  1. type QueryValue = string | number | undefined | null | boolean | Array<QueryValue> | Record<string, any>;
  2. type QueryObject = Record<string, QueryValue | QueryValue[]>;
  3. type ParsedQuery = Record<string, string | string[]>;
  4. /**
  5. * Parses and decodes a query string into an object.
  6. *
  7. * The input can be a query string with or without the leading `?`.
  8. *
  9. * @example
  10. *
  11. * ```js
  12. * parseQuery("?foo=bar&baz=qux");
  13. * // { foo: "bar", baz: "qux" }
  14. *
  15. * parseQuery("tags=javascript&tags=web&tags=dev");
  16. * // { tags: ["javascript", "web", "dev"] }
  17. * ```
  18. *
  19. * @note
  20. * The `__proto__` and `constructor` keys are ignored to prevent prototype pollution.
  21. *
  22. * @group Query_utils
  23. */
  24. declare function parseQuery<T extends ParsedQuery = ParsedQuery>(parametersString?: string): T;
  25. /**
  26. * Encodes a pair of key and value into a url query string value.
  27. *
  28. * If the value is an array, it will be encoded as multiple key-value pairs with the same key.
  29. *
  30. * @example
  31. *
  32. * ```js
  33. * encodeQueryItem('message', 'Hello World')
  34. * // 'message=Hello+World'
  35. *
  36. * encodeQueryItem('tags', ['javascript', 'web', 'dev'])
  37. * // 'tags=javascript&tags=web&tags=dev'
  38. * ```
  39. *
  40. * @group Query_utils
  41. */
  42. declare function encodeQueryItem(key: string, value: QueryValue | QueryValue[]): string;
  43. /**
  44. * Stringfies and encodes a query object into a query string.
  45. *
  46. * @example
  47. *
  48. * ```js
  49. * stringifyQuery({ foo: 'bar', baz: 'qux' })
  50. * // 'foo=bar&baz=qux'
  51. *
  52. * stringifyQuery({ foo: 'bar', baz: undefined })
  53. * // 'foo=bar'
  54. * ```
  55. *
  56. * @group Query_utils
  57. */
  58. declare function stringifyQuery(query: QueryObject): string;
  59. /**
  60. * Encodes characters that need to be encoded in the path, search and hash
  61. * sections of the URL.
  62. *
  63. * @group encoding_utils
  64. *
  65. * @param text - string to encode
  66. * @returns encoded string
  67. */
  68. declare function encode(text: string | number): string;
  69. /**
  70. * Encodes characters that need to be encoded in the hash section of the URL.
  71. *
  72. * @group encoding_utils
  73. *
  74. * @param text - string to encode
  75. * @returns encoded string
  76. */
  77. declare function encodeHash(text: string): string;
  78. /**
  79. * Encodes characters that need to be encoded for query values in the query
  80. * section of the URL.
  81. *
  82. * @group encoding_utils
  83. *
  84. * @param input - string to encode
  85. * @returns encoded string
  86. */
  87. declare function encodeQueryValue(input: QueryValue): string;
  88. /**
  89. * Encodes characters that need to be encoded for query values in the query
  90. * section of the URL and also encodes the `=` character.
  91. *
  92. * @group encoding_utils
  93. *
  94. * @param text - string to encode
  95. */
  96. declare function encodeQueryKey(text: string | number): string;
  97. /**
  98. * Encodes characters that need to be encoded in the path section of the URL.
  99. *
  100. * @group encoding_utils
  101. *
  102. * @param text - string to encode
  103. * @returns encoded string
  104. */
  105. declare function encodePath(text: string | number): string;
  106. /**
  107. * Encodes characters that need to be encoded in the path section of the URL as a
  108. * param. This function encodes everything `encodePath` does plus the
  109. * slash (`/`) character.
  110. *
  111. * @group encoding_utils
  112. *
  113. * @param text - string to encode
  114. * @returns encoded string
  115. */
  116. declare function encodeParam(text: string | number): string;
  117. /**
  118. * Decodes text using `decodeURIComponent`. Returns the original text if it
  119. * fails.
  120. *
  121. * @group encoding_utils
  122. *
  123. * @param text - string to decode
  124. * @returns decoded string
  125. */
  126. declare function decode(text?: string | number): string;
  127. /**
  128. * Decodes path section of URL (consistent with encodePath for slash encoding).
  129. *
  130. * @group encoding_utils
  131. *
  132. * @param text - string to decode
  133. * @returns decoded string
  134. */
  135. declare function decodePath(text: string): string;
  136. /**
  137. * Decodes query key (consistent with `encodeQueryKey` for plus encoding).
  138. *
  139. * @group encoding_utils
  140. *
  141. * @param text - string to decode
  142. * @returns decoded string
  143. */
  144. declare function decodeQueryKey(text: string): string;
  145. /**
  146. * Decodes query value (consistent with `encodeQueryValue` for plus encoding).
  147. *
  148. * @group encoding_utils
  149. *
  150. * @param text - string to decode
  151. * @returns decoded string
  152. */
  153. declare function decodeQueryValue(text: string): string;
  154. /**
  155. * Encodes hostname with punycode encoding.
  156. *
  157. * @group encoding_utils
  158. */
  159. declare function encodeHost(name?: string): string;
  160. declare const protocolRelative: unique symbol;
  161. interface ParsedURL {
  162. protocol?: string;
  163. host?: string;
  164. auth?: string;
  165. href?: string;
  166. pathname: string;
  167. hash: string;
  168. search: string;
  169. [protocolRelative]?: boolean;
  170. }
  171. type ParsedPath = Pick<ParsedURL, "pathname" | "hash" | "search">;
  172. interface ParsedAuth {
  173. username: string;
  174. password: string;
  175. }
  176. interface ParsedHost {
  177. hostname: string;
  178. port: string;
  179. }
  180. /**
  181. * Takes a URL string and returns an object with the URL's `protocol`, `auth`, `host`, `pathname`, `search`, and `hash`.
  182. *
  183. * @example
  184. *
  185. * ```js
  186. * parseURL("http://foo.com/foo?test=123#token");
  187. * // { protocol: 'http:', auth: '', host: 'foo.com', pathname: '/foo', search: '?test=123', hash: '#token' }
  188. *
  189. * parseURL("foo.com/foo?test=123#token");
  190. * // { pathname: 'foo.com/foo', search: '?test=123', hash: '#token' }
  191. *
  192. * parseURL("foo.com/foo?test=123#token", "https://");
  193. * // { protocol: 'https:', auth: '', host: 'foo.com', pathname: '/foo', search: '?test=123', hash: '#token' }
  194. * ```
  195. *
  196. * @group parsing_utils
  197. *
  198. * @param [input] - The URL to parse.
  199. * @param [defaultProto] - The default protocol to use if the input doesn't have one.
  200. * @returns A parsed URL object.
  201. */
  202. declare function parseURL(input?: string, defaultProto?: string): ParsedURL;
  203. /**
  204. * Splits the input string into three parts, and returns an object with those three parts.
  205. *
  206. * @example
  207. *
  208. * ```js
  209. * parsePath("http://foo.com/foo?test=123#token");
  210. * // { pathname: 'http://foo.com/foo', search: '?test=123', hash: '#token' }
  211. * ```
  212. *
  213. * @group parsing_utils
  214. *
  215. * @param [input] - The URL to parse.
  216. * @returns An object with three properties: `pathname`, `search`, and `hash`.
  217. */
  218. declare function parsePath(input?: string): ParsedPath;
  219. /**
  220. * Takes a string of the form `username:password` and returns an object with the username and
  221. * password decoded.
  222. *
  223. * @group parsing_utils
  224. *
  225. * @param [input] - The URL to parse.
  226. * @returns An object with two properties: username and password.
  227. */
  228. declare function parseAuth(input?: string): ParsedAuth;
  229. /**
  230. * Takes a string, and returns an object with two properties: `hostname` and `port`.
  231. *
  232. * @example
  233. *
  234. * ```js
  235. * parseHost("foo.com:8080");
  236. * // { hostname: 'foo.com', port: '8080' }
  237. * ```
  238. *
  239. * @group parsing_utils
  240. *
  241. * @param [input] - The URL to parse.
  242. * @returns A function that takes a string and returns an object with two properties: `hostname` and
  243. * `port`.
  244. */
  245. declare function parseHost(input?: string): ParsedHost;
  246. /**
  247. * Takes a `ParsedURL` object and returns the stringified URL.
  248. *
  249. * @group parsing_utils
  250. *
  251. * @example
  252. *
  253. * ```js
  254. * const obj = parseURL("http://foo.com/foo?test=123#token");
  255. * obj.host = "bar.com";
  256. *
  257. * stringifyParsedURL(obj); // "http://bar.com/foo?test=123#token"
  258. * ```
  259. *
  260. * @param [parsed] - The parsed URL
  261. * @returns A stringified URL.
  262. */
  263. declare function stringifyParsedURL(parsed: Partial<ParsedURL>): string;
  264. /**
  265. * Parses a URL and returns last segment in path as filename.
  266. *
  267. * If `{ strict: true }` is passed as the second argument, it will only return the last segment only if ending with an extension.
  268. *
  269. * @group parsing_utils
  270. *
  271. * @example
  272. *
  273. * ```js
  274. * // Result: filename.ext
  275. * parseFilename("http://example.com/path/to/filename.ext");
  276. *
  277. * // Result: undefined
  278. * parseFilename("/path/to/.hidden-file", { strict: true });
  279. * ```
  280. *
  281. * @param [input] - The URL to parse.
  282. * @param [opts] - Options to use while parsing
  283. */
  284. declare function parseFilename(input?: string, opts?: {
  285. strict?: boolean;
  286. }): string | undefined;
  287. /**
  288. * @deprecated use native URL with `new URL(input)` or `ufo.parseURL(input)`
  289. */
  290. declare class $URL implements URL {
  291. protocol: string;
  292. host: string;
  293. auth: string;
  294. pathname: string;
  295. query: QueryObject;
  296. hash: string;
  297. constructor(input?: string);
  298. get hostname(): string;
  299. get port(): string;
  300. get username(): string;
  301. get password(): string;
  302. get hasProtocol(): number;
  303. get isAbsolute(): number | boolean;
  304. get search(): string;
  305. get searchParams(): URLSearchParams;
  306. get origin(): string;
  307. get fullpath(): string;
  308. get encodedAuth(): string;
  309. get href(): string;
  310. append(url: $URL): void;
  311. toJSON(): string;
  312. toString(): string;
  313. }
  314. /**
  315. * @deprecated use native URL with `new URL(input)` or `ufo.parseURL(input)`
  316. */
  317. declare function createURL(input: string): $URL;
  318. /**
  319. * Check if a path starts with `./` or `../`.
  320. *
  321. * @example
  322. * ```js
  323. * isRelative("./foo"); // true
  324. * ```
  325. *
  326. * @group utils
  327. */
  328. declare function isRelative(inputString: string): boolean;
  329. interface HasProtocolOptions {
  330. acceptRelative?: boolean;
  331. strict?: boolean;
  332. }
  333. declare function hasProtocol(inputString: string, opts?: HasProtocolOptions): boolean;
  334. /** @deprecated Same as { hasProtocol(inputString, { acceptRelative: true }) */
  335. declare function hasProtocol(inputString: string, acceptRelative: boolean): boolean;
  336. /**
  337. * Checks if the input protocol is any of the dangerous `blob:`, `data:`, `javascript`: or `vbscript:` protocols.
  338. *
  339. * @example
  340. *
  341. * ```js
  342. * isScriptProtocol("javascript:alert(1)"); // true
  343. *
  344. * isScriptProtocol("data:text/html,hello"); // true
  345. *
  346. * isScriptProtocol("blob:hello"); // true
  347. *
  348. * isScriptProtocol("vbscript:alert(1)"); // true
  349. *
  350. * isScriptProtocol("https://example.com"); // false
  351. * ```
  352. *
  353. * @group utils
  354. */
  355. declare function isScriptProtocol(protocol?: string): boolean;
  356. /**
  357. * Checks if the input has a trailing slash.
  358. *
  359. * @example
  360. *
  361. * ```js
  362. * hasTrailingSlash("/foo/"); // true
  363. *
  364. * hasTrailingSlash("/foo"); // false
  365. *
  366. * hasTrailingSlash("/foo?query=true", true); // false
  367. *
  368. * hasTrailingSlash("/foo/?query=true", true); // true
  369. * ```
  370. *
  371. * @group utils
  372. */
  373. declare function hasTrailingSlash(input?: string, respectQueryAndFragment?: boolean): boolean;
  374. /**
  375. * Removes the trailing slash from the URL or pathname.
  376. *
  377. * If second argument is `true`, it will only remove the trailing slash if it's not part of the query or fragment with cost of more expensive operations.
  378. *
  379. * @example
  380. *
  381. * ```js
  382. * withoutTrailingSlash("/foo/"); // "/foo"
  383. *
  384. * withoutTrailingSlash("/path/?query=true", true); // "/path?query=true"
  385. * ```
  386. *
  387. * @group utils
  388. */
  389. declare function withoutTrailingSlash(input?: string, respectQueryAndFragment?: boolean): string;
  390. /**
  391. * Ensures the URL ends with a trailing slash.
  392. *
  393. * If second argument is `true`, it will only add the trailing slash if it's not part of the query or fragment with cost of more expensive operation.
  394. *
  395. * @example
  396. *
  397. * ```js
  398. * withTrailingSlash("/foo"); // "/foo/"
  399. *
  400. * withTrailingSlash("/path?query=true", true); // "/path/?query=true"
  401. * ```
  402. *
  403. * @group utils
  404. */
  405. declare function withTrailingSlash(input?: string, respectQueryAndFragment?: boolean): string;
  406. /**
  407. * Checks if the input has a leading slash (e.g. `/foo`).
  408. *
  409. * @group utils
  410. */
  411. declare function hasLeadingSlash(input?: string): boolean;
  412. /**
  413. * Removes leading slash from the URL or pathname.
  414. *
  415. * @example
  416. *
  417. * ```js
  418. * withoutLeadingSlash("/foo"); // "foo"
  419. * ```
  420. *
  421. * @group utils
  422. */
  423. declare function withoutLeadingSlash(input?: string): string;
  424. /**
  425. * Ensures the URL or pathname has a leading slash.
  426. *
  427. * @example
  428. *
  429. * ```js
  430. * withLeadingSlash("foo"); // "/foo"
  431. * ```
  432. *
  433. * @group utils
  434. */
  435. declare function withLeadingSlash(input?: string): string;
  436. /**
  437. * Removes double slashes from the URL.
  438. *
  439. * @example
  440. *
  441. * ```js
  442. * cleanDoubleSlashes("//foo//bar//"); // "/foo/bar/"
  443. *
  444. * cleanDoubleSlashes("http://example.com/analyze//http://localhost:3000//");
  445. * // Returns "http://example.com/analyze/http://localhost:3000/"
  446. * ```
  447. *
  448. * @group utils
  449. */
  450. declare function cleanDoubleSlashes(input?: string): string;
  451. /**
  452. * Ensures the URL or pathname starts with base.
  453. *
  454. * If input already starts with base, it will not be added again.
  455. *
  456. * @example
  457. *
  458. * ```js
  459. * withBase("/foo/bar", "/foo"); // "/foo/bar"
  460. *
  461. * withBase("/foo/bar", "/baz"); // "/baz/foo/bar"
  462. * ```
  463. *
  464. * @group utils
  465. */
  466. declare function withBase(input: string, base: string): string;
  467. /**
  468. * Removes the base from the URL or pathname.
  469. *
  470. * If input does not start with base, it will not be removed.
  471. *
  472. * @example
  473. *
  474. * ```js
  475. * withoutBase("/foo/bar", "/foo"); // "/bar"
  476. * ```
  477. *
  478. * @group utils
  479. */
  480. declare function withoutBase(input: string, base: string): string;
  481. /**
  482. * Add/Replace the query section of the URL.
  483. *
  484. * @example
  485. *
  486. * ```js
  487. * withQuery("/foo?page=a", { token: "secret" }); // "/foo?page=a&token=secret"
  488. * ```
  489. *
  490. * @group utils
  491. */
  492. declare function withQuery(input: string, query: QueryObject): string;
  493. /**
  494. * Removes the query section of the URL.
  495. *
  496. * @example
  497. *
  498. * ```js
  499. * filterQuery("/foo?bar=1&baz=2", (key) => key !== "bar"); // "/foo?baz=2"
  500. * ```
  501. *
  502. * @group utils
  503. */
  504. declare function filterQuery(input: string, predicate: (key: string, value: string | string[]) => boolean): string;
  505. /**
  506. * Parses and decodes the query object of an input URL into an object.
  507. *
  508. * @example
  509. *
  510. * ```js
  511. * getQuery("http://foo.com/foo?test=123&unicode=%E5%A5%BD");
  512. * // { test: "123", unicode: "好" }
  513. * ```
  514. * @group utils
  515. */
  516. declare function getQuery<T extends ParsedQuery = ParsedQuery>(input: string): T;
  517. /**
  518. * Checks if the input URL is empty or `/`.
  519. *
  520. * @group utils
  521. */
  522. declare function isEmptyURL(url: string): boolean;
  523. /**
  524. * Checks if the input URL is neither empty nor `/`.
  525. *
  526. * @group utils
  527. */
  528. declare function isNonEmptyURL(url: string): boolean | "";
  529. /**
  530. * Joins multiple URL segments into a single URL.
  531. *
  532. * @example
  533. *
  534. * ```js
  535. * joinURL("a", "/b", "/c"); // "a/b/c"
  536. * ```
  537. *
  538. * @group utils
  539. */
  540. declare function joinURL(base: string, ...input: string[]): string;
  541. /**
  542. * Joins multiple URL segments into a single URL and also handles relative paths with `./` and `../`.
  543. *
  544. * @example
  545. *
  546. * ```js
  547. * joinRelativeURL("/a", "../b", "./c"); // "/b/c"
  548. * ```
  549. *
  550. * @group utils
  551. */
  552. declare function joinRelativeURL(..._input: string[]): string;
  553. /**
  554. * Adds or replaces the URL protocol to `http://`.
  555. *
  556. * @example
  557. *
  558. * ```js
  559. * withHttp("https://example.com"); // http://example.com
  560. * ```
  561. *
  562. * @group utils
  563. */
  564. declare function withHttp(input: string): string;
  565. /**
  566. * Adds or replaces the URL protocol to `https://`.
  567. *
  568. * @example
  569. *
  570. * ```js
  571. * withHttps("http://example.com"); // https://example.com
  572. * ```
  573. *
  574. * @group utils
  575. */
  576. declare function withHttps(input: string): string;
  577. /**
  578. * Removes the protocol from the input.
  579. *
  580. * @example
  581. * ```js
  582. * withoutProtocol("http://example.com"); // "example.com"
  583. * ```
  584. */
  585. declare function withoutProtocol(input: string): string;
  586. /**
  587. * Adds or replaces protocol of the input URL.
  588. *
  589. * @example
  590. * ```js
  591. * withProtocol("http://example.com", "ftp://"); // "ftp://example.com"
  592. * ```
  593. *
  594. * @group utils
  595. */
  596. declare function withProtocol(input: string, protocol: string): string;
  597. /**
  598. * Normalizes the input URL:
  599. *
  600. * - Ensures the URL is properly encoded
  601. * - Ensures pathname starts with a slash
  602. * - Preserves protocol/host if provided
  603. *
  604. * @example
  605. *
  606. * ```js
  607. * normalizeURL("test?query=123 123#hash, test");
  608. * // Returns "test?query=123%20123#hash,%20test"
  609. *
  610. * normalizeURL("http://localhost:3000");
  611. * // Returns "http://localhost:3000"
  612. * ```
  613. *
  614. * @group utils
  615. */
  616. declare function normalizeURL(input: string): string;
  617. /**
  618. * Resolves multiple URL segments into a single URL.
  619. *
  620. * @example
  621. *
  622. * ```js
  623. * resolveURL("http://foo.com/foo?test=123#token", "bar", "baz");
  624. * // Returns "http://foo.com/foo/bar/baz?test=123#token"
  625. * ```
  626. *
  627. * @group utils
  628. */
  629. declare function resolveURL(base?: string, ...inputs: string[]): string;
  630. /**
  631. * Check if two paths are equal or not. Trailing slash and encoding are normalized before comparison.
  632. *
  633. * @example
  634. * ```js
  635. * isSamePath("/foo", "/foo/"); // true
  636. * ```
  637. *
  638. * @group utils
  639. */
  640. declare function isSamePath(p1: string, p2: string): boolean;
  641. interface CompareURLOptions {
  642. trailingSlash?: boolean;
  643. leadingSlash?: boolean;
  644. encoding?: boolean;
  645. }
  646. /**
  647. * Checks if two paths are equal regardless of encoding, trailing slash, and leading slash differences.
  648. *
  649. * You can make slash check strict by setting `{ trailingSlash: true, leadingSlash: true }` as options.
  650. *
  651. * You can make encoding check strict by setting `{ encoding: true }` as options.
  652. *
  653. * @example
  654. *
  655. * ```js
  656. * isEqual("/foo", "foo"); // true
  657. * isEqual("foo/", "foo"); // true
  658. * isEqual("/foo bar", "/foo%20bar"); // true
  659. *
  660. * // Strict compare
  661. * isEqual("/foo", "foo", { leadingSlash: true }); // false
  662. * isEqual("foo/", "foo", { trailingSlash: true }); // false
  663. * isEqual("/foo bar", "/foo%20bar", { encoding: true }); // false
  664. * ```
  665. *
  666. * @group utils
  667. */
  668. declare function isEqual(a: string, b: string, options?: CompareURLOptions): boolean;
  669. /**
  670. * Adds or replaces the fragment section of the URL.
  671. *
  672. * @example
  673. *
  674. * ```js
  675. * withFragment("/foo", "bar"); // "/foo#bar"
  676. * withFragment("/foo#bar", "baz"); // "/foo#baz"
  677. * withFragment("/foo#bar", ""); // "/foo"
  678. * ```
  679. *
  680. * @group utils
  681. */
  682. declare function withFragment(input: string, hash: string): string;
  683. /**
  684. * Removes the fragment section from the URL.
  685. *
  686. * @example
  687. *
  688. * ```js
  689. * withoutFragment("http://example.com/foo?q=123#bar")
  690. * // Returns "http://example.com/foo?q=123"
  691. * ```
  692. *
  693. * @group utils
  694. */
  695. declare function withoutFragment(input: string): string;
  696. /**
  697. * Removes the host from the URL while preserving everything else.
  698. *
  699. * @example
  700. * ```js
  701. * withoutHost("http://example.com/foo?q=123#bar")
  702. * // Returns "/foo?q=123#bar"
  703. * ```
  704. *
  705. * @group utils
  706. */
  707. declare function withoutHost(input: string): string;
  708. export { $URL, cleanDoubleSlashes, createURL, decode, decodePath, decodeQueryKey, decodeQueryValue, encode, encodeHash, encodeHost, encodeParam, encodePath, encodeQueryItem, encodeQueryKey, encodeQueryValue, filterQuery, getQuery, hasLeadingSlash, hasProtocol, hasTrailingSlash, isEmptyURL, isEqual, isNonEmptyURL, isRelative, isSamePath, isScriptProtocol, joinRelativeURL, joinURL, normalizeURL, parseAuth, parseFilename, parseHost, parsePath, parseQuery, parseURL, resolveURL, stringifyParsedURL, stringifyQuery, withBase, withFragment, withHttp, withHttps, withLeadingSlash, withProtocol, withQuery, withTrailingSlash, withoutBase, withoutFragment, withoutHost, withoutLeadingSlash, withoutProtocol, withoutTrailingSlash };
  709. export type { HasProtocolOptions, ParsedAuth, ParsedHost, ParsedPath, ParsedQuery, ParsedURL, QueryObject, QueryValue };