@kosdev-code/kos-ui-sdk 3.0.25 → 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 (355) hide show
  1. package/.kos.json +3 -2
  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 +22 -131
  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 -14
  35. package/core/core/decorators/kos-reload-aware.d.ts.map +1 -1
  36. package/core/core/decorators/kos-service-request-helpers.d.ts +3 -1
  37. package/core/core/decorators/kos-service-request-helpers.d.ts.map +1 -1
  38. package/core/core/decorators/kos-service-request.d.ts +85 -265
  39. package/core/core/decorators/kos-service-request.d.ts.map +1 -1
  40. package/core/core/decorators/kos-state-machine.d.ts +44 -273
  41. package/core/core/decorators/kos-state-machine.d.ts.map +1 -1
  42. package/core/core/decorators/kos-topic-handler-flow-control.d.ts +37 -29
  43. package/core/core/decorators/kos-topic-handler-flow-control.d.ts.map +1 -1
  44. package/core/core/decorators/kos-trouble-aware.d.ts +9 -43
  45. package/core/core/decorators/kos-trouble-aware.d.ts.map +1 -1
  46. package/core/core/decorators/kos-view-model.d.ts +20 -100
  47. package/core/core/decorators/kos-view-model.d.ts.map +1 -1
  48. package/core/core/decorators/kosDependency.d.ts +4 -2
  49. package/core/core/decorators/kosDependency.d.ts.map +1 -1
  50. package/core/core/decorators/kosModel.d.ts.map +1 -1
  51. package/core/core/decorators/kosTopicHandler.d.ts +28 -98
  52. package/core/core/decorators/kosTopicHandler.d.ts.map +1 -1
  53. package/core/core/decorators/propKeys.d.ts +1 -0
  54. package/core/core/decorators/propKeys.d.ts.map +1 -1
  55. package/core/core/extension/extension-manager.d.ts.map +1 -1
  56. package/core/core/indexing/index.d.ts +2 -4
  57. package/core/core/indexing/index.d.ts.map +1 -1
  58. package/core/core/indexing/kos-container-index-aware.d.ts +17 -48
  59. package/core/core/indexing/kos-container-index-aware.d.ts.map +1 -1
  60. package/core/core/indexing/kos-index-aware.d.ts +11 -37
  61. package/core/core/indexing/kos-index-aware.d.ts.map +1 -1
  62. package/core/core/kos-container-index.d.ts +11 -0
  63. package/core/core/kos-container-index.d.ts.map +1 -1
  64. package/core/core/kos-container-model.d.ts +11 -32
  65. package/core/core/kos-container-model.d.ts.map +1 -1
  66. package/core/core/kos-data-container.d.ts +6 -6
  67. package/core/core/kos-data-container.d.ts.map +1 -1
  68. package/core/core/kosCore.d.ts +22 -4
  69. package/core/core/kosCore.d.ts.map +1 -1
  70. package/core/core/kosModel.d.ts +21 -8
  71. package/core/core/kosModel.d.ts.map +1 -1
  72. package/core/core/kosModelManager.d.ts +2 -3
  73. package/core/core/kosModelManager.d.ts.map +1 -1
  74. package/core/core/lifecycle/constants.d.ts +6 -2
  75. package/core/core/lifecycle/constants.d.ts.map +1 -1
  76. package/core/core/lifecycle/kosCoreLifecycle.d.ts +11 -1
  77. package/core/core/lifecycle/kosCoreLifecycle.d.ts.map +1 -1
  78. package/core/core/lifecycle/kosModelLifecycle.d.ts +6 -0
  79. package/core/core/lifecycle/kosModelLifecycle.d.ts.map +1 -1
  80. package/core/core/lifecycle/model-machine.d.ts +6 -0
  81. package/core/core/lifecycle/model-machine.d.ts.map +1 -1
  82. package/core/core/model/kos-fsm-manager.d.ts +6 -0
  83. package/core/core/model/kos-fsm-manager.d.ts.map +1 -1
  84. package/core/core/model/kos-model-component-factory.d.ts +1 -1
  85. package/core/core/model/kos-model-component-factory.d.ts.map +1 -1
  86. package/core/core/model/kos-offline-queue.d.ts +1 -1
  87. package/core/core/model/kos-service-request-manager.d.ts +7 -2
  88. package/core/core/model/kos-service-request-manager.d.ts.map +1 -1
  89. package/core/core/model/kos-subscription-manager.d.ts +2 -2
  90. package/core/core/model/kos-subscription-manager.d.ts.map +1 -1
  91. package/core/core/model/service-response-store.d.ts +4 -16
  92. package/core/core/model/service-response-store.d.ts.map +1 -1
  93. package/core/core/reconnect/reconnect-fixture.d.ts +17 -0
  94. package/core/core/reconnect/reconnect-fixture.d.ts.map +1 -0
  95. package/core/core/registration/model-registration.d.ts.map +1 -1
  96. package/core/core/services/app-startup-service.d.ts +5 -13
  97. package/core/core/services/app-startup-service.d.ts.map +1 -1
  98. package/core/core/services/intent-service.d.ts +3 -12
  99. package/core/core/services/intent-service.d.ts.map +1 -1
  100. package/core/core/transport/mock/mock-frames.d.ts +3 -3
  101. package/core/core/transport/transport.d.ts +1 -1
  102. package/core/core/transport/transport.d.ts.map +1 -1
  103. package/core/core/transport/webSocketTransport.d.ts +10 -0
  104. package/core/core/transport/webSocketTransport.d.ts.map +1 -1
  105. package/core/types/kos-dependency.d.ts +13 -4
  106. package/core/types/kos-dependency.d.ts.map +1 -1
  107. package/core/types/model.d.ts +4 -8
  108. package/core/types/model.d.ts.map +1 -1
  109. package/core/types/service-response-store.d.ts +3 -15
  110. package/core/types/service-response-store.d.ts.map +1 -1
  111. package/core/types/utils/kos-fetch.d.ts +25 -37
  112. package/core/types/utils/kos-fetch.d.ts.map +1 -1
  113. package/core/util/abortable-when.d.ts +5 -6
  114. package/core/util/abortable-when.d.ts.map +1 -1
  115. package/core/util/ancestor-path-visitor.d.ts +14 -20
  116. package/core/util/ancestor-path-visitor.d.ts.map +1 -1
  117. package/core/util/container-utils.d.ts +26 -159
  118. package/core/util/container-utils.d.ts.map +1 -1
  119. package/core/util/date-utils.d.ts +9 -58
  120. package/core/util/date-utils.d.ts.map +1 -1
  121. package/core/util/debounce.d.ts +1 -8
  122. package/core/util/debounce.d.ts.map +1 -1
  123. package/core/util/kos-fetch.d.ts +1 -1
  124. package/core/util/kos-fetch.d.ts.map +1 -1
  125. package/core/util/kos-model-utils.d.ts +10 -11
  126. package/core/util/kos-model-utils.d.ts.map +1 -1
  127. package/core/util/model-attribute-utils.d.ts +5 -22
  128. package/core/util/model-attribute-utils.d.ts.map +1 -1
  129. package/core/util/model-type-guards.d.ts.map +1 -1
  130. package/core/util/model-utils.d.ts.map +1 -1
  131. package/core/util/promise-utils.d.ts +1 -26
  132. package/core/util/promise-utils.d.ts.map +1 -1
  133. package/core/util/service-factory.d.ts +5 -23
  134. package/core/util/service-factory.d.ts.map +1 -1
  135. package/core/util/service-request-error.d.ts +3 -5
  136. package/core/util/service-request-error.d.ts.map +1 -1
  137. package/core/util/service-response.d.ts +12 -67
  138. package/core/util/service-response.d.ts.map +1 -1
  139. package/core/util/transport-not-ready-error.d.ts +11 -13
  140. package/core/util/transport-not-ready-error.d.ts.map +1 -1
  141. package/core/util/when-ready.d.ts +1 -8
  142. package/core/util/when-ready.d.ts.map +1 -1
  143. package/index.cjs +983 -11777
  144. package/index.cjs.map +1 -1
  145. package/index.js +1056 -11854
  146. package/index.js.map +1 -1
  147. package/models/decorators/future-service.d.ts +7 -7
  148. package/models/models/browser-router/browser-router-model.d.ts +10 -39
  149. package/models/models/browser-router/browser-router-model.d.ts.map +1 -1
  150. package/models/models/browser-router/browser-router-registration.d.ts +5 -77
  151. package/models/models/browser-router/browser-router-registration.d.ts.map +1 -1
  152. package/models/models/browser-router/types/index.d.ts +2 -16
  153. package/models/models/canvas-dispatcher/canvas-dispatcher-registration.d.ts +5 -77
  154. package/models/models/canvas-dispatcher/canvas-dispatcher-registration.d.ts.map +1 -1
  155. package/models/models/canvas-renderer/canvas-renderer-registration.d.ts +5 -75
  156. package/models/models/canvas-renderer/canvas-renderer-registration.d.ts.map +1 -1
  157. package/models/models/config-bean/config-bean-model-builder.d.ts +4 -11
  158. package/models/models/config-bean/config-bean-model-builder.d.ts.map +1 -1
  159. package/models/models/config-bean/config-bean-model.d.ts +23 -66
  160. package/models/models/config-bean/config-bean-model.d.ts.map +1 -1
  161. package/models/models/config-bean-prop/config-bean-prop-model.d.ts +15 -62
  162. package/models/models/config-bean-prop/config-bean-prop-model.d.ts.map +1 -1
  163. package/models/models/config-bean-prop/types/index.d.ts +34 -215
  164. package/models/models/device/device-model.d.ts +20 -199
  165. package/models/models/device/device-model.d.ts.map +1 -1
  166. package/models/models/device/device-registration.d.ts +7 -87
  167. package/models/models/device/device-registration.d.ts.map +1 -1
  168. package/models/models/device/types/index.d.ts +5 -34
  169. package/models/models/future/future-aware.d.ts +7 -71
  170. package/models/models/future/future-aware.d.ts.map +1 -1
  171. package/models/models/future/future-model-builder.d.ts +2 -2
  172. package/models/models/future/future-model.d.ts +3 -23
  173. package/models/models/future/future-model.d.ts.map +1 -1
  174. package/models/models/future/future-types.d.ts +28 -145
  175. package/models/models/future/future-types.d.ts.map +1 -1
  176. package/models/models/gpio-chip/gpio-chip-builders.d.ts +14 -0
  177. package/models/models/gpio-chip/gpio-chip-builders.d.ts.map +1 -0
  178. package/models/models/gpio-chip/gpio-chip-container-model.d.ts +2 -1
  179. package/models/models/gpio-chip/gpio-chip-container-model.d.ts.map +1 -1
  180. package/models/models/key-value/key-value-model.d.ts +12 -72
  181. package/models/models/key-value/key-value-model.d.ts.map +1 -1
  182. package/models/models/key-value/key-value-registration.d.ts +5 -77
  183. package/models/models/key-value/key-value-registration.d.ts.map +1 -1
  184. package/models/models/key-value/services/key-value-services.d.ts +13 -72
  185. package/models/models/key-value/services/key-value-services.d.ts.map +1 -1
  186. package/models/models/key-value/types/index.d.ts +3 -46
  187. package/models/models/kos-expression-evaluator/expression-parse-cache.d.ts +29 -0
  188. package/models/models/kos-expression-evaluator/expression-parse-cache.d.ts.map +1 -0
  189. package/models/models/kos-expression-evaluator/index.d.ts +1 -0
  190. package/models/models/kos-expression-evaluator/index.d.ts.map +1 -1
  191. package/models/models/kos-expression-evaluator/kos-expression-evaluator-model.d.ts +73 -105
  192. package/models/models/kos-expression-evaluator/kos-expression-evaluator-model.d.ts.map +1 -1
  193. package/models/models/kos-expression-evaluator/services/kos-expression-evaluator-services.d.ts +2 -12
  194. package/models/models/kos-expression-evaluator/services/kos-expression-evaluator-services.d.ts.map +1 -1
  195. package/models/models/kos-log-manager/kos-log-manager-model.d.ts +7 -46
  196. package/models/models/kos-log-manager/kos-log-manager-model.d.ts.map +1 -1
  197. package/models/models/kos-log-manager/kos-log-manager-registration.d.ts +5 -80
  198. package/models/models/kos-log-manager/kos-log-manager-registration.d.ts.map +1 -1
  199. package/models/models/kos-log-manager/types/index.d.ts +13 -156
  200. package/models/models/kos-time/kos-time-model.d.ts +8 -39
  201. package/models/models/kos-time/kos-time-model.d.ts.map +1 -1
  202. package/models/models/kos-time/kos-time-registration.d.ts +6 -73
  203. package/models/models/kos-time/kos-time-registration.d.ts.map +1 -1
  204. package/models/models/kos-time/types/index.d.ts +3 -58
  205. package/models/models/log-block/log-block-container-model.d.ts +2 -118
  206. package/models/models/log-block/log-block-container-model.d.ts.map +1 -1
  207. package/models/models/log-block/log-block-container-registration.d.ts +5 -75
  208. package/models/models/log-block/log-block-container-registration.d.ts.map +1 -1
  209. package/models/models/log-block/log-block-model.d.ts +5 -168
  210. package/models/models/log-block/log-block-model.d.ts.map +1 -1
  211. package/models/models/log-block/log-block-registration.d.ts +5 -75
  212. package/models/models/log-block/log-block-registration.d.ts.map +1 -1
  213. package/models/models/log-block/types/index.d.ts +14 -81
  214. package/models/models/log-stream/log-stream-container-model.d.ts +8 -35
  215. package/models/models/log-stream/log-stream-container-model.d.ts.map +1 -1
  216. package/models/models/log-stream/log-stream-container-registration.d.ts +5 -75
  217. package/models/models/log-stream/log-stream-container-registration.d.ts.map +1 -1
  218. package/models/models/log-stream/log-stream-model.d.ts +8 -29
  219. package/models/models/log-stream/log-stream-model.d.ts.map +1 -1
  220. package/models/models/log-stream/log-stream-registration.d.ts +5 -75
  221. package/models/models/log-stream/log-stream-registration.d.ts.map +1 -1
  222. package/models/models/log-stream/types/index.d.ts +5 -60
  223. package/models/models/network-interface/network-interface-container-model.d.ts +6 -35
  224. package/models/models/network-interface/network-interface-container-model.d.ts.map +1 -1
  225. package/models/models/network-interface/network-interface-container-registration.d.ts +5 -73
  226. package/models/models/network-interface/network-interface-container-registration.d.ts.map +1 -1
  227. package/models/models/network-interface/network-interface-model.d.ts +5 -43
  228. package/models/models/network-interface/network-interface-model.d.ts.map +1 -1
  229. package/models/models/network-interface/network-interface-registration.d.ts +5 -73
  230. package/models/models/network-interface/network-interface-registration.d.ts.map +1 -1
  231. package/models/models/network-interface/types/index.d.ts +2 -16
  232. package/models/models/ota/ota-model.d.ts +11 -39
  233. package/models/models/ota/ota-model.d.ts.map +1 -1
  234. package/models/models/ota/ota-registration.d.ts +5 -77
  235. package/models/models/ota/ota-registration.d.ts.map +1 -1
  236. package/models/models/ota/types/index.d.ts +2 -141
  237. package/models/models/region-info/types/index.d.ts +19 -99
  238. package/models/models/region-info/types/index.d.ts.map +1 -1
  239. package/models/models/software-info/services/software-info-services.d.ts +2 -14
  240. package/models/models/software-info/services/software-info-services.d.ts.map +1 -1
  241. package/models/models/software-info/software-info-model.d.ts +3 -39
  242. package/models/models/software-info/software-info-model.d.ts.map +1 -1
  243. package/models/models/software-info/software-info-registration.d.ts +6 -73
  244. package/models/models/software-info/software-info-registration.d.ts.map +1 -1
  245. package/models/models/software-info/types/index.d.ts +6 -20
  246. package/models/models/state-bean/state-bean-model.d.ts +10 -41
  247. package/models/models/state-bean/state-bean-model.d.ts.map +1 -1
  248. package/models/models/state-bean/state-bean-registration.d.ts +6 -73
  249. package/models/models/state-bean/state-bean-registration.d.ts.map +1 -1
  250. package/models/models/state-bean/types/index.d.ts +4 -84
  251. package/models/models/state-prop/state-prop-model.d.ts +6 -40
  252. package/models/models/state-prop/state-prop-model.d.ts.map +1 -1
  253. package/models/models/state-prop/state-prop-registration.d.ts +6 -73
  254. package/models/models/state-prop/state-prop-registration.d.ts.map +1 -1
  255. package/models/models/state-prop/types/index.d.ts +5 -37
  256. package/models/models/storage-device/storage-device-container-model.d.ts +7 -273
  257. package/models/models/storage-device/storage-device-container-model.d.ts.map +1 -1
  258. package/models/models/storage-device/storage-device-container-registration.d.ts +5 -75
  259. package/models/models/storage-device/storage-device-container-registration.d.ts.map +1 -1
  260. package/models/models/storage-device/storage-device-model.d.ts +3 -49
  261. package/models/models/storage-device/storage-device-model.d.ts.map +1 -1
  262. package/models/models/storage-device/storage-device-registration.d.ts +5 -75
  263. package/models/models/storage-device/storage-device-registration.d.ts.map +1 -1
  264. package/models/models/storage-device/types/index.d.ts +13 -82
  265. package/models/models/studio-properties/studio-properties-model.d.ts +13 -36
  266. package/models/models/studio-properties/studio-properties-model.d.ts.map +1 -1
  267. package/models/models/studio-properties/studio-properties-registration.d.ts +5 -75
  268. package/models/models/studio-properties/studio-properties-registration.d.ts.map +1 -1
  269. package/models/models/studio-properties/types/index.d.ts +2 -24
  270. package/models/models/translation/descriptor-merge.d.ts +13 -17
  271. package/models/models/translation/descriptor-merge.d.ts.map +1 -1
  272. package/models/models/translation/services/translation-services.d.ts +19 -77
  273. package/models/models/translation/services/translation-services.d.ts.map +1 -1
  274. package/models/models/translation/test-harness.d.ts +6 -8
  275. package/models/models/translation/test-harness.d.ts.map +1 -1
  276. package/models/models/translation/translation-container-model.d.ts +7 -59
  277. package/models/models/translation/translation-container-model.d.ts.map +1 -1
  278. package/models/models/translation/translation-container-registration.d.ts +6 -73
  279. package/models/models/translation/translation-container-registration.d.ts.map +1 -1
  280. package/models/models/translation/translation-model.d.ts +17 -50
  281. package/models/models/translation/translation-model.d.ts.map +1 -1
  282. package/models/models/translation/translation-registration.d.ts +6 -73
  283. package/models/models/translation/translation-registration.d.ts.map +1 -1
  284. package/models/models/translation/types/index.d.ts +51 -276
  285. package/models/models/trouble/trouble-registration.d.ts +6 -73
  286. package/models/models/trouble/trouble-registration.d.ts.map +1 -1
  287. package/models/models/trouble/types/index.d.ts +17 -188
  288. package/models/models/trouble/utils/is-trouble-aware.d.ts +4 -85
  289. package/models/models/trouble/utils/is-trouble-aware.d.ts.map +1 -1
  290. package/models/models/trouble-container/trouble-builders.d.ts +11 -0
  291. package/models/models/trouble-container/trouble-builders.d.ts.map +1 -0
  292. package/models/models/trouble-container/trouble-container-model.d.ts +2 -1
  293. package/models/models/trouble-container/trouble-container-model.d.ts.map +1 -1
  294. package/models/models/usb-update/usb-update-container-registration.d.ts +5 -75
  295. package/models/models/usb-update/usb-update-container-registration.d.ts.map +1 -1
  296. package/models/models/usb-update/usb-update-registration.d.ts +5 -75
  297. package/models/models/usb-update/usb-update-registration.d.ts.map +1 -1
  298. package/models/types/cancellable-promise.d.ts +6 -9
  299. package/models/types/cancellable-promise.d.ts.map +1 -1
  300. package/models/utils/await-future-call.d.ts +9 -21
  301. package/models/utils/await-future-call.d.ts.map +1 -1
  302. package/models/utils/cancellable-future-call.d.ts +8 -19
  303. package/models/utils/cancellable-future-call.d.ts.map +1 -1
  304. package/models/utils/cancellable-service.d.ts +14 -23
  305. package/models/utils/cancellable-service.d.ts.map +1 -1
  306. package/models/utils/conversion-utils.d.ts +8 -48
  307. package/models/utils/conversion-utils.d.ts.map +1 -1
  308. package/models/utils/persistence-store.d.ts +1 -1
  309. package/models/utils/service.d.ts +14 -48
  310. package/models/utils/service.d.ts.map +1 -1
  311. package/models/utils/services/kos/daily/service.d.ts +5 -5
  312. package/models/utils/services/kos/daily/service.d.ts.map +1 -1
  313. package/models/utils/services/vfs/daily/service.d.ts +5 -5
  314. package/models/utils/services/vfs/daily/service.d.ts.map +1 -1
  315. package/models/utils/timer-manager.d.ts.map +1 -1
  316. package/package.json +2 -2
  317. package/{index-CRb8ucfF.cjs → software-info-registration-Le3V0a6v.cjs} +12187 -986
  318. package/software-info-registration-Le3V0a6v.cjs.map +1 -0
  319. package/software-info-registration-kSGacOka.js +24809 -0
  320. package/software-info-registration-kSGacOka.js.map +1 -0
  321. package/testing/index.d.ts +32 -34
  322. package/testing/index.d.ts.map +1 -1
  323. package/testing.cjs +2 -1
  324. package/testing.cjs.map +1 -1
  325. package/testing.js +2 -1
  326. package/testing.js.map +1 -1
  327. package/ui/components/connection-dev-button/connection-dev-button-styles.d.ts +9 -0
  328. package/ui/components/connection-dev-button/connection-dev-button-styles.d.ts.map +1 -0
  329. package/ui/components/connection-dev-button/index.d.ts +36 -0
  330. package/ui/components/connection-dev-button/index.d.ts.map +1 -0
  331. package/ui/components/connection-dev-button/use-connection-dev-state.d.ts +29 -0
  332. package/ui/components/connection-dev-button/use-connection-dev-state.d.ts.map +1 -0
  333. package/ui/components/index.d.ts +1 -0
  334. package/ui/components/index.d.ts.map +1 -1
  335. package/ui/features/canvas/hooks/use-image-renderer.d.ts +5 -4
  336. package/ui/features/canvas/hooks/use-image-renderer.d.ts.map +1 -1
  337. package/ui/hooks/use-function-warmup.d.ts +4 -14
  338. package/ui/hooks/use-function-warmup.d.ts.map +1 -1
  339. package/ui/hooks/use-kos-date-formats.d.ts +15 -29
  340. package/ui/hooks/use-kos-date-formats.d.ts.map +1 -1
  341. package/ui/hooks/use-kos-region-timezones.d.ts +4 -55
  342. package/ui/hooks/use-kos-region-timezones.d.ts.map +1 -1
  343. package/ui/hooks/use-kos-regions.d.ts +11 -23
  344. package/ui/hooks/use-kos-regions.d.ts.map +1 -1
  345. package/ui/hooks/use-kos-time-formats.d.ts +16 -31
  346. package/ui/hooks/use-kos-time-formats.d.ts.map +1 -1
  347. package/ui/hooks/use-kos-unit-systems.d.ts +13 -27
  348. package/ui/hooks/use-kos-unit-systems.d.ts.map +1 -1
  349. package/ui/hooks/view-model/use-view-model.d.ts +6 -31
  350. package/ui/hooks/view-model/use-view-model.d.ts.map +1 -1
  351. package/ui/policies/reload-on-disconnect-policy.d.ts +5 -6
  352. package/ui/policies/reload-on-disconnect-policy.d.ts.map +1 -1
  353. package/index-CRb8ucfF.cjs.map +0 -1
  354. package/index-YzHb2lnB.js +0 -13607
  355. package/index-YzHb2lnB.js.map +0 -1
