@kosdev-code/kos-ui-sdk 3.0.26 → 3.0.27

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 (339) hide show
  1. package/.kos.json +2 -1
  2. package/common/events/async-event-bus.d.ts +8 -11
  3. package/common/events/async-event-bus.d.ts.map +1 -1
  4. package/common/events/eventBus.d.ts +1 -18
  5. package/common/events/eventBus.d.ts.map +1 -1
  6. package/core/core/companion-instantiator.d.ts +5 -0
  7. package/core/core/companion-instantiator.d.ts.map +1 -1
  8. package/core/core/decorators/index.d.ts +1 -0
  9. package/core/core/decorators/index.d.ts.map +1 -1
  10. package/core/core/decorators/kos-child.d.ts +2 -3
  11. package/core/core/decorators/kos-child.d.ts.map +1 -1
  12. package/core/core/decorators/kos-companion.d.ts +25 -87
  13. package/core/core/decorators/kos-companion.d.ts.map +1 -1
  14. package/core/core/decorators/kos-container-aware-reconcile.test-d.d.ts +2 -0
  15. package/core/core/decorators/kos-container-aware-reconcile.test-d.d.ts.map +1 -0
  16. package/core/core/decorators/kos-container-aware.d.ts +191 -420
  17. package/core/core/decorators/kos-container-aware.d.ts.map +1 -1
  18. package/core/core/decorators/kos-execute-service-request.d.ts +7 -11
  19. package/core/core/decorators/kos-execute-service-request.d.ts.map +1 -1
  20. package/core/core/decorators/kos-execution-context.d.ts +14 -31
  21. package/core/core/decorators/kos-execution-context.d.ts.map +1 -1
  22. package/core/core/decorators/kos-future-aware.d.ts +21 -74
  23. package/core/core/decorators/kos-future-aware.d.ts.map +1 -1
  24. package/core/core/decorators/kos-http-decorators.d.ts +18 -62
  25. package/core/core/decorators/kos-http-decorators.d.ts.map +1 -1
  26. package/core/core/decorators/kos-logger-aware.d.ts +10 -60
  27. package/core/core/decorators/kos-logger-aware.d.ts.map +1 -1
  28. package/core/core/decorators/kos-mixin.d.ts +67 -0
  29. package/core/core/decorators/kos-mixin.d.ts.map +1 -0
  30. package/core/core/decorators/kos-model-effect.d.ts +10 -9
  31. package/core/core/decorators/kos-model-effect.d.ts.map +1 -1
  32. package/core/core/decorators/kos-multiple-future-aware.d.ts +21 -94
  33. package/core/core/decorators/kos-multiple-future-aware.d.ts.map +1 -1
  34. package/core/core/decorators/kos-reload-aware.d.ts +14 -16
  35. package/core/core/decorators/kos-reload-aware.d.ts.map +1 -1
  36. package/core/core/decorators/kos-service-request.d.ts +80 -238
  37. package/core/core/decorators/kos-service-request.d.ts.map +1 -1
  38. package/core/core/decorators/kos-state-machine.d.ts +35 -275
  39. package/core/core/decorators/kos-state-machine.d.ts.map +1 -1
  40. package/core/core/decorators/kos-topic-handler-flow-control.d.ts +11 -3
  41. package/core/core/decorators/kos-topic-handler-flow-control.d.ts.map +1 -1
  42. package/core/core/decorators/kos-trouble-aware.d.ts +9 -43
  43. package/core/core/decorators/kos-trouble-aware.d.ts.map +1 -1
  44. package/core/core/decorators/kos-view-model.d.ts +20 -100
  45. package/core/core/decorators/kos-view-model.d.ts.map +1 -1
  46. package/core/core/decorators/kosModel.d.ts.map +1 -1
  47. package/core/core/decorators/kosTopicHandler.d.ts +28 -89
  48. package/core/core/decorators/kosTopicHandler.d.ts.map +1 -1
  49. package/core/core/decorators/propKeys.d.ts +1 -0
  50. package/core/core/decorators/propKeys.d.ts.map +1 -1
  51. package/core/core/indexing/index.d.ts +2 -4
  52. package/core/core/indexing/index.d.ts.map +1 -1
  53. package/core/core/indexing/kos-container-index-aware.d.ts +17 -48
  54. package/core/core/indexing/kos-container-index-aware.d.ts.map +1 -1
  55. package/core/core/indexing/kos-index-aware.d.ts +11 -37
  56. package/core/core/indexing/kos-index-aware.d.ts.map +1 -1
  57. package/core/core/kos-container-index.d.ts +11 -0
  58. package/core/core/kos-container-index.d.ts.map +1 -1
  59. package/core/core/kos-container-model.d.ts +11 -32
  60. package/core/core/kos-container-model.d.ts.map +1 -1
  61. package/core/core/kos-data-container.d.ts +6 -6
  62. package/core/core/kos-data-container.d.ts.map +1 -1
  63. package/core/core/kosCore.d.ts +7 -4
  64. package/core/core/kosCore.d.ts.map +1 -1
  65. package/core/core/kosModel.d.ts +16 -8
  66. package/core/core/kosModel.d.ts.map +1 -1
  67. package/core/core/kosModelManager.d.ts +2 -3
  68. package/core/core/kosModelManager.d.ts.map +1 -1
  69. package/core/core/lifecycle/constants.d.ts +6 -2
  70. package/core/core/lifecycle/constants.d.ts.map +1 -1
  71. package/core/core/lifecycle/kosCoreLifecycle.d.ts +11 -1
  72. package/core/core/lifecycle/kosCoreLifecycle.d.ts.map +1 -1
  73. package/core/core/lifecycle/kosModelLifecycle.d.ts +6 -0
  74. package/core/core/lifecycle/kosModelLifecycle.d.ts.map +1 -1
  75. package/core/core/lifecycle/model-machine.d.ts +6 -0
  76. package/core/core/lifecycle/model-machine.d.ts.map +1 -1
  77. package/core/core/model/kos-fsm-manager.d.ts +6 -0
  78. package/core/core/model/kos-fsm-manager.d.ts.map +1 -1
  79. package/core/core/model/kos-offline-queue.d.ts +1 -1
  80. package/core/core/model/kos-subscription-manager.d.ts.map +1 -1
  81. package/core/core/model/service-response-store.d.ts +2 -15
  82. package/core/core/model/service-response-store.d.ts.map +1 -1
  83. package/core/core/reconnect/reconnect-fixture.d.ts +17 -0
  84. package/core/core/reconnect/reconnect-fixture.d.ts.map +1 -0
  85. package/core/core/registration/model-registration.d.ts.map +1 -1
  86. package/core/core/services/app-startup-service.d.ts +5 -13
  87. package/core/core/services/app-startup-service.d.ts.map +1 -1
  88. package/core/core/services/intent-service.d.ts +3 -12
  89. package/core/core/services/intent-service.d.ts.map +1 -1
  90. package/core/core/transport/mock/mock-frames.d.ts +3 -3
  91. package/core/core/transport/transport.d.ts +1 -1
  92. package/core/core/transport/transport.d.ts.map +1 -1
  93. package/core/core/transport/webSocketTransport.d.ts +10 -0
  94. package/core/core/transport/webSocketTransport.d.ts.map +1 -1
  95. package/core/types/model.d.ts +4 -8
  96. package/core/types/model.d.ts.map +1 -1
  97. package/core/types/service-response-store.d.ts +3 -11
  98. package/core/types/service-response-store.d.ts.map +1 -1
  99. package/core/types/utils/kos-fetch.d.ts +25 -37
  100. package/core/types/utils/kos-fetch.d.ts.map +1 -1
  101. package/core/util/abortable-when.d.ts +5 -6
  102. package/core/util/abortable-when.d.ts.map +1 -1
  103. package/core/util/ancestor-path-visitor.d.ts +14 -20
  104. package/core/util/ancestor-path-visitor.d.ts.map +1 -1
  105. package/core/util/container-utils.d.ts +26 -159
  106. package/core/util/container-utils.d.ts.map +1 -1
  107. package/core/util/date-utils.d.ts +9 -58
  108. package/core/util/date-utils.d.ts.map +1 -1
  109. package/core/util/debounce.d.ts +1 -8
  110. package/core/util/debounce.d.ts.map +1 -1
  111. package/core/util/kos-fetch.d.ts +1 -1
  112. package/core/util/kos-fetch.d.ts.map +1 -1
  113. package/core/util/kos-model-utils.d.ts +10 -11
  114. package/core/util/kos-model-utils.d.ts.map +1 -1
  115. package/core/util/model-attribute-utils.d.ts +5 -22
  116. package/core/util/model-attribute-utils.d.ts.map +1 -1
  117. package/core/util/model-type-guards.d.ts.map +1 -1
  118. package/core/util/promise-utils.d.ts +1 -26
  119. package/core/util/promise-utils.d.ts.map +1 -1
  120. package/core/util/service-factory.d.ts +5 -23
  121. package/core/util/service-factory.d.ts.map +1 -1
  122. package/core/util/service-request-error.d.ts +3 -5
  123. package/core/util/service-request-error.d.ts.map +1 -1
  124. package/core/util/service-response.d.ts +12 -67
  125. package/core/util/service-response.d.ts.map +1 -1
  126. package/core/util/transport-not-ready-error.d.ts +11 -13
  127. package/core/util/transport-not-ready-error.d.ts.map +1 -1
  128. package/core/util/when-ready.d.ts +1 -8
  129. package/core/util/when-ready.d.ts.map +1 -1
  130. package/index.cjs +692 -11760
  131. package/index.cjs.map +1 -1
  132. package/index.js +774 -11846
  133. package/index.js.map +1 -1
  134. package/models/decorators/future-service.d.ts +7 -7
  135. package/models/models/browser-router/browser-router-model.d.ts +10 -39
  136. package/models/models/browser-router/browser-router-model.d.ts.map +1 -1
  137. package/models/models/browser-router/browser-router-registration.d.ts +5 -77
  138. package/models/models/browser-router/browser-router-registration.d.ts.map +1 -1
  139. package/models/models/browser-router/types/index.d.ts +2 -16
  140. package/models/models/canvas-dispatcher/canvas-dispatcher-registration.d.ts +5 -77
  141. package/models/models/canvas-dispatcher/canvas-dispatcher-registration.d.ts.map +1 -1
  142. package/models/models/canvas-renderer/canvas-renderer-registration.d.ts +5 -75
  143. package/models/models/canvas-renderer/canvas-renderer-registration.d.ts.map +1 -1
  144. package/models/models/config-bean/config-bean-model-builder.d.ts +4 -11
  145. package/models/models/config-bean/config-bean-model-builder.d.ts.map +1 -1
  146. package/models/models/config-bean/config-bean-model.d.ts +23 -66
  147. package/models/models/config-bean/config-bean-model.d.ts.map +1 -1
  148. package/models/models/config-bean-prop/config-bean-prop-model.d.ts +15 -62
  149. package/models/models/config-bean-prop/config-bean-prop-model.d.ts.map +1 -1
  150. package/models/models/config-bean-prop/types/index.d.ts +34 -215
  151. package/models/models/device/device-model.d.ts +20 -199
  152. package/models/models/device/device-model.d.ts.map +1 -1
  153. package/models/models/device/device-registration.d.ts +7 -87
  154. package/models/models/device/device-registration.d.ts.map +1 -1
  155. package/models/models/device/types/index.d.ts +5 -34
  156. package/models/models/future/future-aware.d.ts +7 -71
  157. package/models/models/future/future-aware.d.ts.map +1 -1
  158. package/models/models/future/future-model-builder.d.ts +2 -2
  159. package/models/models/future/future-model.d.ts +3 -23
  160. package/models/models/future/future-model.d.ts.map +1 -1
  161. package/models/models/future/future-types.d.ts +28 -145
  162. package/models/models/future/future-types.d.ts.map +1 -1
  163. package/models/models/gpio-chip/gpio-chip-builders.d.ts +14 -0
  164. package/models/models/gpio-chip/gpio-chip-builders.d.ts.map +1 -0
  165. package/models/models/gpio-chip/gpio-chip-container-model.d.ts +2 -1
  166. package/models/models/gpio-chip/gpio-chip-container-model.d.ts.map +1 -1
  167. package/models/models/key-value/key-value-model.d.ts +12 -72
  168. package/models/models/key-value/key-value-model.d.ts.map +1 -1
  169. package/models/models/key-value/key-value-registration.d.ts +5 -77
  170. package/models/models/key-value/key-value-registration.d.ts.map +1 -1
  171. package/models/models/key-value/services/key-value-services.d.ts +13 -72
  172. package/models/models/key-value/services/key-value-services.d.ts.map +1 -1
  173. package/models/models/key-value/types/index.d.ts +3 -46
  174. package/models/models/kos-expression-evaluator/expression-parse-cache.d.ts +29 -0
  175. package/models/models/kos-expression-evaluator/expression-parse-cache.d.ts.map +1 -0
  176. package/models/models/kos-expression-evaluator/index.d.ts +1 -0
  177. package/models/models/kos-expression-evaluator/index.d.ts.map +1 -1
  178. package/models/models/kos-expression-evaluator/kos-expression-evaluator-model.d.ts +73 -105
  179. package/models/models/kos-expression-evaluator/kos-expression-evaluator-model.d.ts.map +1 -1
  180. package/models/models/kos-expression-evaluator/services/kos-expression-evaluator-services.d.ts +2 -12
  181. package/models/models/kos-expression-evaluator/services/kos-expression-evaluator-services.d.ts.map +1 -1
  182. package/models/models/kos-log-manager/kos-log-manager-model.d.ts +7 -46
  183. package/models/models/kos-log-manager/kos-log-manager-model.d.ts.map +1 -1
  184. package/models/models/kos-log-manager/kos-log-manager-registration.d.ts +5 -80
  185. package/models/models/kos-log-manager/kos-log-manager-registration.d.ts.map +1 -1
  186. package/models/models/kos-log-manager/types/index.d.ts +13 -156
  187. package/models/models/kos-time/kos-time-model.d.ts +8 -39
  188. package/models/models/kos-time/kos-time-model.d.ts.map +1 -1
  189. package/models/models/kos-time/kos-time-registration.d.ts +6 -73
  190. package/models/models/kos-time/kos-time-registration.d.ts.map +1 -1
  191. package/models/models/kos-time/types/index.d.ts +3 -58
  192. package/models/models/log-block/log-block-container-model.d.ts +2 -118
  193. package/models/models/log-block/log-block-container-model.d.ts.map +1 -1
  194. package/models/models/log-block/log-block-container-registration.d.ts +5 -75
  195. package/models/models/log-block/log-block-container-registration.d.ts.map +1 -1
  196. package/models/models/log-block/log-block-model.d.ts +5 -168
  197. package/models/models/log-block/log-block-model.d.ts.map +1 -1
  198. package/models/models/log-block/log-block-registration.d.ts +5 -75
  199. package/models/models/log-block/log-block-registration.d.ts.map +1 -1
  200. package/models/models/log-block/types/index.d.ts +14 -81
  201. package/models/models/log-stream/log-stream-container-model.d.ts +8 -35
  202. package/models/models/log-stream/log-stream-container-model.d.ts.map +1 -1
  203. package/models/models/log-stream/log-stream-container-registration.d.ts +5 -75
  204. package/models/models/log-stream/log-stream-container-registration.d.ts.map +1 -1
  205. package/models/models/log-stream/log-stream-model.d.ts +8 -29
  206. package/models/models/log-stream/log-stream-model.d.ts.map +1 -1
  207. package/models/models/log-stream/log-stream-registration.d.ts +5 -75
  208. package/models/models/log-stream/log-stream-registration.d.ts.map +1 -1
  209. package/models/models/log-stream/types/index.d.ts +5 -60
  210. package/models/models/network-interface/network-interface-container-model.d.ts +6 -35
  211. package/models/models/network-interface/network-interface-container-model.d.ts.map +1 -1
  212. package/models/models/network-interface/network-interface-container-registration.d.ts +5 -73
  213. package/models/models/network-interface/network-interface-container-registration.d.ts.map +1 -1
  214. package/models/models/network-interface/network-interface-model.d.ts +5 -43
  215. package/models/models/network-interface/network-interface-model.d.ts.map +1 -1
  216. package/models/models/network-interface/network-interface-registration.d.ts +5 -73
  217. package/models/models/network-interface/network-interface-registration.d.ts.map +1 -1
  218. package/models/models/network-interface/types/index.d.ts +2 -16
  219. package/models/models/ota/ota-model.d.ts +11 -39
  220. package/models/models/ota/ota-model.d.ts.map +1 -1
  221. package/models/models/ota/ota-registration.d.ts +5 -77
  222. package/models/models/ota/ota-registration.d.ts.map +1 -1
  223. package/models/models/ota/types/index.d.ts +2 -141
  224. package/models/models/region-info/types/index.d.ts +19 -99
  225. package/models/models/region-info/types/index.d.ts.map +1 -1
  226. package/models/models/software-info/services/software-info-services.d.ts +2 -14
  227. package/models/models/software-info/services/software-info-services.d.ts.map +1 -1
  228. package/models/models/software-info/software-info-model.d.ts +3 -39
  229. package/models/models/software-info/software-info-model.d.ts.map +1 -1
  230. package/models/models/software-info/software-info-registration.d.ts +6 -73
  231. package/models/models/software-info/software-info-registration.d.ts.map +1 -1
  232. package/models/models/software-info/types/index.d.ts +6 -20
  233. package/models/models/state-bean/state-bean-model.d.ts +10 -41
  234. package/models/models/state-bean/state-bean-model.d.ts.map +1 -1
  235. package/models/models/state-bean/state-bean-registration.d.ts +6 -73
  236. package/models/models/state-bean/state-bean-registration.d.ts.map +1 -1
  237. package/models/models/state-bean/types/index.d.ts +4 -84
  238. package/models/models/state-prop/state-prop-model.d.ts +6 -40
  239. package/models/models/state-prop/state-prop-model.d.ts.map +1 -1
  240. package/models/models/state-prop/state-prop-registration.d.ts +6 -73
  241. package/models/models/state-prop/state-prop-registration.d.ts.map +1 -1
  242. package/models/models/state-prop/types/index.d.ts +5 -37
  243. package/models/models/storage-device/storage-device-container-model.d.ts +7 -273
  244. package/models/models/storage-device/storage-device-container-model.d.ts.map +1 -1
  245. package/models/models/storage-device/storage-device-container-registration.d.ts +5 -75
  246. package/models/models/storage-device/storage-device-container-registration.d.ts.map +1 -1
  247. package/models/models/storage-device/storage-device-model.d.ts +3 -49
  248. package/models/models/storage-device/storage-device-model.d.ts.map +1 -1
  249. package/models/models/storage-device/storage-device-registration.d.ts +5 -75
  250. package/models/models/storage-device/storage-device-registration.d.ts.map +1 -1
  251. package/models/models/storage-device/types/index.d.ts +13 -82
  252. package/models/models/studio-properties/studio-properties-model.d.ts +13 -36
  253. package/models/models/studio-properties/studio-properties-model.d.ts.map +1 -1
  254. package/models/models/studio-properties/studio-properties-registration.d.ts +5 -75
  255. package/models/models/studio-properties/studio-properties-registration.d.ts.map +1 -1
  256. package/models/models/studio-properties/types/index.d.ts +2 -24
  257. package/models/models/translation/descriptor-merge.d.ts +13 -17
  258. package/models/models/translation/descriptor-merge.d.ts.map +1 -1
  259. package/models/models/translation/services/translation-services.d.ts +19 -77
  260. package/models/models/translation/services/translation-services.d.ts.map +1 -1
  261. package/models/models/translation/test-harness.d.ts +6 -8
  262. package/models/models/translation/test-harness.d.ts.map +1 -1
  263. package/models/models/translation/translation-container-model.d.ts +7 -59
  264. package/models/models/translation/translation-container-model.d.ts.map +1 -1
  265. package/models/models/translation/translation-container-registration.d.ts +6 -73
  266. package/models/models/translation/translation-container-registration.d.ts.map +1 -1
  267. package/models/models/translation/translation-model.d.ts +17 -50
  268. package/models/models/translation/translation-model.d.ts.map +1 -1
  269. package/models/models/translation/translation-registration.d.ts +6 -73
  270. package/models/models/translation/translation-registration.d.ts.map +1 -1
  271. package/models/models/translation/types/index.d.ts +51 -276
  272. package/models/models/trouble/trouble-registration.d.ts +6 -73
  273. package/models/models/trouble/trouble-registration.d.ts.map +1 -1
  274. package/models/models/trouble/types/index.d.ts +17 -188
  275. package/models/models/trouble/utils/is-trouble-aware.d.ts +4 -85
  276. package/models/models/trouble/utils/is-trouble-aware.d.ts.map +1 -1
  277. package/models/models/trouble-container/trouble-builders.d.ts +11 -0
  278. package/models/models/trouble-container/trouble-builders.d.ts.map +1 -0
  279. package/models/models/trouble-container/trouble-container-model.d.ts +2 -1
  280. package/models/models/trouble-container/trouble-container-model.d.ts.map +1 -1
  281. package/models/models/usb-update/usb-update-container-registration.d.ts +5 -75
  282. package/models/models/usb-update/usb-update-container-registration.d.ts.map +1 -1
  283. package/models/models/usb-update/usb-update-registration.d.ts +5 -75
  284. package/models/models/usb-update/usb-update-registration.d.ts.map +1 -1
  285. package/models/types/cancellable-promise.d.ts +6 -9
  286. package/models/types/cancellable-promise.d.ts.map +1 -1
  287. package/models/utils/await-future-call.d.ts +9 -21
  288. package/models/utils/await-future-call.d.ts.map +1 -1
  289. package/models/utils/cancellable-future-call.d.ts +8 -19
  290. package/models/utils/cancellable-future-call.d.ts.map +1 -1
  291. package/models/utils/cancellable-service.d.ts +14 -23
  292. package/models/utils/cancellable-service.d.ts.map +1 -1
  293. package/models/utils/conversion-utils.d.ts +8 -48
  294. package/models/utils/conversion-utils.d.ts.map +1 -1
  295. package/models/utils/persistence-store.d.ts +1 -1
  296. package/models/utils/service.d.ts +14 -48
  297. package/models/utils/service.d.ts.map +1 -1
  298. package/models/utils/services/kos/daily/service.d.ts +4 -4
  299. package/models/utils/services/vfs/daily/service.d.ts +4 -4
  300. package/models/utils/timer-manager.d.ts.map +1 -1
  301. package/package.json +2 -2
  302. package/{index-D52vEGXT.cjs → software-info-registration-Le3V0a6v.cjs} +11906 -416
  303. package/software-info-registration-Le3V0a6v.cjs.map +1 -0
  304. package/{index-Csq0zQtb.js → software-info-registration-kSGacOka.js} +12116 -625
  305. package/software-info-registration-kSGacOka.js.map +1 -0
  306. package/testing/index.d.ts +32 -34
  307. package/testing/index.d.ts.map +1 -1
  308. package/testing.cjs +2 -1
  309. package/testing.cjs.map +1 -1
  310. package/testing.js +2 -1
  311. package/testing.js.map +1 -1
  312. package/ui/components/connection-dev-button/connection-dev-button-styles.d.ts +9 -0
  313. package/ui/components/connection-dev-button/connection-dev-button-styles.d.ts.map +1 -0
  314. package/ui/components/connection-dev-button/index.d.ts +36 -0
  315. package/ui/components/connection-dev-button/index.d.ts.map +1 -0
  316. package/ui/components/connection-dev-button/use-connection-dev-state.d.ts +29 -0
  317. package/ui/components/connection-dev-button/use-connection-dev-state.d.ts.map +1 -0
  318. package/ui/components/index.d.ts +1 -0
  319. package/ui/components/index.d.ts.map +1 -1
  320. package/ui/features/canvas/hooks/use-image-renderer.d.ts +5 -4
  321. package/ui/features/canvas/hooks/use-image-renderer.d.ts.map +1 -1
  322. package/ui/hooks/use-function-warmup.d.ts +4 -14
  323. package/ui/hooks/use-function-warmup.d.ts.map +1 -1
  324. package/ui/hooks/use-kos-date-formats.d.ts +15 -29
  325. package/ui/hooks/use-kos-date-formats.d.ts.map +1 -1
  326. package/ui/hooks/use-kos-region-timezones.d.ts +4 -55
  327. package/ui/hooks/use-kos-region-timezones.d.ts.map +1 -1
  328. package/ui/hooks/use-kos-regions.d.ts +11 -23
  329. package/ui/hooks/use-kos-regions.d.ts.map +1 -1
  330. package/ui/hooks/use-kos-time-formats.d.ts +16 -31
  331. package/ui/hooks/use-kos-time-formats.d.ts.map +1 -1
  332. package/ui/hooks/use-kos-unit-systems.d.ts +13 -27
  333. package/ui/hooks/use-kos-unit-systems.d.ts.map +1 -1
  334. package/ui/hooks/view-model/use-view-model.d.ts +6 -31
  335. package/ui/hooks/view-model/use-view-model.d.ts.map +1 -1
  336. package/ui/policies/reload-on-disconnect-policy.d.ts +5 -6
  337. package/ui/policies/reload-on-disconnect-policy.d.ts.map +1 -1
  338. package/index-Csq0zQtb.js.map +0 -1
  339. package/index-D52vEGXT.cjs.map +0 -1
