@kosdev-code/kos-ui-sdk 3.0.26 → 3.0.28
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.
- package/.kos.json +2 -1
- package/common/events/async-event-bus.d.ts +8 -11
- package/common/events/async-event-bus.d.ts.map +1 -1
- package/common/events/eventBus.d.ts +1 -18
- package/common/events/eventBus.d.ts.map +1 -1
- package/core/core/companion-instantiator.d.ts +5 -0
- package/core/core/companion-instantiator.d.ts.map +1 -1
- package/core/core/decorators/index.d.ts +1 -0
- package/core/core/decorators/index.d.ts.map +1 -1
- package/core/core/decorators/kos-child.d.ts +2 -3
- package/core/core/decorators/kos-child.d.ts.map +1 -1
- package/core/core/decorators/kos-companion.d.ts +26 -88
- package/core/core/decorators/kos-companion.d.ts.map +1 -1
- package/core/core/decorators/kos-container-aware-reconcile.test-d.d.ts +2 -0
- package/core/core/decorators/kos-container-aware-reconcile.test-d.d.ts.map +1 -0
- package/core/core/decorators/kos-container-aware.d.ts +191 -420
- package/core/core/decorators/kos-container-aware.d.ts.map +1 -1
- package/core/core/decorators/kos-execute-service-request.d.ts +7 -11
- package/core/core/decorators/kos-execute-service-request.d.ts.map +1 -1
- package/core/core/decorators/kos-execution-context.d.ts +14 -31
- package/core/core/decorators/kos-execution-context.d.ts.map +1 -1
- package/core/core/decorators/kos-future-aware.d.ts +21 -74
- package/core/core/decorators/kos-future-aware.d.ts.map +1 -1
- package/core/core/decorators/kos-http-decorators.d.ts +18 -62
- package/core/core/decorators/kos-http-decorators.d.ts.map +1 -1
- package/core/core/decorators/kos-logger-aware.d.ts +10 -60
- package/core/core/decorators/kos-logger-aware.d.ts.map +1 -1
- package/core/core/decorators/kos-mixin.d.ts +69 -0
- package/core/core/decorators/kos-mixin.d.ts.map +1 -0
- package/core/core/decorators/kos-model-effect.d.ts +10 -9
- package/core/core/decorators/kos-model-effect.d.ts.map +1 -1
- package/core/core/decorators/kos-multiple-future-aware.d.ts +21 -94
- package/core/core/decorators/kos-multiple-future-aware.d.ts.map +1 -1
- package/core/core/decorators/kos-reload-aware.d.ts +14 -16
- package/core/core/decorators/kos-reload-aware.d.ts.map +1 -1
- package/core/core/decorators/kos-service-request.d.ts +80 -238
- package/core/core/decorators/kos-service-request.d.ts.map +1 -1
- package/core/core/decorators/kos-state-machine.d.ts +35 -275
- package/core/core/decorators/kos-state-machine.d.ts.map +1 -1
- package/core/core/decorators/kos-topic-handler-flow-control.d.ts +11 -3
- package/core/core/decorators/kos-topic-handler-flow-control.d.ts.map +1 -1
- package/core/core/decorators/kos-trouble-aware.d.ts +9 -43
- package/core/core/decorators/kos-trouble-aware.d.ts.map +1 -1
- package/core/core/decorators/kos-view-model.d.ts +20 -100
- package/core/core/decorators/kos-view-model.d.ts.map +1 -1
- package/core/core/decorators/kosModel.d.ts.map +1 -1
- package/core/core/decorators/kosTopicHandler.d.ts +28 -89
- package/core/core/decorators/kosTopicHandler.d.ts.map +1 -1
- package/core/core/decorators/propKeys.d.ts +1 -0
- package/core/core/decorators/propKeys.d.ts.map +1 -1
- package/core/core/indexing/index.d.ts +2 -4
- package/core/core/indexing/index.d.ts.map +1 -1
- package/core/core/indexing/kos-container-index-aware.d.ts +17 -48
- package/core/core/indexing/kos-container-index-aware.d.ts.map +1 -1
- package/core/core/indexing/kos-index-aware.d.ts +11 -37
- package/core/core/indexing/kos-index-aware.d.ts.map +1 -1
- package/core/core/kos-container-index.d.ts +11 -0
- package/core/core/kos-container-index.d.ts.map +1 -1
- package/core/core/kos-container-model.d.ts +11 -32
- package/core/core/kos-container-model.d.ts.map +1 -1
- package/core/core/kos-data-container.d.ts +6 -6
- package/core/core/kos-data-container.d.ts.map +1 -1
- package/core/core/kosCore.d.ts +7 -4
- package/core/core/kosCore.d.ts.map +1 -1
- package/core/core/kosModel.d.ts +16 -8
- package/core/core/kosModel.d.ts.map +1 -1
- package/core/core/kosModelManager.d.ts +2 -3
- package/core/core/kosModelManager.d.ts.map +1 -1
- package/core/core/lifecycle/constants.d.ts +6 -2
- package/core/core/lifecycle/constants.d.ts.map +1 -1
- package/core/core/lifecycle/kosCoreLifecycle.d.ts +11 -1
- package/core/core/lifecycle/kosCoreLifecycle.d.ts.map +1 -1
- package/core/core/lifecycle/kosModelLifecycle.d.ts +6 -0
- package/core/core/lifecycle/kosModelLifecycle.d.ts.map +1 -1
- package/core/core/lifecycle/model-machine.d.ts +6 -0
- package/core/core/lifecycle/model-machine.d.ts.map +1 -1
- package/core/core/model/kos-fsm-manager.d.ts +6 -0
- package/core/core/model/kos-fsm-manager.d.ts.map +1 -1
- package/core/core/model/kos-offline-queue.d.ts +1 -1
- package/core/core/model/kos-subscription-manager.d.ts.map +1 -1
- package/core/core/model/service-response-store.d.ts +2 -15
- package/core/core/model/service-response-store.d.ts.map +1 -1
- package/core/core/reconnect/reconnect-fixture.d.ts +17 -0
- package/core/core/reconnect/reconnect-fixture.d.ts.map +1 -0
- package/core/core/registration/model-registration.d.ts.map +1 -1
- package/core/core/services/app-startup-service.d.ts +5 -13
- package/core/core/services/app-startup-service.d.ts.map +1 -1
- package/core/core/services/intent-service.d.ts +3 -12
- package/core/core/services/intent-service.d.ts.map +1 -1
- package/core/core/transport/mock/mock-frames.d.ts +3 -3
- package/core/core/transport/transport.d.ts +1 -1
- package/core/core/transport/transport.d.ts.map +1 -1
- package/core/core/transport/webSocketTransport.d.ts +10 -0
- package/core/core/transport/webSocketTransport.d.ts.map +1 -1
- package/core/types/model.d.ts +4 -8
- package/core/types/model.d.ts.map +1 -1
- package/core/types/service-response-store.d.ts +3 -11
- package/core/types/service-response-store.d.ts.map +1 -1
- package/core/types/utils/kos-fetch.d.ts +25 -37
- package/core/types/utils/kos-fetch.d.ts.map +1 -1
- package/core/util/abortable-when.d.ts +5 -6
- package/core/util/abortable-when.d.ts.map +1 -1
- package/core/util/ancestor-path-visitor.d.ts +14 -20
- package/core/util/ancestor-path-visitor.d.ts.map +1 -1
- package/core/util/container-utils.d.ts +26 -159
- package/core/util/container-utils.d.ts.map +1 -1
- package/core/util/date-utils.d.ts +9 -58
- package/core/util/date-utils.d.ts.map +1 -1
- package/core/util/debounce.d.ts +1 -8
- package/core/util/debounce.d.ts.map +1 -1
- package/core/util/kos-fetch.d.ts +1 -1
- package/core/util/kos-fetch.d.ts.map +1 -1
- package/core/util/kos-model-utils.d.ts +10 -11
- package/core/util/kos-model-utils.d.ts.map +1 -1
- package/core/util/model-attribute-utils.d.ts +5 -22
- package/core/util/model-attribute-utils.d.ts.map +1 -1
- package/core/util/model-type-guards.d.ts.map +1 -1
- package/core/util/promise-utils.d.ts +1 -26
- package/core/util/promise-utils.d.ts.map +1 -1
- package/core/util/service-factory.d.ts +5 -23
- package/core/util/service-factory.d.ts.map +1 -1
- package/core/util/service-request-error.d.ts +3 -5
- package/core/util/service-request-error.d.ts.map +1 -1
- package/core/util/service-response.d.ts +12 -67
- package/core/util/service-response.d.ts.map +1 -1
- package/core/util/transport-not-ready-error.d.ts +11 -13
- package/core/util/transport-not-ready-error.d.ts.map +1 -1
- package/core/util/when-ready.d.ts +1 -8
- package/core/util/when-ready.d.ts.map +1 -1
- package/index.cjs +692 -11760
- package/index.cjs.map +1 -1
- package/index.js +774 -11846
- package/index.js.map +1 -1
- package/models/decorators/future-service.d.ts +7 -7
- package/models/models/browser-router/browser-router-model.d.ts +10 -39
- package/models/models/browser-router/browser-router-model.d.ts.map +1 -1
- package/models/models/browser-router/browser-router-registration.d.ts +5 -77
- package/models/models/browser-router/browser-router-registration.d.ts.map +1 -1
- package/models/models/browser-router/types/index.d.ts +2 -16
- package/models/models/canvas-dispatcher/canvas-dispatcher-registration.d.ts +5 -77
- package/models/models/canvas-dispatcher/canvas-dispatcher-registration.d.ts.map +1 -1
- package/models/models/canvas-renderer/canvas-renderer-registration.d.ts +5 -75
- package/models/models/canvas-renderer/canvas-renderer-registration.d.ts.map +1 -1
- package/models/models/config-bean/config-bean-model-builder.d.ts +4 -11
- package/models/models/config-bean/config-bean-model-builder.d.ts.map +1 -1
- package/models/models/config-bean/config-bean-model.d.ts +23 -66
- package/models/models/config-bean/config-bean-model.d.ts.map +1 -1
- package/models/models/config-bean-prop/config-bean-prop-model.d.ts +15 -62
- package/models/models/config-bean-prop/config-bean-prop-model.d.ts.map +1 -1
- package/models/models/config-bean-prop/types/index.d.ts +34 -215
- package/models/models/device/device-model.d.ts +20 -199
- package/models/models/device/device-model.d.ts.map +1 -1
- package/models/models/device/device-registration.d.ts +7 -87
- package/models/models/device/device-registration.d.ts.map +1 -1
- package/models/models/device/types/index.d.ts +5 -34
- package/models/models/future/future-aware.d.ts +7 -71
- package/models/models/future/future-aware.d.ts.map +1 -1
- package/models/models/future/future-model-builder.d.ts +2 -2
- package/models/models/future/future-model.d.ts +3 -23
- package/models/models/future/future-model.d.ts.map +1 -1
- package/models/models/future/future-types.d.ts +28 -145
- package/models/models/future/future-types.d.ts.map +1 -1
- package/models/models/gpio-chip/gpio-chip-builders.d.ts +14 -0
- package/models/models/gpio-chip/gpio-chip-builders.d.ts.map +1 -0
- package/models/models/gpio-chip/gpio-chip-container-model.d.ts +2 -1
- package/models/models/gpio-chip/gpio-chip-container-model.d.ts.map +1 -1
- package/models/models/key-value/key-value-model.d.ts +12 -72
- package/models/models/key-value/key-value-model.d.ts.map +1 -1
- package/models/models/key-value/key-value-registration.d.ts +5 -77
- package/models/models/key-value/key-value-registration.d.ts.map +1 -1
- package/models/models/key-value/services/key-value-services.d.ts +13 -72
- package/models/models/key-value/services/key-value-services.d.ts.map +1 -1
- package/models/models/key-value/types/index.d.ts +3 -46
- package/models/models/kos-expression-evaluator/expression-parse-cache.d.ts +29 -0
- package/models/models/kos-expression-evaluator/expression-parse-cache.d.ts.map +1 -0
- package/models/models/kos-expression-evaluator/index.d.ts +1 -0
- package/models/models/kos-expression-evaluator/index.d.ts.map +1 -1
- package/models/models/kos-expression-evaluator/kos-expression-evaluator-model.d.ts +73 -105
- package/models/models/kos-expression-evaluator/kos-expression-evaluator-model.d.ts.map +1 -1
- package/models/models/kos-expression-evaluator/services/kos-expression-evaluator-services.d.ts +2 -12
- package/models/models/kos-expression-evaluator/services/kos-expression-evaluator-services.d.ts.map +1 -1
- package/models/models/kos-log-manager/kos-log-manager-model.d.ts +7 -46
- package/models/models/kos-log-manager/kos-log-manager-model.d.ts.map +1 -1
- package/models/models/kos-log-manager/kos-log-manager-registration.d.ts +5 -80
- package/models/models/kos-log-manager/kos-log-manager-registration.d.ts.map +1 -1
- package/models/models/kos-log-manager/types/index.d.ts +13 -156
- package/models/models/kos-time/kos-time-model.d.ts +8 -39
- package/models/models/kos-time/kos-time-model.d.ts.map +1 -1
- package/models/models/kos-time/kos-time-registration.d.ts +6 -73
- package/models/models/kos-time/kos-time-registration.d.ts.map +1 -1
- package/models/models/kos-time/types/index.d.ts +3 -58
- package/models/models/log-block/log-block-container-model.d.ts +2 -118
- package/models/models/log-block/log-block-container-model.d.ts.map +1 -1
- package/models/models/log-block/log-block-container-registration.d.ts +5 -75
- package/models/models/log-block/log-block-container-registration.d.ts.map +1 -1
- package/models/models/log-block/log-block-model.d.ts +5 -168
- package/models/models/log-block/log-block-model.d.ts.map +1 -1
- package/models/models/log-block/log-block-registration.d.ts +5 -75
- package/models/models/log-block/log-block-registration.d.ts.map +1 -1
- package/models/models/log-block/types/index.d.ts +14 -81
- package/models/models/log-stream/log-stream-container-model.d.ts +8 -35
- package/models/models/log-stream/log-stream-container-model.d.ts.map +1 -1
- package/models/models/log-stream/log-stream-container-registration.d.ts +5 -75
- package/models/models/log-stream/log-stream-container-registration.d.ts.map +1 -1
- package/models/models/log-stream/log-stream-model.d.ts +8 -29
- package/models/models/log-stream/log-stream-model.d.ts.map +1 -1
- package/models/models/log-stream/log-stream-registration.d.ts +5 -75
- package/models/models/log-stream/log-stream-registration.d.ts.map +1 -1
- package/models/models/log-stream/types/index.d.ts +5 -60
- package/models/models/network-interface/network-interface-container-model.d.ts +6 -35
- package/models/models/network-interface/network-interface-container-model.d.ts.map +1 -1
- package/models/models/network-interface/network-interface-container-registration.d.ts +5 -73
- package/models/models/network-interface/network-interface-container-registration.d.ts.map +1 -1
- package/models/models/network-interface/network-interface-model.d.ts +5 -43
- package/models/models/network-interface/network-interface-model.d.ts.map +1 -1
- package/models/models/network-interface/network-interface-registration.d.ts +5 -73
- package/models/models/network-interface/network-interface-registration.d.ts.map +1 -1
- package/models/models/network-interface/types/index.d.ts +2 -16
- package/models/models/ota/ota-model.d.ts +11 -39
- package/models/models/ota/ota-model.d.ts.map +1 -1
- package/models/models/ota/ota-registration.d.ts +5 -77
- package/models/models/ota/ota-registration.d.ts.map +1 -1
- package/models/models/ota/types/index.d.ts +2 -141
- package/models/models/region-info/types/index.d.ts +19 -99
- package/models/models/region-info/types/index.d.ts.map +1 -1
- package/models/models/software-info/services/software-info-services.d.ts +2 -14
- package/models/models/software-info/services/software-info-services.d.ts.map +1 -1
- package/models/models/software-info/software-info-model.d.ts +3 -39
- package/models/models/software-info/software-info-model.d.ts.map +1 -1
- package/models/models/software-info/software-info-registration.d.ts +6 -73
- package/models/models/software-info/software-info-registration.d.ts.map +1 -1
- package/models/models/software-info/types/index.d.ts +6 -20
- package/models/models/state-bean/state-bean-model.d.ts +10 -41
- package/models/models/state-bean/state-bean-model.d.ts.map +1 -1
- package/models/models/state-bean/state-bean-registration.d.ts +6 -73
- package/models/models/state-bean/state-bean-registration.d.ts.map +1 -1
- package/models/models/state-bean/types/index.d.ts +4 -84
- package/models/models/state-prop/state-prop-model.d.ts +6 -40
- package/models/models/state-prop/state-prop-model.d.ts.map +1 -1
- package/models/models/state-prop/state-prop-registration.d.ts +6 -73
- package/models/models/state-prop/state-prop-registration.d.ts.map +1 -1
- package/models/models/state-prop/types/index.d.ts +5 -37
- package/models/models/storage-device/storage-device-container-model.d.ts +7 -273
- package/models/models/storage-device/storage-device-container-model.d.ts.map +1 -1
- package/models/models/storage-device/storage-device-container-registration.d.ts +5 -75
- package/models/models/storage-device/storage-device-container-registration.d.ts.map +1 -1
- package/models/models/storage-device/storage-device-model.d.ts +3 -49
- package/models/models/storage-device/storage-device-model.d.ts.map +1 -1
- package/models/models/storage-device/storage-device-registration.d.ts +5 -75
- package/models/models/storage-device/storage-device-registration.d.ts.map +1 -1
- package/models/models/storage-device/types/index.d.ts +13 -82
- package/models/models/studio-properties/studio-properties-model.d.ts +13 -36
- package/models/models/studio-properties/studio-properties-model.d.ts.map +1 -1
- package/models/models/studio-properties/studio-properties-registration.d.ts +5 -75
- package/models/models/studio-properties/studio-properties-registration.d.ts.map +1 -1
- package/models/models/studio-properties/types/index.d.ts +2 -24
- package/models/models/translation/descriptor-merge.d.ts +13 -17
- package/models/models/translation/descriptor-merge.d.ts.map +1 -1
- package/models/models/translation/services/translation-services.d.ts +19 -77
- package/models/models/translation/services/translation-services.d.ts.map +1 -1
- package/models/models/translation/test-harness.d.ts +6 -8
- package/models/models/translation/test-harness.d.ts.map +1 -1
- package/models/models/translation/translation-container-model.d.ts +7 -59
- package/models/models/translation/translation-container-model.d.ts.map +1 -1
- package/models/models/translation/translation-container-registration.d.ts +6 -73
- package/models/models/translation/translation-container-registration.d.ts.map +1 -1
- package/models/models/translation/translation-model.d.ts +17 -50
- package/models/models/translation/translation-model.d.ts.map +1 -1
- package/models/models/translation/translation-registration.d.ts +6 -73
- package/models/models/translation/translation-registration.d.ts.map +1 -1
- package/models/models/translation/types/index.d.ts +51 -276
- package/models/models/trouble/trouble-registration.d.ts +6 -73
- package/models/models/trouble/trouble-registration.d.ts.map +1 -1
- package/models/models/trouble/types/index.d.ts +17 -188
- package/models/models/trouble/utils/is-trouble-aware.d.ts +4 -85
- package/models/models/trouble/utils/is-trouble-aware.d.ts.map +1 -1
- package/models/models/trouble-container/trouble-builders.d.ts +11 -0
- package/models/models/trouble-container/trouble-builders.d.ts.map +1 -0
- package/models/models/trouble-container/trouble-container-model.d.ts +2 -1
- package/models/models/trouble-container/trouble-container-model.d.ts.map +1 -1
- package/models/models/usb-update/usb-update-container-registration.d.ts +5 -75
- package/models/models/usb-update/usb-update-container-registration.d.ts.map +1 -1
- package/models/models/usb-update/usb-update-registration.d.ts +5 -75
- package/models/models/usb-update/usb-update-registration.d.ts.map +1 -1
- package/models/types/cancellable-promise.d.ts +6 -9
- package/models/types/cancellable-promise.d.ts.map +1 -1
- package/models/utils/await-future-call.d.ts +9 -21
- package/models/utils/await-future-call.d.ts.map +1 -1
- package/models/utils/cancellable-future-call.d.ts +8 -19
- package/models/utils/cancellable-future-call.d.ts.map +1 -1
- package/models/utils/cancellable-service.d.ts +14 -23
- package/models/utils/cancellable-service.d.ts.map +1 -1
- package/models/utils/conversion-utils.d.ts +8 -48
- package/models/utils/conversion-utils.d.ts.map +1 -1
- package/models/utils/persistence-store.d.ts +1 -1
- package/models/utils/service.d.ts +14 -48
- package/models/utils/service.d.ts.map +1 -1
- package/models/utils/services/kos/daily/service.d.ts +4 -4
- package/models/utils/services/vfs/daily/service.d.ts +4 -4
- package/models/utils/timer-manager.d.ts.map +1 -1
- package/package.json +2 -2
- package/{index-D52vEGXT.cjs → software-info-registration-Le3V0a6v.cjs} +11906 -416
- package/software-info-registration-Le3V0a6v.cjs.map +1 -0
- package/{index-Csq0zQtb.js → software-info-registration-kSGacOka.js} +12116 -625
- package/software-info-registration-kSGacOka.js.map +1 -0
- package/testing/index.d.ts +32 -34
- package/testing/index.d.ts.map +1 -1
- package/testing.cjs +2 -1
- package/testing.cjs.map +1 -1
- package/testing.js +2 -1
- package/testing.js.map +1 -1
- package/ui/components/connection-dev-button/connection-dev-button-styles.d.ts +9 -0
- package/ui/components/connection-dev-button/connection-dev-button-styles.d.ts.map +1 -0
- package/ui/components/connection-dev-button/index.d.ts +36 -0
- package/ui/components/connection-dev-button/index.d.ts.map +1 -0
- package/ui/components/connection-dev-button/use-connection-dev-state.d.ts +29 -0
- package/ui/components/connection-dev-button/use-connection-dev-state.d.ts.map +1 -0
- package/ui/components/index.d.ts +1 -0
- package/ui/components/index.d.ts.map +1 -1
- package/ui/features/canvas/hooks/use-image-renderer.d.ts +5 -4
- package/ui/features/canvas/hooks/use-image-renderer.d.ts.map +1 -1
- package/ui/hooks/use-function-warmup.d.ts +4 -14
- package/ui/hooks/use-function-warmup.d.ts.map +1 -1
- package/ui/hooks/use-kos-date-formats.d.ts +15 -29
- package/ui/hooks/use-kos-date-formats.d.ts.map +1 -1
- package/ui/hooks/use-kos-region-timezones.d.ts +4 -55
- package/ui/hooks/use-kos-region-timezones.d.ts.map +1 -1
- package/ui/hooks/use-kos-regions.d.ts +11 -23
- package/ui/hooks/use-kos-regions.d.ts.map +1 -1
- package/ui/hooks/use-kos-time-formats.d.ts +16 -31
- package/ui/hooks/use-kos-time-formats.d.ts.map +1 -1
- package/ui/hooks/use-kos-unit-systems.d.ts +13 -27
- package/ui/hooks/use-kos-unit-systems.d.ts.map +1 -1
- package/ui/hooks/view-model/use-view-model.d.ts +6 -31
- package/ui/hooks/view-model/use-view-model.d.ts.map +1 -1
- package/ui/policies/reload-on-disconnect-policy.d.ts +5 -6
- package/ui/policies/reload-on-disconnect-policy.d.ts.map +1 -1
- package/index-Csq0zQtb.js.map +0 -1
- package/index-D52vEGXT.cjs.map +0 -1
|
@@ -19,8 +19,8 @@ export interface KosViewModelOptions {
|
|
|
19
19
|
devToolsEnabled?: boolean;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
|
-
* Interface for ViewModels that support cleanup.
|
|
23
|
-
*
|
|
22
|
+
* Interface for ViewModels that support cleanup. `useViewModel` calls `dispose()` when
|
|
23
|
+
* the ViewModel is replaced or the component unmounts.
|
|
24
24
|
*
|
|
25
25
|
* @kosService core.view-model
|
|
26
26
|
* @kosApiLevel 20
|
|
@@ -29,32 +29,9 @@ export interface IKosViewModelDisposable {
|
|
|
29
29
|
dispose(): void | Promise<void>;
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
|
-
* Interface for ViewModels that require async initialization
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* When a ViewModel implements this interface, the useViewModel hook will:
|
|
36
|
-
* - Call ready() after construction
|
|
37
|
-
* - Track ready state and any errors
|
|
38
|
-
* - Return { viewModel, ready, error } instead of just the viewModel
|
|
39
|
-
*
|
|
40
|
-
* @example
|
|
41
|
-
* ```typescript
|
|
42
|
-
* @kosViewModel({ typeId: 'order-summary' })
|
|
43
|
-
* class OrderSummaryViewModel implements IKosViewModelReady {
|
|
44
|
-
* constructor(
|
|
45
|
-
* private order: IOrderModel,
|
|
46
|
-
* private inventory: IInventoryModel
|
|
47
|
-
* ) {}
|
|
48
|
-
*
|
|
49
|
-
* async ready(): Promise<void> {
|
|
50
|
-
* // Await model readiness before ViewModel is considered ready
|
|
51
|
-
* await Promise.all([
|
|
52
|
-
* this.order.whenReady?.(),
|
|
53
|
-
* this.inventory.whenReady?.()
|
|
54
|
-
* ]);
|
|
55
|
-
* }
|
|
56
|
-
* }
|
|
57
|
-
* ```
|
|
32
|
+
* Interface for ViewModels that require async initialization, such as waiting for the
|
|
33
|
+
* models they wrap to be ready. `useViewModel` calls `ready()` after construction and
|
|
34
|
+
* reports its progress through the `ready` and `error` fields of its result.
|
|
58
35
|
*
|
|
59
36
|
* @kosService core.view-model
|
|
60
37
|
* @kosApiLevel 20
|
|
@@ -67,23 +44,8 @@ export interface IKosViewModelReady {
|
|
|
67
44
|
*/
|
|
68
45
|
export declare function hasReadyHook(obj: unknown): obj is IKosViewModelReady;
|
|
69
46
|
/**
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
* @example
|
|
74
|
-
* ```typescript
|
|
75
|
-
* interface MyViewModel extends KosLoggerAware {}
|
|
76
|
-
*
|
|
77
|
-
* @kosViewModel({ typeId: 'my-view-model' })
|
|
78
|
-
* @kosLoggerAware()
|
|
79
|
-
* export class MyViewModel {
|
|
80
|
-
* constructor(private readonly model: IMyModel) {}
|
|
81
|
-
*
|
|
82
|
-
* doSomething() {
|
|
83
|
-
* this.logger.info('Doing something');
|
|
84
|
-
* }
|
|
85
|
-
* }
|
|
86
|
-
* ```
|
|
47
|
+
* Members injected by @kosLoggerAware into a ViewModel. Declare an interface with the
|
|
48
|
+
* same name as the class that extends this type (TypeScript interface merging).
|
|
87
49
|
*
|
|
88
50
|
* @kosService core.view-model
|
|
89
51
|
* @kosApiLevel 20
|
|
@@ -96,75 +58,33 @@ export interface KosViewModelLoggerAware {
|
|
|
96
58
|
*/
|
|
97
59
|
export declare function isDisposable(obj: unknown): obj is IKosViewModelDisposable;
|
|
98
60
|
/**
|
|
99
|
-
*
|
|
100
|
-
*
|
|
61
|
+
* Class decorator for a ViewModel: a plain class made into a reactive model without the
|
|
62
|
+
* KOS model lifecycle.
|
|
101
63
|
*
|
|
102
|
-
* Use
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
64
|
+
* Use it for state derived from one or more KOS models for a component. Dependencies
|
|
65
|
+
* are passed to the constructor, instances are created with `new` (usually inside
|
|
66
|
+
* `useViewModel`), and there are no lifecycle phases or dependency resolution. A
|
|
67
|
+
* ViewModel may also use @kosLoggerAware, @kosModelEffect and @kosStateMachine; its
|
|
68
|
+
* state machine initializes at construction.
|
|
107
69
|
*
|
|
108
70
|
* @param options Configuration options for the ViewModel
|
|
109
71
|
* @returns A class decorator
|
|
110
72
|
*
|
|
111
73
|
* @example
|
|
112
74
|
* ```typescript
|
|
113
|
-
* // Basic usage
|
|
114
|
-
* @kosViewModel({ typeId: 'counter' })
|
|
115
|
-
* export class CounterViewModel {
|
|
116
|
-
* count = 0;
|
|
117
|
-
*
|
|
118
|
-
* increment() {
|
|
119
|
-
* this.count++;
|
|
120
|
-
* }
|
|
121
|
-
* }
|
|
122
|
-
*
|
|
123
|
-
* // With logger support
|
|
124
|
-
* interface OrderSummaryViewModel extends KosViewModelLoggerAware {}
|
|
125
|
-
*
|
|
126
75
|
* @kosViewModel({ typeId: 'order-summary' })
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
* constructor(
|
|
130
|
-
* private readonly order: IOrderModel,
|
|
131
|
-
* private readonly inventory: IInventoryModel
|
|
132
|
-
* ) {
|
|
133
|
-
* this.logger.info('ViewModel created');
|
|
134
|
-
* }
|
|
76
|
+
* export class OrderSummaryViewModel {
|
|
77
|
+
* constructor(private readonly order: IOrderModel) {}
|
|
135
78
|
*
|
|
136
79
|
* get total(): number {
|
|
137
80
|
* return this.order.items.reduce((sum, i) => sum + i.price, 0);
|
|
138
81
|
* }
|
|
139
|
-
*
|
|
140
|
-
* get hasStockIssues(): boolean {
|
|
141
|
-
* return this.order.items.some(item =>
|
|
142
|
-
* this.inventory.getStock(item.productId) < item.quantity
|
|
143
|
-
* );
|
|
144
|
-
* }
|
|
145
|
-
*
|
|
146
|
-
* dispose(): void {
|
|
147
|
-
* this.logger.info('ViewModel disposed');
|
|
148
|
-
* }
|
|
149
82
|
* }
|
|
150
83
|
*
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
* const vm = useViewModel(
|
|
157
|
-
* () => new OrderSummaryViewModel(order!, inventory!),
|
|
158
|
-
* [order, inventory]
|
|
159
|
-
* );
|
|
160
|
-
*
|
|
161
|
-
* return (
|
|
162
|
-
* <div>
|
|
163
|
-
* <p>Total: ${vm.total}</p>
|
|
164
|
-
* {vm.hasStockIssues && <Warning>Some items may be unavailable</Warning>}
|
|
165
|
-
* </div>
|
|
166
|
-
* );
|
|
167
|
-
* }
|
|
84
|
+
* const OrderSummary = kosComponent(({ order }: Props) => {
|
|
85
|
+
* const { viewModel } = useViewModel(() => new OrderSummaryViewModel(order), [order]);
|
|
86
|
+
* return <p>Total: {viewModel.total}</p>;
|
|
87
|
+
* });
|
|
168
88
|
* ```
|
|
169
89
|
*
|
|
170
90
|
* @category KOS ViewModel Decorator
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kos-view-model.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/decorators/kos-view-model.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAYpD;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,uBAAuB;IACtC,OAAO,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACjC;AAED
|
|
1
|
+
{"version":3,"file":"kos-view-model.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/decorators/kos-view-model.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAYpD;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,uBAAuB;IACtC,OAAO,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACjC;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB;IACjC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,kBAAkB,CAOpE;AAED;;;;;;GAMG;AACH,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,gBAAgB,CAAC;CAC1B;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,uBAAuB,CAOzE;AAuMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,YAAY,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,cAAc,CAgB1E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kosModel.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/decorators/kosModel.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"kosModel.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/decorators/kosModel.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AA0pB5C,UAAU,cAAc;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CACtB,CAAC,SAAS,aAAa,EACvB,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACtC,MAAM,EAAE,MAAM,GAAG,cAAc,GAAG,cAAc,CA0DjD"}
|
|
@@ -89,9 +89,9 @@ export interface IKosTopicHandlerParams<Response = any, Model extends IKosDataMo
|
|
|
89
89
|
*/
|
|
90
90
|
explicitDestination?: boolean;
|
|
91
91
|
/**
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
92
|
+
* Delivers events only after a period of inactivity. By default the handler receives
|
|
93
|
+
* an array of every payload received during the delay; with `discardIntermediate`
|
|
94
|
+
* it receives only the last payload.
|
|
95
95
|
* @kosApiLevel 11
|
|
96
96
|
*/
|
|
97
97
|
debounce?: number | {
|
|
@@ -100,9 +100,9 @@ export interface IKosTopicHandlerParams<Response = any, Model extends IKosDataMo
|
|
|
100
100
|
discardIntermediate?: boolean;
|
|
101
101
|
};
|
|
102
102
|
/**
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
103
|
+
* Limits delivery to once per interval. By default the handler receives an array of
|
|
104
|
+
* every payload received in the interval; with `discardIntermediate` it receives only
|
|
105
|
+
* the first payload in each window.
|
|
106
106
|
* @kosApiLevel 11
|
|
107
107
|
*/
|
|
108
108
|
throttle?: number | {
|
|
@@ -111,7 +111,8 @@ export interface IKosTopicHandlerParams<Response = any, Model extends IKosDataMo
|
|
|
111
111
|
discardIntermediate?: boolean;
|
|
112
112
|
};
|
|
113
113
|
/**
|
|
114
|
-
*
|
|
114
|
+
* Holds events until the time window elapses or `maxSize` is reached, then calls the
|
|
115
|
+
* handler once per buffered event.
|
|
115
116
|
* @kosApiLevel 11
|
|
116
117
|
*/
|
|
117
118
|
buffer?: {
|
|
@@ -132,9 +133,8 @@ export interface IKosTopicHandlerParams<Response = any, Model extends IKosDataMo
|
|
|
132
133
|
*/
|
|
133
134
|
once?: boolean;
|
|
134
135
|
/**
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
* You can optionally specify a name for the captured segment.
|
|
136
|
+
* Name for the segment captured by a trailing `/*` in the topic (default `"path"`).
|
|
137
|
+
* The handler's second argument carries it as `wildcardCapture[wildcardName]`.
|
|
138
138
|
*
|
|
139
139
|
* @example
|
|
140
140
|
* ```typescript
|
|
@@ -144,58 +144,35 @@ export interface IKosTopicHandlerParams<Response = any, Model extends IKosDataMo
|
|
|
144
144
|
* wildcardName: "configPath"
|
|
145
145
|
* })
|
|
146
146
|
* handleConfigUpdate(payload: ConfigData, raw: ApiCallbackWithWildcard<any>) {
|
|
147
|
-
* // raw.wildcardCapture
|
|
147
|
+
* // raw.wildcardCapture?.configPath is everything after "/config/system/"
|
|
148
148
|
* }
|
|
149
149
|
* ```
|
|
150
150
|
* @kosApiLevel 12
|
|
151
151
|
*/
|
|
152
152
|
wildcardName?: string;
|
|
153
153
|
/**
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
* filtering and rate limiting.
|
|
154
|
+
* Flow control applied to the event stream before the handler runs: batching,
|
|
155
|
+
* transforms, stateful filtering, rate limiting and retry.
|
|
157
156
|
*
|
|
158
|
-
* @example
|
|
159
|
-
* ```typescript
|
|
160
|
-
* @kosTopicHandler({
|
|
161
|
-
* topic: 'sensor.data',
|
|
162
|
-
* websocket: true,
|
|
163
|
-
* flow: {
|
|
164
|
-
* batch: { size: 50, window: 1000 },
|
|
165
|
-
* transform: (events) => aggregateEvents(events),
|
|
166
|
-
* }
|
|
167
|
-
* })
|
|
168
|
-
* handleProcessedEvents(aggregatedData) {
|
|
169
|
-
* // Receives transformed, batched data
|
|
170
|
-
* }
|
|
171
|
-
* ```
|
|
172
157
|
* @kosApiLevel 12
|
|
173
158
|
*/
|
|
174
159
|
flow?: FlowControlOptions<Response, TransformedResponse>;
|
|
175
160
|
/**
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
*
|
|
179
|
-
* temporal comparison with the baseline request/response timing.
|
|
161
|
+
* Makes the handler wait for a baseline service request to complete before it
|
|
162
|
+
* processes events. Events received earlier are queued and replayed according to
|
|
163
|
+
* `replayStrategy`, which compares them with the baseline request timing.
|
|
180
164
|
*
|
|
181
165
|
* @example
|
|
182
166
|
* ```typescript
|
|
183
167
|
* @kosTopicHandler({
|
|
184
168
|
* topic: TOPIC_INGREDIENT_UPDATE,
|
|
185
169
|
* websocket: true,
|
|
186
|
-
* lifecycle: DependencyLifecycle.READY,
|
|
187
170
|
* requiresBaseline: {
|
|
188
171
|
* path: PATH_INGREDIENTS,
|
|
189
|
-
*
|
|
190
|
-
* replayStrategy: 'after-request'
|
|
172
|
+
* replayStrategy: ReplayStrategy.AFTER_REQUEST
|
|
191
173
|
* }
|
|
192
174
|
* })
|
|
193
|
-
* handleIngredientUpdate(payload: IngredientUpdatePayload) {
|
|
194
|
-
* // Framework guarantees:
|
|
195
|
-
* // 1. Baseline loaded before this handler executes
|
|
196
|
-
* // 2. Queued events replayed with temporal filtering
|
|
197
|
-
* // 3. Only events newer than baseline are processed
|
|
198
|
-
* }
|
|
175
|
+
* handleIngredientUpdate(payload: IngredientUpdatePayload) {}
|
|
199
176
|
* ```
|
|
200
177
|
* @kosApiLevel 15
|
|
201
178
|
*/
|
|
@@ -204,61 +181,23 @@ export interface IKosTopicHandlerParams<Response = any, Model extends IKosDataMo
|
|
|
204
181
|
/**
|
|
205
182
|
* Decorator for defining a Kos topic handler function within a Kos Data Model class.
|
|
206
183
|
*
|
|
184
|
+
* The handler is called with the (transformed) payload and the raw message. Topics may
|
|
185
|
+
* include property keys from `createPropKey` to resolve per model instance, and a
|
|
186
|
+
* trailing `/*` to match a subtree (see `wildcardName`). When more than one of
|
|
187
|
+
* `debounce`, `throttle`, `buffer` and `once` is set, only the first in that order
|
|
188
|
+
* applies.
|
|
189
|
+
*
|
|
207
190
|
* @param params - An object containing configuration parameters for the topic handler.
|
|
208
191
|
* @returns A decorator function.
|
|
209
192
|
*
|
|
210
|
-
* @example
|
|
193
|
+
* @example
|
|
211
194
|
* ```typescript
|
|
212
195
|
* @kosTopicHandler({
|
|
213
|
-
* topic:
|
|
214
|
-
* websocket: true
|
|
215
|
-
* })
|
|
216
|
-
* handleTemperature(payload: TemperatureData) { }
|
|
217
|
-
* ```
|
|
218
|
-
*
|
|
219
|
-
* @example Debounced handling:
|
|
220
|
-
* ```typescript
|
|
221
|
-
* @kosTopicHandler({
|
|
222
|
-
* topic: 'rapid/updates',
|
|
223
|
-
* websocket: true,
|
|
224
|
-
* debounce: 1000 // Wait 1 second after last event
|
|
225
|
-
* })
|
|
226
|
-
* handleRapidUpdates(payload: UpdateData) { }
|
|
227
|
-
* ```
|
|
228
|
-
*
|
|
229
|
-
* @example Buffered batch processing:
|
|
230
|
-
* ```typescript
|
|
231
|
-
* @kosTopicHandler({
|
|
232
|
-
* topic: 'log/entry',
|
|
233
|
-
* websocket: true,
|
|
234
|
-
* buffer: { time: 5000, maxSize: 100 }
|
|
235
|
-
* })
|
|
236
|
-
* handleLogBatch(entries: LogEntry[]) { }
|
|
237
|
-
* ```
|
|
238
|
-
*
|
|
239
|
-
* @example Trailing wildcard with custom name:
|
|
240
|
-
* ```typescript
|
|
241
|
-
* @kosTopicHandler({
|
|
242
|
-
* topic: '/config/system/*',
|
|
243
|
-
* websocket: true,
|
|
244
|
-
* wildcardName: 'configPath'
|
|
245
|
-
* })
|
|
246
|
-
* handleConfigUpdate(payload: ConfigData, raw: ApiCallbackWithWildcard<any>) {
|
|
247
|
-
* // raw.wildcardCapture.configPath = "network/timeout" (everything after "/config/system/")
|
|
248
|
-
* }
|
|
249
|
-
* ```
|
|
250
|
-
*
|
|
251
|
-
* @example Trailing wildcard with PropKeys:
|
|
252
|
-
* ```typescript
|
|
253
|
-
* const DEVICE_ID = createPropKey<DeviceModel>('deviceId');
|
|
254
|
-
*
|
|
255
|
-
* @kosTopicHandler({
|
|
256
|
-
* topic: `/devices/${DEVICE_ID}/sensors/*`,
|
|
196
|
+
* topic: `/devices/${createPropKey<DeviceModel>("deviceId")}/temperature`,
|
|
257
197
|
* websocket: true,
|
|
258
|
-
* wildcardName: 'sensorPath'
|
|
259
198
|
* })
|
|
260
|
-
*
|
|
261
|
-
*
|
|
199
|
+
* handleTemperature(payload: TemperatureData) {
|
|
200
|
+
* this.temperature = payload.value;
|
|
262
201
|
* }
|
|
263
202
|
* ```
|
|
264
203
|
* @category KOS Model Decorator
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kosTopicHandler.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/decorators/kosTopicHandler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAG3E;;;;;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;QACE,KAAK,EAAE,MAAM,CAAC;QACd,qFAAqF;QACrF,mBAAmB,CAAC,EAAE,OAAO,CAAC;KAC/B,CAAC;IAEN;;;;;OAKG;IACH,QAAQ,CAAC,EACL,MAAM,GACN;QACE,QAAQ,EAAE,MAAM,CAAC;QACjB,gGAAgG;QAChG,mBAAmB,CAAC,EAAE,OAAO,CAAC;KAC/B,CAAC;IAEN
|
|
1
|
+
{"version":3,"file":"kosTopicHandler.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/decorators/kosTopicHandler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAG3E;;;;;GAKG;AACH,MAAM,WAAW,uBAAuB,CAAC,CAAC,GAAG,MAAM,CAAE,SAAQ,WAAW,CAAC,CAAC,CAAC;IACzE;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC1C;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,YAAY,CAAC,EAAE,MAAM,GACpB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAkBxB;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAE7D;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,sBAAsB,CACrC,QAAQ,GAAG,GAAG,EACd,KAAK,SAAS,aAAa,GAAG,GAAG,EACjC,mBAAmB,GAAG,QAAQ;IAE9B;;OAEG;IACH,KAAK,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|
26
26
|
export declare const ViewModelConfig: unique symbol;
|
|
27
27
|
export declare const ReloadAwareSetup: unique symbol;
|
|
28
|
+
export declare const MixinModels: unique symbol;
|
|
28
29
|
//# sourceMappingURL=propKeys.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propKeys.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/decorators/propKeys.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,oBAAoB,eAAiC,CAAC;AACnE,eAAO,MAAM,gBAAgB,eAA6B,CAAC;AAC3D,eAAO,MAAM,aAAa,eAA0B,CAAC;AACrD,eAAO,MAAM,WAAW,eAAwB,CAAC;AACjD,eAAO,MAAM,WAAW,eAAwB,CAAC;AACjD,eAAO,MAAM,SAAS,eAAsB,CAAC;AAC7C,eAAO,MAAM,eAAe,eAA4B,CAAC;AACzD,eAAO,MAAM,cAAc,eAA2B,CAAC;AACvD,eAAO,MAAM,YAAY,eAAyB,CAAC;AACnD,eAAO,MAAM,oBAAoB,eAAiC,CAAC;AACnE,eAAO,MAAM,oBAAoB,eAAiC,CAAC;AACnE,eAAO,MAAM,4BAA4B,eAExC,CAAC;AACF,eAAO,MAAM,aAAa,eAA0B,CAAC;AACrD,eAAO,MAAM,iBAAiB,eAA8B,CAAC;AAC7D,eAAO,MAAM,WAAW,eAAwB,CAAC;AACjD,eAAO,MAAM,mBAAmB,eAAgC,CAAC;AACjE,eAAO,MAAM,iBAAiB,eAA8B,CAAC;AAC7D,eAAO,MAAM,kBAAkB,eAA+B,CAAC;AAC/D,eAAO,MAAM,iBAAiB,eAA8B,CAAC;AAC7D,eAAO,MAAM,mBAAmB,eAAgC,CAAC;AACjE,eAAO,MAAM,eAAe,eAA4B,CAAC;AACzD,eAAO,MAAM,kBAAkB,eAA+B,CAAC;AAC/D,eAAO,MAAM,eAAe,eAA4B,CAAC;AACzD,eAAO,MAAM,gBAAgB,eAA6B,CAAC"}
|
|
1
|
+
{"version":3,"file":"propKeys.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/decorators/propKeys.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,oBAAoB,eAAiC,CAAC;AACnE,eAAO,MAAM,gBAAgB,eAA6B,CAAC;AAC3D,eAAO,MAAM,aAAa,eAA0B,CAAC;AACrD,eAAO,MAAM,WAAW,eAAwB,CAAC;AACjD,eAAO,MAAM,WAAW,eAAwB,CAAC;AACjD,eAAO,MAAM,SAAS,eAAsB,CAAC;AAC7C,eAAO,MAAM,eAAe,eAA4B,CAAC;AACzD,eAAO,MAAM,cAAc,eAA2B,CAAC;AACvD,eAAO,MAAM,YAAY,eAAyB,CAAC;AACnD,eAAO,MAAM,oBAAoB,eAAiC,CAAC;AACnE,eAAO,MAAM,oBAAoB,eAAiC,CAAC;AACnE,eAAO,MAAM,4BAA4B,eAExC,CAAC;AACF,eAAO,MAAM,aAAa,eAA0B,CAAC;AACrD,eAAO,MAAM,iBAAiB,eAA8B,CAAC;AAC7D,eAAO,MAAM,WAAW,eAAwB,CAAC;AACjD,eAAO,MAAM,mBAAmB,eAAgC,CAAC;AACjE,eAAO,MAAM,iBAAiB,eAA8B,CAAC;AAC7D,eAAO,MAAM,kBAAkB,eAA+B,CAAC;AAC/D,eAAO,MAAM,iBAAiB,eAA8B,CAAC;AAC7D,eAAO,MAAM,mBAAmB,eAAgC,CAAC;AACjE,eAAO,MAAM,eAAe,eAA4B,CAAC;AACzD,eAAO,MAAM,kBAAkB,eAA+B,CAAC;AAC/D,eAAO,MAAM,eAAe,eAA4B,CAAC;AACzD,eAAO,MAAM,gBAAgB,eAA6B,CAAC;AAC3D,eAAO,MAAM,WAAW,eAAwB,CAAC"}
|
|
@@ -6,10 +6,8 @@
|
|
|
6
6
|
* - Decorators: `kosIndexAware` (item-level), `kosContainerIndexAware`
|
|
7
7
|
* (container-level).
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* anything to get it — adding an `@kosIndexAware` item to any
|
|
12
|
-
* container is enough.
|
|
9
|
+
* `KosModelContainer` publishes ADDED and REMOVED for any `@kosIndexAware`
|
|
10
|
+
* item it holds.
|
|
13
11
|
*/
|
|
14
12
|
export { KosContainerIndexEvents } from './topics';
|
|
15
13
|
export { INDEX_COLLECTION_KEY, INDEX_RECORD_SYMBOL, isIndexableItem, type IndexableItem, type IndexAddedEvent, type IndexChangedEvent, type IndexPurgeEvent, type IndexRecord, type IndexRecordContribution, type IndexRemovedEvent, type IndexRequestSeedEvent, type IndexSeedEvent, } from './types';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/indexing/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/indexing/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAEnD,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,EACf,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,cAAc,GACpB,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,aAAa,EACb,KAAK,aAAa,EAClB,KAAK,oBAAoB,GAC1B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,sBAAsB,EACtB,KAAK,6BAA6B,GACnC,MAAM,6BAA6B,CAAC"}
|
|
@@ -1,35 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Container-level decorator
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* `itemsProperty` pointing at the array of items the container
|
|
6
|
-
* exposes.
|
|
2
|
+
* Container-level decorator for the kos-ui-sdk container indexing system.
|
|
3
|
+
* Works with `@kosContainerAware` or `@kosChild`-based containers; it needs
|
|
4
|
+
* only an `itemsProperty` naming the array of items the container exposes.
|
|
7
5
|
*
|
|
8
|
-
*
|
|
6
|
+
* - On `init`, writes the declared collection onto the container's
|
|
7
|
+
* `KosContext`, where items resolve it by walking up the parent chain.
|
|
8
|
+
* - On `KosContainerIndexEvents.REQUEST_SEED`, publishes one SEED event with
|
|
9
|
+
* the records of the current items, so consumers can subscribe at any time.
|
|
10
|
+
* - On `unload`, publishes one PURGE per distinct collection in the current
|
|
11
|
+
* items so consumers can drop those records.
|
|
9
12
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* value via `KosContext.get(INDEX_COLLECTION_KEY)`, which
|
|
13
|
-
* auto-walks the parent chain.
|
|
14
|
-
*
|
|
15
|
-
* 2. Registers a `SubscriptionHandlers` entry for
|
|
16
|
-
* `KosContainerIndexEvents.REQUEST_SEED`. When a consumer
|
|
17
|
-
* publishes that topic, the container reads its current items,
|
|
18
|
-
* maps them via `INDEX_RECORD_SYMBOL`, and emits one SEED
|
|
19
|
-
* event. Lets subscribe order stop mattering.
|
|
20
|
-
*
|
|
21
|
-
* 3. Wraps `unload` to emit one PURGE per distinct collection in
|
|
22
|
-
* the current items, so consumers can drop the collection's
|
|
23
|
-
* records at container teardown.
|
|
24
|
-
*
|
|
25
|
-
* Membership detection (ADDED, REMOVED) is owned by
|
|
26
|
-
* `KosModelContainer` itself, not this decorator — the events fire
|
|
27
|
-
* at the moment of mutation, with no diffing or property-watching
|
|
28
|
-
* involved.
|
|
29
|
-
*
|
|
30
|
-
* Modeled on `kos-studio-state-aware`: class decorator, options
|
|
31
|
-
* object, `target.prototype[ModelEffects]` / `[SubscriptionHandlers]`
|
|
32
|
-
* registration pattern.
|
|
13
|
+
* ADDED and REMOVED events come from `KosModelContainer` itself at the moment
|
|
14
|
+
* of mutation.
|
|
33
15
|
*
|
|
34
16
|
* @kosService core.indexing
|
|
35
17
|
* @kosApiLevel 22
|
|
@@ -37,21 +19,15 @@
|
|
|
37
19
|
export interface KosContainerIndexAwareOptions {
|
|
38
20
|
/**
|
|
39
21
|
* Name of the property on the container that exposes its items
|
|
40
|
-
* as an array
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* collection).
|
|
44
|
-
*
|
|
45
|
-
* Used for SEED re-emission and PURGE. Membership add/remove
|
|
46
|
-
* events come from `KosModelContainer` directly and do not
|
|
47
|
-
* depend on this property.
|
|
22
|
+
* as an array, such as the `data` getter from `@kosContainerAware` or a
|
|
23
|
+
* custom getter on a `@kosChild`-managed collection. Used for SEED and
|
|
24
|
+
* PURGE; ADDED and REMOVED do not depend on it.
|
|
48
25
|
*/
|
|
49
26
|
itemsProperty: string;
|
|
50
27
|
/**
|
|
51
28
|
* Collection tag written onto the container's own `KosContext`
|
|
52
|
-
* so child items
|
|
53
|
-
*
|
|
54
|
-
* (heterogeneous containers).
|
|
29
|
+
* so child items inherit it. Optional when items declare their own
|
|
30
|
+
* `collection` through `@kosIndexAware`.
|
|
55
31
|
*/
|
|
56
32
|
collection?: string;
|
|
57
33
|
}
|
|
@@ -59,7 +35,7 @@ export interface KosContainerIndexAwareOptions {
|
|
|
59
35
|
* Class decorator that wires a container model into the kos-ui-sdk
|
|
60
36
|
* indexing system.
|
|
61
37
|
*
|
|
62
|
-
* @example
|
|
38
|
+
* @example
|
|
63
39
|
* ```ts
|
|
64
40
|
* @kosModel("image-container-model")
|
|
65
41
|
* @kosContainerAware<IImageModel>()
|
|
@@ -67,13 +43,6 @@ export interface KosContainerIndexAwareOptions {
|
|
|
67
43
|
* class ImageContainerModelImpl implements IKosDataModel { ... }
|
|
68
44
|
* ```
|
|
69
45
|
*
|
|
70
|
-
* @example Heterogeneous container — items declare their own collection
|
|
71
|
-
* ```ts
|
|
72
|
-
* @kosModel("virtual-machine-container-model")
|
|
73
|
-
* @kosContainerIndexAware({ itemsProperty: "virtualMachines" })
|
|
74
|
-
* class VirtualMachineContainerModelImpl implements IKosDataModel { ... }
|
|
75
|
-
* ```
|
|
76
|
-
*
|
|
77
46
|
* @category KOS Model Decorator
|
|
78
47
|
* @kosService core.indexing
|
|
79
48
|
* @kosApiLevel 22
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kos-container-index-aware.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/indexing/kos-container-index-aware.ts"],"names":[],"mappings":"AACA
|
|
1
|
+
{"version":3,"file":"kos-container-index-aware.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/indexing/kos-container-index-aware.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;GAiBG;AAqBH,MAAM,WAAW,6BAA6B;IAC5C;;;;;OAKG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAMD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,6BAA6B,GACrC,cAAc,CAWhB"}
|
|
@@ -7,12 +7,10 @@ export interface KosIndexAwareOptions {
|
|
|
7
7
|
* - A function called with the instance, returning the tag
|
|
8
8
|
* (heterogeneous case where one container holds items belonging
|
|
9
9
|
* to multiple collections, distinguished by some item property).
|
|
10
|
-
* - Undefined
|
|
11
|
-
* `KosContext
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* onto its own context, so this resolves transparently with no
|
|
15
|
-
* per-item declaration needed.
|
|
10
|
+
* - Undefined: the item resolves its collection from its
|
|
11
|
+
* `KosContext`, walking up the parent chain. Under a
|
|
12
|
+
* `@kosContainerIndexAware` container that declares a collection,
|
|
13
|
+
* this picks up the container's value.
|
|
16
14
|
*/
|
|
17
15
|
collection?: string | ((self: any) => string | undefined);
|
|
18
16
|
/**
|
|
@@ -23,18 +21,9 @@ export interface KosIndexAwareOptions {
|
|
|
23
21
|
fields?: string[];
|
|
24
22
|
}
|
|
25
23
|
/**
|
|
26
|
-
*
|
|
27
|
-
* to
|
|
28
|
-
*
|
|
29
|
-
* ```ts
|
|
30
|
-
* interface MyItemModelImpl extends KosIndexAware {}
|
|
31
|
-
*
|
|
32
|
-
* @kosModel("my-item-model")
|
|
33
|
-
* @kosIndexAware({ collection: "items", fields: ["name"] })
|
|
34
|
-
* class MyItemModelImpl implements IKosDataModel { ... }
|
|
35
|
-
* ```
|
|
36
|
-
*
|
|
37
|
-
* Mirrors the `KosLoggerAware` / `KosContainerAware` pattern.
|
|
24
|
+
* Merge this interface into a `@kosIndexAware` model class
|
|
25
|
+
* (`interface MyItemModelImpl extends KosIndexAware {}`) to type the
|
|
26
|
+
* index record accessor.
|
|
38
27
|
*/
|
|
39
28
|
export interface KosIndexAware {
|
|
40
29
|
readonly [INDEX_RECORD_SYMBOL]: IndexRecordContribution;
|
|
@@ -43,33 +32,18 @@ export interface KosIndexAware {
|
|
|
43
32
|
* Class decorator that registers a model as a publisher of index
|
|
44
33
|
* records.
|
|
45
34
|
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
* `IKosIdentifiable`, `modelTypeId` from `@kosModel`. No author
|
|
49
|
-
* duplication needed.
|
|
35
|
+
* The record always carries the instance's `id` and `modelTypeId`, plus the
|
|
36
|
+
* resolved collection and the declared `fields`.
|
|
50
37
|
*
|
|
51
|
-
* @example
|
|
38
|
+
* @example
|
|
52
39
|
* ```ts
|
|
53
40
|
* interface VirtualMachineModelImpl extends KosIndexAware {}
|
|
54
41
|
*
|
|
55
42
|
* @kosModel("virtual-machine-model")
|
|
56
|
-
* @kosIndexAware({
|
|
57
|
-
* collection: (self) => self.type,
|
|
58
|
-
* fields: ["name", "desc"],
|
|
59
|
-
* })
|
|
43
|
+
* @kosIndexAware({ collection: (self) => self.type, fields: ["name"] })
|
|
60
44
|
* class VirtualMachineModelImpl implements IKosDataModel { ... }
|
|
61
45
|
* ```
|
|
62
46
|
*
|
|
63
|
-
* @example Homogeneous — collection declared on the container instead
|
|
64
|
-
* ```ts
|
|
65
|
-
* @kosModel("image-model")
|
|
66
|
-
* @kosIndexAware({ fields: ["name"] })
|
|
67
|
-
* class ImageModelImpl implements IKosDataModel { ... }
|
|
68
|
-
*
|
|
69
|
-
* @kosContainerIndexAware({ itemsProperty: "images", collection: "images" })
|
|
70
|
-
* class ImageContainerModelImpl ...
|
|
71
|
-
* ```
|
|
72
|
-
*
|
|
73
47
|
* @category KOS Model Decorator
|
|
74
48
|
* @kosService core.indexing
|
|
75
49
|
* @kosApiLevel 22
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kos-index-aware.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/indexing/kos-index-aware.ts"],"names":[],"mappings":"AACA
|
|
1
|
+
{"version":3,"file":"kos-index-aware.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/core/core/indexing/kos-index-aware.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;GAWG;AAOH,OAAO,EAEL,mBAAmB,EAEnB,KAAK,uBAAuB,EAC7B,MAAM,SAAS,CAAC;AAMjB,MAAM,WAAW,oBAAoB;IACnC;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,GAAG,KAAK,MAAM,GAAG,SAAS,CAAC,CAAC;IAE1D;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAMD;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,CAAC,mBAAmB,CAAC,EAAE,uBAAuB,CAAC;CACzD;AAMD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,aAAa,CAAC,OAAO,CAAC,EAAE,oBAAoB,GAAG,cAAc,CAY5E"}
|
|
@@ -19,12 +19,23 @@ export declare class KosContainerIndex<T extends IKosIdentifiable> implements IK
|
|
|
19
19
|
private _container;
|
|
20
20
|
private _map;
|
|
21
21
|
private _key;
|
|
22
|
+
private _generation;
|
|
22
23
|
data: KosData<Record<string, T[]>>;
|
|
23
24
|
constructor({ container, key }: KosContainerIndexOptions<T>);
|
|
24
25
|
refresh(): void;
|
|
25
26
|
private addItemToIndex;
|
|
26
27
|
private resolveIndex;
|
|
28
|
+
/**
|
|
29
|
+
* Rebuild the index from the container's current contents.
|
|
30
|
+
*
|
|
31
|
+
* Applied in the same action when every key resolves synchronously, so a
|
|
32
|
+
* property key or a synchronous mapper updates the index before the
|
|
33
|
+
* container mutation returns. When a mapper returns a promise, the rebuild
|
|
34
|
+
* applies once they all settle, and only if no later rebuild has started:
|
|
35
|
+
* the latest container contents always win.
|
|
36
|
+
*/
|
|
27
37
|
private generateIndex;
|
|
38
|
+
private applyIndex;
|
|
28
39
|
get keys(): string[];
|
|
29
40
|
get index(): Map<string, Set<T>>;
|
|
30
41
|
getByKey(key: string): T[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kos-container-index.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ui-sdk/src/core/core/kos-container-index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkB,KAAK,OAAO,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,UAAU,wBAAwB,CAAC,CAAC,SAAS,gBAAgB;IAC3D,SAAS,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC;IAChC,GAAG,EAAE,MAAM,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;CAC/B;AAED,MAAM,WAAW,kBAAkB,CAAC,CAAC,SAAS,gBAAgB;IAC5D,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3B,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACnC,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,CAAC,EAAE,CAAC;IAC/B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,WAAW,CAAC,CAAC,SAAS,gBAAgB;IACrD,CAAC,KAAK,EAAE,CAAC,GACL,OAAO,CAAC,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,GACtC,MAAM,GACN,MAAM,EAAE,GACR,SAAS,CAAC;CACf;
|
|
1
|
+
{"version":3,"file":"kos-container-index.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ui-sdk/src/core/core/kos-container-index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkB,KAAK,OAAO,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,UAAU,wBAAwB,CAAC,CAAC,SAAS,gBAAgB;IAC3D,SAAS,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC;IAChC,GAAG,EAAE,MAAM,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;CAC/B;AAED,MAAM,WAAW,kBAAkB,CAAC,CAAC,SAAS,gBAAgB;IAC5D,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3B,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACnC,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,CAAC,EAAE,CAAC;IAC/B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,WAAW,CAAC,CA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