@poveste/vendors 0.13.1 → 0.15.0

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