@@ -1,29 +1,18 @@
1
1
  /**
2
- * @fileoverview Translation service functions for internationalization and localization.
3
- *
4
- * This module provides service functions for loading translation data, managing locale
5
- * descriptors, and handling multi-language content in KOS applications. Supports both
6
- * static file-based translations and dynamic translation service integration.
2
+ * @fileoverview Service functions for loading translation bundles and
3
+ * localization descriptors.
7
4
  *
8
5
  * @module TranslationServices
9
6
  */
10
7
  /**
11
- * Generic translation data response format.
12
- *
13
- * Represents the structure of translation data returned from various translation
14
- * endpoints, supporting flexible key-value structures for different locales
15
- * and translation namespaces.
8
+ * Translation bundle: keys to strings, string arrays or nested groups.
16
9
  *
17
10
  * @group KOS Model
18
11
  * @category i18n
19
12
  */
20
13
  export type TranslationResponse = Record<string, any>;
21
14
  /**
22
- * Locale descriptor defining translation file location and fallback behavior.
23
- *
24
- * Describes how to locate and load translation files for a specific locale,
25
- * including fallback chains for graceful degradation when translations are
26
- * missing or incomplete.
15
+ * Where a locale's translation file lives and which locales it falls back to.
27
16
  *
28
17
  * @group KOS Model
29
18
  * @category i18n
@@ -37,20 +26,14 @@ export interface LocaleDescriptor {
37
26
  fallbacks?: string[];
38
27
  }
39
28
  /**
40
- * Complete localization configuration for organizing translation namespaces.
41
- *
42
- * Defines the structure for managing multiple translation namespaces with
43
- * locale-specific configurations. Enables organized translation management
44
- * across different features or components of an application.
29
+ * Localization descriptor: the translation namespaces an application uses and
30
+ * the locale files each provides.
45
31
  *
46
32
  * @group KOS Model
47
33
  * @category i18n
48
34
  */