@@ -1,96 +1,111 @@
1
1
  import { IKosModelContainer } from '../kos-container-model';
2
2
  import { IKosDataModel } from '../kosModel';
3
3
  type MaybePromise<T> = T | Promise<T>;
4
+ /**
5
+ * How the injected `reconcile(list)` turns a full list of DTOs into the container's
6
+ * contents. Pass named functions from the model's builders module.
7
+ *
8
+ * @template T The type of models contained in the container
9
+ * @template D The incoming DTO type
10
+ * @template M The DTO type after `idMapper` (defaults to D)
11
+ *
12
+ * @example
13
+ * ```typescript
14
+ * import { createFolderModel, updateFolderModel } from "./folder-builders";
15
+ *
16
+ * @kosContainerAware<FolderModel>({
17
+ * reconcile: { create: createFolderModel, update: updateFolderModel },
18
+ * })
19
+ * ```
20
+ *
21
+ * @kosService core.container-aware
22
+ * @kosApiLevel 25
23
+ */
24
+ export interface KosContainerReconcileOptions<T extends IKosDataModel = IKosDataModel, D extends {
25
+ id: string;
26
+ } = any, M extends {
27
+ id: string;
28
+ } = D> {
29
+ /**
30
+ * Builds a model for a DTO whose id is not in the container.
31
+ */
32
+ create: (dto: M) => T;
33
+ /**
34
+ * Updates the existing model for a DTO whose id is already in the container, in
35
+ * place, so the model keeps its identity. Without it an existing id is passed to
36
+ * `create` and the new model replaces the old one.
37
+ */
38
+ update?: (dto: M, model: T) => void;
39
+ /**
40
+ * Maps each DTO before reconciling, typically to build a compound model id.
41
+ * `create`, `update` and `afterCreate` receive the mapped DTO.
42
+ */
43
+ idMapper?: (dto: D) => M;
44
+ /**
45
+ * Keeps only the DTOs it returns true for. Applied before the delta, so the ids
46
+ * it drops are removed from the container.
47
+ */
48
+ filter?: (dto: D) => boolean;
49
+ /**
50
+ * Runs after `create` and before the new model is added to the container.
51
+ */
52
+ afterCreate?: (model: T, dto: M) => void;
53
+ }
4
54
  /**
5
55
  * Configuration options for the @kosContainerAware decorator.
6
56
  *
7
57
  * @template T The type of models contained in the container (must extend IKosDataModel)
58
+ * @template D The DTO type `reconcile` receives
59
+ * @template M The DTO type after `reconcile.idMapper` (defaults to D)
8
60
  *
9
61
  * @kosService core.container-aware
10
62
  * @kosApiLevel 13
11
63
  */
