@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
@@ -5,18 +5,6 @@ import { DependencyLifecycle } from '../../types';
5
5
  * @template TState Union type of valid state strings
6
6
  * @template TEvent Union type of valid event strings
7
7
  *
8
- * @example
9
- * ```typescript
10
- * const config: KosStateMachineConfig<'idle' | 'active', 'START' | 'STOP'> = {
11
- * initial: 'idle',
12
- * initializeAt: DependencyLifecycle.READY,
13
- * states: {
14
- * idle: { on: { START: 'active' } },
15
- * active: { on: { STOP: 'idle' } }
16
- * }
17
- * };
18
- * ```
19
- *
20
8
  * @kosService core.state-machine
21
9
  * @kosApiLevel 15
22
10
  */
@@ -27,26 +15,14 @@ export interface KosStateMachineConfig<TState extends string, TEvent extends str
27
15
  */
28
16
  initial: TState;
29
17
  /**
30
- * The lifecycle phase at which the state machine should be initialized.
31
- * Before this phase, the state property already holds `initial`, but
18
+ * The lifecycle phase at which the state machine is initialized: INIT, READY (the
19
+ * default), ACTIVATE (when the UI activates the model) or ONLINE (the first time the
20
+ * model goes online; a reconnect does not restart it).
21
+ *
22
+ * Before this phase the state property already holds `initial`, but
32
23
  * isFsmInitialized is false and transitions are refused.
33
24
  *
34
25
  * @default DependencyLifecycle.READY
35
- *
36
- * @example
37
- * ```typescript
38
- * // FSM initializes when model is ready (most common)
39
- * initializeAt: DependencyLifecycle.READY
40
- *
41
- * // FSM initializes only when UI activates the model
42
- * initializeAt: DependencyLifecycle.ACTIVATE
43
- *
44
- * // FSM initializes during model initialization (rare)
45
- * initializeAt: DependencyLifecycle.INIT
46
- *
47
- * // FSM initializes the first time the model goes online
48
- * initializeAt: DependencyLifecycle.ONLINE
49
- * ```
50
26
  */
51
27
  initializeAt?: DependencyLifecycle;
52
28
  /**
@@ -70,17 +46,8 @@ export interface KosStateMachineConfig<TState extends string, TEvent extends str
70
46
  */
71
47
  on?: Partial<Record<TEvent, TState>>;
72
48
  /**
73
- * Event to auto-send when an async @kosStateEntry handler resolves.
74
- * Only triggers if the FSM is still in this state when the handler completes.
75
- *
76
- * @example
77
- * ```typescript
78
- * cancelling: {
79
- * on: { CANCELLED: 'cancelled', FAIL: 'error' },
80
- * onDone: 'CANCELLED', // auto-transition on success
81
- * onError: 'FAIL', // auto-transition on failure
82
- * }
83
- * ```
49
+ * Event to send when an async @kosStateEntry handler for this state resolves.
50
+ * Sent only if the FSM is still in this state when the handler completes.
84
51
  */
85
52
  onDone?: TEvent;
86
53
  /**
@@ -118,105 +85,35 @@ export interface KosStateMachineOptions {
118
85
  */
119
86
  throwOnInvalid?: boolean;
120
87
  /**
121
- * Optional function to compute the initial FSM state dynamically at instance creation time.
122
- * When provided, this function is called with the model instance and its return value
123
- * is used as the initial state instead of the static `initial` from the config.
88
+ * Computes the initial state when the instance is created, replacing the static
89
+ * `initial` from the config. Useful for view models that wrap a model already in a
90
+ * non-default state (for example, a connection that is already connected on app load).
124
91
  *
125
- * This is useful for ViewModels that wrap an existing model which may already be in
126
- * a non-default state (e.g., a connection that is already CONNECTED on app load).
92
+ * Entry handlers do not run for the computed state, since it represents current state
93
+ * rather than a transition.
127
94
  *
128
- * Note: Entry handlers are NOT called for the computed initial state since it
129
- * represents current state, not a transition.
130
- *
131
- * @param instance The model/ViewModel instance (after constructor, before makeAutoObservable)
95
+ * @param instance The model or view model instance, after its constructor has run
132
96
  * @returns The initial FSM state to use
133
- *
134
- * @example
135
- * ```typescript
136
- * @kosStateMachine(fsmConfig, {
137
- * computeInitialState: (instance) => {
138
- * const state = instance.connection?.state;
139
- * return state === 'CONNECTED' ? 'connected' : 'inactive';
140
- * }
141
- * })
142
- * ```
143
97
  * @kosApiLevel 21
144
98
  */
