@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
@@ -4,18 +4,20 @@ export interface BootKosCoreOptions {
4
4
  alias?: string;
5
5
  }
6
6
  /**
7
- * A model's registration bean — the value `@kosModel` generates beside the
8
- * model, and the one an application passes to `KosModelRegistry...model()`.
7
+ * A model's registration bean: the value `@kosModel` generates beside the
8
+ * model, which an application passes to `KosModelRegistry...model()`.
9
9
  *
10
- * The bean itself, not its `registration` property: handing over the property
11
- * registers nothing, and the model only fails later, on the first build.
10
+ * Pass the bean itself rather than its `registration` property; the property
11
+ * registers nothing, and the model then fails on its first build.
12
12
  */
13
13
  export type KosTestRegistration = BaseKosModelRegistrationBean<any, any> | KosModelRegistrationType<any, any>;
14
14
  /**
15
15
  * The registration chain an application uses, terminated by `boot()`.
16
16
  *
17
17
  * Every call is deferred until `boot()`, so ordering within the chain does not
18
- * matter and `alias()` may come after the models it applies to.
18
+ * matter and `alias()` may come after the models it applies to. `boot()`
19
+ * registers the SDK's core models before the chain's own registrations, the
20
+ * same set `KosModelRegistry.core.models()` registers in an app.
19
21
  */
