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