@chatsdk-dev/elements 0.0.1 → 0.1.2

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 (329) hide show
  1. package/README.md +3 -3
  2. package/dist/api-CIYPz72L.d.ts +10 -0
  3. package/dist/api-CIYPz72L.d.ts.map +1 -0
  4. package/dist/callbacks-PIvHXeEI.d.ts +24 -0
  5. package/dist/callbacks-PIvHXeEI.d.ts.map +1 -0
  6. package/dist/chat-element-CCsDDFif.js +441 -0
  7. package/dist/chat-element-CCsDDFif.js.map +1 -0
  8. package/dist/chat-element-CSpa62Te.d.ts +53 -0
  9. package/dist/chat-element-CSpa62Te.d.ts.map +1 -0
  10. package/dist/chatsdk-provider-BhlChLFd.d.ts +15 -0
  11. package/dist/chatsdk-provider-BhlChLFd.d.ts.map +1 -0
  12. package/dist/common/utils.d.ts +14 -0
  13. package/dist/common/utils.d.ts.map +1 -0
  14. package/dist/common/utils.js +26 -0
  15. package/dist/common/utils.js.map +1 -0
  16. package/dist/components/info-card.d.ts +20 -11
  17. package/dist/components/info-card.d.ts.map +1 -0
  18. package/dist/components/info-card.js +38 -1
  19. package/dist/components/info-card.js.map +1 -0
  20. package/dist/config-BigIL6TQ.js +29 -0
  21. package/dist/config-BigIL6TQ.js.map +1 -0
  22. package/dist/config-CqihvSgz.d.ts +150 -0
  23. package/dist/config-CqihvSgz.d.ts.map +1 -0
  24. package/dist/config-D_jVTH_D.d.ts +58 -0
  25. package/dist/config-D_jVTH_D.d.ts.map +1 -0
  26. package/dist/context-aSaHw-ac.d.ts +13 -0
  27. package/dist/context-aSaHw-ac.d.ts.map +1 -0
  28. package/dist/element-provider-C_nBsftD.d.ts +40 -0
  29. package/dist/element-provider-C_nBsftD.d.ts.map +1 -0
  30. package/dist/features/chat/chat-card.d.ts +5 -3
  31. package/dist/features/chat/chat-card.d.ts.map +1 -0
  32. package/dist/features/chat/chat-card.js +2 -14
  33. package/dist/features/chat/chat-element.d.ts +2 -0
  34. package/dist/features/chat/chat-element.js +2 -0
  35. package/dist/features/chat/chat-header/chat-header.d.ts +8 -4
  36. package/dist/features/chat/chat-header/chat-header.d.ts.map +1 -0
  37. package/dist/features/chat/chat-header/chat-header.js +2 -14
  38. package/dist/features/chat/chat-header/chat-menu.d.ts +5 -3
  39. package/dist/features/chat/chat-header/chat-menu.d.ts.map +1 -0
  40. package/dist/features/chat/chat-header/chat-menu.js +29 -2
  41. package/dist/features/chat/chat-header/chat-menu.js.map +1 -0
  42. package/dist/features/chat/chat-history/chat-history-empty.d.ts +5 -3
  43. package/dist/features/chat/chat-history/chat-history-empty.d.ts.map +1 -0
  44. package/dist/features/chat/chat-history/chat-history-empty.js +24 -1
  45. package/dist/features/chat/chat-history/chat-history-empty.js.map +1 -0
  46. package/dist/features/chat/chat-history/chat-history.d.ts +5 -3
  47. package/dist/features/chat/chat-history/chat-history.d.ts.map +1 -0
  48. package/dist/features/chat/chat-history/chat-history.js +2 -14
  49. package/dist/features/chat/chat-main/chat-main.d.ts +10 -0
  50. package/dist/features/chat/chat-main/chat-main.d.ts.map +1 -0
  51. package/dist/features/chat/chat-main/chat-main.js +3 -0
  52. package/dist/features/chat/chat-main/use-chat.d.ts +23 -0
  53. package/dist/features/chat/chat-main/use-chat.d.ts.map +1 -0
  54. package/dist/features/chat/chat-main/use-chat.js +3 -0
  55. package/dist/features/chat/chat-main/use-initial-messages.d.ts +22 -0
  56. package/dist/features/chat/chat-main/use-initial-messages.d.ts.map +1 -0
  57. package/dist/features/chat/chat-main/use-initial-messages.js +2 -0
  58. package/dist/features/chat/chat-prompt-input.d.ts +20 -12
  59. package/dist/features/chat/chat-prompt-input.d.ts.map +1 -0
  60. package/dist/features/chat/chat-prompt-input.js +3 -14
  61. package/dist/features/chat/chat.context.d.ts +17 -15
  62. package/dist/features/chat/chat.context.d.ts.map +1 -0
  63. package/dist/features/chat/chat.context.js +9 -12
  64. package/dist/features/chat/chat.context.js.map +1 -0
  65. package/dist/features/chat/index.d.ts +2 -14
  66. package/dist/features/chat/index.js +2 -14
  67. package/dist/features/chat/queries/query-keys.d.ts +7 -5
  68. package/dist/features/chat/queries/query-keys.d.ts.map +1 -0
  69. package/dist/features/chat/queries/query-keys.js +19 -1
  70. package/dist/features/chat/queries/query-keys.js.map +1 -0
  71. package/dist/features/chat/queries/use-create-conversation-mutation.d.ts +27 -23
  72. package/dist/features/chat/queries/use-create-conversation-mutation.d.ts.map +1 -0
  73. package/dist/features/chat/queries/use-create-conversation-mutation.js +17 -36
  74. package/dist/features/chat/queries/use-create-conversation-mutation.js.map +1 -0
  75. package/dist/features/chat/queries/use-get-chat-query.d.ts +9 -5
  76. package/dist/features/chat/queries/use-get-chat-query.d.ts.map +1 -0
  77. package/dist/features/chat/queries/use-get-chat-query.js +2 -14
  78. package/dist/features/chat/queries/use-get-conversation-query.d.ts +56 -46
  79. package/dist/features/chat/queries/use-get-conversation-query.d.ts.map +1 -0
  80. package/dist/features/chat/queries/use-get-conversation-query.js +2 -14
  81. package/dist/features/chat/queries/use-list-conversations-query.d.ts +27 -23
  82. package/dist/features/chat/queries/use-list-conversations-query.d.ts.map +1 -0
  83. package/dist/features/chat/queries/use-list-conversations-query.js +2 -14
  84. package/dist/features/chat/store.d.ts +10 -8
  85. package/dist/features/chat/store.d.ts.map +1 -0
  86. package/dist/features/chat/store.js +15 -1
  87. package/dist/features/chat/store.js.map +1 -0
  88. package/dist/features/chat/utils.d.ts +4 -2
  89. package/dist/features/chat/utils.d.ts.map +1 -0
  90. package/dist/features/chat/utils.js +15 -1
  91. package/dist/features/chat/utils.js.map +1 -0
  92. package/dist/features/data-fetching/use-api-client.d.ts +5 -3
  93. package/dist/features/data-fetching/use-api-client.d.ts.map +1 -0
  94. package/dist/features/data-fetching/use-api-client.js +2 -14
  95. package/dist/features/element/chatsdk-provider.d.ts +2 -0
  96. package/dist/features/element/chatsdk-provider.js +23 -0
  97. package/dist/features/element/chatsdk-provider.js.map +1 -0
  98. package/dist/features/element/constants.d.ts +5 -0
  99. package/dist/features/element/constants.d.ts.map +1 -0
  100. package/dist/features/element/constants.js +6 -0
  101. package/dist/features/element/constants.js.map +1 -0
  102. package/dist/features/element/element-provider.d.ts +2 -0
  103. package/dist/features/element/element-provider.js +82 -0
  104. package/dist/features/element/element-provider.js.map +1 -0
  105. package/dist/features/element/store.d.ts +2 -0
  106. package/dist/features/element/store.js +112 -0
  107. package/dist/features/element/store.js.map +1 -0
  108. package/dist/features/element/types/api.d.ts +2 -0
  109. package/dist/features/element/types/api.js +1 -0
  110. package/dist/features/element/types/callbacks.d.ts +2 -0
  111. package/dist/features/element/types/callbacks.js +1 -0
  112. package/dist/features/element/types/config.d.ts +2 -0
  113. package/dist/features/element/types/config.js +1 -0
  114. package/dist/features/element/types/context.d.ts +2 -0
  115. package/dist/features/element/types/context.js +1 -0
  116. package/dist/features/element/types/locale.d.ts +2 -0
  117. package/dist/features/element/types/locale.js +1 -0
  118. package/dist/features/element/types/theme.d.ts +2 -0
  119. package/dist/features/element/types/theme.js +1 -0
  120. package/dist/features/element/types/translations.d.ts +2 -0
  121. package/dist/features/element/types/translations.js +1 -0
  122. package/dist/features/element/use-element-config.d.ts +40 -0
  123. package/dist/features/element/use-element-config.d.ts.map +1 -0
  124. package/dist/features/element/use-element-config.js +39 -0
  125. package/dist/features/element/use-element-config.js.map +1 -0
  126. package/dist/features/element/use-merge-global-config.d.ts +20 -0
  127. package/dist/features/element/use-merge-global-config.d.ts.map +1 -0
  128. package/dist/features/element/use-merge-global-config.js +34 -0
  129. package/dist/features/element/use-merge-global-config.js.map +1 -0
  130. package/dist/features/element/utils.d.ts +2 -0
  131. package/dist/features/element/utils.js +86 -0
  132. package/dist/features/element/utils.js.map +1 -0
  133. package/dist/features/logger/logger.d.ts +2 -9
  134. package/dist/features/logger/logger.js +15 -1
  135. package/dist/features/logger/logger.js.map +1 -0
  136. package/dist/i18n/config.d.ts +2 -61
  137. package/dist/i18n/config.js +2 -1
  138. package/dist/i18n/i18next.d.ts +1382 -10
  139. package/dist/i18n/i18next.d.ts.map +1 -0
  140. package/dist/i18n/i18next.js +27 -2
  141. package/dist/i18n/i18next.js.map +1 -0
  142. package/dist/i18n/utils.d.ts +4 -3
  143. package/dist/i18n/utils.d.ts.map +1 -0
  144. package/dist/i18n/utils.js +10 -3
  145. package/dist/i18n/utils.js.map +1 -0
  146. package/dist/index.d.ts +5 -20
  147. package/dist/index.js +68 -20
  148. package/dist/index.js.map +1 -0
  149. package/dist/locale-W5Kyyi4X.d.ts +11 -0
  150. package/dist/locale-W5Kyyi4X.d.ts.map +1 -0
  151. package/dist/logger-BvmhODdq.d.ts +11 -0
  152. package/dist/logger-BvmhODdq.d.ts.map +1 -0
  153. package/dist/store-CGX9oRlE.d.ts +46 -0
  154. package/dist/store-CGX9oRlE.d.ts.map +1 -0
  155. package/dist/styles.css +1954 -1963
  156. package/dist/theme-Cb-RBWbR.d.ts +38 -0
  157. package/dist/theme-Cb-RBWbR.d.ts.map +1 -0
  158. package/package.json +18 -50
  159. package/dist/chunk-2LHKM7RD.js +0 -14
  160. package/dist/chunk-5UMYP6MD.js +0 -10
  161. package/dist/chunk-AP4MG32M.js +0 -36
  162. package/dist/chunk-CFM57HOS.js +0 -358
  163. package/dist/chunk-EGIUE7H2.js +0 -37
  164. package/dist/chunk-M5OONVIO.js +0 -90
  165. package/dist/chunk-MXTBCHYC.js +0 -31
  166. package/dist/chunk-NIC3MOMY.js +0 -55
  167. package/dist/chunk-QTRMNIG3.js +0 -83
  168. package/dist/chunk-R7G3RQLU.js +0 -36
  169. package/dist/chunk-RJG5D2TM.js +0 -113
  170. package/dist/chunk-SLJNKQ2G.js +0 -125
  171. package/dist/chunk-TDEFIW2L.js +0 -9
  172. package/dist/chunk-TDP6D7U7.js +0 -551
  173. package/dist/chunk-V2ITXC65.js +0 -24
  174. package/dist/chunk-VS55HRUS.js +0 -16
  175. package/dist/chunk-VYDYCGJL.js +0 -25
  176. package/dist/chunk-X5YUF2YM.js +0 -113
  177. package/dist/chunk-YX46JVQN.js +0 -78
  178. package/dist/chunk-YXAMLTTT.js +0 -16
  179. package/dist/chunk-YXFVHSY4.js +0 -51
  180. package/dist/chunk-ZCSZX3OI.js +0 -4
  181. package/dist/common/use-copy-to-clipboard.d.ts +0 -3
  182. package/dist/common/use-copy-to-clipboard.js +0 -33
  183. package/dist/common/utilts.d.ts +0 -8
  184. package/dist/common/utilts.js +0 -28
  185. package/dist/components/ai-elements/actions.d.ts +0 -13
  186. package/dist/components/ai-elements/actions.js +0 -42
  187. package/dist/components/ai-elements/agent.d.ts +0 -31
  188. package/dist/components/ai-elements/agent.js +0 -77
  189. package/dist/components/ai-elements/artifact.d.ts +0 -27
  190. package/dist/components/ai-elements/artifact.js +0 -108
  191. package/dist/components/ai-elements/attachments.d.ts +0 -57
  192. package/dist/components/ai-elements/attachments.js +0 -258
  193. package/dist/components/ai-elements/audio-player.d.ts +0 -33
  194. package/dist/components/ai-elements/audio-player.js +0 -199
  195. package/dist/components/ai-elements/canvas.d.ts +0 -10
  196. package/dist/components/ai-elements/canvas.js +0 -24
  197. package/dist/components/ai-elements/chain-of-thought.d.ts +0 -34
  198. package/dist/components/ai-elements/chain-of-thought.js +0 -159
  199. package/dist/components/ai-elements/checkpoint.d.ts +0 -16
  200. package/dist/components/ai-elements/checkpoint.js +0 -47
  201. package/dist/components/ai-elements/code-block.d.ts +0 -48
  202. package/dist/components/ai-elements/code-block.js +0 -1
  203. package/dist/components/ai-elements/commit.d.ts +0 -68
  204. package/dist/components/ai-elements/commit.js +0 -314
  205. package/dist/components/ai-elements/confirmation.d.ts +0 -52
  206. package/dist/components/ai-elements/confirmation.js +0 -76
  207. package/dist/components/ai-elements/connection.d.ts +0 -5
  208. package/dist/components/ai-elements/connection.js +0 -34
  209. package/dist/components/ai-elements/context.d.ts +0 -36
  210. package/dist/components/ai-elements/context.js +0 -320
  211. package/dist/components/ai-elements/controls.d.ts +0 -8
  212. package/dist/components/ai-elements/controls.js +0 -17
  213. package/dist/components/ai-elements/conversation.d.ts +0 -27
  214. package/dist/components/ai-elements/conversation.js +0 -119
  215. package/dist/components/ai-elements/edge.d.ts +0 -9
  216. package/dist/components/ai-elements/edge.js +0 -111
  217. package/dist/components/ai-elements/environment-variables.d.ts +0 -42
  218. package/dist/components/ai-elements/environment-variables.js +0 -208
  219. package/dist/components/ai-elements/file-tree.d.ts +0 -30
  220. package/dist/components/ai-elements/file-tree.js +0 -212
  221. package/dist/components/ai-elements/image.d.ts +0 -10
  222. package/dist/components/ai-elements/image.js +0 -23
  223. package/dist/components/ai-elements/inline-citation.d.ts +0 -42
  224. package/dist/components/ai-elements/inline-citation.js +0 -203
  225. package/dist/components/ai-elements/jsx-preview.d.ts +0 -33
  226. package/dist/components/ai-elements/jsx-preview.js +0 -206
  227. package/dist/components/ai-elements/loader.d.ts +0 -9
  228. package/dist/components/ai-elements/loader.js +0 -115
  229. package/dist/components/ai-elements/message.d.ts +0 -42
  230. package/dist/components/ai-elements/message.js +0 -259
  231. package/dist/components/ai-elements/mic-selector.d.ts +0 -49
  232. package/dist/components/ai-elements/mic-selector.js +0 -252
  233. package/dist/components/ai-elements/model-selector.d.ts +0 -39
  234. package/dist/components/ai-elements/model-selector.js +0 -73
  235. package/dist/components/ai-elements/node.d.ts +0 -25
  236. package/dist/components/ai-elements/node.js +0 -41
  237. package/dist/components/ai-elements/open-in-chat.d.ts +0 -32
  238. package/dist/components/ai-elements/open-in-chat.js +0 -366
  239. package/dist/components/ai-elements/package-info.d.ts +0 -32
  240. package/dist/components/ai-elements/package-info.js +0 -162
  241. package/dist/components/ai-elements/panel.d.ts +0 -8
  242. package/dist/components/ai-elements/panel.js +0 -17
  243. package/dist/components/ai-elements/persona.d.ts +0 -50
  244. package/dist/components/ai-elements/persona.js +0 -209
  245. package/dist/components/ai-elements/plan.d.ts +0 -29
  246. package/dist/components/ai-elements/plan.js +0 -95
  247. package/dist/components/ai-elements/prompt-input.d.ts +0 -153
  248. package/dist/components/ai-elements/prompt-input.js +0 -939
  249. package/dist/components/ai-elements/queue.d.ts +0 -65
  250. package/dist/components/ai-elements/queue.js +0 -179
  251. package/dist/components/ai-elements/reasoning.d.ts +0 -30
  252. package/dist/components/ai-elements/reasoning.js +0 -161
  253. package/dist/components/ai-elements/response.d.ts +0 -9
  254. package/dist/components/ai-elements/response.js +0 -33
  255. package/dist/components/ai-elements/sandbox.d.ts +0 -28
  256. package/dist/components/ai-elements/sandbox.js +0 -98
  257. package/dist/components/ai-elements/schema-display.d.ts +0 -58
  258. package/dist/components/ai-elements/schema-display.js +0 -313
  259. package/dist/components/ai-elements/shimmer.d.ts +0 -14
  260. package/dist/components/ai-elements/shimmer.js +0 -1
  261. package/dist/components/ai-elements/snippet.d.ts +0 -22
  262. package/dist/components/ai-elements/snippet.js +0 -90
  263. package/dist/components/ai-elements/sources.d.ts +0 -16
  264. package/dist/components/ai-elements/sources.js +0 -62
  265. package/dist/components/ai-elements/speech-input.d.ts +0 -57
  266. package/dist/components/ai-elements/speech-input.js +0 -206
  267. package/dist/components/ai-elements/stack-trace.d.ts +0 -42
  268. package/dist/components/ai-elements/stack-trace.js +0 -377
  269. package/dist/components/ai-elements/suggestion.d.ts +0 -14
  270. package/dist/components/ai-elements/suggestion.js +0 -41
  271. package/dist/components/ai-elements/task.d.ts +0 -18
  272. package/dist/components/ai-elements/task.js +0 -60
  273. package/dist/components/ai-elements/terminal.d.ts +0 -31
  274. package/dist/components/ai-elements/terminal.js +0 -203
  275. package/dist/components/ai-elements/test-results.d.ts +0 -61
  276. package/dist/components/ai-elements/test-results.js +0 -349
  277. package/dist/components/ai-elements/tool.d.ts +0 -35
  278. package/dist/components/ai-elements/tool.js +0 -2
  279. package/dist/components/ai-elements/toolbar.d.ts +0 -8
  280. package/dist/components/ai-elements/toolbar.js +0 -18
  281. package/dist/components/ai-elements/transcription.d.ts +0 -19
  282. package/dist/components/ai-elements/transcription.js +0 -90
  283. package/dist/components/ai-elements/voice-selector.d.ts +0 -66
  284. package/dist/components/ai-elements/voice-selector.js +0 -332
  285. package/dist/components/ai-elements/web-preview.d.ts +0 -38
  286. package/dist/components/ai-elements/web-preview.js +0 -214
  287. package/dist/components/responsive-alert-dialog.d.ts +0 -19
  288. package/dist/components/responsive-alert-dialog.js +0 -1
  289. package/dist/components/responsive-dialog.d.ts +0 -14
  290. package/dist/components/responsive-dialog.js +0 -1
  291. package/dist/config-IcWUmjwj.d.ts +0 -239
  292. package/dist/features/chat/chat-element/chat-element.d.ts +0 -8
  293. package/dist/features/chat/chat-element/chat-element.js +0 -14
  294. package/dist/features/chat/chat-element/use-chat.d.ts +0 -21
  295. package/dist/features/chat/chat-element/use-chat.js +0 -14
  296. package/dist/features/chat/chat-element/use-initial-messages.d.ts +0 -20
  297. package/dist/features/chat/chat-element/use-initial-messages.js +0 -14
  298. package/dist/features/chat/chat-message.d.ts +0 -10
  299. package/dist/features/chat/chat-message.js +0 -1
  300. package/dist/features/chat/chat-molecule.d.ts +0 -35
  301. package/dist/features/chat/chat-molecule.js +0 -14
  302. package/dist/features/molecule/chatsdk-provider.d.ts +0 -19
  303. package/dist/features/molecule/chatsdk-provider.js +0 -26
  304. package/dist/features/molecule/constants.d.ts +0 -3
  305. package/dist/features/molecule/constants.js +0 -1
  306. package/dist/features/molecule/molecule-provider.d.ts +0 -39
  307. package/dist/features/molecule/molecule-provider.js +0 -1
  308. package/dist/features/molecule/store.d.ts +0 -53
  309. package/dist/features/molecule/store.js +0 -3
  310. package/dist/features/molecule/types/api.d.ts +0 -8
  311. package/dist/features/molecule/types/api.js +0 -1
  312. package/dist/features/molecule/types/callbacks.d.ts +0 -22
  313. package/dist/features/molecule/types/callbacks.js +0 -1
  314. package/dist/features/molecule/types/config.d.ts +0 -10
  315. package/dist/features/molecule/types/config.js +0 -1
  316. package/dist/features/molecule/types/context.d.ts +0 -11
  317. package/dist/features/molecule/types/context.js +0 -1
  318. package/dist/features/molecule/types/locale.d.ts +0 -9
  319. package/dist/features/molecule/types/locale.js +0 -1
  320. package/dist/features/molecule/types/theme.d.ts +0 -38
  321. package/dist/features/molecule/types/theme.js +0 -1
  322. package/dist/features/molecule/types/translations.d.ts +0 -10
  323. package/dist/features/molecule/types/translations.js +0 -1
  324. package/dist/features/molecule/use-merge-global-config.d.ts +0 -22
  325. package/dist/features/molecule/use-merge-global-config.js +0 -5
  326. package/dist/features/molecule/use-molecule-config.d.ts +0 -41
  327. package/dist/features/molecule/use-molecule-config.js +0 -6
  328. package/dist/features/molecule/utils.d.ts +0 -10
  329. package/dist/features/molecule/utils.js +0 -1
