@digitaldefiance/i18n-lib 3.8.2 → 3.8.3

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 (502) hide show
  1. package/package.json +6 -5
  2. package/src/{active-context.ts → active-context.d.ts} +1 -0
  3. package/src/active-context.d.ts.map +1 -0
  4. package/src/active-context.js +3 -0
  5. package/src/active-context.js.map +1 -0
  6. package/src/builders/i18n-builder.d.ts +26 -0
  7. package/src/builders/i18n-builder.d.ts.map +1 -0
  8. package/src/builders/i18n-builder.js +70 -0
  9. package/src/builders/i18n-builder.js.map +1 -0
  10. package/src/builders/{index.ts → index.d.ts} +1 -1
  11. package/src/builders/index.d.ts.map +1 -0
  12. package/src/builders/index.js +8 -0
  13. package/src/builders/index.js.map +1 -0
  14. package/src/component-definition.d.ts +12 -0
  15. package/src/component-definition.d.ts.map +1 -0
  16. package/src/component-definition.js +3 -0
  17. package/src/component-definition.js.map +1 -0
  18. package/src/component-registration.d.ts +22 -0
  19. package/src/component-registration.d.ts.map +1 -0
  20. package/src/component-registration.js +3 -0
  21. package/src/component-registration.js.map +1 -0
  22. package/src/component-registry.d.ts +102 -0
  23. package/src/component-registry.d.ts.map +1 -0
  24. package/src/component-registry.js +282 -0
  25. package/src/component-registry.js.map +1 -0
  26. package/src/context-error-type.d.ts +8 -0
  27. package/src/context-error-type.d.ts.map +1 -0
  28. package/src/context-error-type.js +12 -0
  29. package/src/context-error-type.js.map +1 -0
  30. package/src/core/component-store.d.ts +93 -0
  31. package/src/core/component-store.d.ts.map +1 -0
  32. package/src/core/component-store.js +198 -0
  33. package/src/core/component-store.js.map +1 -0
  34. package/src/core/context-manager.d.ts +72 -0
  35. package/src/core/context-manager.d.ts.map +1 -0
  36. package/src/core/context-manager.js +98 -0
  37. package/src/core/context-manager.js.map +1 -0
  38. package/src/core/enum-registry.d.ts +48 -0
  39. package/src/core/enum-registry.d.ts.map +1 -0
  40. package/src/core/enum-registry.js +85 -0
  41. package/src/core/enum-registry.js.map +1 -0
  42. package/src/core/i18n-engine.d.ts +241 -0
  43. package/src/core/i18n-engine.d.ts.map +1 -0
  44. package/src/core/i18n-engine.js +568 -0
  45. package/src/core/i18n-engine.js.map +1 -0
  46. package/src/core/{index.ts → index.d.ts} +1 -4
  47. package/src/core/index.d.ts.map +1 -0
  48. package/src/core/index.js +21 -0
  49. package/src/core/index.js.map +1 -0
  50. package/src/core/language-registry.d.ts +180 -0
  51. package/src/core/language-registry.d.ts.map +1 -0
  52. package/src/core/language-registry.js +298 -0
  53. package/src/core/language-registry.js.map +1 -0
  54. package/src/{core-component-id.ts → core-component-id.d.ts} +2 -1
  55. package/src/core-component-id.d.ts.map +1 -0
  56. package/src/core-component-id.js +9 -0
  57. package/src/core-component-id.js.map +1 -0
  58. package/src/core-i18n.d.ts +69 -0
  59. package/src/core-i18n.d.ts.map +1 -0
  60. package/src/core-i18n.js +219 -0
  61. package/src/core-i18n.js.map +1 -0
  62. package/src/core-plugin-factory.d.ts +28 -0
  63. package/src/core-plugin-factory.d.ts.map +1 -0
  64. package/src/core-plugin-factory.js +80 -0
  65. package/src/core-plugin-factory.js.map +1 -0
  66. package/src/core-string-key.d.ts +52 -0
  67. package/src/core-string-key.d.ts.map +1 -0
  68. package/src/core-string-key.js +61 -0
  69. package/src/core-string-key.js.map +1 -0
  70. package/src/create-translation-adapter.d.ts +33 -0
  71. package/src/create-translation-adapter.d.ts.map +1 -0
  72. package/src/create-translation-adapter.js +72 -0
  73. package/src/create-translation-adapter.js.map +1 -0
  74. package/src/enum-registry.d.ts +65 -0
  75. package/src/enum-registry.d.ts.map +1 -0
  76. package/src/enum-registry.js +123 -0
  77. package/src/enum-registry.js.map +1 -0
  78. package/src/errors/{base.ts → base.d.ts} +1 -1
  79. package/src/errors/base.d.ts.map +1 -0
  80. package/src/errors/base.js +11 -0
  81. package/src/errors/base.js.map +1 -0
  82. package/src/errors/context-error.d.ts +50 -0
  83. package/src/errors/context-error.d.ts.map +1 -0
  84. package/src/errors/context-error.js +93 -0
  85. package/src/errors/context-error.js.map +1 -0
  86. package/src/errors/enhanced-error-base.d.ts +125 -0
  87. package/src/errors/enhanced-error-base.d.ts.map +1 -0
  88. package/src/errors/enhanced-error-base.js +165 -0
  89. package/src/errors/enhanced-error-base.js.map +1 -0
  90. package/src/errors/handleable.d.ts +83 -0
  91. package/src/errors/handleable.d.ts.map +1 -0
  92. package/src/errors/handleable.js +136 -0
  93. package/src/errors/handleable.js.map +1 -0
  94. package/src/errors/i18n-error.d.ts +211 -0
  95. package/src/errors/i18n-error.d.ts.map +1 -0
  96. package/src/errors/i18n-error.js +358 -0
  97. package/src/errors/i18n-error.js.map +1 -0
  98. package/src/errors/{index.ts → index.d.ts} +1 -4
  99. package/src/errors/index.d.ts.map +1 -0
  100. package/src/errors/index.js +17 -0
  101. package/src/errors/index.js.map +1 -0
  102. package/src/errors/simple-typed-error.d.ts +53 -0
  103. package/src/errors/simple-typed-error.d.ts.map +1 -0
  104. package/src/errors/simple-typed-error.js +51 -0
  105. package/src/errors/simple-typed-error.js.map +1 -0
  106. package/src/errors/{translatable-exports.ts → translatable-exports.d.ts} +1 -1
  107. package/src/errors/translatable-exports.d.ts.map +1 -0
  108. package/src/errors/translatable-exports.js +15 -0
  109. package/src/errors/translatable-exports.js.map +1 -0
  110. package/src/errors/translatable-generic.d.ts +87 -0
  111. package/src/errors/translatable-generic.d.ts.map +1 -0
  112. package/src/errors/translatable-generic.js +139 -0
  113. package/src/errors/translatable-generic.js.map +1 -0
  114. package/src/errors/translatable-handleable-generic.d.ts +116 -0
  115. package/src/errors/translatable-handleable-generic.d.ts.map +1 -0
  116. package/src/errors/translatable-handleable-generic.js +121 -0
  117. package/src/errors/translatable-handleable-generic.js.map +1 -0
  118. package/src/errors/translatable.d.ts +63 -0
  119. package/src/errors/translatable.d.ts.map +1 -0
  120. package/src/errors/translatable.js +85 -0
  121. package/src/errors/translatable.js.map +1 -0
  122. package/src/errors/typed-handleable.d.ts +62 -0
  123. package/src/errors/typed-handleable.d.ts.map +1 -0
  124. package/src/errors/typed-handleable.js +108 -0
  125. package/src/errors/typed-handleable.js.map +1 -0
  126. package/src/errors/typed.d.ts +206 -0
  127. package/src/errors/typed.d.ts.map +1 -0
  128. package/src/errors/typed.js +458 -0
  129. package/src/errors/typed.js.map +1 -0
  130. package/src/gender/{gender-categories.ts → gender-categories.d.ts} +2 -6
  131. package/src/gender/gender-categories.d.ts.map +1 -0
  132. package/src/gender/gender-categories.js +15 -0
  133. package/src/gender/gender-categories.js.map +1 -0
  134. package/src/gender/gender-resolver.d.ts +14 -0
  135. package/src/gender/gender-resolver.d.ts.map +1 -0
  136. package/src/gender/gender-resolver.js +35 -0
  137. package/src/gender/gender-resolver.js.map +1 -0
  138. package/src/gender/{index.ts → index.d.ts} +1 -0
  139. package/src/gender/index.d.ts.map +1 -0
  140. package/src/gender/index.js +6 -0
  141. package/src/gender/index.js.map +1 -0
  142. package/src/global-active-context.d.ts +50 -0
  143. package/src/global-active-context.d.ts.map +1 -0
  144. package/src/global-active-context.js +185 -0
  145. package/src/global-active-context.js.map +1 -0
  146. package/src/icu/ast.d.ts +48 -0
  147. package/src/icu/ast.d.ts.map +1 -0
  148. package/src/icu/ast.js +16 -0
  149. package/src/icu/ast.js.map +1 -0
  150. package/src/icu/compiler.d.ts +16 -0
  151. package/src/icu/compiler.d.ts.map +1 -0
  152. package/src/icu/compiler.js +87 -0
  153. package/src/icu/compiler.js.map +1 -0
  154. package/src/icu/formatter-registry.d.ts +10 -0
  155. package/src/icu/formatter-registry.d.ts.map +1 -0
  156. package/src/icu/formatter-registry.js +34 -0
  157. package/src/icu/formatter-registry.js.map +1 -0
  158. package/src/icu/formatters/base-formatter.d.ts +8 -0
  159. package/src/icu/formatters/base-formatter.d.ts.map +1 -0
  160. package/src/icu/formatters/base-formatter.js +3 -0
  161. package/src/icu/formatters/base-formatter.js.map +1 -0
  162. package/src/icu/formatters/date-formatter.d.ts +5 -0
  163. package/src/icu/formatters/date-formatter.d.ts.map +1 -0
  164. package/src/icu/formatters/date-formatter.js +31 -0
  165. package/src/icu/formatters/date-formatter.js.map +1 -0
  166. package/src/icu/formatters/number-formatter.d.ts +5 -0
  167. package/src/icu/formatters/number-formatter.d.ts.map +1 -0
  168. package/src/icu/formatters/number-formatter.js +33 -0
  169. package/src/icu/formatters/number-formatter.js.map +1 -0
  170. package/src/icu/formatters/plural-formatter.d.ts +5 -0
  171. package/src/icu/formatters/plural-formatter.d.ts.map +1 -0
  172. package/src/icu/formatters/plural-formatter.js +15 -0
  173. package/src/icu/formatters/plural-formatter.js.map +1 -0
  174. package/src/icu/formatters/select-formatter.d.ts +5 -0
  175. package/src/icu/formatters/select-formatter.d.ts.map +1 -0
  176. package/src/icu/formatters/select-formatter.js +10 -0
  177. package/src/icu/formatters/select-formatter.js.map +1 -0
  178. package/src/icu/formatters/selectordinal-formatter.d.ts +5 -0
  179. package/src/icu/formatters/selectordinal-formatter.d.ts.map +1 -0
  180. package/src/icu/formatters/selectordinal-formatter.js +22 -0
  181. package/src/icu/formatters/selectordinal-formatter.js.map +1 -0
  182. package/src/icu/formatters/time-formatter.d.ts +5 -0
  183. package/src/icu/formatters/time-formatter.d.ts.map +1 -0
  184. package/src/icu/formatters/time-formatter.js +31 -0
  185. package/src/icu/formatters/time-formatter.js.map +1 -0
  186. package/src/icu/helpers.d.ts +9 -0
  187. package/src/icu/helpers.d.ts.map +1 -0
  188. package/src/icu/helpers.js +31 -0
  189. package/src/icu/helpers.js.map +1 -0
  190. package/src/icu/parser.d.ts +31 -0
  191. package/src/icu/parser.d.ts.map +1 -0
  192. package/src/icu/parser.js +203 -0
  193. package/src/icu/parser.js.map +1 -0
  194. package/src/icu/runtime.d.ts +10 -0
  195. package/src/icu/runtime.d.ts.map +1 -0
  196. package/src/icu/runtime.js +33 -0
  197. package/src/icu/runtime.js.map +1 -0
  198. package/src/icu/tokenizer.d.ts +37 -0
  199. package/src/icu/tokenizer.d.ts.map +1 -0
  200. package/src/icu/tokenizer.js +187 -0
  201. package/src/icu/tokenizer.js.map +1 -0
  202. package/src/icu/validator.d.ts +11 -0
  203. package/src/icu/validator.d.ts.map +1 -0
  204. package/src/icu/validator.js +140 -0
  205. package/src/icu/validator.js.map +1 -0
  206. package/src/{index.ts → index.d.ts} +6 -38
  207. package/src/index.d.ts.map +1 -0
  208. package/src/index.js +76 -0
  209. package/src/index.js.map +1 -0
  210. package/src/interfaces/active-context.interface.d.ts +36 -0
  211. package/src/interfaces/active-context.interface.d.ts.map +1 -0
  212. package/src/interfaces/active-context.interface.js +3 -0
  213. package/src/interfaces/active-context.interface.js.map +1 -0
  214. package/src/interfaces/component-config.interface.d.ts +16 -0
  215. package/src/interfaces/component-config.interface.d.ts.map +1 -0
  216. package/src/interfaces/component-config.interface.js +6 -0
  217. package/src/interfaces/component-config.interface.js.map +1 -0
  218. package/src/interfaces/engine-config.interface.d.ts +22 -0
  219. package/src/interfaces/engine-config.interface.d.ts.map +1 -0
  220. package/src/interfaces/engine-config.interface.js +6 -0
  221. package/src/interfaces/engine-config.interface.js.map +1 -0
  222. package/src/interfaces/global-active-context.d.ts +23 -0
  223. package/src/interfaces/global-active-context.d.ts.map +1 -0
  224. package/src/interfaces/global-active-context.js +3 -0
  225. package/src/interfaces/global-active-context.js.map +1 -0
  226. package/src/interfaces/handleable-error-options.d.ts +14 -0
  227. package/src/interfaces/handleable-error-options.d.ts.map +1 -0
  228. package/src/interfaces/handleable-error-options.js +3 -0
  229. package/src/interfaces/handleable-error-options.js.map +1 -0
  230. package/src/interfaces/handleable.d.ts +21 -0
  231. package/src/interfaces/handleable.d.ts.map +1 -0
  232. package/src/interfaces/handleable.js +3 -0
  233. package/src/interfaces/handleable.js.map +1 -0
  234. package/src/interfaces/i18n-engine.interface.d.ts +46 -0
  235. package/src/interfaces/i18n-engine.interface.d.ts.map +1 -0
  236. package/src/interfaces/i18n-engine.interface.js +6 -0
  237. package/src/interfaces/i18n-engine.interface.js.map +1 -0
  238. package/src/interfaces/{index.ts → index.d.ts} +1 -1
  239. package/src/interfaces/index.d.ts.map +1 -0
  240. package/src/interfaces/index.js +7 -0
  241. package/src/interfaces/index.js.map +1 -0
  242. package/src/interfaces/language-definition.interface.d.ts +17 -0
  243. package/src/interfaces/language-definition.interface.d.ts.map +1 -0
  244. package/src/interfaces/language-definition.interface.js +6 -0
  245. package/src/interfaces/language-definition.interface.js.map +1 -0
  246. package/src/interfaces/translation-options.interface.d.ts +15 -0
  247. package/src/interfaces/translation-options.interface.d.ts.map +1 -0
  248. package/src/interfaces/translation-options.interface.js +6 -0
  249. package/src/interfaces/translation-options.interface.js.map +1 -0
  250. package/src/interfaces/validation-result.interface.d.ts +24 -0
  251. package/src/interfaces/validation-result.interface.d.ts.map +1 -0
  252. package/src/interfaces/validation-result.interface.js +6 -0
  253. package/src/interfaces/validation-result.interface.js.map +1 -0
  254. package/src/language-codes.d.ts +28 -0
  255. package/src/language-codes.d.ts.map +1 -0
  256. package/src/language-codes.js +32 -0
  257. package/src/language-codes.js.map +1 -0
  258. package/src/language-definition.d.ts +14 -0
  259. package/src/language-definition.d.ts.map +1 -0
  260. package/src/language-definition.js +3 -0
  261. package/src/language-definition.js.map +1 -0
  262. package/src/plugin-i18n-engine.d.ts +164 -0
  263. package/src/plugin-i18n-engine.d.ts.map +1 -0
  264. package/src/plugin-i18n-engine.js +493 -0
  265. package/src/plugin-i18n-engine.js.map +1 -0
  266. package/src/pluralization/{index.ts → index.d.ts} +1 -1
  267. package/src/pluralization/index.d.ts.map +1 -0
  268. package/src/pluralization/index.js +10 -0
  269. package/src/pluralization/index.js.map +1 -0
  270. package/src/pluralization/language-plural-map.d.ts +29 -0
  271. package/src/pluralization/language-plural-map.d.ts.map +1 -0
  272. package/src/pluralization/language-plural-map.js +155 -0
  273. package/src/pluralization/language-plural-map.js.map +1 -0
  274. package/src/pluralization/{plural-categories.ts → plural-categories.d.ts} +3 -5
  275. package/src/pluralization/plural-categories.d.ts.map +1 -0
  276. package/src/pluralization/plural-categories.js +8 -0
  277. package/src/pluralization/plural-categories.js.map +1 -0
  278. package/src/pluralization/plural-rules.d.ts +102 -0
  279. package/src/pluralization/plural-rules.d.ts.map +1 -0
  280. package/src/pluralization/plural-rules.js +263 -0
  281. package/src/pluralization/plural-rules.js.map +1 -0
  282. package/src/registry-config.d.ts +16 -0
  283. package/src/registry-config.d.ts.map +1 -0
  284. package/src/registry-config.js +3 -0
  285. package/src/registry-config.js.map +1 -0
  286. package/src/registry-error-type.d.ts +20 -0
  287. package/src/registry-error-type.d.ts.map +1 -0
  288. package/src/registry-error-type.js +24 -0
  289. package/src/registry-error-type.js.map +1 -0
  290. package/src/registry-error.d.ts +25 -0
  291. package/src/registry-error.d.ts.map +1 -0
  292. package/src/registry-error.js +63 -0
  293. package/src/registry-error.js.map +1 -0
  294. package/src/strict-types.d.ts +19 -0
  295. package/src/strict-types.d.ts.map +1 -0
  296. package/src/strict-types.js +18 -0
  297. package/src/strict-types.js.map +1 -0
  298. package/src/strings/de.d.ts +3 -0
  299. package/src/strings/de.d.ts.map +1 -0
  300. package/src/strings/de.js +57 -0
  301. package/src/strings/de.js.map +1 -0
  302. package/src/strings/en-GB.d.ts +3 -0
  303. package/src/strings/en-GB.d.ts.map +1 -0
  304. package/src/strings/en-GB.js +57 -0
  305. package/src/strings/en-GB.js.map +1 -0
  306. package/src/strings/en-US.d.ts +3 -0
  307. package/src/strings/en-US.d.ts.map +1 -0
  308. package/src/strings/en-US.js +57 -0
  309. package/src/strings/en-US.js.map +1 -0
  310. package/src/strings/es.d.ts +3 -0
  311. package/src/strings/es.d.ts.map +1 -0
  312. package/src/strings/es.js +57 -0
  313. package/src/strings/es.js.map +1 -0
  314. package/src/strings/fr.d.ts +3 -0
  315. package/src/strings/fr.d.ts.map +1 -0
  316. package/src/strings/fr.js +57 -0
  317. package/src/strings/fr.js.map +1 -0
  318. package/src/strings/ja.d.ts +3 -0
  319. package/src/strings/ja.d.ts.map +1 -0
  320. package/src/strings/ja.js +57 -0
  321. package/src/strings/ja.js.map +1 -0
  322. package/src/strings/uk.d.ts +3 -0
  323. package/src/strings/uk.d.ts.map +1 -0
  324. package/src/strings/uk.js +57 -0
  325. package/src/strings/uk.js.map +1 -0
  326. package/src/strings/zh-CN.d.ts +3 -0
  327. package/src/strings/zh-CN.d.ts.map +1 -0
  328. package/src/strings/zh-CN.js +57 -0
  329. package/src/strings/zh-CN.js.map +1 -0
  330. package/src/template.d.ts +13 -0
  331. package/src/template.d.ts.map +1 -0
  332. package/src/template.js +40 -0
  333. package/src/template.js.map +1 -0
  334. package/src/translation-engine.d.ts +9 -0
  335. package/src/translation-engine.d.ts.map +1 -0
  336. package/src/translation-engine.js +3 -0
  337. package/src/translation-engine.js.map +1 -0
  338. package/src/translation-request.d.ts +10 -0
  339. package/src/translation-request.d.ts.map +1 -0
  340. package/src/translation-request.js +3 -0
  341. package/src/translation-request.js.map +1 -0
  342. package/src/translation-response.d.ts +9 -0
  343. package/src/translation-response.d.ts.map +1 -0
  344. package/src/translation-response.js +3 -0
  345. package/src/translation-response.js.map +1 -0
  346. package/src/types/engine.d.ts +47 -0
  347. package/src/types/engine.d.ts.map +1 -0
  348. package/src/types/engine.js +8 -0
  349. package/src/types/engine.js.map +1 -0
  350. package/src/types/{index.ts → index.d.ts} +1 -1
  351. package/src/types/index.d.ts.map +1 -0
  352. package/src/types/index.js +9 -0
  353. package/src/types/index.js.map +1 -0
  354. package/src/types/{plural-types.ts → plural-types.d.ts} +3 -29
  355. package/src/types/plural-types.d.ts.map +1 -0
  356. package/src/types/plural-types.js +39 -0
  357. package/src/types/plural-types.js.map +1 -0
  358. package/src/{types.ts → types.d.ts} +21 -72
  359. package/src/types.d.ts.map +1 -0
  360. package/src/types.js +23 -0
  361. package/src/types.js.map +1 -0
  362. package/src/utils/currency.d.ts +81 -0
  363. package/src/utils/currency.d.ts.map +1 -0
  364. package/src/utils/currency.js +99 -0
  365. package/src/utils/currency.js.map +1 -0
  366. package/src/utils/html-escape.d.ts +22 -0
  367. package/src/utils/html-escape.d.ts.map +1 -0
  368. package/src/utils/html-escape.js +53 -0
  369. package/src/utils/html-escape.js.map +1 -0
  370. package/src/utils/{index.ts → index.d.ts} +1 -0
  371. package/src/utils/index.d.ts.map +1 -0
  372. package/src/utils/index.js +12 -0
  373. package/src/utils/index.js.map +1 -0
  374. package/src/utils/lru-cache.d.ts +42 -0
  375. package/src/utils/lru-cache.d.ts.map +1 -0
  376. package/src/utils/lru-cache.js +73 -0
  377. package/src/utils/lru-cache.js.map +1 -0
  378. package/src/utils/{plural-helpers.ts → plural-helpers.d.ts} +4 -14
  379. package/src/utils/plural-helpers.d.ts.map +1 -0
  380. package/src/utils/plural-helpers.js +35 -0
  381. package/src/utils/plural-helpers.js.map +1 -0
  382. package/src/utils/safe-object.d.ts +39 -0
  383. package/src/utils/safe-object.d.ts.map +1 -0
  384. package/src/utils/{safe-object.ts → safe-object.js} +34 -37
  385. package/src/utils/safe-object.js.map +1 -0
  386. package/src/utils/string-utils.d.ts +28 -0
  387. package/src/utils/string-utils.d.ts.map +1 -0
  388. package/src/utils/string-utils.js +63 -0
  389. package/src/utils/string-utils.js.map +1 -0
  390. package/src/utils/timezone.d.ts +50 -0
  391. package/src/utils/timezone.d.ts.map +1 -0
  392. package/src/utils/timezone.js +74 -0
  393. package/src/utils/timezone.js.map +1 -0
  394. package/src/utils/validation.d.ts +40 -0
  395. package/src/utils/validation.d.ts.map +1 -0
  396. package/src/utils/validation.js +69 -0
  397. package/src/utils/validation.js.map +1 -0
  398. package/src/utils.d.ts +65 -0
  399. package/src/utils.d.ts.map +1 -0
  400. package/src/utils.js +129 -0
  401. package/src/utils.js.map +1 -0
  402. package/src/validation/{index.ts → index.d.ts} +1 -0
  403. package/src/validation/index.d.ts.map +1 -0
  404. package/src/validation/index.js +5 -0
  405. package/src/validation/index.js.map +1 -0
  406. package/src/validation/plural-validator.d.ts +46 -0
  407. package/src/validation/plural-validator.d.ts.map +1 -0
  408. package/src/validation/plural-validator.js +123 -0
  409. package/src/validation/plural-validator.js.map +1 -0
  410. package/src/validation-config.d.ts +12 -0
  411. package/src/validation-config.d.ts.map +1 -0
  412. package/src/validation-config.js +3 -0
  413. package/src/validation-config.js.map +1 -0
  414. package/src/validation-result.d.ts +13 -0
  415. package/src/validation-result.d.ts.map +1 -0
  416. package/src/validation-result.js +3 -0
  417. package/src/validation-result.js.map +1 -0
  418. package/LICENSE +0 -21
  419. package/src/builders/i18n-builder.ts +0 -82
  420. package/src/component-definition.ts +0 -11
  421. package/src/component-registration.ts +0 -29
  422. package/src/component-registry.ts +0 -432
  423. package/src/context-error-type.ts +0 -7
  424. package/src/core/component-store.ts +0 -241
  425. package/src/core/context-manager.ts +0 -113
  426. package/src/core/enum-registry.ts +0 -106
  427. package/src/core/i18n-engine.ts +0 -710
  428. package/src/core/language-registry.ts +0 -345
  429. package/src/core-i18n.ts +0 -270
  430. package/src/core-plugin-factory.ts +0 -111
  431. package/src/core-string-key.ts +0 -59
  432. package/src/create-translation-adapter.ts +0 -93
  433. package/src/enum-registry.ts +0 -152
  434. package/src/errors/context-error.ts +0 -122
  435. package/src/errors/enhanced-error-base.ts +0 -260
  436. package/src/errors/handleable.ts +0 -152
  437. package/src/errors/i18n-error.ts +0 -494
  438. package/src/errors/simple-typed-error.ts +0 -81
  439. package/src/errors/translatable-generic.ts +0 -245
  440. package/src/errors/translatable-handleable-generic.ts +0 -222
  441. package/src/errors/translatable.ts +0 -138
  442. package/src/errors/typed-handleable.ts +0 -138
  443. package/src/errors/typed.ts +0 -617
  444. package/src/gender/gender-resolver.ts +0 -40
  445. package/src/global-active-context.ts +0 -266
  446. package/src/icu/ast.ts +0 -56
  447. package/src/icu/compiler.ts +0 -96
  448. package/src/icu/formatter-registry.ts +0 -36
  449. package/src/icu/formatters/base-formatter.ts +0 -8
  450. package/src/icu/formatters/date-formatter.ts +0 -30
  451. package/src/icu/formatters/number-formatter.ts +0 -32
  452. package/src/icu/formatters/plural-formatter.ts +0 -12
  453. package/src/icu/formatters/select-formatter.ts +0 -7
  454. package/src/icu/formatters/selectordinal-formatter.ts +0 -17
  455. package/src/icu/formatters/time-formatter.ts +0 -30
  456. package/src/icu/helpers.ts +0 -34
  457. package/src/icu/parser.ts +0 -242
  458. package/src/icu/runtime.ts +0 -37
  459. package/src/icu/tokenizer.ts +0 -212
  460. package/src/icu/validator.ts +0 -163
  461. package/src/interfaces/active-context.interface.ts +0 -41
  462. package/src/interfaces/component-config.interface.ts +0 -17
  463. package/src/interfaces/engine-config.interface.ts +0 -22
  464. package/src/interfaces/global-active-context.ts +0 -39
  465. package/src/interfaces/handleable-error-options.ts +0 -13
  466. package/src/interfaces/handleable.ts +0 -20
  467. package/src/interfaces/i18n-engine.interface.ts +0 -57
  468. package/src/interfaces/language-definition.interface.ts +0 -17
  469. package/src/interfaces/translation-options.interface.ts +0 -15
  470. package/src/interfaces/validation-result.interface.ts +0 -24
  471. package/src/language-codes.ts +0 -40
  472. package/src/language-definition.ts +0 -13
  473. package/src/plugin-i18n-engine.ts +0 -707
  474. package/src/pluralization/language-plural-map.ts +0 -186
  475. package/src/pluralization/plural-rules.ts +0 -228
  476. package/src/registry-config.ts +0 -16
  477. package/src/registry-error-type.ts +0 -19
  478. package/src/registry-error.ts +0 -100
  479. package/src/strict-types.ts +0 -35
  480. package/src/strings/de.ts +0 -75
  481. package/src/strings/en-GB.ts +0 -74
  482. package/src/strings/en-US.ts +0 -74
  483. package/src/strings/es.ts +0 -74
  484. package/src/strings/fr.ts +0 -75
  485. package/src/strings/ja.ts +0 -73
  486. package/src/strings/uk.ts +0 -73
  487. package/src/strings/zh-CN.ts +0 -72
  488. package/src/template.ts +0 -72
  489. package/src/translation-engine.ts +0 -18
  490. package/src/translation-request.ts +0 -12
  491. package/src/translation-response.ts +0 -8
  492. package/src/types/engine.ts +0 -55
  493. package/src/utils/currency.ts +0 -141
  494. package/src/utils/html-escape.ts +0 -55
  495. package/src/utils/lru-cache.ts +0 -76
  496. package/src/utils/string-utils.ts +0 -77
  497. package/src/utils/timezone.ts +0 -76
  498. package/src/utils/validation.ts +0 -66
  499. package/src/utils.ts +0 -215
  500. package/src/validation/plural-validator.ts +0 -168
  501. package/src/validation-config.ts +0 -11
  502. package/src/validation-result.ts +0 -12