20
22
  export interface KosCoreBootBuilder {
21
23
  /** Register a model under test, optionally preloading it. */
@@ -29,42 +31,38 @@ export interface KosCoreBootBuilder {
29
31
  /** Connection alias, when the model under test cares about one. */
30
32
  alias: (alias: string) => KosCoreBootBuilder;
31
33
  /**
32
- * Install a KosMock setup module before boot — the same default export the
34
+ * Install a KosMock setup module before boot: the default export the
33
35
  * fixture server serves from `fixtures/setups/*.mjs`, imported directly. It
34
- * runs before the transport exists, so it registers routes, transformers,
35
- * config injections and observers; anything it pushes belongs after boot.
36
+ * runs before the transport exists, so it can register routes, transformers,
37
+ * config injections and observers; pushes belong after boot.
36
38
  */
37
39
  setup: (module: KosMockSetupModule) => KosCoreBootBuilder;
38
40
  /**
39
- * Load a recorded fixture before boot — the JSON the fixture server serves,
40
- * imported directly. Test defaults: `ignoreLatency: true` (full speed) and
41
- * `pushes: "manual"` (the capture's topic and future timeline stays inert; a
42
- * test pushes what it asserts on). Pass options to override either.
41
+ * Load a recorded fixture before boot: the JSON the fixture server serves,
42
+ * imported directly. Test defaults are `ignoreLatency: true` (full speed) and
43
+ * `pushes: "manual"` (the capture's topic and future timeline stays inert, and
44
+ * the test pushes what it asserts on). Pass options to override either.
43
45
  */
44
46
  fixture: (fixture: KosMockFixture, options?: KosMockPlaybackOptions) => KosCoreBootBuilder;
45
- /** Boot KosCore with everything registered on this chain. */
47
+ /** Boot KosCore with the core models and everything on this chain. */
46
48
  boot: () => Promise<IKosCoreManager>;
47
49
  }
48
50
  /**
49
51
  * Open a registration chain, then `boot()` it.
50
52
  *
51
- * Idempotent per module instance: the first `boot()` boots, later ones return
52
- * the same core. KosCore and the model manager are process-global, so a test
53
- * file gets one core and one set of singletons — which is the isolation
54
- * boundary, and the reason a differently-configured singleton needs its own
55
- * file.
53
+ * Idempotent per module instance: the first `boot()` boots and later calls
54
+ * return the same core. KosCore and the model manager are process-global, so
55
+ * a test file gets one core and one set of singletons.
56
56
  *
57
- * Register any routes the models need BEFORE calling `boot()`, so nothing races
58
- * the boot requests — `KosMock.get(...)` above the chain, or `.setup()` /
59
- * `.fixture()` on it.
57
+ * Register the routes the models need before calling `boot()` so nothing races
58
+ * the boot requests, either with `KosMock.get(...)` above the chain or with
59
+ * `.setup()` / `.fixture()` on it.
60
60
  *
61
61
  * @example
62
62
  * ```ts
63
- * await bootKosCore().model(AssetManager).model(AssetEntry).boot();
64
- *
65
63
  * await bootKosCore()
66
- * .setup(boardBaseline) // fixtures/setups/board-baseline.mjs
67
- * .fixture(pourOk) // fixtures/pour-ok.json
64
+ * .setup(boardBaseline) // fixtures/setups/board-baseline.mjs
65
+ * .fixture(pourOk) // fixtures/pour-ok.json
68
66
  * .model(Board)
69
67
  * .boot();
70
68
  * ```
@@ -73,22 +71,22 @@ export declare function bootKosCore(): KosCoreBootBuilder;
73
71
  /**
74
72
  * Boot KosCore from an assembled registry.
75
73
  *
76
- * Kept for callers that already hold an `IKosRegistry`. A test registering its
77
- * own models should use the no-argument chain instead, which takes the
78
- * registration beans directly.
74
+ * For callers that already hold an `IKosRegistry`; it boots exactly the
75
+ * registry it is given. A test registering its own models should use the
76
+ * no-argument chain, which takes registration beans directly and registers the
77
+ * SDK's core models.
79
78
  *
80
79
  * @param registration Models under test, e.g. `{ models: {...}, preloadModels: [] }`.
81
80
  */
82
81
  export declare function bootKosCore(registration: IKosRegistry, options?: BootKosCoreOptions): Promise<IKosCoreManager>;
83
82
  /**
84
- * Wait until `predicate` holds, then resolve — or reject naming what never
85
- * happened.
83
+ * Resolves once `predicate` holds, or rejects with a message naming `label`
84
+ * after the timeout.
86
85
  *
87
86
  * Model reactions are asynchronous, so a test that changes an input and asserts
88
- * immediately reads the old value. Polling for the OUTCOME beats sleeping for an
89
- * arbitrary interval: it is faster when the reaction is quick, and it fails with
90
- * a usable message instead of a bare assertion diff when the reaction never
91
- * fires at all.
87
+ * at once reads the old value. Polling for the outcome is faster than sleeping
88
+ * for a fixed interval and fails with a clear message when the reaction never
89
+ * fires.
92
90
  *
93
91
  * @param label What is being waited for, quoted back in the timeout message.
94
92
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/kos-ui-sdk/src/testing/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,OAAO,KAAK,EACV,4BAA4B,EAC5B,eAAe,EACf,qBAAqB,EACrB,YAAY,EACZ,qBAAqB,EACrB,cAAc,EACd,sBAAsB,EACtB,kBAAkB,EAClB,wBAAwB,EACxB,SAAS,EACV,MAAM,SAAS,CAAC;AAMjB,MAAM,WAAW,kBAAkB;IACjC,mEAAmE;IACnE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,mBAAmB,GAC3B,4BAA4B,CAAC,GAAG,EAAE,GAAG,CAAC,GACtC,wBAAwB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAEvC;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC,6DAA6D;IAC7D,KAAK,EAAE,CACL,YAAY,EAAE,mBAAmB,EACjC,OAAO,CAAC,EAAE,OAAO,KACd,kBAAkB,CAAC;IACxB,oEAAoE;IACpE,OAAO,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,kBAAkB,CAAC;IAClD,sDAAsD;IACtD,SAAS,EAAE,CACT,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,qBAAqB,CAAC,GAAG,CAAC,KAClC,kBAAkB,CAAC;IACxB,kEAAkE;IAClE,MAAM,EAAE,CACN,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,qBAAqB,KAChC,kBAAkB,CAAC;IACxB,mEAAmE;IACnE,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,kBAAkB,CAAC;IAC7C;;;;;OAKG;IACH,KAAK,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,kBAAkB,CAAC;IAC1D;;;;;OAKG;IACH,OAAO,EAAE,CACP,OAAO,EAAE,cAAc,EACvB,OAAO,CAAC,EAAE,sBAAsB,KAC7B,kBAAkB,CAAC;IACxB,6DAA6D;IAC7D,IAAI,EAAE,MAAM,OAAO,CAAC,eAAe,CAAC,CAAC;CACtC;AAmGD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,WAAW,IAAI,kBAAkB,CAAC;AAClD;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CACzB,YAAY,EAAE,YAAY,EAC1B,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC,eAAe,CAAC,CAAC;AAQ5B;;;;;;;;;;;GAWG;AACH,wBAAsB,KAAK,CACzB,SAAS,EAAE,MAAM,OAAO,EACxB,KAAK,EAAE,MAAM,EACb,SAAS,SAAO,GACf,OAAO,CAAC,IAAI,CAAC,CAQf"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/kos-ui-sdk/src/testing/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,OAAO,KAAK,EACV,4BAA4B,EAC5B,eAAe,EACf,qBAAqB,EACrB,YAAY,EACZ,qBAAqB,EACrB,cAAc,EACd,sBAAsB,EACtB,kBAAkB,EAClB,wBAAwB,EACxB,SAAS,EACV,MAAM,SAAS,CAAC;AAOjB,MAAM,WAAW,kBAAkB;IACjC,mEAAmE;IACnE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;GAMG;AACH,MAAM,MAAM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ACf,OAAO,CAAC,IAAI,CAAC,CAQf"}
package/testing.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  require("mobx");
4
- const service = require("./index-CRb8ucfF.cjs");
4
+ const service = require("./software-info-registration-Le3V0a6v.cjs");
5
5
  require("loglevel");
6
6
  let booted;
7
7
  let prepared = false;
@@ -77,6 +77,7 @@ function buildBootBuilder() {
77
77
  await install();
78
78
  }
79
79
  prepareTransport(alias);
80
+ service.KosModelRegistry.core.models();
80
81
  registrations.splice(0).forEach((register) => register());
81
82
  return bootCore({ models: {}, preloadModels }, { alias });
82
83
  }
package/testing.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"testing.cjs","sources":["../../../packages/kos-ui-sdk/src/testing/index.ts"],"sourcesContent":["/**\n * Test support for KOS models — boot the framework in a unit test, with no\n * device, no WebSocket server and no browser.\n *\n * KOS models cannot be built in isolation: they need a live KosCore, and\n * KosCore opens a WebSocket the moment it is created. `bootKosCore` boots it on\n * KosMock's standalone loopback transport instead, which authorizes itself so\n * `whenReady()` resolves with no device and no `KOS_ALLOW_ANONYMOUS` build flag.\n *\n * Models register the way an application registers them. `bootKosCore()` with\n * no arguments returns a builder carrying the same chain an app's\n * `KosModelRegistry` gives — `.model()`, `.preload()`, `.companion()`,\n * `.legacy()` — so a test hands over the registration bean itself rather than\n * assembling a registry by hand.\n *\n * Backend traffic is mocked the same way an app would mock it — `KosMock.get`,\n * `KosMock.post`, fixtures, config injection — so a test exercises the real\n * request path rather than a stubbed service function. The chain's `.setup()`\n * and `.fixture()` install the project's committed setup modules and recorded\n * fixtures before boot, so the declarations the browser dev loop runs are the\n * ones the test runs.\n *\n * ```ts\n * import { bootKosCore, until } from \"@kosdev-code/kos-ui-sdk/testing\";\n * import { KosMock } from \"@kosdev-code/kos-ui-sdk\";\n * import { Board } from \"./models/board\";\n *\n * beforeAll(async () => {\n * KosMock.get(\"/api/board/:id\", { data: { id: \"b1\", state: \"READY\" } });\n * await bootKosCore().model(Board).boot();\n * });\n *\n * it(\"loads the board\", async () => {\n * const board = Board.instance(\"b1\").options({}).build();\n * await whenReady(board);\n * expect(board.state).toBe(\"READY\");\n * });\n * ```\n *\n * ## Two things that bite\n *\n * **Singleton models take one configuration per test file.** A second\n * `options(...)` call returns the FIRST instance and discards the new options in\n * silence, so assertions written against them pass for the wrong reason. A case\n * needing different options belongs in its own file, which the test runner\n * gives its own module state.\n *\n * **The standalone socket authorizes by publishing Studio's\n * `/studioServer/auth/LOGGED_IN` on every open.** A device never sends that, so\n * a test shaped around disconnect/reconnect here is exercising Studio's\n * sequence, not a device's. It makes no difference to tests that never\n * reconnect.\n */\nimport type {\n BaseKosModelRegistrationBean,\n IKosCoreManager,\n IKosModelRegistration,\n IKosRegistry,\n KosCompanionModelType,\n KosMockFixture,\n KosMockPlaybackOptions,\n KosMockSetupModule,\n KosModelRegistrationType,\n Preloaded,\n} from \"../core\";\nimport { KosCore, KosMock, RegistrationManager } from \"../core\";\n\nlet booted: Promise<IKosCoreManager> | undefined;\nlet prepared = false;\n\nexport interface BootKosCoreOptions {\n /** Connection alias, when the model under test cares about one. */\n alias?: string;\n}\n\n/**\n * A model's registration bean — the value `@kosModel` generates beside the\n * model, and the one an application passes to `KosModelRegistry...model()`.\n *\n * The bean itself, not its `registration` property: handing over the property\n * registers nothing, and the model only fails later, on the first build.\n */\nexport type KosTestRegistration =\n | BaseKosModelRegistrationBean<any, any>\n | KosModelRegistrationType<any, any>;\n\n/**\n * The registration chain an application uses, terminated by `boot()`.\n *\n * Every call is deferred until `boot()`, so ordering within the chain does not\n * matter and `alias()` may come after the models it applies to.\n */\nexport interface KosCoreBootBuilder {\n /** Register a model under test, optionally preloading it. */\n model: (\n registration: KosTestRegistration,\n preload?: boolean\n ) => KosCoreBootBuilder;\n /** Preload a model type, or a specific instance of one, at boot. */\n preload: (model: Preloaded) => KosCoreBootBuilder;\n /** Attach a companion model type to a parent type. */\n companion: (\n parentType: string,\n companion: KosCompanionModelType<any>\n ) => KosCoreBootBuilder;\n /** Register a hand-written registration record against a type. */\n legacy: (\n type: string,\n registration: IKosModelRegistration\n ) => KosCoreBootBuilder;\n /** Connection alias, when the model under test cares about one. */\n alias: (alias: string) => KosCoreBootBuilder;\n /**\n * Install a KosMock setup module before boot — the same default export the\n * fixture server serves from `fixtures/setups/*.mjs`, imported directly. It\n * runs before the transport exists, so it registers routes, transformers,\n * config injections and observers; anything it pushes belongs after boot.\n */\n setup: (module: KosMockSetupModule) => KosCoreBootBuilder;\n /**\n * Load a recorded fixture before boot — the JSON the fixture server serves,\n * imported directly. Test defaults: `ignoreLatency: true` (full speed) and\n * `pushes: \"manual\"` (the capture's topic and future timeline stays inert; a\n * test pushes what it asserts on). Pass options to override either.\n */\n fixture: (\n fixture: KosMockFixture,\n options?: KosMockPlaybackOptions\n ) => KosCoreBootBuilder;\n /** Boot KosCore with everything registered on this chain. */\n boot: () => Promise<IKosCoreManager>;\n}\n\n/**\n * Put the mock transport and the connection alias in place before anything\n * constructs KosCore.\n *\n * KosCore picks its transport and reads its alias in the constructor, and\n * registering a model reaches `KosCore.getInstance()` — so registration cannot\n * come first.\n */\nfunction prepareTransport(alias?: string): void {\n if (prepared) {\n return;\n }\n prepared = true;\n KosMock.configure({ standalone: true });\n KosCore.getInstance({ connectionAlias: alias });\n}\n\nfunction bootCore(\n registration: IKosRegistry,\n options: BootKosCoreOptions\n): Promise<IKosCoreManager> {\n if (!booted) {\n prepareTransport(options.alias);\n const core = KosCore.create(registration, false, options.alias);\n booted = core.whenReady().then(() => core);\n }\n return booted;\n}\n\nconst FIXTURE_TEST_DEFAULTS: KosMockPlaybackOptions = {\n ignoreLatency: true,\n pushes: \"manual\",\n};\n\nfunction buildBootBuilder(): KosCoreBootBuilder {\n const registrations: (() => void)[] = [];\n const mockInstalls: (() => Promise<void> | void)[] = [];\n const preloadModels: Preloaded[] = [];\n let alias: string | undefined;\n\n const builder: KosCoreBootBuilder = {\n model: (registration, preload) => {\n registrations.push(() =>\n RegistrationManager.model.register(builder)(registration, preload)\n );\n return builder;\n },\n preload: (model) => {\n preloadModels.push(model);\n return builder;\n },\n companion: (parentType, companion) => {\n registrations.push(() =>\n RegistrationManager.companion.register(builder)(parentType, companion)\n );\n return builder;\n },\n legacy: (type, registration) => {\n registrations.push(() =>\n RegistrationManager.model.registerLegacyModel(builder)(\n type,\n registration\n )\n );\n return builder;\n },\n alias: (value) => {\n alias = value;\n return builder;\n },\n setup: (module) => {\n mockInstalls.push(async () => {\n await module(KosMock);\n });\n return builder;\n },\n fixture: (fixture, options) => {\n mockInstalls.push(() => {\n KosMock.loadFixture(fixture, { ...FIXTURE_TEST_DEFAULTS, ...options });\n });\n return builder;\n },\n boot: async () => {\n // Mocks first, in call order, before the transport exists — the same\n // \"routes before boot\" rule a test follows when it calls KosMock.get.\n for (const install of mockInstalls.splice(0)) {\n await install();\n }\n prepareTransport(alias);\n registrations.splice(0).forEach((register) => register());\n return bootCore({ models: {}, preloadModels }, { alias });\n },\n };\n\n return builder;\n}\n\n/**\n * Open a registration chain, then `boot()` it.\n *\n * Idempotent per module instance: the first `boot()` boots, later ones return\n * the same core. KosCore and the model manager are process-global, so a test\n * file gets one core and one set of singletons — which is the isolation\n * boundary, and the reason a differently-configured singleton needs its own\n * file.\n *\n * Register any routes the models need BEFORE calling `boot()`, so nothing races\n * the boot requests — `KosMock.get(...)` above the chain, or `.setup()` /\n * `.fixture()` on it.\n *\n * @example\n * ```ts\n * await bootKosCore().model(AssetManager).model(AssetEntry).boot();\n *\n * await bootKosCore()\n * .setup(boardBaseline) // fixtures/setups/board-baseline.mjs\n * .fixture(pourOk) // fixtures/pour-ok.json\n * .model(Board)\n * .boot();\n * ```\n */\nexport function bootKosCore(): KosCoreBootBuilder;\n/**\n * Boot KosCore from an assembled registry.\n *\n * Kept for callers that already hold an `IKosRegistry`. A test registering its\n * own models should use the no-argument chain instead, which takes the\n * registration beans directly.\n *\n * @param registration Models under test, e.g. `{ models: {...}, preloadModels: [] }`.\n */\nexport function bootKosCore(\n registration: IKosRegistry,\n options?: BootKosCoreOptions\n): Promise<IKosCoreManager>;\nexport function bootKosCore(\n registration?: IKosRegistry,\n options: BootKosCoreOptions = {}\n): KosCoreBootBuilder | Promise<IKosCoreManager> {\n return registration ? bootCore(registration, options) : buildBootBuilder();\n}\n\n/**\n * Wait until `predicate` holds, then resolve — or reject naming what never\n * happened.\n *\n * Model reactions are asynchronous, so a test that changes an input and asserts\n * immediately reads the old value. Polling for the OUTCOME beats sleeping for an\n * arbitrary interval: it is faster when the reaction is quick, and it fails with\n * a usable message instead of a bare assertion diff when the reaction never\n * fires at all.\n *\n * @param label What is being waited for, quoted back in the timeout message.\n */\nexport async function until(\n predicate: () => boolean,\n label: string,\n timeoutMs = 2000\n): Promise<void> {\n const deadline = Date.now() + timeoutMs;\n while (!predicate()) {\n if (Date.now() > deadline) {\n throw new Error(`timed out waiting for ${label}`);\n }\n await new Promise((resolve) => setTimeout(resolve, 5));\n }\n}\n"],"names":["KosMock","KosCore","RegistrationManager","module"],"mappings":";;;;;AAmEA,IAAI;AACJ,IAAI,WAAW;AAyEf,SAAS,iBAAiB,OAAsB;AAC9C,MAAI,UAAU;AACZ;AAAA,EACF;AACA,aAAW;AACXA,UAAAA,QAAQ,UAAU,EAAE,YAAY,KAAA,CAAM;AACtCC,UAAAA,QAAQ,YAAY,EAAE,iBAAiB,MAAA,CAAO;AAChD;AAEA,SAAS,SACP,cACA,SAC0B;AAC1B,MAAI,CAAC,QAAQ;AACX,qBAAiB,QAAQ,KAAK;AAC9B,UAAM,OAAOA,QAAAA,QAAQ,OAAO,cAAc,OAAO,QAAQ,KAAK;AAC9D,aAAS,KAAK,UAAA,EAAY,KAAK,MAAM,IAAI;AAAA,EAC3C;AACA,SAAO;AACT;AAEA,MAAM,wBAAgD;AAAA,EACpD,eAAe;AAAA,EACf,QAAQ;AACV;AAEA,SAAS,mBAAuC;AAC9C,QAAM,g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,cAAA,GAAiB,EAAE,OAAO;AAAA,IAC1D;AAAA,EAAA;AAGF,SAAO;AACT;AAwCO,SAAS,YACd,cACA,UAA8B,IACiB;AAC/C,SAAO,eAAe,SAAS,cAAc,OAAO,IAAI,iBAAA;AAC1D;AAcA,eAAsB,MACpB,WACA,OACA,YAAY,KACG;AACf,QAAM,WAAW,KAAK,IAAA,IAAQ;AAC9B,SAAO,CAAC,aAAa;AACnB,QAAI,KAAK,IAAA,IAAQ,UAAU;AACzB,YAAM,IAAI,MAAM,yBAAyB,KAAK,EAAE;AAAA,IAClD;AACA,UAAM,IAAI,QAAQ,CAAC,YAAY,WAAW,SAAS,CAAC,CAAC;AAAA,EACvD;AACF;;;"}
1
+ {"version":3,"file":"testing.cjs","sources":["../../../packages/kos-ui-sdk/src/testing/index.ts"],"sourcesContent":["/**\n * Test support for KOS models: boots the framework in a unit test without a\n * device, WebSocket server or browser.\n *\n * KOS models need a live KosCore, and KosCore opens a WebSocket as soon as it\n * is created. `bootKosCore` boots it on KosMock's standalone loopback\n * transport instead, which authorizes itself so `whenReady()` resolves without\n * a device or the `KOS_ALLOW_ANONYMOUS` build flag.\n *\n * `bootKosCore()` returns the same registration chain an app's\n * `KosModelRegistry` gives (`.model()`, `.preload()`, `.companion()`,\n * `.legacy()`), so a test passes the model's registration bean directly.\n * `boot()` also registers the SDK's core models, so a model with a\n * `@kosConfigProperty` or a dependency on a core model builds with only the\n * model under test on the chain.\n *\n * Backend traffic is mocked as an app would mock it (`KosMock.get`,\n * `KosMock.post`, fixtures, config injection), so a test exercises the real\n * request path. `.setup()` and `.fixture()` install the project's setup modules\n * and recorded fixtures before boot.\n *\n * ```ts\n * import { bootKosCore } from \"@kosdev-code/kos-ui-sdk/testing\";\n * import { KosMock, whenReady } from \"@kosdev-code/kos-ui-sdk\";\n * import { Board } from \"./models/board\";\n *\n * beforeAll(async () => {\n * KosMock.get(\"/api/board/:id\", { data: { id: \"b1\", state: \"READY\" } });\n * await bootKosCore().model(Board).boot();\n * });\n *\n * it(\"loads the board\", async () => {\n * const board = Board.instance(\"b1\").options({}).build();\n * await whenReady(board);\n * expect(board.state).toBe(\"READY\");\n * });\n * ```\n *\n * Singleton models take one configuration per test file: a second\n * `options(...)` call returns the first instance and silently discards the new\n * options. Put a case that needs different options in its own file.\n *\n * The standalone socket authorizes by publishing Studio's\n * `/studioServer/auth/LOGGED_IN` on every open, which a device never sends, so\n * disconnect and reconnect tests here follow Studio's sequence rather than a\n * device's.\n */\nimport type {\n BaseKosModelRegistrationBean,\n IKosCoreManager,\n IKosModelRegistration,\n IKosRegistry,\n KosCompanionModelType,\n KosMockFixture,\n KosMockPlaybackOptions,\n KosMockSetupModule,\n KosModelRegistrationType,\n Preloaded,\n} from \"../core\";\nimport { KosCore, KosMock, RegistrationManager } from \"../core\";\nimport { KosModelRegistry } from \"../models/utils/core-registration-manager\";\n\nlet booted: Promise<IKosCoreManager> | undefined;\nlet prepared = false;\n\nexport interface BootKosCoreOptions {\n /** Connection alias, when the model under test cares about one. */\n alias?: string;\n}\n\n/**\n * A model's registration bean: the value `@kosModel` generates beside the\n * model, which an application passes to `KosModelRegistry...model()`.\n *\n * Pass the bean itself rather than its `registration` property; the property\n * registers nothing, and the model then fails on its first build.\n */\nexport type KosTestRegistration =\n | BaseKosModelRegistrationBean<any, any>\n | KosModelRegistrationType<any, any>;\n\n/**\n * The registration chain an application uses, terminated by `boot()`.\n *\n * Every call is deferred until `boot()`, so ordering within the chain does not\n * matter and `alias()` may come after the models it applies to. `boot()`\n * registers the SDK's core models before the chain's own registrations, the\n * same set `KosModelRegistry.core.models()` registers in an app.\n */\nexport interface KosCoreBootBuilder {\n /** Register a model under test, optionally preloading it. */\n model: (\n registration: KosTestRegistration,\n preload?: boolean\n ) => KosCoreBootBuilder;\n /** Preload a model type, or a specific instance of one, at boot. */\n preload: (model: Preloaded) => KosCoreBootBuilder;\n /** Attach a companion model type to a parent type. */\n companion: (\n parentType: string,\n companion: KosCompanionModelType<any>\n ) => KosCoreBootBuilder;\n /** Register a hand-written registration record against a type. */\n legacy: (\n type: string,\n registration: IKosModelRegistration\n ) => KosCoreBootBuilder;\n /** Connection alias, when the model under test cares about one. */\n alias: (alias: string) => KosCoreBootBuilder;\n /**\n * Install a KosMock setup module before boot: the default export the\n * fixture server serves from `fixtures/setups/*.mjs`, imported directly. It\n * runs before the transport exists, so it can register routes, transformers,\n * config injections and observers; pushes belong after boot.\n */\n setup: (module: KosMockSetupModule) => KosCoreBootBuilder;\n /**\n * Load a recorded fixture before boot: the JSON the fixture server serves,\n * imported directly. Test defaults are `ignoreLatency: true` (full speed) and\n * `pushes: \"manual\"` (the capture's topic and future timeline stays inert, and\n * the test pushes what it asserts on). Pass options to override either.\n */\n fixture: (\n fixture: KosMockFixture,\n options?: KosMockPlaybackOptions\n ) => KosCoreBootBuilder;\n /** Boot KosCore with the core models and everything on this chain. */\n boot: () => Promise<IKosCoreManager>;\n}\n\n/**\n * Put the mock transport and the connection alias in place before anything\n * constructs KosCore.\n *\n * KosCore picks its transport and reads its alias in the constructor, and\n * registering a model calls `KosCore.getInstance()`, so registration cannot\n * come first.\n */\nfunction prepareTransport(alias?: string): void {\n if (prepared) {\n return;\n }\n prepared = true;\n KosMock.configure({ standalone: true });\n KosCore.getInstance({ connectionAlias: alias });\n}\n\nfunction bootCore(\n registration: IKosRegistry,\n options: BootKosCoreOptions\n): Promise<IKosCoreManager> {\n if (!booted) {\n prepareTransport(options.alias);\n const core = KosCore.create(registration, false, options.alias);\n booted = core.whenReady().then(() => core);\n }\n return booted;\n}\n\nconst FIXTURE_TEST_DEFAULTS: KosMockPlaybackOptions = {\n ignoreLatency: true,\n pushes: \"manual\",\n};\n\nfunction buildBootBuilder(): KosCoreBootBuilder {\n const registrations: (() => void)[] = [];\n const mockInstalls: (() => Promise<void> | void)[] = [];\n const preloadModels: Preloaded[] = [];\n let alias: string | undefined;\n\n const builder: KosCoreBootBuilder = {\n model: (registration, preload) => {\n registrations.push(() =>\n RegistrationManager.model.register(builder)(registration, preload)\n );\n return builder;\n },\n preload: (model) => {\n preloadModels.push(model);\n return builder;\n },\n companion: (parentType, companion) => {\n registrations.push(() =>\n RegistrationManager.companion.register(builder)(parentType, companion)\n );\n return builder;\n },\n legacy: (type, registration) => {\n registrations.push(() =>\n RegistrationManager.model.registerLegacyModel(builder)(\n type,\n registration\n )\n );\n return builder;\n },\n alias: (value) => {\n alias = value;\n return builder;\n },\n setup: (module) => {\n mockInstalls.push(async () => {\n await module(KosMock);\n });\n return builder;\n },\n fixture: (fixture, options) => {\n mockInstalls.push(() => {\n KosMock.loadFixture(fixture, { ...FIXTURE_TEST_DEFAULTS, ...options });\n });\n return builder;\n },\n boot: async () => {\n // Mocks first, in call order, before the transport exists.\n for (const install of mockInstalls.splice(0)) {\n await install();\n }\n prepareTransport(alias);\n KosModelRegistry.core.models();\n registrations.splice(0).forEach((register) => register());\n return bootCore({ models: {}, preloadModels }, { alias });\n },\n };\n\n return builder;\n}\n\n/**\n * Open a registration chain, then `boot()` it.\n *\n * Idempotent per module instance: the first `boot()` boots and later calls\n * return the same core. KosCore and the model manager are process-global, so\n * a test file gets one core and one set of singletons.\n *\n * Register the routes the models need before calling `boot()` so nothing races\n * the boot requests, either with `KosMock.get(...)` above the chain or with\n * `.setup()` / `.fixture()` on it.\n *\n * @example\n * ```ts\n * await bootKosCore()\n * .setup(boardBaseline) // fixtures/setups/board-baseline.mjs\n * .fixture(pourOk) // fixtures/pour-ok.json\n * .model(Board)\n * .boot();\n * ```\n */\nexport function bootKosCore(): KosCoreBootBuilder;\n/**\n * Boot KosCore from an assembled registry.\n *\n * For callers that already hold an `IKosRegistry`; it boots exactly the\n * registry it is given. A test registering its own models should use the\n * no-argument chain, which takes registration beans directly and registers the\n * SDK's core models.\n *\n * @param registration Models under test, e.g. `{ models: {...}, preloadModels: [] }`.\n */\nexport function bootKosCore(\n registration: IKosRegistry,\n options?: BootKosCoreOptions\n): Promise<IKosCoreManager>;\nexport function bootKosCore(\n registration?: IKosRegistry,\n options: BootKosCoreOptions = {}\n): KosCoreBootBuilder | Promise<IKosCoreManager> {\n return registration ? bootCore(registration, options) : buildBootBuilder();\n}\n\n/**\n * Resolves once `predicate` holds, or rejects with a message naming `label`\n * after the timeout.\n *\n * Model reactions are asynchronous, so a test that changes an input and asserts\n * at once reads the old value. Polling for the outcome is faster than sleeping\n * for a fixed interval and fails with a clear message when the reaction never\n * fires.\n *\n * @param label What is being waited for, quoted back in the timeout message.\n */\nexport async function until(\n predicate: () => boolean,\n label: string,\n timeoutMs = 2000\n): Promise<void> {\n const deadline = Date.now() + timeoutMs;\n while (!predicate()) {\n if (Date.now() > deadline) {\n throw new Error(`timed out waiting for ${label}`);\n }\n await new Promise((resolve) => setTimeout(resolve, 5));\n }\n}\n"],"names":["KosMock","KosCore","RegistrationManager","module","KosModelRegistry"],"mappings":";;;;;AA8DA,IAAI;AACJ,IAAI,WAAW;AA2Ef,SAAS,iBAAiB,OAAsB;AAC9C,MAAI,UAAU;AACZ;AAAA,EACF;AACA,aAAW;AACXA,UAAAA,QAAQ,UAAU,EAAE,YAAY,KAAA,CAAM;AACtCC,UAAAA,QAAQ,YAAY,EAAE,iBAAiB,MAAA,CAAO;AAChD;AAEA,SAAS,SACP,cACA,SAC0B;AAC1B,MAAI,CAAC,QAAQ;AACX,qBAAiB,QAAQ,KAAK;AAC9B,UAAM,OAAOA,QAAAA,QAAQ,OAAO,cAAc,OAAO,QAAQ,KAAK;AAC9D,aAAS,KAAK,UAAA,EAAY,KAAK,MAAM,IAAI;AAAA,EAC3C;AACA,SAAO;AACT;AAEA,MAAM,wBAAgD;AAAA,EACpD,eAAe;AAAA,EACf,QAAQ;AACV;AAEA,SAAS,mBAAuC;AAC9C,QAAM,gBAAgC,CAAA;AACtC,QAAM,eAA+C,CAAA;AACrD,QAAM,gBAA6B,CAAA;AACnC,MAAI;AAEJ,QAAM,UAA8B;AAAA,IAClC,OAAO,CAAC,cAAc,YAAY;AAChC,oBAAc;AAAA,QAAK,MAC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AS,cAAc,OAAO,IAAI,iBAAA;AAC1D;AAaA,eAAsB,MACpB,WACA,OACA,YAAY,KACG;AACf,QAAM,WAAW,KAAK,IAAA,IAAQ;AAC9B,SAAO,CAAC,aAAa;AACnB,QAAI,KAAK,IAAA,IAAQ,UAAU;AACzB,YAAM,IAAI,MAAM,yBAAyB,KAAK,EAAE;AAAA,IAClD;AACA,UAAM,IAAI,QAAQ,CAAC,YAAY,WAAW,SAAS,CAAC,CAAC;AAAA,EACvD;AACF;;;"}
package/testing.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "mobx";
2
- import { l as KosCore, b0 as KosMock, al as RegistrationManager } from "./index-YzHb2lnB.js";
2
+ import { h as KosCore, bU as KosMock, bZ as KosModelRegistry, cn as RegistrationManager } from "./software-info-registration-kSGacOka.js";
3
3
  import "loglevel";