@@ -1,11 +1,1383 @@
1
- declare module "i18next" {
2
- interface CustomTypeOptions {
3
- formality?: "formal" | "informal";
4
- }
5
- interface InitOptions {
6
- formality?: "formal" | "informal";
7
- }
8
- interface CustomInstanceExtensions {
9
- formality?: "formal" | "informal";
10
- }
1
+ //#region ../../node_modules/.pnpm/i18next@25.10.3_typescript@5.9.3/node_modules/i18next/typescript/helpers.d.ts
2
+ // Types
3
+ type $Dictionary<T = unknown> = {
4
+ [key: string]: T;
5
+ };
6
+ type $SpecialObject = object | Array<string | object>;
7
+ // Types Operators
8
+ type $Prune<T> = never | { [K in keyof T as [keyof T[K]] extends [never] ? never : K]: T[K] };
9
+ /** All the way down. */
10
+ interface $Turtles {
11
+ [x: string]: $Turtles;
11
12
  }
13
+ type $MergeBy<T, K> = Omit<T, keyof K> & K;
14
+ type $OmitArrayKeys<Arr> = Arr extends readonly any[] ? Omit<Arr, keyof any[]> : Arr;
15
+ type $PreservedValue<Value, Fallback> = [Value] extends [never] ? Fallback : Value;
16
+ type $NormalizeIntoArray<T extends unknown | readonly unknown[]> = T extends readonly unknown[] ? T : [T];
17
+ /**
18
+ * @typeParam T
19
+ * @example
20
+ * ```
21
+ * $UnionToIntersection<{foo: {bar: string} | {asd: boolean}}> = {foo: {bar: string} & {asd: boolean}}
22
+ * ```
23
+ *
24
+ * @see https://stackoverflow.com/questions/50374908/transform-union-type-to-intersection-type
25
+ */
26
+ type $UnionToIntersection<T> = (T extends unknown ? (k: T) => void : never) extends ((k: infer I) => void) ? I : never;
27
+ /**
28
+ * @typeParam TPath union of strings
29
+ * @typeParam TValue value of the record
30
+ * @example
31
+ * ```
32
+ * $StringKeyPathToRecord<'foo.bar' | 'asd'> = {foo: {bar: string} | {asd: boolean}}
33
+ * ```
34
+ */
35
+ type $StringKeyPathToRecordUnion<TPath extends string, TValue> = TPath extends `${infer TKey}.${infer Rest}` ? { [Key in TKey]: $StringKeyPathToRecord<Rest, TValue> } : { [Key in TPath]: TValue };
36
+ /**
37
+ * Used to intersect output of {@link $StringKeyPathToRecordUnion}
38
+ *
39
+ * @typeParam TPath union of strings
40
+ * @typeParam TValue value of the record
41
+ * @example
42
+ * ```
43
+ * $StringKeyPathToRecord<'foo.bar' | 'asd'> = {foo: {bar: string} & {asd: boolean}}
44
+ * ```
45
+ */
46
+ type $StringKeyPathToRecord<TPath extends string, TValue> = $UnionToIntersection<$StringKeyPathToRecordUnion<TPath, TValue>>;
47
+ /**
48
+ * We could use NoInfer typescript build-in utility,
49
+ * however this project still supports ts < 5.4.
50
+ *
51
+ * @see https://github.com/millsp/ts-toolbelt/blob/master/sources/Function/NoInfer.ts
52
+ */
53
+ type $NoInfer<A> = [A][A extends any ? 0 : never];
54
+ //#endregion
55
+ //#region ../../node_modules/.pnpm/i18next@25.10.3_typescript@5.9.3/node_modules/i18next/typescript/options.d.ts
56
+ /**
57
+ * This interface can be augmented by users to add types to `i18next` default TypeOptions.
58
+ *
59
+ * Usage:
60
+ * ```ts
61
+ * // i18next.d.ts
62
+ * import 'i18next';
63
+ * declare module 'i18next' {
64
+ * interface CustomTypeOptions {
65
+ * defaultNS: 'custom';
66
+ * returnNull: false;
67
+ * returnObjects: false;
68
+ * nsSeparator: ':';
69
+ * keySeparator: '.';
70
+ * compatibilityJSON: 'v4';
71
+ * allowObjectInHTMLChildren: false;
72
+ * resources: {
73
+ * custom: {
74
+ * foo: 'foo';
75
+ * };
76
+ * };
77
+ * }
78
+ * }
79
+ * ```
80
+ */
81
+ interface CustomTypeOptions {}
82
+ /**
83
+ * This interface can be augmented by users to add types to `i18next` default PluginOptions.
84
+ */
85
+ interface CustomPluginOptions {}
86
+ type TypeOptions = $MergeBy<{
87
+ /** @see {InitOptions.returnNull} */returnNull: false; /** @see {InitOptions.returnEmptyString} */
88
+ returnEmptyString: true; /** @see {InitOptions.returnObjects} */
89
+ returnObjects: false; /** @see {InitOptions.keySeparator} */
90
+ keySeparator: '.'; /** @see {InitOptions.nsSeparator} */
91
+ nsSeparator: ':'; /** @see {InitOptions.pluralSeparator} */
92
+ pluralSeparator: '_'; /** @see {InitOptions.contextSeparator} */
93
+ contextSeparator: '_'; /** @see {InitOptions.defaultNS} */
94
+ defaultNS: 'translation'; /** @see {InitOptions.fallbackNS} */
95
+ fallbackNS: false; /** @see {InitOptions.compatibilityJSON} */
96
+ compatibilityJSON: 'v4'; /** @see {InitOptions.resources} */
97
+ resources: object;
98
+ /**
99
+ * Flag that allows HTML elements to receive objects. This is only useful for React applications
100
+ * where you pass objects to HTML elements so they can be replaced to their respective interpolation
101
+ * values (mostly with Trans component)
102
+ */
103
+ allowObjectInHTMLChildren: false;
104
+ /**
105
+ * Flag that enables strict key checking even if a `defaultValue` has been provided.
106
+ * This ensures all calls of `t` function don't accidentally use implicitly missing keys.
107
+ */
108
+ strictKeyChecks: false;
109
+ /**
110
+ * Prefix for interpolation
111
+ */
112
+ interpolationPrefix: '{{';
113
+ /**
114
+ * Suffix for interpolation
115
+ */
116
+ interpolationSuffix: '}}'; /** @see {InterpolationOptions.unescapePrefix} */
117
+ unescapePrefix: '-'; /** @see {InterpolationOptions.unescapeSuffix} */
118
+ unescapeSuffix: '';
119
+ /**
120
+ * Use a proxy-based selector to select a translation.
121
+ *
122
+ * Enables features like go-to definition, and better DX/faster autocompletion
123
+ * for TypeScript developers.
124
+ *
125
+ * If you're working with an especially large set of translations and aren't
126
+ * using context, you set `enableSelector` to `"optimize"` and i18next won't do
127
+ * any type-level processing of your translations at all.
128
+ *
129
+ * With `enableSelector` set to `"optimize"`, i18next is capable of supporting
130
+ * arbitrarily large/deep translation sets without causing any IDE slowdown
131
+ * whatsoever.
132
+ *
133
+ * @default false
134
+ */
135
+ enableSelector: false;
136
+ /**
137
+ * Maps interpolation format specifiers to their expected value types.
138
+ *
139
+ * By default, i18next infers types from built-in formatter names:
140
+ * - `number`, `currency` → `number`
141
+ * - `datetime` → `Date`
142
+ * - `relativetime` → `number`
143
+ * - `list` → `readonly string[]`
144
+ * - No format specifier → `string`
145
+ *
146
+ * Use this option to add mappings for custom formatters or to override
147
+ * the built-in defaults.
148
+ *
149
+ * @default {} (empty — built-in defaults apply)
150
+ *
151
+ * @example
152
+ * ```ts
153
+ * interface CustomTypeOptions {
154
+ * interpolationFormatTypeMap: {
155
+ * // custom formatter
156
+ * uppercase: string;
157
+ * // override built-in
158
+ * currency: string;
159
+ * };
160
+ * }
161
+ * ```
162
+ */
163
+ interpolationFormatTypeMap: {};
164
+ }, CustomTypeOptions>;
165
+ type PluginOptions<T> = $MergeBy<{
166
+ /**
167
+ * Options for language detection - check documentation of plugin
168
+ * @default undefined
169
+ */
170
+ detection?: object;
171
+ /**
172
+ * Options for backend - check documentation of plugin
173
+ * @default undefined
174
+ */
175
+ backend?: T;
176
+ /**
177
+ * Options for cache layer - check documentation of plugin
178
+ * @default undefined
179
+ */
180
+ cache?: object;
181
+ /**
182
+ * Options for i18n message format - check documentation of plugin
183
+ * @default undefined
184
+ */
185
+ i18nFormat?: object;
186
+ }, CustomPluginOptions>;
187
+ type FormatFunction = (value: any, format?: string, lng?: string, options?: InterpolationOptions & $Dictionary<any>) => string;
188
+ interface InterpolationOptions {
189
+ /**
190
+ * Format function see formatting for details
191
+ * @default noop
192
+ */
193
+ format?: FormatFunction;
194
+ /**
195
+ * Used to separate format from interpolation value
196
+ * @default ','
197
+ */
198
+ formatSeparator?: string;
199
+ /**
200
+ * Escape function
201
+ * @default str => str
202
+ */
203
+ escape?(str: string): string;
204
+ /**
205
+ * Always format interpolated values.
206
+ * @default false
207
+ */
208
+ alwaysFormat?: boolean;
209
+ /**
210
+ * Escape passed in values to avoid xss injection
211
+ * @default true
212
+ */
213
+ escapeValue?: boolean;
214
+ /**
215
+ * If true, then value passed into escape function is not casted to string, use with custom escape function that does its own type check
216
+ * @default false
217
+ */
218
+ useRawValueToEscape?: boolean;
219
+ /**
220
+ * Prefix for interpolation
221
+ * @default '{{'
222
+ */
223
+ prefix?: string;
224
+ /**
225
+ * Suffix for interpolation
226
+ * @default '}}'
227
+ */
228
+ suffix?: string;
229
+ /**
230
+ * Escaped prefix for interpolation (regexSafe)
231
+ * @default undefined
232
+ */
233
+ prefixEscaped?: string;
234
+ /**
235
+ * Escaped suffix for interpolation (regexSafe)
236
+ * @default undefined
237
+ */
238
+ suffixEscaped?: string;
239
+ /**
240
+ * Suffix to unescaped mode
241
+ * @default undefined
242
+ */
243
+ unescapeSuffix?: string;
244
+ /**
245
+ * Prefix to unescaped mode
246
+ * @default '-'
247
+ */
248
+ unescapePrefix?: string;
249
+ /**
250
+ * Prefix for nesting
251
+ * @default '$t('
252
+ */
253
+ nestingPrefix?: string;
254
+ /**
255
+ * Suffix for nesting
256
+ * @default ')'
257
+ */
258
+ nestingSuffix?: string;
259
+ /**
260
+ * Escaped prefix for nesting (regexSafe)
261
+ * @default undefined
262
+ */
263
+ nestingPrefixEscaped?: string;
264
+ /**
265
+ * Escaped suffix for nesting (regexSafe)
266
+ * @default undefined
267
+ */
268
+ nestingSuffixEscaped?: string;
269
+ /**
270
+ * Separates options from key
271
+ * @default ','
272
+ */
273
+ nestingOptionsSeparator?: string;
274
+ /**
275
+ * Global variables to use in interpolation replacements
276
+ * @default undefined
277
+ */
278
+ defaultVariables?: {
279
+ [index: string]: any;
280
+ };
281
+ /**
282
+ * After how many interpolation runs to break out before throwing a stack overflow
283
+ * @default 1000
284
+ */
285
+ maxReplaces?: number;
286
+ /**
287
+ * If true, it will skip to interpolate the variables
288
+ * @default true
289
+ */
290
+ skipOnVariables?: boolean;
291
+ }
292
+ interface FallbackLngObjList {
293
+ [language: string]: readonly string[];
294
+ }
295
+ type FallbackLng = string | readonly string[] | FallbackLngObjList | ((code: string) => string | readonly string[] | FallbackLngObjList);
296
+ interface ReactOptions {
297
+ /**
298
+ * Set it to fallback to let passed namespaces to translated hoc act as fallbacks
299
+ * @default 'default'
300
+ */
301
+ nsMode?: 'default' | 'fallback';
302
+ /**
303
+ * Set it to the default parent element created by the Trans component.
304
+ * @default 'div'
305
+ */
306
+ defaultTransParent?: string;
307
+ /**
308
+ * Set which events trigger a re-render, can be set to false or string of events
309
+ * @default 'languageChanged'
310
+ */
311
+ bindI18n?: string | false;
312
+ /**
313
+ * Set which events on store trigger a re-render, can be set to false or string of events
314
+ * @default ''
315
+ */
316
+ bindI18nStore?: string | false;
317
+ /**
318
+ * Set fallback value for Trans components without children
319
+ * @default undefined
320
+ */
321
+ transEmptyNodeValue?: string;
322
+ /**
323
+ * Set it to false if you do not want to use Suspense
324
+ * @default true
325
+ */
326
+ useSuspense?: boolean;
327
+ /**
328
+ * Function to generate an i18nKey from the defaultValue (or Trans children)
329
+ * when no key is provided.
330
+ * By default, the defaultValue (Trans text) itself is used as the key.
331
+ * If you want to require keys for all translations, supply a function
332
+ * that always throws an error.
333
+ * @default undefined
334
+ */
335
+ hashTransKey?(defaultValue: TOptionsBase['defaultValue']): TOptionsBase['defaultValue'];
336
+ /**
337
+ * Convert eg. <br/> found in translations to a react component of type br
338
+ * @default true
339
+ */
340
+ transSupportBasicHtmlNodes?: boolean;
341
+ /**
342
+ * Which nodes not to convert in defaultValue generation in the Trans component.
343
+ * @default ['br', 'strong', 'i', 'p']
344
+ */
345
+ transKeepBasicHtmlNodesFor?: readonly string[];
346
+ /**
347
+ * Wrap text nodes in a user-specified element.
348
+ * @default ''
349
+ */
350
+ transWrapTextNodes?: string;
351
+ /**
352
+ * Default props to apply to all Trans components.
353
+ * Component-level props will override these defaults.
354
+ */
355
+ transDefaultProps?: {
356
+ tOptions?: TOptions;
357
+ values?: object;
358
+ shouldUnescape?: boolean;
359
+ components?: readonly unknown[] | {
360
+ readonly [tagName: string]: unknown;
361
+ }; // Use `unknown` (or `any`) to be permissive without importing React.
362
+ };
363
+ /**
364
+ * Optional keyPrefix that will be automatically applied to returned t function in useTranslation for example.
365
+ * Accepts a string or a selector function (e.g. `$ => $.deeply.nested`).
366
+ * @default undefined
367
+ */
368
+ keyPrefix?: string | (($: any) => any);
369
+ /**
370
+ * Unescape function
371
+ * by default it unescapes some basic html entities
372
+ */
373
+ unescape?(str: string): string;
374
+ }
375
+ type ResourceKey = string | {
376
+ [key: string]: any;
377
+ };
378
+ interface ResourceLanguage {
379
+ [namespace: string]: ResourceKey;
380
+ }
381
+ interface Resource {
382
+ [language: string]: ResourceLanguage;
383
+ }
384
+ interface InitOptions<T = object> extends PluginOptions<T> {
385
+ /**
386
+ * Logs info level to console output. Helps finding issues with loading not working.
387
+ * @default false
388
+ */
389
+ debug?: boolean;
390
+ /**
391
+ * Show support notice in console during initialization.
392
+ * @default true
393
+ */
394
+ showSupportNotice?: boolean;
395
+ /**
396
+ * Resources to initialize with (if not using loading or not appending using addResourceBundle)
397
+ * @default undefined
398
+ */
399
+ resources?: Resource;
400
+ /**
401
+ * Allow initializing with bundled resources while using a backend to load non bundled ones.
402
+ * @default false
403
+ */
404
+ partialBundledLanguages?: boolean;
405
+ /**
406
+ * Language to use (overrides language detection)
407
+ * @default undefined
408
+ */
409
+ lng?: string;
410
+ /**
411
+ * Language to use if translations in user language are not available.
412
+ * @default 'dev'
413
+ */
414
+ fallbackLng?: false | FallbackLng;
415
+ /**
416
+ * Array of allowed languages
417
+ * @default false
418
+ */
419
+ supportedLngs?: false | readonly string[];
420
+ /**
421
+ * If true will pass eg. en-US if finding en in supportedLngs
422
+ * @default false
423
+ */
424
+ nonExplicitSupportedLngs?: boolean;
425
+ /**
426
+ * Language codes to lookup, given set language is 'en-US':
427
+ * 'all' --> ['en-US', 'en', 'dev'],
428
+ * 'currentOnly' --> 'en-US',
429
+ * 'languageOnly' --> 'en'
430
+ * @default 'all'
431
+ */
432
+ load?: 'all' | 'currentOnly' | 'languageOnly';
433
+ /**
434
+ * Array of languages to preload. Important on server-side to assert translations are loaded before rendering views.
435
+ * @default false
436
+ */
437
+ preload?: false | readonly string[];
438
+ /**
439
+ * Language will be lowercased eg. en-US --> en-us
440
+ * @default false
441
+ */
442
+ lowerCaseLng?: boolean;
443
+ /**
444
+ * Language will be lowercased EN --> en while leaving full locales like en-US
445
+ * @default false
446
+ */
447
+ cleanCode?: boolean;
448
+ /**
449
+ * String or array of namespaces to load
450
+ * @default 'translation'
451
+ */
452
+ ns?: string | readonly string[];
453
+ /**
454
+ * Default namespace used if not passed to translation function
455
+ * @default 'translation'
456
+ */
457
+ defaultNS?: string | false | readonly string[];
458
+ /**
459
+ * String or array of namespaces to lookup key if not found in given namespace.
460
+ * @default false
461
+ */
462
+ fallbackNS?: false | string | readonly string[];
463
+ /**
464
+ * Calls save missing key function on backend if key not found.
465
+ * @default false
466
+ */
467
+ saveMissing?: boolean;
468
+ /**
469
+ * Calls save missing key function on backend if key not found also for plural forms.
470
+ * @default false
471
+ */
472
+ saveMissingPlurals?: boolean;
473
+ /**
474
+ * Experimental: enable to update default values using the saveMissing
475
+ * (Works only if defaultValue different from translated value.
476
+ * Only useful on initial development or when keeping code as source of truth not changing values outside of code.
477
+ * Only supported if backend supports it already)
478
+ * @default false
479
+ */
480
+ updateMissing?: boolean;
481
+ /**
482
+ * @default 'fallback'
483
+ */
484
+ saveMissingTo?: 'current' | 'all' | 'fallback';
485
+ /**
486
+ * Used to not fallback to the key as default value, when using saveMissing functionality.
487
+ * i.e. when using with i18next-http-backend this will result in having a key with an empty string value.
488
+ * @default false
489
+ */
490
+ missingKeyNoValueFallbackToKey?: boolean;
491
+ /**
492
+ * Used for custom missing key handling (needs saveMissing set to true!)
493
+ * @default false
494
+ */
495
+ missingKeyHandler?: false | ((lngs: readonly string[], ns: string, key: string, fallbackValue: string, updateMissing: boolean, options: any) => void);
496
+ /**
497
+ * Receives a key that was not found in `t()` and returns a value, that will be returned by `t()`
498
+ * @default noop
499
+ */
500
+ parseMissingKeyHandler?(key: string, defaultValue?: string, options?: any): any;
501
+ /**
502
+ * Appends namespace to missing key
503
+ * @default false
504
+ */
505
+ appendNamespaceToMissingKey?: boolean;
506
+ /**
507
+ * Gets called in case a interpolation value is undefined. This method will not be called if the value is empty string or null
508
+ * @default noop
509
+ */
510
+ missingInterpolationHandler?: (text: string, value: any, options: InitOptions) => any;
511
+ /**
512
+ * Will use 'plural' as suffix for languages only having 1 plural form, setting it to false will suffix all with numbers
513
+ * @default true
514
+ */
515
+ simplifyPluralSuffix?: boolean;
516
+ /**
517
+ * String or array of postProcessors to apply per default
518
+ * @default false
519
+ */
520
+ postProcess?: false | string | readonly string[];
521
+ /**
522
+ * passthrough the resolved object including 'usedNS', 'usedLang' etc into options object of postprocessors as 'i18nResolved' property
523
+ * @default false
524
+ */
525
+ postProcessPassResolved?: boolean;
526
+ /**
527
+ * Allows null values as valid translation
528
+ * @default false
529
+ */
530
+ returnNull?: boolean;
531
+ /**
532
+ * Allows empty string as valid translation
533
+ * @default true
534
+ */
535
+ returnEmptyString?: boolean;
536
+ /**
537
+ * Allows objects as valid translation result
538
+ * @default false
539
+ */
540
+ returnObjects?: boolean;
541
+ /**
542
+ * Returns an object that includes information about the used language, namespace, key and value
543
+ * @default false
544
+ */
545
+ returnDetails?: boolean;
546
+ /**
547
+ * Gets called if object was passed in as key but returnObjects was set to false
548
+ * @default noop
549
+ */
550
+ returnedObjectHandler?(key: string, value: string, options: any): void;
551
+ /**
552
+ * Char, eg. '\n' that arrays will be joined by
553
+ * @default false
554
+ */
555
+ joinArrays?: false | string;
556
+ /**
557
+ * Sets defaultValue
558
+ * @default args => ({ defaultValue: args[1] })
559
+ */
560
+ overloadTranslationOptionHandler?(args: string[]): TOptions;
561
+ /**
562
+ * @see https://www.i18next.com/translation-function/interpolation
563
+ */
564
+ interpolation?: InterpolationOptions;
565
+ /**
566
+ * Options for react - check documentation of plugin
567
+ * @default undefined
568
+ */
569
+ react?: ReactOptions;
570
+ /**
571
+ * Triggers resource loading in init function inside a setTimeout (default async behaviour).
572
+ * Set it to false if your backend loads resources sync - that way calling i18next.t after
573
+ * init is possible without relaying on the init callback.
574
+ * @default true
575
+ */
576
+ initAsync?: boolean;
577
+ /**
578
+ * @deprecated Use initAsync instead.
579
+ */
580
+ initImmediate?: boolean;
581
+ /**
582
+ * Char to separate keys
583
+ * @default '.'
584
+ */
585
+ keySeparator?: false | string;
586
+ /**
587
+ * Char to split namespace from key
588
+ * @default ':'
589
+ */
590
+ nsSeparator?: false | string;
591
+ /**
592
+ * Char to split plural from key
593
+ * @default '_'
594
+ */
595
+ pluralSeparator?: string;
596
+ /**
597
+ * Char to split context from key
598
+ * @default '_'
599
+ */
600
+ contextSeparator?: string;
601
+ /**
602
+ * Prefixes the namespace to the returned key when using `cimode`
603
+ * @default false
604
+ */
605
+ appendNamespaceToCIMode?: boolean;
606
+ /**
607
+ * Compatibility JSON version
608
+ * @warning only `v4` is available and supported by typescript
609
+ * @default 'v4'
610
+ */
611
+ compatibilityJSON?: 'v4';
612
+ /**
613
+ * Options for https://github.com/locize/locize-lastused
614
+ * @default undefined
615
+ */
616
+ locizeLastUsed?: {
617
+ /**
618
+ * The id of your locize project
619
+ */
620
+ projectId: string;
621
+ /**
622
+ * An api key if you want to send missing keys
623
+ */
624
+ apiKey?: string;
625
+ /**
626
+ * The reference language of your project
627
+ * @default 'en'
628
+ */
629
+ referenceLng?: string;
630
+ /**
631
+ * Version
632
+ * @default 'latest'
633
+ */
634
+ version?: string;
635
+ /**
636
+ * Debounce interval to send data in milliseconds
637
+ * @default 90000
638
+ */
639
+ debounceSubmit?: number;
640
+ /**
641
+ * Hostnames that are allowed to send last used data.
642
+ * Please keep those to your local system, staging, test servers (not production)
643
+ * @default ['localhost']
644
+ */
645
+ allowedHosts?: readonly string[];
646
+ };
647
+ /**
648
+ * Automatically lookup for a flat key if a nested key is not found an vice-versa
649
+ * @default true
650
+ */
651
+ ignoreJSONStructure?: boolean;
652
+ /**
653
+ * Limit parallelism of calls to backend
654
+ * This is needed to prevent trying to open thousands of
655
+ * sockets or file descriptors, which can cause failures
656
+ * and actually make the entire process take longer.
657
+ * @default 10
658
+ */
659
+ maxParallelReads?: number;
660
+ /**
661
+ * The maximum number of retries to perform.
662
+ * Note that retries are only performed when a request has no response
663
+ * and throws an error.
664
+ * The default value is used if value is set below 0.
665
+ * @default 5
666
+ */
667
+ maxRetries?: number;
668
+ /**
669
+ * Set how long to wait, in milliseconds, between retries of failed requests.
670
+ * This number is compounded by a factor of 2 for subsequent retry.
671
+ * The default value is used if value is set below 1ms.
672
+ * @default 350
673
+ */
674
+ retryTimeout?: number;
675
+ /**
676
+ * Initializes the internal formatter for the in-built formats as cached version.
677
+ * Can be set to false for this type of issues: https://github.com/i18next/i18next/issues/2227
678
+ * @default true
679
+ */
680
+ cacheInBuiltFormats?: boolean;
681
+ }
682
+ interface TOptionsBase {
683
+ /**
684
+ * Default value to return if a translation was not found
685
+ */
686
+ defaultValue?: unknown;
687
+ /**
688
+ * Count value used for plurals
689
+ */
690
+ count?: number;
691
+ /**
692
+ * Ordinal flag for ordinal plurals
693
+ */
694
+ ordinal?: boolean;
695
+ /**
696
+ * Used for contexts (eg. male\female)
697
+ */
698
+ context?: unknown;
699
+ /**
700
+ * Object with vars for interpolation - or put them directly in options
701
+ */
702
+ replace?: any;
703
+ /**
704
+ * Override language to use
705
+ */
706
+ lng?: string;
707
+ /**
708
+ * Override languages to use
709
+ */
710
+ lngs?: readonly string[];
711
+ /**
712
+ * Override language to lookup key if not found see fallbacks for details
713
+ */
714
+ fallbackLng?: false | FallbackLng;
715
+ /**
716
+ * Override namespaces (string or array)
717
+ */
718
+ ns?: Namespace;
719
+ /**
720
+ * Override char to separate keys
721
+ */
722
+ keySeparator?: false | string;
723
+ /**
724
+ * Override char to split namespace from key
725
+ */
726
+ nsSeparator?: false | string;
727
+ /**
728
+ * Accessing an object not a translation string (can be set globally too)
729
+ */
730
+ returnObjects?: boolean;
731
+ /**
732
+ * Returns an object that includes information about the used language, namespace, key and value
733
+ */
734
+ returnDetails?: boolean;
735
+ /**
736
+ * Char, eg. '\n' that arrays will be joined by (can be set globally too)
737
+ */
738
+ joinArrays?: string;
739
+ /**
740
+ * String or array of postProcessors to apply see interval plurals as a sample
741
+ */
742
+ postProcess?: string | readonly string[];
743
+ /**
744
+ * Override interpolation options
745
+ */
746
+ interpolation?: InterpolationOptions;
747
+ /**
748
+ * Optional keyPrefix that will be applied to the key before resolving.
749
+ * Accepts a string or a selector function (e.g. `$ => $.deeply.nested`).
750
+ * Only supported on the TFunction returned by getFixedT().
751
+ */
752
+ keyPrefix?: string | (($: any) => any);
753
+ }
754
+ type TOptions<TInterpolationMap extends object = $Dictionary> = TOptionsBase & TInterpolationMap;
755
+ type FlatNamespace = $PreservedValue<keyof TypeOptions['resources'], string>;
756
+ type Namespace<T = FlatNamespace> = T | readonly T[];
757
+ type DefaultNamespace = TypeOptions['defaultNS'];
758
+ //#endregion
759
+ //#region ../../node_modules/.pnpm/i18next@25.10.3_typescript@5.9.3/node_modules/i18next/typescript/t.d.ts
760
+ /** @todo consider to replace {} with Record<string, never> */
761
+ // Type Options
762
+ type _ReturnObjects = TypeOptions['returnObjects'];
763
+ type _ReturnEmptyString = TypeOptions['returnEmptyString'];
764
+ type _ReturnNull = TypeOptions['returnNull'];
765
+ type _KeySeparator = TypeOptions['keySeparator'];
766
+ type _NsSeparator = TypeOptions['nsSeparator'];
767
+ type _PluralSeparator = TypeOptions['pluralSeparator'];
768
+ type _ContextSeparator = TypeOptions['contextSeparator'];
769
+ type _FallbackNamespace = TypeOptions['fallbackNS'];
770
+ type _Resources = TypeOptions['resources'];
771
+ type _CompatibilityJSON = TypeOptions['compatibilityJSON'];
772
+ type _InterpolationPrefix = TypeOptions['interpolationPrefix'];
773
+ type _InterpolationSuffix = TypeOptions['interpolationSuffix'];
774
+ type _UnescapePrefix = TypeOptions['unescapePrefix'];
775
+ type _UnescapeSuffix = TypeOptions['unescapeSuffix'];
776
+ type _StrictKeyChecks = TypeOptions['strictKeyChecks'];
777
+ type _EnableSelector = TypeOptions['enableSelector'];
778
+ type _InterpolationFormatTypeMap = TypeOptions['interpolationFormatTypeMap'];
779
+ type $IsResourcesDefined = [keyof _Resources] extends [never] ? false : true;
780
+ type $ValueIfResourcesDefined<Value, Fallback> = $IsResourcesDefined extends true ? Value : Fallback;
781
+ type $FirstNamespace<Ns extends Namespace> = Ns extends readonly any[] ? Ns[0] : Ns;
782
+ type Resources = $ValueIfResourcesDefined<_Resources, $Dictionary<string>>;
783
+ type PluralSuffix = 'zero' | 'one' | 'two' | 'few' | 'many' | 'other';
784
+ type WithOrWithoutPlural<Key> = _CompatibilityJSON extends 'v4' ? Key extends `${infer KeyWithoutOrdinalPlural}${_PluralSeparator}ordinal${_PluralSeparator}${PluralSuffix}` ? KeyWithoutOrdinalPlural | Key : Key extends `${infer KeyWithoutPlural}${_PluralSeparator}${PluralSuffix}` ? KeyWithoutPlural | Key : Key : Key;
785
+ type JoinKeys<K1, K2> = `${K1 & string}${_KeySeparator}${K2 & string}`;
786
+ type AppendNamespace<Ns, Keys> = `${Ns & string}${_NsSeparator}${Keys & string}`;
787
+ type TrimSpaces<T extends string, Acc extends string = ''> = T extends `${infer Char}${infer Rest}` ? Char extends ' ' ? TrimSpaces<Rest, Acc> : TrimSpaces<Rest, `${Acc}${Char}`> : T extends '' ? Acc : never;
788
+ interface Branded<Ns extends Namespace> {
789
+ $TFunctionBrand: $IsResourcesDefined extends true ? `${Ns extends readonly any[] ? Ns[0] : Ns}` : never;
790
+ }
791
+ /** ****************************************************
792
+ * Build all keys and key prefixes based on Resources *
793
+ ***************************************************** */
794
+ type KeysBuilderWithReturnObjects<Res, Key = keyof Res> = Key extends keyof Res ? Res[Key] extends $Dictionary | readonly unknown[] ? JoinKeys<Key, WithOrWithoutPlural<keyof $OmitArrayKeys<Res[Key]>>> | JoinKeys<Key, KeysBuilderWithReturnObjects<Res[Key]>> : never : never;
795
+ type KeysBuilderWithoutReturnObjects<Res, Key = keyof $OmitArrayKeys<Res>> = Key extends keyof Res ? Res[Key] extends $Dictionary | readonly unknown[] ? JoinKeys<Key, KeysBuilderWithoutReturnObjects<Res[Key]>> : Key : never;
796
+ type KeysBuilder<Res, WithReturnObjects> = $IsResourcesDefined extends true ? WithReturnObjects extends true ? keyof Res | KeysBuilderWithReturnObjects<Res> : KeysBuilderWithoutReturnObjects<Res> : string;
797
+ type KeysWithReturnObjects = { [Ns in FlatNamespace]: WithOrWithoutPlural<KeysBuilder<Resources[Ns], true>> };
798
+ type KeysWithoutReturnObjects = { [Ns in FlatNamespace]: WithOrWithoutPlural<KeysBuilder<Resources[Ns], false>> };
799
+ type ResourceKeys<WithReturnObjects = _ReturnObjects> = WithReturnObjects extends true ? KeysWithReturnObjects : KeysWithoutReturnObjects;
800
+ /** **********************************************************************
801
+ * Parse t function keys based on the namespace, options and key prefix *
802
+ *********************************************************************** */
803
+ type KeysByTOptions<TOpt extends TOptions> = TOpt['returnObjects'] extends true ? ResourceKeys<true> : ResourceKeys;
804
+ type NsByTOptions<Ns extends Namespace, TOpt extends TOptions> = TOpt['ns'] extends Namespace ? TOpt['ns'] : Ns;
805
+ type ParseKeysByKeyPrefix<Keys, KPrefix> = KPrefix extends string ? Keys extends `${KPrefix}${_KeySeparator}${infer Key}` ? Key : never : Keys;
806
+ type ParseKeysByNamespaces<Ns extends Namespace, Keys> = Ns extends readonly (infer UnionNsps)[] ? UnionNsps extends keyof Keys ? AppendNamespace<UnionNsps, Keys[UnionNsps]> : never : never;
807
+ type ParseKeysByFallbackNs<Keys extends $Dictionary> = _FallbackNamespace extends false ? never : _FallbackNamespace extends (infer UnionFallbackNs extends string)[] ? Keys[UnionFallbackNs] : Keys[_FallbackNamespace & string];
808
+ type FilterKeysByContext<Keys, Context> = Context extends string ? Keys extends `${infer Prefix}${_ContextSeparator}${Context}${_PluralSeparator}${PluralSuffix}` | `${infer Prefix}${_ContextSeparator}${Context}` ? Prefix : never : Keys;
809
+ type ParseKeys<Ns extends Namespace = DefaultNamespace, TOpt extends TOptions = {}, KPrefix = undefined, Keys extends $Dictionary = KeysByTOptions<TOpt>, ActualNS extends Namespace = NsByTOptions<Ns, TOpt>, Context extends TOpt['context'] = TOpt['context']> = $IsResourcesDefined extends true ? FilterKeysByContext<ParseKeysByKeyPrefix<Keys[$FirstNamespace<ActualNS>], KPrefix> | ParseKeysByNamespaces<ActualNS, Keys> | ParseKeysByFallbackNs<Keys>, Context> : string;
810
+ /** *******************************************************
811
+ * Parse t function return type and interpolation values *
812
+ ******************************************************** */
813
+ type ParseActualValue<Ret> = Ret extends `${_UnescapePrefix}${infer ActualValue}${_UnescapeSuffix}` ? TrimSpaces<ActualValue> : Ret;
814
+ /** Parses interpolation entries as `[variableName, formatSpecifier | never]` tuples. */
815
+ type ParseInterpolationEntries<Ret> = Ret extends `${string}${_InterpolationPrefix}${infer Value}${_InterpolationSuffix}${infer Rest}` ? (Value extends `${infer ActualValue},${infer Format}` ? [ParseActualValue<ActualValue>, TrimSpaces<Format>] : [ParseActualValue<Value>, never]) | ParseInterpolationEntries<Rest> : never;
816
+ /** Extracts just the variable names (kept for backward compat with ParseInterpolationValues usage). */
817
+ /** Built-in i18next formatter name → value type mapping. */
818
+ type _BuiltInFormatTypeMap = {
819
+ number: number;
820
+ currency: number;
821
+ datetime: Date;
822
+ relativetime: number;
823
+ list: readonly string[];
824
+ };
825
+ /** Resolves the type for a single interpolation entry based on name and format. */
826
+ type _ResolveEntryType<Name extends string, Format> = [Format] extends [never] ? Name extends 'count' ? number : string : Format extends keyof _InterpolationFormatTypeMap ? _InterpolationFormatTypeMap[Format] : Format extends keyof _BuiltInFormatTypeMap ? _BuiltInFormatTypeMap[Format] : string;
827
+ /** Local union-to-intersection (not exported from helpers). */
828
+ type _UnionToIntersection<T> = (T extends unknown ? (k: T) => void : never) extends ((k: infer I) => void) ? I : never;
829
+ /** Builds a per-entry typed record from parsed interpolation entries and intersects them. */
830
+ type _InterpolationMapFromEntries<E> = _UnionToIntersection<E extends [infer Name extends string, infer Format] ? $StringKeyPathToRecord<Name, _ResolveEntryType<Name, Format>> : never>;
831
+ type InterpolationMap<Ret> = $PreservedValue<_InterpolationMapFromEntries<ParseInterpolationEntries<Ret>>, Record<string, unknown>>;
832
+ type ParseTReturnPlural<Res, Key, KeyWithPlural = `${Key & string}${_PluralSeparator}${PluralSuffix}`> = Res[(KeyWithPlural | Key) & keyof Res];
833
+ type ParseTReturnPluralOrdinal<Res, Key, KeyWithOrdinalPlural = `${Key & string}${_PluralSeparator}ordinal${_PluralSeparator}${PluralSuffix}`> = Res[(KeyWithOrdinalPlural | Key) & keyof Res];
834
+ type ParseTReturnWithFallback<Key, Val> = Val extends '' ? _ReturnEmptyString extends true ? '' : Key : Val extends null ? _ReturnNull extends true ? null : Key : Val;
835
+ type ParseTReturn<Key, Res, TOpt extends TOptions = {}> = ParseTReturnWithFallback<Key, Key extends `${infer K1}${_KeySeparator}${infer RestKey}` ? ParseTReturn<RestKey, Res[K1 & keyof Res], TOpt> : // Process plurals only if count is provided inside options
836
+ TOpt['count'] extends number ? TOpt['ordinal'] extends boolean ? ParseTReturnPluralOrdinal<Res, Key> : ParseTReturnPlural<Res, Key> : // otherwise access plain key without adding plural and ordinal suffixes
837
+ Res extends readonly unknown[] ? Key extends `${infer NKey extends number}` ? Res[NKey] : never : Res[Key & keyof Res]>;
838
+ type TReturnOptionalNull = _ReturnNull extends true ? null : never;
839
+ type TReturnOptionalObjects<TOpt extends {
840
+ returnObjects?: unknown;
841
+ }> = _ReturnObjects extends true ? $SpecialObject | string : TOpt['returnObjects'] extends true ? $SpecialObject : string;
842
+ type DefaultTReturn<TOpt extends {
843
+ returnObjects?: unknown;
844
+ }> = TReturnOptionalObjects<TOpt> | TReturnOptionalNull;
845
+ type KeyWithContext<Key, TOpt extends TOptions> = TOpt['context'] extends string ? `${Key & string}${_ContextSeparator}${TOpt['context']}` : Key;
846
+ type ContextOfKey<Key extends string, Ns extends Namespace = DefaultNamespace, TOpt extends TOptions = {}, KPrefix = undefined, Keys extends $Dictionary = KeysByTOptions<TOpt>, ActualNS extends Namespace = NsByTOptions<Ns, TOpt>, ActualKeys = ParseKeysByKeyPrefix<Keys[$FirstNamespace<ActualNS>], KPrefix> | ParseKeysByNamespaces<ActualNS, Keys> | ParseKeysByFallbackNs<Keys>> = $IsResourcesDefined extends true ? Key extends ActualKeys ? string : ActualKeys extends `${Key}${_ContextSeparator}${infer Context}${_PluralSeparator}${PluralSuffix}` | `${Key}${_ContextSeparator}${infer Context}` ? Context : never : string;
847
+ // helper that maps the configured fallbackNS value to the matching resources slice
848
+ type FallbackResourcesOf<FallbackNS, R> = FallbackNS extends readonly (infer FN)[] ? R[FN & keyof R] : [FallbackNS] extends [false] ? never : R[Extract<FallbackNS, keyof R> & keyof R];
849
+ /* reuse the parse helpers as top-level aliases (no nested type declarations) */
850
+ type _PrimaryParse<ActualKey, PrimaryNS extends keyof Resources, TOpt extends TOptions> = ParseTReturn<ActualKey, Resources[PrimaryNS], TOpt>;
851
+ type _FallbackParse<ActualKey, FallbackNS, TOpt extends TOptions> = [FallbackResourcesOf<FallbackNS, Resources>] extends [never] ? never : ParseTReturn<ActualKey, FallbackResourcesOf<FallbackNS, Resources>, TOpt>;
852
+ type TFunctionReturn<Ns extends Namespace, Key, TOpt extends TOptions, ActualNS extends Namespace = NsByTOptions<Ns, TOpt>, ActualKey = KeyWithContext<Key, TOpt>> = $IsResourcesDefined extends true ? ActualKey extends `${infer Nsp}${_NsSeparator}${infer RestKey}` ? ParseTReturn<RestKey, Resources[Nsp & keyof Resources], TOpt> : $FirstNamespace<ActualNS> extends infer PrimaryNS ? [PrimaryNS] extends [keyof Resources] ? [_PrimaryParse<ActualKey, PrimaryNS & keyof Resources, TOpt>] extends [never] ? [_FallbackParse<ActualKey, _FallbackNamespace, TOpt>] extends [never] ? DefaultTReturn<TOpt> : _FallbackParse<ActualKey, _FallbackNamespace, TOpt> : _PrimaryParse<ActualKey, PrimaryNS & keyof Resources, TOpt> : never : never : DefaultTReturn<TOpt>;
853
+ type TFunctionDetailedResult<T = string, TOpt extends TOptions = {}> = {
854
+ /**
855
+ * The plain used key
856
+ */
857
+ usedKey: string;
858
+ /**
859
+ * The translation result.
860
+ */
861
+ res: T;
862
+ /**
863
+ * The key with context / plural
864
+ */
865
+ exactUsedKey: string;
866
+ /**
867
+ * The used language for this translation.
868
+ */
869
+ usedLng: string;
870
+ /**
871
+ * The used namespace for this translation.
872
+ */
873
+ usedNS: string;
874
+ /**
875
+ * The parameters used for interpolation.
876
+ */
877
+ usedParams: InterpolationMap<T> & {
878
+ count?: TOpt['count'];
879
+ };
880
+ };
881
+ type TFunctionProcessReturnValue<Ret, DefaultValue> = Ret extends string | $SpecialObject | null ? Ret : [DefaultValue] extends [never] ? Ret : DefaultValue;
882
+ type TFunctionReturnOptionalDetails<Ret, TOpt extends TOptions> = TOpt['returnDetails'] extends true ? TFunctionDetailedResult<Ret, TOpt> : Ret;
883
+ type AppendKeyPrefix<Key, KPrefix> = KPrefix extends string ? `${KPrefix}${_KeySeparator}${Key & string}` : Key;
884
+ /**
885
+ * Resolves the effective key prefix by preferring a per-call `keyPrefix` from
886
+ * options over the interface-level `KPrefix` (set via getFixedT's 3rd argument).
887
+ */
888
+ type EffectiveKPrefix<KPrefix, TOpt> = TOpt extends {
889
+ keyPrefix: infer OptKP extends string;
890
+ } ? OptKP : KPrefix;
891
+ /** ************************
892
+ * T function declaration *
893
+ ************************* */
894
+ interface TFunctionStrict<Ns extends Namespace = DefaultNamespace, KPrefix = undefined> extends Branded<Ns> {
895
+ <const Key extends ParseKeys<Ns, TOpt, EffectiveKPrefix<KPrefix, TOpt>> | TemplateStringsArray, const TOpt extends TOptions, Ret extends TFunctionReturn<Ns, AppendKeyPrefix<Key, EffectiveKPrefix<KPrefix, TOpt>>, TOpt>>(key: Key | Key[], options?: TOpt & InterpolationMap<Ret> & {
896
+ context?: Key extends string ? ContextOfKey<Key, Ns, TOpt, EffectiveKPrefix<KPrefix, TOpt>> : never;
897
+ }): TFunctionReturnOptionalDetails<TFunctionProcessReturnValue<$NoInfer<Ret>, never>, TOpt>;
898
+ <const Key extends ParseKeys<Ns, TOpt, EffectiveKPrefix<KPrefix, TOpt>> | TemplateStringsArray, const TOpt extends TOptions, Ret extends TFunctionReturn<Ns, AppendKeyPrefix<Key, EffectiveKPrefix<KPrefix, TOpt>>, TOpt>>(key: Key | Key[], defaultValue: string, options?: TOpt & InterpolationMap<Ret> & {
899
+ context?: Key extends string ? ContextOfKey<Key, Ns, TOpt, EffectiveKPrefix<KPrefix, TOpt>> : never;
900
+ }): TFunctionReturnOptionalDetails<TFunctionProcessReturnValue<$NoInfer<Ret>, never>, TOpt>;
901
+ }
902
+ interface TFunctionNonStrict<Ns extends Namespace = DefaultNamespace, KPrefix = undefined> extends Branded<Ns> {
903
+ <const Key extends ParseKeys<Ns, TOpt, EffectiveKPrefix<KPrefix, TOpt>> | TemplateStringsArray, const TOpt extends TOptions, Ret extends TFunctionReturn<Ns, AppendKeyPrefix<Key, EffectiveKPrefix<KPrefix, TOpt>>, TOpt>, const ActualOptions extends Omit<TOpt, 'context'> & InterpolationMap<Ret> & {
904
+ context?: Key extends string ? ContextOfKey<Key, Ns, TOpt, EffectiveKPrefix<KPrefix, TOpt>> : never;
905
+ } = TOpt & InterpolationMap<Ret> & {
906
+ context?: Key extends string ? ContextOfKey<Key, Ns, TOpt, EffectiveKPrefix<KPrefix, TOpt>> : never;
907
+ }, DefaultValue extends string = never>(...args: [key: Key | Key[], options?: ActualOptions] | [key: string | string[], options: TOpt & $Dictionary & {
908
+ defaultValue: DefaultValue;
909
+ }] | [key: string | string[], defaultValue: DefaultValue, options?: TOpt & $Dictionary]): TFunctionReturnOptionalDetails<TFunctionProcessReturnValue<$NoInfer<Ret>, DefaultValue>, TOpt>;
910
+ }
911
+ type TFunctionSignature<Ns extends Namespace = DefaultNamespace, KPrefix = undefined> = _EnableSelector extends true | 'optimize' ? TFunctionSelector<Ns, KPrefix, GetSource<Ns, KPrefix>> : _StrictKeyChecks extends true ? TFunctionStrict<Ns, KPrefix> : TFunctionNonStrict<Ns, KPrefix>;
912
+ interface TFunction<Ns extends Namespace = DefaultNamespace, KPrefix = undefined> extends TFunctionSignature<Ns, KPrefix> {}
913
+ type KeyPrefix<Ns extends Namespace> = ResourceKeys<true>[$FirstNamespace<Ns>] | undefined;
914
+ /// ////////////// ///
915
+ /// ↆ selector ↆ ///
916
+ /// ////////////// ///
917
+ declare const $PluralBrand: unique symbol;
918
+ /** Marks a value as coming from a plural-form key, requiring `count` in the selector options. */
919
+ type PluralValue<T extends string> = T & {
920
+ readonly [$PluralBrand]: typeof $PluralBrand;
921
+ };
922
+ declare const $SelectorKeyBrand: unique symbol;
923
+ /**
924
+ * A branded string produced by {@link keyFromSelector}.
925
+ * Can be passed directly to `t()` when the selector API is enabled.
926
+ */
927
+ type SelectorKey = string & {
928
+ readonly [$SelectorKeyBrand]: typeof $SelectorKeyBrand;
929
+ };
930
+ /** Recursively strips the {@link PluralValue} brand from a type (handles nested objects for `returnObjects`). */
931
+ type DeepUnwrapPlural<T> = T extends PluralValue<infer U> ? U : T extends readonly any[] ? { [I in keyof T]: DeepUnwrapPlural<T[I]> } : T extends object ? { [K in keyof T]: DeepUnwrapPlural<T[K]> } : T;
932
+ type NsArg<Ns extends Namespace> = Ns[number] | readonly Ns[number][];
933
+ interface TFunctionSelector<Ns extends Namespace, KPrefix, Source> extends Branded<Ns> {
934
+ // ── Selector(s) with explicit `ns` ───────────────────────────────────────────
935
+ <Target extends ConstrainTarget<Opts>, const NewNs extends NsArg<Ns> & Namespace, const Opts extends SelectorOptions<NewNs>, NewSrc extends GetSource<NewNs, KPrefix>>(selector: SelectorFn<NewSrc, ApplyTarget<Target, Opts>, Opts> | readonly SelectorFn<NewSrc, ApplyTarget<Target, Opts>, Opts>[], options: Opts & InterpolationMap<Target> & {
936
+ ns: NewNs;
937
+ }): SelectorReturn<Target, Opts>; // ── Array of selectors with default `ns` ─────────────────────────────────────
938
+ // Captures the selector tuple as `const Fns` so TypeScript preserves each
939
+ // element's exact return type. The union of return types is then extracted
940
+ // via a distributive `infer`, which correctly handles mixed PluralValue<T> and
941
+ // plain-string callbacks that would otherwise cause TypeScript to "lock in" the
942
+ // type from the first element.
943
+ <const Fns extends readonly ((src: Select<Source, Opts['context']>) => string | object)[], const Opts extends SelectorOptions<Ns[number]> = SelectorOptions<Ns[number]>>(selectors: Fns, options?: Opts & InterpolationMap<DeepUnwrapPlural<Fns[number] extends ((...args: any[]) => infer R) ? R : never>>): SelectorReturn<Fns[number] extends ((...args: any[]) => infer R) ? R : never, Opts>; // ── Single selector with context — bypasses count enforcement ────────────────
944
+ // When `context` is present in options, `Target` is derived from the
945
+ // context-filtered source (third mapped type of FilterKeys), which does NOT
946
+ // apply the PluralValue brand. A separate overload avoids the circular
947
+ // inference that would otherwise occur when `Opts['context']` sits inside the
948
+ // conditional rest tuple of the overload below.
949
+ <Target extends ConstrainTarget<Opts>, const NewNs extends NsArg<Ns> = Ns[number], const Opts extends SelectorOptions<NewNs> & {
950
+ context: string;
951
+ } = SelectorOptions<NewNs> & {
952
+ context: string;
953
+ }>(selector: SelectorFn<Source, ApplyTarget<Target, Opts>, Opts>, options: Opts & InterpolationMap<Target>): SelectorReturn<Target, Opts>; // ── Single selector with defaultValue — preserves literal type of DV ────────
954
+ // `const Opts` loses literal precision for `defaultValue` when inferred
955
+ // through a conditional rest tuple (TypeScript limitation). This dedicated
956
+ // overload captures `DV` from a regular (non-conditional) parameter position,
957
+ // preserving its literal type. Count enforcement for plural keys is achieved
958
+ // via a conditional intersection on the options parameter.
959
+ <const Fn extends (src: Select<Source, undefined>) => ConstrainTarget<Opts>, const DV extends string, const Opts extends SelectorOptions<Ns[number]> = SelectorOptions<Ns[number]>>(selector: Fn, options: Opts & {
960
+ defaultValue: DV;
961
+ } & (ReturnType<Fn> extends PluralValue<string> ? {
962
+ count: number;
963
+ } : {}) & InterpolationMap<DeepUnwrapPlural<ReturnType<Fn>>>): SelectorReturn<ReturnType<Fn>, Opts, DV>; // ── Single selector without context — enforces count for plural keys ──────────
964
+ // Uses `const Fn` to capture the selector's exact return type independently of
965
+ // `Opts`, breaking the circular dependency between `Target` inference and the
966
+ // conditional rest tuple. `ReturnType<Fn>` drives both the plural check and
967
+ // the return type; `Opts` is inferred later from the resolved rest args.
968
+ <const Fn extends (src: Select<Source, undefined>) => ConstrainTarget<Opts>, const Opts extends SelectorOptions<Ns[number]> = SelectorOptions<Ns[number]>>(selector: Fn, ...args: ReturnType<Fn> extends PluralValue<string> ? [options: Opts & {
969
+ count: number;
970
+ } & InterpolationMap<DeepUnwrapPlural<ReturnType<Fn>>>] : [options?: Opts & InterpolationMap<ReturnType<Fn>>]): SelectorReturn<ReturnType<Fn>, Opts>; // ── Pre-computed key(s) from keyFromSelector ────────────────────────────────
971
+ // Accepts a branded `SelectorKey` (or array of them) produced by `keyFromSelector`.
972
+ // Return-type precision is traded for the flexibility of decoupled key creation.
973
+ <const Opts extends SelectorOptions<Ns[number]> = SelectorOptions<Ns[number]>>(key: SelectorKey | SelectorKey[], ...args: [options?: Opts & $Dictionary]): DefaultTReturn<Opts>;
974
+ }
975
+ interface SelectorOptions<Ns = Namespace> extends Omit<TOptionsBase, 'ns' | 'nsSeparator'>, $Dictionary {
976
+ ns?: Ns;
977
+ }
978
+ type SelectorReturn<Target, Opts extends {
979
+ defaultValue?: unknown;
980
+ returnObjects?: boolean;
981
+ }, DV = Opts['defaultValue']> = $IsResourcesDefined extends true ? TFunctionReturnOptionalDetails<ProcessReturnValue<DeepUnwrapPlural<Target>, DV>, Opts> : DefaultTReturn<Opts>;
982
+ interface SelectorFn<Source, Target, Opts extends SelectorOptions<unknown>> {
983
+ (translations: Select<Source, Opts['context']>): Target;
984
+ }
985
+ type ApplyKeyPrefix<T extends [any], KPrefix> = KPrefix extends `${infer Head}${_KeySeparator}${infer Tail}` ? ApplyKeyPrefix<[T[0][Head]], Tail> : T[0][KPrefix & string];
986
+ type ApplyTarget<Target, Opts extends {
987
+ returnObjects?: unknown;
988
+ }> = Opts['returnObjects'] extends true ? unknown : Target;
989
+ type ConstrainTarget<Opts extends SelectorOptions<any>> = _ReturnObjects extends true ? unknown : Opts['returnObjects'] extends true ? unknown : $IsResourcesDefined extends false ? unknown : string;
990
+ type ProcessReturnValue<Target, DefaultValue> = $Turtles extends Target ? string : [DefaultValue] extends [never] ? Target : unknown extends DefaultValue ? Target : Target | DefaultValue;
991
+ type PickNamespaces<T, K extends keyof any> = { [P in K as P extends keyof T ? P : never]: T[P & keyof T] };
992
+ type GetSource<Ns extends Namespace, KPrefix, Res = (Ns extends readonly [keyof Resources, any, ...any] ? Resources[Ns[0]] & PickNamespaces<Resources, Ns[number]> : Resources[$FirstNamespace<Ns>])> = KPrefix extends keyof Res ? Res[KPrefix] : undefined extends KPrefix ? Res : ApplyKeyPrefix<[Res], KPrefix>;
993
+ type Select<T, Context> = $IsResourcesDefined extends false ? $Turtles : [_EnableSelector] extends ['optimize'] ? T : FilterKeys<T, Context>;
994
+ type _HasContextVariant<T, K extends string, Context> = [keyof T & (`${K}${_ContextSeparator}${Context & string}` | `${K}${_ContextSeparator}${Context & string}${_PluralSeparator}${PluralSuffix}`)] extends [never] ? false : true;
995
+ /** Checks whether key K has **any** context variant in T (excluding pure plural suffixes). */
996
+ type _IsContextualKey<T, K extends string> = [Exclude<keyof T & `${K}${_ContextSeparator}${string}`, `${K}${_PluralSeparator}${PluralSuffix}` | `${K}${_PluralSeparator}ordinal${_PluralSeparator}${PluralSuffix}`>] extends [never] ? false : true;
997
+ type FilterKeys<T, Context> = never | T extends readonly any[] ? { [I in keyof T]: FilterKeys<T[I], Context> } : $Prune<{ // Mapped type 1: object-valued keys (recurse) + plain leaf keys (non-plural, non-context)
998
+ [K in keyof T as T[K] extends object ? K : [Context] extends [string] ? K extends `${string}${_ContextSeparator}${Context}` | `${string}${_ContextSeparator}${Context}${_PluralSeparator}${PluralSuffix}` ? never // context keys handled by mapped type 3
999
+ : K extends `${string}${_PluralSeparator}${PluralSuffix}` ? never // plural keys handled by mapped type 2
1000
+ : K extends string ? _HasContextVariant<T, K, Context> extends true ? never // context variant exists, drop base key (type 3 handles it)
1001
+ : _IsContextualKey<T, K> extends true ? never // key has context variants but not for this context
1002
+ : K // no context variants at all, keep base key
1003
+ : K : K extends `${string}${_PluralSeparator}${PluralSuffix}` ? never : K]: T[K] extends object ? FilterKeys<T[K], Context> : T[K] } & { // Mapped type 2: plural collapsing (active regardless of context)
1004
+ [K in keyof T as T[K] extends object ? never : [Context] extends [string] ? K extends `${string}${_ContextSeparator}${Context}` | `${string}${_ContextSeparator}${Context}${_PluralSeparator}${PluralSuffix}` ? never // context keys handled by mapped type 3
1005
+ : K extends `${infer Prefix}${_PluralSeparator}${PluralSuffix}` | `${infer Prefix}${_PluralSeparator}ordinal${_PluralSeparator}${PluralSuffix}` ? Prefix : never : K extends `${infer Prefix}${_PluralSeparator}${PluralSuffix}` | `${infer Prefix}${_PluralSeparator}ordinal${_PluralSeparator}${PluralSuffix}` ? Prefix : never]: T[K] extends object ? FilterKeys<T[K], Context> : PluralValue<T[K] & string> } & { // Mapped type 3: context key collapsing
1006
+ [K in keyof T as T[K] extends object ? never : [Context] extends [string] ? K extends `${infer Prefix}${_ContextSeparator}${Context}` | `${infer Prefix}${_ContextSeparator}${Context}${_PluralSeparator}${PluralSuffix}` ? Prefix : never : never]: T[K] extends object ? FilterKeys<T[K], Context> : T[K] }>;
1007
+ //#endregion
1008
+ //#region ../../node_modules/.pnpm/i18next@25.10.3_typescript@5.9.3/node_modules/i18next/index.d.ts
1009
+ interface Interpolator {
1010
+ init(options: InterpolationOptions, reset: boolean): undefined;
1011
+ reset(): undefined;
1012
+ resetRegExp(): undefined;
1013
+ interpolate(str: string, data: object, lng: string, options: InterpolationOptions): string;
1014
+ nest(str: string, fc: (...args: any[]) => any, options: InterpolationOptions): string;
1015
+ }
1016
+ declare class ResourceStore {
1017
+ constructor(data: Resource, options: InitOptions);
1018
+ public data: Resource;
1019
+ public options: InitOptions;
1020
+ /**
1021
+ * Gets fired when resources got added or removed
1022
+ */
1023
+ on(event: 'added' | 'removed', callback: (lng: string, ns: string) => void): void;
1024
+ /**
1025
+ * Remove event listener
1026
+ * removes all callback when callback not specified
1027
+ */
1028
+ off(event: 'added' | 'removed', callback?: (lng: string, ns: string) => void): void;
1029
+ }
1030
+ interface Formatter {
1031
+ init(services: Services, i18nextOptions: InitOptions): void;
1032
+ add(name: string, fc: (value: any, lng: string | undefined, options: any) => string): void;
1033
+ addCached(name: string, fc: (lng: string | undefined, options: any) => (value: any) => string): void;
1034
+ format: FormatFunction;
1035
+ }
1036
+ interface Services {
1037
+ backendConnector: any;
1038
+ i18nFormat: any;
1039
+ interpolator: Interpolator;
1040
+ languageDetector: any;
1041
+ languageUtils: any;
1042
+ logger: any;
1043
+ pluralResolver: any;
1044
+ resourceStore: ResourceStore;
1045
+ formatter?: Formatter;
1046
+ }
1047
+ type ModuleType = 'backend' | 'logger' | 'languageDetector' | 'postProcessor' | 'i18nFormat' | 'formatter' | '3rdParty';
1048
+ interface Module {
1049
+ type: ModuleType;
1050
+ }
1051
+ type CallbackError = Error | string | null | undefined;
1052
+ type ReadCallback = (err: CallbackError, data: ResourceKey | boolean | null | undefined) => void;
1053
+ type MultiReadCallback = (err: CallbackError, data: Resource | null | undefined) => void;
1054
+ /**
1055
+ * Used to load data for i18next.
1056
+ * Can be provided as a singleton or as a prototype constructor (preferred for supporting multiple instances of i18next).
1057
+ * For singleton set property `type` to `'backend'` For a prototype constructor set static property.
1058
+ */
1059
+ interface BackendModule<Options = object> extends Module {
1060
+ type: 'backend';
1061
+ init(services: Services, backendOptions: Options, i18nextOptions: InitOptions): void;
1062
+ read(language: string, namespace: string, callback: ReadCallback): void;
1063
+ /** Save the missing translation */
1064
+ create?(languages: readonly string[], namespace: string, key: string, fallbackValue: string): void;
1065
+ /** Load multiple languages and namespaces. For backends supporting multiple resources loading */
1066
+ readMulti?(languages: readonly string[], namespaces: readonly string[], callback: MultiReadCallback): void;
1067
+ /** Store the translation. For backends acting as cache layer */
1068
+ save?(language: string, namespace: string, data: ResourceLanguage): void;
1069
+ }
1070
+ /**
1071
+ * Used to detect language in user land.
1072
+ * Can be provided as a singleton or as a prototype constructor (preferred for supporting multiple instances of i18next).
1073
+ * For singleton set property `type` to `'languageDetector'` For a prototype constructor set static property.
1074
+ */
1075
+ interface LanguageDetectorModule extends Module {
1076
+ type: 'languageDetector';
1077
+ init?(services: Services, detectorOptions: object, i18nextOptions: InitOptions): void;
1078
+ /** Must return detected language */
1079
+ detect(): string | readonly string[] | undefined;
1080
+ cacheUserLanguage?(lng: string): void;
1081
+ }
1082
+ /**
1083
+ * Used to detect language in user land.
1084
+ * Can be provided as a singleton or as a prototype constructor (preferred for supporting multiple instances of i18next).
1085
+ * For singleton set property `type` to `'languageDetector'` For a prototype constructor set static property.
1086
+ */
1087
+ interface LanguageDetectorAsyncModule extends Module {
1088
+ type: 'languageDetector';
1089
+ /** Set to true to enable async detection */
1090
+ async: true;
1091
+ init?(services: Services, detectorOptions: object, i18nextOptions: InitOptions): void;
1092
+ /** Must call callback passing detected language or return a Promise */
1093
+ detect(callback: (lng: string | readonly string[] | undefined) => void | undefined): void | Promise<string | readonly string[] | undefined>;
1094
+ cacheUserLanguage?(lng: string): void | Promise<void>;
1095
+ }
1096
+ /**
1097
+ * Override the built-in console logger.
1098
+ * Do not need to be a prototype function.
1099
+ */
1100
+ interface LoggerModule extends Module {
1101
+ type: 'logger';
1102
+ log(...args: any[]): void;
1103
+ warn(...args: any[]): void;
1104
+ error(...args: any[]): void;
1105
+ }
1106
+ interface I18nFormatModule extends Module {
1107
+ type: 'i18nFormat';
1108
+ }
1109
+ interface FormatterModule extends Module, Formatter {
1110
+ type: 'formatter';
1111
+ }
1112
+ interface ThirdPartyModule extends Module {
1113
+ type: '3rdParty';
1114
+ init(i18next: i18n$1): void;
1115
+ }
1116
+ interface Modules {
1117
+ backend?: BackendModule;
1118
+ logger?: LoggerModule;
1119
+ languageDetector?: LanguageDetectorModule | LanguageDetectorAsyncModule;
1120
+ i18nFormat?: I18nFormatModule;
1121
+ formatter?: FormatterModule;
1122
+ external: ThirdPartyModule[];
1123
+ }
1124
+ // helper to identify class https://stackoverflow.com/a/45983481/2363935
1125
+ interface Newable<T> {
1126
+ new (...args: any[]): T;
1127
+ }
1128
+ interface NewableModule<T extends Module> extends Newable<T> {
1129
+ type: T['type'];
1130
+ }
1131
+ type Callback = (error: any, t: TFunction) => void;
1132
+ /**
1133
+ * Uses similar args as the t function and returns true if a key exists.
1134
+ */
1135
+ interface ExistsFunction<TKeys extends string = string, TInterpolationMap extends object = $Dictionary> {
1136
+ (key: TKeys | TKeys[], options?: TOptions<TInterpolationMap>): boolean;
1137
+ }
1138
+ interface CloneOptions extends InitOptions {
1139
+ /**
1140
+ * Will create a new instance of the resource store and import the existing translation resources.
1141
+ * This way it will not shared the resource store instance.
1142
+ * @default false
1143
+ */
1144
+ forkResourceStore?: boolean;
1145
+ }
1146
+ interface CustomInstanceExtensions {}
1147
+ // Used just here to exclude `DefaultNamespace` which can be both string or array from `FlatNamespace`
1148
+ // in TFunction declaration below.
1149
+ // Due to this only very special usage I'm not moving this inside helpers.
1150
+ type InferArrayValuesElseReturnType<T> = T extends (infer A)[] ? A : T; // eslint-disable-next-line @typescript-eslint/naming-convention
1151
+ interface i18n$1 extends CustomInstanceExtensions {
1152
+ // Expose parameterized t in the i18next interface hierarchy
1153
+ t: TFunction<[...$NormalizeIntoArray<DefaultNamespace>, ...Exclude<FlatNamespace, InferArrayValuesElseReturnType<DefaultNamespace>>[]]>;
1154
+ /**
1155
+ * The default of the i18next module is an i18next instance ready to be initialized by calling init.
1156
+ * You can create additional instances using the createInstance function.
1157
+ *
1158
+ * @param options - Initial options.
1159
+ * @param callback - will be called after all translations were loaded or with an error when failed (in case of using a backend).
1160
+ */
1161
+ init(callback?: Callback): Promise<TFunction>;
1162
+ init<T>(options: InitOptions<T>, callback?: Callback): Promise<TFunction>;
1163
+ loadResources(callback?: (err: any) => void): void;
1164
+ /**
1165
+ * The use function is there to load additional plugins to i18next.
1166
+ * For available module see the plugins page and don't forget to read the documentation of the plugin.
1167
+ *
1168
+ * @param module Accepts a class or object
1169
+ */
1170
+ use<T extends Module>(module: T | NewableModule<T> | Newable<T>): this;
1171
+ /**
1172
+ * List of modules used
1173
+ */
1174
+ modules: Modules;
1175
+ /**
1176
+ * Internal container for all used plugins and implementation details like languageUtils, pluralResolvers, etc.
1177
+ */
1178
+ services: Services;
1179
+ /**
1180
+ * Internal container for translation resources
1181
+ */
1182
+ store: ResourceStore;
1183
+ /**
1184
+ * Uses similar args as the t function and returns true if a key exists.
1185
+ */
1186
+ exists: ExistsFunction;
1187
+ /**
1188
+ * Returns a resource data by language.
1189
+ */
1190
+ getDataByLanguage(lng: string): {
1191
+ [key: string]: {
1192
+ [key: string]: string;
1193
+ };
1194
+ } | undefined;
1195
+ /**
1196
+ * Returns a t function that defaults to given language or namespace.
1197
+ * Both params could be arrays of languages or namespaces and will be treated as fallbacks in that case.
1198
+ * On the returned function you can like in the t function override the languages or namespaces by passing them in options or by prepending namespace.
1199
+ *
1200
+ * Accepts optional keyPrefix that will be automatically applied to returned t function.
1201
+ */
1202
+ getFixedT<Ns extends Namespace | null = DefaultNamespace, TKPrefix extends KeyPrefix<ActualNs> = undefined, ActualNs extends Namespace = (Ns extends null ? DefaultNamespace : Ns)>(...args: [lng: string | readonly string[], ns?: Ns, keyPrefix?: TKPrefix | (($: any) => any)] | [lng: null, ns: Ns, keyPrefix?: TKPrefix | (($: any) => any)]): TFunction<ActualNs, TKPrefix>;
1203
+ /**
1204
+ * Changes the language. The callback will be called as soon translations were loaded or an error occurs while loading.
1205
+ * HINT: For easy testing - setting lng to 'cimode' will set t function to always return the key.
1206
+ */
1207
+ changeLanguage(lng?: string, callback?: Callback): Promise<TFunction>;
1208
+ /**
1209
+ * Is set to the current detected or set language.
1210
+ * If you need the primary used language depending on your configuration (supportedLngs, load) you will prefer using i18next.languages[0].
1211
+ */
1212
+ language: string;
1213
+ /**
1214
+ * Is set to an array of language-codes that will be used it order to lookup the translation value.
1215
+ */
1216
+ languages: readonly string[];
1217
+ /**
1218
+ * Is set to the current resolved language.
1219
+ * It can be used as primary used language, for example in a language switcher.
1220
+ */
1221
+ resolvedLanguage?: string;
1222
+ /**
1223
+ * Checks if namespace has loaded yet.
1224
+ * i.e. used by react-i18next
1225
+ */
1226
+ hasLoadedNamespace(ns: string | readonly string[], options?: {
1227
+ lng?: string | readonly string[];
1228
+ fallbackLng?: InitOptions['fallbackLng'];
1229
+ /**
1230
+ * if `undefined` is returned default checks are performed.
1231
+ */
1232
+ precheck?: (i18n: i18n$1,
1233
+ /**
1234
+ * Check if the language namespace provided are not in loading status:
1235
+ * returns `true` if load is completed successfully or with an error.
1236
+ */
1237
+
1238
+ loadNotPending: (lng: string | readonly string[], ns: string | readonly string[]) => boolean) => boolean | undefined;
1239
+ }): boolean;
1240
+ /**
1241
+ * Loads additional namespaces not defined in init options.
1242
+ */
1243
+ loadNamespaces(ns: string | readonly string[], callback?: Callback): Promise<void>;
1244
+ /**
1245
+ * Loads additional languages not defined in init options (preload).
1246
+ */
1247
+ loadLanguages(lngs: string | readonly string[], callback?: Callback): Promise<void>;
1248
+ /**
1249
+ * Reloads resources on given state. Optionally you can pass an array of languages and namespaces as params if you don't want to reload all.
1250
+ */
1251
+ reloadResources(lngs?: string | readonly string[], ns?: string | readonly string[], callback?: () => void): Promise<void>;
1252
+ reloadResources(lngs: null, ns: string | readonly string[], callback?: () => void): Promise<void>;
1253
+ /**
1254
+ * Changes the default namespace.
1255
+ */
1256
+ setDefaultNamespace(ns: string | readonly string[]): void;
1257
+ /**
1258
+ * Returns rtl or ltr depending on languages read direction.
1259
+ */
1260
+ dir(lng?: string): 'ltr' | 'rtl';
1261
+ /**
1262
+ * Exposes interpolation.format function added on init.
1263
+ */
1264
+ format: FormatFunction;
1265
+ /**
1266
+ * Will return a new i18next instance.
1267
+ * Please read the options page for details on configuration options.
1268
+ * Providing a callback will automatically call init.
1269
+ * The callback will be called after all translations were loaded or with an error when failed (in case of using a backend).
1270
+ */
1271
+ createInstance(options?: InitOptions, callback?: Callback): i18n$1;
1272
+ /**
1273
+ * Creates a clone of the current instance. Shares store, plugins and initial configuration.
1274
+ * Can be used to create an instance sharing storage but being independent on set language or namespaces.
1275
+ */
1276
+ cloneInstance(options?: CloneOptions, callback?: Callback): i18n$1;
1277
+ /**
1278
+ * Returns a JSON representation of the i18next instance for serialization.
1279
+ */
1280
+ toJSON(): {
1281
+ options: InitOptions;
1282
+ store: ResourceStore;
1283
+ language: string;
1284
+ languages: readonly string[];
1285
+ resolvedLanguage?: string;
1286
+ };
1287
+ /**
1288
+ * Gets fired after initialization.
1289
+ */
1290
+ on(event: 'initialized', callback: (options: InitOptions) => void): this;
1291
+ /**
1292
+ * Gets fired on loaded resources.
1293
+ */
1294
+ on(event: 'loaded', callback: (loaded: {
1295
+ [language: string]: {
1296
+ [namespace: string]: boolean;
1297
+ };
1298
+ }) => void): this;
1299
+ /**
1300
+ * Gets fired if loading resources failed.
1301
+ */
1302
+ on(event: 'failedLoading', callback: (lng: string, ns: string, msg: string) => void): this;
1303
+ /**
1304
+ * Gets fired on accessing a key not existing.
1305
+ */
1306
+ on(event: 'missingKey', callback: (lngs: readonly string[], namespace: string, key: string, res: string) => void): this;
1307
+ /**
1308
+ * Gets fired when changeLanguage got called.
1309
+ */
1310
+ on(event: 'languageChanged', callback: (lng: string) => void): this;
1311
+ /**
1312
+ * Event listener
1313
+ */
1314
+ on(event: string, listener: (...args: any[]) => void): this;
1315
+ /**
1316
+ * Remove event listener
1317
+ * removes all callback when callback not specified
1318
+ */
1319
+ off(event: string, listener?: (...args: any[]) => void): void;
1320
+ /**
1321
+ * Gets one value by given key.
1322
+ */
1323
+ getResource(lng: string, ns: string, key: string, options?: Pick<InitOptions, 'keySeparator' | 'ignoreJSONStructure'>): any;
1324
+ /**
1325
+ * Adds one key/value.
1326
+ */
1327
+ addResource(lng: string, ns: string, key: string, value: string, options?: {
1328
+ keySeparator?: string;
1329
+ silent?: boolean;
1330
+ }): i18n$1;
1331
+ /**
1332
+ * Adds multiple key/values.
1333
+ */
1334
+ addResources(lng: string, ns: string, resources: any): i18n$1;
1335
+ /**
1336
+ * Adds a complete bundle.
1337
+ * Setting deep param to true will extend existing translations in that file.
1338
+ * Setting overwrite to true it will overwrite existing translations in that file.
1339
+ */
1340
+ addResourceBundle(lng: string, ns: string, resources: any, deep?: boolean, overwrite?: boolean): i18n$1;
1341
+ /**
1342
+ * Checks if a resource bundle exists.
1343
+ */
1344
+ hasResourceBundle(lng: string, ns: string): boolean;
1345
+ /**
1346
+ * Returns a resource bundle.
1347
+ */
1348
+ getResourceBundle(lng: string, ns: string): any;
1349
+ /**
1350
+ * Removes an existing bundle.
1351
+ */
1352
+ removeResourceBundle(lng: string, ns: string): i18n$1;
1353
+ /**
1354
+ * Current options
1355
+ */
1356
+ options: InitOptions;
1357
+ /**
1358
+ * Is initialized
1359
+ */
1360
+ isInitialized: boolean;
1361
+ /**
1362
+ * Is initializing
1363
+ */
1364
+ isInitializing: boolean;
1365
+ /**
1366
+ * Store was initialized
1367
+ */
1368
+ initializedStoreOnce: boolean;
1369
+ /**
1370
+ * Language was initialized
1371
+ */
1372
+ initializedLanguageOnce: boolean;
1373
+ /**
1374
+ * Emit event
1375
+ */
1376
+ emit(eventName: string, ...args: any[]): void;
1377
+ }
1378
+ //#endregion
1379
+ //#region src/i18n/i18next.d.ts
1380
+ declare const i18n: i18n$1;
1381
+ //#endregion
1382
+ export { i18n };
1383
+ //# sourceMappingURL=i18next.d.ts.map