@dcloudio/vue-cli-plugin-uni 2.0.0 → 2.0.1-32920211122002

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 (269) hide show
  1. package/commands/build.js +64 -33
  2. package/commands/serve.js +12 -17
  3. package/generator.js +6 -2
  4. package/index.js +5 -3
  5. package/lib/chain-webpack.js +8 -1
  6. package/lib/check-update.js +56 -0
  7. package/lib/commands/custom.js +7 -4
  8. package/lib/commands/invoke.js +5 -4
  9. package/lib/configure-webpack.js +35 -5
  10. package/lib/copy-webpack-options.js +60 -20
  11. package/lib/env.js +99 -51
  12. package/lib/error-reporting.js +9 -3
  13. package/lib/mp/index.js +31 -16
  14. package/lib/options.js +6 -3
  15. package/lib/util.js +5 -6
  16. package/package.json +3 -3
  17. package/packages/@vue/component-compiler-utils/MODIFY.md +5 -0
  18. package/packages/@vue/component-compiler-utils/dist/compileStyle.js +11 -0
  19. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/API.md +873 -0
  20. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/CHANGELOG.md +466 -0
  21. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/LICENSE-MIT +22 -0
  22. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/README.md +49 -0
  23. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/index.js +26 -0
  24. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/parser.js +1088 -0
  25. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/processor.js +185 -0
  26. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/attribute.js +468 -0
  27. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/className.js +67 -0
  28. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/combinator.js +35 -0
  29. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/comment.js +35 -0
  30. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/constructors.js +91 -0
  31. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/container.js +392 -0
  32. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/guards.js +54 -0
  33. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/id.js +39 -0
  34. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/index.js +39 -0
  35. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/namespace.js +98 -0
  36. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/nesting.js +36 -0
  37. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/node.js +216 -0
  38. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/pseudo.js +40 -0
  39. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/root.js +60 -0
  40. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/selector.js +35 -0
  41. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/string.js +35 -0
  42. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/tag.js +35 -0
  43. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/types.js +15 -0
  44. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/universal.js +36 -0
  45. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/sortAscending.js +10 -0
  46. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/tokenTypes.js +39 -0
  47. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/tokenize.js +271 -0
  48. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/util/ensureObject.js +20 -0
  49. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/util/getProp.js +22 -0
  50. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/util/index.js +41 -0
  51. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/util/stripComments.js +21 -0
  52. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/util/unesc.js +18 -0
  53. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/package.json +76 -0
  54. package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/postcss-selector-parser.d.ts +499 -0
  55. package/packages/@vue/devtools-api/lib/cjs/api/api.d.ts +90 -0
  56. package/packages/@vue/devtools-api/lib/cjs/api/api.js +2 -0
  57. package/packages/@vue/devtools-api/lib/cjs/api/app.d.ts +1 -0
  58. package/packages/@vue/devtools-api/lib/cjs/api/app.js +2 -0
  59. package/packages/@vue/devtools-api/lib/cjs/api/component.d.ts +76 -0
  60. package/packages/@vue/devtools-api/lib/cjs/api/component.js +2 -0
  61. package/packages/@vue/devtools-api/lib/cjs/api/context.d.ts +5 -0
  62. package/packages/@vue/devtools-api/lib/cjs/api/context.js +2 -0
  63. package/packages/@vue/devtools-api/lib/cjs/api/hooks.d.ts +169 -0
  64. package/packages/@vue/devtools-api/lib/cjs/api/hooks.js +2 -0
  65. package/packages/@vue/devtools-api/lib/cjs/api/index.d.ts +6 -0
  66. package/packages/@vue/devtools-api/lib/cjs/api/index.js +18 -0
  67. package/packages/@vue/devtools-api/lib/cjs/api/util.d.ts +4 -0
  68. package/packages/@vue/devtools-api/lib/cjs/api/util.js +2 -0
  69. package/packages/@vue/devtools-api/lib/cjs/const.d.ts +1 -0
  70. package/packages/@vue/devtools-api/lib/cjs/const.js +4 -0
  71. package/packages/@vue/devtools-api/lib/cjs/env.d.ts +10 -0
  72. package/packages/@vue/devtools-api/lib/cjs/env.js +16 -0
  73. package/packages/@vue/devtools-api/lib/cjs/index.d.ts +14 -0
  74. package/packages/@vue/devtools-api/lib/cjs/index.js +31 -0
  75. package/packages/@vue/devtools-api/lib/esm/api/api.js +0 -0
  76. package/packages/@vue/devtools-api/lib/esm/api/app.js +0 -0
  77. package/packages/@vue/devtools-api/lib/esm/api/component.js +0 -0
  78. package/packages/@vue/devtools-api/lib/esm/api/context.js +0 -0
  79. package/packages/@vue/devtools-api/lib/esm/api/hooks.js +0 -0
  80. package/packages/@vue/devtools-api/lib/esm/api/index.js +6 -0
  81. package/packages/@vue/devtools-api/lib/esm/api/util.js +0 -0
  82. package/packages/@vue/devtools-api/lib/esm/const.js +1 -0
  83. package/packages/@vue/devtools-api/lib/esm/env.js +11 -0
  84. package/packages/@vue/devtools-api/lib/esm/index.js +17 -0
  85. package/packages/@vue/devtools-api/package.json +38 -0
  86. package/packages/app-vue-style-loader/lib/addStylesClient.js +1 -1
  87. package/packages/h5-vue-style-loader/lib/addStylesClient.js +1 -1
  88. package/packages/mp-vue/dist/mp.runtime.esm.js +3 -2
  89. package/packages/mp-vue/package.json +1 -0
  90. package/packages/uni-app/LICENSE +202 -0
  91. package/packages/uni-app/dist/uni-app.cjs.js +165 -0
  92. package/packages/uni-app/dist/uni-app.d.ts +61 -0
  93. package/packages/uni-app/dist/uni-app.es.js +108 -0
  94. package/packages/uni-app/package.json +22 -0
  95. package/packages/uni-cloud/dist/index.js +1 -1
  96. package/packages/uni-stat/dist/uni-stat.cjs.js +961 -0
  97. package/packages/uni-stat/dist/uni-stat.es.js +959 -0
  98. package/packages/uni-stat/lib/uni.plugin.js +68 -0
  99. package/packages/uni-stat/package.json +25 -0
  100. package/packages/vue3/node_modules/.yarn-integrity +27 -0
  101. package/packages/vue3/node_modules/@intlify/core-base/LICENSE +20 -0
  102. package/packages/vue3/node_modules/@intlify/core-base/README.md +7 -0
  103. package/packages/vue3/node_modules/@intlify/core-base/dist/core-base.cjs.js +989 -0
  104. package/packages/vue3/node_modules/@intlify/core-base/dist/core-base.cjs.prod.js +735 -0
  105. package/packages/vue3/node_modules/@intlify/core-base/dist/core-base.d.ts +576 -0
  106. package/packages/vue3/node_modules/@intlify/core-base/dist/core-base.esm-browser.js +2771 -0
  107. package/packages/vue3/node_modules/@intlify/core-base/dist/core-base.esm-browser.prod.js +6 -0
  108. package/packages/vue3/node_modules/@intlify/core-base/dist/core-base.esm-bundler.js +965 -0
  109. package/packages/vue3/node_modules/@intlify/core-base/dist/core-base.global.js +2814 -0
  110. package/packages/vue3/node_modules/@intlify/core-base/dist/core-base.global.prod.js +6 -0
  111. package/packages/vue3/node_modules/@intlify/core-base/index.js +7 -0
  112. package/packages/vue3/node_modules/@intlify/core-base/package.json +59 -0
  113. package/packages/vue3/node_modules/@intlify/devtools-if/LICENSE +20 -0
  114. package/packages/vue3/node_modules/@intlify/devtools-if/README.md +13 -0
  115. package/packages/vue3/node_modules/@intlify/devtools-if/dist/devtools-if.cjs.js +15 -0
  116. package/packages/vue3/node_modules/@intlify/devtools-if/dist/devtools-if.cjs.prod.js +15 -0
  117. package/packages/vue3/node_modules/@intlify/devtools-if/dist/devtools-if.d.ts +43 -0
  118. package/packages/vue3/node_modules/@intlify/devtools-if/dist/devtools-if.esm-bundler.js +11 -0
  119. package/packages/vue3/node_modules/@intlify/devtools-if/index.js +7 -0
  120. package/packages/vue3/node_modules/@intlify/devtools-if/package.json +49 -0
  121. package/packages/vue3/node_modules/@intlify/message-compiler/LICENSE +20 -0
  122. package/packages/vue3/node_modules/@intlify/message-compiler/README.md +7 -0
  123. package/packages/vue3/node_modules/@intlify/message-compiler/dist/message-compiler.cjs.js +1400 -0
  124. package/packages/vue3/node_modules/@intlify/message-compiler/dist/message-compiler.cjs.prod.js +1395 -0
  125. package/packages/vue3/node_modules/@intlify/message-compiler/dist/message-compiler.d.ts +197 -0
  126. package/packages/vue3/node_modules/@intlify/message-compiler/dist/message-compiler.esm-browser.js +1348 -0
  127. package/packages/vue3/node_modules/@intlify/message-compiler/dist/message-compiler.esm-browser.prod.js +6 -0
  128. package/packages/vue3/node_modules/@intlify/message-compiler/dist/message-compiler.esm-bundler.js +1329 -0
  129. package/packages/vue3/node_modules/@intlify/message-compiler/dist/message-compiler.global.js +1365 -0
  130. package/packages/vue3/node_modules/@intlify/message-compiler/dist/message-compiler.global.prod.js +6 -0
  131. package/packages/vue3/node_modules/@intlify/message-compiler/index.js +7 -0
  132. package/packages/vue3/node_modules/@intlify/message-compiler/package.json +56 -0
  133. package/packages/vue3/node_modules/@intlify/message-resolver/LICENSE +20 -0
  134. package/packages/vue3/node_modules/@intlify/message-resolver/README.md +7 -0
  135. package/packages/vue3/node_modules/@intlify/message-resolver/dist/message-resolver.cjs.js +302 -0
  136. package/packages/vue3/node_modules/@intlify/message-resolver/dist/message-resolver.cjs.prod.js +302 -0
  137. package/packages/vue3/node_modules/@intlify/message-resolver/dist/message-resolver.d.ts +21 -0
  138. package/packages/vue3/node_modules/@intlify/message-resolver/dist/message-resolver.esm-bundler.js +297 -0
  139. package/packages/vue3/node_modules/@intlify/message-resolver/index.js +7 -0
  140. package/packages/vue3/node_modules/@intlify/message-resolver/package.json +46 -0
  141. package/packages/vue3/node_modules/@intlify/runtime/LICENSE +20 -0
  142. package/packages/vue3/node_modules/@intlify/runtime/README.md +7 -0
  143. package/packages/vue3/node_modules/@intlify/runtime/dist/runtime.cjs.js +116 -0
  144. package/packages/vue3/node_modules/@intlify/runtime/dist/runtime.cjs.prod.js +116 -0
  145. package/packages/vue3/node_modules/@intlify/runtime/dist/runtime.d.ts +95 -0
  146. package/packages/vue3/node_modules/@intlify/runtime/dist/runtime.esm-bundler.js +111 -0
  147. package/packages/vue3/node_modules/@intlify/runtime/index.js +7 -0
  148. package/packages/vue3/node_modules/@intlify/runtime/package.json +51 -0
  149. package/packages/vue3/node_modules/@intlify/shared/LICENSE +20 -0
  150. package/packages/vue3/node_modules/@intlify/shared/README.md +18 -0
  151. package/packages/vue3/node_modules/@intlify/shared/dist/shared.cjs.js +222 -0
  152. package/packages/vue3/node_modules/@intlify/shared/dist/shared.cjs.prod.js +209 -0
  153. package/packages/vue3/node_modules/@intlify/shared/dist/shared.d.ts +145 -0
  154. package/packages/vue3/node_modules/@intlify/shared/dist/shared.esm-bundler.js +192 -0
  155. package/packages/vue3/node_modules/@intlify/shared/index.js +7 -0
  156. package/packages/vue3/node_modules/@intlify/shared/package.json +46 -0
  157. package/packages/vue3/node_modules/@intlify/vue-devtools/LICENSE +20 -0
  158. package/packages/vue3/node_modules/@intlify/vue-devtools/README.md +7 -0
  159. package/packages/vue3/node_modules/@intlify/vue-devtools/dist/vue-devtools.cjs.js +24 -0
  160. package/packages/vue3/node_modules/@intlify/vue-devtools/dist/vue-devtools.cjs.prod.js +24 -0
  161. package/packages/vue3/node_modules/@intlify/vue-devtools/dist/vue-devtools.d.ts +81 -0
  162. package/packages/vue3/node_modules/@intlify/vue-devtools/dist/vue-devtools.esm-bundler.js +18 -0
  163. package/packages/vue3/node_modules/@intlify/vue-devtools/index.js +7 -0
  164. package/packages/vue3/node_modules/@intlify/vue-devtools/package.json +51 -0
  165. package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/api.d.ts +90 -0
  166. package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/api.js +2 -0
  167. package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/app.d.ts +1 -0
  168. package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/app.js +2 -0
  169. package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/component.d.ts +76 -0
  170. package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/component.js +2 -0
  171. package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/context.d.ts +5 -0
  172. package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/context.js +2 -0
  173. package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/hooks.d.ts +169 -0
  174. package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/hooks.js +2 -0
  175. package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/index.d.ts +6 -0
  176. package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/index.js +18 -0
  177. package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/util.d.ts +4 -0
  178. package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/util.js +2 -0
  179. package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/const.d.ts +1 -0
  180. package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/const.js +4 -0
  181. package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/env.d.ts +10 -0
  182. package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/env.js +16 -0
  183. package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/index.d.ts +14 -0
  184. package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/index.js +31 -0
  185. package/packages/vue3/node_modules/@vue/devtools-api/lib/esm/api/api.js +0 -0
  186. package/packages/vue3/node_modules/@vue/devtools-api/lib/esm/api/app.js +0 -0
  187. package/packages/vue3/node_modules/@vue/devtools-api/lib/esm/api/component.js +0 -0
  188. package/packages/vue3/node_modules/@vue/devtools-api/lib/esm/api/context.js +0 -0
  189. package/packages/vue3/node_modules/@vue/devtools-api/lib/esm/api/hooks.js +0 -0
  190. package/packages/vue3/node_modules/@vue/devtools-api/lib/esm/api/index.js +6 -0
  191. package/packages/vue3/node_modules/@vue/devtools-api/lib/esm/api/util.js +0 -0
  192. package/packages/vue3/node_modules/@vue/devtools-api/lib/esm/const.js +1 -0
  193. package/packages/vue3/node_modules/@vue/devtools-api/lib/esm/env.js +11 -0
  194. package/packages/vue3/node_modules/@vue/devtools-api/lib/esm/index.js +17 -0
  195. package/packages/vue3/node_modules/@vue/devtools-api/package.json +38 -0
  196. package/packages/vue3/node_modules/source-map/CHANGELOG.md +301 -0
  197. package/packages/vue3/node_modules/source-map/LICENSE +28 -0
  198. package/packages/vue3/node_modules/source-map/README.md +742 -0
  199. package/packages/vue3/node_modules/source-map/dist/source-map.debug.js +3234 -0
  200. package/packages/vue3/node_modules/source-map/dist/source-map.js +3233 -0
  201. package/packages/vue3/node_modules/source-map/dist/source-map.min.js +2 -0
  202. package/packages/vue3/node_modules/source-map/dist/source-map.min.js.map +1 -0
  203. package/packages/vue3/node_modules/source-map/lib/array-set.js +121 -0
  204. package/packages/vue3/node_modules/source-map/lib/base64-vlq.js +140 -0
  205. package/packages/vue3/node_modules/source-map/lib/base64.js +67 -0
  206. package/packages/vue3/node_modules/source-map/lib/binary-search.js +111 -0
  207. package/packages/vue3/node_modules/source-map/lib/mapping-list.js +79 -0
  208. package/packages/vue3/node_modules/source-map/lib/quick-sort.js +114 -0
  209. package/packages/vue3/node_modules/source-map/lib/source-map-consumer.js +1145 -0
  210. package/packages/vue3/node_modules/source-map/lib/source-map-generator.js +425 -0
  211. package/packages/vue3/node_modules/source-map/lib/source-node.js +413 -0
  212. package/packages/vue3/node_modules/source-map/lib/util.js +488 -0
  213. package/packages/vue3/node_modules/source-map/package.json +73 -0
  214. package/packages/vue3/node_modules/source-map/source-map.d.ts +98 -0
  215. package/packages/vue3/node_modules/source-map/source-map.js +8 -0
  216. package/packages/vue3/node_modules/vue-i18n/LICENSE +20 -0
  217. package/packages/vue3/node_modules/vue-i18n/README.md +74 -0
  218. package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.cjs.js +1801 -0
  219. package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.cjs.prod.js +1685 -0
  220. package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.d.ts +3302 -0
  221. package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.esm-browser.js +5052 -0
  222. package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.esm-browser.prod.js +6 -0
  223. package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.esm-bundler.js +2226 -0
  224. package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.global.js +5065 -0
  225. package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.global.prod.js +6 -0
  226. package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.runtime.esm-browser.js +3724 -0
  227. package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.runtime.esm-browser.prod.js +6 -0
  228. package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.runtime.esm-bundler.js +2224 -0
  229. package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.runtime.global.js +3737 -0
  230. package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.runtime.global.prod.js +6 -0
  231. package/packages/vue3/node_modules/vue-i18n/index.js +7 -0
  232. package/packages/vue3/node_modules/vue-i18n/package.json +69 -0
  233. package/packages/vue3/node_modules/vue-i18n/vetur/attributes.json +62 -0
  234. package/packages/vue3/node_modules/vue-i18n/vetur/tags.json +14 -0
  235. package/packages/vue3/package.json +15 -0
  236. package/packages/vue3/yarn.lock +79 -0
  237. package/packages/vuex/CHANGELOG.md +604 -0
  238. package/packages/vuex/LICENSE +21 -0
  239. package/packages/vuex/README.md +55 -0
  240. package/packages/vuex/dist/vuex.cjs.js +1474 -0
  241. package/packages/vuex/dist/vuex.esm-browser.js +1472 -0
  242. package/packages/vuex/dist/vuex.esm-browser.prod.js +1307 -0
  243. package/packages/vuex/dist/vuex.esm-bundler.js +1473 -0
  244. package/packages/vuex/dist/vuex.global.js +1499 -0
  245. package/packages/vuex/dist/vuex.global.prod.js +6 -0
  246. package/packages/vuex/dist/vuex.mjs +32 -0
  247. package/packages/vuex/package.json +99 -0
  248. package/packages/vuex/types/helpers.d.ts +86 -0
  249. package/packages/vuex/types/index.d.ts +167 -0
  250. package/packages/vuex/types/logger.d.ts +20 -0
  251. package/packages/vuex/types/vue.d.ts +12 -0
  252. package/packages/vuex3/CHANGELOG.md +356 -0
  253. package/packages/vuex3/LICENSE +21 -0
  254. package/packages/vuex3/README.md +59 -0
  255. package/packages/vuex3/dist/logger.js +155 -0
  256. package/packages/vuex3/dist/vuex.common.js +1244 -0
  257. package/packages/vuex3/dist/vuex.esm.browser.js +1200 -0
  258. package/packages/vuex3/dist/vuex.esm.browser.min.js +6 -0
  259. package/packages/vuex3/dist/vuex.esm.js +1243 -0
  260. package/packages/vuex3/dist/vuex.js +1250 -0
  261. package/packages/vuex3/dist/vuex.min.js +6 -0
  262. package/packages/vuex3/dist/vuex.mjs +26 -0
  263. package/packages/vuex3/package.json +96 -0
  264. package/packages/vuex3/types/helpers.d.ts +86 -0
  265. package/packages/vuex3/types/index.d.ts +164 -0
  266. package/packages/vuex3/types/logger.d.ts +20 -0
  267. package/packages/vuex3/types/vue.d.ts +18 -0
  268. package/packages/webpack-uni-app-loader/plugin/index.js +8 -2
  269. package/packages/webpack-uni-app-loader/view/main.js +12 -0