4
4
  let booted;
5
5
  let prepared = false;
@@ -75,6 +75,7 @@ function buildBootBuilder() {
75
75
  await install();
76
76
  }
77
77
  prepareTransport(alias);
78
+ KosModelRegistry.core.models();
78
79
  registrations.splice(0).forEach((register) => register());
79
80
  return bootCore({ models: {}, preloadModels }, { alias });
80
81
  }
package/testing.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"testing.js","sources":["../../../packages/kos-ui-sdk/src/testing/index.ts"],"sourcesContent":["/**\n * Test support for KOS models — boot the framework in a unit test, with no\n * device, no WebSocket server and no browser.\n *\n * KOS models cannot be built in isolation: they need a live KosCore, and\n * KosCore opens a WebSocket the moment it is created. `bootKosCore` boots it on\n * KosMock's standalone loopback transport instead, which authorizes itself so\n * `whenReady()` resolves with no device and no `KOS_ALLOW_ANONYMOUS` build flag.\n *\n * Models register the way an application registers them. `bootKosCore()` with\n * no arguments returns a builder carrying the same chain an app's\n * `KosModelRegistry` gives — `.model()`, `.preload()`, `.companion()`,\n * `.legacy()` — so a test hands over the registration bean itself rather than\n * assembling a registry by hand.\n *\n * Backend traffic is mocked the same way an app would mock it — `KosMock.get`,\n * `KosMock.post`, fixtures, config injection — so a test exercises the real\n * request path rather than a stubbed service function. The chain's `.setup()`\n * and `.fixture()` install the project's committed setup modules and recorded\n * fixtures before boot, so the declarations the browser dev loop runs are the\n * ones the test runs.\n *\n * ```ts\n * import { bootKosCore, until } from \"@kosdev-code/kos-ui-sdk/testing\";\n * import { KosMock } from \"@kosdev-code/kos-ui-sdk\";\n * import { Board } from \"./models/board\";\n *\n * beforeAll(async () => {\n * KosMock.get(\"/api/board/:id\", { data: { id: \"b1\", state: \"READY\" } });\n * await bootKosCore().model(Board).boot();\n * });\n *\n * it(\"loads the board\", async () => {\n * const board = Board.instance(\"b1\").options({}).build();\n * await whenReady(board);\n * expect(board.state).toBe(\"READY\");\n * });\n * ```\n *\n * ## Two things that bite\n *\n * **Singleton models take one configuration per test file.** A second\n * `options(...)` call returns the FIRST instance and discards the new options in\n * silence, so assertions written against them pass for the wrong reason. A case\n * needing different options belongs in its own file, which the test runner\n * gives its own module state.\n *\n * **The standalone socket authorizes by publishing Studio's\n * `/studioServer/auth/LOGGED_IN` on every open.** A device never sends that, so\n * a test shaped around disconnect/reconnect here is exercising Studio's\n * sequence, not a device's. It makes no difference to tests that never\n * reconnect.\n */\nimport type {\n BaseKosModelRegistrationBean,\n IKosCoreManager,\n IKosModelRegistration,\n IKosRegistry,\n KosCompanionModelType,\n KosMockFixture,\n KosMockPlaybackOptions,\n KosMockSetupModule,\n KosModelRegistrationType,\n Preloaded,\n} from \"../core\";\nimport { KosCore, KosMock, RegistrationManager } from \"../core\";\n\nlet booted: Promise<IKosCoreManager> | undefined;\nlet prepared = false;\n\nexport interface BootKosCoreOptions {\n /** Connection alias, when the model under test cares about one. */\n alias?: string;\n}\n\n/**\n * A model's registration bean — the value `@kosModel` generates beside the\n * model, and the one an application passes to `KosModelRegistry...model()`.\n *\n * The bean itself, not its `registration` property: handing over the property\n * registers nothing, and the model only fails later, on the first build.\n */\nexport type KosTestRegistration =\n | BaseKosModelRegistrationBean<any, any>\n | KosModelRegistrationType<any, any>;\n\n/**\n * The registration chain an application uses, terminated by `boot()`.\n *\n * Every call is deferred until `boot()`, so ordering within the chain does not\n * matter and `alias()` may come after the models it applies to.\n */\nexport interface KosCoreBootBuilder {\n /** Register a model under test, optionally preloading it. */\n model: (\n registration: KosTestRegistration,\n preload?: boolean\n ) => KosCoreBootBuilder;\n /** Preload a model type, or a specific instance of one, at boot. */\n preload: (model: Preloaded) => KosCoreBootBuilder;\n /** Attach a companion model type to a parent type. */\n companion: (\n parentType: string,\n companion: KosCompanionModelType<any>\n ) => KosCoreBootBuilder;\n /** Register a hand-written registration record against a type. */\n legacy: (\n type: string,\n registration: IKosModelRegistration\n ) => KosCoreBootBuilder;\n /** Connection alias, when the model under test cares about one. */\n alias: (alias: string) => KosCoreBootBuilder;\n /**\n * Install a KosMock setup module before boot — the same default export the\n * fixture server serves from `fixtures/setups/*.mjs`, imported directly. It\n * runs before the transport exists, so it registers routes, transformers,\n * config injections and observers; anything it pushes belongs after boot.\n */\n setup: (module: KosMockSetupModule) => KosCoreBootBuilder;\n /**\n * Load a recorded fixture before boot — the JSON the fixture server serves,\n * imported directly. Test defaults: `ignoreLatency: true` (full speed) and\n * `pushes: \"manual\"` (the capture's topic and future timeline stays inert; a\n * test pushes what it asserts on). Pass options to override either.\n */\n fixture: (\n fixture: KosMockFixture,\n options?: KosMockPlaybackOptions\n ) => KosCoreBootBuilder;\n /** Boot KosCore with everything registered on this chain. */\n boot: () => Promise<IKosCoreManager>;\n}\n\n/**\n * Put the mock transport and the connection alias in place before anything\n * constructs KosCore.\n *\n * KosCore picks its transport and reads its alias in the constructor, and\n * registering a model reaches `KosCore.getInstance()` — so registration cannot\n * come first.\n */\nfunction prepareTransport(alias?: string): void {\n if (prepared) {\n return;\n }\n prepared = true;\n KosMock.configure({ standalone: true });\n KosCore.getInstance({ connectionAlias: alias });\n}\n\nfunction bootCore(\n registration: IKosRegistry,\n options: BootKosCoreOptions\n): Promise<IKosCoreManager> {\n if (!booted) {\n prepareTransport(options.alias);\n const core = KosCore.create(registration, false, options.alias);\n booted = core.whenReady().then(() => core);\n }\n return booted;\n}\n\nconst FIXTURE_TEST_DEFAULTS: KosMockPlaybackOptions = {\n ignoreLatency: true,\n pushes: \"manual\",\n};\n\nfunction buildBootBuilder(): KosCoreBootBuilder {\n const registrations: (() => void)[] = [];\n const mockInstalls: (() => Promise<void> | void)[] = [];\n const preloadModels: Preloaded[] = [];\n let alias: string | undefined;\n\n const builder: KosCoreBootBuilder = {\n model: (registration, preload) => {\n registrations.push(() =>\n RegistrationManager.model.register(builder)(registration, preload)\n );\n return builder;\n },\n preload: (model) => {\n preloadModels.push(model);\n return builder;\n },\n companion: (parentType, companion) => {\n registrations.push(() =>\n RegistrationManager.companion.register(builder)(parentType, companion)\n );\n return builder;\n },\n legacy: (type, registration) => {\n registrations.push(() =>\n RegistrationManager.model.registerLegacyModel(builder)(\n type,\n registration\n )\n );\n return builder;\n },\n alias: (value) => {\n alias = value;\n return builder;\n },\n setup: (module) => {\n mockInstalls.push(async () => {\n await module(KosMock);\n });\n return builder;\n },\n fixture: (fixture, options) => {\n mockInstalls.push(() => {\n KosMock.loadFixture(fixture, { ...FIXTURE_TEST_DEFAULTS, ...options });\n });\n return builder;\n },\n boot: async () => {\n // Mocks first, in call order, before the transport exists — the same\n // \"routes before boot\" rule a test follows when it calls KosMock.get.\n for (const install of mockInstalls.splice(0)) {\n await install();\n }\n prepareTransport(alias);\n registrations.splice(0).forEach((register) => register());\n return bootCore({ models: {}, preloadModels }, { alias });\n },\n };\n\n return builder;\n}\n\n/**\n * Open a registration chain, then `boot()` it.\n *\n * Idempotent per module instance: the first `boot()` boots, later ones return\n * the same core. KosCore and the model manager are process-global, so a test\n * file gets one core and one set of singletons — which is the isolation\n * boundary, and the reason a differently-configured singleton needs its own\n * file.\n *\n * Register any routes the models need BEFORE calling `boot()`, so nothing races\n * the boot requests — `KosMock.get(...)` above the chain, or `.setup()` /\n * `.fixture()` on it.\n *\n * @example\n * ```ts\n * await bootKosCore().model(AssetManager).model(AssetEntry).boot();\n *\n * await bootKosCore()\n * .setup(boardBaseline) // fixtures/setups/board-baseline.mjs\n * .fixture(pourOk) // fixtures/pour-ok.json\n * .model(Board)\n * .boot();\n * ```\n */\nexport function bootKosCore(): KosCoreBootBuilder;\n/**\n * Boot KosCore from an assembled registry.\n *\n * Kept for callers that already hold an `IKosRegistry`. A test registering its\n * own models should use the no-argument chain instead, which takes the\n * registration beans directly.\n *\n * @param registration Models under test, e.g. `{ models: {...}, preloadModels: [] }`.\n */\nexport function bootKosCore(\n registration: IKosRegistry,\n options?: BootKosCoreOptions\n): Promise<IKosCoreManager>;\nexport function bootKosCore(\n registration?: IKosRegistry,\n options: BootKosCoreOptions = {}\n): KosCoreBootBuilder | Promise<IKosCoreManager> {\n return registration ? bootCore(registration, options) : buildBootBuilder();\n}\n\n/**\n * Wait until `predicate` holds, then resolve — or reject naming what never\n * happened.\n *\n * Model reactions are asynchronous, so a test that changes an input and asserts\n * immediately reads the old value. Polling for the OUTCOME beats sleeping for an\n * arbitrary interval: it is faster when the reaction is quick, and it fails with\n * a usable message instead of a bare assertion diff when the reaction never\n * fires at all.\n *\n * @param label What is being waited for, quoted back in the timeout message.\n */\nexport async function until(\n predicate: () => boolean,\n label: string,\n timeoutMs = 2000\n): Promise<void> {\n const deadline = Date.now() + timeoutMs;\n while (!predicate()) {\n if (Date.now() > deadline) {\n throw new Error(`timed out waiting for ${label}`);\n }\n await new Promise((resolve) => setTimeout(resolve, 5));\n }\n}\n"],"names":[],"mappings":";;;AAmEA,IAAI;AACJ,IAAI,WAAW;AAyEf,SAAS,iBAAiB,OAAsB;AAC9C,MAAI,UAAU;AACZ;AAAA,EACF;AACA,aAAW;AACX,UAAQ,UAAU,EAAE,YAAY,KAAA,CAAM;AACtC,UAAQ,YAAY,EAAE,iBAAiB,MAAA,CAAO;AAChD;AAEA,SAAS,SACP,cACA,SAC0B;AAC1B,MAAI,CAAC,QAAQ;AACX,qBAAiB,QAAQ,KAAK;AAC9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AGhB,iBAAW,WAAW,aAAa,OAAO,CAAC,GAAG;AAC5C,cAAM,QAAA;AAAA,MACR;AACA,uBAAiB,KAAK;AACtB,oBAAc,OAAO,CAAC,EAAE,QAAQ,CAAC,aAAa,UAAU;AACxD,aAAO,SAAS,EAAE,QAAQ,CAAA,GAAI,cAAA,GAAiB,EAAE,OAAO;AAAA,IAC1D;AAAA,EAAA;AAGF,SAAO;AACT;AAwCO,SAAS,YACd,cACA,UAA8B,IACiB;AAC/C,SAAO,eAAe,SAAS,cAAc,OAAO,IAAI,iBAAA;AAC1D;AAcA,eAAsB,MACpB,WACA,OACA,YAAY,KACG;AACf,QAAM,WAAW,KAAK,IAAA,IAAQ;AAC9B,SAAO,CAAC,aAAa;AACnB,QAAI,KAAK,IAAA,IAAQ,UAAU;AACzB,YAAM,IAAI,MAAM,yBAAyB,KAAK,EAAE;AAAA,IAClD;AACA,UAAM,IAAI,QAAQ,CAAC,YAAY,WAAW,SAAS,CAAC,CAAC;AAAA,EACvD;AACF;"}
1
+ {"version":3,"file":"testing.js","sources":["../../../packages/kos-ui-sdk/src/testing/index.ts"],"sourcesContent":["/**\n * Test support for KOS models: boots the framework in a unit test without a\n * device, WebSocket server or browser.\n *\n * KOS models need a live KosCore, and KosCore opens a WebSocket as soon as it\n * is created. `bootKosCore` boots it on KosMock's standalone loopback\n * transport instead, which authorizes itself so `whenReady()` resolves without\n * a device or the `KOS_ALLOW_ANONYMOUS` build flag.\n *\n * `bootKosCore()` returns the same registration chain an app's\n * `KosModelRegistry` gives (`.model()`, `.preload()`, `.companion()`,\n * `.legacy()`), so a test passes the model's registration bean directly.\n * `boot()` also registers the SDK's core models, so a model with a\n * `@kosConfigProperty` or a dependency on a core model builds with only the\n * model under test on the chain.\n *\n * Backend traffic is mocked as an app would mock it (`KosMock.get`,\n * `KosMock.post`, fixtures, config injection), so a test exercises the real\n * request path. `.setup()` and `.fixture()` install the project's setup modules\n * and recorded fixtures before boot.\n *\n * ```ts\n * import { bootKosCore } from \"@kosdev-code/kos-ui-sdk/testing\";\n * import { KosMock, whenReady } from \"@kosdev-code/kos-ui-sdk\";\n * import { Board } from \"./models/board\";\n *\n * beforeAll(async () => {\n * KosMock.get(\"/api/board/:id\", { data: { id: \"b1\", state: \"READY\" } });\n * await bootKosCore().model(Board).boot();\n * });\n *\n * it(\"loads the board\", async () => {\n * const board = Board.instance(\"b1\").options({}).build();\n * await whenReady(board);\n * expect(board.state).toBe(\"READY\");\n * });\n * ```\n *\n * Singleton models take one configuration per test file: a second\n * `options(...)` call returns the first instance and silently discards the new\n * options. Put a case that needs different options in its own file.\n *\n * The standalone socket authorizes by publishing Studio's\n * `/studioServer/auth/LOGGED_IN` on every open, which a device never sends, so\n * disconnect and reconnect tests here follow Studio's sequence rather than a\n * device's.\n */\nimport type {\n BaseKosModelRegistrationBean,\n IKosCoreManager,\n IKosModelRegistration,\n IKosRegistry,\n KosCompanionModelType,\n KosMockFixture,\n KosMockPlaybackOptions,\n KosMockSetupModule,\n KosModelRegistrationType,\n Preloaded,\n} from \"../core\";\nimport { KosCore, KosMock, RegistrationManager } from \"../core\";\nimport { KosModelRegistry } from \"../models/utils/core-registration-manager\";\n\nlet booted: Promise<IKosCoreManager> | undefined;\nlet prepared = false;\n\nexport interface BootKosCoreOptions {\n /** Connection alias, when the model under test cares about one. */\n alias?: string;\n}\n\n/**\n * A model's registration bean: the value `@kosModel` generates beside the\n * model, which an application passes to `KosModelRegistry...model()`.\n *\n * Pass the bean itself rather than its `registration` property; the property\n * registers nothing, and the model then fails on its first build.\n */\nexport type KosTestRegistration =\n | BaseKosModelRegistrationBean<any, any>\n | KosModelRegistrationType<any, any>;\n\n/**\n * The registration chain an application uses, terminated by `boot()`.\n *\n * Every call is deferred until `boot()`, so ordering within the chain does not\n * matter and `alias()` may come after the models it applies to. `boot()`\n * registers the SDK's core models before the chain's own registrations, the\n * same set `KosModelRegistry.core.models()` registers in an app.\n */\nexport interface KosCoreBootBuilder {\n /** Register a model under test, optionally preloading it. */\n model: (\n registration: KosTestRegistration,\n preload?: boolean\n ) => KosCoreBootBuilder;\n /** Preload a model type, or a specific instance of one, at boot. */\n preload: (model: Preloaded) => KosCoreBootBuilder;\n /** Attach a companion model type to a parent type. */\n companion: (\n parentType: string,\n companion: KosCompanionModelType<any>\n ) => KosCoreBootBuilder;\n /** Register a hand-written registration record against a type. */\n legacy: (\n type: string,\n registration: IKosModelRegistration\n ) => KosCoreBootBuilder;\n /** Connection alias, when the model under test cares about one. */\n alias: (alias: string) => KosCoreBootBuilder;\n /**\n * Install a KosMock setup module before boot: the default export the\n * fixture server serves from `fixtures/setups/*.mjs`, imported directly. It\n * runs before the transport exists, so it can register routes, transformers,\n * config injections and observers; pushes belong after boot.\n */\n setup: (module: KosMockSetupModule) => KosCoreBootBuilder;\n /**\n * Load a recorded fixture before boot: the JSON the fixture server serves,\n * imported directly. Test defaults are `ignoreLatency: true` (full speed) and\n * `pushes: \"manual\"` (the capture's topic and future timeline stays inert, and\n * the test pushes what it asserts on). Pass options to override either.\n */\n fixture: (\n fixture: KosMockFixture,\n options?: KosMockPlaybackOptions\n ) => KosCoreBootBuilder;\n /** Boot KosCore with the core models and everything on this chain. */\n boot: () => Promise<IKosCoreManager>;\n}\n\n/**\n * Put the mock transport and the connection alias in place before anything\n * constructs KosCore.\n *\n * KosCore picks its transport and reads its alias in the constructor, and\n * registering a model calls `KosCore.getInstance()`, so registration cannot\n * come first.\n */\nfunction prepareTransport(alias?: string): void {\n if (prepared) {\n return;\n }\n prepared = true;\n KosMock.configure({ standalone: true });\n KosCore.getInstance({ connectionAlias: alias });\n}\n\nfunction bootCore(\n registration: IKosRegistry,\n options: BootKosCoreOptions\n): Promise<IKosCoreManager> {\n if (!booted) {\n prepareTransport(options.alias);\n const core = KosCore.create(registration, false, options.alias);\n booted = core.whenReady().then(() => core);\n }\n return booted;\n}\n\nconst FIXTURE_TEST_DEFAULTS: KosMockPlaybackOptions = {\n ignoreLatency: true,\n pushes: \"manual\",\n};\n\nfunction buildBootBuilder(): KosCoreBootBuilder {\n const registrations: (() => void)[] = [];\n const mockInstalls: (() => Promise<void> | void)[] = [];\n const preloadModels: Preloaded[] = [];\n let alias: string | undefined;\n\n const builder: KosCoreBootBuilder = {\n model: (registration, preload) => {\n registrations.push(() =>\n RegistrationManager.model.register(builder)(registration, preload)\n );\n return builder;\n },\n preload: (model) => {\n preloadModels.push(model);\n return builder;\n },\n companion: (parentType, companion) => {\n registrations.push(() =>\n RegistrationManager.companion.register(builder)(parentType, companion)\n );\n return builder;\n },\n legacy: (type, registration) => {\n registrations.push(() =>\n RegistrationManager.model.registerLegacyModel(builder)(\n type,\n registration\n )\n );\n return builder;\n },\n alias: (value) => {\n alias = value;\n return builder;\n },\n setup: (module) => {\n mockInstalls.push(async () => {\n await module(KosMock);\n });\n return builder;\n },\n fixture: (fixture, options) => {\n mockInstalls.push(() => {\n KosMock.loadFixture(fixture, { ...FIXTURE_TEST_DEFAULTS, ...options });\n });\n return builder;\n },\n boot: async () => {\n // Mocks first, in call order, before the transport exists.\n for (const install of mockInstalls.splice(0)) {\n await install();\n }\n prepareTransport(alias);\n KosModelRegistry.core.models();\n registrations.splice(0).forEach((register) => register());\n return bootCore({ models: {}, preloadModels }, { alias });\n },\n };\n\n return builder;\n}\n\n/**\n * Open a registration chain, then `boot()` it.\n *\n * Idempotent per module instance: the first `boot()` boots and later calls\n * return the same core. KosCore and the model manager are process-global, so\n * a test file gets one core and one set of singletons.\n *\n * Register the routes the models need before calling `boot()` so nothing races\n * the boot requests, either with `KosMock.get(...)` above the chain or with\n * `.setup()` / `.fixture()` on it.\n *\n * @example\n * ```ts\n * await bootKosCore()\n * .setup(boardBaseline) // fixtures/setups/board-baseline.mjs\n * .fixture(pourOk) // fixtures/pour-ok.json\n * .model(Board)\n * .boot();\n * ```\n */\nexport function bootKosCore(): KosCoreBootBuilder;\n/**\n * Boot KosCore from an assembled registry.\n *\n * For callers that already hold an `IKosRegistry`; it boots exactly the\n * registry it is given. A test registering its own models should use the\n * no-argument chain, which takes registration beans directly and registers the\n * SDK's core models.\n *\n * @param registration Models under test, e.g. `{ models: {...}, preloadModels: [] }`.\n */\nexport function bootKosCore(\n registration: IKosRegistry,\n options?: BootKosCoreOptions\n): Promise<IKosCoreManager>;\nexport function bootKosCore(\n registration?: IKosRegistry,\n options: BootKosCoreOptions = {}\n): KosCoreBootBuilder | Promise<IKosCoreManager> {\n return registration ? bootCore(registration, options) : buildBootBuilder();\n}\n\n/**\n * Resolves once `predicate` holds, or rejects with a message naming `label`\n * after the timeout.\n *\n * Model reactions are asynchronous, so a test that changes an input and asserts\n * at once reads the old value. Polling for the outcome is faster than sleeping\n * for a fixed interval and fails with a clear message when the reaction never\n * fires.\n *\n * @param label What is being waited for, quoted back in the timeout message.\n */\nexport async function until(\n predicate: () => boolean,\n label: string,\n timeoutMs = 2000\n): Promise<void> {\n const deadline = Date.now() + timeoutMs;\n while (!predicate()) {\n if (Date.now() > deadline) {\n throw new Error(`timed out waiting for ${label}`);\n }\n await new Promise((resolve) => setTimeout(resolve, 5));\n }\n}\n"],"names":[],"mappings":";;;AA8DA,IAAI;AACJ,IAAI,WAAW;AA2Ef,SAAS,iBAAiB,OAAsB;AAC9C,MAAI,UAAU;AACZ;AAAA,EACF;AACA,aAAW;AACX,UAAQ,UAAU,EAAE,YAAY,KAAA,CAAM;AACtC,UAAQ,YAAY,EAAE,iBAAiB,MAAA,CAAO;AAChD;AAEA,SAAS,SACP,cACA,SAC0B;AAC1B,MAAI,CAAC,QAAQ;AACX,qBAAiB,QAAQ,KAAK;AAC9B,UAAM,OAAO,QAAQ,OAAO,cAAc,OAAO,QAAQ,KAAK;AAC9D,aAAS,KAAK,UAAA,EAAY,KAAK,MAAM,IAAI;AAAA,EAC3C;AACA,SAAO;AACT;AAEA,MAAM,wBAAgD;AAAA,EACpD,eAAe;AAAA,EACf,QAAQ;AACV;AAEA,SAAS,mBAAuC;AAC9C,QAAM,gBAAgC,CAAA;AACtC,QAAM,eAA+C,CAAA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AAA;AAGF,SAAO;AACT;AAqCO,SAAS,YACd,cACA,UAA8B,IACiB;AAC/C,SAAO,eAAe,SAAS,cAAc,OAAO,IAAI,iBAAA;AAC1D;AAaA,eAAsB,MACpB,WACA,OACA,YAAY,KACG;AACf,QAAM,WAAW,KAAK,IAAA,IAAQ;AAC9B,SAAO,CAAC,aAAa;AACnB,QAAI,KAAK,IAAA,IAAQ,UAAU;AACzB,YAAM,IAAI,MAAM,yBAAyB,KAAK,EAAE;AAAA,IAClD;AACA,UAAM,IAAI,QAAQ,CAAC,YAAY,WAAW,SAAS,CAAC,CAAC;AAAA,EACvD;AACF;"}
@@ -0,0 +1,9 @@
1
+ export declare const buttonRoot: import('@emotion/react').SerializedStyles;
2
+ export declare const positions: {
3
+ readonly "bottom-left": import('@emotion/react').SerializedStyles;
4
+ readonly "bottom-right": import('@emotion/react').SerializedStyles;
5
+ readonly "top-left": import('@emotion/react').SerializedStyles;
6
+ readonly "top-right": import('@emotion/react').SerializedStyles;
7
+ };
8
+ export declare const statusText: import('@emotion/react').SerializedStyles;
9
+ //# sourceMappingURL=connection-dev-button-styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection-dev-button-styles.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/ui/components/connection-dev-button/connection-dev-button-styles.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,UAAU,2CAoBtB,CAAC;AAEF,eAAO,MAAM,SAAS;;;;;CAiBZ,CAAC;AAEX,eAAO,MAAM,UAAU,2CAItB,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { default as React } from 'react';
2
+ import { ConnectionDevState } from './use-connection-dev-state';
3
+ export { useConnectionDevState, type ConnectionDevState, type ConnectionDevStatus, } from './use-connection-dev-state';
4
+ /**
5
+ * Props for ConnectionDevButton.
6
+ *
7
+ * @kosService core.connection-dev-button
8
+ * @kosApiLevel 25
9
+ */
10
+ export interface ConnectionDevButtonProps {
11
+ /** Screen corner the button is fixed to. Default: "bottom-right". */
12
+ position?: "bottom-left" | "bottom-right" | "top-left" | "top-right";
13
+ /** Button label. Default: "Drop connection". */
14
+ label?: string;
15
+ className?: string;
16
+ /**
17
+ * Fully replace the button's content with a custom renderer. Receives the
18
+ * connection state. If provided, the default label and status are not
19
+ * rendered.
20
+ */
21
+ renderContent?: (state: ConnectionDevState) => React.ReactNode;
22
+ }
23
+ /**
24
+ * Minimal, unbranded development button that drops the KOS websocket so the
25
+ * reconnect path can be exercised from any KOS application. Shows the live
26
+ * connection status and, on click, calls the transport's `dropConnection()`;
27
+ * the transport reconnects on its own and KOS Core runs its reconnect
28
+ * sequence. Disabled while the core is not online.
29
+ *
30
+ * Pair with ReconnectingOverlay to see the reconnect as users do.
31
+ *
32
+ * @kosService core.connection-dev-button
33
+ * @kosApiLevel 25
34
+ */
35
+ export declare const ConnectionDevButton: React.FC<ConnectionDevButtonProps>;
36
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/ui/components/connection-dev-button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,4BAA4B,CAAC;AAOpC,OAAO,EACL,qBAAqB,EACrB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,GACzB,MAAM,4BAA4B,CAAC;AAEpC;;;;;GAKG;AACH,MAAM,WAAW,wBAAwB;IACvC,qEAAqE;IACrE,QAAQ,CAAC,EAAE,aAAa,GAAG,cAAc,GAAG,UAAU,GAAG,WAAW,CAAC;IACrE,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,KAAK,CAAC,SAAS,CAAC;CAChE;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CA0BlE,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Connection status shown by ConnectionDevButton.
3
+ *
4
+ * @kosService core.use-connection-dev-state
5
+ * @kosApiLevel 25
6
+ */
7
+ export type ConnectionDevStatus = "online" | "offline" | "reconnecting";
8
+ /**
9
+ * Snapshot of the connection, returned by useConnectionDevState.
10
+ *
11
+ * @kosService core.use-connection-dev-state
12
+ * @kosApiLevel 25
13
+ */
14
+ export interface ConnectionDevState {
15
+ /**
16
+ * `reconnecting` while KOS Core reloads or runs its reconnect sequence,
17
+ * otherwise `online` or `offline` from the core's connection.
18
+ */
19
+ status: ConnectionDevStatus;
20
+ }
21
+ /**
22
+ * Headless state hook for ConnectionDevButton. Tracks KOS Core's `isOnline`
23
+ * and `reloading` reactively and reports them as one status.
24
+ *
25
+ * @kosService core.use-connection-dev-state
26
+ * @kosApiLevel 25
27
+ */
28
+ export declare const useConnectionDevState: () => ConnectionDevState;
29
+ //# sourceMappingURL=use-connection-dev-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-connection-dev-state.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/ui/components/connection-dev-button/use-connection-dev-state.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,SAAS,GAAG,cAAc,CAAC;AAExE;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,MAAM,EAAE,mBAAmB,CAAC;CAC7B;AAOD;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,QAAO,kBAgBxC,CAAC"}
@@ -3,4 +3,5 @@ export * from './error-boundary';
3
3
  export * from './progress-bar';