@@ -0,0 +1,83 @@
1
+ import { IHandleable } from '../interfaces/handleable';
2
+ import { HandleableErrorOptions } from '../interfaces/handleable-error-options';
3
+ /**
4
+ * Base error class that implements IHandleable interface with full i18n support.
5
+ *
6
+ * Provides enhanced error handling capabilities including status codes, handled state tracking,
7
+ * and source data preservation. Fully compatible with all i18n features when used with
8
+ * translation strings.
9
+ *
10
+ * **Supported i18n Features** (via translation strings in derived classes):
11
+ * - ICU MessageFormat: plural, select, selectordinal
12
+ * - Pluralization: 37 languages with CLDR rules
13
+ * - Gender support: male, female, neutral, other
14
+ * - Number formatting: integer, currency, percent
15
+ * - Nested messages: complex patterns
16
+ *
17
+ * **Usage Pattern:**
18
+ * ```typescript
19
+ * // Extend HandleableError with translated messages
20
+ * class MyHandleableError extends HandleableError {
21
+ * constructor(componentId: string, stringKey: string, variables?: Record<string, any>) {
22
+ * const engine = I18nEngine.getInstance();
23
+ * const message = engine.translate(componentId, stringKey, variables);
24
+ * const error = new Error(message);
25
+ * super(error, { statusCode: 400 });
26
+ * }
27
+ * }
28
+ *
29
+ * // Register translation with ICU features
30
+ * engine.registerComponent({
31
+ * component: { id: 'api', stringKeys: ['validationError'] },
32
+ * strings: {
33
+ * 'en-US': {
34
+ * validationError: \"{count, plural, one {# field is invalid} other {# fields are invalid}}\"
35
+ * }
36
+ * }
37
+ * });
38
+ *
39
+ * // Use with i18n features
40
+ * throw new MyHandleableError('api', 'validationError', { count: 3 });
41
+ * // Result: \"3 fields are invalid\"
42
+ * ```
43
+ */
44
+ export declare class HandleableError extends Error implements IHandleable {
45
+ /** The original error that caused this error */
46
+ readonly cause?: Error;
47
+ /** HTTP status code associated with this error */
48
+ readonly statusCode: number;
49
+ /** Optional source data related to the error */
50
+ readonly sourceData?: unknown;
51
+ /** Internal tracking of whether this error has been handled */
52
+ private _handled;
53
+ /**
54
+ * Creates a new HandleableError instance.
55
+ * @param source - The original error being wrapped
56
+ * @param options - Optional configuration for the error
57
+ */
58
+ constructor(source: Error, options?: HandleableErrorOptions);
59
+ /**
60
+ * Gets the handled state of this error.
61
+ * @returns True if the error has been handled, false otherwise
62
+ */
63
+ get handled(): boolean;
64
+ /**
65
+ * Sets the handled state of this error.
66
+ * @param value - The new handled state
67
+ */
68
+ set handled(value: boolean);
69
+ /**
70
+ * Serializes a value to a JSON-compatible format.
71
+ * Handles objects with toJSON methods, Error instances, arrays, and plain objects.
72
+ * @param value - The value to serialize
73
+ * @returns The serialized value
74
+ */
75
+ private serializeValue;
76
+ /**
77
+ * Converts the error to a JSON-serializable object.
78
+ * Includes name, message, status code, handled state, stack trace, and optional source data.
79
+ * @returns A plain object representation of the error
80
+ */
81
+ toJSON(): Record<string, unknown>;
82
+ }
83
+ //# sourceMappingURL=handleable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handleable.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-i18n-lib/src/errors/handleable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAShF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,qBAAa,eAAgB,SAAQ,KAAM,YAAW,WAAW;IAC/D,gDAAgD;IAChD,SAAyB,KAAK,CAAC,EAAE,KAAK,CAAC;IACvC,kDAAkD;IAClD,SAAgB,UAAU,EAAE,MAAM,CAAC;IACnC,gDAAgD;IAChD,SAAgB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrC,+DAA+D;IAC/D,OAAO,CAAC,QAAQ,CAAU;IAE1B;;;;OAIG;gBACS,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,sBAAsB;IAsB3D;;;OAGG;IACH,IAAW,OAAO,IAAI,OAAO,CAE5B;IAED;;;OAGG;IACH,IAAW,OAAO,CAAC,KAAK,EAAE,OAAO,EAEhC;IAED;;;;;OAKG;IACH,OAAO,CAAC,cAAc;IAuBtB;;;;OAIG;IACI,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAazC"}
@@ -0,0 +1,136 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HandleableError = void 0;
4
+ /**
5
+ * Base error class that implements IHandleable interface with full i18n support.
6
+ *
7
+ * Provides enhanced error handling capabilities including status codes, handled state tracking,
8
+ * and source data preservation. Fully compatible with all i18n features when used with
9
+ * translation strings.
10
+ *
11
+ * **Supported i18n Features** (via translation strings in derived classes):
12
+ * - ICU MessageFormat: plural, select, selectordinal
13
+ * - Pluralization: 37 languages with CLDR rules
14
+ * - Gender support: male, female, neutral, other
15
+ * - Number formatting: integer, currency, percent
16
+ * - Nested messages: complex patterns
17
+ *
18
+ * **Usage Pattern:**
19
+ * ```typescript
20
+ * // Extend HandleableError with translated messages
21
+ * class MyHandleableError extends HandleableError {
22
+ * constructor(componentId: string, stringKey: string, variables?: Record<string, any>) {
23
+ * const engine = I18nEngine.getInstance();
24
+ * const message = engine.translate(componentId, stringKey, variables);
25
+ * const error = new Error(message);
26
+ * super(error, { statusCode: 400 });
27
+ * }
28
+ * }
29
+ *
30
+ * // Register translation with ICU features
31
+ * engine.registerComponent({
32
+ * component: { id: 'api', stringKeys: ['validationError'] },
33
+ * strings: {
34
+ * 'en-US': {
35
+ * validationError: \"{count, plural, one {# field is invalid} other {# fields are invalid}}\"
36
+ * }
37
+ * }
38
+ * });
39
+ *
40
+ * // Use with i18n features
41
+ * throw new MyHandleableError('api', 'validationError', { count: 3 });
42
+ * // Result: \"3 fields are invalid\"
43
+ * ```
44
+ */
45
+ class HandleableError extends Error {
46
+ /** The original error that caused this error */
47
+ cause;
48
+ /** HTTP status code associated with this error */
49
+ statusCode;
50
+ /** Optional source data related to the error */
51
+ sourceData;
52
+ /** Internal tracking of whether this error has been handled */
53
+ _handled;
54
+ /**
55
+ * Creates a new HandleableError instance.
56
+ * @param source - The original error being wrapped
57
+ * @param options - Optional configuration for the error
58
+ */
59
+ constructor(source, options) {
60
+ super(source.message);
61
+ this.name = this.constructor.name;
62
+ this.cause = options?.cause ?? source;
63
+ this.statusCode = options?.statusCode ?? 500;
64
+ this._handled = options?.handled ?? false;
65
+ this.sourceData = options?.sourceData;
66
+ this.name = 'HandleableError';
67
+ // Capture stack trace - prioritize source stack, then capture new one
68
+ if (source.stack) {
69
+ this.stack = source.stack;
70
+ }
71
+ else if (Error.captureStackTrace) {
72
+ Error.captureStackTrace?.(this, this.constructor);
73
+ }
74
+ else {
75
+ this.stack = new Error().stack;
76
+ }
77
+ }
78
+ /**
79
+ * Gets the handled state of this error.
80
+ * @returns True if the error has been handled, false otherwise
81
+ */
82
+ get handled() {
83
+ return this._handled;
84
+ }
85
+ /**
86
+ * Sets the handled state of this error.
87
+ * @param value - The new handled state
88
+ */
89
+ set handled(value) {
90
+ this._handled = value;
91
+ }
92
+ /**
93
+ * Serializes a value to a JSON-compatible format.
94
+ * Handles objects with toJSON methods, Error instances, arrays, and plain objects.
95
+ * @param value - The value to serialize
96
+ * @returns The serialized value
97
+ */
98
+ serializeValue(value) {
99
+ if (value &&
100
+ typeof value === 'object' &&
101
+ 'toJSON' in value &&
102
+ typeof value.toJSON === 'function') {
103
+ return value.toJSON();
104
+ }
105
+ if (value instanceof Error) {
106
+ return value.message;
107
+ }
108
+ if (Array.isArray(value)) {
109
+ return value.map((item) => this.serializeValue(item));
110
+ }
111
+ if (value && typeof value === 'object') {
112
+ return Object.fromEntries(Object.entries(value).map(([k, v]) => [k, this.serializeValue(v)]));
113
+ }
114
+ return value;
115
+ }
116
+ /**
117
+ * Converts the error to a JSON-serializable object.
118
+ * Includes name, message, status code, handled state, stack trace, and optional source data.
119
+ * @returns A plain object representation of the error
120
+ */
121
+ toJSON() {
122
+ return {
123
+ name: this.name,
124
+ message: this.message,
125
+ statusCode: this.statusCode,
126
+ handled: this.handled,
127
+ stack: this.stack,
128
+ cause: this.serializeValue(this.cause),
129
+ ...(this.sourceData
130
+ ? { sourceData: this.serializeValue(this.sourceData) }
131
+ : {}),
132
+ };
133
+ }
134
+ }
135
+ exports.HandleableError = HandleableError;
136
+ //# sourceMappingURL=handleable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handleable.js","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-i18n-lib/src/errors/handleable.ts"],"names":[],"mappings":";;;AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,MAAa,eAAgB,SAAQ,KAAK;IACxC,gDAAgD;IACvB,KAAK,CAAS;IACvC,kDAAkD;IAClC,UAAU,CAAS;IACnC,gDAAgD;IAChC,UAAU,CAAW;IACrC,+DAA+D;IACvD,QAAQ,CAAU;IAE1B;;;;OAIG;IACH,YAAY,MAAa,EAAE,OAAgC;QACzD,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;QAClC,IAAI,CAAC,KAAK,GAAG,OAAO,EAAE,KAAK,IAAI,MAAM,CAAC;QACtC,IAAI,CAAC,UAAU,GAAG,OAAO,EAAE,UAAU,IAAI,GAAG,CAAC;QAC7C,IAAI,CAAC,QAAQ,GAAG,OAAO,EAAE,OAAO,IAAI,KAAK,CAAC;QAC1C,IAAI,CAAC,UAAU,GAAG,OAAO,EAAE,UAAU,CAAC;QACtC,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;QAE9B,sEAAsE;QACtE,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;YACjB,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAC5B,CAAC;aAAM,IAAK,KAAmC,CAAC,iBAAiB,EAAE,CA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;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,KAAK,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC;YACtC,GAAG,CAAC,IAAI,CAAC,UAAU;gBACjB,CAAC,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE;gBACtD,CAAC,CAAC,EAAE,CAAC;SACR,CAAC;IACJ,CAAC;CACF;AApGD,0CAoGC"}
@@ -0,0 +1,211 @@
1
+ /**
2
+ * Unified error class for i18n library with ICU MessageFormat support
3
+ */
4
+ /**
5
+ * Error codes used throughout the i18n library.
6
+ */
7
+ export declare const I18nErrorCode: {
8
+ /** Component not found in registry */
9
+ readonly COMPONENT_NOT_FOUND: "COMPONENT_NOT_FOUND";
10
+ /** String key not found in component */
11
+ readonly STRING_KEY_NOT_FOUND: "STRING_KEY_NOT_FOUND";
12
+ /** Language not found in registry */
13
+ readonly LANGUAGE_NOT_FOUND: "LANGUAGE_NOT_FOUND";
14
+ /** Translation missing for specified key and language */
15
+ readonly TRANSLATION_MISSING: "TRANSLATION_MISSING";
16
+ /** Invalid configuration provided */
17
+ readonly INVALID_CONFIG: "INVALID_CONFIG";
18
+ /** Attempt to register duplicate component */
19
+ readonly DUPLICATE_COMPONENT: "DUPLICATE_COMPONENT";
20
+ /** Attempt to register duplicate language */
21
+ readonly DUPLICATE_LANGUAGE: "DUPLICATE_LANGUAGE";
22
+ /** Validation failed during registration */
23
+ readonly VALIDATION_FAILED: "VALIDATION_FAILED";
24
+ /** I18n instance not found */
25
+ readonly INSTANCE_NOT_FOUND: "INSTANCE_NOT_FOUND";
26
+ /** I18n instance already exists */
27
+ readonly INSTANCE_EXISTS: "INSTANCE_EXISTS";
28
+ /** Invalid context key provided */
29
+ readonly INVALID_CONTEXT: "INVALID_CONTEXT";
30
+ /** Plural form not found for language and category */
31
+ readonly PLURAL_FORM_NOT_FOUND: "PLURAL_FORM_NOT_FOUND";
32
+ /** Invalid plural category provided */
33
+ readonly INVALID_PLURAL_CATEGORY: "INVALID_PLURAL_CATEGORY";
34
+ /** Count variable missing for plural translation */
35
+ readonly MISSING_COUNT_VARIABLE: "MISSING_COUNT_VARIABLE";
36
+ /** Validation threshold exceeded */
37
+ readonly VALIDATION_THRESHOLD_EXCEEDED: "VALIDATION_THRESHOLD_EXCEEDED";
38
+ /** Operation failed at specific step */
39
+ readonly OPERATION_STEP_FAILED: "OPERATION_STEP_FAILED";
40
+ /** Rate limit exceeded */
41
+ readonly RATE_LIMIT_EXCEEDED: "RATE_LIMIT_EXCEEDED";
42
+ /** Nested validation error with context */
43
+ readonly NESTED_VALIDATION_ERROR: "NESTED_VALIDATION_ERROR";
44
+ };
45
+ /**
46
+ * Type representing all possible i18n error codes.
47
+ */
48
+ export type I18nErrorCode = (typeof I18nErrorCode)[keyof typeof I18nErrorCode];
49
+ /**
50
+ * Main error class for i18n-related errors.
51
+ * Includes error code and optional metadata for debugging.
52
+ */
53
+ export declare class I18nError extends Error {
54
+ readonly code: I18nErrorCode;
55
+ readonly metadata?: Record<string, any> | undefined;
56
+ /**
57
+ * Creates a new I18nError instance.
58
+ * @param code - The specific error code
59
+ * @param message - Human-readable error message
60
+ * @param metadata - Optional metadata providing context about the error
61
+ */
62
+ constructor(code: I18nErrorCode, message: string, metadata?: Record<string, any> | undefined);
63
+ /**
64
+ * Creates an error for when a component is not found with nested ICU select formatting.
65
+ * @param componentId - The ID of the component that was not found
66
+ * @param language - Optional language code for message formatting
67
+ * @returns An I18nError instance
68
+ */
69
+ static componentNotFound(componentId: string, language?: string): I18nError;
70
+ /**
71
+ * Creates an error for when a string key is not found in a component with nested ICU formatting.
72
+ * @param componentId - The ID of the component
73
+ * @param stringKey - The string key that was not found
74
+ * @param language - Optional language code for message formatting
75
+ * @returns An I18nError instance
76
+ */
77
+ static stringKeyNotFound(componentId: string, stringKey: string, language?: string): I18nError;
78
+ /**
79
+ * Creates an error for when a language is not found with ICU formatting.
80
+ * @param language - The language code that was not found
81
+ * @param messageLanguage - Optional language code for error message formatting
82
+ * @returns An I18nError instance
83
+ */
84
+ static languageNotFound(language: string, messageLanguage?: string): I18nError;
85
+ /**
86
+ * Creates an error for when a translation is missing with nested ICU formatting.
87
+ * @param componentId - The ID of the component
88
+ * @param stringKey - The string key
89
+ * @param language - The language code where translation is missing
90
+ * @param messageLanguage - Optional language code for error message formatting
91
+ * @returns An I18nError instance
92
+ */
93
+ static translationMissing(componentId: string, stringKey: string, language: string, messageLanguage?: string): I18nError;
94
+ /**
95
+ * Creates an error for invalid configuration.
96
+ * @param reason - The reason why the configuration is invalid
97
+ * @returns An I18nError instance
98
+ */
99
+ static invalidConfig(reason: string): I18nError;
100
+ /**
101
+ * Creates an error for duplicate component registration with nested ICU select formatting.
102
+ * @param componentId - The ID of the duplicate component
103
+ * @param language - Optional language code for message formatting
104
+ * @returns An I18nError instance
105
+ */
106
+ static duplicateComponent(componentId: string, language?: string): I18nError;
107
+ /**
108
+ * Creates an error for duplicate language registration with ICU formatting.
109
+ * @param language - The language code that is duplicate
110
+ * @param messageLanguage - Optional language code for error message formatting
111
+ * @returns An I18nError instance
112
+ */
113
+ static duplicateLanguage(language: string, messageLanguage?: string): I18nError;
114
+ /**
115
+ * Creates an error for validation failure with ICU plural formatting and number formatting.
116
+ * @param errors - Array of validation error messages
117
+ * @param language - Optional language code for message formatting
118
+ * @returns An I18nError instance
119
+ */
120
+ static validationFailed(errors: string[], language?: string): I18nError;
121
+ /**
122
+ * Creates an error for when an i18n instance is not found with nested ICU select formatting.
123
+ * @param key - The instance key that was not found
124
+ * @param language - Optional language code for message formatting
125
+ * @returns An I18nError instance
126
+ */
127
+ static instanceNotFound(key: string, language?: string): I18nError;
128
+ /**
129
+ * Creates an error for when an i18n instance already exists with nested ICU select formatting.
130
+ * @param key - The instance key that already exists
131
+ * @param language - Optional language code for message formatting
132
+ * @returns An I18nError instance
133
+ */
134
+ static instanceExists(key: string, language?: string): I18nError;
135
+ /**
136
+ * Creates an error for an invalid context key with ICU formatting.
137
+ * @param contextKey - The invalid context key
138
+ * @param language - Optional language code for message formatting
139
+ * @returns An I18nError instance
140
+ */
141
+ static invalidContext(contextKey: string, language?: string): I18nError;
142
+ /**
143
+ * Creates an error for when a plural form is not found with nested ICU select and plural formatting.
144
+ * @param category - The plural category that was not found
145
+ * @param language - The language code
146
+ * @param key - The translation key
147
+ * @param availableForms - Array of available plural forms
148
+ * @returns An I18nError instance
149
+ */
150
+ static pluralFormNotFound(category: string, language: string, key: string, availableForms: string[]): I18nError;
151
+ /**
152
+ * Creates an error for an invalid plural category with nested ICU plural and number formatting.
153
+ * @param category - The invalid category
154
+ * @param validCategories - Array of valid categories
155
+ * @param language - Optional language code for message formatting
156
+ * @returns An I18nError instance
157
+ */
158
+ static invalidPluralCategory(category: string, validCategories: string[], language?: string): I18nError;
159
+ /**
160
+ * Creates an error for when the count variable is missing for plural forms with ICU formatting.
161
+ * @param key - The translation key that requires a count variable
162
+ * @param language - Optional language code for message formatting
163
+ * @returns An I18nError instance
164
+ */
165
+ static missingCountVariable(key: string, language?: string): I18nError;
166
+ /**
167
+ * Creates an error for validation threshold violations with ICU number formatting.
168
+ * Demonstrates currency, percent, and integer formatting based on threshold type.
169
+ * @param fieldName - The field that exceeded the threshold
170
+ * @param value - The actual value
171
+ * @param threshold - The maximum allowed value
172
+ * @param thresholdType - Type of threshold: 'currency', 'percent', or 'integer'
173
+ * @param language - Optional language code for message formatting
174
+ * @returns An I18nError instance
175
+ */
176
+ static validationThresholdExceeded(fieldName: string, value: number, threshold: number, thresholdType?: 'currency' | 'percent' | 'integer', language?: string): I18nError;
177
+ /**
178
+ * Creates an error for operation failures at specific steps with ICU selectordinal formatting.
179
+ * Demonstrates 1st, 2nd, 3rd, etc. formatting for step numbers.
180
+ * @param stepNumber - The step number where the operation failed (1-based)
181
+ * @param operationName - The name of the operation
182
+ * @param reason - The reason for failure
183
+ * @param language - Optional language code for message formatting
184
+ * @returns An I18nError instance
185
+ */
186
+ static operationStepFailed(stepNumber: number, operationName: string, reason: string, language?: string): I18nError;
187
+ /**
188
+ * Creates an error for rate limit violations with nested ICU messages.
189
+ * Demonstrates nested plural, number formatting, and conditional messages.
190
+ * @param requestCount - Number of requests made
191
+ * @param limit - Maximum allowed requests
192
+ * @param windowSeconds - Time window in seconds
193
+ * @param retryAfterSeconds - Seconds until retry is allowed
194
+ * @param language - Optional language code for message formatting
195
+ * @returns An I18nError instance
196
+ */
197
+ static rateLimitExceeded(requestCount: number, limit: number, windowSeconds: number, retryAfterSeconds: number, language?: string): I18nError;
198
+ /**
199
+ * Creates a nested validation error with multiple layers of context.
200
+ * Demonstrates 4-level deep nested ICU messages with plural, select, and number formatting.
201
+ * @param componentId - The component being validated
202
+ * @param fieldPath - Nested field path (e.g., 'user.profile.settings.theme')
203
+ * @param errorCount - Number of errors found
204
+ * @param errorType - Type of validation error
205
+ * @param severity - Error severity level
206
+ * @param language - Optional language code for message formatting
207
+ * @returns An I18nError instance
208
+ */
209
+ static nestedValidationError(componentId: string, fieldPath: string, errorCount: number, errorType: 'type' | 'range' | 'format' | 'required', severity: 'low' | 'medium' | 'high' | 'critical', language?: string): I18nError;
210
+ }
211
+ //# sourceMappingURL=i18n-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i18n-error.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-i18n-lib/src/errors/i18n-error.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;GAEG;AACH,eAAO,MAAM,aAAa;IACxB,sCAAsC;;IAEtC,wCAAwC;;IAExC,qCAAqC;;IAErC,yDAAyD;;IAEzD,qCAAqC;;IAErC,8CAA8C;;IAE9C,6CAA6C;;IAE7C,4CAA4C;;IAE5C,8BAA8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