49
35
  export interface Localization {
50
- /**
51
- * Translation namespaces organized by feature or component.
52
- * Each namespace contains locale configurations and file paths.
53
- */
36
+ /** Namespaces keyed by name, usually one per feature area. */
54
37
  namespaces: {
55
38
  [key: string]: {
56
39
  /** Locale-specific configuration for this namespace */
@@ -65,83 +48,42 @@ export interface Localization {
65
48
  path: string;
66
49
  }
67
50
  /**
68
- * Loads translation data from a specified URL.
51
+ * Fetches a translation bundle. A non-200 response yields an empty bundle so
52
+ * the remaining locales in the fallback chain still apply.
69
53
  *
70
- * Fetches translation JSON files from static resources or translation services.
71
- * Handles network errors gracefully by returning empty objects rather than
72
- * throwing exceptions, enabling fallback behavior in translation systems.
73
- *
74
- * @param url - Relative or absolute URL to the translation file
75
- * @param root - Optional root URL override (defaults to current window origin)
54
+ * @param url - Path of the translation file
55
+ * @param root - Host to load from; defaults to the `host` query parameter or the window origin
76
56
  * @returns Promise resolving to translation data object
77
57
  *
78
- * @throws {Error} When network request fails unexpectedly (non-200 responses return empty object)
79
- *
80
- * @example Load Translation File
81
- * ```typescript
82
- * const frenchTranslations = await getTranslations('/assets/locales/fr/common.json');
83
- * console.log('Welcome message:', frenchTranslations.welcome);
84
- *
85
- * const customTranslations = await getTranslations('/api/translations/dashboard', 'https://translations.example.com');
86
- * ```
58
+ * @throws {Error} When the request itself fails
87
59
  *
88
60
  * @group KOS Model
89
61
  * @category i18n
90
62
  */
91
63
  export declare const getTranslations: (url: string, root?: string) => Promise<any>;
92
64
  /**
93
- * Retrieves the system-wide localization configuration descriptor.
94
- *
95
- * Fetches the complete localization configuration from the KOS system,
96
- * including namespace definitions, locale mappings, and file path information.
97
- * Used for initializing translation containers with proper configuration.
65
+ * Fetches the system localization descriptor.
98
66
  *
99
67
  * @returns Promise resolving to complete localization descriptor
100
68
  *
101
- * @throws {Error} When service request fails or returns non-200 status
102
- *
103
- * @example Initialize Translation System
104
- * ```typescript
105
- * const localizationConfig = await getLocalizationDescriptor();
106
- * const translationContainer = TranslationContainer.instance('app-i18n')
107
- * .options({
108
- * lang: 'en',
109
- * descriptor: localizationConfig
110
- * })
111
- * .build();
112
- * ```
69
+ * @throws {Error} When the response status is not 200
113
70
  *
114
71
  * @group KOS Model
115
72
  * @category i18n
116
73
  */
117
74
  export declare const getLocalizationDescriptor: () => Promise<Localization>;
118
75
  /**
119
- * Creates a context-specific localization descriptor retrieval function.
120
- *
121
- * Returns a curried function that fetches localization configuration for a
122
- * specific context from the KOS system. Useful for creating context-aware
123
- * translation loaders that can be configured once and used multiple times.
76
+ * Returns a loader for the localization descriptor of one context, such as
77
+ * `"studio"`.
124
78
  *
125
79
  * @param context - Context identifier for localization configuration
126
80
  * @returns Async function that retrieves context-specific localization descriptor
127
81
  *
128
- * @throws {Error} When service request fails or context is not found
82
+ * @throws {Error} When the response status is not 200
129
83
  *
130
- * @example Create Context-Specific Loader
84
+ * @example
131
85
  * ```typescript
132
- * const getStudioTranslations = getKosLocalizationDescriptor('studio');
133
- * const studioConfig = await getStudioTranslations();
134
- *
135
- * const getDeviceTranslations = getKosLocalizationDescriptor('device');
136
- * const deviceConfig = await getDeviceTranslations();
137
- *
138
- * // Use in translation container initialization
139
- * const container = TranslationContainer.instance('context-aware')
140
- * .options({
141
- * lang: 'es',
142
- * descriptor: studioConfig
143
- * })
144
- * .build();
86
+ * const descriptor = await getKosLocalizationDescriptor("studio")();
145
87
  * ```
146
88
  *
147
89
  * @group KOS Model
@@ -1 +1 @@
1
- {"version":3,"file":"translation-services.d.ts","sourceRoot":"","sources":["../../../../../../../packages/kos-ui-sdk/src/models/models/translation/services/translation-services.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAuBH;;;;;;;;;GASG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAEtD;;;;;;;;;GASG;AACH,MAAM,WAAW,gBAAgB;IAC/B,4EAA4E;IAC5E,aAAa,EAAE,MAAM,CAAC;IACtB,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,UAAU,EAAE;QACV,CAAC,GAAG,EAAE,MAAM,GAAG;YACb,uDAAuD;YACvD,OAAO,EAAE;gBACP,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAC;aACjC,CAAC;YACF,wDAAwD;YACxD,QAAQ,EAAE,MAAM,CAAC;SAClB,CAAC;KACH,CAAC;IACF,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;CACd;AAoBD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,eAAe,GAAU,KAAK,MAAM,EAAE,OAAO,MAAM,iBAgB/D,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,yBAAyB,6BAYrC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,4BAA4B,GAAI,SAAS,MAAM,gCAY3D,CAAC"}
1
+ {"version":3,"file":"translation-services.d.ts","sourceRoot":"","sources":["../../../../../../../packages/kos-ui-sdk/src/models/models/translation/services/translation-services.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAuBH;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,4EAA4E;IAC5E,aAAa,EAAE,MAAM,CAAC;IACtB,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC3B,8DAA8D;IAC9D,UAAU,EAAE;QACV,CAAC,GAAG,EAAE,MAAM,GAAG;YACb,uDAAuD;YACvD,OAAO,EAAE;gBACP,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAC;aACjC,CAAC;YACF,wDAAwD;YACxD,QAAQ,EAAE,MAAM,CAAC;SAClB,CAAC;KACH,CAAC;IACF,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;CACd;AAiBD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,eAAe,GAAU,KAAK,MAAM,EAAE,OAAO,MAAM,iBAgB/D,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,yBAAyB,6BAYrC,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,4BAA4B,GAAI,SAAS,MAAM,gCAY3D,CAAC"}
@@ -9,12 +9,10 @@ export type Bundles = Record<string, Record<string, TranslationResponse>>;
9
9
  */
10
10
  export declare function descriptorFor(bundles: Bundles, fallbacks?: Record<string, string[]>): Localization;
11
11
  /**
12
- * ONE CONTAINER PER TEST FILE. TranslationContainer is a singleton keyed by
13
- * model type, so a second `harness()` call in the same file returns the FIRST
14
- * container with its original descriptor and locale — the new options are
15
- * discarded in silence, and assertions written against them pass for the wrong
16
- * reason. A case needing a different locale or descriptor belongs in its own
17
- * file, which vitest runs with its own module state.
12
+ * The container is a singleton keyed by model type, so a second `harness()`
13
+ * call in the same test file returns the first container and ignores the new
14
+ * options. Put a case that needs a different locale or descriptor in its own
15
+ * file; vitest gives each file its own module state.
18
16
  */
19
17
  export interface Harness {
20
18
  container: Awaited<ReturnType<typeof KosTranslations.init>>["translations"];
@@ -24,8 +22,8 @@ export interface Harness {
24
22
  namespace: (name: string) => Promise<ReturnType<Harness["container"]["resolveNamespace"]>>;
25
23
  }
26
24
  /**
27
- * A ready container serving `bundles`, plus a log of what it loaded — the log
28
- * is how a test tells a genuine reload from a cached read.
25
+ * A ready container serving `bundles`, plus a log of what it loaded. The log
26
+ * tells a genuine reload from a cached read.
29
27
  */
30
28
  export declare function harness(bundles: Bundles, options?: {
31
29
  lang?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"test-harness.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/translation/test-harness.ts"],"names":[],"mappings":"AAaA,OAAO,EAAe,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAIxD,0DAA0D;AAC1D,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC;AAE1E;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,OAAO,EAChB,SAAS,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAM,GACvC,YAAY,CAoBd;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,OAAO;IACtB,SAAS,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC;IAC5E,uEAAuE;IACvE,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,iEAAiE;IACjE,SAAS,EAAE,CACT,IAAI,EAAE,MAAM,KACT,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;CACpE;AAED;;;GAGG;AACH,wBAAsB,OAAO,CAC3B,OAAO,EAAE,OAAO,EAChB,OAAO,GAAE;IACP,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACrC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CACtB,GACL,OAAO,CAAC,OAAO,CAAC,CA6BlB;AAED,OAAO,EAAE,KAAK,EAAE,CAAC"}
1
+ {"version":3,"file":"test-harness.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/translation/test-harness.ts"],"names":[],"mappings":"AASA,OAAO,EAAe,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAIxD,0DAA0D;AAC1D,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC;AAE1E;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,OAAO,EAChB,SAAS,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAM,GACvC,YAAY,CAoBd;AAED;;;;;GAKG;AACH,MAAM,WAAW,OAAO;IACtB,SAAS,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC;IAC5E,uEAAuE;IACvE,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,iEAAiE;IACjE,SAAS,EAAE,CACT,IAAI,EAAE,MAAM,KACT,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;CACpE;AAED;;;GAGG;AACH,wBAAsB,OAAO,CAC3B,OAAO,EAAE,OAAO,EAChB,OAAO,GAAE;IACP,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACrC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CACtB,GACL,OAAO,CAAC,OAAO,CAAC,CA6BlB;AAED,OAAO,EAAE,KAAK,EAAE,CAAC"}
@@ -5,66 +5,14 @@ import { TranslationModel } from './translation-model';
5
5
  import { TranslationContainerOptions } from './types';
6
6
  export declare const MODEL_TYPE = "translation-container-model";
7
7
  /**
8
- * TranslationContainer - Multi-namespace translation management with automatic locale switching.
8
+ * Owns the application's translation namespaces. Each namespace gets a
9
+ * {@link TranslationModel}, created the first time it is resolved, and setting
10
+ * `currentLocale` switches every namespace model to the new locale.
9
11
  *
10
- * The TranslationContainer model serves as the central orchestrator for internationalization in KOS
11
- * applications. It manages multiple translation namespaces, handles global locale switching, and provides
12
- * namespace resolution with fallback chains. This container enables building sophisticated multi-language
13
- * interfaces that adapt automatically to user language preferences across all application features.
14
- *
15
- * ## Key Features
16
- * - **Multi-Namespace Management** - Organize translations by feature areas (dashboard, alerts, settings)
17
- * - **Global Locale Control** - Centralized locale switching affects all contained translation models
18
- * - **Automatic Discovery** - Dynamic namespace loading and registration as features request translations
19
- * - **Fallback Resolution** - Sophisticated locale fallback chains for graceful degradation
20
- * - **Custom Resolvers** - Flexible translation loading strategies for different deployment scenarios
21
- * - **Reload Capability** - Dynamic translation updates without application restart
22
- * - **Default Namespace** - Optional primary namespace for application-wide common translations
23
- *
24
- * ## Namespace Organization
25
- * Translation namespaces organize translations by functional areas:
26
- * - **Feature-Based**: dashboard, device-config, maintenance, alerts
27
- * - **Component-Based**: forms, modals, navigation, status-displays
28
- * - **Common**: common, shared, ui-elements for cross-cutting concerns
29
- *
30
- * ## Locale Management Architecture
31
- * The container manages locale switching across all child translation models:
32
- * 1. **Centralized Control**: Single point for locale changes
33
- * 2. **Automatic Propagation**: All child models receive locale updates
34
- * 3. **Reactive Loading**: Translation files loaded automatically on locale switch
35
- * 4. **Fallback Coordination**: Container coordinates fallback chains across namespaces
36
- *
37
- * ## Common Use Cases
38
- * - **Application Initialization** - Bootstrap internationalization system with locale descriptors
39
- * - **User Language Switching** - Provide language selector that updates entire application
40
- * - **Feature Translation Loading** - Dynamic namespace registration as features are accessed
41
- * - **Multi-Tenant Systems** - Different translation sets for different deployments
42
- * - **Development Workflows** - Hot-reload translations during development
43
- * - **Global Device Interfaces** - Centralized management for device control applications
44
- *
45
- * @example Basic Usage
12
+ * @example
46
13
  * ```typescript
47
- * const translationContainer = TranslationContainer.instance('app-translations')
48
- * .options({
49
- * lang: 'es',
50
- * defaultNamespace: 'common',
51
- * descriptor: {
52
- * namespaces: {
53
- * 'common': {
54
- * basePath: '/assets/locales',
55
- * locales: {
56
- * 'en': { file: 'en/common.json', defaultLocale: 'en' },
57
- * 'es': { file: 'es/common.json', defaultLocale: 'en' }
58
- * }
59
- * }
60
- * }
61
- * }
62
- * })
63
- * .build();
64
- *
65
- * // Access translations and switch language
66
- * const commonTranslations = translationContainer.getModel('common');
67
- * translationContainer.currentLocale = 'fr';
14
+ * const ns = container.resolveNamespace("common");
15
+ * container.currentLocale = "fr";
68
16
  * ```
69
17
  *
70
18
  * @group KOS Model
@@ -72,7 +20,7 @@ export declare const MODEL_TYPE = "translation-container-model";
72
20
  * @interface
73
21
  * @useDeclaredType
74
22
  *
75
- * @see {@link TranslationContainerOptions} - Configuration options for TranslationContainer instances
23
+ * @see {@link TranslationContainerOptions} - Configuration options
76
24
  * @see {@link TranslationModel} - Individual translation namespace model
77
25
  * @see {@link useKosTranslation} - React hook for accessing container translations
78
26
  * @see {@link useKosTranslationContext} - React hook for container-level operations
@@ -1 +1 @@
1
- {"version":3,"file":"translation-container-model.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/translation/translation-container-model.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EAEf,kBAAkB,EAClB,WAAW,EACZ,MAAM,eAAe,CAAC;AASvB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAEhE,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,KAAK,EAAE,2BAA2B,EAAsB,MAAM,SAAS,CAAC;AAE/E,eAAO,MAAM,UAAU,gCAAgC,CA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;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAG5B"}
1
+ {"version":3,"file":"translation-container-model.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/translation/translation-container-model.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EAEf,kBAAkB,EAClB,WAAW,EACZ,MAAM,eAAe,CAAC;AASvB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAEhE,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,KAAK,EAAE,2BAA2B,EAAsB,MAAM,SAAS,CAAC;AAE/E,eAAO,MAAM,UAAU,gCAAgC,CAAC;AAExD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,yBAAyB,GACnC,oBAAoB,CAAC,6BAA6B,CAAC,CAAC;AAmBtD;;;GAGG;AACH,qBACa,6BACX,YACE,gBAAgB,EAChB,eAAe,CAAC,gBAAgB,CAAC,EACjC,aAAa,EACb,WAAW;IAEb,yDAAyD;IACzD,EAAE,EAAE,MAAM,CAAC;IACX,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,OAAO,CAAC,OAAO,CAAC,CAAS;IACzB,mFAAmF;IACnF,UAAU,EAAE,YAAY,CAAC;IACzB,iFAAiF;IACjF,OAAO,CAAC,iBAAiB,CAAC,CAAS;IACnC,oEAAoE;IACpE,OAAO,CAAC,QAAQ,CAIJ;IACZ,0DAA0D;IAC1D,OAAO,CAAC,MAAM,CAAmB;IACjC,2DAA2D;IAC3D,OAAO,CAAC,aAAa,CAAC,CAAS;IAC/B,sDAAsD;IACtD,OAAO,CAAC,UAAU,CAAgB;IAClC,0EAA0E;IAC1E,OAAO,CAAC,cAAc,CAAC,CAAuC;IAC9D,yDAAyD;IAC/C,OAAO,CAAC,OAAO,CAAuC;gBAE9D,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,2BAA2B,EACpC,OAAO,EAAE,kBAAkB;IAkB7B,IAAI,aAAa,CAAC,MAAM,EAAE,MAAM,EAK/B;IACD,IAAI,gBAAgB,iCAInB;IACD,QAAQ,CAAC,EAAE,EAAE,MAAM;IAInB,IAAI,MAAM,yCAET;IACD,IAAI,IAAI,uBAEP;IAEK,MAAM;IAMZ,gBAAgB,CAAC,SAAS,EAAE,MAAM;IA8ClC,QAAQ,CAAC,KAAK,EAAE,gBAAgB;IAIhC,WAAW,CAAC,EAAE,EAAE,MAAM;IAKtB;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAM3B;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAG5B"}
@@ -2,86 +2,19 @@ import { SingletonKosModelRegistrationBean } from '../../../core';
2
2
  import { TranslationContainerModel } from './translation-container-model';
3
3
  import { TranslationContainerOptions } from './types';
4
4
  /**
5
- * # TranslationContainer
5
+ * Registration for {@link TranslationContainerModel}, a singleton model.
6
6
  *
7
- * The registration bean includes convenience methods for creating and working with TranslationContainerModel instances.
8
- *
9
- * ## type
10
- * The type property is a string that identifies the model type.
11
- * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently
12
- * used when declaring dependencies on models.
7
+ * `type` identifies the model in the registry and in `@kosDependency` declarations.
8
+ * `factory(options)` returns the single instance, creating it on first call; later calls ignore the options. `predicate` narrows a model to `TranslationContainerModel`.
9
+ * Spread `registration` into an application's model registry.
13
10
  *
14
11
  * @example
15
12
  * ```typescript
16
- *
17
- * @kosDependency({modelType: TranslationContainer.type, id: "translationContainerId"})
18
- * private translationContainerModel: TranslationContainerModel;
13
+ * const model = TranslationContainer.factory(options);
19
14
  * ```
20
15
  *
21
- *
22
- * ## factory
23
- *
24
- * The factory method creates a factory function that can be used to create new TranslationContainerModel instances.
25
- *
26
-
27
- * As this is a singleton model, the factory function accepts the model options as its argument.
28
- *
29
- * If a model with the same model type already exists, the factory function will return the existing model. The options will be ignored
30
- * in this case and the existing model will be returned in its current state.
31
- *
32
- * @example
33
- * ```typescript
34
- * const model = TranslationContainer.factory({
35
- * // Add option data
36
- * });
37
- * ```
38
-
39
-
40
- *
41
- * ## predicate
42
- *
43
- * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a TranslationContainerModel.
44
- *
45
- * @example
46
- * ```typescript
47
- *
48
- * const model: IKosDataModel = ...; // some model
49
- *
50
- * if (TranslationContainer.predicate(model)) {
51
- * // if the function evaluates to true, the model is narrowed down to TranslationContainerModel
52
- * // and the compiler will know that the model has the TranslationContainerModel interface
53
- * model.updateAvailability(false);
54
- * }
55
- * ```
56
- *
57
- * ## registration
58
- *
59
- * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object
60
- * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.
61
- *
62
- *
63
- * @example
64
- *
65
- * In an application registration file you can declare the model registration as follows:
66
- *
67
- * **registration.ts**
68
- * ```typescript
69
- * import { TranslationContainer } from "@kosdev-code/kos-dispense-sdk";
70
- * ...
71
- * import { ExtensionManager, IKosRegistry } from "@kosdev-code/kos-ui-sdk";
72
- * export const kosModels: IKosRegistry["models"] = {
73
- * ...TranslationContainer.registration,
74
- * };
75
- * ```
76
- *
77
- * ## registration.singleton
78
-
79
- * The translationContainer model is a singleton model. This means that each time the factory function is called , the same instance will be returned.
80
- * If the model does not yet exist, it will be created passing in the provided options to initialize it.
81
- *
82
- * Singleton models don't require an ID as they will use the model type as their ID to guarantee uniqueness throughout the system.
83
16
  * @group KOS Model
84
17
  * @category i18n
85
- * */
18
+ */
86
19
  export declare const TranslationContainer: Readonly<SingletonKosModelRegistrationBean<TranslationContainerModel, TranslationContainerOptions>>;
87
20
  //# sourceMappingURL=translation-container-registration.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"translation-container-registration.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/translation/translation-container-registration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,eAAe,CAAC;AAEvE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAK/E,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAiFK;AACL,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CACzC,iCAAiC,CAC/B,yBAAyB,EACzB,2BAA2B,CAC5B,CAcF,CAAC"}
1
+ {"version":3,"file":"translation-container-registration.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/translation/translation-container-registration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,eAAe,CAAC;AAEvE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAK/E,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAE3D;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CACzC,iCAAiC,CAC/B,yBAAyB,EACzB,2BAA2B,CAC5B,CAcF,CAAC"}
@@ -13,60 +13,25 @@ interface ResolveTranslationsDataOptions<T = string> extends ResolveTranslationO
13
13
  type ResolveTranslationsOptionsMap<T = string> = ResolveTranslationOptionsBase<T> & Record<string, string | number | boolean | undefined | null>;
14
14
  export type ResolveTranslationOptions<T = string> = ResolveTranslationsDataOptions<T> | ResolveTranslationsOptionsMap<T>;
15
15
  /**
16
- * Translation - Individual namespace translations with automatic locale switching and interpolation.
16
+ * Translations for one namespace. The model loads the bundle for each locale in
17
+ * the active locale's fallback chain, merges them so the active locale wins, and
18
+ * reloads when `currentLocale` changes.
17
19
  *
18
- * The Translation model provides access to localized text for a specific namespace within a KOS
19
- * application. It handles locale switching, fallback chains, variable interpolation, and context-aware
20
- * translations for building truly international device interfaces that adapt to user language preferences
21
- * automatically.
20
+ * The fallback chain is the active locale followed by the `fallbacks` its
21
+ * descriptor declares, or by `defaultLocale` when it declares none. When a key is
22
+ * still missing, `resolveKey` returns the supplied default value or the key.
22
23
  *
23
- * ## Key Features
24
- * - **Namespace Isolation** - Translations organized by functional area or feature
25
- * - **Automatic Locale Switching** - React to parent container locale changes
26
- * - **Fallback Chains** - Graceful degradation through locale hierarchy (pt-BR → pt → es → en)
27
- * - **Variable Interpolation** - Support for both template (`{{variable}}`) and macro (`__variable__`) substitution
28
- * - **Context-Aware Keys** - Conditional translations based on context (e.g., `title_edit` vs `title`)
29
- * - **Real-time Updates** - Automatic UI updates when locale or translations change
30
- * - **Bundle Resolution** - Custom loading strategies for different deployment scenarios
24
+ * Translated strings support two kinds of placeholder:
25
+ * - `{{name}}` is replaced from the values passed to `resolveKey`.
26
+ * - `__key__` is replaced with another key from the same bundle.
31
27
  *
32
- * ## Variable Interpolation Patterns
33
- * The model supports two interpolation patterns for dynamic content:
34
- * - **Template Variables** (`{{variable}}`) - Context-based substitution passed via options
35
- * - **Macro Variables** (`__variable__`) - Data-based substitution from nested objects
36
- *
37
- * ## Fallback Resolution
38
- * When translations are missing, the system follows a sophisticated fallback chain:
39
- * 1. **Current locale** (e.g., `pt-BR`)
40
- * 2. **Parent locale** (e.g., `pt`)
41
- * 3. **Fallback locales** (configured per locale, e.g., `es`)
42
- * 4. **Default locale** (typically `en`)
43
- * 5. **Provided default value** or raw key
44
- *
45
- * ## Common Use Cases
46
- * - **Feature-Specific UI** - Isolated translations for dashboards, settings, alerts
47
- * - **Form Validation** - Localized error messages with variable interpolation
48
- * - **Status Displays** - Dynamic content with device state and user context
49
- * - **Multi-Language Interfaces** - Complete internationalization for global deployments
50
- * - **Context-Aware Content** - Mode-specific text (create vs edit, online vs offline)
51
- * - **Rich Text Support** - Integration with Trans component for formatted content
28
+ * A key prefixed `namespace:` resolves in that namespace of the parent container.
52
29
  *
53
30
  * @interface
54
- * @example Basic Usage
31
+ * @example
55
32
  * ```typescript
56
- * const statusTranslations = Translation.instance('device-status')
57
- * .options({
58
- * namespace: 'device-status',
59
- * currentLocale: 'es',
60
- * defaultLocale: 'en',
61
- * descriptor: {
62
- * 'es': { fallbacks: ['en'] },
63
- * 'en': { fallbacks: [] }
64
- * }
65
- * })
66
- * .build();
67
- *
68
- * // Resolve localized keys with fallback support
69
- * const title = statusTranslations.resolveKey('title');
33
+ * const ns = container.resolveNamespace("device-status");
34
+ * const title = ns.resolveKey("title", { context: "edit", count: 3 });
70
35
  * ```
71
36
  *
72
37
  * @group KOS Model
@@ -130,9 +95,11 @@ export declare class TranslationModelImpl implements IKosDataModel, IKosIdentifi
130
95
  */
131
96
  exists(_key: string): any;
132
97
  /**
133
- * Resolves a translation key with optional variable interpolation.
98
+ * Resolves a translation key, substituting `{{name}}` placeholders from
99
+ * `options` (or from `options.data` when it is an object). With
100
+ * `options.context`, the variant key `<key>_<context>` is tried first.
134
101
  * @param _key Translation key, optionally with namespace prefix
135
- * @param options Options for interpolation and fallback
102
+ * @param options Interpolation values, or a default value string
136
103
  * @returns Resolved translation string or array
137
104
  */
138
105
  resolveKey<T = string>(_key: string, options?: ResolveTranslationOptions<T> | string): any;
@@ -1 +1 @@
1
- {"version":3,"file":"translation-model.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/translation/translation-model.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,UAAU,EAEV,kBAAkB,EACnB,MAAM,eAAe,CAAC;AAQvB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAEhE,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EAEpB,MAAM,Y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AO,CAAC,EAAE,yBAAyB,CAAC,CAAC,CAAC,GAAG,MAAM;IAmCjD;;OAEG;IACH,MAAM,IAAI,IAAI;IAOd;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAK3B;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAOtB,yBAAyB;CAGhC"}
@@ -2,83 +2,16 @@ import { KosModelRegistrationBean } from '../../../core';
2
2
  import { TranslationModel } from './translation-model';
3
3
  import { TranslationOptions } from './types';
4
4
  /**
5
- * # Translation
5
+ * Registration for {@link TranslationModel}.
6
6
  *
7
- * The registration bean includes convenience methods for creating and working with TranslationModel instances.
8
- *
9
- * ## type
10
- * The type property is a string that identifies the model type.
11
- * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently
12
- * used when declaring dependencies on models.
7
+ * `type` identifies the model in the registry and in `@kosDependency` declarations.
8
+ * `factory(id)(options)` creates the model, or returns the existing one when the id is already in use. `predicate` narrows a model to `TranslationModel`.
9
+ * Spread `registration` into an application's model registry.
13
10
  *
14
11
  * @example
15
12
  * ```typescript
16
- *
17
- * @kosDependency({modelType: Translation.type, id: "translationId"})
18
- * private translationModel: TranslationModel;
13
+ * const model = Translation.factory("translationId")(options);
19
14
  * ```
20
- *
21
- *
22
- * ## factory
23
- *
24
- * The factory method creates a factory function that can be used to create new TranslationModel instances.
25
- *
26
-
27
- * The factory function is a curried function that takes the model id as the first argument and the options as the second argument.
28
- *
29
- * If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored
30
- * in this case and the existing model will be returned in its current state.
31
- *
32
- * @example
33
- * ```typescript
34
- * const model = Translation.factory("translationId")({
35
- * // Add option data
36
- * });
37
- * ```
38
-
39
-
40
- *
41
- * ## predicate
42
- *
43
- * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a TranslationModel.
44
- *
45
- * @example
46
- * ```typescript
47
- *
48
- * const model: IKosDataModel = ...; // some model
49
- *
50
- * if (Translation.predicate(model)) {
51
- * // if the function evaluates to true, the model is narrowed down to TranslationModel
52
- * // and the compiler will know that the model has the TranslationModel interface
53
- * model.updateAvailability(false);
54
- * }
55
- * ```
56
- *
57
- * ## registration
58
- *
59
- * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object
60
- * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.
61
- *
62
- *
63
- * @example
64
- *
65
- * In an application registration file you can declare the model registration as follows:
66
- *
67
- * **registration.ts**
68
- * ```typescript
69
- * import { Translation } from "@kosdev-code/kos-dispense-sdk";
70
- * ...
71
- * import { ExtensionManager, IKosRegistry } from "@kosdev-code/kos-ui-sdk";
72
- * export const kosModels: IKosRegistry["models"] = {
73
- * ...Translation.registration,
74
- * };
75
- * ```
76
- *
77
- * ## registration.singleton
78
-
79
- * The translation model is NOT a singleton model. This means that each time the factory function is called with a unique ID, a new model instance will be created.
80
- * If the factory function is called with an ID that already exists, the existing model will be returned.
81
-
82
- * */
15
+ */
83
16
  export declare const Translation: Readonly<KosModelRegistrationBean<TranslationModel, TranslationOptions>>;
84
17
  //# sourceMappingURL=translation-registration.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"translation-registration.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/translation/translation-registration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAE9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA8EK;AACL,eAAO,MAAM,WAAW,EAAE,QAAQ,CAChC,wBAAwB,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,CAW/D,CAAC"}
1
+ {"version":3,"file":"translation-registration.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/translation/translation-registration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAE9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,WAAW,EAAE,QAAQ,CAChC,wBAAwB,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,CAW/D,CAAC"}