145
99
  computeInitialState?: (instance: any) => string;
146
100
  }
147
101
  /**
148
- * Interface for models using the @kosStateMachine decorator.
149
- *
150
- * **IMPORTANT**: Use TypeScript interface merging to add FSM properties to your model class.
151
- * This provides full type safety and IntelliSense support for all injected FSM functionality.
152
- *
153
- * ## Interface Merging Pattern
154
- *
155
- * ```typescript
156
- * // 1. Define state and event types
157
- * type PourState = 'idle' | 'preparing' | 'ready' | 'pouring' | 'error';
158
- * type PourEvent = 'PREPARE' | 'READY' | 'POUR' | 'COMPLETE' | 'ERROR';
159
- *
160
- * // 2. Declare interface merging BEFORE the class
161
- * interface DispenserModelImpl extends KosStateMachineAware<PourState, PourEvent> {}
162
- *
163
- * // 3. Apply decorators and implement the class
164
- * @kosModel({ modelTypeId: "dispenser-model" })
165
- * @kosStateMachine<PourState, PourEvent>({
166
- * initial: 'idle',
167
- * initializeAt: DependencyLifecycle.READY,
168
- * states: {
169
- * idle: { on: { PREPARE: 'preparing' } },
170
- * preparing: { on: { READY: 'ready', ERROR: 'error' } },
171
- * ready: { on: { POUR: 'pouring' } },
172
- * pouring: { on: { COMPLETE: 'idle', ERROR: 'error' } },
173
- * error: {}
174
- * }
175
- * })
176
- * export class DispenserModelImpl implements IKosDataModel {
177
- * // All FSM properties are now available with full type safety
178
- * }
179
- * ```
102
+ * Members that @kosStateMachine injects into a model.
180
103
  *
181
- * ## Lifecycle-Aware Initialization
104
+ * Declare an interface with the same name as the class that extends this type so the
105
+ * injected members are typed (TypeScript interface merging).
182
106
  *
183
107
  * The FSM is uninitialized until the configured lifecycle phase:
184
- * - From construction: `currentState === initial`, `isFsmInitialized === false`;
108
+ * - From construction: `currentState === initial` and `isFsmInitialized === false`;
185
109
  * `transition()` is refused and `canTransition()`, `isInState()` and
186
110
  * `allowedTransitions` report nothing
187
- * - At the phase: `isFsmInitialized === true` and the entry handler for
188
- * `initial` runs
111
+ * - At the phase: `isFsmInitialized === true` and the entry handler for `initial` runs
189
112
  * - After `unload()`: `currentState === undefined` and `isFsmInitialized === false`
190
113
  * until the phase runs again
191
114
  *
192
- * ```typescript
193
- * @kosStateMachine({
194
- * initial: 'idle',
195
- * initializeAt: DependencyLifecycle.READY, // FSM starts when model is ready
196
- * states: { ... }
197
- * })
198
- * class MyModel {
199
- * async ready(): Promise<void> {
200
- * // Before this completes: this.currentState === 'idle', this.isFsmInitialized === false
201
- * // After this completes: this.isFsmInitialized === true
202
- * }
203
- * }
204
- * ```
205
- *
206
- * ## Injected Properties and Methods
207
- *
208
- * The decorator automatically injects the following members:
209
- *
210
- * - **`currentState`**: Current state (holds `initial` from construction, observable)
211
- * - **`isFsmInitialized`**: Boolean indicating if FSM has been initialized
212
- * - **`isTransitioning`**: Boolean indicating if a transition is in progress
213
- * - **`allowedTransitions`**: Computed array of valid events for current state
214
- * - **`transition(event)`**: Method to trigger state transitions
215
- * - **`canTransition(event)`**: Check if a transition is valid from current state
216
- * - **`isInState(state)`**: Check if currently in a specific state
217
- * - **`stateHistory`**: Array of historical states (if trackHistory enabled)
218
- *
219
- * All properties are reactive and will automatically update UI components when state changes.
115
+ * The injected state is reactive, so a `kosComponent` reading it re-renders on
116
+ * transitions.
220
117
  *
221
118
  * @template TState Union type of valid state strings
222
119
  * @template TEvent Union type of valid event strings
@@ -230,9 +127,7 @@ export interface KosStateMachineOptions {
230
127
  */