@@ -0,0 +1,3302 @@
1
+ import type { App } from 'vue';
2
+ import type { ComponentInternalInstance } from 'vue';
3
+ import type { ComputedRef } from '@vue/reactivity';
4
+ import { DateTimeOptions } from '@intlify/core-base';
5
+ import { FallbackLocale } from '@intlify/core-base';
6
+ import { DateTimeFormat as IntlDateTimeFormat } from '@intlify/core-base';
7
+ import { DateTimeFormats as IntlDateTimeFormats } from '@intlify/core-base';
8
+ import { FormatMatcher as IntlFormatMatcher } from '@intlify/core-base';
9
+ import { LocaleMatcher as IntlLocaleMatcher } from '@intlify/core-base';
10
+ import { NumberFormat as IntlNumberFormat } from '@intlify/core-base';
11
+ import { NumberFormats as IntlNumberFormats } from '@intlify/core-base';
12
+ import { LinkedModifiers } from '@intlify/core-base';
13
+ import { Locale } from '@intlify/core-base';
14
+ import { LocaleMessageArray } from '@intlify/core-base';
15
+ import { LocaleMessageDictionary } from '@intlify/core-base';
16
+ import { LocaleMessages } from '@intlify/core-base';
17
+ import { LocaleMessageValue } from '@intlify/core-base';
18
+ import { MessageFunction } from '@intlify/core-base';
19
+ import { MessageFunctions } from '@intlify/core-base';
20
+ import { NamedValue } from '@intlify/core-base';
21
+ import { NumberOptions } from '@intlify/core-base';
22
+ import type { ObjectDirective } from 'vue';
23
+ import { Path } from '@intlify/core-base';
24
+ import { PathValue } from '@intlify/core-base';
25
+ import { PluralizationRule } from '@intlify/core-base';
26
+ import type { PluralizationRules } from '@intlify/core-base';
27
+ import { PostTranslationHandler } from '@intlify/core-base';
28
+ import type { RenderFunction } from 'vue';
29
+ import type { SetupContext } from 'vue';
30
+ import { TranslateOptions } from '@intlify/core-base';
31
+ import type { VNode } from 'vue';
32
+ import type { WritableComputedRef } from '@vue/reactivity';
33
+
34
+ /**
35
+ * BaseFormat Props for Components that is offered Vue I18n
36
+ *
37
+ * @remarks
38
+ * The interface definitions of the underlying props of components such as Translation, DatetimeFormat, and NumberFormat.
39
+ *
40
+ * @VueI18nComponent
41
+ */
42
+ export declare interface BaseFormatProps {
43
+ /**
44
+ * @remarks
45
+ * Used to wrap the content that is distribute in the slot. If omitted, the slot content is treated as Fragments.
46
+ *
47
+ * You can specify a string-based tag name, such as `p`, or the object for which the component is defined.
48
+ */
49
+ tag?: string | object;
50
+ /**
51
+ * @remarks
52
+ * Specifies the locale to be used for the component.
53
+ *
54
+ * If specified, the global scope or the locale of the parent scope of the target component will not be overridden and the specified locale will be used.
55
+ */
56
+ locale?: Locale;
57
+ /**
58
+ * @remarks
59
+ * Specifies the scope to be used in the target component.
60
+ *
61
+ * You can specify either `global` or `parent`.
62
+ *
63
+ * If `global` is specified, global scope is used, else then `parent` is specified, the scope of the parent of the target component is used.
64
+ *
65
+ * If the parent is a global scope, the global scope is used, if it's a local scope, the local scope is used.
66
+ */
67
+ scope?: ComponetI18nScope;
68
+ /**
69
+ * @remarks
70
+ * A composer instance with an existing scope.
71
+ *
72
+ * This option takes precedence over the `scope` option.
73
+ */
74
+ i18n?: Composer;
75
+ }
76
+
77
+ export declare type Choice = number;
78
+
79
+ declare type ComponentInstanceCreatedListener = <Messages>(target: VueI18n<Messages>, global: VueI18n<Messages>) => void;
80
+
81
+ export declare type ComponetI18nScope = Exclude<I18nScope, 'local'>;
82
+
83
+ /**
84
+ * Composer interfaces
85
+ *
86
+ * @remarks
87
+ * This is the interface for being used for Vue 3 Composition API.
88
+ *
89
+ * @VueI18nComposition
90
+ */
91
+ export declare interface Composer<Messages = {}, DateTimeFormats = {}, NumberFormats = {}, Message = VueMessageType> {
92
+ /**
93
+ * @remarks
94
+ * Instance ID.
95
+ */
96
+ id: number;
97
+ /**
98
+ * @remarks
99
+ * The current locale this Composer instance is using.
100
+ *
101
+ * If the locale contains a territory and a dialect, this locale contains an implicit fallback.
102
+ *
103
+ * @VueI18nSee [Scope and Locale Changing](../guide/essentials/scope)
104
+ */
105
+ locale: WritableComputedRef<Locale>;
106
+ /**
107
+ * @remarks
108
+ * The current fallback locales this Composer instance is using.
109
+ *
110
+ * @VueI18nSee [Fallbacking](../guide/essentials/fallback)
111
+ */
112
+ fallbackLocale: WritableComputedRef<FallbackLocale>;
113
+ /**
114
+ * @remarks
115
+ * Whether inherit the root level locale to the component localization locale.
116
+ *
117
+ * @VueI18nSee [Local Scope](../guide/essentials/scope#local-scope-2)
118
+ */
119
+ inheritLocale: boolean;
120
+ /**
121
+ * @remarks
122
+ * The list of available locales in `messages` in lexical order.
123
+ */
124
+ readonly availableLocales: Locale[];
125
+ /**
126
+ * @remarks
127
+ * The locale messages of localization.
128
+ *
129
+ * @VueI18nSee [Getting Started](../guide/)
130
+ */
131
+ readonly messages: ComputedRef<Messages>;
132
+ /**
133
+ * @remarks
134
+ * The datetime formats of localization.
135
+ *
136
+ * @VueI18nSee [Datetime Formatting](../guide/essentials/datetime)
137
+ */
138
+ readonly datetimeFormats: ComputedRef<DateTimeFormats>;
139
+ /**
140
+ * @remarks
141
+ * The number formats of localization.
142
+ *
143
+ * @VueI18nSee [Number Formatting](../guide/essentials/number)
144
+ */
145
+ readonly numberFormats: ComputedRef<NumberFormats>;
146
+ /**
147
+ * @remarks
148
+ * Custom Modifiers for linked messages.
149
+ *
150
+ * @VueI18nSee [Custom Modifiers](../guide/essentials/syntax#custom-modifiers)
151
+ */
152
+ readonly modifiers: LinkedModifiers<Message>;
153
+ /**
154
+ * @remarks
155
+ * A set of rules for word pluralization
156
+ *
157
+ * @VueI18nSee [Custom Pluralization](../guide/essentials/pluralization#custom-pluralization)
158
+ */
159
+ readonly pluralRules: PluralizationRules;
160
+ /**
161
+ * @remarks
162
+ * Whether this composer instance is global or not
163
+ */
164
+ readonly isGlobal: boolean;
165
+ /**
166
+ * @remarks
167
+ * Whether suppress warnings outputted when localization fails.
168
+ *
169
+ * @VueI18nSee [Fallbacking](../guide/essentials/fallback)
170
+ */
171
+ missingWarn: boolean | RegExp;
172
+ /**
173
+ * @remarks
174
+ * Whether suppress fall back warnings when localization fails.
175
+ *
176
+ * @VueI18nSee [Fallbacking](../guide/essentials/fallback)
177
+ */
178
+ fallbackWarn: boolean | RegExp;
179
+ /**
180
+ * @remarks
181
+ * Whether to fall back to root level (global scope) localization when localization fails.
182
+ *
183
+ * @VueI18nSee [Fallbacking](../guide/essentials/fallback)
184
+ */
185
+ fallbackRoot: boolean;
186
+ /**
187
+ * @remarks
188
+ * Whether suppress warnings when falling back to either `fallbackLocale` or root.
189
+ *
190
+ * @VueI18nSee [Fallbacking](../guide/essentials/fallback)
191
+ */
192
+ fallbackFormat: boolean;
193
+ /**
194
+ * @remarks
195
+ * Whether to allow the use locale messages of HTML formatting.
196
+ *
197
+ * If you set `false`, will check the locale messages on the Composer instance.
198
+ *
199
+ * If you are specified `true`, a warning will be output at console.
200
+ *
201
+ * @VueI18nSee [HTML Message](../guide/essentials/syntax#html-message)
202
+ * @VueI18nSee [Change `warnHtmlInMessage` option default value](../guide/migration/breaking#change-warnhtmlinmessage-option-default-value)
203
+ */
204
+ warnHtmlMessage: boolean;
205
+ /**
206
+ * @remarks
207
+ * Whether interpolation parameters are escaped before the message is translated.
208
+ *
209
+ * @VueI18nSee [HTML Message](../guide/essentials/syntax#html-message)
210
+ */
211
+ escapeParameter: boolean;
212
+ /**
213
+ * Locale message translation
214
+ *
215
+ * @remarks
216
+ * If this is used in a reactive context, it will re-evaluate once the locale changes.
217
+ *
218
+ * If [UseI18nScope](general#usei18nscope) `'local'` or Some [UseI18nOptions](composition#usei18noptions) are specified at `useI18n`, it’s translated in preferentially local scope locale messages than global scope locale messages.
219
+ *
220
+ * If not, then it’s translated with global scope locale messages.
221
+ *
222
+ * @param key - A target locale message key
223
+ *
224
+ * @returns Translated message
225
+ *
226
+ * @VueI18nSee [Scope and Locale Changing](../guide/essentials/scope)
227
+ */
228
+ t(key: Path | number): string;
229
+ /**
230
+ * Locale message translation for plurals
231
+ *
232
+ * @remarks
233
+ * Overloaded `t`. About details, see the [t](composition#t-key) details.
234
+ *
235
+ * In this overloaded `t`, return a pluralized translation message.
236
+ *
237
+ * You can also suppress the warning, when the translation missing according to the options.
238
+ *
239
+ * About details of options, see the {@link TranslateOptions}.
240
+ *
241
+ * @param key - A target locale message key
242
+ * @param plural - Which plural string to get. 1 returns the first one.
243
+ * @param options - Additional {@link TranslateOptions | options} for translation
244
+ *
245
+ * @returns Translated message
246
+ *
247
+ * @VueI18nSee [Pluralization](../guide/essentials/pluralization)
248
+ */
249
+ t(key: Path | number, plural: number, options?: TranslateOptions): string;
250
+ /**
251
+ * Locale message translation for missing default message
252
+ *
253
+ * @remarks
254
+ * Overloaded `t`. About details, see the [t](composition#t-key) details.
255
+ *
256
+ * In this overloaded `t`, if no translation was found, return a default message.
257
+ *
258
+ * You can also suppress the warning, when the translation missing according to the options.
259
+ *
260
+ * About details of options, see the {@link TranslateOptions}.
261
+ *
262
+ * @param key - A target locale message key
263
+ * @param defaultMsg - A default message to return if no translation was found
264
+ * @param options - Additional {@link TranslateOptions | options} for translation
265
+ *
266
+ * @returns Translated message
267
+ */
268
+ t(key: Path | number, defaultMsg: string, options?: TranslateOptions): string;
269
+ /**
270
+ * Locale message translation for list interpolations
271
+ *
272
+ * @remarks
273
+ * Overloaded `t`. About details, see the [t](composition#t-key) details.
274
+ *
275
+ * In this overloaded `t`, the locale messages should contain a `{0}`, `{1}`, … for each placeholder in the list.
276
+ *
277
+ * You can also suppress the warning, when the translation missing according to the options.
278
+ *
279
+ * About details of options, see the {@link TranslateOptions}.
280
+ *
281
+ * @param key - A target locale message key
282
+ * @param list - A values of list interpolation
283
+ * @param options - Additional {@link TranslateOptions | options} for translation
284
+ *
285
+ * @returns Translated message
286
+ *
287
+ * @VueI18nSee [List interpolation](../guide/essentials/syntax#list-interpolation)
288
+ */
289
+ t(key: Path | number, list: unknown[], options?: TranslateOptions): string;
290
+ /**
291
+ * Locale message translation for list interpolations and plurals
292
+ *
293
+ * @remarks
294
+ * Overloaded `t`. About details, see the [t](composition#t-key) details.
295
+ *
296
+ * In this overloaded `t`, the locale messages should contain a `{0}`, `{1}`, … for each placeholder in the list, and return a pluralized translation message.
297
+ *
298
+ * @param key - A target locale message key
299
+ * @param list - A values of list interpolation
300
+ * @param plural - Which plural string to get. 1 returns the first one.
301
+ *
302
+ * @returns Translated message
303
+ *
304
+ * @VueI18nSee [Pluralization](../guide/essentials/pluralization)
305
+ * @VueI18nSee [List interpolation](../guide/essentials/syntax#list-interpolation)
306
+ */
307
+ t(key: Path | number, list: unknown[], plural: number): string;
308
+ /**
309
+ * Locale message translation for list interpolations and missing default message
310
+ *
311
+ * @remarks
312
+ * Overloaded `t`. About details, see the [t](composition#t-key) details.
313
+ *
314
+ * In this overloaded `t`, the locale messages should contain a `{0}`, `{1}`, … for each placeholder in the list, and if no translation was found, return a default message.
315
+ *
316
+ * @param key - A target locale message key
317
+ * @param list - A values of list interpolation
318
+ * @param defaultMsg - A default message to return if no translation was found
319
+ *
320
+ * @returns Translated message
321
+ *
322
+ * @VueI18nSee [List interpolation](../guide/essentials/syntax#list-interpolation)
323
+ */
324
+ t(key: Path | number, list: unknown[], defaultMsg: string): string;
325
+ /**
326
+ * Locale message translation for named interpolations
327
+ *
328
+ * @remarks
329
+ * Overloaded `t`. About details, see the [t](composition#t-key) details.
330
+ *
331
+ * In this overloaded `t`, for each placeholder x, the locale messages should contain a `{x}` token.
332
+ *
333
+ * You can also suppress the warning, when the translation missing according to the options.
334
+ *
335
+ * About details of options, see the {@link TranslateOptions}.
336
+ *
337
+ * @param key - A target locale message key
338
+ * @param named - A values of named interpolation
339
+ * @param options - Additional {@link TranslateOptions | options} for translation
340
+ *
341
+ * @returns Translated message
342
+ *
343
+ * @VueI18nSee [Named interpolation](../guide/essentials/syntax#named-interpolation)
344
+ */
345
+ t(key: Path | number, named: NamedValue, options?: TranslateOptions): string;
346
+ /**
347
+ * Locale message translation for named interpolations and plurals
348
+ *
349
+ * @remarks
350
+ * Overloaded `t`. About details, see the [t](composition#t-key) details.
351
+ *
352
+ * In this overloaded `t`, for each placeholder x, the locale messages should contain a `{x}` token, and return a pluralized translation message.
353
+ *
354
+ * @param key - A target locale message key
355
+ * @param named - A values of named interpolation
356
+ * @param plural - Which plural string to get. 1 returns the first one.
357
+ *
358
+ * @returns Translated message
359
+ *
360
+ * @VueI18nSee [Pluralization](../guide/essentials/pluralization)
361
+ * @VueI18nSee [Named interpolation](../guide/essentials/syntax#named-interpolation)
362
+ */
363
+ t(key: Path | number, named: NamedValue, plural: number): string;
364
+ /**
365
+ * Locale message translation for named interpolations and plurals
366
+ *
367
+ * @remarks
368
+ * Overloaded `t`. About details, see the [t](composition#t-key) details.
369
+ *
370
+ * In this overloaded `t`, for each placeholder x, the locale messages should contain a `{x}` token, and if no translation was found, return a default message.
371
+ *
372
+ * @param key - A target locale message key
373
+ * @param named - A values of named interpolation
374
+ * @param defaultMsg - A default message to return if no translation was found
375
+ *
376
+ * @returns Translated message
377
+ *
378
+ * @VueI18nSee [Named interpolation](../guide/essentials/syntax#named-interpolation)
379
+ */
380
+ t(key: Path | number, named: NamedValue, defaultMsg: string): string;
381
+ /* Excluded from this release type: t */
382
+ /**
383
+ * Resolve locale message translation
384
+ *
385
+ * @remarks
386
+ * If this is used in a reactive context, it will re-evaluate once the locale changes.
387
+ *
388
+ * If [UseI18nScope](general#usei18nscope) `'local'` or Some [UseI18nOptions](composition#usei18noptions) are specified at `useI18n`, it’s translated in preferentially local scope locale messages than global scope locale messages.
389
+ *
390
+ * If not, then it’s translated with global scope locale messages.
391
+ *
392
+ * @VueI18nTip
393
+ * The use-case for `rt` is for programmatic locale messages translation with using `tm`, `v-for`, javascript `for` statement.
394
+ *
395
+ * @VueI18nWarning
396
+ * `rt` differs from `t` in that it processes the locale message directly, not the key of the locale message. There is no internal fallback with `rt`. You need to understand and use the structure of the locale messge returned by `tm`.
397
+ *
398
+ * @param message - A target locale message to be resolved. You will need to specify the locale message returned by `tm`.
399
+ *
400
+ * @returns Translated message
401
+ *
402
+ * @VueI18nSee [Scope and Locale Changing](../guide/essentials/scope)
403
+ */
404
+ rt(message: MessageFunction<Message> | Message): string;
405
+ /**
406
+ * Resolve locale message translation for plurals
407
+ *
408
+ * @remarks
409
+ * Overloaded `rt`. About details, see the [rt](composition#rt-message) details.
410
+ *
411
+ * In this overloaded `rt`, return a pluralized translation message.
412
+ *
413
+ * @VueI18nTip
414
+ * The use-case for `rt` is for programmatic locale messages translation with using `tm`, `v-for`, javascript `for` statement.
415
+ *
416
+ * @VueI18nWarning
417
+ * `rt` differs from `t` in that it processes the locale message directly, not the key of the locale message. There is no internal fallback with `rt`. You need to understand and use the structure of the locale messge returned by `tm`.
418
+ *
419
+ * @param message - A target locale message to be resolved. You will need to specify the locale message returned by `tm`.
420
+ * @param plural - Which plural string to get. 1 returns the first one.
421
+ * @param options - Additional {@link TranslateOptions | options} for translation
422
+ *
423
+ * @returns Translated message
424
+ *
425
+ * @VueI18nSee [Pluralization](../guide/essentials/pluralization)
426
+ */
427
+ rt(message: MessageFunction<Message> | Message, plural: number, options?: TranslateOptions): string;
428
+ /**
429
+ * Resolve locale message translation for list interpolations
430
+ *
431
+ * @remarks
432
+ * Overloaded `rt`. About details, see the [rt](composition#rt-message) details.
433
+ *
434
+ * In this overloaded `rt`, return a pluralized translation message.
435
+ *
436
+ * @VueI18nTip
437
+ * The use-case for `rt` is for programmatic locale messages translation with using `tm`, `v-for`, javascript `for` statement.
438
+ *
439
+ * @VueI18nWarning
440
+ * `rt` differs from `t` in that it processes the locale message directly, not the key of the locale message. There is no internal fallback with `rt`. You need to understand and use the structure of the locale messge returned by `tm`.
441
+ *
442
+ * @param message - A target locale message to be resolved. You will need to specify the locale message returned by `tm`.
443
+ * @param list - A values of list interpolation.
444
+ * @param options - Additional {@link TranslateOptions | options} for translation
445
+ *
446
+ * @returns Translated message
447
+ *
448
+ * @VueI18nSee [List interpolation](../guide/essentials/syntax#list-interpolation)
449
+ */
450
+ rt(message: MessageFunction<Message> | Message, list: unknown[], options?: TranslateOptions): string;
451
+ /**
452
+ * Resolve locale message translation for named interpolations
453
+ *
454
+ * @remarks
455
+ * Overloaded `rt`. About details, see the [rt](composition#rt-message) details.
456
+ *
457
+ * In this overloaded `rt`, for each placeholder x, the locale messages should contain a `{x}` token.
458
+ *
459
+ * @VueI18nTip
460
+ * The use-case for `rt` is for programmatic locale messages translation with using `tm`, `v-for`, javascript `for` statement.
461
+ *
462
+ * @VueI18nWarning
463
+ * `rt` differs from `t` in that it processes the locale message directly, not the key of the locale message. There is no internal fallback with `rt`. You need to understand and use the structure of the locale messge returned by `tm`.
464
+ *
465
+ * @param message - A target locale message to be resolved. You will need to specify the locale message returned by `tm`.
466
+ * @param named - A values of named interpolation.
467
+ * @param options - Additional {@link TranslateOptions | options} for translation
468
+ *
469
+ * @returns Translated message
470
+ *
471
+ * @VueI18nSee [Named interpolation](../guide/essentials/syntax#named-interpolation)
472
+ */
473
+ rt(message: MessageFunction<Message> | Message, named: NamedValue, options?: TranslateOptions): string;
474
+ /* Excluded from this release type: rt */
475
+ /**
476
+ * Datetime formatting
477
+ *
478
+ * @remarks
479
+ * If this is used in a reactive context, it will re-evaluate once the locale changes.
480
+ *
481
+ * If [UseI18nScope](general#usei18nscope) `'local'` or Some [UseI18nOptions](composition#usei18noptions) are specified at `useI18n`, it’s translated in preferentially local scope datetime formats than global scope datetime formats.
482
+ *
483
+ * If not, then it’s formatted with global scope datetime formats.
484
+ *
485
+ * @param value - A value, timestamp number or `Date` instance or ISO 8601 string
486
+ *
487
+ * @returns Formatted value
488
+ *
489
+ * @VueI18nSee [Datetime formatting](../guide/essentials/datetime)
490
+ */
491
+ d(value: number | Date | string): string;
492
+ /**
493
+ * Datetime formatting
494
+ *
495
+ * @remarks
496
+ * Overloaded `d`. About details, see the [d](composition#d-value) details.
497
+ *
498
+ * In this overloaded `d`, format in datetime format for a key registered in datetime formats.
499
+ *
500
+ * @param value - A value, timestamp number or `Date` instance or ISO 8601 string
501
+ * @param key - A key of datetime formats
502
+ *
503
+ * @returns Formatted value
504
+ */
505
+ d(value: number | Date | string, key: string): string;
506
+ /**
507
+ * Datetime formatting
508
+ *
509
+ * @remarks
510
+ * Overloaded `d`. About details, see the [d](composition#d-value) details.
511
+ *
512
+ * In this overloaded `d`, format in datetime format for a key registered in datetime formats at target locale
513
+ *
514
+ * @param value - A value, timestamp number or `Date` instance or ISO 8601 string
515
+ * @param key - A key of datetime formats
516
+ * @param locale - A locale, it will be used over than global scope or local scope.
517
+ *
518
+ * @returns Formatted value
519
+ */
520
+ d(value: number | Date | string, key: string, locale: Locale): string;
521
+ /**
522
+ * Datetime formatting
523
+ *
524
+ * @remarks
525
+ * Overloaded `d`. About details, see the [d](composition#d-value) details.
526
+ *
527
+ * You can also suppress the warning, when the formatting missing according to the options.
528
+ *
529
+ * About details of options, see the {@link DateTimeOptions}.
530
+ *
531
+ * @param value - A value, timestamp number or `Date` instance or ISO 8601 string
532
+ * @param options - Additional {@link DateTimeOptions | options} for datetime formatting
533
+ *
534
+ * @returns Formatted value
535
+ */
536
+ d(value: number | Date | string, options: DateTimeOptions): string;
537
+ /* Excluded from this release type: d */
538
+ /**
539
+ * Number Formatting
540
+ *
541
+ * @remarks
542
+ * If this is used in a reactive context, it will re-evaluate once the locale changes.
543
+ *
544
+ * If [UseI18nScope](general#usei18nscope) `'local'` or Some [UseI18nOptions](composition#usei18noptions) are specified at `useI18n`, it’s translated in preferentially local scope datetime formats than global scope datetime formats.
545
+ *
546
+ * If not, then it’s formatted with global scope number formats.
547
+ *
548
+ * @param value - A number value
549
+ *
550
+ * @returns Formatted value
551
+ *
552
+ * @VueI18nSee [Number formatting](../guide/essentials/number)
553
+ */
554
+ n(value: number): string;
555
+ /**
556
+ * Number Formatting
557
+ *
558
+ * @remarks
559
+ * Overloaded `n`. About details, see the [n](composition#n-value) details.
560
+ *
561
+ * In this overloaded `n`, format in number format for a key registered in number formats.
562
+ *
563
+ * @param value - A number value
564
+ * @param key - A key of number formats
565
+ *
566
+ * @returns Formatted value
567
+ */
568
+ n(value: number, key: string): string;
569
+ /**
570
+ * Number Formatting
571
+ *
572
+ * @remarks
573
+ * Overloaded `n`. About details, see the [n](composition#n-value) details.
574
+ *
575
+ * In this overloaded `n`, format in number format for a key registered in number formats at target locale.
576
+ *
577
+ * @param value - A number value
578
+ * @param key - A key of number formats
579
+ * @param locale - A locale, it will be used over than global scope or local scope.
580
+ *
581
+ * @returns Formatted value
582
+ */
583
+ n(value: number, key: string, locale: Locale): string;
584
+ /**
585
+ *
586
+ * Number Formatting
587
+ *
588
+ * @remarks
589
+ * Overloaded `n`. About details, see the [n](composition#n-value) details.
590
+ *
591
+ * You can also suppress the warning, when the formatting missing according to the options.
592
+ *
593
+ * About details of options, see the {@link NumberOptions}.
594
+ *
595
+ * @param value - A number value
596
+ * @param options - Additional {@link NumberOptions | options} for number formatting
597
+ *
598
+ * @returns Formatted value
599
+ */
600
+ n(value: number, options: NumberOptions): string;
601
+ /* Excluded from this release type: n */
602
+ /**
603
+ * Translation locale message exist
604
+ *
605
+ * @remarks
606
+ * whether do exist locale message on Composer instance [messages](composition#messages).
607
+ *
608
+ * If you specified `locale`, check the locale messages of `locale`.
609
+ *
610
+ * @param key - A target locale message key
611
+ * @param locale - A locale, it will be used over than global scope or local scope
612
+ *
613
+ * @returns If found locale message, `true`, else `false`
614
+ */
615
+ te(key: Path, locale?: Locale): boolean;
616
+ /**
617
+ * Locale messages getter
618
+ *
619
+ * @remarks
620
+ * If [UseI18nScope](general#usei18nscope) `'local'` or Some [UseI18nOptions](composition#usei18noptions) are specified at `useI18n`, it’s translated in preferentially local scope locale messages than global scope locale messages.
621
+ *
622
+ * Based on the current `locale`, locale messages will be returned from Composer instance messages.
623
+ *
624
+ * If you change the `locale`, the locale messages returned will also correspond to the locale.
625
+ *
626
+ * If there are no locale messages for the given `key` in the composer instance messages, they will be returned with [fallbacking](../guide/essentials/fallback).
627
+ *
628
+ * @VueI18nWarning
629
+ * You need to use `rt` for the locale message returned by `tm`. see the [rt](composition#rt-message) details.
630
+ *
631
+ * @example
632
+ * template block:
633
+ * ```html
634
+ * <div class="container">
635
+ * <template v-for="content in tm('contents')">
636
+ * <h2>{{ rt(content.title) }}</h2>
637
+ * <p v-for="paragraph in content.paragraphs">
638
+ * {{ rt(paragraph) }}
639
+ * </p>
640
+ * </template>
641
+ * </div>
642
+ * ```
643
+ * script block:
644
+ * ```js
645
+ * import { defineComponent } from 'vue
646
+ * import { useI18n } from 'vue-i18n'
647
+ *
648
+ * export default defineComponent({
649
+ * setup() {
650
+ * const { rt, tm } = useI18n({
651
+ * messages: {
652
+ * en: {
653
+ * contents: [
654
+ * {
655
+ * title: 'Title1',
656
+ * // ...
657
+ * paragraphs: [
658
+ * // ...
659
+ * ]
660
+ * }
661
+ * ]
662
+ * }
663
+ * }
664
+ * // ...
665
+ * })
666
+ * // ...
667
+ * return { ... , rt, tm }
668
+ * }
669
+ * })
670
+ * ```
671
+ *
672
+ * @param key - A target locale message key
673
+ *
674
+ * @return Locale messages
675
+ */
676
+ tm(key: Path): LocaleMessageValue<Message> | {};
677
+ /**
678
+ * Get locale message
679
+ *
680
+ * @remarks
681
+ * get locale message from Composer instance [messages](composition#messages).
682
+ *
683
+ * @param locale - A target locale
684
+ *
685
+ * @returns Locale messages
686
+ */
687
+ getLocaleMessage(locale: Locale): LocaleMessageDictionary<Message>;
688
+ /**
689
+ * Set locale message
690
+ *
691
+ * @remarks
692
+ * Set locale message to Composer instance [messages](composition#messages).
693
+ *
694
+ * @param locale - A target locale
695
+ * @param message - A message
696
+ */
697
+ setLocaleMessage(locale: Locale, message: LocaleMessageDictionary<Message>): void;
698
+ /**
699
+ * Merge locale message
700
+ *
701
+ * @remarks
702
+ * Merge locale message to Composer instance [messages](composition#messages).
703
+ *
704
+ * @param locale - A target locale
705
+ * @param message - A message
706
+ */
707
+ mergeLocaleMessage(locale: Locale, message: LocaleMessageDictionary<Message>): void;
708
+ /**
709
+ * Get datetime format
710
+ *
711
+ * @remarks
712
+ * get datetime format from Composer instance [datetimeFormats](composition#datetimeformats).
713
+ *
714
+ * @param locale - A target locale
715
+ *
716
+ * @returns Datetime format
717
+ */
718
+ getDateTimeFormat(locale: Locale): IntlDateTimeFormat;
719
+ /**
720
+ * Set datetime format
721
+ *
722
+ * @remarks
723
+ * Set datetime format to Composer instance [datetimeFormats](composition#datetimeformats).
724
+ *
725
+ * @param locale - A target locale
726
+ * @param format - A target datetime format
727
+ */
728
+ setDateTimeFormat(locale: Locale, format: IntlDateTimeFormat): void;
729
+ /**
730
+ * Merge datetime format
731
+ *
732
+ * @remarks
733
+ * Merge datetime format to Composer instance [datetimeFormats](composition#datetimeformats).
734
+ *
735
+ * @param locale - A target locale
736
+ * @param format - A target datetime format
737
+ */
738
+ mergeDateTimeFormat(locale: Locale, format: IntlDateTimeFormat): void;
739
+ /**
740
+ * Get number format
741
+ *
742
+ * @remarks
743
+ * get number format from Composer instance [numberFormats](composition#numberFormats).
744
+ *
745
+ * @param locale - A target locale
746
+ *
747
+ * @returns Number format
748
+ */
749
+ getNumberFormat(locale: Locale): IntlNumberFormat;
750
+ /**
751
+ * Set number format
752
+ *
753
+ * @remarks
754
+ * Set number format to Composer instance [numberFormats](composition#numberFormats).
755
+ *
756
+ * @param locale - A target locale
757
+ * @param format - A target number format
758
+ */
759
+ setNumberFormat(locale: Locale, format: IntlNumberFormat): void;
760
+ /**
761
+ * Merge number format
762
+ *
763
+ * @remarks
764
+ * Merge number format to Composer instance [numberFormats](composition#numberFormats).
765
+ *
766
+ * @param locale - A target locale
767
+ * @param format - A target number format
768
+ */
769
+ mergeNumberFormat(locale: Locale, format: IntlNumberFormat): void;
770
+ /**
771
+ * Get post translation handler
772
+ *
773
+ * @returns {@link PostTranslationHandler}
774
+ *
775
+ * @VueI18nSee [missing](composition#posttranslation)
776
+ */
777
+ getPostTranslationHandler(): PostTranslationHandler<Message> | null;
778
+ /**
779
+ * Set post translation handler
780
+ *
781
+ * @param handler - A {@link PostTranslationHandler}
782
+ *
783
+ * @VueI18nSee [missing](composition#posttranslation)
784
+ */
785
+ setPostTranslationHandler(handler: PostTranslationHandler<Message> | null): void;
786
+ /**
787
+ * Get missing handler
788
+ *
789
+ * @returns {@link MissingHandler}
790
+ *
791
+ * @VueI18nSee [missing](composition#missing)
792
+ */
793
+ getMissingHandler(): MissingHandler | null;
794
+ /**
795
+ * Set missing handler
796
+ *
797
+ * @param handler - A {@link MissingHandler}
798
+ *
799
+ * @VueI18nSee [missing](composition#missing)
800
+ */
801
+ setMissingHandler(handler: MissingHandler | null): void;
802
+ }
803
+
804
+ /**
805
+ * Composer additional options for `useI18n`
806
+ *
807
+ * @remarks
808
+ * `ComposerAdditionalOptions` is extend for {@link ComposerOptions}, so you can specify these options.
809
+ *
810
+ * @VueI18nSee [useI18n](composition#usei18n)
811
+ *
812
+ * @VueI18nComposition
813
+ */
814
+ export declare interface ComposerAdditionalOptions {
815
+ useScope?: I18nScope;
816
+ }
817
+
818
+ /**
819
+ * Composer Options
820
+ *
821
+ * @remarks
822
+ * This is options to create composer.
823
+ *
824
+ * @VueI18nComposition
825
+ */
826
+ export declare interface ComposerOptions<Message = VueMessageType> {
827
+ /**
828
+ * @remarks
829
+ * The locale of localization.
830
+ *
831
+ * If the locale contains a territory and a dialect, this locale contains an implicit fallback.
832
+ *
833
+ * @VueI18nSee [Scope and Locale Changing](../guide/essentials/scope)
834
+ *
835
+ * @defaultValue `'en-US'`
836
+ */
837
+ locale?: Locale;
838
+ /**
839
+ * @remarks
840
+ * The locale of fallback localization.
841
+ *
842
+ * For more complex fallback definitions see fallback.
843
+ *
844
+ * @VueI18nSee [Fallbacking](../guide/essentials/fallback)
845
+ *
846
+ * @defaultValue The default `'en-US'` for the `locale` if it's not specified, or it's `locale` value
847
+ */
848
+ fallbackLocale?: FallbackLocale;
849
+ /**
850
+ * @remarks
851
+ * Whether inheritance the root level locale to the component localization locale.
852
+ *
853
+ * If `false`, regardless of the root level locale, localize for each component locale.
854
+ *
855
+ * @VueI18nSee [Local Scope](../guide/essentials/scope#local-scope-2)
856
+ *
857
+ * @defaultValue `true`
858
+ */
859
+ inheritLocale?: boolean;
860
+ /**
861
+ * @remarks
862
+ * The locale messages of localization.
863
+ *
864
+ * @VueI18nSee [Getting Started](../guide/)
865
+ *
866
+ * @defaultValue `{}`
867
+ */
868
+ messages?: LocaleMessages<Message>;
869
+ /**
870
+ * @remarks
871
+ * Allow use flat json messages or not
872
+ *
873
+ * @defaultValue `false`
874
+ */
875
+ flatJson?: boolean;
876
+ /**
877
+ * @remarks
878
+ * The datetime formats of localization.
879
+ *
880
+ * @VueI18nSee [Datetime Formatting](../guide/essentials/datetime)
881
+ *
882
+ * @defaultValue `{}`
883
+ */
884
+ datetimeFormats?: IntlDateTimeFormats;
885
+ /**
886
+ * @remarks
887
+ * The number formats of localization.
888
+ *
889
+ * @VueI18nSee [Number Formatting](../guide/essentials/number)
890
+ *
891
+ * @defaultValue `{}`
892
+ */
893
+ numberFormats?: IntlNumberFormats;
894
+ /**
895
+ * @remarks
896
+ * Custom Modifiers for linked messages.
897
+ *
898
+ * @VueI18nSee [Custom Modifiers](../guide/essentials/syntax#custom-modifiers)
899
+ */
900
+ modifiers?: LinkedModifiers<Message>;
901
+ /**
902
+ * @remarks
903
+ * A set of rules for word pluralization
904
+ *
905
+ * @VueI18nSee [Custom Pluralization](../guide/essentials/pluralization#custom-pluralization)
906
+ *
907
+ * @defaultValue `{}`
908
+ */
909
+ pluralRules?: PluralizationRules;
910
+ /**
911
+ * @remarks
912
+ * A handler for localization missing.
913
+ *
914
+ * The handler gets called with the localization target locale, localization path key, the Vue instance and values.
915
+ *
916
+ * If missing handler is assigned, and occurred localization missing, it's not warned.
917
+ *
918
+ * @defaultValue `null`
919
+ */
920
+ missing?: MissingHandler;
921
+ /**
922
+ * @remarks
923
+ * Whether suppress warnings outputted when localization fails.
924
+ *
925
+ * If `false`, suppress localization fail warnings.
926
+ *
927
+ * If you use regular expression, you can suppress localization fail warnings that it match with translation key (e.g. `t`).
928
+ *
929
+ * @VueI18nSee [Fallbacking](../guide/essentials/fallback)
930
+ *
931
+ * @defaultValue `true`
932
+ */
933
+ missingWarn?: boolean | RegExp;
934
+ /**
935
+ * @remarks
936
+ * Whether suppress warnings when falling back to either `fallbackLocale` or root.
937
+ *
938
+ * If `false`, suppress fall back warnings.
939
+ *
940
+ * If you use regular expression, you can suppress fallback warnings that it match with translation key (e.g. `t`).
941
+ *
942
+ * @VueI18nSee [Fallbacking](../guide/essentials/fallback)
943
+ *
944
+ * @defaultValue `true`
945
+ */
946
+ fallbackWarn?: boolean | RegExp;
947
+ /**
948
+ * @remarks
949
+ * In the component localization, whether to fallback to root level (global scope) localization when localization fails.
950
+ *
951
+ * If `false`, it's not fallback to root.
952
+ *
953
+ * @VueI18nSee [Fallbacking](../guide/essentials/fallback)
954
+ *
955
+ * @defaultValue `true`
956
+ */
957
+ fallbackRoot?: boolean;
958
+ /**
959
+ * @remarks
960
+ * Whether do template interpolation on translation keys when your language lacks a translation for a key.
961
+ *
962
+ * If `true`, skip writing templates for your "base" language; the keys are your templates.
963
+ *
964
+ * @VueI18nSee [Fallbacking](../guide/essentials/fallback)
965
+ *
966
+ * @defaultValue `false`
967
+ */
968
+ fallbackFormat?: boolean;
969
+ /**
970
+ * @remarks
971
+ * A handler for post processing of translation.
972
+ *
973
+ * The handler gets after being called with the `t`.
974
+ *
975
+ * This handler is useful if you want to filter on translated text such as space trimming.
976
+ *
977
+ * @defaultValue `null`
978
+ */
979
+ postTranslation?: PostTranslationHandler<Message>;
980
+ /**
981
+ * @remarks
982
+ * Whether to allow the use locale messages of HTML formatting.
983
+ *
984
+ * See the warnHtmlMessage property.
985
+ *
986
+ * @VueI18nSee [HTML Message](../guide/essentials/syntax#html-message)
987
+ * @VueI18nSee [Change `warnHtmlInMessage` option default value](../guide/migration/breaking#change-warnhtmlinmessage-option-default-value)
988
+ *
989
+ * @defaultValue `'off'`
990
+ */
991
+ warnHtmlMessage?: boolean;
992
+ /**
993
+ * @remarks
994
+ * If `escapeParameter` is configured as true then interpolation parameters are escaped before the message is translated.
995
+ *
996
+ * This is useful when translation output is used in `v-html` and the translation resource contains html markup (e.g. <b> around a user provided value).
997
+ *
998
+ * This usage pattern mostly occurs when passing precomputed text strings into UI components.
999
+ *
1000
+ * The escape process involves replacing the following symbols with their respective HTML character entities: `<`, `>`, `"`, `'`.
1001
+ *
1002
+ * Setting `escapeParameter` as true should not break existing functionality but provides a safeguard against a subtle type of XSS attack vectors.
1003
+ *
1004
+ * @VueI18nSee [HTML Message](../guide/essentials/syntax#html-message)
1005
+ *
1006
+ * @defaultValue `false`
1007
+ */
1008
+ escapeParameter?: boolean;
1009
+ }
1010
+
1011
+ /**
1012
+ * Vue I18n factory
1013
+ *
1014
+ * @param options - An options, see the {@link I18nOptions}
1015
+ *
1016
+ * @returns {@link I18n} instance
1017
+ *
1018
+ * @remarks
1019
+ * If you use Legacy API mode, you need toto specify {@link VueI18nOptions} and `legacy: true` option.
1020
+ *
1021
+ * If you use composition API mode, you need to specify {@link ComposerOptions}.
1022
+ *
1023
+ * @VueI18nSee [Getting Started](../guide/)
1024
+ * @VueI18nSee [Composition API](../guide/advanced/composition)
1025
+ *
1026
+ * @example
1027
+ * case: for Legacy API
1028
+ * ```js
1029
+ * import { createApp } from 'vue'
1030
+ * import { createI18n } from 'vue-i18n'
1031
+ *
1032
+ * // call with I18n option
1033
+ * const i18n = createI18n({
1034
+ * locale: 'ja',
1035
+ * messages: {
1036
+ * en: { ... },
1037
+ * ja: { ... }
1038
+ * }
1039
+ * })
1040
+ *
1041
+ * const App = {
1042
+ * // ...
1043
+ * }
1044
+ *
1045
+ * const app = createApp(App)
1046
+ *
1047
+ * // install!
1048
+ * app.use(i18n)
1049
+ * app.mount('#app')
1050
+ * ```
1051
+ *
1052
+ * @example
1053
+ * case: for composition API
1054
+ * ```js
1055
+ * import { createApp } from 'vue'
1056
+ * import { createI18n, useI18n } from 'vue-i18n'
1057
+ *
1058
+ * // call with I18n option
1059
+ * const i18n = createI18n({
1060
+ * legacy: false, // you must specify 'legacy: false' option
1061
+ * locale: 'ja',
1062
+ * messages: {
1063
+ * en: { ... },
1064
+ * ja: { ... }
1065
+ * }
1066
+ * })
1067
+ *
1068
+ * const App = {
1069
+ * setup() {
1070
+ * // ...
1071
+ * const { t } = useI18n({ ... })
1072
+ * return { ... , t }
1073
+ * }
1074
+ * }
1075
+ *
1076
+ * const app = createApp(App)
1077
+ *
1078
+ * // install!
1079
+ * app.use(i18n)
1080
+ * app.mount('#app')
1081
+ * ```
1082
+ *
1083
+ * @VueI18nGeneral
1084
+ */
1085
+ export declare function createI18n<Options extends I18nOptions = {}, Messages extends Record<keyof Options['messages'], LocaleMessageDictionary<VueMessageType>> = Record<keyof Options['messages'], LocaleMessageDictionary<VueMessageType>>, DateTimeFormats extends Record<keyof Options['datetimeFormats'], IntlDateTimeFormat> = Record<keyof Options['datetimeFormats'], IntlDateTimeFormat>, NumberFormats extends Record<keyof Options['numberFormats'], IntlNumberFormat> = Record<keyof Options['numberFormats'], IntlNumberFormat>>(options?: Options): I18n<Options['messages'], Options['datetimeFormats'], Options['numberFormats'], Options['legacy'] extends boolean ? Options['legacy'] : true>;
1086
+
1087
+ export declare interface CustomBlock<Message = VueMessageType> {
1088
+ locale: Locale;
1089
+ resource: LocaleMessages<Message> | LocaleMessageDictionary<Message>;
1090
+ }
1091
+
1092
+ export declare type CustomBlocks<Message = VueMessageType> = Array<CustomBlock<Message>>;
1093
+
1094
+ /**
1095
+ * Datetime Format Component
1096
+ *
1097
+ * @remarks
1098
+ * See the following items for property about details
1099
+ *
1100
+ * @VueI18nSee [FormattableProps](component#formattableprops)
1101
+ * @VueI18nSee [BaseFormatProps](component#baseformatprops)
1102
+ * @VueI18nSee [Custom Formatting](../guide/essentials/datetime#custom-formatting)
1103
+ *
1104
+ * @VueI18nDanger
1105
+ * Not supported IE, due to no support `Intl.DateTimeFormat#formatToParts` in [IE](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/formatToParts)
1106
+ *
1107
+ * If you want to use it, you need to use [polyfill](https://github.com/formatjs/formatjs/tree/main/packages/intl-datetimeformat)
1108
+ *
1109
+ * @VueI18nComponent
1110
+ */
1111
+ export declare const DatetimeFormat: {
1112
+ name: string;
1113
+ props: {
1114
+ value: {
1115
+ type: (NumberConstructor | DateConstructor)[];
1116
+ required: boolean;
1117
+ };
1118
+ format: {
1119
+ type: (ObjectConstructor | StringConstructor)[];
1120
+ };
1121
+ } & {
1122
+ tag: {
1123
+ type: (ObjectConstructor | StringConstructor)[];
1124
+ };
1125
+ locale: {
1126
+ type: StringConstructor;
1127
+ };
1128
+ scope: {
1129
+ type: StringConstructor;
1130
+ validator: (val: "parent" | "global") => boolean;
1131
+ default: "parent" | "global";
1132
+ };
1133
+ i18n: {
1134
+ type: ObjectConstructor;
1135
+ };
1136
+ };
1137
+ setup(props: DatetimeFormatProps, context: SetupContext): RenderFunction;
1138
+ };
1139
+
1140
+ /**
1141
+ * DatetimeFormat Component Props
1142
+ *
1143
+ * @VueI18nComponent
1144
+ */
1145
+ export declare type DatetimeFormatProps = FormattableProps<number | Date, Intl.DateTimeFormatOptions>;
1146
+
1147
+ /** @VueI18nLegacy */
1148
+ export declare type DateTimeFormatResult = string;
1149
+ export { DateTimeOptions }
1150
+
1151
+ /**
1152
+ * Exported global composer instance
1153
+ *
1154
+ * @remarks
1155
+ * This interface is the [global composer](general#global) that is provided interface that is injected into each component with `app.config.globalProperties`.
1156
+ *
1157
+ * @VueI18nGeneral
1158
+ */
1159
+ export declare interface ExportedGlobalComposer {
1160
+ /**
1161
+ * Locale
1162
+ *
1163
+ * @remarks
1164
+ * This property is proxy-like property for `Composer#locale`. About details, see the [Composer#locale](composition#locale)
1165
+ */
1166
+ locale: Locale;
1167
+ /**
1168
+ * Fallback locale
1169
+ *
1170
+ * @remarks
1171
+ * This property is proxy-like property for `Composer#fallbackLocale`. About details, see the [Composer#fallbackLocale](composition#fallbacklocale)
1172
+ */
1173
+ fallbackLocale: FallbackLocale;
1174
+ /**
1175
+ * Available locales
1176
+ *
1177
+ * @remarks
1178
+ * This property is proxy-like property for `Composer#availableLocales`. About details, see the [Composer#availableLocales](composition#availablelocales)
1179
+ */
1180
+ readonly availableLocales: Locale[];
1181
+ }
1182
+ export { FallbackLocale }
1183
+
1184
+ /**
1185
+ * Formattable Props
1186
+ *
1187
+ * @remarks
1188
+ * The props used in DatetimeFormat, or NumberFormat component
1189
+ *
1190
+ * @VueI18nComponent
1191
+ */
1192
+ export declare interface FormattableProps<Value, Format> extends BaseFormatProps {
1193
+ /**
1194
+ * @remarks
1195
+ * The value specified for the target component
1196
+ */
1197
+ value: Value;
1198
+ /**
1199
+ * @remarks
1200
+ * The format to use in the target component.
1201
+ *
1202
+ * Specify the format key string or the format as defined by the Intl API in ECMA 402.
1203
+ */
1204
+ format?: string | Format;
1205
+ }
1206
+
1207
+ export declare interface Formatter {
1208
+ interpolate(message: string, values: any, path: string): Array<any> | null;
1209
+ }
1210
+
1211
+ /**
1212
+ * I18n instance
1213
+ *
1214
+ * @remarks
1215
+ * The instance required for installation as the Vue plugin
1216
+ *
1217
+ * @VueI18nGeneral
1218
+ */
1219
+ export declare interface I18n<Messages = {}, DateTimeFormats = {}, NumberFormats = {}, Legacy extends boolean = true> {
1220
+ /**
1221
+ * Vue I18n API mode
1222
+ *
1223
+ * @remarks
1224
+ * If you specified `legacy: true` option in `createI18n`, return `legacy`, else `composition`
1225
+ *
1226
+ * @defaultValue `'composition'`
1227
+ */
1228
+ readonly mode: I18nMode;
1229
+ /**
1230
+ * The property accessible to the global Composer instance or VueI18n instance
1231
+ *
1232
+ * @remarks
1233
+ * If the [I18n#mode](general#mode) is `'legacy'`, then you can access to a global {@link VueI18n} instance, else then [I18n#mode](general#mode) is `'composition' `, you can access to the global {@link Composer} instance.
1234
+ *
1235
+ * An instance of this property is **global scope***.
1236
+ */
1237
+ readonly global: Legacy extends true ? VueI18n<Messages, DateTimeFormats, NumberFormats> : Composer<Messages, DateTimeFormats, NumberFormats>;
1238
+ /**
1239
+ * Install entry point
1240
+ *
1241
+ * @param app - A target Vue app instance
1242
+ * @param options - An install options
1243
+ */
1244
+ install(app: App, ...options: unknown[]): void;
1245
+ }
1246
+
1247
+ /**
1248
+ * I18n Additional Options
1249
+ *
1250
+ * @remarks
1251
+ * Specific options for {@link createI18n}
1252
+ *
1253
+ * @VueI18nGeneral
1254
+ */
1255
+ export declare interface I18nAdditionalOptions {
1256
+ /**
1257
+ * Whether vue-i18n Legacy API mode use on your Vue App
1258
+ *
1259
+ * @remarks
1260
+ * The default is to use the Legacy API mode. If you want to use the Composition API mode, you need to set it to `false`.
1261
+ *
1262
+ * @VueI18nSee [Composition API](../guide/advanced/composition)
1263
+ *
1264
+ * @defaultValue `true`
1265
+ */
1266
+ legacy?: boolean;
1267
+ /**
1268
+ * Whether Whether to inject global properties & functions into for each component.
1269
+ *
1270
+ * @remarks
1271
+ * If set to `true`, then properties and methods prefixed with `$` are injected into Vue Component.
1272
+ *
1273
+ * @VueI18nSee [Implicit with injected properties and functions](../guide/advanced/composition#implicit-with-injected-properties-and-functions)
1274
+ * @VueI18nSee [ComponentCustomProperties](injection#componentcustomproperties)
1275
+ *
1276
+ * @defaultValue `false`
1277
+ */
1278
+ globalInjection?: boolean;
1279
+ }
1280
+
1281
+ /**
1282
+ * Vue I18n API mode
1283
+ *
1284
+ * @VueI18nSee [I18n#mode](general#mode)
1285
+ *
1286
+ * @VueI18nGeneral
1287
+ */
1288
+ export declare type I18nMode = 'legacy' | 'composition';
1289
+
1290
+ /**
1291
+ * I18n Options for `createI18n`
1292
+ *
1293
+ * @remarks
1294
+ * `I18nOptions` is inherited {@link I18nAdditionalOptions}, {@link ComposerOptions} and {@link VueI18nOptions},
1295
+ * so you can specify these options.
1296
+ *
1297
+ * @VueI18nGeneral
1298
+ */
1299
+ export declare type I18nOptions = I18nAdditionalOptions & (ComposerOptions | VueI18nOptions);
1300
+
1301
+ /**
1302
+ * Vue I18n plugin options
1303
+ *
1304
+ * @remarks
1305
+ * An options specified when installing Vue I18n as Vue plugin with using `app.use`.
1306
+ *
1307
+ * @VueI18nGeneral
1308
+ */
1309
+ export declare interface I18nPluginOptions {
1310
+ /**
1311
+ * Whether to use the tag name `i18n` for Translation Component
1312
+ *
1313
+ * @remarks
1314
+ * This option is used for compatibility with Vue I18n v8.x.
1315
+ *
1316
+ * If you can't migrate right away, you can temporarily enable this option, and you can work Translation Component.
1317
+ *
1318
+ * @defaultValue `false`
1319
+ */
1320
+ useI18nComponentName?: boolean;
1321
+ /**
1322
+ * Whether to globally install the components that is offered by Vue I18n
1323
+ *
1324
+ * @remarks
1325
+ * If this option is enabled, the components will be installed globally at `app.use` time.
1326
+ *
1327
+ * If you want to install manually in the `import` syntax, you can set it to `false` to install when needed.
1328
+ *
1329
+ * @defaultValue `true`
1330
+ */
1331
+ globalInstall?: boolean;
1332
+ }
1333
+
1334
+ /**
1335
+ * I18n Scope
1336
+ *
1337
+ * @VueI18nSee [ComposerAdditionalOptions#useScope](composition#usescope)
1338
+ * @VueI18nSee [useI18n](composition#usei18n)
1339
+ *
1340
+ * @VueI18nGeneral
1341
+ */
1342
+ export declare type I18nScope = 'local' | 'parent' | 'global';
1343
+ export { IntlDateTimeFormat }
1344
+ export { IntlDateTimeFormats }
1345
+ export { IntlFormatMatcher }
1346
+ export { IntlLocaleMatcher }
1347
+ export { IntlNumberFormat }
1348
+ export { IntlNumberFormats }
1349
+ export { LinkedModifiers }
1350
+ export { Locale }
1351
+ export { LocaleMessageArray }
1352
+ export { LocaleMessageDictionary }
1353
+
1354
+ /** @VueI18nLegacy */
1355
+ export declare type LocaleMessageObject<Message = string> = LocaleMessageDictionary<Message>;
1356
+ export { LocaleMessages }
1357
+ export { LocaleMessageValue }
1358
+ export { MessageFunction }
1359
+ export { MessageFunctions }
1360
+
1361
+ /** @VueI18nComposition */
1362
+ export declare type MissingHandler = (locale: Locale, key: Path, insttance?: ComponentInternalInstance, type?: string) => string | void;
1363
+ export { NamedValue }
1364
+
1365
+ /**
1366
+ * Number Format Component
1367
+ *
1368
+ * @remarks
1369
+ * See the following items for property about details
1370
+ *
1371
+ * @VueI18nSee [FormattableProps](component#formattableprops)
1372
+ * @VueI18nSee [BaseFormatProps](component#baseformatprops)
1373
+ * @VueI18nSee [Custom Formatting](../guide/essentials/number#custom-formatting)
1374
+ *
1375
+ * @VueI18nDanger
1376
+ * Not supported IE, due to no support `Intl.NumberFormat#formatToParts` in [IE](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/formatToParts)
1377
+ *
1378
+ * If you want to use it, you need to use [polyfill](https://github.com/formatjs/formatjs/tree/main/packages/intl-numberformat)
1379
+ *
1380
+ * @VueI18nComponent
1381
+ */
1382
+ export declare const NumberFormat: {
1383
+ name: string;
1384
+ props: {
1385
+ value: {
1386
+ type: NumberConstructor;
1387
+ required: boolean;
1388
+ };
1389
+ format: {
1390
+ type: (ObjectConstructor | StringConstructor)[];
1391
+ };
1392
+ } & {
1393
+ tag: {
1394
+ type: (ObjectConstructor | StringConstructor)[];
1395
+ };
1396
+ locale: {
1397
+ type: StringConstructor;
1398
+ };
1399
+ scope: {
1400
+ type: StringConstructor;
1401
+ validator: (val: "parent" | "global") => boolean;
1402
+ default: "parent" | "global";
1403
+ };
1404
+ i18n: {
1405
+ type: ObjectConstructor;
1406
+ };
1407
+ };
1408
+ setup(props: NumberFormatProps, context: SetupContext): RenderFunction;
1409
+ };
1410
+
1411
+ /**
1412
+ * NumberFormat Component Props
1413
+ *
1414
+ * @VueI18nComponent
1415
+ */
1416
+ export declare type NumberFormatProps = FormattableProps<number, Intl.NumberFormatOptions>;
1417
+
1418
+ /** @VueI18nLegacy */
1419
+ export declare type NumberFormatResult = string;
1420
+ export { NumberOptions }
1421
+ export { Path }
1422
+ export { PathValue }
1423
+ export { PluralizationRule }
1424
+
1425
+ export declare type PluralizationRulesMap = {
1426
+ [locale: string]: PluralizationRule;
1427
+ };
1428
+ export { PostTranslationHandler }
1429
+ export { TranslateOptions }
1430
+
1431
+ /** @VueI18nLegacy */
1432
+ export declare type TranslateResult = string;
1433
+
1434
+ /**
1435
+ * Translation Component
1436
+ *
1437
+ * @remarks
1438
+ * See the following items for property about details
1439
+ *
1440
+ * @VueI18nSee [TranslationProps](component#translationprops)
1441
+ * @VueI18nSee [BaseFormatProps](component#baseformatprops)
1442
+ * @VueI18nSee [Component Interpolation](../guide/advanced/component)
1443
+ *
1444
+ * @example
1445
+ * ```html
1446
+ * <div id="app">
1447
+ * <!-- ... -->
1448
+ * <i18n path="term" tag="label" for="tos">
1449
+ * <a :href="url" target="_blank">{{ $t('tos') }}</a>
1450
+ * </i18n>
1451
+ * <!-- ... -->
1452
+ * </div>
1453
+ * ```
1454
+ * ```js
1455
+ * import { createApp } from 'vue'
1456
+ * import { createI18n } from 'vue-i18n'
1457
+ *
1458
+ * const messages = {
1459
+ * en: {
1460
+ * tos: 'Term of Service',
1461
+ * term: 'I accept xxx {0}.'
1462
+ * },
1463
+ * ja: {
1464
+ * tos: '利用規約',
1465
+ * term: '私は xxx の{0}に同意します。'
1466
+ * }
1467
+ * }
1468
+ *
1469
+ * const i18n = createI18n({
1470
+ * locale: 'en',
1471
+ * messages
1472
+ * })
1473
+ *
1474
+ * const app = createApp({
1475
+ * data: {
1476
+ * url: '/term'
1477
+ * }
1478
+ * }).use(i18n).mount('#app')
1479
+ * ```
1480
+ *
1481
+ * @VueI18nComponent
1482
+ */
1483
+ export declare const Translation: {
1484
+ name: string;
1485
+ props: {
1486
+ keypath: {
1487
+ type: StringConstructor;
1488
+ required: boolean;
1489
+ };
1490
+ plural: {
1491
+ type: (StringConstructor | NumberConstructor)[];
1492
+ validator: (val: any) => boolean;
1493
+ };
1494
+ } & {
1495
+ tag: {
1496
+ type: (ObjectConstructor | StringConstructor)[];
1497
+ };
1498
+ locale: {
1499
+ type: StringConstructor;
1500
+ };
1501
+ scope: {
1502
+ type: StringConstructor;
1503
+ validator: (val: "parent" | "global") => boolean;
1504
+ default: "parent" | "global";
1505
+ };
1506
+ i18n: {
1507
+ type: ObjectConstructor;
1508
+ };
1509
+ };
1510
+ setup(props: TranslationProps, context: SetupContext): RenderFunction;
1511
+ };
1512
+
1513
+ /**
1514
+ * Translation Directive (`v-t`)
1515
+ *
1516
+ * @remarks
1517
+ * Update the element `textContent` that localized with locale messages.
1518
+ *
1519
+ * You can use string syntax or object syntax.
1520
+ *
1521
+ * String syntax can be specified as a keypath of locale messages.
1522
+ *
1523
+ * If you can be used object syntax, you need to specify as the object key the following params
1524
+ *
1525
+ * ```
1526
+ * - path: required, key of locale messages
1527
+ * - locale: optional, locale
1528
+ * - args: optional, for list or named formatting
1529
+ * ```
1530
+ *
1531
+ * @example
1532
+ * ```html
1533
+ * <!-- string syntax: literal -->
1534
+ * <p v-t="'foo.bar'"></p>
1535
+ *
1536
+ * <!-- string syntax: binding via data or computed props -->
1537
+ * <p v-t="msg"></p>
1538
+ *
1539
+ * <!-- object syntax: literal -->
1540
+ * <p v-t="{ path: 'hi', locale: 'ja', args: { name: 'kazupon' } }"></p>
1541
+ *
1542
+ * <!-- object syntax: binding via data or computed props -->
1543
+ * <p v-t="{ path: greeting, args: { name: fullName } }"></p>
1544
+ * ```
1545
+ *
1546
+ * @VueI18nDirective
1547
+ */
1548
+ export declare type TranslationDirective<T = HTMLElement> = ObjectDirective<T>;
1549
+
1550
+ /**
1551
+ * Translation Component Props
1552
+ *
1553
+ * @VueI18nComponent
1554
+ */
1555
+ export declare interface TranslationProps extends BaseFormatProps {
1556
+ /**
1557
+ * @remarks
1558
+ * The locale message key can be specified prop
1559
+ */
1560
+ keypath: string;
1561
+ /**
1562
+ * @remarks
1563
+ * The Plural Choosing the message number prop
1564
+ */
1565
+ plural?: number | string;
1566
+ }
1567
+
1568
+ /**
1569
+ * Use Composition API for Vue I18n
1570
+ *
1571
+ * @param options - An options, see {@link UseI18nOptions}
1572
+ *
1573
+ * @returns {@link Composer} instance
1574
+ *
1575
+ * @remarks
1576
+ * This function is mainly used by `setup`.
1577
+ *
1578
+ * If options are specified, Composer instance is created for each component and you can be localized on the component.
1579
+ *
1580
+ * If options are not specified, you can be localized using the global Composer.
1581
+ *
1582
+ * @example
1583
+ * case: Component resource base localization
1584
+ * ```html
1585
+ * <template>
1586
+ * <form>
1587
+ * <label>{{ t('language') }}</label>
1588
+ * <select v-model="locale">
1589
+ * <option value="en">en</option>
1590
+ * <option value="ja">ja</option>
1591
+ * </select>
1592
+ * </form>
1593
+ * <p>message: {{ t('hello') }}</p>
1594
+ * </template>
1595
+ *
1596
+ * <script>
1597
+ * import { useI18n } from 'vue-i18n'
1598
+ *
1599
+ * export default {
1600
+ * setup() {
1601
+ * const { t, locale } = useI18n({
1602
+ * locale: 'ja',
1603
+ * messages: {
1604
+ * en: { ... },
1605
+ * ja: { ... }
1606
+ * }
1607
+ * })
1608
+ * // Something to do ...
1609
+ *
1610
+ * return { ..., t, locale }
1611
+ * }
1612
+ * }
1613
+ * </script>
1614
+ * ```
1615
+ *
1616
+ * @VueI18nComposition
1617
+ */
1618
+ export declare function useI18n<Options extends UseI18nOptions = object, Messages extends Record<keyof Options['messages'], LocaleMessageDictionary<VueMessageType>> = Record<keyof Options['messages'], LocaleMessageDictionary<VueMessageType>>, DateTimeFormats extends Record<keyof Options['datetimeFormats'], IntlDateTimeFormat> = Record<keyof Options['datetimeFormats'], IntlDateTimeFormat>, NumberFormats extends Record<keyof Options['numberFormats'], IntlNumberFormat> = Record<keyof Options['numberFormats'], IntlNumberFormat>>(options?: Options): Composer<Options['messages'], Options['datetimeFormats'], Options['numberFormats']>;
1619
+
1620
+ /**
1621
+ * I18n Options for `useI18n`
1622
+ *
1623
+ * @remarks
1624
+ * `UseI18nOptions` is inherited {@link ComposerAdditionalOptions} and {@link ComposerOptions}, so you can specify these options.
1625
+ *
1626
+ * @VueI18nSee [useI18n](composition#usei18n)
1627
+ *
1628
+ * @VueI18nComposition
1629
+ */
1630
+ export declare type UseI18nOptions = ComposerAdditionalOptions & ComposerOptions;
1631
+
1632
+ /**
1633
+ * Vue I18n Version
1634
+ *
1635
+ * @remarks
1636
+ * Semver format. Same format as the package.json `version` field.
1637
+ *
1638
+ * @VueI18nGeneral
1639
+ */
1640
+ export declare const VERSION: string;
1641
+
1642
+ export declare function vTDirective<Messages, DateTimeFormats, NumberFormats, Legacy extends boolean>(i18n: I18n<Messages, DateTimeFormats, NumberFormats, Legacy>): TranslationDirective<HTMLElement>;
1643
+
1644
+ /**
1645
+ * VueI18n legacy interfaces
1646
+ *
1647
+ * @remarks
1648
+ * This interface is compatible with interface of `VueI18n` class (offered with Vue I18n v8.x).
1649
+ *
1650
+ * @VueI18nLegacy
1651
+ */
1652
+ export declare interface VueI18n<Messages = {}, DateTimeFormats = {}, NumberFormats = {}> {
1653
+ /**
1654
+ * @remarks
1655
+ * Instance ID.
1656
+ */
1657
+ id: number;
1658
+ /**
1659
+ * @remarks
1660
+ * The current locale this VueI18n instance is using.
1661
+ *
1662
+ * If the locale contains a territory and a dialect, this locale contains an implicit fallback.
1663
+ *
1664
+ * @VueI18nSee [Scope and Locale Changing](../guide/essentials/scope)
1665
+ */
1666
+ locale: Locale;
1667
+ /**
1668
+ * @remarks
1669
+ * The current fallback locales this VueI18n instance is using.
1670
+ *
1671
+ * @VueI18nSee [Fallbacking](../guide/essentials/fallback)
1672
+ */
1673
+ fallbackLocale: FallbackLocale;
1674
+ /**
1675
+ * @remarks
1676
+ * The list of available locales in `messages` in lexical order.
1677
+ */
1678
+ readonly availableLocales: Locale[];
1679
+ /**
1680
+ * @remarks
1681
+ * The locale messages of localization.
1682
+ *
1683
+ * @VueI18nSee [Getting Started](../guide/)
1684
+ */
1685
+ readonly messages: Messages;
1686
+ /**
1687
+ * @remarks
1688
+ * The datetime formats of localization.
1689
+ *
1690
+ * @VueI18nSee [Datetime Formatting](../guide/essentials/datetime)
1691
+ */
1692
+ readonly datetimeFormats: DateTimeFormats;
1693
+ /**
1694
+ * @remarks
1695
+ * The number formats of localization.
1696
+ *
1697
+ * @VueI18nSee [Number Formatting](../guide/essentials/number)
1698
+ */
1699
+ readonly numberFormats: NumberFormats;
1700
+ /**
1701
+ * @remarks
1702
+ * Custom Modifiers for linked messages.
1703
+ *
1704
+ * @VueI18nSee [Custom Modifiers](../guide/essentials/syntax#custom-modifiers)
1705
+ */
1706
+ readonly modifiers: LinkedModifiers<VueMessageType>;
1707
+ /**
1708
+ * @remarks
1709
+ * The formatter that implemented with Formatter interface.
1710
+ *
1711
+ * @deprecated See the [here](../guide/migration/breaking#remove-custom-formatter)
1712
+ */
1713
+ formatter: Formatter;
1714
+ /**
1715
+ * @remarks
1716
+ * A handler for localization missing.
1717
+ */
1718
+ missing: MissingHandler | null;
1719
+ /**
1720
+ * @remarks
1721
+ * A handler for post processing of translation.
1722
+ */
1723
+ postTranslation: PostTranslationHandler<VueMessageType> | null;
1724
+ /**
1725
+ * @remarks
1726
+ * Whether suppress warnings outputted when localization fails.
1727
+ *
1728
+ * @VueI18nSee [Fallbacking](../guide/essentials/fallback)
1729
+ */
1730
+ silentTranslationWarn: boolean | RegExp;
1731
+ /**
1732
+ * @remarks
1733
+ * Whether suppress fallback warnings when localization fails.
1734
+ */
1735
+ silentFallbackWarn: boolean | RegExp;
1736
+ /**
1737
+ * @remarks
1738
+ * Whether suppress warnings when falling back to either `fallbackLocale` or root.
1739
+ *
1740
+ * @VueI18nSee [Fallbacking](../guide/essentials/fallback)
1741
+ */
1742
+ formatFallbackMessages: boolean;
1743
+ /**
1744
+ * @remarks
1745
+ * Whether synchronize the root level locale to the component localization locale.
1746
+ *
1747
+ * @VueI18nSee [Local Scope](../guide/essentials/scope#local-scope-2)
1748
+ */
1749
+ sync: boolean;
1750
+ /**
1751
+ * @remarks
1752
+ * Whether to allow the use locale messages of HTML formatting.
1753
+ *
1754
+ * If you set `warn` or` error`, will check the locale messages on the VueI18n instance.
1755
+ *
1756
+ * If you are specified `warn`, a warning will be output at console.
1757
+ *
1758
+ * If you are specified `error` will occurred an Error.
1759
+ *
1760
+ * @VueI18nSee [HTML Message](../guide/essentials/syntax#html-message)
1761
+ * @VueI18nSee [Change `warnHtmlInMessage` option default value](../guide/migration/breaking#change-warnhtmlinmessage-option-default-value)
1762
+ */
1763
+ warnHtmlInMessage: WarnHtmlInMessageLevel;
1764
+ /**
1765
+ * @remarks
1766
+ * Whether interpolation parameters are escaped before the message is translated.
1767
+ *
1768
+ * @VueI18nSee [HTML Message](../guide/essentials/syntax#html-message)
1769
+ */
1770
+ escapeParameterHtml: boolean;
1771
+ /**
1772
+ * @remarks
1773
+ * Whether `v-t` directive's element should preserve `textContent` after directive is unbinded.
1774
+ *
1775
+ * @VueI18nSee [Custom Directive](../guide/advanced/directive)
1776
+ * @VueI18nSee [Remove preserveDirectiveContent option](../guide/migration/breaking#remove-preservedirectivecontent-option)
1777
+ *
1778
+ * @deprecated The `v-t` directive for Vue 3 now preserves the default content. Therefore, this option and its properties have been removed from the VueI18n instance.
1779
+ */
1780
+ preserveDirectiveContent: boolean;
1781
+ /**
1782
+ * A set of rules for word pluralization
1783
+ *
1784
+ * @VueI18nSee [Custom Pluralization](../guide/essentials/pluralization#custom-pluralization)
1785
+ */
1786
+ pluralizationRules: PluralizationRules;
1787
+ /**
1788
+ * Locale message translation.
1789
+ *
1790
+ * @remarks
1791
+ * If this is used in a reactive context, it will re-evaluate once the locale changes.
1792
+ *
1793
+ * If [i18n component options](injection#i18n) is specified, it’s translated in preferentially local scope locale messages than global scope locale messages.
1794
+ *
1795
+ * If [i18n component options](injection#i18n) isn't specified, it’s translated with global scope locale messages.
1796
+ *
1797
+ * @param key - A target locale message key
1798
+ *
1799
+ * @returns Translated message
1800
+ *
1801
+ * @VueI18nSee [Scope and Locale Changing](../guide/essentials/scope)
1802
+ */
1803
+ t(key: Path): TranslateResult;
1804
+ /**
1805
+ * Locale message translation.
1806
+ *
1807
+ * @remarks
1808
+ * Overloaded `t`. About details, see the [t](legacy#t-key) details.
1809
+ *
1810
+ * @param key - A target locale message key
1811
+ * @param locale - A locale, it will be used over than global scope or local scope.
1812
+ *
1813
+ * @returns Translated message
1814
+ */
1815
+ t(key: Path, locale: Locale): TranslateResult;
1816
+ /**
1817
+ * Locale message translation.
1818
+ *
1819
+ * @remarks
1820
+ * Overloaded `t`. About details, see the [t](legacy#t-key) details.
1821
+ *
1822
+ * @param key - A target locale message key
1823
+ * @param locale - A locale, it will be used over than global scope or local scope.
1824
+ * @param list - A values of list interpolation
1825
+ *
1826
+ * @returns Translated message
1827
+ *
1828
+ * @VueI18nSee [List interpolation](../guide/essentials/syntax#list-interpolation)
1829
+ */
1830
+ t(key: Path, locale: Locale, list: unknown[]): TranslateResult;
1831
+ /**
1832
+ * Locale message translation.
1833
+ *
1834
+ * @remarks
1835
+ * Overloaded `t`. About details, see the [t](legacy#t-key) details.
1836
+ *
1837
+ * @param key - A target locale message key
1838
+ * @param locale - A locale, it will be used over than global scope or local scope.
1839
+ * @param named - A values of named interpolation
1840
+ *
1841
+ * @returns Translated message
1842
+ *
1843
+ * @VueI18nSee [Named interpolation](../guide/essentials/syntax#named-interpolation)
1844
+ */
1845
+ t(key: Path, locale: Locale, named: object): TranslateResult;
1846
+ /**
1847
+ * Locale message translation.
1848
+ *
1849
+ * @remarks
1850
+ * Overloaded `t`. About details, see the [t](legacy#t-key) details.
1851
+ *
1852
+ * @param key - A target locale message key
1853
+ * @param list - A values of list interpolation
1854
+ *
1855
+ * @returns Translated message
1856
+ *
1857
+ * @VueI18nSee [List interpolation](../guide/essentials/syntax#list-interpolation)
1858
+ */
1859
+ t(key: Path, list: unknown[]): TranslateResult;
1860
+ /**
1861
+ * Locale message translation.
1862
+ *
1863
+ * @remarks
1864
+ * Overloaded `t`. About details, see the [t](legacy#t-key) details.
1865
+ *
1866
+ * @param key - A target locale message key
1867
+ * @param named - A values of named interpolation
1868
+ *
1869
+ * @returns Translated message
1870
+ *
1871
+ * @VueI18nSee [Named interpolation](../guide/essentials/syntax#named-interpolation)
1872
+ */
1873
+ t(key: Path, named: Record<string, unknown>): TranslateResult;
1874
+ /* Excluded from this release type: t */
1875
+ /**
1876
+ * Resolve locale message translation
1877
+ *
1878
+ * @remarks
1879
+ * If this is used in a reactive context, it will re-evaluate once the locale changes.
1880
+ *
1881
+ * @VueI18nTip
1882
+ * The use-case for `rt` is for programmatic locale messages translation with using `tm`, `v-for`, javascript `for` statement.
1883
+ *
1884
+ * @VueI18nWarning
1885
+ * `rt` differs from `t` in that it processes the locale message directly, not the key of the locale message. There is no internal fallback with `rt`. You need to understand and use the structure of the locale messge returned by `tm`.
1886
+ *
1887
+ * @param message - A target locale message to be resolved. You will need to specify the locale message returned by `tm`.
1888
+ *
1889
+ * @returns Translated message
1890
+ *
1891
+ * @VueI18nSee [Scope and Locale Changing](../guide/essentials/scope)
1892
+ */
1893
+ rt(message: MessageFunction<VueMessageType> | VueMessageType): string;
1894
+ /**
1895
+ * Resolve locale message translation for plurals
1896
+ *
1897
+ * @remarks
1898
+ * Overloaded `rt`. About details, see the [rt](legacy#rt-message) details.
1899
+ *
1900
+ * In this overloaded `rt`, return a pluralized translation message.
1901
+ *
1902
+ * @VueI18nTip
1903
+ * The use-case for `rt` is for programmatic locale messages translation with using `tm`, `v-for`, javascript `for` statement.
1904
+ *
1905
+ * @VueI18nWarning
1906
+ * `rt` differs from `t` in that it processes the locale message directly, not the key of the locale message. There is no internal fallback with `rt`. You need to understand and use the structure of the locale messge returned by `tm`.
1907
+ *
1908
+ * @param message - A target locale message to be resolved. You will need to specify the locale message returned by `tm`.
1909
+ * @param plural - Which plural string to get. 1 returns the first one.
1910
+ * @param options - Additional {@link TranslateOptions | options} for translation
1911
+ *
1912
+ * @returns Translated message
1913
+ *
1914
+ * @VueI18nSee [Pluralization](../guide/essentials/pluralization)
1915
+ */
1916
+ rt(message: MessageFunction<VueMessageType> | VueMessageType, plural: number, options?: TranslateOptions): string;
1917
+ /**
1918
+ * Resolve locale message translation for list interpolations
1919
+ *
1920
+ * @remarks
1921
+ * Overloaded `rt`. About details, see the [rt](legacy#rt-message) details.
1922
+ *
1923
+ * In this overloaded `rt`, return a pluralized translation message.
1924
+ *
1925
+ * @VueI18nTip
1926
+ * The use-case for `rt` is for programmatic locale messages translation with using `tm`, `v-for`, javascript `for` statement.
1927
+ *
1928
+ * @VueI18nWarning
1929
+ * `rt` differs from `t` in that it processes the locale message directly, not the key of the locale message. There is no internal fallback with `rt`. You need to understand and use the structure of the locale messge returned by `tm`.
1930
+ *
1931
+ * @param message - A target locale message to be resolved. You will need to specify the locale message returned by `tm`.
1932
+ * @param list - A values of list interpolation.
1933
+ * @param options - Additional {@link TranslateOptions | options} for translation
1934
+ *
1935
+ * @returns Translated message
1936
+ *
1937
+ * @VueI18nSee [List interpolation](../guide/essentials/syntax#list-interpolation)
1938
+ */
1939
+ rt(message: MessageFunction<VueMessageType> | VueMessageType, list: unknown[], options?: TranslateOptions): string;
1940
+ /**
1941
+ * Resolve locale message translation for named interpolations
1942
+ *
1943
+ * @remarks
1944
+ * Overloaded `rt`. About details, see the [rt](legacy#rt-message) details.
1945
+ *
1946
+ * In this overloaded `rt`, for each placeholder x, the locale messages should contain a `{x}` token.
1947
+ *
1948
+ * @VueI18nTip
1949
+ * The use-case for `rt` is for programmatic locale messages translation with using `tm`, `v-for`, javascript `for` statement.
1950
+ *
1951
+ * @VueI18nWarning
1952
+ * `rt` differs from `t` in that it processes the locale message directly, not the key of the locale message. There is no internal fallback with `rt`. You need to understand and use the structure of the locale messge returned by `tm`.
1953
+ *
1954
+ * @param message - A target locale message to be resolved. You will need to specify the locale message returned by `tm`.
1955
+ * @param named - A values of named interpolation.
1956
+ * @param options - Additional {@link TranslateOptions | options} for translation
1957
+ *
1958
+ * @returns Translated message
1959
+ *
1960
+ * @VueI18nSee [Named interpolation](../guide/essentials/syntax#named-interpolation)
1961
+ */
1962
+ rt(message: MessageFunction<VueMessageType> | VueMessageType, named: NamedValue, options?: TranslateOptions): string;
1963
+ /* Excluded from this release type: rt */
1964
+ /**
1965
+ * Locale message pluralization
1966
+ *
1967
+ * @remarks
1968
+ * If this is used in a reactive context, it will re-evaluate once the locale changes.
1969
+ *
1970
+ * If [i18n component options](injection#i18n) is specified, it’s pluraled in preferentially local scope locale messages than global scope locale messages.
1971
+ *
1972
+ * If [i18n component options](injection#i18n) isn't specified, it’s pluraled with global scope locale messages.
1973
+ *
1974
+ * The plural choice number is handled with default `1`.
1975
+ *
1976
+ * @param key - A target locale message key
1977
+ *
1978
+ * @returns Pluraled message
1979
+ *
1980
+ * @VueI18nSee [Pluralization](../guide/essentials/pluralization)
1981
+ */
1982
+ tc(key: Path): TranslateResult;
1983
+ /**
1984
+ * Locale message pluralization
1985
+ *
1986
+ * @remarks
1987
+ * Overloaded `tc`. About details, see the [tc](legacy#tc-key) details.
1988
+ *
1989
+ * @param key - A target locale message key
1990
+ * @param locale - A locale, it will be used over than global scope or local scope.
1991
+ *
1992
+ * @returns Pluraled message
1993
+ */
1994
+ tc(key: Path, locale: Locale): TranslateResult;
1995
+ /**
1996
+ * Locale message pluralization
1997
+ *
1998
+ * @remarks
1999
+ * Overloaded `tc`. About details, see the [tc](legacy#tc-key) details.
2000
+ *
2001
+ * @param key - A target locale message key
2002
+ * @param list - A values of list interpolation
2003
+ *
2004
+ * @returns Pluraled message
2005
+ */
2006
+ tc(key: Path, list: unknown[]): TranslateResult;
2007
+ /**
2008
+ * Locale message pluralization
2009
+ *
2010
+ * @remarks
2011
+ * Overloaded `tc`. About details, see the [tc](legacy#tc-key) details.
2012
+ *
2013
+ * @param key - A target locale message key
2014
+ * @param named - A values of named interpolation
2015
+ *
2016
+ * @returns Pluraled message
2017
+ */
2018
+ tc(key: Path, named: Record<string, unknown>): TranslateResult;
2019
+ /**
2020
+ * Locale message pluralization
2021
+ *
2022
+ * @remarks
2023
+ * Overloaded `tc`. About details, see the [tc](legacy#tc-key) details.
2024
+ *
2025
+ * @param key - A target locale message key
2026
+ * @param choice - Which plural string to get. 1 returns the first one.
2027
+ *
2028
+ * @returns Pluraled message
2029
+ */
2030
+ tc(key: Path, choice: number): TranslateResult;
2031
+ /**
2032
+ * Locale message pluralization
2033
+ *
2034
+ * @remarks
2035
+ * Overloaded `tc`. About details, see the [tc](legacy#tc-key) details.
2036
+ *
2037
+ * @param key - A target locale message key
2038
+ * @param choice - Which plural string to get. 1 returns the first one.
2039
+ * @param locale - A locale, it will be used over than global scope or local scope.
2040
+ *
2041
+ * @returns Pluraled message
2042
+ */
2043
+ tc(key: Path, choice: number, locale: Locale): TranslateResult;
2044
+ /**
2045
+ * Locale message pluralization
2046
+ *
2047
+ * @remarks
2048
+ * Overloaded `tc`. About details, see the [tc](legacy#tc-key) details.
2049
+ *
2050
+ * @param key - A target locale message key
2051
+ * @param choice - Which plural string to get. 1 returns the first one.
2052
+ * @param list - A values of list interpolation
2053
+ *
2054
+ * @returns Pluraled message
2055
+ */
2056
+ tc(key: Path, choice: number, list: unknown[]): TranslateResult;
2057
+ /**
2058
+ * Locale message pluralization
2059
+ *
2060
+ * @remarks
2061
+ * Overloaded `tc`. About details, see the [tc](legacy#tc-key) details.
2062
+ *
2063
+ * @param key - A target locale message key
2064
+ * @param choice - Which plural string to get. 1 returns the first one.
2065
+ * @param named - A values of named interpolation
2066
+ *
2067
+ * @returns Pluraled message
2068
+ */
2069
+ tc(key: Path, choice: number, named: Record<string, unknown>): TranslateResult;
2070
+ /* Excluded from this release type: tc */
2071
+ /**
2072
+ * Translation locale message exist
2073
+ *
2074
+ * @remarks
2075
+ * whether do exist locale message on VueI18n instance [messages](legacy#messages).
2076
+ *
2077
+ * If you specified `locale`, check the locale messages of `locale`.
2078
+ *
2079
+ * @param key - A target locale message key
2080
+ * @param locale - A target locale
2081
+ *
2082
+ * @returns If found locale message, `true`, else `false`
2083
+ */
2084
+ te(key: Path, locale?: Locale): boolean;
2085
+ /**
2086
+ * Locale messages getter
2087
+ *
2088
+ * @remarks
2089
+ * If [i18n component options](injection#i18n) is specified, it’s get in preferentially local scope locale messages than global scope locale messages.
2090
+ *
2091
+ * If [i18n component options](injection#i18n) isn't specified, it’s get with global scope locale messages.
2092
+ *
2093
+ * Based on the current `locale`, locale messages will be returned from Composer instance messages.
2094
+ *
2095
+ * If you change the `locale`, the locale messages returned will also correspond to the locale.
2096
+ *
2097
+ * If there are no locale messages for the given `key` in the composer instance messages, they will be returned with [fallbacking](../guide/essentials/fallback).
2098
+ *
2099
+ * @VueI18nWarning
2100
+ * You need to use `rt` for the locale message returned by `tm`. see the [rt](legacy#rt-message) details.
2101
+ *
2102
+ * @example
2103
+ * template:
2104
+ * ```html
2105
+ * <div class="container">
2106
+ * <template v-for="content in $tm('contents')">
2107
+ * <h2>{{ $rt(content.title) }}</h2>
2108
+ * <p v-for="paragraph in content.paragraphs">
2109
+ * {{ $rt(paragraph) }}
2110
+ * </p>
2111
+ * </template>
2112
+ * </div>
2113
+ * ```
2114
+ *
2115
+ * ```js
2116
+ * import { createI18n } from 'vue-i18n'
2117
+ *
2118
+ * const i18n = createI18n({
2119
+ * messages: {
2120
+ * en: {
2121
+ * contents: [
2122
+ * {
2123
+ * title: 'Title1',
2124
+ * // ...
2125
+ * paragraphs: [
2126
+ * // ...
2127
+ * ]
2128
+ * }
2129
+ * ]
2130
+ * }
2131
+ * }
2132
+ * // ...
2133
+ * })
2134
+ * ```
2135
+ * @param key - A target locale message key
2136
+ *
2137
+ * @return Locale messages
2138
+ */
2139
+ tm(key: Path): LocaleMessageValue<VueMessageType> | {};
2140
+ /**
2141
+ * Get locale message
2142
+ *
2143
+ * @remarks
2144
+ * get locale message from VueI18n instance [messages](legacy#messages).
2145
+ *
2146
+ * @param locale - A target locale
2147
+ *
2148
+ * @returns Locale messages
2149
+ */
2150
+ getLocaleMessage(locale: Locale): LocaleMessageDictionary<VueMessageType>;
2151
+ /**
2152
+ * Set locale message
2153
+ *
2154
+ * @remarks
2155
+ * Set locale message to VueI18n instance [messages](legacy#messages).
2156
+ *
2157
+ * @param locale - A target locale
2158
+ * @param message - A message
2159
+ */
2160
+ setLocaleMessage(locale: Locale, message: LocaleMessageDictionary<VueMessageType>): void;
2161
+ /**
2162
+ * Merge locale message
2163
+ *
2164
+ * @remarks
2165
+ * Merge locale message to VueI18n instance [messages](legacy#messages).
2166
+ *
2167
+ * @param locale - A target locale
2168
+ * @param message - A message
2169
+ */
2170
+ mergeLocaleMessage(locale: Locale, message: LocaleMessageDictionary<VueMessageType>): void;
2171
+ /**
2172
+ * Datetime formatting
2173
+ *
2174
+ * @remarks
2175
+ * If this is used in a reactive context, it will re-evaluate once the locale changes.
2176
+ *
2177
+ * If [i18n component options](injection#i18n) is specified, it’s formatted in preferentially local scope datetime formats than global scope locale messages.
2178
+ *
2179
+ * If [i18n component options](injection#i18n) isn't specified, it’s formatted with global scope datetime formats.
2180
+ *
2181
+ * @param value - A value, timestamp number or `Date` instance
2182
+ *
2183
+ * @returns Formatted value
2184
+ *
2185
+ * @VueI18nSee [Datetime formatting](../guide/essentials/datetime)
2186
+ */
2187
+ d(value: number | Date): DateTimeFormatResult;
2188
+ /**
2189
+ * Datetime formatting
2190
+ *
2191
+ * @remarks
2192
+ * Overloaded `d`. About details, see the [d](legacy#d-value) details.
2193
+ *
2194
+ * @param value - A value, timestamp number or `Date` instance
2195
+ * @param key - A key of datetime formats
2196
+ *
2197
+ * @returns Formatted value
2198
+ */
2199
+ d(value: number | Date, key: string): DateTimeFormatResult;
2200
+ /**
2201
+ * Datetime formatting
2202
+ *
2203
+ * @remarks
2204
+ * Overloaded `d`. About details, see the [d](legacy#d-value) details.
2205
+ *
2206
+ * @param value - A value, timestamp number or `Date` instance
2207
+ * @param key - A key of datetime formats
2208
+ * @param locale - A locale, it will be used over than global scope or local scope.
2209
+ *
2210
+ * @returns Formatted value
2211
+ */
2212
+ d(value: number | Date, key: string, locale: Locale): DateTimeFormatResult;
2213
+ /**
2214
+ * Datetime formatting
2215
+ *
2216
+ * @remarks
2217
+ * Overloaded `d`. About details, see the [d](legacy#d-value) details.
2218
+ *
2219
+ * @param value - A value, timestamp number or `Date` instance
2220
+ * @param args - An argument values
2221
+ *
2222
+ * @returns Formatted value
2223
+ */
2224
+ d(value: number | Date, args: {
2225
+ [key: string]: string;
2226
+ }): DateTimeFormatResult;
2227
+ /* Excluded from this release type: d */
2228
+ /**
2229
+ * Get datetime format
2230
+ *
2231
+ * @remarks
2232
+ * get datetime format from VueI18n instance [datetimeFormats](legacy#datetimeformats).
2233
+ *
2234
+ * @param locale - A target locale
2235
+ *
2236
+ * @returns Datetime format
2237
+ */
2238
+ getDateTimeFormat(locale: Locale): IntlDateTimeFormat;
2239
+ /**
2240
+ * Set datetime format
2241
+ *
2242
+ * @remarks
2243
+ * Set datetime format to VueI18n instance [datetimeFormats](legacy#datetimeformats).
2244
+ *
2245
+ * @param locale - A target locale
2246
+ * @param format - A target datetime format
2247
+ */
2248
+ setDateTimeFormat(locale: Locale, format: IntlDateTimeFormat): void;
2249
+ /**
2250
+ * Merge datetime format
2251
+ *
2252
+ * @remarks
2253
+ * Merge datetime format to VueI18n instance [datetimeFormats](legacy#datetimeformats).
2254
+ *
2255
+ * @param locale - A target locale
2256
+ * @param format - A target datetime format
2257
+ */
2258
+ mergeDateTimeFormat(locale: Locale, format: IntlDateTimeFormat): void;
2259
+ /**
2260
+ * Number formatting
2261
+ *
2262
+ * @remarks
2263
+ * If this is used in a reactive context, it will re-evaluate once the locale changes.
2264
+ *
2265
+ * If [i18n component options](injection#i18n) is specified, it’s formatted in preferentially local scope number formats than global scope locale messages.
2266
+ *
2267
+ * If [i18n component options](injection#i18n) isn't specified, it’s formatted with global scope number formats.
2268
+ *
2269
+ * @param value - A number value
2270
+ *
2271
+ * @returns Formatted value
2272
+ *
2273
+ * @VueI18nSee [Number formatting](../guide/essentials/number)
2274
+ */
2275
+ n(value: number): NumberFormatResult;
2276
+ /**
2277
+ * Number formatting
2278
+ *
2279
+ * @remarks
2280
+ * Overloaded `n`. About details, see the [n](legacy#n-value) details.
2281
+ *
2282
+ * @param value - A number value
2283
+ @param key - A key of number formats
2284
+ *
2285
+ * @returns Formatted value
2286
+ */
2287
+ n(value: number, key: string): NumberFormatResult;
2288
+ /**
2289
+ * Number formatting
2290
+ *
2291
+ * @remarks
2292
+ * Overloaded `n`. About details, see the [n](legacy#n-value) details.
2293
+ *
2294
+ * @param value - A number value
2295
+ * @param key - A key of number formats
2296
+ * @param locale - A locale, it will be used over than global scope or local scope.
2297
+ *
2298
+ * @returns Formatted value
2299
+ */
2300
+ n(value: number, key: string, locale: Locale): NumberFormatResult;
2301
+ /**
2302
+ * Number formatting
2303
+ *
2304
+ * @remarks
2305
+ * Overloaded `n`. About details, see the [n](legacy#n-value) details.
2306
+ *
2307
+ * @param value - A number value
2308
+ * @param args - An argument values
2309
+ *
2310
+ * @returns Formatted value
2311
+ */
2312
+ n(value: number, args: {
2313
+ [key: string]: string;
2314
+ }): NumberFormatResult;
2315
+ /* Excluded from this release type: n */
2316
+ /**
2317
+ * Get number format
2318
+ *
2319
+ * @remarks
2320
+ * get number format from VueI18n instance [numberFormats](legacy#numberFormats).
2321
+ *
2322
+ * @param locale - A target locale
2323
+ *
2324
+ * @returns Number format
2325
+ */
2326
+ getNumberFormat(locale: Locale): IntlNumberFormat;
2327
+ /**
2328
+ * Set number format
2329
+ *
2330
+ * @remarks
2331
+ * Set number format to VueI18n instance [numberFormats](legacy#numberFormats).
2332
+ *
2333
+ * @param locale - A target locale
2334
+ * @param format - A target number format
2335
+ */
2336
+ setNumberFormat(locale: Locale, format: IntlNumberFormat): void;
2337
+ /**
2338
+ * Merge number format
2339
+ *
2340
+ * @remarks
2341
+ * Merge number format to VueI18n instance [numberFormats](legacy#numberFormats).
2342
+ *
2343
+ * @param locale - A target locale
2344
+ * @param format - A target number format
2345
+ */
2346
+ mergeNumberFormat(locale: Locale, format: IntlNumberFormat): void;
2347
+ /**
2348
+ * Get choice index
2349
+ *
2350
+ * @remarks
2351
+ * Get pluralization index for current pluralizing number and a given amount of choices.
2352
+ *
2353
+ * @deprecated Use `pluralizationRules` option instead of `getChoiceIndex`.
2354
+ */
2355
+ getChoiceIndex: (choice: Choice, choicesLength: number) => number;
2356
+ }
2357
+
2358
+ /**
2359
+ * VueI18n Options
2360
+ *
2361
+ * @remarks
2362
+ * This option is compatible with `VueI18n` class constructor options (offered with Vue I18n v8.x)
2363
+ *
2364
+ * @VueI18nLegacy
2365
+ */
2366
+ export declare interface VueI18nOptions {
2367
+ /**
2368
+ * @remarks
2369
+ * The locale of localization.
2370
+ *
2371
+ * If the locale contains a territory and a dialect, this locale contains an implicit fallback.
2372
+ *
2373
+ * @VueI18nSee [Scope and Locale Changing](../guide/essentials/scope)
2374
+ *
2375
+ * @defaultValue `'en-US'`
2376
+ */
2377
+ locale?: Locale;
2378
+ /**
2379
+ * @remarks
2380
+ * The locale of fallback localization.
2381
+ *
2382
+ * For more complex fallback definitions see fallback.
2383
+ *
2384
+ * @VueI18nSee [Fallbacking](../guide/essentials/fallback)
2385
+ *
2386
+ * @defaultValue The default `'en-US'` for the `locale` if it's not specified, or it's `locale` value
2387
+ */
2388
+ fallbackLocale?: FallbackLocale;
2389
+ /**
2390
+ * @remarks
2391
+ * The locale messages of localization.
2392
+ *
2393
+ * @VueI18nSee [Getting Started](../guide/)
2394
+ *
2395
+ * @defaultValue `{}`
2396
+ */
2397
+ messages?: LocaleMessages<VueMessageType>;
2398
+ /**
2399
+ * @remarks
2400
+ * Allow use flat json messages or not
2401
+ *
2402
+ * @defaultValue `false`
2403
+ */
2404
+ flatJson?: boolean;
2405
+ /**
2406
+ * @remarks
2407
+ * The datetime formats of localization.
2408
+ *
2409
+ * @VueI18nSee [Datetime Formatting](../guide/essentials/datetime)
2410
+ *
2411
+ * @defaultValue `{}`
2412
+ */
2413
+ datetimeFormats?: IntlDateTimeFormats;
2414
+ /**
2415
+ * @remarks
2416
+ * The number formats of localization.
2417
+ *
2418
+ * @VueI18nSee [Number Formatting](../guide/essentials/number)
2419
+ *
2420
+ * @defaultValue `{}`
2421
+ */
2422
+ numberFormats?: IntlNumberFormats;
2423
+ /**
2424
+ * @remarks
2425
+ * The list of available locales in messages in lexical order.
2426
+ *
2427
+ * @defaultValue `[]`
2428
+ */
2429
+ availableLocales?: Locale[];
2430
+ /**
2431
+ * @remarks
2432
+ * Custom Modifiers for linked messages.
2433
+ *
2434
+ * @VueI18nSee [Custom Modifiers](../guide/essentials/syntax#custom-modifiers)
2435
+ */
2436
+ modifiers?: LinkedModifiers<VueMessageType>;
2437
+ /**
2438
+ * @remarks
2439
+ * The formatter that implemented with Formatter interface.
2440
+ *
2441
+ * @deprecated See the [here](../guide/migration/breaking#remove-custom-formatter)
2442
+ */
2443
+ formatter?: Formatter;
2444
+ /**
2445
+ * @remarks
2446
+ * A handler for localization missing.
2447
+ *
2448
+ * The handler gets called with the localization target locale, localization path key, the Vue instance and values.
2449
+ *
2450
+ * If missing handler is assigned, and occurred localization missing, it's not warned.
2451
+ *
2452
+ * @defaultValue `null`
2453
+ */
2454
+ missing?: MissingHandler;
2455
+ /**
2456
+ * @remarks
2457
+ * In the component localization, whether to fall back to root level (global scope) localization when localization fails.
2458
+ *
2459
+ * If `false`, it's not fallback to root.
2460
+ *
2461
+ * @VueI18nSee [Fallbacking](../guide/essentials/fallback)
2462
+ *
2463
+ * @defaultValue `true`
2464
+ */
2465
+ fallbackRoot?: boolean;
2466
+ /**
2467
+ * @remarks
2468
+ * Whether suppress warnings outputted when localization fails.
2469
+ *
2470
+ * If `true`, suppress localization fail warnings.
2471
+ *
2472
+ * If you use regular expression, you can suppress localization fail warnings that it match with translation key (e.g. `t`).
2473
+ *
2474
+ * @VueI18nSee [Fallbacking](../guide/essentials/fallback)
2475
+ *
2476
+ * @defaultValue `false`
2477
+ */
2478
+ silentTranslationWarn?: boolean | RegExp;
2479
+ /**
2480
+ * @remarks
2481
+ * Whether do template interpolation on translation keys when your language lacks a translation for a key.
2482
+ *
2483
+ * If `true`, skip writing templates for your "base" language; the keys are your templates.
2484
+ *
2485
+ * @VueI18nSee [Fallbacking](../guide/essentials/fallback)
2486
+ *
2487
+ * @defaultValue `false`
2488
+ */
2489
+ silentFallbackWarn?: boolean | RegExp;
2490
+ /**
2491
+ * @remarks
2492
+ * Whether suppress warnings when falling back to either `fallbackLocale` or root.
2493
+ *
2494
+ * @VueI18nSee [Fallbacking](../guide/essentials/fallback)
2495
+ *
2496
+ * @defaultValue `false`
2497
+ */
2498
+ formatFallbackMessages?: boolean;
2499
+ /**
2500
+ * @remarks
2501
+ * Whether `v-t` directive's element should preserve `textContent` after directive is unbinded.
2502
+ *
2503
+ * @VueI18nSee [Custom Directive](../guide/advanced/directive)
2504
+ * @VueI18nSee [Remove `preserveDirectiveContent` option](../guide/migration/breaking#remove-preservedirectivecontent-option)
2505
+ *
2506
+ * @defaultValue `false`
2507
+ *
2508
+ * @deprecated The `v-t` directive for Vue 3 now preserves the default content. Therefore, this option and its properties have been removed from the VueI18n instance.
2509
+ */
2510
+ preserveDirectiveContent?: boolean;
2511
+ /**
2512
+ * @remarks
2513
+ * Whether to allow the use locale messages of HTML formatting.
2514
+ *
2515
+ * See the warnHtmlInMessage property.
2516
+ *
2517
+ * @VueI18nSee [HTML Message](../guide/essentials/syntax#html-message)
2518
+ * @VueI18nSee [Change `warnHtmlInMessage` option default value](../guide/migration/breaking#change-warnhtmlinmessage-option-default-value)
2519
+ *
2520
+ * @defaultValue `'off'`
2521
+ */
2522
+ warnHtmlInMessage?: WarnHtmlInMessageLevel;
2523
+ /**
2524
+ * @remarks
2525
+ * If `escapeParameterHtml` is configured as true then interpolation parameters are escaped before the message is translated.
2526
+ *
2527
+ * This is useful when translation output is used in `v-html` and the translation resource contains html markup (e.g. <b> around a user provided value).
2528
+ *
2529
+ * This usage pattern mostly occurs when passing precomputed text strings into UI components.
2530
+ *
2531
+ * The escape process involves replacing the following symbols with their respective HTML character entities: `<`, `>`, `"`, `'`.
2532
+ *
2533
+ * Setting `escapeParameterHtml` as true should not break existing functionality but provides a safeguard against a subtle type of XSS attack vectors.
2534
+ *
2535
+ * @VueI18nSee [HTML Message](../guide/essentials/syntax#html-message)
2536
+ *
2537
+ * @defaultValue `false`
2538
+ */
2539
+ escapeParameterHtml?: boolean;
2540
+ /**
2541
+ * @remarks
2542
+ * The shared locale messages of localization for components. More detail see Component based localization.
2543
+ *
2544
+ * @VueI18nSee [Shared locale messages for components](../guide/essentials/local#shared-locale-messages-for-components)
2545
+ *
2546
+ * @defaultValue `undefined`
2547
+ */
2548
+ sharedMessages?: LocaleMessages<VueMessageType>;
2549
+ /**
2550
+ * @remarks
2551
+ * A set of rules for word pluralization
2552
+ *
2553
+ * @VueI18nSee [Custom Pluralization](../guide/essentials/pluralization#custom-pluralization)
2554
+ *
2555
+ * @defaultValue `{}`
2556
+ */
2557
+ pluralizationRules?: PluralizationRules;
2558
+ /**
2559
+ * @remarks
2560
+ * A handler for post processing of translation. The handler gets after being called with the `$t`, `t`, `$tc`, and `tc`.
2561
+ *
2562
+ * This handler is useful if you want to filter on translated text such as space trimming.
2563
+ *
2564
+ * @defaultValue `null`
2565
+ */
2566
+ postTranslation?: PostTranslationHandler<VueMessageType>;
2567
+ /**
2568
+ * @remarks
2569
+ * Whether synchronize the root level locale to the component localization locale.
2570
+ *
2571
+ * If `false`, regardless of the root level locale, localize for each component locale.
2572
+ *
2573
+ * @VueI18nSee [Local Scope](../guide/essentials/scope#local-scope-2)
2574
+ *
2575
+ * @defaultValue `true`
2576
+ */
2577
+ sync?: boolean;
2578
+ /**
2579
+ * @remarks
2580
+ * A handler for getting notified when component-local instance was created.
2581
+ *
2582
+ * The handler gets called with new and old (root) VueI18n instances.
2583
+ *
2584
+ * This handler is useful when extending the root VueI18n instance and wanting to also apply those extensions to component-local instance.
2585
+ *
2586
+ * @defaultValue `null`
2587
+ */
2588
+ componentInstanceCreatedListener?: ComponentInstanceCreatedListener;
2589
+ }
2590
+
2591
+ /** @VueI18nComposition */
2592
+ export declare type VueMessageType = string | VNode;
2593
+
2594
+ export declare type WarnHtmlInMessageLevel = 'off' | 'warn' | 'error';
2595
+
2596
+ export { }
2597
+
2598
+ declare module '@vue/runtime-core' {
2599
+ /**
2600
+ * Component Custom Options for Vue I18n
2601
+ *
2602
+ * @VueI18nInjection
2603
+ */
2604
+ export interface ComponentCustomOptions {
2605
+ /**
2606
+ * VueI18n options
2607
+ *
2608
+ * @remarks
2609
+ * See the {@link VueI18nOptions}
2610
+ */
2611
+ i18n?: VueI18nOptions
2612
+ /**
2613
+ * For custom blocks options
2614
+ * @internal
2615
+ */
2616
+ __i18n?: CustomBlocks
2617
+ /**
2618
+ * For devtools
2619
+ * @internal
2620
+ */
2621
+ __INTLIFY_META__?: string
2622
+ }
2623
+
2624
+ /**
2625
+ * Component Custom Properties for Vue I18n
2626
+ *
2627
+ * @VueI18nInjection
2628
+ */
2629
+ export interface ComponentCustomProperties {
2630
+ /**
2631
+ * Exported Global Composer instance, or global VueI18n instance.
2632
+ *
2633
+ * @remarks
2634
+ * You can get the {@link ExportedGlobalComposer | exported composer instance} which are exported from global {@link Composer | composer instance} created with {@link createI18n}, or global {@link VueI18n | VueI18n instance}.
2635
+ * You can get the exported composer instance in {@link I18nMode | Composition API mode}, or the Vuei18n instance in {@link I18nMode | Legacy API mode}, which is the instance you can refer to with this property.
2636
+ * The locales, locale messages, and other resources managed by the instance referenced by this property are valid as global scope.
2637
+ * If the `i18n` component custom option is not specified, it's the same as the VueI18n instance that can be referenced by the i18n instance {@link I18n.global | global} property.
2638
+ */
2639
+ $i18n: VueI18n | ExportedGlobalComposer
2640
+ /**
2641
+ * Locale message translation
2642
+ *
2643
+ * @remarks
2644
+ * If this is used in a reactive context, it will re-evaluate once the locale changes.
2645
+ *
2646
+ * In {@link I18nMode | Legacy API mode}, the input / output is the same as for VueI18n instance. About that details, see {@link VueI18n#t | `VueI18n#t`}.
2647
+ *
2648
+ * In {@link I18nMode | Composition API mode}, the `$t` is injected by `app.config.globalProperties`.
2649
+ * the input / output is the same as for Composer, and it work on **global scope**. About that details, see {@link Composer#t | `Composer#t` }.
2650
+ *
2651
+ * @param key - A target locale message key
2652
+ *
2653
+ * @returns translation message
2654
+ */
2655
+ $t(key: Path): TranslateResult
2656
+ /**
2657
+ * Locale message translation
2658
+ *
2659
+ * @remarks
2660
+ * Overloaded `$t`. About details, see the {@link $t} remarks.
2661
+ *
2662
+ * @param key - A target locale message key
2663
+ * @param locale - A locale, override locale that global scope or local scope
2664
+ *
2665
+ * @returns translation message
2666
+ */
2667
+ $t(key: Path, locale: Locale): TranslateResult
2668
+ /**
2669
+ * Locale message translation
2670
+ *
2671
+ * @remarks
2672
+ * Overloaded `$t`. About details, see the {@link $t} remarks.
2673
+ *
2674
+ * @param key - A target locale message key
2675
+ * @param locale - A locale, override locale that global scope or local scope
2676
+ * @param list - A values of list interpolation
2677
+ *
2678
+ * @returns translation message
2679
+ */
2680
+ $t(key: Path, locale: Locale, list: unknown[]): TranslateResult
2681
+ /**
2682
+ * Locale message translation
2683
+ *
2684
+ * @remarks
2685
+ * Overloaded `$t`. About details, see the {@link $t} remarks.
2686
+ *
2687
+ * @param key - A target locale message key
2688
+ * @param locale - A locale, override locale that global scope or local scope
2689
+ * @param named - A values of named interpolation
2690
+ *
2691
+ * @returns translation message
2692
+ */
2693
+ $t(key: Path, locale: Locale, named: object): TranslateResult
2694
+ /**
2695
+ * Locale message translation
2696
+ *
2697
+ * @remarks
2698
+ * Overloaded `$t`. About details, see the {@link $t} remarks.
2699
+ *
2700
+ * @param key - A target locale message key
2701
+ * @param list - A values of list interpolation
2702
+ *
2703
+ * @returns translation message
2704
+ */
2705
+ $t(key: Path, list: unknown[]): TranslateResult
2706
+ /**
2707
+ * Locale message translation
2708
+ *
2709
+ * @remarks
2710
+ * Overloaded `$t`. About details, see the {@link $t} remarks.
2711
+ *
2712
+ * @param key - A target locale message key
2713
+ * @param named - A values of named interpolation
2714
+ *
2715
+ * @returns translation message
2716
+ */
2717
+ $t(key: Path, named: Record<string, unknown>): TranslateResult
2718
+ /**
2719
+ * Locale message translation
2720
+ *
2721
+ * @remarks
2722
+ * Overloaded `$t`. About details, see the {@link $t} remarks.
2723
+ *
2724
+ * @param key - A target locale message key
2725
+ *
2726
+ * @returns translation message
2727
+ */
2728
+ $t(key: Path): string
2729
+ /**
2730
+ * Locale message translation
2731
+ *
2732
+ * @remarks
2733
+ * Overloaded `$t`. About details, see the {@link $t} remarks.
2734
+ *
2735
+ * @param key - A target locale message key
2736
+ * @param plural - A choice number of plural
2737
+ *
2738
+ * @returns translation message
2739
+ */
2740
+ $t(key: Path, plural: number): string
2741
+ /**
2742
+ * Locale message translation
2743
+ *
2744
+ * @remarks
2745
+ * Overloaded `$t`. About details, see the {@link $t} remarks.
2746
+ *
2747
+ * @param key - A target locale message key
2748
+ * @param plural - Which plural string to get. 1 returns the first one.
2749
+ * @param options - An options, see the {@link TranslateOptions}
2750
+ *
2751
+ * @returns translation message
2752
+ */
2753
+ $t(key: Path, plural: number, options: TranslateOptions): string
2754
+ /**
2755
+ * Locale message translation
2756
+ *
2757
+ * @remarks
2758
+ * Overloaded `$t`. About details, see the {@link $t} remarks.
2759
+ *
2760
+ * @param key - A target locale message key
2761
+ * @param defaultMsg - A default message to return if no translation was found
2762
+ *
2763
+ * @returns translation message
2764
+ */
2765
+ $t(key: Path, defaultMsg: string): string
2766
+ /**
2767
+ * Locale message translation
2768
+ *
2769
+ * @remarks
2770
+ * Overloaded `$t`. About details, see the {@link $t} remarks.
2771
+ *
2772
+ * @param key - A target locale message key
2773
+ * @param defaultMsg - A default message to return if no translation was found
2774
+ * @param options - An options, see the {@link TranslateOptions}
2775
+ *
2776
+ * @returns translation message
2777
+ */
2778
+ $t(key: Path, defaultMsg: string, options: TranslateOptions): string
2779
+ /**
2780
+ * Locale message translation
2781
+ *
2782
+ * @remarks
2783
+ * Overloaded `$t`. About details, see the {@link $t} remarks.
2784
+ *
2785
+ * @param key - A target locale message key
2786
+ * @param list - A values of list interpolation
2787
+ *
2788
+ * @returns translation message
2789
+ */
2790
+ $t(key: Path, list: unknown[]): string
2791
+ /**
2792
+ * Locale message translation
2793
+ *
2794
+ * @remarks
2795
+ * Overloaded `$t`. About details, see the {@link $t} remarks.
2796
+ *
2797
+ * @param key - A target locale message key
2798
+ * @param list - A values of list interpolation
2799
+ * @param plural - A choice number of plural
2800
+ *
2801
+ * @returns translation message
2802
+ */
2803
+ $t(key: Path, list: unknown[], plural: number): string
2804
+ /**
2805
+ * Locale message translation
2806
+ *
2807
+ * @remarks
2808
+ * Overloaded `$t`. About details, see the {@link $t} remarks.
2809
+ *
2810
+ * @param key - A target locale message key
2811
+ * @param list - A values of list interpolation
2812
+ * @param defaultMsg - A default message to return if no translation was found
2813
+ *
2814
+ * @returns translation message
2815
+ */
2816
+ $t(key: Path, list: unknown[], defaultMsg: string): string
2817
+ /**
2818
+ * Locale message translation
2819
+ *
2820
+ * @remarks
2821
+ * Overloaded `$t`. About details, see the {@link $t} remarks.
2822
+ *
2823
+ * @param key - A target locale message key
2824
+ * @param list - A values of list interpolation
2825
+ * @param options - An options, see the {@link TranslateOptions}
2826
+ *
2827
+ * @returns translation message
2828
+ */
2829
+ $t(key: Path, list: unknown[], options: TranslateOptions): string
2830
+ /**
2831
+ * Locale message translation
2832
+ *
2833
+ * @remarks
2834
+ * Overloaded `$t`. About details, see the {@link $t} remarks.
2835
+ *
2836
+ * @param key - A target locale message key
2837
+ * @param named - A values of named interpolation
2838
+ *
2839
+ * @returns translation message
2840
+ */
2841
+ $t(key: Path, named: NamedValue): string
2842
+ /**
2843
+ * Locale message translation
2844
+ *
2845
+ * @remarks
2846
+ * Overloaded `$t`. About details, see the {@link $t} remarks.
2847
+ *
2848
+ * @param key - A target locale message key
2849
+ * @param named - A values of named interpolation
2850
+ * @param plural - A choice number of plural
2851
+ *
2852
+ * @returns translation message
2853
+ */
2854
+ $t(key: Path, named: NamedValue, plural: number): string
2855
+ /**
2856
+ * Locale message translation
2857
+ *
2858
+ * @remarks
2859
+ * Overloaded `$t`. About details, see the {@link $t} remarks.
2860
+ *
2861
+ * @param key - A target locale message key
2862
+ * @param named - A values of named interpolation
2863
+ * @param defaultMsg - A default message to return if no translation was found
2864
+ *
2865
+ * @returns translation message
2866
+ */
2867
+ $t(key: Path, named: NamedValue, defaultMsg: string): string
2868
+ /**
2869
+ * Locale message translation
2870
+ *
2871
+ * @remarks
2872
+ * Overloaded `$t`. About details, see the {@link $t} remarks.
2873
+ *
2874
+ * @param key - A target locale message key
2875
+ * @param named - A values of named interpolation
2876
+ * @param options - An options, see the {@link TranslateOptions}
2877
+ *
2878
+ * @returns translation message
2879
+ */
2880
+ $t(key: Path, named: NamedValue, options: TranslateOptions): string
2881
+ /**
2882
+ * Resolve locale message translation
2883
+ *
2884
+ * @remarks
2885
+ * If this is used in a reactive context, it will re-evaluate once the locale changes.
2886
+ *
2887
+ * In {@link I18nMode | Legacy API mode}, the input / output is the same as for VueI18n instance. About that details, see {@link VueI18n#rt | `VueI18n#rt`}.
2888
+ *
2889
+ * In {@link I18nMode | Composition API mode}, the `$rt` is injected by `app.config.globalProperties`.
2890
+ * the input / output is the same as for Composer, and it work on **global scope**. About that details, see {@link Composer#rt | `Composer#rt` }.
2891
+ *
2892
+ * @param message - A target locale message to be resolved. You will need to specify the locale message returned by `$tm`.
2893
+ *
2894
+ * @returns translated message
2895
+ */
2896
+ $rt(message: MessageFunction<VueMessageType> | VueMessageType): string
2897
+ /**
2898
+ * Resolve locale message translation for plurals
2899
+ *
2900
+ * @remarks
2901
+ * Overloaded `$rt`. About details, see the {@link $rt} remarks.
2902
+ *
2903
+ * @param message - A target locale message to be resolved. You will need to specify the locale message returned by `$tm`.
2904
+ * @param plural - Which plural string to get. 1 returns the first one.
2905
+ * @param options - Additional {@link TranslateOptions | options} for translation
2906
+ *
2907
+ * @returns Translated message
2908
+ */
2909
+ $rt(
2910
+ message: MessageFunction<VueMessageType> | VueMessageType,
2911
+ plural: number,
2912
+ options?: TranslateOptions
2913
+ ): string
2914
+ /**
2915
+ * Resolve locale message translation for list interpolations
2916
+ *
2917
+ * @remarks
2918
+ * Overloaded `$rt`. About details, see the {@link $rt} remarks.
2919
+ *
2920
+ * @param message - A target locale message to be resolved. You will need to specify the locale message returned by `$tm`.
2921
+ * @param list - A values of list interpolation.
2922
+ * @param options - Additional {@link TranslateOptions | options} for translation
2923
+ *
2924
+ * @returns Translated message
2925
+ */
2926
+ $rt(
2927
+ message: MessageFunction<VueMessageType> | VueMessageType,
2928
+ list: unknown[],
2929
+ options?: TranslateOptions
2930
+ ): string
2931
+ /**
2932
+ * Resolve locale message translation for named interpolations
2933
+ *
2934
+ * @remarks
2935
+ * Overloaded `$rt`. About details, see the {@link $rt} remarks.
2936
+ *
2937
+ * @param message - A target locale message to be resolved. You will need to specify the locale message returned by `$tm`.
2938
+ * @param named - A values of named interpolation.
2939
+ * @param options - Additional {@link TranslateOptions | options} for translation
2940
+ *
2941
+ * @returns Translated message
2942
+ */
2943
+ $rt(
2944
+ message: MessageFunction<VueMessageType> | VueMessageType,
2945
+ named: NamedValue,
2946
+ options?: TranslateOptions
2947
+ ): string
2948
+ /**
2949
+ * Locale message pluralization
2950
+ *
2951
+ * @remarks
2952
+ * If this is used in a reactive context, it will re-evaluate once the locale changes.
2953
+ *
2954
+ * The input / output is the same as for VueI18n instance. About that details, see {@link VueI18n#tc | `VueI18n#tc` }.
2955
+ * The value of plural is handled with default `1`.
2956
+ * Supported for Legacy API mode only.
2957
+ *
2958
+ * @param key - A target locale message key
2959
+ *
2960
+ * @returns translation message that is pluraled
2961
+ */
2962
+ $tc(key: Path): TranslateResult
2963
+ /**
2964
+ * Locale message pluralization
2965
+ *
2966
+ * @remarks
2967
+ * Overloaded `$tc`. About details, see the {@link $tc} remarks.
2968
+ * Supported for Legacy API mode only.
2969
+ *
2970
+ * @param key - A target locale message key
2971
+ * @param locale - A locale, override locale that global scope or local scope
2972
+ *
2973
+ * @returns translation message that is pluraled
2974
+ */
2975
+ $tc(key: Path, locale: Locale): TranslateResult
2976
+ /**
2977
+ * Locale message pluralization
2978
+ *
2979
+ * @remarks
2980
+ * Overloaded `$tc`. About details, see the {@link $tc} remarks.
2981
+ * Supported for Legacy API mode only.
2982
+ *
2983
+ * @param key - A target locale message key
2984
+ * @param list - A values of list interpolation
2985
+ *
2986
+ * @returns translation message that is pluraled
2987
+ */
2988
+ $tc(key: Path, list: unknown[]): TranslateResult
2989
+ /**
2990
+ * Locale message pluralization
2991
+ * Supported for Legacy API mode only.
2992
+ *
2993
+ * @remarks
2994
+ * Overloaded `$tc`. About details, see the {@link $tc} remarks.
2995
+ * Supported for Legacy API mode only.
2996
+ *
2997
+ * @param key - A target locale message key
2998
+ * @param named - A values of named interpolation
2999
+ *
3000
+ * @returns translation message that is pluraled
3001
+ */
3002
+ $tc(key: Path, named: Record<string, unknown>): TranslateResult
3003
+ /**
3004
+ * Locale message pluralization
3005
+ * Supported for Legacy API mode only.
3006
+ *
3007
+ * @remarks
3008
+ * Overloaded `$tc`. About details, see the {@link $tc} remarks.
3009
+ * Supported for Legacy API mode only.
3010
+ *
3011
+ * @param key - A target locale message key
3012
+ * @param choice - Which plural string to get. 1 returns the first one.
3013
+ *
3014
+ * @returns translation message that is pluraled
3015
+ */
3016
+ $tc(key: Path, choice: number): TranslateResult
3017
+ /**
3018
+ * Locale message pluralization
3019
+ * Supported for Legacy API mode only.
3020
+ *
3021
+ * @remarks
3022
+ * Overloaded `$tc`. About details, see the {@link $tc} remarks.
3023
+ * Supported for Legacy API mode only.
3024
+ *
3025
+ * @param key - A target locale message key
3026
+ * @param choice - Which plural string to get. 1 returns the first one.
3027
+ * @param locale - A locale, override locale that global scope or local scope
3028
+ *
3029
+ * @returns translation message that is pluraled
3030
+ */
3031
+ $tc(key: Path, choice: number, locale: Locale): TranslateResult
3032
+ /**
3033
+ * Locale message pluralization
3034
+ * Supported for Legacy API mode only.
3035
+ *
3036
+ * @remarks
3037
+ * Overloaded `$tc`. About details, see the {@link $tc} remarks.
3038
+ * Supported for Legacy API mode only.
3039
+ *
3040
+ * @param key - A target locale message key
3041
+ * @param choice - Which plural string to get. 1 returns the first one.
3042
+ * @param list - A values of list interpolation
3043
+ *
3044
+ * @returns translation message that is pluraled
3045
+ */
3046
+ $tc(key: Path, choice: number, list: unknown[]): TranslateResult
3047
+ /**
3048
+ * Locale message pluralization
3049
+ * Supported for Legacy API mode only.
3050
+ *
3051
+ * @remarks
3052
+ * Overloaded `$tc`. About details, see the {@link $tc} remarks.
3053
+ * Supported for Legacy API mode only.
3054
+ *
3055
+ * @param key - A target locale message key
3056
+ * @param choice - Which plural string to get. 1 returns the first one.
3057
+ * @param named - A values of named interpolation
3058
+ *
3059
+ * @returns translation message that is pluraled
3060
+ */
3061
+ $tc(
3062
+ key: Path,
3063
+ choice: number,
3064
+ named: Record<string, unknown>
3065
+ ): TranslateResult
3066
+ /**
3067
+ * Translation message exist
3068
+ *
3069
+ * @remarks
3070
+ * The input / output is the same as for VueI18n instance. About that details, see {@link VueI18n#te | `VueI18n.#te` }.
3071
+ * Supported for Legacy API mode only.
3072
+ *
3073
+ * @param key - A target locale message key
3074
+ * @param locale - A locale, optional, override locale that global scope or local scope
3075
+ *
3076
+ * @returns if found locale message, `true`, else `false`
3077
+ */
3078
+ $te(key: Path, locale?: Locale): boolean
3079
+ /**
3080
+ * Datetime formatting
3081
+ *
3082
+ * @remarks
3083
+ * If this is used in a reactive context, it will re-evaluate once the locale changes.
3084
+ *
3085
+ * In {@link I18nMode | Legacy API mode}, the input / output is the same as for VueI18n instance. About that details, see {@link VueI18n#d | `VueI18n#d` }.
3086
+ *
3087
+ * In {@link I18nMode | Composition API mode}, the `$d` is injected by `app.config.globalProperties`.
3088
+ * the input / output is the same as for Composer instance, and it work on **global scope**. About that details, see {@link Composer#d | `Composer#d` }.
3089
+ *
3090
+ * @param value - A value, timestamp number or `Date` instance
3091
+ *
3092
+ * @returns formatted value
3093
+ */
3094
+ $d(value: number | Date): DateTimeFormatResult
3095
+ /**
3096
+ * Datetime formatting
3097
+ *
3098
+ * @remarks
3099
+ * Overloaded `$d`. About details, see the {@link $d} remarks.
3100
+ *
3101
+ * @param value - A value, timestamp number or `Date` instance
3102
+ * @param key - A key of datetime formats
3103
+ *
3104
+ * @returns formatted value
3105
+ */
3106
+ $d(value: number | Date, key: string): DateTimeFormatResult
3107
+ /**
3108
+ * Datetime formatting
3109
+ *
3110
+ * @remarks
3111
+ * Overloaded `$d`. About details, see the {@link $d} remarks.
3112
+ *
3113
+ * @param value - A value, timestamp number or `Date` instance
3114
+ * @param key - A key of datetime formats
3115
+ * @param locale - A locale, optional, override locale that global scope or local scope
3116
+ *
3117
+ * @returns formatted value
3118
+ */
3119
+ $d(value: number | Date, key: string, locale: Locale): DateTimeFormatResult
3120
+ /**
3121
+ * Datetime formatting
3122
+ *
3123
+ * @remarks
3124
+ * Overloaded `$d`. About details, see the {@link $d} remarks.
3125
+ *
3126
+ * @param value - A value, timestamp number or `Date` instance
3127
+ * @param args - An argument values
3128
+ *
3129
+ * @returns formatted value
3130
+ */
3131
+ $d(
3132
+ value: number | Date,
3133
+ args: { [key: string]: string }
3134
+ ): DateTimeFormatResult
3135
+ /**
3136
+ * Datetime formatting
3137
+ *
3138
+ * @remarks
3139
+ * Overloaded `$d`. About details, see the {@link $d} remarks.
3140
+ *
3141
+ * @param value - A value, timestamp number or `Date` instance
3142
+ *
3143
+ * @returns formatted value
3144
+ */
3145
+ $d(value: number | Date): string
3146
+ /**
3147
+ * Datetime formatting
3148
+ *
3149
+ * @remarks
3150
+ * Overloaded `$d`. About details, see the {@link $d} remarks.
3151
+ *
3152
+ * @param value - A value, timestamp number or `Date` instance
3153
+ * @param key - A key of datetime formats
3154
+ *
3155
+ * @returns formatted value
3156
+ */
3157
+ $d(value: number | Date, key: string): string
3158
+ /**
3159
+ * Datetime formatting
3160
+ *
3161
+ * @remarks
3162
+ * Overloaded `$d`. About details, see the {@link $d} remarks.
3163
+ *
3164
+ * @param value - A value, timestamp number or `Date` instance
3165
+ * @param key - A key of datetime formats
3166
+ * @param locale - A locale, optional, override locale that global scope or local scope
3167
+ *
3168
+ * @returns formatted value
3169
+ */
3170
+ $d(value: number | Date, key: string, locale: Locale): string
3171
+ /**
3172
+ * Datetime formatting
3173
+ *
3174
+ * @remarks
3175
+ * Overloaded `$d`. About details, see the {@link $d} remarks.
3176
+ *
3177
+ * @param value - A value, timestamp number or `Date` instance
3178
+ * @param options - An options, see the {@link DateTimeOptions}
3179
+ *
3180
+ * @returns formatted value
3181
+ */
3182
+ $d(value: number | Date, options: DateTimeOptions): string
3183
+ /**
3184
+ * Number formatting
3185
+ *
3186
+ * @remarks
3187
+ * If this is used in a reactive context, it will re-evaluate once the locale changes.
3188
+ *
3189
+ * In {@link I18nMode | Legacy API mode}, the input / output is the same as for VueI18n instance. About that details, see {@link VueI18n#n | `VueI18n.n` }.
3190
+ *
3191
+ * In {@link I18nMode | Composition API mode}, the `$n` is injected by `app.config.globalProperties`.
3192
+ * the input / output is the same as for Composer instance, and it work on **global scope**. About that details, see {@link Composer#n | `Composer.n` }.
3193
+ *
3194
+ * @param value - A number value
3195
+ *
3196
+ * @returns formatted value
3197
+ */
3198
+ $n(value: number): NumberFormatResult
3199
+ /**
3200
+ * Number formatting
3201
+ *
3202
+ * @remarks
3203
+ * Overloaded `$n`. About details, see the {@link $n} remarks.
3204
+ *
3205
+ * @param value - A number value
3206
+ * @param key - A key of number formats
3207
+ *
3208
+ * @returns formatted value
3209
+ */
3210
+ $n(value: number, key: string): NumberFormatResult
3211
+ /**
3212
+ * Number formatting
3213
+ *
3214
+ * @remarks
3215
+ * Overloaded `$n`. About details, see the {@link $n} remarks.
3216
+ *
3217
+ * @param value - A number value
3218
+ * @param key - A key of number formats
3219
+ * @param locale - A locale, optional, override locale that global scope or local scope
3220
+ *
3221
+ * @returns formatted value
3222
+ */
3223
+ $n(value: number, key: string, locale: Locale): NumberFormatResult
3224
+ /**
3225
+ * Number formatting
3226
+ *
3227
+ * @remarks
3228
+ * Overloaded `$n`. About details, see the {@link $n} remarks.
3229
+ *
3230
+ * @param value - A number value
3231
+ * @param args - An argument values
3232
+ *
3233
+ * @returns formatted value
3234
+ */
3235
+ $n(value: number, args: { [key: string]: string }): NumberFormatResult
3236
+ /**
3237
+ * Number formatting
3238
+ *
3239
+ * @remarks
3240
+ * Overloaded `$n`. About details, see the {@link $n} remarks.
3241
+ *
3242
+ * @param value - A number value
3243
+ *
3244
+ * @returns formatted value
3245
+ */
3246
+ $n(value: number): string
3247
+ /**
3248
+ * Number formatting
3249
+ *
3250
+ * @remarks
3251
+ * Overloaded `$n`. About details, see the {@link $n} remarks.
3252
+ *
3253
+ * @param value - A number value
3254
+ * @param key - A key of number formats
3255
+ *
3256
+ * @returns formatted value
3257
+ */
3258
+ $n(value: number, key: string): string
3259
+ /**
3260
+ * Number formatting
3261
+ *
3262
+ * @remarks
3263
+ * Overloaded `$n`. About details, see the {@link $n} remarks.
3264
+ *
3265
+ * @param value - A number value
3266
+ * @param key - A key of number formats
3267
+ * @param locale - A locale, optional, override locale that global scope or local scope
3268
+ *
3269
+ * @returns formatted value
3270
+ */
3271
+ $n(value: number, key: string, locale: Locale): string
3272
+ /**
3273
+ * Number formatting
3274
+ *
3275
+ * @remarks
3276
+ * Overloaded `$n`. About details, see the {@link $n} remarks.
3277
+ *
3278
+ * @param value - A number value
3279
+ * @param options - An options, see the {@link NumberOptions}
3280
+ *
3281
+ * @returns formatted value
3282
+ */
3283
+ $n(value: number, options: NumberOptions): string
3284
+ /**
3285
+ * Locale messages getter
3286
+ *
3287
+ * In {@link I18nMode | Legacy API mode}, the input / output is the same as for VueI18n instance. About that details, see {@link VueI18n#tm | `VueI18n#tm` }.
3288
+ *
3289
+ * @remarks
3290
+ * In {@link I18nMode | Composition API mode}, the `$tm` is injected by `app.config.globalProperties`.
3291
+ * the input / output is the same as for Composer instance, and it work on **global scope**. About that details, see {@link Composer#tm | `Composer.tm` }.
3292
+ * Based on the current `locale`, locale messages will be returned from Composer instance messages.
3293
+ * If you change the `locale`, the locale messages returned will also correspond to the locale.
3294
+ * If there are no locale messages for the given `key` in the composer instance messages, they will be returned with fallbacking.
3295
+ *
3296
+ * @param key - A target locale message key
3297
+ *
3298
+ * @returns locale messages
3299
+ */
3300
+ $tm(key: Path): LocaleMessageValue<VueMessageType> | {}
3301
+ }
3302
+ }