12
- export interface KosContainerAwareOptions<T extends IKosDataModel = IKosDataModel> {
64
+ export interface KosContainerAwareOptions<T extends IKosDataModel = IKosDataModel, D extends {
65
+ id: string;
66
+ } = any, M extends {
67
+ id: string;
68
+ } = D> {
13
69
  /**
14
- * Container property name on the model instance.
70
+ * Name of the model property that holds the container.
15
71
  *
16
72
  * @default "container"
17
- * @example
18
- * ```typescript
19
- * @kosContainerAware({ containerProperty: "devices" })
20
- * class DeviceContainer {
21
- * // Access via: this.devices.addModel(...)
22
- * }
23
- * ```
24
73
  */
25
74
  containerProperty?: string;
26
75
  /**
27
- * Whether to include convenience methods (getModel, addModel, removeModel, addAll, removeAll,
28
- * removeAndDestroy, removeAndDestroyAll).
76
+ * Whether to inject the convenience methods (getModel, addModel, removeModel, addAll,
77
+ * removeAll, removeAndDestroy, removeAndDestroyAll) onto the model.
29
78
  *
30
79
  * @default true
31
- * @example
32
- * ```typescript
33
- * @kosContainerAware({ includeMethods: false })
34
- * class Container {
35
- * // Only this.container property available, no convenience methods
36
- * }
37
- * ```
38
80
  */
39
81
  includeMethods?: boolean;
40
82
  /**
41
- * Whether to include reactive getters (models, data).
83
+ * Whether to inject the reactive `models` and `data` getters onto the model.
42
84
  *
43
85
  * @default true
44
- * @example
45
- * ```typescript
46
- * @kosContainerAware({ includeGetters: false })
47
- * class Container {
48
- * // No this.models or this.data getters, use this.container.data directly
49
- * }
50
- * ```
51
86
  */
52
87
  includeGetters?: boolean;
53
88
  /**
54
- * Container-specific configuration options passed to KosModelContainer constructor.
55
- *
56
- * @example
57
- * ```typescript
58
- * @kosContainerAware({
59
- * containerOptions: {
60
- * sortKey: "name",
61
- * indexMap: {
62
- * byType: "deviceType",
63
- * active: (device) => device.isOnline
64
- * },
65
- * parentId: "custom-parent", // Overrides automatic inference
66
- * extensionId: "device-manager",
67
- * maxCapacity: 1000, // Safety net for unbounded growth
68
- * evictionStrategy: "fifo"
69
- * }
70
- * })
71
- * ```
89
+ * Options passed to the KosModelContainer constructor.
72
90
  */
73
91
  containerOptions?: {
74
92
  /** Default property to sort models by */
75
93
  sortKey?: keyof T;
76
94
  /**
77
- * Index mapping for efficient queries. Keys are index names, values are either:
78
- * - Property names (string keys) for simple property-based indexing
79
- * - Functions that return index keys for complex logic
95
+ * Indexes maintained by the container, keyed by index name. Each value is either a
96
+ * model property name or a function returning the index key(s) for a model.
80
97
  *
81
98
  * @example
82
99
  * ```typescript
83
100
  * indexMap: {
84
- * byStatus: "connectionStatus", // Property-based
85
- * byType: (device) => device.type.toLowerCase(), // Function-based
86
- * needsUpdate: (device) => device.version < "2.0" // Boolean logic
101
+ * byStatus: "connectionStatus",
102
+ * byType: (device) => device.type.toLowerCase(),
87
103
  * }
88
104
  * ```
89
105
  */
90
106
  indexMap?: Record<string, keyof T | ((model: T) => MaybePromise<string | string[] | undefined>)>;
91
107
  /**
92
- * Parent model ID for the container. If not provided, automatically uses
93
- * the modelId parameter from the model's constructor.
108
+ * Parent model ID for the container. Defaults to the owning model's ID.
94
109
  *
95
110
  * @default Inferred from constructor modelId parameter
96
111
  */
@@ -98,27 +113,19 @@ export interface KosContainerAwareOptions<T extends IKosDataModel = IKosDataMode
98
113
  /** Extension identifier for the container */
99
114
  extensionId?: string;
100
115
  /**
101
- * SAFETY NET: Maximum number of models this container can hold.
102
- * When exceeded, models are automatically evicted and destroyed based on evictionStrategy.
103
- *
104
- * **Primary use case**: Prevent memory overflow when cleanup handlers are missing or
105
- * data becomes inconsistent. Set higher than normal usage to catch edge cases.
116
+ * Maximum number of models the container holds before it evicts and destroys
117
+ * models according to `evictionStrategy`.
106
118
  *
107
- * @example
108
- * ```typescript
109
- * containerOptions: {
110
- * maxCapacity: 10000, // Safety net: expect ~100-1000 normally
111
- * evictionStrategy: 'fifo'
112
- * }
113
- * ```
119
+ * This is a safety net against unbounded growth when cleanup handlers are missing,
120
+ * so set it well above normal usage.
114
121
  */
115
122
  maxCapacity?: number;
116
123
  /**
117
124
  * Strategy for selecting which models to evict when maxCapacity is exceeded.
118
125
  *
119
- * - **fifo** (default): Remove oldest models first - best for event streams, logs
120
- * - **lru**: Remove least recently accessed models - best for caches
121
- * - **custom**: Use customEvictionFilter to determine eviction candidates
126
+ * - **fifo** (default): oldest models first; suits event streams and logs
127
+ * - **lru**: least recently accessed models first; suits caches
128
+ * - **custom**: models returned by `customEvictionFilter`
122
129
  *
123
130
  * @default 'fifo'
124
131
  */
@@ -129,221 +136,55 @@ export interface KosContainerAwareOptions<T extends IKosDataModel = IKosDataMode
129
136
  */
130
137
  evictionBatchSize?: number;
131
138
  /**
132
- * Custom filter function for 'custom' eviction strategy.
133
- * Should return models that are candidates for eviction.
134
- *
135
- * @example
136
- * ```typescript
137
- * customEvictionFilter: (models) => {
138
- * return models.filter(m =>
139
- * m.status === 'resolved' &&
140
- * Date.now() - m.resolvedAt > 3600000
141
- * );
142
- * }
143
- * ```
139
+ * Filter for the 'custom' eviction strategy. Returns the models that are
140
+ * candidates for eviction.
144
141
  */
145
142
  customEvictionFilter?: (models: T[]) => T[];
146
143
  };
147
144
  /**
148
- * Custom name for the reactive models array getter.
145
+ * Name of the getter that returns the container.
149
146
  *
150
147
  * @default "models"
151
- * @example
152
- * ```typescript
153
- * @kosContainerAware({ modelsProperty: "items" })
154
- * class Container {
155
- * get items() { return this.container.data; } // Instead of 'models'
156
- * }
157
- * ```
158
148
  */
159
149
  modelsProperty?: string;
160
150
  /**
161
- * Legacy compatibility mode. Uses '_models' as the container property name
162
- * instead of 'container' for backward compatibility with existing code.
151
+ * Uses '_models' as the container property name, for code written before
152
+ * `containerProperty` existed.
163
153
  *
164
154
  * @default false
165
155
  * @deprecated Use containerProperty instead for new code
166
156
  */
167
157
  legacy?: boolean;
158
+ /**
159
+ * Injects `reconcile(list)`, which makes the container match a full list of DTOs:
160
+ * ids missing from the list are removed, existing ids are updated in place and new
161
+ * ids are created and added, in one batch. Call it from `load()` and from topic
162
+ * handlers that receive the full list.
163
+ *
164
+ * @kosApiLevel 25
165
+ */
166
+ reconcile?: KosContainerReconcileOptions<T, D, M>;
168
167
  }
169
168
  /**
170
- * Interface for models using @kosContainerAware decorator.
171
- *
172
- * **IMPORTANT**: Use TypeScript interface merging to add container management properties to your model class.
173
- * This provides full type safety and IntelliSense support for all injected container functionality.
174
- *
175
- * ## Interface Merging Pattern
176
- *
177
- * ```typescript
178
- * // 1. Declare interface merging BEFORE the class
179
- * interface MyContainerModelImpl extends KosContainerAware<ItemModel> {}
180
- *
181
- * // 2. Apply decorator and implement the class
182
- * @kosModel("my-container-model")
183
- * @kosContainerAware<ItemModel>()
184
- * export class MyContainerModelImpl implements IKosDataModel {
185
- * // All container properties are now available with full type safety
186
- * }
187
- * ```
188
- *
189
- * ## Custom Container Property Name
190
- *
191
- * When using a custom `containerProperty` name, use `KosContainerAwareWithProp`:
192
- *
193
- * ```typescript
194
- * // For custom container property name
195
- * interface DeviceManagerImpl extends KosContainerAwareWithProp<DeviceModel, "devices"> {}
196
- *
197
- * @kosContainerAware<DeviceModel>({ containerProperty: "devices" })
198
- * class DeviceManagerImpl implements IKosDataModel {
199
- * // Access via: this.devices instead of this.container
200
- * }
201
- * ```
202
- *
203
- * ## Injected Properties and Methods
204
- *
205
- * The decorator automatically injects the following members (configurable via options):
206
- *
207
- * - **`container`**: Core KosModelContainer instance for direct access (or custom name via `containerProperty`)
208
- * - **`getModel(id)`**: Retrieve a model by ID from the container
209
- * - **`addModel(model)`**: Add a model to the container
210
- * - **`removeModel(id)`**: Remove a model from the container by ID (does not destroy)
211
- * - **`addAll(models)`**: Add multiple models to the container at once
212
- * - **`removeAll(ids)`**: Remove multiple models from the container by IDs (does not destroy)
213
- * - **`removeAndDestroy(id)`**: Remove a model from the container and destroy it
214
- * - **`removeAndDestroyAll(ids)`**: Remove multiple models from the container and destroy them
215
- * - **`models`**: Readonly KosModelContainer instance (compatible with IKosModelHolder)
216
- * - **`data`**: Reactive array of all model instances (compatible with IKosModelHolder)
217
- *
218
- * All injected getters are reactive and will automatically update UI components when container contents change.
219
- *
220
- * @template T The type of models contained in the container (must extend IKosDataModel)
221
- *
222
- * @example
223
- * ```typescript
224
- * // Basic usage with minimal configuration
225
- * interface DeviceContainerModelImpl extends KosContainerAware<DeviceModel> {}
226
- *
227
- * @kosModel("device-container-model")
228
- * @kosContainerAware<DeviceModel>()
229
- * class DeviceContainerModelImpl implements IKosDataModel {
230
- * constructor(modelId: string, options: ContainerOptions, context: KosCreationContext) {
231
- * this.id = modelId;
232
- * // Container automatically injected with parentId: modelId
233
- * }
234
- *
235
- * // Use injected methods
236
- * addDevice(device: DeviceModel): void {
237
- * this.addModel(device); // Method injected by decorator
238
- * }
239
- *
240
- * // Use injected reactive getters
241
- * get deviceCount(): number {
242
- * return this.data.length; // Reactive array getter injected by decorator
243
- * }
244
- * }
245
- * ```
246
- *
247
- * @example
248
- * ```typescript
249
- * // Advanced usage with indexing and custom configuration
250
- * interface UserContainerModelImpl extends KosContainerAware<UserModel> {}
251
- *
252
- * @kosModel("user-container-model")
253
- * @kosContainerAware<UserModel>({
254
- * containerOptions: {
255
- * indexMap: {
256
- * byRole: "role",
257
- * byDepartment: "department",
258
- * active: (user) => user.status === "active"
259
- * },
260
- * sortKey: "lastName"
261
- * }
262
- * })
263
- * class UserContainerModelImpl implements IKosDataModel {
264
- * // Access indexed data via injected container
265
- * getActiveUsers(): UserModel[] {
266
- * return this.container.getIndexByKey("active", true);
267
- * }
169
+ * The `reconcile` member @kosContainerAware injects when the decorator declares the
170
+ * `reconcile` option.
268
171
  *
269
- * getUsersByRole(role: string): UserModel[] {
270
- * return this.container.getIndexByKey("byRole", role);
271
- * }
272
- * }
273
- * ```
274
- *
275
- * @see {@link kosContainerAware} - The decorator function
276
- * @see {@link KosContainerAwareOptions} - Configuration options
172
+ * @template D The DTO type the list holds
277
173
  *
278
174
  * @kosService core.container-aware
279
- * @kosApiLevel 13
175
+ * @kosApiLevel 25
280
176
  */
281
- export interface KosContainerAware<T extends IKosDataModel = IKosDataModel> {
282
- /**
283
- * Core container that manages the collection of models.
284
- * Provides methods to add, remove, and query model instances.
285
- * Automatically injected by @kosContainerAware decorator.
286
- */
287
- container: IKosModelContainer<T>;
288
- /**
289
- * Retrieves a model from the container by its ID.
290
- * @param id - The unique identifier of the model to retrieve
291
- * @returns The model instance if found, undefined otherwise
292
- */
293
- getModel(id: string): T | undefined;
294
- /**
295
- * Adds a model to the container.
296
- * @param model - The model instance to add
297
- */
298
- addModel(model: T): void;
177
+ export interface KosContainerReconcile<D> {
299
178
  /**
300
- * Removes a model from the container by its ID.
301
- * @param id - The unique identifier of the model to remove
302
- */
303
- removeModel(id: string): void;
304
- /**
305
- * Adds multiple models to the container at once.
306
- * @param models - Array of model instances to add
307
- * @kosApiLevel 19
308
- */
309
- addAll(models: T[]): void;
310
- /**
311
- * Removes multiple models from the container by their IDs.
312
- * @param ids - Array of unique identifiers of the models to remove
313
- * @kosApiLevel 19
314
- */
315
- removeAll(ids: string[]): void;
316
- /**
317
- * Removes a model from the container and destroys it.
318
- * Convenience method that combines removeModel() and destroyKosModel().
319
- * @param id - The unique identifier of the model to remove and destroy
320
- * @kosApiLevel 19
321
- */
322
- removeAndDestroy(id: string): Promise<void>;
323
- /**
324
- * Removes multiple models from the container and destroys them.
325
- * Convenience method that combines removeAll() and destroyKosModel().
326
- * @param ids - Array of unique identifiers of the models to remove and destroy
327
- * @kosApiLevel 19
328
- */
329
- removeAndDestroyAll(ids: string[]): Promise<void>;
330
- /**
331
- * The container instance managing the models.
332
- * Readonly property that provides access to the KosModelContainer.
333
- * Compatible with IKosModelHolder interface.
334
- * Updates automatically when models are added or removed.
335
- */
336
- readonly models: IKosModelContainer<T>;
337
- /**
338
- * Reactive array of all model instances in the container.
339
- * This is the actual array of models, compatible with IKosModelHolder interface.
340
- * Updates automatically when models are added or removed.
179
+ * Makes the container match `list`: removes models whose id is missing, updates
180
+ * existing models in place and adds new ones.
181
+ * @param list - The full list of DTOs
341
182
  */
342
- data: T[];
183
+ reconcile(list: D[]): void;
343
184
  }
185
+ type KosContainerReconcileFor<D> = [D] extends [never] ? unknown : KosContainerReconcile<D>;
344
186
  /**
345
- * Base interface providing common container-aware methods and properties.
346
- * Used internally by both KosContainerAware and KosContainerAwareWithProp.
187
+ * Container-aware members shared by KosContainerAware and KosContainerAwareWithProp.
347
188
  *
348
189
  * @template T The type of models contained in the container
349
190
  *
@@ -363,7 +204,7 @@ export interface KosContainerAwareBase<T extends IKosDataModel = IKosDataModel>
363
204
  */
364
205
  addModel(model: T): void;
365
206
  /**
366
- * Removes a model from the container by its ID.
207
+ * Removes a model from the container by its ID without destroying it.
367
208
  * @param id - The unique identifier of the model to remove
368
209
  */
369
210
  removeModel(id: string): void;
@@ -374,187 +215,145 @@ export interface KosContainerAwareBase<T extends IKosDataModel = IKosDataModel>
374
215
  */
375
216
  addAll(models: T[]): void;
376
217
  /**
377
- * Removes multiple models from the container by their IDs.
218
+ * Removes multiple models from the container by their IDs without destroying them.
378
219
  * @param ids - Array of unique identifiers of the models to remove
379
220
  * @kosApiLevel 19
380
221
  */
381
222
  removeAll(ids: string[]): void;
382
223
  /**
383
224
  * Removes a model from the container and destroys it.
384
- * Convenience method that combines removeModel() and destroyKosModel().
385
225
  * @param id - The unique identifier of the model to remove and destroy
386
226
  * @kosApiLevel 19
387
227
  */
388
228
  removeAndDestroy(id: string): Promise<void>;
389
229
  /**
390
230
  * Removes multiple models from the container and destroys them.
391
- * Convenience method that combines removeAll() and destroyKosModel().
392
231
  * @param ids - Array of unique identifiers of the models to remove and destroy
393
232
  * @kosApiLevel 19
394
233
  */
395
234
  removeAndDestroyAll(ids: string[]): Promise<void>;
396
235
  /**
397
- * The container instance managing the models.
398
- * Readonly property that provides access to the KosModelContainer.
399
- * Compatible with IKosModelHolder interface.
400
- * Updates automatically when models are added or removed.
236
+ * The container instance, compatible with IKosModelHolder.
401
237
  */
402
238
  readonly models: IKosModelContainer<T>;
403
239
  /**
404
- * Reactive array of all model instances in the container.
405
- * This is the actual array of models, compatible with IKosModelHolder interface.
406
- * Updates automatically when models are added or removed.
240
+ * Reactive array of all model instances in the container, compatible with
241
+ * IKosModelHolder.
407
242
  */
408
243
  data: T[];
409
244
  }
410
245
  /**
411
- * Interface for models using @kosContainerAware decorator with a custom container property name.
246
+ * Members that @kosContainerAware injects into a model.
412
247
  *
413
- * Use this interface when you specify a custom `containerProperty` in the decorator options
414
- * to get proper type safety for the custom property name.
248
+ * Declare an interface with the same name as the class that extends this type so the
249
+ * injected members are typed (TypeScript interface merging). When the decorator uses a
250
+ * custom `containerProperty`, extend {@link KosContainerAwareWithProp} instead.
415
251
  *
416
- * @template T The type of models contained in the container
417
- * @template P The custom property name for the container (string literal type)
252
+ * The `models` and `data` getters are reactive, so a `kosComponent` reading them
253
+ * re-renders when the container contents change.
254
+ *
255
+ * Pass the DTO type as `D` when the decorator declares the `reconcile` option, so
256
+ * `this.reconcile(list)` is typed.
257
+ *
258
+ * @template T The type of models contained in the container (must extend IKosDataModel)
259
+ * @template D The DTO type `reconcile` receives; omit it when `reconcile` is not declared
418
260
  *
419
261
  * @example
420
262
  * ```typescript
421
- * // Specify the custom property name "devices" in both the interface and decorator
422
- * interface DeviceManagerImpl extends KosContainerAwareWithProp<DeviceModel, "devices"> {}
423
- *
424
- * @kosModel("device-manager")
425
- * @kosContainerAware<DeviceModel>({ containerProperty: "devices" })
426
- * class DeviceManagerImpl implements IKosDataModel {
427
- * constructor(modelId: string, options: ContainerOptions, context: KosCreationContext) {
428
- * this.id = modelId;
429
- * }
263
+ * interface DeviceContainerModelImpl extends KosContainerAware<DeviceModel> {}
430
264
  *
431
- * addDevice(device: DeviceModel): void {
432
- * // Access container via custom property name
433
- * this.devices.addModel(device);
265
+ * @kosModel("device-container-model")
266
+ * @kosContainerAware<DeviceModel>({
267
+ * containerOptions: { indexMap: { byType: "deviceType" } },
268
+ * })
269
+ * class DeviceContainerModelImpl implements IKosDataModel {
270
+ * get deviceCount(): number {
271
+ * return this.data.length;
434
272
  * }
435
273
  *
436
- * getDeviceCount(): number {
437
- * // The 'data' property is still available
438
- * return this.data.length;
274
+ * devicesOfType(type: string): DeviceModel[] {
275
+ * return this.container.getIndexByKey("byType", type);
439
276
  * }
440
277
  * }
441
278
  * ```
442
279
  *
443
280
  * @example
444
281
  * ```typescript
445
- * // Custom property for user management
446
- * interface UserManagerImpl extends KosContainerAwareWithProp<UserModel, "users"> {}
447
- *
448
- * @kosContainerAware<UserModel>({
449
- * containerProperty: "users",
450
- * containerOptions: {
451
- * indexMap: {
452
- * byRole: "role"
453
- * }
454
- * }
282
+ * import { createFolderModel, updateFolderModel, type FolderDto } from "./folder-builders";
283
+ *
284
+ * interface FolderContainerModelImpl extends KosContainerAware<FolderModel, FolderDto> {}
285
+ *
286
+ * @kosModel("folder-container-model")
287
+ * @kosContainerAware<FolderModel>({
288
+ * reconcile: { create: createFolderModel, update: updateFolderModel },
455
289
  * })
456
- * class UserManagerImpl implements IKosDataModel {
457
- * getUsersByRole(role: string): UserModel[] {
458
- * // Access via this.users instead of this.container
459
- * return this.users.getIndexByKey("byRole", role);
290
+ * class FolderContainerModelImpl implements IKosDataModel {
291
+ * async load(): Promise<void> {
292
+ * const [error, folders] = await this.fetchFolders();
293
+ * if (!error) this.reconcile(folders);
460
294
  * }
461
295
  * }
462
296
  * ```
463
297
  *
298
+ * @see {@link kosContainerAware} - The decorator function
299
+ * @see {@link KosContainerAwareOptions} - Configuration options
300
+ *
464
301
  * @kosService core.container-aware
302
+ * @kosApiLevel 13
465
303
  */
466
- export type KosContainerAwareWithProp<T extends IKosDataModel = IKosDataModel, P extends string = "container"> = KosContainerAwareBase<T> & {
467
- [K in P]: IKosModelContainer<T>;
468
- };
304
+ export type KosContainerAware<T extends IKosDataModel = IKosDataModel, D = never> = KosContainerAwareBase<T> & {
305
+ /**
306
+ * Container that manages the collection of models.
307
+ */
308
+ container: IKosModelContainer<T>;
309
+ } & KosContainerReconcileFor<D>;
469
310
  /**
470
- * Class decorator that automatically adds container management capabilities to a KOS model.
471
- *
472
- * This decorator eliminates the need for manual container setup by:
473
- * - **Adding a container property** (default: `container`) for managing model collections
474
- * - **Adding convenience methods** (`getModel`, `addModel`, `removeModel`, `addAll`, `removeAll`, `removeAndDestroy`, `removeAndDestroyAll`) if `includeMethods` is true (default)
475
- * - **Adding reactive getters** (`models`, `data`) if `includeGetters` is true (default)
476
- * - **Automatically inferring parentId** from the model's constructor `modelId` parameter
477
- * - **Registering container as @kosChild** for proper lifecycle management and cleanup
478
- * - **Supporting custom indexing** via `containerOptions.indexMap` for efficient queries
479
- *
480
- * ## Automatic Hierarchy Integration
481
- *
482
- * The decorator automatically registers the container as a `@kosChild`, ensuring:
483
- * - Proper lifecycle management (init, load, destroy)
484
- * - Automatic cleanup when parent model is destroyed
485
- * - Participation in the KOS reactive system
486
- * - Memory management and observer disposal
311
+ * Members that @kosContainerAware injects into a model whose decorator sets a custom
312
+ * `containerProperty`. `P` must match that property name.
487
313
  *
488
- * ## TypeScript Usage
489
- *
490
- * **IMPORTANT**: Use TypeScript interface merging to get proper type information:
314
+ * @template T The type of models contained in the container
315
+ * @template P The custom property name for the container (string literal type)
316
+ * @template D The DTO type `reconcile` receives; omit it when `reconcile` is not declared
491
317
  *
318
+ * @example
492
319
  * ```typescript
493
- * interface MyContainerModelImpl extends KosContainerAware<MyItemModel> {}
320
+ * interface DeviceManagerImpl extends KosContainerAwareWithProp<DeviceModel, "devices"> {}
494
321
  *
495
- * @kosContainerAware<MyItemModel>()
496
- * class MyContainerModelImpl implements IKosDataModel {
497
- * // All container properties are now available with full type safety
322
+ * @kosModel("device-manager")
323
+ * @kosContainerAware<DeviceModel>({ containerProperty: "devices" })
324
+ * class DeviceManagerImpl implements IKosDataModel {
325
+ * addDevice(device: DeviceModel): void {
326
+ * this.devices.addModel(device);
327
+ * }
498
328
  * }
499
329
  * ```
500
330
  *
501
- * ## Model Lifecycle: removeModel vs removeAndDestroy
502
- *
503
- * The decorator provides both removal and destruction methods with different purposes:
504
- *
505
- * **removeModel(id) / removeAll(ids)** - Removes from container WITHOUT destroying:
506
- * - Use when moving models between containers
507
- * - Use when temporarily hiding models that may be re-added
508
- * - Use when model lifecycle is managed elsewhere
509
- * - Container handles cleanup of observers and metadata
510
- * - Model remains in memory and can be used elsewhere
331
+ * @kosService core.container-aware
332
+ */
333
+ export type KosContainerAwareWithProp<T extends IKosDataModel = IKosDataModel, P extends string = "container", D = never> = KosContainerAwareBase<T> & {
334
+ [K in P]: IKosModelContainer<T>;
335
+ } & KosContainerReconcileFor<D>;
336
+ /**
337
+ * Class decorator that gives a KOS model a container of child models.
511
338
  *
512
- * **removeAndDestroy(id) / removeAndDestroyAll(ids)** - Removes AND destroys:
513
- * - Use when permanently removing models from the system
514
- * - Use when models should be fully cleaned up and disposed
515
- * - Calls destroyKosModel() automatically after removal
516
- * - Ensures proper cleanup of all model resources
517
- * - Model is removed from framework and memory
339
+ * At instantiation the model gets:
340
+ * - a KosModelContainer on `container` (or `containerProperty`), with `parentId`
341
+ * defaulting to the model's ID
342
+ * - the convenience methods (`getModel`, `addModel`, `removeModel`, `addAll`,
343
+ * `removeAll`, `removeAndDestroy`, `removeAndDestroyAll`) unless `includeMethods`
344
+ * is false
345
+ * - the reactive `models` and `data` getters unless `includeGetters` is false
346
+ * - `reconcile(list)` when the `reconcile` option is declared
518
347
  *
519
- * ```typescript
520
- * // Example: Explicit lifecycle control
521
- * @kosTopicHandler({ topic: "/device/sensor/removed" })
522
- * handleSensorRemoved(id: string) {
523
- * // Permanently remove - sensor is gone from system
524
- * await this.removeAndDestroy(id);
525
- * }
348
+ * The container is registered as a child model, so it follows the owner's lifecycle
349
+ * and is cleaned up when the owner is destroyed.
526
350
  *
527
- * // Example: Reorganization without destruction
528
- * moveSensorToArchive(id: string) {
529
- * const sensor = this.getModel(id);
530
- * if (sensor) {
531
- * this.removeModel(id); // Remove from active container
532
- * this.archive.addModel(sensor); // Add to archive container
533
- * }
534
- * }
535
- * ```
536
- *
537
- * ## Configuration Options
351
+ * `removeModel`/`removeAll` only take models out of the container; use them when the
352
+ * model lives on elsewhere (for example, moving it to another container).
353
+ * `removeAndDestroy`/`removeAndDestroyAll` also destroy the removed models.
538
354
  *
539
- * ```typescript
540
- * @kosContainerAware<UserModel>({
541
- * containerProperty: "users", // Custom property name (default: "container")
542
- * includeMethods: true, // Include convenience methods (default: true)
543
- * includeGetters: true, // Include reactive getters (default: true)
544
- * modelsProperty: "userList", // Custom models getter name (default: "models")
545
- * legacy: false, // Use "_models" property name (default: false)
546
- * containerOptions: {
547
- * parentId: "custom-parent", // Override automatic parentId inference
548
- * sortKey: "name", // Default sorting key
549
- * extensionId: "my-extension", // Extension identifier
550
- * indexMap: { // Automatic indexing for efficient queries
551
- * byRole: "role", // Property-based index
552
- * byStatus: (user) => user.active ? "active" : "inactive", // Function-based index
553
- * admins: (user) => user.role === "admin" // Boolean index
554
- * }
555
- * }
556
- * })
557
- * ```
355
+ * Pair the decorator with an interface that extends {@link KosContainerAware} (see
356
+ * that type for an example) so the injected members are typed.
558
357
  *
559
358
  * @param options Configuration options for the decorator
560
359
  * @returns A class decorator that modifies the target class prototype
@@ -564,48 +363,16 @@ export type KosContainerAwareWithProp<T extends IKosDataModel = IKosDataModel, P
564
363
  *
565
364
  * @example
566
365
  * ```typescript
567
- * // Minimal configuration - parentId automatically inferred
568
366
  * interface ItemContainerModelImpl extends KosContainerAware<ItemModel> {}
569
367
  *
368
+ * @kosModel("item-container-model")
570
369
  * @kosContainerAware<ItemModel>()
571
370
  * class ItemContainerModelImpl implements IKosDataModel {
572
- * id: string;
573
- *
574
- * constructor(modelId: string, options: ContainerOptions, context: KosCreationContext) {
575
- * this.id = modelId;
576
- * // Container automatically created with parentId: modelId
371
+ * @kosTopicHandler({ topic: "/items/removed", websocket: true })
372
+ * async handleItemRemoved(id: string) {
373
+ * await this.removeAndDestroy(id);
577
374
  * }
578
375
  * }
579
- *
580
- * // With index configuration
581
- * interface UserContainerModelImpl extends KosContainerAware<UserModel> {}
582
- *
583
- * @kosContainerAware<UserModel>({
584
- * containerOptions: {
585
- * indexMap: {
586
- * byRole: "role",
587
- * byStatus: (user) => user.status
588
- * }
589
- * }
590
- * })
591
- * class UserContainerModelImpl implements IKosDataModel {
592
- * constructor(modelId: string, options: ContainerOptions, context: KosCreationContext) {
593
- * this.id = modelId;
594
- * }
595
- * }
596
- *
597
- * // Legacy mode for backward compatibility
598
- * interface LegacyContainerModelImpl extends KosContainerAware<LegacyModel> {}
599
- *
600
- * @kosContainerAware<LegacyModel>({
601
- * legacy: true, // Uses '_models' as property name
602
- * containerOptions: {
603
- * sortKey: "name"
604
- * }
605
- * })
606
- * class LegacyContainerModelImpl implements IKosDataModel {
607
- * // Container available as this._models for backward compatibility
608
- * }
609
376
  * ```
610
377
  *
611
378
  * @category KOS Model Decorator
@@ -613,6 +380,10 @@ export type KosContainerAwareWithProp<T extends IKosDataModel = IKosDataModel, P
613
380
  * @kosService core.container-aware
614
381
  * @kosApiLevel 13
615
382
  */
616
- export declare function kosContainerAware<T extends IKosDataModel = IKosDataModel>(options?: KosContainerAwareOptions<T>): ClassDecorator;
383
+ export declare function kosContainerAware<T extends IKosDataModel = IKosDataModel, D extends {
384
+ id: string;
385
+ } = any, M extends {
386
+ id: string;
387
+ } = D>(options?: KosContainerAwareOptions<T, D, M>): ClassDecorator;
617
388
  export {};
618
389
  //# sourceMappingURL=kos-container-aware.d.ts.map