4
4
  export * from './kos-model-loader';
5
5
  export * from './reconnecting-overlay';
6
+ export * from './connection-dev-button';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ui-sdk/src/ui/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC9D,cAAc,kBAAkB,CAAC;AAEjC,cAAc,gBAAgB,CAAC;AAE/B,cAAc,oBAAoB,CAAC;AAEnC,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ui-sdk/src/ui/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC9D,cAAc,kBAAkB,CAAC;AAEjC,cAAc,gBAAgB,CAAC;AAE/B,cAAc,oBAAoB,CAAC;AAEnC,cAAc,wBAAwB,CAAC;AAEvC,cAAc,yBAAyB,CAAC"}
@@ -5,17 +5,18 @@ interface UseImageRendererProps {
5
5
  src: string;
6
6
  }
7
7
  /**
8
- * A custom hook that initializes and manages a video renderer for streaming video frames.
8
+ * A custom hook that initializes and manages an image renderer, streaming the
9
+ * image as frames at 5 fps.
9
10
  *
10
- * @param {UseImageRendererProps} props - The properties required to configure the video renderer.
11
+ * @param {UseImageRendererProps} props - The properties required to configure the image renderer.
11
12
  * @param {number} props.width - The width of the image frame.
12
13
  * @param {number} props.height - The height of the image frame.
13
14
  * @param {Function} props.onFrame - A callback function invoked for each rendered frame.
14
15
  * @param {string} props.src - The source URL or path of the image to be rendered.
15
16
  *
16
17
  * @returns {readonly [boolean, () => void]} A tuple containing:
17
- * - `isStreaming` (boolean): Indicates whether the video is currently streaming.
18
- * - `startStreaming` (Function): A function to start the video streaming process.
18
+ * - `isStreaming` (boolean): Indicates whether the image is currently streaming.
19
+ * - `startStreaming` (Function): A function to start streaming.
19
20
  */