231
128
  export interface KosStateMachineAware<TState extends string, TEvent extends string> {
232
129
  /**
233
- * Current state of the state machine.
234
- * Observable property that updates automatically via @kosModel.
235
- * Always initialized to the initial state immediately.
130
+ * Current state of the state machine. Holds `initial` from construction.
236
131
  */
237
132
  currentState: TState;
238
133
  /**
@@ -245,7 +140,6 @@ export interface KosStateMachineAware<TState extends string, TEvent extends stri
245
140
  readonly isFsmInitialized: boolean;
246
141
  /**
247
142
  * Indicates whether a state transition is currently in progress.
248
- * Observable property that updates during transitions.
249
143
  */
250
144
  isTransitioning: boolean;
251
145
  /**
@@ -260,12 +154,6 @@ export interface KosStateMachineAware<TState extends string, TEvent extends stri
260
154
  * @param event The event to trigger
261
155
  * @throws Error if FSM not initialized (unless `throwOnInvalid` is false)
262
156
  * @throws Error if transition is invalid (unless `throwOnInvalid` is false)
263
- *
264
- * @example
265
- * ```typescript
266
- * this.transition('START'); // idle -> active
267
- * this.transition('STOP'); // active -> idle
268
- * ```
269
157
  */
270
158
  transition(event: TEvent): void;
271
159
  /**
@@ -274,13 +162,6 @@ export interface KosStateMachineAware<TState extends string, TEvent extends stri
274
162
  *
275
163
  * @param event The event to check
276
164
  * @returns true if the transition is valid, false otherwise
277
- *
278
- * @example
279
- * ```typescript
280
- * if (this.canTransition('START')) {
281
- * this.transition('START');
282
- * }
283
- * ```
284
165
  */
285
166
  canTransition(event: TEvent): boolean;
286
167
  /**
@@ -289,13 +170,6 @@ export interface KosStateMachineAware<TState extends string, TEvent extends stri
289
170
  *
290
171
  * @param state The state to check
291
172
  * @returns true if currently in the specified state, false otherwise
292
- *
293
- * @example
294
- * ```typescript
295
- * if (this.isInState('idle')) {
296
- * console.log('System is idle');
297
- * }
298
- * ```
299
173
  */
300
174
  isInState(state: TState): boolean;
301
175
  /**
@@ -311,60 +185,16 @@ export interface KosStateMachineAware<TState extends string, TEvent extends stri
311
185
  }>;
312
186
  }
313
187
  /**
314
- * Class decorator that adds finite state machine capabilities to a KOS model.
315
- *
316
- * This decorator eliminates manual state management boilerplate by:
317
- * - **Adding lifecycle-aware FSM initialization** at configured phase (READY, ACTIVATE, ONLINE, etc.)
318
- * - **Managing state transitions** automatically with validation
319
- * - **Providing observable state** that integrates with @kosModel reactive system
320
- * - **Supporting entry/exit handlers** via @kosStateEntry and @kosStateExit decorators
321
- * - **Enabling state guards** via @kosStateGuard decorator
322
- *
323
- * ## Two-Level State System
324
- *
325
- * **Framework Lifecycle (Universal, Not Customizable):**
326
- * - CREATED → INIT → LOAD → READY → ACTIVATE → UNLOAD → DESTROY
327
- * - Managed by KOS framework
328
- * - Same for all models
329
- *
330
- * **Application FSM (This Decorator):**
331
- * - Runs WITHIN an active model
332
- * - Application-specific business logic
333
- * - Different for each model type
334
- * - Examples: Pour states, connection states, workflow states
335
- *
336
- * ## Lifecycle Integration
337
- *
338
- * The FSM initializes at the configured lifecycle phase:
339
- *
340
- * ```typescript
341
- * @kosStateMachine({
342
- * initial: 'idle',
343
- * initializeAt: DependencyLifecycle.READY, // Default
344
- * states: { ... }
345
- * })
346
- * ```
347
- *
348
- * - **INIT**: FSM needs to be active during model initialization (rare)
349
- * - **READY**: FSM operational as soon as data loaded (most common)
350
- * - **ACTIVATE**: FSM only relevant when UI is active (UI-bound models)
351
- * - **ONLINE**: FSM starts the first time the model goes online; a reconnect does not restart it
188
+ * Class decorator that adds a finite state machine to a KOS model.
352
189
  *
353
- * ## TypeScript Usage
354
- *
355
- * **IMPORTANT**: Use TypeScript interface merging to get proper type information:
356
- *
357
- * ```typescript
358
- * type MyState = 'idle' | 'active';
359
- * type MyEvent = 'START' | 'STOP';
190
+ * The FSM models application states (pour states, connection states, workflow steps)
191
+ * and runs inside the framework's model lifecycle, initializing at the phase set by
192
+ * `initializeAt`. Transitions are validated against the config. Entry and exit
193
+ * handlers are declared with @kosStateEntry and @kosStateExit, and @kosStateGuard
194
+ * restricts a method to given states.
360
195
  *
361
- * interface MyModelImpl extends KosStateMachineAware<MyState, MyEvent> {}
362
- *
363
- * @kosStateMachine<MyState, MyEvent>({ ... })
364
- * class MyModelImpl implements IKosDataModel {
365
- * // All FSM properties are now available with full type safety
366
- * }
367
- * ```
196
+ * Pair the decorator with an interface that extends {@link KosStateMachineAware} so the
197
+ * injected members are typed.
368
198
  *
369
199
  * @param config State machine configuration
370
200
  * @param options Optional configuration for FSM behavior
@@ -376,7 +206,6 @@ export interface KosStateMachineAware<TState extends string, TEvent extends stri
376
206
  *
377
207
  * @example
378
208
  * ```typescript
379
- * // Basic FSM with default READY initialization
380
209
  * type PourState = 'idle' | 'pouring' | 'complete';
381
210
  * type PourEvent = 'START' | 'FINISH';
382
211
  *
@@ -392,59 +221,9 @@ export interface KosStateMachineAware<TState extends string, TEvent extends stri
392
221
  * }
393
222
  * })
394
223
  * class PourModelImpl implements IKosDataModel {
395
- * async ready(): Promise<void> {
396
- * // After this completes, FSM is initialized to 'idle'
397
- * }
398
- *
399
224
  * startPour(): void {
400
- * this.transition('START'); // idle -> pouring
401
- * }
402
- * }
403
- * ```
404
- *
405
- * @example
406
- * ```typescript
407
- * // UI-bound FSM with ACTIVATE initialization
408
- * type WorkflowState = 'draft' | 'review' | 'approved';
409
- * type WorkflowEvent = 'SUBMIT' | 'APPROVE' | 'REJECT';
410
- *
411
- * interface DocumentModelImpl extends KosStateMachineAware<WorkflowState, WorkflowEvent> {}
412
- *
413
- * @kosModel({ modelTypeId: "document-model" })
414
- * @kosStateMachine<WorkflowState, WorkflowEvent>({
415
- * initial: 'draft',
416
- * initializeAt: DependencyLifecycle.ACTIVATE, // UI-bound
417
- * states: {
418
- * draft: { on: { SUBMIT: 'review' } },
419
- * review: { on: { APPROVE: 'approved', REJECT: 'draft' } },
420
- * approved: {}
421
- * }
422
- * })
423
- * class DocumentModelImpl implements IKosDataModel {
424
- * // FSM only initializes when UI activates this model
425
- * }
426
- * ```
427
- *
428
- * @example
429
- * ```typescript
430
- * // FSM with history tracking
431
- * interface HistoryModelImpl extends KosStateMachineAware<'idle' | 'active', 'TOGGLE'> {}
432
- *
433
- * @kosStateMachine<'idle' | 'active', 'TOGGLE'>(
434
- * {
435
- * initial: 'idle',
436
- * states: {
437
- * idle: { on: { TOGGLE: 'active' } },
438
- * active: { on: { TOGGLE: 'idle' } }
439
- * }
440
- * },
441
- * {
442
- * trackHistory: true,
443
- * stateProperty: 'status'
225
+ * this.transition('START');
444
226
  * }
445
- * )
446
- * class HistoryModelImpl implements IKosDataModel {
447
- * // Access via this.stateHistory
448
227
  * }
449
228
  * ```
450
229
  *
@@ -457,19 +236,11 @@ export declare function kosStateMachine<TState extends string, TEvent extends st
457
236
  /**
458
237
  * Method decorator that marks a method as a state entry handler.
459
238
  * The decorated method will be called when the state machine enters the specified state.
239
+ * If it returns a promise, the state's `onDone`/`onError` events fire when it settles.
460
240
  *
461
241
  * @param state The state to handle entry for
462
242
  * @returns A method decorator
463
243
  *
464
- * @example
465
- * ```typescript
466
- * @kosStateEntry('pouring')
467
- * handlePouringStart(): void {
468
- * this.logger.info('Pour started');
469
- * EventBus.publish(TOPIC_POUR_STARTED, { id: this.id });
470
- * }
471
- * ```
472
- *
473
244
  * @kosService core.state-machine
474
245
  * @kosApiLevel 15
475
246
  */
@@ -481,15 +252,6 @@ export declare function kosStateEntry<TState extends string>(state: TState): Met
481
252
  * @param state The state to handle exit for
482
253
  * @returns A method decorator
483
254
  *
484
- * @example
485
- * ```typescript
486
- * @kosStateExit('pouring')
487
- * handlePouringEnd(): void {
488
- * this.logger.info('Pour ended');
489
- * EventBus.publish(TOPIC_POUR_ENDED, { id: this.id });
490
- * }
491
- * ```
492
- *
493
255
  * @kosService core.state-machine
494
256
  * @kosApiLevel 15
495
257
  */
@@ -510,7 +272,7 @@ export interface KosStateGuardOptions<TState extends string> {
510
272
  * Whether to throw an error on invalid state.
511
273
  * When false, logs a warning instead.
512
274
  *
513
- * @default true (uses the FSM's throwOnInvalid setting)
275
+ * @default The state machine's throwOnInvalid setting
514
276
  */
515
277
  throwOnInvalid?: boolean;
516
278
  }
@@ -519,9 +281,8 @@ export interface KosStateGuardOptions<TState extends string> {
519
281
  * The decorated method can only be called when the state machine is in one of the allowed states.
520
282
  * The guard reads the property named by the state machine's `stateProperty` option.
521
283
  *
522
- * **IMPORTANT**: This decorator gracefully handles uninitialized FSM:
523
- * - If FSM is not yet initialized, the guard allows the method to proceed
524
- * - Once FSM is initialized, the guard enforces state validation
284
+ * Before the FSM is initialized the guard lets every call through, so the method can
285
+ * be used during model initialization.
525
286
  *
526
287
  * @param options Guard configuration
527
288
  * @returns A method decorator
@@ -530,9 +291,8 @@ export interface KosStateGuardOptions<TState extends string> {
530
291
  * ```typescript
531
292
  * @kosStateGuard({ allowedStates: ['ready'] })
532
293
  * async pourBeverage(bevId: string): Promise<void> {
533
- * // This method can only be called when currentState === 'ready'
534
294
  * this.transition('POUR');
535
- * await this.deviceService.dispense(bevId);
295
+ * await this.dispense(bevId);
536
296
  * this.transition('COMPLETE');
537
297
  * }
538
298
  * ```
@@ -1 +1 @@
1
- {"version":3,"file":"kos-state-machine.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/decorators/kos-state-machine.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AASlD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,qBAAqB,CACpC,MAAM,SAAS,MAAM,EACrB,MAAM,SAAS,MAAM;IAErB;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,YAAY,CAAC,EAAE,mBAAmB,CAAC;IAEnC;;;;;;;;;;;;;OAaG;IACH,MAAM,EAAE,MAAM,CACZ,MAAM,EACN;QACE;;;WAGG;QACH,EAAE,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;QAErC;;;;;;;;;;;;WAYG;QACH,MAAM,CAAC,EAAE,MAAM,CAAC;QAEhB;;;WAGG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CACF,CAAC;CACH;AAED;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,mBAAmB,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,KAAK,MAAM,CAAC;CACjD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;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AE,MAAM,GACZ,eAAe,CAUjB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,YAAY,CAAC,MAAM,SAAS,MAAM,EAChD,KAAK,EAAE,MAAM,GACZ,eAAe,CAUjB;AAED;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB,CAAC,MAAM,SAAS,MAAM;IACzD;;;OAGG;IACH,aAAa,EAAE,MAAM,EAAE,CAAC;IAExB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,aAAa,CAAC,MAAM,SAAS,MAAM,EACjD,OAAO,EAAE,oBAAoB,CAAC,MAAM,CAAC,GACpC,eAAe,CAmDjB"}
1
+ {"version":3,"file":"kos-state-machine.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/decorators/kos-state-machine.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AASlD;;;;;;;;GAQG;AACH,MAAM,WAAW,qBAAqB,CACpC,MAAM,SAAS,MAAM,EACrB,MAAM,SAAS,MAAM;IAErB;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;;;;;;;OASG;IACH,YAAY,CAAC,EAAE,mBAAmB,CAAC;IAEnC;;;;;;;;;;;;;OAaG;IACH,MAAM,EAAE,MAAM,CACZ,MAAM,EACN;QACE;;;WAGG;QACH,EAAE,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;QAErC;;;WAGG;QACH,MAAM,CAAC,EAAE,MAAM,CAAC;QAEhB;;;WAGG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CACF,CAAC;CACH;AAED;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;;OAKG;IACH,YA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AM,GACZ,eAAe,CAUjB;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,MAAM,SAAS,MAAM,EAChD,KAAK,EAAE,MAAM,GACZ,eAAe,CAUjB;AAED;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB,CAAC,MAAM,SAAS,MAAM;IACzD;;;OAGG;IACH,aAAa,EAAE,MAAM,EAAE,CAAC;IAExB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,aAAa,CAAC,MAAM,SAAS,MAAM,EACjD,OAAO,EAAE,oBAAoB,CAAC,MAAM,CAAC,GACpC,eAAe,CAmDjB"}
@@ -121,13 +121,21 @@ export declare class FlowControlManager<T = any, R = T> {
121
121
  private filterHistory;
122
122
  private rateLimitWindow;
123
123
  constructor(config: FlowControlOptions<T, R>);
124
- processEvents(eventStream: AsyncIterable<T>): AsyncGenerator<R, void, unknown>;
124
+ /**
125
+ * Runs `eventStream` through the configured filter, rate limit, batching
126
+ * and transform. Aborting `signal` ends the flow without an error: an event
127
+ * still awaited from the source is abandoned, a partial batch is discarded,
128
+ * and the source is returned.
129
+ */
130
+ processEvents(eventStream: AsyncIterable<T>, signal?: AbortSignal): AsyncGenerator<R, void, unknown>;
131
+ private processSingleEvents;
125
132
  private processSingleEvent;
126
133
  /**
127
134
  * Collects admitted events into batches. A batch is delivered when it
128
135
  * reaches `size`, when `window` ms have passed since its first event, or
129
- * when the stream ends. The window timer is cleared on every flush and when
130
- * the generator finishes or is returned.
136
+ * when the stream ends. Aborting `signal` discards the open batch. The
137
+ * window timer is cleared on every flush and when the generator finishes,
138
+ * is returned or is aborted.
131
139
  */
132
140
  private processBatchedEvents;
133
141
  private shouldProcessEvent;
@@ -1 +1 @@
1
- {"version":3,"file":"kos-topic-handler-flow-control.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/decorators/kos-topic-handler-flow-control.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,"file":"kos-topic-handler-flow-control.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/decorators/kos-topic-handler-flow-control.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAEhE;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC;IAChD;;;OAGG;IACH,KAAK,CAAC,EAAE;QACN,0CAA0C;QAC1C,IAAI,CAAC,EAAE,MAAM,CAAC;QACd;;;WAGG;QACH,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;IAEF;;;;OAIG;IACH,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;IAE/B;;OAEG;IACH,MAAM,CAAC,EAAE;QACP,8CAA8C;QAC9C,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC;QACzD,oDAAoD;QACpD,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;IAEF;;;OAGG;IACH,SAAS,CAAC,EAAE;QACV,gDAAgD;QAChD,SAAS,EAAE,MAAM,CAAC;QAClB,kCAAkC;QAClC,QAAQ,EAAE,MAAM,CAAC;QACjB;;;;;WAKG;QACH,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;KAC/B,CAAC;IAEF;;OAEG;IACH,aAAa,CAAC,EAAE;QACd,0BAA0B;QAC1B,KAAK,CAAC,EAAE;YACN,QAAQ,EAAE,MAAM,CAAC;YACjB,SAAS,EAAE,MAAM,CAAC;SACnB,CAAC;QACF,oDAAoD;QACpD,eAAe,CAAC,EAAE,OAAO,CAAC;KAC3B,CAAC;CACH;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,4CAA4C;IAC5C,OAA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AC,kBAAkB;IAsB1B;;;;OAIG;YACW,gBAAgB;IAc9B,OAAO,CAAC,cAAc;YAuBR,gBAAgB;IAa9B,OAAO,CAAC,qBAAqB;IAiB7B,QAAQ,IAAI,gBAAgB;CAG7B"}
@@ -7,65 +7,31 @@ export interface KosTroubleAwareOptions {
7
7
  pathProperty?: string;
8
8
  }
9
9
  /**
10
- * Class decorator that automatically adds TroubleAware capabilities to a KOS model.
10
+ * Class decorator that makes a KOS model TroubleAware: it gets reactive `troubles`
11
+ * (the troubles whose path matches the model's path), `troublesByType` and
12
+ * `troubleStatus` (an empty string by default). The trouble container is added as a
13
+ * dependency automatically.
11
14
  *
12
- * This decorator eliminates the need for manual TroubleAware interface implementation by:
13
- * - Adding troubleContainer dependency injection (internal, not exposed)
14
- * - Adding troubles getter that filters by model path
15
- * - Adding troubleStatus getter (returns empty string by default)
16
- * - Adding troublesByType getter that groups troubles by type
17
- *
18
- * **Important**: Use TypeScript interface merging to get proper type information:
19
- *
20
- * ```typescript
21
- * // Add ESLint disable comment at top of file, then:
22
- * interface MyModelImpl extends TroubleAware {}
23
- *
24
- * @kosTroubleAware()
25
- * class MyModelImpl implements IKosDataModel {
26
- * path: string; // Required for trouble resolution
27
- *
28
- * constructor(modelId: string, options: MyOptions) {
29
- * this.path = options.path;
30
- * // All TroubleAware properties are now available with full type safety
31
- * }
32
- * }
33
- * ```
34
- *
35
- * The decorator requires the model to have a path property (default) or specify
36
- * a custom path property via options.
15
+ * The model must expose its device path on `path`, or on the property named by
16
+ * `pathProperty`. Declare an interface with the same name as the class that extends
17
+ * `TroubleAware` (TypeScript interface merging) so the members are typed.
37
18
  *
38
19
  * @param options Configuration options for the decorator
39
20
  * @returns A class decorator
40
21
  *
41
22
  * @example
42
23
  * ```typescript
43
- * // Default usage - uses this.path
44
24
  * interface HolderModelImpl extends TroubleAware {}
45
25
  *
26
+ * @kosModel("holder-model")
46
27
  * @kosTroubleAware()
47
28
  * class HolderModelImpl implements IKosDataModel {
48
- * path: string; // Required for trouble path resolution
29
+ * path: string;
49
30
  *
50
31
  * constructor(modelId: string, options: HolderOptions) {
51
32
  * this.path = options.path;
52
33
  * }
53
34
  * }
54
- *
55
- * // Custom path property
56
- * interface CustomModelImpl extends TroubleAware {}
57
- *
58
- * @kosTroubleAware({ pathProperty: 'devicePath' })
59
- * class CustomModelImpl implements IKosDataModel {
60
- * devicePath: string; // Custom path property
61
- *
62
- * constructor(modelId: string, options: CustomOptions) {
63
- * this.devicePath = options.devicePath;
64
- * }
65
- * }
66
- *
67
- * // Type-safe external interface
68
- * export type HolderModel = PublicModelInterface<HolderModelImpl> & TroubleAware;
69
35
  * ```
70
36
  *
71
37
  * @category KOS Model Decorator
@@ -1 +1 @@
1
- {"version":3,"file":"kos-trouble-aware.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/decorators/kos-trouble-aware.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,wEAAwE;IACxE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AACH,wBAAgB,eAAe,CAC7B,OAAO,CAAC,EAAE,sBAAsB,GAC/B,cAAc,CAsBhB"}
1
+ {"version":3,"file":"kos-trouble-aware.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/decorators/kos-trouble-aware.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,wEAAwE;IACxE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,eAAe,CAC7B,OAAO,CAAC,EAAE,sBAAsB,GAC/B,cAAc,CAsBhB"}