20
21
  export declare const useImageRenderer: ({ width, height, onFrame, src, }: UseImageRendererProps) => readonly [boolean, () => void];
21
22
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"use-image-renderer.d.ts","sourceRoot":"","sources":["../../../../../../../packages/kos-ui-sdk/src/ui/features/canvas/hooks/use-image-renderer.ts"],"names":[],"mappings":"AAIA,UAAU,qBAAqB;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC5C,GAAG,EAAE,MAAM,CAAC;CACb;AACD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,gBAAgB,GAAI,kCAM9B,qBAAqB,mCAWvB,CAAC"}
1
+ {"version":3,"file":"use-image-renderer.d.ts","sourceRoot":"","sources":["../../../../../../../packages/kos-ui-sdk/src/ui/features/canvas/hooks/use-image-renderer.ts"],"names":[],"mappings":"AAIA,UAAU,qBAAqB;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC5C,GAAG,EAAE,MAAM,CAAC;CACb;AACD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gBAAgB,GAAI,kCAM9B,qBAAqB,mCAWvB,CAAC"}
@@ -39,21 +39,11 @@ interface UseFunctionWarmupOptions {
39
39
  *
40
40
  * @example
41
41
  * ```tsx
42
- * import { useFunctionWarmup } from './use-function-warmup';
43
- *
44
- * const myFunction = (arg?: any) => {
45
- * if (arg?.__warmup) {
46
- * console.log('Warming up...');
47
- * } else {
48
- * console.log('Executing function...');
49
- * }
42
+ * const lookup = (arg?: string | WarmupMarker) => {
43
+ * if (typeof arg === "object" && arg.__warmup) return;
44
+ * // ...
50
45
  * };
51
- *
52
- * function MyComponent() {
53
- * useFunctionWarmup(myFunction, { intervalMs: 60000, immediate: true });
54
- *
55
- * return <div>My Component</div>;
56
- * }
46
+ * useFunctionWarmup(lookup, { intervalMs: 60000 });
57
47
  * ```
58
48
  */
59
49
  export declare function useFunctionWarmup<T extends (arg?: any) => any>(fn: Warmupable<T>, options?: UseFunctionWarmupOptions): void;
@@ -1 +1 @@
1
- {"version":3,"file":"use-function-warmup.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ui-sdk/src/ui/hooks/use-function-warmup.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,MAAM,MAAM,YAAY,GAAG;IAAE,QAAQ,EAAE,IAAI,CAAA;CAAE,CAAC;AAG9C,KAAK,UAAU,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,GAAG,KAAK,GAAG,IAAI,CAC9C,GAAG,CAAC,EAAE,GAAG,GAAG,YAAY,KACrB,UAAU,CAAC,CAAC,CAAC,CAAC;AAEnB,UAAU,wBAAwB;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,GAAG,KAAK,GAAG,EAC5D,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC,EACjB,OAAO,GAAE,wBAA6B,QA0BvC"}
1
+ {"version":3,"file":"use-function-warmup.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ui-sdk/src/ui/hooks/use-function-warmup.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,MAAM,MAAM,YAAY,GAAG;IAAE,QAAQ,EAAE,IAAI,CAAA;CAAE,CAAC;AAG9C,KAAK,UAAU,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,GAAG,KAAK,GAAG,IAAI,CAC9C,GAAG,CAAC,EAAE,GAAG,GAAG,YAAY,KACrB,UAAU,CAAC,CAAC,CAAC,CAAC;AAEnB,UAAU,wBAAwB;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,GAAG,KAAK,GAAG,EAC5D,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC,EACjB,OAAO,GAAE,wBAA6B,QA0BvC"}
@@ -3,19 +3,18 @@ import { ChangeEvent } from 'react';
3
3
  type SelectCallback = string | ChangeEvent<HTMLSelectElement>;
4
4
  type DateFormatMap<T extends {} = any> = (format: DateFormatOptions) => T;
5
5
  /**
6
- * The data returned from the useKosRegions hook.
7
- * @typeParam RegionData - the region data returned from the backend service. The type must extend BaseRegionResponse from the kos-core-model.
8
- * @typeParam T - the type of the options returned from the regionMap function.
6
+ * The data returned from the useKosDateFormats hook.
7
+ * @typeParam T - the type of the options returned from the dateFormatMap function.
9
8
  */
10
9
  export interface KosDateFormatHookData<T extends {} = any> {
11
- /**the raw region data returned from the backend service. */
10
+ /** the ids of the available date formats. */
12
11
  raw: string[];
13
- /**the region model returned from the backend service. */
12
+ /** the region info model. */
14
13
  regionModel?: RegionInfoModel;
15
- /**the currently selected region. */
14
+ /** the currently selected date format. */
16
15
  selectedDateFormat: string;
17
16
  dateFormatId: string;
18
- /**a function that can be used to update the region. */
17
+ /** updates the selected date format. */
19
18
  updateDateFormat: (e: SelectCallback) => void;
20
19
  /**the props that can be spread into a select box component. */
21
20
  props: {
@@ -25,30 +24,17 @@ export interface KosDateFormatHookData<T extends {} = any> {
25
24
  };
26
25
  }
27
26
  /**
28
- * A hook that will help manage the use of region date formats on a dispenser.
29
- * @param dateFormatMap - a function that maps a region string a structure that can be
30
- * used as an option in a select box. The default is to return an option element
31
- * with the date format as the value and label.
27
+ * Manages the region's date format: the available formats, the selected
28
+ * format, and props for a date format select box.
29
+ *
30
+ * @param dateFormatMap - maps a date format to a select-box option. The
31
+ * default returns an `<option>` with the format as value and label.
32
32
  * @returns KosDateFormatHookData - the data returned from the hook.
33
33
  * @example
34
- * In this example the default region map is used to populate a select box with the available regions. If using a third party select box component where the options
35
- * are passed in as a prop, the options property can be spread into the props for the component. In this case, a region map function could be passed in to map the region
36
- * to a structure that the component expects.
37
- *
38
- *
39
- * ```typescript
40
- * interface RegionData extends RegionServices.BaseRegionResponse {
41
- * rfidRegion: string;
42
- * }
43
- * const { regionSelectProps, regionModel, regionData, selectedRegion, updateRegion } = useKosRegions<RegionData>();
44
- * const { options, ...selectAttributes } = regionSelectProps;
45
- * ...
46
- * <div>
47
- * <label>Select region: </label>
48
- * <select {...selectAttributes}>{options}</select>
49
- * </div>
50
- * <div>Selected Region: {selectedRegion}</div>
51
- * <div>Region Data: {regionData?.rfidRegion}</div>
34
+ * ```tsx
35
+ * const { props } = useKosDateFormats();
36
+ * const { options, ...selectAttributes } = props;
37
+ * return <select {...selectAttributes}>{options}</select>;
52
38
  * ```
53
39
  */
54
40
  export declare const useKosDateFormats: <T extends {} = any>(dateFormatMap?: DateFormatMap<T>) => KosDateFormatHookData<T>;
@@ -1 +1 @@
1
- {"version":3,"file":"use-kos-date-formats.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ui-sdk/src/ui/hooks/use-kos-date-formats.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EAEhB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,WAAW,EAAoC,MAAM,OAAO,CAAC;AAGtE,KAAK,cAAc,GAAG,MAAM,GAAG,WAAW,CAAC,iBAAiB,CAAC,CAAC;AAC9D,KAAK,aAAa,CAAC,CAAC,SAAS,EAAE,GAAG,GAAG,IAAI,CAAC,MAAM,EAAE,iBAAiB,KAAK,CAAC,CAAC;AAO1E;;;;GAIG;AACH,MAAM,WAAW,qBAAqB,CAAC,CAAC,SAAS,EAAE,GAAG,GAAG;IACvD,4DAA4D;IAC5D,GAAG,EAAE,MAAM,EAAE,CAAC;IAEd,yDAAyD;IACzD,WAAW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,gBAAgB,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IAE9C,+DAA+D;IAC/D,KAAK,EAAE;QACL,QAAQ,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;QACtC,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,CAAC,EAAE,CAAC;KACd,CAAC;CACH;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,EAAE,GAAG,GAAG,EAClD,gBAAe,aAAa,CAAC,CAAC,CAAsB,KACnD,qBAAqB,CAAC,CAAC,CAkEzB,CAAC"}
@@ -12,63 +12,12 @@ type OptionMap<T extends {} = any> = (option: string) => T;
12
12
  * @returns An object containing timezone options, raw timezone data, the selected timezone, and functions to handle updates.
13
13
  *
14
14
  * @example
15
- * ```typescript
16
- * import React from 'react';
17
- * import { useKosTimeZones } from '@kosdev-code/kos-ui-sdk';
18
- *
19
- * const MyComponent: React.FC = () => {
20
- * // Using the hook with the default option mapper
15
+ * ```tsx
16
+ * const TimeZonePicker = kosComponent(() => {
21
17
  * const { selectProps } = useKosTimeZones();
22
- *
23
- * return (
24
- * <div>
25
- * <label>Select Timezone:</label>
26
- * <select {...selectProps}>
27
- * {selectProps.options}
28
- * </select>
29
- * </div>
30
- * );
31
- * };
32
- *
33
- * export default MyComponent;
34
- * ```
35
- * @example
36
- * Using the hook with a custom component and regionMap function:
37
- *
38
- * ```typescript
39
- * import React from 'react';
40
- * import { useKosTimeZones } from '@kosdev-code/kos-ui-sdk';
41
- *
42
- * // Custom component that expects an options prop
43
- * const CustomSelectComponent: React.FC<{ options: { label: string; value: string }[] }> = ({ options }) => {
44
- * return (
45
- * <select>
46
- * {options.map(option => (
47
- * <option key={option.value} value={option.value}>{option.label}</option>
48
- * ))}
49
- * </select>
50
- * );
51
- * };
52
- *
53
- * // Custom regionMap function to map timezones to the required format for CustomSelectComponent
54
- * const customRegionMap = (timezone: string) => ({
55
- * label: `Timezone: ${timezone}`,
56
- * value: timezone
18
+ * const { options, ...props } = selectProps;
19
+ * return <select {...props}>{options}</select>;
57
20
  * });
58
- *
59
- * const MyComponent: React.FC = () => {
60
- * // Using the hook with the custom regionMap function
61
- * const { options } = useKosTimeZones(customRegionMap);
62
- *
63
- * return (
64
- * <div>
65
- * <label>Select Timezone:</label>
66
- * <CustomSelectComponent options={options} />
67
- * </div>
68
- * );
69
- * };
70
- *
71
- * export default MyComponent;
72
21
  * ```
73
22
  */
74
23
  export declare const useKosTimeZones: <T extends {} = any>(optionsMap?: OptionMap<T>) => {
@@ -1 +1 @@
1
- {"version":3,"file":"use-kos-region-timezones.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ui-sdk/src/ui/hooks/use-kos-region-timezones.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAoC,MAAM,OAAO,CAAC;AAEtE,OAAO,EAIL,eAAe,EAGhB,MAAM,cAAc,CAAC;AAGtB,KAAK,cAAc,GAAG,MAAM,GAAG,WAAW,CAAC,iBAAiB,CAAC,CAAC;AAC9D,KAAK,SAAS,CAAC,CAAC,SAAS,EAAE,GAAG,GAAG,IAAI,CAAC,MAAM,EAAE,MAAM,KAAK,CAAC,CAAC;AAY3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoEG;AACH,eAAO,MAAM,eAAe,GAAI,CAAC,SAAS,EAAE,GAAG,GAAG,EAChD,aAAY,SAAS,CAAC,CAAC,CAAsB;;;;;;wBA+CR,cAAc;;sBAAd,cAAc;;;;CA0BpD,CAAC"}
1
+ {"version":3,"file":"use-kos-region-timezones.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ui-sdk/src/ui/hooks/use-kos-region-timezones.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAoC,MAAM,OAAO,CAAC;AAEtE,OAAO,EAIL,eAAe,EAGhB,MAAM,cAAc,CAAC;AAGtB,KAAK,cAAc,GAAG,MAAM,GAAG,WAAW,CAAC,iBAAiB,CAAC,CAAC;AAC9D,KAAK,SAAS,CAAC,CAAC,SAAS,EAAE,GAAG,GAAG,IAAI,CAAC,MAAM,EAAE,MAAM,KAAK,CAAC,CAAC;AAY3D;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,eAAe,GAAI,CAAC,SAAS,EAAE,GAAG,GAAG,EAChD,aAAY,SAAS,CAAC,CAAC,CAAsB;;;;;;wBA+CR,cAAc;;sBAAd,cAAc;;;;CA0BpD,CAAC"}