@kosdev-code/kos-ui-sdk 2.0.45 → 2.0.46
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 +0 -30
- package/common/events/eventBus.d.ts.map +1 -1
- package/common/events/eventBus.functional.d.ts +0 -48
- package/common/events/eventBus.functional.d.ts.map +1 -1
- package/common/events/eventBus.state.d.ts +0 -33
- package/common/events/eventBus.state.d.ts.map +1 -1
- package/core/core/decorators/index.d.ts +0 -11
- package/core/core/decorators/index.d.ts.map +1 -1
- package/core/core/decorators/kos-child.d.ts +0 -2
- package/core/core/decorators/kos-child.d.ts.map +1 -1
- package/core/core/decorators/kos-companion.d.ts +8 -158
- package/core/core/decorators/kos-companion.d.ts.map +1 -1
- package/core/core/decorators/kos-context.d.ts +0 -6
- package/core/core/decorators/kos-context.d.ts.map +1 -1
- package/core/core/decorators/kos-http-decorators.d.ts +0 -15
- package/core/core/decorators/kos-http-decorators.d.ts.map +1 -1
- package/core/core/decorators/kos-log.d.ts +0 -4
- package/core/core/decorators/kos-log.d.ts.map +1 -1
- package/core/core/decorators/kos-model-effect.d.ts +0 -9
- package/core/core/decorators/kos-model-effect.d.ts.map +1 -1
- package/core/core/decorators/kos-parent.d.ts +0 -4
- package/core/core/decorators/kos-parent.d.ts.map +1 -1
- package/core/core/decorators/kos-reference.d.ts +0 -9
- package/core/core/decorators/kos-reference.d.ts.map +1 -1
- package/core/core/decorators/kos-topic-handler-flow-control.d.ts +1 -17
- package/core/core/decorators/kos-topic-handler-flow-control.d.ts.map +1 -1
- package/core/core/decorators/kosDependency.d.ts +1 -4
- package/core/core/decorators/kosDependency.d.ts.map +1 -1
- package/core/core/decorators/kosModel.d.ts +2 -17
- package/core/core/decorators/kosModel.d.ts.map +1 -1
- package/core/core/decorators/kosSubscribe.d.ts +0 -9
- package/core/core/decorators/kosSubscribe.d.ts.map +1 -1
- package/core/core/decorators/kosTopicHandler.d.ts +5 -87
- package/core/core/decorators/kosTopicHandler.d.ts.map +1 -1
- package/core/core/decorators/propKeys.d.ts +0 -14
- 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 +4 -64
- package/core/core/extension/extension-manager.d.ts.map +1 -1
- package/core/core/extension/initialize-extension.d.ts +0 -24
- package/core/core/extension/initialize-extension.d.ts.map +1 -1
- package/core/core/extension/plugin-extension-manager.d.ts +0 -11
- package/core/core/extension/plugin-extension-manager.d.ts.map +1 -1
- package/core/core/kos-container-model.d.ts +0 -188
- package/core/core/kos-container-model.d.ts.map +1 -1
- package/core/core/kos-data-container.d.ts +1 -93
- 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 +2 -55
- package/core/core/kosModel.d.ts.map +1 -1
- package/core/core/kosModelManager.d.ts +1 -11
- 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-fsm-manager.d.ts +4 -1
- package/core/core/model/kos-fsm-manager.d.ts.map +1 -1
- package/core/core/model/kos-model-component-factory.d.ts +0 -4
- package/core/core/model/kos-model-component-factory.d.ts.map +1 -1
- package/core/core/model/kos-offline-queue.d.ts +1 -78
- package/core/core/model/kos-offline-queue.d.ts.map +1 -1
- package/core/core/model/kos-online-lifecycle-manager.d.ts.map +1 -1
- package/core/core/model/kos-subscription-manager.d.ts +0 -20
- package/core/core/model/kos-subscription-manager.d.ts.map +1 -1
- package/core/core/model/model-introspection-utils.d.ts +0 -1
- package/core/core/model/model-introspection-utils.d.ts.map +1 -1
- package/core/core/model-instantiator.d.ts +0 -19
- package/core/core/model-instantiator.d.ts.map +1 -1
- package/core/core/registration/index.d.ts +0 -1
- 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 +1 -2
- package/core/core/transport/webSocketTransport.d.ts.map +1 -1
- package/core/core/types/registration.d.ts +0 -7
- package/core/core/types/registration.d.ts.map +1 -1
- package/core/index.d.ts +1 -2
- package/core/index.d.ts.map +1 -1
- package/core/types/index.d.ts +0 -1
- package/core/types/index.d.ts.map +1 -1
- package/core/types/kos-dependency.d.ts +1 -48
- package/core/types/kos-dependency.d.ts.map +1 -1
- package/core/types/utils/kos-fetch.d.ts +0 -121
- package/core/types/utils/kos-fetch.d.ts.map +1 -1
- package/core/util/api-request-id.d.ts +0 -4
- package/core/util/api-request-id.d.ts.map +1 -1
- package/core/util/apply-mixins.d.ts +0 -4
- package/core/util/apply-mixins.d.ts.map +1 -1
- package/core/util/array-utils.d.ts +0 -4
- package/core/util/array-utils.d.ts.map +1 -1
- package/core/util/container-utils.d.ts +11 -264
- package/core/util/container-utils.d.ts.map +1 -1
- package/core/util/date-utils.d.ts +0 -29
- package/core/util/date-utils.d.ts.map +1 -1
- package/core/util/debounce.d.ts +0 -3
- package/core/util/debounce.d.ts.map +1 -1
- package/core/util/feature-flags.d.ts +0 -19
- package/core/util/feature-flags.d.ts.map +1 -1
- package/core/util/get-query-params.d.ts +0 -4
- package/core/util/get-query-params.d.ts.map +1 -1
- package/core/util/hsl-to-hex.d.ts +0 -16
- package/core/util/hsl-to-hex.d.ts.map +1 -1
- package/core/util/index.d.ts +0 -3
- package/core/util/index.d.ts.map +1 -1
- package/core/util/kos-config-init.d.ts +0 -37
- package/core/util/kos-config-init.d.ts.map +1 -1
- package/core/util/kos-data-mapper-utils.d.ts +0 -9
- package/core/util/kos-data-mapper-utils.d.ts.map +1 -1
- package/core/util/kos-fetch.d.ts +0 -12
- package/core/util/kos-fetch.d.ts.map +1 -1
- package/core/util/kos-message-utils.d.ts +0 -88
- package/core/util/kos-message-utils.d.ts.map +1 -1
- package/core/util/kos-model-utils.d.ts +0 -46
- package/core/util/kos-model-utils.d.ts.map +1 -1
- package/core/util/kos-model-visitor.d.ts +0 -2
- package/core/util/kos-model-visitor.d.ts.map +1 -1
- package/core/util/kos-service-request.d.ts +3 -43
- package/core/util/kos-service-request.d.ts.map +1 -1
- package/core/util/log-utils.d.ts +0 -12
- package/core/util/log-utils.d.ts.map +1 -1
- package/core/util/middleware.d.ts +0 -15
- package/core/util/middleware.d.ts.map +1 -1
- package/core/util/model-attribute-utils.d.ts +0 -7
- package/core/util/model-attribute-utils.d.ts.map +1 -1
- package/core/util/model-factory.d.ts +0 -4
- package/core/util/model-factory.d.ts.map +1 -1
- package/core/util/model-registration-utils.d.ts +0 -8
- package/core/util/model-registration-utils.d.ts.map +1 -1
- package/core/util/model-utils.d.ts +29 -40
- package/core/util/model-utils.d.ts.map +1 -1
- package/core/util/observable-proxy-map.d.ts +0 -11
- package/core/util/observable-proxy-map.d.ts.map +1 -1
- package/core/util/paired-client-heartbeat.d.ts +0 -2
- package/core/util/paired-client-heartbeat.d.ts.map +1 -1
- package/core/util/pipe.d.ts +0 -4
- package/core/util/pipe.d.ts.map +1 -1
- package/core/util/retry-with-exponential-backoff.d.ts +0 -3
- package/core/util/retry-with-exponential-backoff.d.ts.map +1 -1
- package/core/util/service-factory.d.ts +0 -10
- package/core/util/service-factory.d.ts.map +1 -1
- package/core/util/session-utils.d.ts +0 -8
- package/core/util/session-utils.d.ts.map +1 -1
- package/core/util/wait-for-request.d.ts +0 -16
- package/core/util/wait-for-request.d.ts.map +1 -1
- package/core/util/when-ready.d.ts +0 -3
- package/core/util/when-ready.d.ts.map +1 -1
- package/index.cjs +123 -26909
- package/index.cjs.map +1 -1
- package/index.d.cts +3 -6
- package/index.d.ts +3 -6
- package/index.d.ts.map +1 -1
- package/index.js +13460 -25275
- package/index.js.map +1 -1
- package/models/constants/index.d.ts +1 -3
- package/models/constants/index.d.ts.map +1 -1
- package/models/decorators/future-service.d.ts +2 -27
- package/models/decorators/future-service.d.ts.map +1 -1
- package/models/models/browser-router/browser-router-model.d.ts +1 -80
- package/models/models/browser-router/browser-router-model.d.ts.map +1 -1
- package/models/models/browser-router/types/index.d.ts +1 -26
- package/models/models/canvas-dispatcher/types/index.d.ts +0 -5
- package/models/models/canvas-renderer/types/index.d.ts +0 -5
- package/models/models/config-bean/config-bean-model-builder.d.ts +2 -4
- package/models/models/config-bean/config-bean-model-builder.d.ts.map +1 -1
- package/models/models/config-bean/config-bean-model.d.ts +13 -117
- package/models/models/config-bean/config-bean-model.d.ts.map +1 -1
- package/models/models/config-bean/config-bean-types.d.ts +3 -6
- package/models/models/config-bean/config-bean-types.d.ts.map +1 -1
- package/models/models/config-bean-prop/config-bean-prop-model.d.ts +1 -112
- 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 +19 -301
- package/models/models/device/device-model.d.ts +9 -219
- package/models/models/device/device-model.d.ts.map +1 -1
- package/models/models/device/device-registration.d.ts +48 -61
- package/models/models/device/device-registration.d.ts.map +1 -1
- package/models/models/device/types/index.d.ts +0 -42
- package/models/models/future/future-aware.d.ts +0 -82
- package/models/models/future/future-aware.d.ts.map +1 -1
- package/models/models/future/future-model.d.ts +5 -34
- package/models/models/future/future-model.d.ts.map +1 -1
- package/models/models/future/future-types.d.ts +9 -202
- 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/index.d.ts +0 -1
- package/models/models/index.d.ts.map +1 -1
- package/models/models/key-value/index.d.ts +0 -4
- package/models/models/key-value/index.d.ts.map +1 -1
- package/models/models/key-value/key-value-model.d.ts +0 -111
- package/models/models/key-value/key-value-model.d.ts.map +1 -1
- package/models/models/key-value/services/key-value-services.d.ts +2 -124
- package/models/models/key-value/services/key-value-services.d.ts.map +1 -1
- package/models/models/key-value/types/index.d.ts +0 -57
- package/models/models/kos-log-manager/kos-log-manager-model.d.ts +14 -61
- 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 +0 -191
- package/models/models/kos-time/kos-time-model.d.ts +0 -64
- package/models/models/kos-time/kos-time-model.d.ts.map +1 -1
- package/models/models/kos-time/types/index.d.ts +0 -83
- package/models/models/log-block/log-block-container-model.d.ts +0 -132
- package/models/models/log-block/log-block-container-model.d.ts.map +1 -1
- package/models/models/log-block/log-block-model.d.ts +0 -185
- package/models/models/log-block/log-block-model.d.ts.map +1 -1
- package/models/models/log-block/types/index.d.ts +0 -133
- package/models/models/log-stream/index.d.ts +2 -6
- package/models/models/log-stream/index.d.ts.map +1 -1
- package/models/models/log-stream/log-stream-container-model.d.ts +0 -62
- package/models/models/log-stream/log-stream-container-model.d.ts.map +1 -1
- package/models/models/log-stream/log-stream-model.d.ts +0 -55
- package/models/models/log-stream/log-stream-model.d.ts.map +1 -1
- package/models/models/log-stream/services/log-stream-services.d.ts +1 -2
- package/models/models/log-stream/services/log-stream-services.d.ts.map +1 -1
- package/models/models/log-stream/types/index.d.ts +0 -79
- package/models/models/network-interface/index.d.ts +2 -6
- package/models/models/network-interface/index.d.ts.map +1 -1
- package/models/models/network-interface/network-interface-container-model.d.ts +0 -62
- 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 +1 -2
- package/models/models/network-interface/network-interface-container-registration.d.ts.map +1 -1
- package/models/models/network-interface/network-interface-model.d.ts +0 -77
- package/models/models/network-interface/network-interface-model.d.ts.map +1 -1
- package/models/models/network-interface/network-interface-registration.d.ts +1 -2
- package/models/models/network-interface/network-interface-registration.d.ts.map +1 -1
- package/models/models/network-interface/services/network-interface-services.d.ts +0 -54
- package/models/models/network-interface/services/network-interface-services.d.ts.map +1 -1
- package/models/models/network-interface/types/index.d.ts +0 -22
- package/models/models/ota/ota-model.d.ts +0 -79
- package/models/models/ota/ota-model.d.ts.map +1 -1
- package/models/models/ota/types/index.d.ts +0 -177
- package/models/models/region-info/region-info-model.d.ts +3 -8
- 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 +13 -191
- 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 +2 -74
- package/models/models/software-info/software-info-model.d.ts.map +1 -1
- package/models/models/software-info/types/index.d.ts +17 -52
- package/models/models/state-bean/state-bean-model.d.ts +9 -86
- package/models/models/state-bean/state-bean-model.d.ts.map +1 -1
- package/models/models/state-bean/types/index.d.ts +6 -117
- package/models/models/state-prop/state-prop-model.d.ts +1 -78
- package/models/models/state-prop/state-prop-model.d.ts.map +1 -1
- package/models/models/state-prop/types/index.d.ts +7 -57
- package/models/models/storage-device/services/storage-device-services.d.ts +0 -1
- 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 +2 -289
- package/models/models/storage-device/storage-device-container-model.d.ts.map +1 -1
- package/models/models/storage-device/storage-device-model.d.ts +2 -84
- package/models/models/storage-device/storage-device-model.d.ts.map +1 -1
- package/models/models/storage-device/types/index.d.ts +0 -114
- package/models/models/studio-properties/studio-properties-model.d.ts +0 -75
- package/models/models/studio-properties/studio-properties-model.d.ts.map +1 -1
- package/models/models/studio-properties/types/index.d.ts +0 -29
- package/models/models/translation/services/translation-services.d.ts +2 -128
- package/models/models/translation/services/translation-services.d.ts.map +1 -1
- package/models/models/translation/translation-container-model.d.ts +10 -100
- package/models/models/translation/translation-container-model.d.ts.map +1 -1
- package/models/models/translation/translation-container-registration.d.ts +1 -2
- package/models/models/translation/translation-container-registration.d.ts.map +1 -1
- package/models/models/translation/translation-context.d.ts +16 -1
- package/models/models/translation/translation-context.d.ts.map +1 -1
- package/models/models/translation/translation-model.d.ts +1 -113
- package/models/models/translation/translation-model.d.ts.map +1 -1
- package/models/models/translation/types/index.d.ts +0 -343
- package/models/models/trouble/index.d.ts +1 -2
- package/models/models/trouble/index.d.ts.map +1 -1
- package/models/models/trouble/services/trouble-services.d.ts +4 -6
- package/models/models/trouble/services/trouble-services.d.ts.map +1 -1
- package/models/models/trouble/trouble-model.d.ts +1 -4
- package/models/models/trouble/trouble-model.d.ts.map +1 -1
- package/models/models/trouble/types/index.d.ts +93 -34
- 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 +3 -4
- package/models/models/trouble-container/index.d.ts.map +1 -1
- package/models/models/trouble-container/trouble-container-model.d.ts +6 -10
- package/models/models/trouble-container/trouble-container-model.d.ts.map +1 -1
- package/models/models/trouble-container/trouble-container-registration.d.ts +5 -0
- package/models/models/trouble-container/trouble-container-registration.d.ts.map +1 -0
- package/models/models/trouble-container/types/index.d.ts +15 -6
- package/models/models/usb-update/types/index.d.ts +0 -10
- 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 +12 -16
- 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 +13 -54
- package/models/utils/extension-manager.d.ts.map +1 -1
- package/models/utils/index.d.ts +2 -3
- package/models/utils/index.d.ts.map +1 -1
- package/models/utils/kosmodel-compatible-future-mixin.d.ts +142 -0
- package/models/utils/kosmodel-compatible-future-mixin.d.ts.map +1 -0
- package/models/utils/kosmodel-interface-companion-mixin.d.ts +83 -0
- package/models/utils/kosmodel-interface-companion-mixin.d.ts.map +1 -0
- package/models/utils/service.d.ts +13 -91
- package/models/utils/service.d.ts.map +1 -1
- package/package.json +2 -16
- package/ui/contexts/kos-core-context.d.ts.map +1 -1
- package/ui/contexts/state-bean/state-bean-provider.d.ts.map +1 -1
- package/ui/hooks/device/use-device.d.ts +0 -6
- package/ui/hooks/device/use-device.d.ts.map +1 -1
- package/ui/hooks/index.d.ts +0 -1
- package/ui/hooks/index.d.ts.map +1 -1
- package/ui/hooks/kos-time/use-kos-time.d.ts +0 -6
- 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 +0 -6
- package/ui/hooks/network-interface-container/use-network-interface-container.d.ts.map +1 -1
- package/ui/hooks/ota/use-ota.d.ts +0 -6
- package/ui/hooks/ota/use-ota.d.ts.map +1 -1
- package/ui/hooks/software-info/use-software-info.d.ts +0 -6
- 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 +0 -6
- package/ui/hooks/storage-device-container/use-storage-device-container.d.ts.map +1 -1
- package/ui/hooks/translation-container/trans.d.ts +0 -6
- package/ui/hooks/translation-container/trans.d.ts.map +1 -1
- package/ui/hooks/translation-container/use-translation-container.d.ts +33 -10
- package/ui/hooks/translation-container/use-translation-container.d.ts.map +1 -1
- package/ui/hooks/translation-container/use-translation.d.ts +0 -7
- package/ui/hooks/translation-container/use-translation.d.ts.map +1 -1
- package/ui/hooks/translation-container/with-translation-container.d.ts +0 -6
- 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 +0 -6
- package/ui/hooks/usb-update-container/use-usb-update-container.d.ts.map +1 -1
- package/ui/hooks/use-config-bean.d.ts +0 -6
- package/ui/hooks/use-config-bean.d.ts.map +1 -1
- package/ui/hooks/use-config-property.d.ts +0 -6
- package/ui/hooks/use-config-property.d.ts.map +1 -1
- package/ui/hooks/use-kos-model.d.ts +0 -7
- package/ui/hooks/use-kos-model.d.ts.map +1 -1
- package/ui/hooks/use-kos-regions.d.ts.map +1 -1
- package/core/constants/model-constants.d.ts +0 -9
- package/core/constants/model-constants.d.ts.map +0 -1
- package/core/core/companion-instantiator.d.ts +0 -71
- package/core/core/companion-instantiator.d.ts.map +0 -1
- package/core/core/decorators/fsm-injection-utils.d.ts +0 -16
- package/core/core/decorators/fsm-injection-utils.d.ts.map +0 -1
- package/core/core/decorators/kos-container-aware.d.ts +0 -619
- package/core/core/decorators/kos-container-aware.d.ts.map +0 -1
- package/core/core/decorators/kos-execution-context.d.ts +0 -63
- package/core/core/decorators/kos-execution-context.d.ts.map +0 -1
- package/core/core/decorators/kos-future-aware.d.ts +0 -162
- package/core/core/decorators/kos-future-aware.d.ts.map +0 -1
- package/core/core/decorators/kos-logger-aware.d.ts +0 -105
- package/core/core/decorators/kos-logger-aware.d.ts.map +0 -1
- package/core/core/decorators/kos-multiple-future-aware.d.ts +0 -217
- package/core/core/decorators/kos-multiple-future-aware.d.ts.map +0 -1
- package/core/core/decorators/kos-service-request-helpers.d.ts +0 -60
- package/core/core/decorators/kos-service-request-helpers.d.ts.map +0 -1
- package/core/core/decorators/kos-service-request.d.ts +0 -498
- package/core/core/decorators/kos-service-request.d.ts.map +0 -1
- package/core/core/decorators/kos-state-machine.d.ts +0 -534
- package/core/core/decorators/kos-state-machine.d.ts.map +0 -1
- package/core/core/decorators/kos-trouble-aware.d.ts +0 -77
- package/core/core/decorators/kos-trouble-aware.d.ts.map +0 -1
- package/core/core/decorators/kos-view-model.d.ts +0 -176
- package/core/core/decorators/kos-view-model.d.ts.map +0 -1
- package/core/core/model/kos-service-request-manager.d.ts +0 -102
- package/core/core/model/kos-service-request-manager.d.ts.map +0 -1
- package/core/core/model/service-response-store.d.ts +0 -164
- package/core/core/model/service-response-store.d.ts.map +0 -1
- package/core/types/service-response-store.d.ts +0 -162
- package/core/types/service-response-store.d.ts.map +0 -1
- package/core/util/ancestor-path-visitor.d.ts +0 -60
- package/core/util/ancestor-path-visitor.d.ts.map +0 -1
- package/core/util/error-logger.d.ts +0 -16
- package/core/util/error-logger.d.ts.map +0 -1
- package/core/util/model-error-utils.d.ts +0 -61
- package/core/util/model-error-utils.d.ts.map +0 -1
- package/core/util/model-transition-utils.d.ts +0 -41
- package/core/util/model-transition-utils.d.ts.map +0 -1
- package/core/util/model-type-guards.d.ts +0 -26
- package/core/util/model-type-guards.d.ts.map +0 -1
- package/core/util/promise-utils.d.ts +0 -58
- package/core/util/promise-utils.d.ts.map +0 -1
- package/core/util/service-request-error.d.ts +0 -60
- package/core/util/service-request-error.d.ts.map +0 -1
- package/core/util/service-response.d.ts +0 -125
- package/core/util/service-response.d.ts.map +0 -1
- package/kos-models.json +0 -426
- package/models/models/config-bean/types/index.d.ts +0 -34
- package/models/models/gpio-chip/gpio-chip-container-model.d.ts +0 -25
- package/models/models/gpio-chip/gpio-chip-container-model.d.ts.map +0 -1
- package/models/models/gpio-chip/gpio-chip-model.d.ts +0 -30
- package/models/models/gpio-chip/gpio-chip-model.d.ts.map +0 -1
- package/models/models/gpio-chip/index.d.ts +0 -7
- package/models/models/gpio-chip/index.d.ts.map +0 -1
- package/models/models/gpio-chip/services/gpio-chip-services.d.ts +0 -86
- package/models/models/gpio-chip/services/gpio-chip-services.d.ts.map +0 -1
- package/models/models/gpio-chip/services/index.d.ts +0 -2
- package/models/models/gpio-chip/services/index.d.ts.map +0 -1
- package/models/models/gpio-chip/types/index.d.ts +0 -24
- package/models/models/gpio-pin/gpio-pin-container-model.d.ts +0 -23
- package/models/models/gpio-pin/gpio-pin-container-model.d.ts.map +0 -1
- package/models/models/gpio-pin/gpio-pin-model.d.ts +0 -26
- package/models/models/gpio-pin/gpio-pin-model.d.ts.map +0 -1
- package/models/models/gpio-pin/index.d.ts +0 -6
- package/models/models/gpio-pin/index.d.ts.map +0 -1
- package/models/models/gpio-pin/types/index.d.ts +0 -23
- package/models/models/kos-expression-evaluator/index.d.ts +0 -4
- package/models/models/kos-expression-evaluator/index.d.ts.map +0 -1
- package/models/models/kos-expression-evaluator/kos-expression-evaluator-model.d.ts +0 -209
- package/models/models/kos-expression-evaluator/kos-expression-evaluator-model.d.ts.map +0 -1
- package/models/models/kos-expression-evaluator/services/index.d.ts +0 -6
- package/models/models/kos-expression-evaluator/services/index.d.ts.map +0 -1
- package/models/models/kos-expression-evaluator/services/kos-expression-evaluator-services.d.ts +0 -15
- package/models/models/kos-expression-evaluator/services/kos-expression-evaluator-services.d.ts.map +0 -1
- package/models/models/kos-expression-evaluator/types/index.d.ts +0 -6
- package/models/utils/get-kos-connection-id.d.ts +0 -2
- package/models/utils/get-kos-connection-id.d.ts.map +0 -1
- package/models/utils/openapi-index.d.ts +0 -3
- package/models/utils/openapi-index.d.ts.map +0 -1
- package/models/utils/service-accessor.d.ts +0 -86
- package/models/utils/service-accessor.d.ts.map +0 -1
- package/models/utils/services/kos/1.6.5/openapi.d.ts +0 -3809
- package/models/utils/services/kos/1.6.5/service.d.ts +0 -124
- package/models/utils/services/kos/1.6.5/service.d.ts.map +0 -1
- package/models/utils/services/kos/1.8.1/openapi.d.ts +0 -4344
- package/models/utils/services/kos/1.8.1/service.d.ts +0 -124
- package/models/utils/services/kos/1.8.1/service.d.ts.map +0 -1
- package/models/utils/services/kos/1.9.x/openapi.d.ts +0 -4597
- package/models/utils/services/kos/1.9.x/service.d.ts +0 -124
- package/models/utils/services/kos/1.9.x/service.d.ts.map +0 -1
- package/models/utils/services/kos/daily/openapi.d.ts +0 -4349
- package/models/utils/services/kos/daily/service.d.ts +0 -124
- package/models/utils/services/kos/daily/service.d.ts.map +0 -1
- package/models/utils/services/vfs/1.6.5/openapi.d.ts +0 -51
- package/models/utils/services/vfs/1.6.5/service.d.ts +0 -124
- package/models/utils/services/vfs/1.6.5/service.d.ts.map +0 -1
- package/models/utils/services/vfs/1.8.1/openapi.d.ts +0 -51
- package/models/utils/services/vfs/1.8.1/service.d.ts +0 -124
- package/models/utils/services/vfs/1.8.1/service.d.ts.map +0 -1
- package/models/utils/services/vfs/1.9.x/openapi.d.ts +0 -51
- package/models/utils/services/vfs/1.9.x/service.d.ts +0 -124
- package/models/utils/services/vfs/1.9.x/service.d.ts.map +0 -1
- package/models/utils/services/vfs/daily/openapi.d.ts +0 -51
- package/models/utils/services/vfs/daily/service.d.ts +0 -124
- package/models/utils/services/vfs/daily/service.d.ts.map +0 -1
- package/models/utils/services-index.d.ts +0 -9
- package/models/utils/services-index.d.ts.map +0 -1
- package/ui/hooks/view-model/index.d.ts +0 -2
- package/ui/hooks/view-model/index.d.ts.map +0 -1
- package/ui/hooks/view-model/use-view-model.d.ts +0 -80
- package/ui/hooks/view-model/use-view-model.d.ts.map +0 -1
|
@@ -1,32 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Configuration options for StudioPropertiesModel instances.
|
|
3
|
-
*
|
|
4
|
-
* This interface defines the configuration structure for Studio properties models,
|
|
5
|
-
* which manage real-time access to KOS Studio runtime properties and settings.
|
|
6
|
-
* The connection ID serves as the primary routing mechanism for Studio-specific
|
|
7
|
-
* property synchronization.
|
|
8
|
-
*
|
|
9
|
-
* @example Basic Usage
|
|
10
|
-
* ```typescript
|
|
11
|
-
* const studioProps = StudioPropertiesModel.instance('dev-studio')
|
|
12
|
-
* .options({ connectionId: 'vm-development-001' })
|
|
13
|
-
* .build();
|
|
14
|
-
* ```
|
|
15
|
-
*
|
|
16
|
-
* @category Model Configuration
|
|
17
|
-
* @category System Integration
|
|
18
|
-
*/
|
|
19
1
|
export interface StudioPropertiesOptions {
|
|
20
|
-
/**
|
|
21
|
-
* Studio VM connection identifier for property routing and WebSocket targeting.
|
|
22
|
-
*
|
|
23
|
-
* This ID corresponds to an active Studio connection and determines which Studio
|
|
24
|
-
* instance provides the properties. Each Studio VM connection has unique runtime
|
|
25
|
-
* properties and configuration values.
|
|
26
|
-
*
|
|
27
|
-
* @example "vm-development-local-001"
|
|
28
|
-
* @example "studio-connection-abc123"
|
|
29
|
-
* @example "primary-studio-instance"
|
|
30
|
-
*/
|
|
31
2
|
connectionId: string;
|
|
32
3
|
}
|
|
@@ -1,151 +1,25 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Translation service functions for internationalization and localization.
|
|
3
|
-
*
|
|
4
|
-
* This module provides service functions for loading translation data, managing locale
|
|
5
|
-
* descriptors, and handling multi-language content in KOS applications. Supports both
|
|
6
|
-
* static file-based translations and dynamic translation service integration.
|
|
7
|
-
*
|
|
8
|
-
* @module TranslationServices
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* Generic translation data response format.
|
|
12
|
-
*
|
|
13
|
-
* Represents the structure of translation data returned from various translation
|
|
14
|
-
* endpoints, supporting flexible key-value structures for different locales
|
|
15
|
-
* and translation namespaces.
|
|
16
|
-
*
|
|
17
|
-
* @group KOS Model
|
|
18
|
-
* @category i18n
|
|
19
|
-
*/
|
|
20
1
|
export type TranslationResponse = Record<string, any>;
|
|
21
|
-
/**
|
|
22
|
-
* Locale descriptor defining translation file location and fallback behavior.
|
|
23
|
-
*
|
|
24
|
-
* Describes how to locate and load translation files for a specific locale,
|
|
25
|
-
* including fallback chains for graceful degradation when translations are
|
|
26
|
-
* missing or incomplete.
|
|
27
|
-
*
|
|
28
|
-
* @group KOS Model
|
|
29
|
-
* @category i18n
|
|
30
|
-
*/
|
|
31
2
|
export interface LocaleDescriptor {
|
|
32
|
-
/** Default locale to use when this locale's translations are unavailable */
|
|
33
3
|
defaultLocale: string;
|
|
34
|
-
/** Path to the translation file for this locale */
|
|
35
4
|
file: string;
|
|
36
|
-
/** Optional array of fallback locales to try in order */
|
|
37
5
|
fallbacks?: string[];
|
|
38
6
|
}
|
|
39
|
-
/**
|
|
40
|
-
* Complete localization configuration for organizing translation namespaces.
|
|
41
|
-
*
|
|
42
|
-
* Defines the structure for managing multiple translation namespaces with
|
|
43
|
-
* locale-specific configurations. Enables organized translation management
|
|
44
|
-
* across different features or components of an application.
|
|
45
|
-
*
|
|
46
|
-
* @group KOS Model
|
|
47
|
-
* @category i18n
|
|
48
|
-
*/
|
|
49
7
|
export interface Localization {
|
|
50
|
-
/**
|
|
51
|
-
* Translation namespaces organized by feature or component.
|
|
52
|
-
* Each namespace contains locale configurations and file paths.
|
|
53
|
-
*/
|
|
54
8
|
namespaces: {
|
|
55
9
|
[key: string]: {
|
|
56
|
-
/** Locale-specific configuration for this namespace */
|
|
57
10
|
locales: {
|
|
58
11
|
[key: string]: LocaleDescriptor;
|
|
59
12
|
};
|
|
60
|
-
/** Base path for translation files in this namespace */
|
|
61
13
|
basePath: string;
|
|
62
14
|
};
|
|
63
15
|
};
|
|
64
|
-
/** Root path for the localization configuration */
|
|
65
16
|
path: string;
|
|
66
17
|
}
|
|
67
18
|
/**
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
* Fetches translation JSON files from static resources or translation services.
|
|
71
|
-
* Handles network errors gracefully by returning empty objects rather than
|
|
72
|
-
* throwing exceptions, enabling fallback behavior in translation systems.
|
|
73
|
-
*
|
|
74
|
-
* @param url - Relative or absolute URL to the translation file
|
|
75
|
-
* @param root - Optional root URL override (defaults to current window origin)
|
|
76
|
-
* @returns Promise resolving to translation data object
|
|
77
|
-
*
|
|
78
|
-
* @throws {Error} When network request fails unexpectedly (non-200 responses return empty object)
|
|
79
|
-
*
|
|
80
|
-
* @example Load Translation File
|
|
81
|
-
* ```typescript
|
|
82
|
-
* const frenchTranslations = await getTranslations('/assets/locales/fr/common.json');
|
|
83
|
-
* console.log('Welcome message:', frenchTranslations.welcome);
|
|
84
|
-
*
|
|
85
|
-
* const customTranslations = await getTranslations('/api/translations/dashboard', 'https://translations.example.com');
|
|
86
|
-
* ```
|
|
87
|
-
*
|
|
88
|
-
* @group KOS Model
|
|
89
|
-
* @category i18n
|
|
19
|
+
* @category Service
|
|
20
|
+
* Retrieves the initial translation data.
|
|
90
21
|
*/
|
|
91
22
|
export declare const getTranslations: (url: string, root?: string) => Promise<any>;
|
|
92
|
-
/**
|
|
93
|
-
* Retrieves the system-wide localization configuration descriptor.
|
|
94
|
-
*
|
|
95
|
-
* Fetches the complete localization configuration from the KOS system,
|
|
96
|
-
* including namespace definitions, locale mappings, and file path information.
|
|
97
|
-
* Used for initializing translation containers with proper configuration.
|
|
98
|
-
*
|
|
99
|
-
* @returns Promise resolving to complete localization descriptor
|
|
100
|
-
*
|
|
101
|
-
* @throws {Error} When service request fails or returns non-200 status
|
|
102
|
-
*
|
|
103
|
-
* @example Initialize Translation System
|
|
104
|
-
* ```typescript
|
|
105
|
-
* const localizationConfig = await getLocalizationDescriptor();
|
|
106
|
-
* const translationContainer = TranslationContainer.instance('app-i18n')
|
|
107
|
-
* .options({
|
|
108
|
-
* lang: 'en',
|
|
109
|
-
* descriptor: localizationConfig
|
|
110
|
-
* })
|
|
111
|
-
* .build();
|
|
112
|
-
* ```
|
|
113
|
-
*
|
|
114
|
-
* @group KOS Model
|
|
115
|
-
* @category i18n
|
|
116
|
-
*/
|
|
117
23
|
export declare const getLocalizationDescriptor: () => Promise<Localization>;
|
|
118
|
-
/**
|
|
119
|
-
* Creates a context-specific localization descriptor retrieval function.
|
|
120
|
-
*
|
|
121
|
-
* Returns a curried function that fetches localization configuration for a
|
|
122
|
-
* specific context from the KOS system. Useful for creating context-aware
|
|
123
|
-
* translation loaders that can be configured once and used multiple times.
|
|
124
|
-
*
|
|
125
|
-
* @param context - Context identifier for localization configuration
|
|
126
|
-
* @returns Async function that retrieves context-specific localization descriptor
|
|
127
|
-
*
|
|
128
|
-
* @throws {Error} When service request fails or context is not found
|
|
129
|
-
*
|
|
130
|
-
* @example Create Context-Specific Loader
|
|
131
|
-
* ```typescript
|
|
132
|
-
* const getStudioTranslations = getKosLocalizationDescriptor('studio');
|
|
133
|
-
* const studioConfig = await getStudioTranslations();
|
|
134
|
-
*
|
|
135
|
-
* const getDeviceTranslations = getKosLocalizationDescriptor('device');
|
|
136
|
-
* const deviceConfig = await getDeviceTranslations();
|
|
137
|
-
*
|
|
138
|
-
* // Use in translation container initialization
|
|
139
|
-
* const container = TranslationContainer.instance('context-aware')
|
|
140
|
-
* .options({
|
|
141
|
-
* lang: 'es',
|
|
142
|
-
* descriptor: studioConfig
|
|
143
|
-
* })
|
|
144
|
-
* .build();
|
|
145
|
-
* ```
|
|
146
|
-
*
|
|
147
|
-
* @group KOS Model
|
|
148
|
-
* @category i18n
|
|
149
|
-
*/
|
|
150
24
|
export declare const getKosLocalizationDescriptor: (context: string) => () => Promise<Localization>;
|
|
151
25
|
//# sourceMappingURL=translation-services.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translation-services.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/sdk/kos-ui-sdk/src/models/models/translation/services/translation-services.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"translation-services.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/sdk/kos-ui-sdk/src/models/models/translation/services/translation-services.ts"],"names":[],"mappings":"AAeA,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAEtD,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AACD,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE;QACV,CAAC,GAAG,EAAE,MAAM,GAAG;YACb,OAAO,EAAE;gBACP,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAC;aACjC,CAAC;YACF,QAAQ,EAAE,MAAM,CAAC;SAClB,CAAC;KACH,CAAC;IACF,IAAI,EAAE,MAAM,CAAC;CACd;AASD;;;GAGG;AACH,eAAO,MAAM,eAAe,QAAe,MAAM,SAAS,MAAM,iBAgB/D,CAAC;AAEF,eAAO,MAAM,yBAAyB,6BAYrC,CAAC;AAEF,eAAO,MAAM,4BAA4B,YAAa,MAAM,gCAY3D,CAAC"}
|
|
@@ -1,126 +1,36 @@
|
|
|
1
1
|
import { TranslationContainerOptions } from './types';
|
|
2
2
|
import { TranslationModel } from './translation-model';
|
|
3
3
|
import { Localization } from './services';
|
|
4
|
-
import { PublicModelInterface } from '../../../core/types';
|
|
5
4
|
import { IKosDataModel, IKosIdentifiable, IKosModelContainer, IKosModelHolder, KosCreationContext, ReloadAware } from '../../../core';
|
|
6
5
|
|
|
7
6
|
export declare const MODEL_TYPE = "translation-container-model";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
* applications. It manages multiple translation namespaces, handles global locale switching, and provides
|
|
13
|
-
* namespace resolution with fallback chains. This container enables building sophisticated multi-language
|
|
14
|
-
* interfaces that adapt automatically to user language preferences across all application features.
|
|
15
|
-
*
|
|
16
|
-
* ## Key Features
|
|
17
|
-
* - **Multi-Namespace Management** - Organize translations by feature areas (dashboard, alerts, settings)
|
|
18
|
-
* - **Global Locale Control** - Centralized locale switching affects all contained translation models
|
|
19
|
-
* - **Automatic Discovery** - Dynamic namespace loading and registration as features request translations
|
|
20
|
-
* - **Fallback Resolution** - Sophisticated locale fallback chains for graceful degradation
|
|
21
|
-
* - **Custom Resolvers** - Flexible translation loading strategies for different deployment scenarios
|
|
22
|
-
* - **Reload Capability** - Dynamic translation updates without application restart
|
|
23
|
-
* - **Default Namespace** - Optional primary namespace for application-wide common translations
|
|
24
|
-
*
|
|
25
|
-
* ## Namespace Organization
|
|
26
|
-
* Translation namespaces organize translations by functional areas:
|
|
27
|
-
* - **Feature-Based**: dashboard, device-config, maintenance, alerts
|
|
28
|
-
* - **Component-Based**: forms, modals, navigation, status-displays
|
|
29
|
-
* - **Common**: common, shared, ui-elements for cross-cutting concerns
|
|
30
|
-
*
|
|
31
|
-
* ## Locale Management Architecture
|
|
32
|
-
* The container manages locale switching across all child translation models:
|
|
33
|
-
* 1. **Centralized Control**: Single point for locale changes
|
|
34
|
-
* 2. **Automatic Propagation**: All child models receive locale updates
|
|
35
|
-
* 3. **Reactive Loading**: Translation files loaded automatically on locale switch
|
|
36
|
-
* 4. **Fallback Coordination**: Container coordinates fallback chains across namespaces
|
|
37
|
-
*
|
|
38
|
-
* ## Common Use Cases
|
|
39
|
-
* - **Application Initialization** - Bootstrap internationalization system with locale descriptors
|
|
40
|
-
* - **User Language Switching** - Provide language selector that updates entire application
|
|
41
|
-
* - **Feature Translation Loading** - Dynamic namespace registration as features are accessed
|
|
42
|
-
* - **Multi-Tenant Systems** - Different translation sets for different deployments
|
|
43
|
-
* - **Development Workflows** - Hot-reload translations during development
|
|
44
|
-
* - **Global Device Interfaces** - Centralized management for device control applications
|
|
45
|
-
*
|
|
46
|
-
* @example Basic Usage
|
|
47
|
-
* ```typescript
|
|
48
|
-
* const translationContainer = TranslationContainer.instance('app-translations')
|
|
49
|
-
* .options({
|
|
50
|
-
* lang: 'es',
|
|
51
|
-
* defaultNamespace: 'common',
|
|
52
|
-
* descriptor: {
|
|
53
|
-
* namespaces: {
|
|
54
|
-
* 'common': {
|
|
55
|
-
* basePath: '/assets/locales',
|
|
56
|
-
* locales: {
|
|
57
|
-
* 'en': { file: 'en/common.json', defaultLocale: 'en' },
|
|
58
|
-
* 'es': { file: 'es/common.json', defaultLocale: 'en' }
|
|
59
|
-
* }
|
|
60
|
-
* }
|
|
61
|
-
* }
|
|
62
|
-
* }
|
|
63
|
-
* })
|
|
64
|
-
* .build();
|
|
65
|
-
*
|
|
66
|
-
* // Access translations and switch language
|
|
67
|
-
* const commonTranslations = translationContainer.getModel('common');
|
|
68
|
-
* translationContainer.currentLocale = 'fr';
|
|
69
|
-
* ```
|
|
70
|
-
*
|
|
71
|
-
* @group KOS Model
|
|
72
|
-
* @category i18n
|
|
73
|
-
* @interface
|
|
74
|
-
* @useDeclaredType
|
|
75
|
-
*
|
|
76
|
-
* @see {@link TranslationContainerOptions} - Configuration options for TranslationContainer instances
|
|
77
|
-
* @see {@link TranslationModel} - Individual translation namespace model
|
|
78
|
-
* @see {@link useKosTranslation} - React hook for accessing container translations
|
|
79
|
-
* @see {@link useKosTranslationContext} - React hook for container-level operations
|
|
80
|
-
*/
|
|
81
|
-
export type TranslationContainerModel = PublicModelInterface<TranslationContainerModelImpl>;
|
|
82
|
-
/**
|
|
83
|
-
* @ignore
|
|
84
|
-
* @internal
|
|
85
|
-
*/
|
|
7
|
+
type PublicInterface<T> = {
|
|
8
|
+
[P in keyof T]: T[P];
|
|
9
|
+
};
|
|
10
|
+
export type TranslationContainerModel = PublicInterface<Exclude<TranslationContainerModelImpl, keyof IKosDataModel>>;
|
|
86
11
|
export declare class TranslationContainerModelImpl implements IKosIdentifiable, IKosModelHolder<TranslationModel>, IKosDataModel, ReloadAware {
|
|
87
|
-
/** Unique identifier for the container model instance */
|
|
88
12
|
id: string;
|
|
89
|
-
/** Currently active locale for all managed translation namespaces */
|
|
90
13
|
lang: string;
|
|
91
|
-
/** Base URL for loading translation resources */
|
|
92
14
|
private rootUrl?;
|
|
93
|
-
/** Localization descriptor defining namespace configuration and locale mappings */
|
|
94
15
|
descriptor: Localization;
|
|
95
|
-
/** Optional default namespace identifier for primary application translations */
|
|
96
16
|
private _defaultNamespace?;
|
|
97
|
-
/** Path resolver function for constructing translation file URLs */
|
|
98
17
|
private resolver;
|
|
99
|
-
/** Context logger for debugging translation operations */
|
|
100
18
|
private logger;
|
|
101
|
-
/** URL for dynamically loading localization descriptors */
|
|
102
19
|
private descriptorUrl?;
|
|
103
|
-
/** Array tracking registered namespace identifiers */
|
|
104
20
|
private namespaces;
|
|
105
|
-
/** Container for managing Translation model instances */
|
|
106
21
|
private _models;
|
|
107
22
|
constructor(modelId: string, options: TranslationContainerOptions, context: KosCreationContext);
|
|
108
23
|
set currentLocale(locale: string);
|
|
109
|
-
get defaultNamespace():
|
|
110
|
-
getModel(id: string):
|
|
111
|
-
get models(): IKosModelContainer<
|
|
112
|
-
get data():
|
|
24
|
+
get defaultNamespace(): import('./translation-model').TranslationModelImpl | undefined;
|
|
25
|
+
getModel(id: string): import('./translation-model').TranslationModelImpl | undefined;
|
|
26
|
+
get models(): IKosModelContainer<import('./translation-model').TranslationModelImpl>;
|
|
27
|
+
get data(): import('./translation-model').TranslationModelImpl[];
|
|
113
28
|
reload(): Promise<void>;
|
|
114
|
-
resolveNamespace(namespace: string):
|
|
29
|
+
resolveNamespace(namespace: string): import('./translation-model').TranslationModelImpl;
|
|
115
30
|
addModel(model: TranslationModel): void;
|
|
116
31
|
removeModel(id: string): void;
|
|
117
|
-
/**
|
|
118
|
-
* @internal
|
|
119
|
-
*/
|
|
120
32
|
init(): Promise<void>;
|
|
121
|
-
/**
|
|
122
|
-
* @internal
|
|
123
|
-
*/
|
|
124
33
|
load(): Promise<void>;
|
|
125
34
|
}
|
|
35
|
+
export {};
|
|
126
36
|
//# sourceMappingURL=translation-container-model.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translation-container-model.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-ui-sdk/src/models/models/translation/translation-container-model.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EAEf,kBAAkB,EAClB,WAAW,EACZ,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"translation-container-model.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-ui-sdk/src/models/models/translation/translation-container-model.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EAEf,kBAAkB,EAClB,WAAW,EACZ,MAAM,eAAe,CAAC;AAUvB,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAE3D,eAAO,MAAM,UAAU,gCAAgC,CAAC;AACxD,KAAK,eAAe,CAAC,CAAC,IAAI;KACvB,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACrB,CAAC;AACF,MAAM,MAAM,yBAAyB,GAAG,eAAe,CACrD,OAAO,CAAC,6BAA6B,EAAE,MAAM,aAAa,CAAC,CAC5D,CAAC;AAmBF,qBACa,6BACX,YACE,gBAAgB,EAChB,eAAe,CAAC,gBAAgB,CAAC,EACjC,aAAa,EACb,WAAW;IAEb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,OAAO,CAAC,CAAS;IACzB,UAAU,EAAE,YAAY,CAAC;IACzB,OAAO,CAAC,iBAAiB,CAAC,CAAS;IACnC,OAAO,CAAC,QAAQ,CAIJ;IACZ,OAAO,CAAC,MAAM,CAAmB;IACjC,OAAO,CAAC,aAAa,CAAC,CAAS;IAC/B,OAAO,CAAC,UAAU,CAAgB;IACxB,OAAO,CAAC,OAAO,CAAuC;gBAE9D,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,2BAA2B,EACpC,OAAO,EAAE,kBAAkB;IAiB7B,IAAI,aAAa,CAAC,MAAM,EAAE,MAAM,EAK/B;IACD,IAAI,gBAAgB,mEAInB;IACD,QAAQ,CAAC,EAAE,EAAE,MAAM;IAInB,IAAI,MAAM,2EAET;IACD,IAAI,IAAI,yDAEP;IAEK,MAAM;IAMZ,gBAAgB,CAAC,SAAS,EAAE,MAAM;IA4ClC,QAAQ,CAAC,KAAK,EAAE,gBAAgB;IAIhC,WAAW,CAAC,EAAE,EAAE,MAAM;IAKhB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAMrB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAG5B"}
|
|
@@ -81,8 +81,7 @@ import { SingletonKosModelRegistrationBean } from '../../../core';
|
|
|
81
81
|
* If the model does not yet exist, it will be created passing in the provided options to initialize it.
|
|
82
82
|
*
|
|
83
83
|
* Singleton models don't require an ID as they will use the model type as their ID to guarantee uniqueness throughout the system.
|
|
84
|
-
|
|
85
|
-
* @category i18n
|
|
84
|
+
|
|
86
85
|
* */
|
|
87
86
|
export declare const TranslationContainer: Readonly<SingletonKosModelRegistrationBean<TranslationContainerModel, TranslationContainerOptions>>;
|
|
88
87
|
//# sourceMappingURL=translation-container-registration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translation-container-registration.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-ui-sdk/src/models/models/translation/translation-container-registration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,eAAe,CAAC;AAEvE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAK/E,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAE3D
|
|
1
|
+
{"version":3,"file":"translation-container-registration.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-ui-sdk/src/models/models/translation/translation-container-registration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,eAAe,CAAC;AAEvE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAK/E,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAgFK;AACL,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CACzC,iCAAiC,CAC/B,yBAAyB,EACzB,2BAA2B,CAC5B,CAcF,CAAC"}
|
|
@@ -6,7 +6,22 @@ export declare const TranslationContext: {
|
|
|
6
6
|
};
|
|
7
7
|
export declare const KosTranslations: {
|
|
8
8
|
init(options: TranslationContainerOptions): Promise<{
|
|
9
|
-
translations:
|
|
9
|
+
translations: {
|
|
10
|
+
id: string;
|
|
11
|
+
lang: string;
|
|
12
|
+
descriptor: import('./services').Localization;
|
|
13
|
+
currentLocale: string;
|
|
14
|
+
readonly defaultNamespace: import('./translation-model').TranslationModelImpl | undefined;
|
|
15
|
+
getModel: (id: string) => import('./translation-model').TranslationModelImpl | undefined;
|
|
16
|
+
readonly models: import('../../../core').IKosModelContainer<import('./translation-model').TranslationModelImpl>;
|
|
17
|
+
readonly data: import('./translation-model').TranslationModelImpl[];
|
|
18
|
+
reload: () => Promise<void>;
|
|
19
|
+
resolveNamespace: (namespace: string) => import('./translation-model').TranslationModelImpl;
|
|
20
|
+
addModel: (model: import('./translation-model').TranslationModelImpl) => void;
|
|
21
|
+
removeModel: (id: string) => void;
|
|
22
|
+
init: () => Promise<void>;
|
|
23
|
+
load: () => Promise<void>;
|
|
24
|
+
};
|
|
10
25
|
}>;
|
|
11
26
|
};
|
|
12
27
|
//# sourceMappingURL=translation-context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translation-context.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-ui-sdk/src/models/models/translation/translation-context.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAE3D,eAAO,MAAM,kBAAkB;cACnB,MAAM,SAAS,GAAG;cAMlB,MAAM;CAIjB,CAAC;AAEF,eAAO,MAAM,eAAe;kBACN,2BAA2B
|
|
1
|
+
{"version":3,"file":"translation-context.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-ui-sdk/src/models/models/translation/translation-context.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAE3D,eAAO,MAAM,kBAAkB;cACnB,MAAM,SAAS,GAAG;cAMlB,MAAM;CAIjB,CAAC;AAEF,eAAO,MAAM,eAAe;kBACN,2BAA2B;;;;;;;;;;;;;;;;;;CAKhD,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { TranslationOptions } from './types';
|
|
2
2
|
import { LocaleDescriptor, TranslationResponse } from './services';
|
|
3
|
-
import { PublicModelInterface } from '../../../core/types';
|
|
4
3
|
import { IKosDataModel, IKosIdentifiable, KosContext, KosCreationContext } from '../../../core';
|
|
5
4
|
|
|
6
5
|
export declare const MODEL_TYPE = "translation-model";
|
|
@@ -13,141 +12,30 @@ interface ResolveTranslationsDataOptions<T = string> extends ResolveTranslationO
|
|
|
13
12
|
}
|
|
14
13
|
type ResolveTranslationsOptionsMap<T = string> = ResolveTranslationOptionsBase<T> & Record<string, string | number | boolean | undefined | null>;
|
|
15
14
|
export type ResolveTranslationOptions<T = string> = ResolveTranslationsDataOptions<T> | ResolveTranslationsOptionsMap<T>;
|
|
16
|
-
|
|
17
|
-
* Translation - Individual namespace translations with automatic locale switching and interpolation.
|
|
18
|
-
*
|
|
19
|
-
* The Translation model provides access to localized text for a specific namespace within a KOS
|
|
20
|
-
* application. It handles locale switching, fallback chains, variable interpolation, and context-aware
|
|
21
|
-
* translations for building truly international device interfaces that adapt to user language preferences
|
|
22
|
-
* automatically.
|
|
23
|
-
*
|
|
24
|
-
* ## Key Features
|
|
25
|
-
* - **Namespace Isolation** - Translations organized by functional area or feature
|
|
26
|
-
* - **Automatic Locale Switching** - React to parent container locale changes
|
|
27
|
-
* - **Fallback Chains** - Graceful degradation through locale hierarchy (pt-BR → pt → es → en)
|
|
28
|
-
* - **Variable Interpolation** - Support for both template (`{{variable}}`) and macro (`__variable__`) substitution
|
|
29
|
-
* - **Context-Aware Keys** - Conditional translations based on context (e.g., `title_edit` vs `title`)
|
|
30
|
-
* - **Real-time Updates** - Automatic UI updates when locale or translations change
|
|
31
|
-
* - **Bundle Resolution** - Custom loading strategies for different deployment scenarios
|
|
32
|
-
*
|
|
33
|
-
* ## Variable Interpolation Patterns
|
|
34
|
-
* The model supports two interpolation patterns for dynamic content:
|
|
35
|
-
* - **Template Variables** (`{{variable}}`) - Context-based substitution passed via options
|
|
36
|
-
* - **Macro Variables** (`__variable__`) - Data-based substitution from nested objects
|
|
37
|
-
*
|
|
38
|
-
* ## Fallback Resolution
|
|
39
|
-
* When translations are missing, the system follows a sophisticated fallback chain:
|
|
40
|
-
* 1. **Current locale** (e.g., `pt-BR`)
|
|
41
|
-
* 2. **Parent locale** (e.g., `pt`)
|
|
42
|
-
* 3. **Fallback locales** (configured per locale, e.g., `es`)
|
|
43
|
-
* 4. **Default locale** (typically `en`)
|
|
44
|
-
* 5. **Provided default value** or raw key
|
|
45
|
-
*
|
|
46
|
-
* ## Common Use Cases
|
|
47
|
-
* - **Feature-Specific UI** - Isolated translations for dashboards, settings, alerts
|
|
48
|
-
* - **Form Validation** - Localized error messages with variable interpolation
|
|
49
|
-
* - **Status Displays** - Dynamic content with device state and user context
|
|
50
|
-
* - **Multi-Language Interfaces** - Complete internationalization for global deployments
|
|
51
|
-
* - **Context-Aware Content** - Mode-specific text (create vs edit, online vs offline)
|
|
52
|
-
* - **Rich Text Support** - Integration with Trans component for formatted content
|
|
53
|
-
*
|
|
54
|
-
* @interface
|
|
55
|
-
* @example Basic Usage
|
|
56
|
-
* ```typescript
|
|
57
|
-
* const statusTranslations = Translation.instance('device-status')
|
|
58
|
-
* .options({
|
|
59
|
-
* namespace: 'device-status',
|
|
60
|
-
* currentLocale: 'es',
|
|
61
|
-
* defaultLocale: 'en',
|
|
62
|
-
* descriptor: {
|
|
63
|
-
* 'es': { fallbacks: ['en'] },
|
|
64
|
-
* 'en': { fallbacks: [] }
|
|
65
|
-
* }
|
|
66
|
-
* })
|
|
67
|
-
* .build();
|
|
68
|
-
*
|
|
69
|
-
* // Resolve localized keys with fallback support
|
|
70
|
-
* const title = statusTranslations.resolveKey('title');
|
|
71
|
-
* ```
|
|
72
|
-
*
|
|
73
|
-
* @group KOS Model
|
|
74
|
-
* @category i18n
|
|
75
|
-
* @useDeclaredType
|
|
76
|
-
*
|
|
77
|
-
* @see {@link TranslationOptions} - Configuration options for Translation instances
|
|
78
|
-
* @see {@link TranslationContainerModel} - Container for managing multiple translation namespaces
|
|
79
|
-
* @see {@link useKosTranslation} - React hook for accessing translations in components
|
|
80
|
-
* @see {@link Trans} - React component for rich text translations with markup
|
|
81
|
-
*/
|
|
82
|
-
export type TranslationModel = PublicModelInterface<TranslationModelImpl>;
|
|
15
|
+
export type TranslationModel = Exclude<TranslationModelImpl, keyof IKosDataModel>;
|
|
83
16
|
export declare const expandMacros: (text: string, data: Record<string, any>) => any;
|
|
84
17
|
export declare const replaceText: (text: string, data: Record<string, any>, context?: Record<string, any>) => any;
|
|
85
18
|
export declare class TranslationModelImpl implements IKosDataModel, IKosIdentifiable {
|
|
86
|
-
/** Unique identifier for the model instance */
|
|
87
19
|
id: string;
|
|
88
|
-
/** Namespace identifier for translation key isolation */
|
|
89
20
|
namespace: string;
|
|
90
|
-
/** Locale descriptor configuration mapping locales to fallback chains */
|
|
91
21
|
descriptor: Record<string, LocaleDescriptor>;
|
|
92
|
-
/** Default locale to use when no translation is found in fallback chain */
|
|
93
22
|
defaultLocale: string;
|
|
94
|
-
/** Currently active locale for translation resolution */
|
|
95
23
|
currentLocale: string;
|
|
96
|
-
/** Custom bundle resolver for loading translation data */
|
|
97
24
|
bundleResolver?: (namespace: string, locale: string, context?: KosContext) => Promise<TranslationResponse>;
|
|
98
|
-
/** Flattened translation data for efficient key lookup */
|
|
99
25
|
private data;
|
|
100
|
-
/** Context logger for debugging and diagnostics */
|
|
101
26
|
private logger;
|
|
102
|
-
/** Path resolver function for translation bundle location */
|
|
103
27
|
private resolver;
|
|
104
|
-
/** Reaction disposer for locale change monitoring */
|
|
105
28
|
private disposer?;
|
|
106
|
-
/** Parent translation container reference for namespace resolution */
|
|
107
29
|
private context;
|
|
108
|
-
/** Base URL for loading translation resources */
|
|
109
30
|
private rootUrl?;
|
|
110
31
|
constructor(modelId: string, options: TranslationOptions, context: KosCreationContext);
|
|
111
|
-
/**
|
|
112
|
-
* Builds the fallback chain for a given locale.
|
|
113
|
-
* @param locale The locale to get translation fallback chain for
|
|
114
|
-
* @returns Array of locales in priority order
|
|
115
|
-
* @private
|
|
116
|
-
*/
|
|
117
32
|
getTranslationLocales(locale: string): string[];
|
|
118
|
-
/**
|
|
119
|
-
* Loads and merges translations for all locales in the fallback chain.
|
|
120
|
-
* @private
|
|
121
|
-
*/
|
|
122
33
|
private loadTranslations;
|
|
123
|
-
/**
|
|
124
|
-
* @internal
|
|
125
|
-
*/
|
|
126
34
|
init(): Promise<void>;
|
|
127
|
-
/**
|
|
128
|
-
* Checks if a translation key exists in the current namespace.
|
|
129
|
-
* @param _key Translation key, optionally with namespace prefix
|
|
130
|
-
* @returns True if the key exists
|
|
131
|
-
*/
|
|
132
35
|
exists(_key: string): any;
|
|
133
|
-
/**
|
|
134
|
-
* Resolves a translation key with optional variable interpolation.
|
|
135
|
-
* @param _key Translation key, optionally with namespace prefix
|
|
136
|
-
* @param options Options for interpolation and fallback
|
|
137
|
-
* @returns Resolved translation string or array
|
|
138
|
-
*/
|
|
139
36
|
resolveKey<T = string>(_key: string, options?: ResolveTranslationOptions<T> | string): any;
|
|
140
|
-
/**
|
|
141
|
-
* @internal
|
|
142
|
-
*/
|
|
143
37
|
unload(): void;
|
|
144
|
-
/**
|
|
145
|
-
* @internal
|
|
146
|
-
*/
|
|
147
38
|
load(): Promise<void>;
|
|
148
|
-
/**
|
|
149
|
-
* @internal
|
|
150
|
-
*/
|
|
151
39
|
ready(): Promise<void>;
|
|
152
40
|
}
|
|
153
41
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translation-model.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-ui-sdk/src/models/models/translation/translation-model.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,UAAU,EAEV,kBAAkB,EACnB,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"translation-model.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-ui-sdk/src/models/models/translation/translation-model.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,UAAU,EAEV,kBAAkB,EACnB,MAAM,eAAe,CAAC;AAQvB,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EAEpB,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,eAAO,MAAM,UAAU,sBAAsB,CAAC;AAC9C,UAAU,6BAA6B,CAAC,CAAC,GAAG,MAAM;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,CAAC,CAAC;CAClB;AAED,UAAU,8BAA8B,CAAC,CAAC,GAAG,MAAM,CACjD,SAAQ,6BAA6B,CAAC,CAAC,CAAC;IACxC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC;CACpC;AAED,KAAK,6BAA6B,CAAC,CAAC,GAAG,MAAM,IAC3C,6BAA6B,CAAC,CAAC,CAAC,GAC9B,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,IAAI,CAAC,CAAC;AACjE,MAAM,MAAM,yBAAyB,CAAC,CAAC,GAAG,MAAM,IAC5C,8BAA8B,CAAC,CAAC,CAAC,GACjC,6BAA6B,CAAC,CAAC,CAAC,CAAC;AACrC,MAAM,MAAM,gBAAgB,GAAG,OAAO,CACpC,oBAAoB,EACpB,MAAM,aAAa,CACpB,CAAC;AAuDF,eAAO,MAAM,YAAY,SAAU,MAAM,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,QAoBnE,CAAC;AAEF,eAAO,MAAM,WAAW,SAChB,MAAM,QACN,OAAO,MAAM,EAAE,GAAG,CAAC,YACf,OAAO,MAAM,EAAE,GAAG,CAAC,QAgB9B,CAAC;AAUF,qBAEa,oBAAqB,YAAW,aAAa,EAAE,gBAAgB;IAC1E,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAElB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC7C,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,CACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,UAAU,KACjB,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAClC,OAAO,CAAC,IAAI,CAAsB;IAClC,OAAO,CAAC,MAAM,CAAmB;IACjC,OAAO,CAAC,QAAQ,CAAgD;IAChE,OAAO,CAAC,QAAQ,CAAC,CAAoB;IACrC,OAAO,CAAC,OAAO,CAA4B;IAC3C,OAAO,CAAC,OAAO,CAAC,CAAS;gBAEvB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,kBAAkB,EAC3B,OAAO,EAAE,kBAAkB;IAqB7B,qBAAqB,CAAC,MAAM,EAAE,MAAM;YAetB,gBAAgB;IAoCxB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3B,MAAM,CAAC,IAAI,EAAE,MAAM;IAYnB,UAAU,CAAC,CAAC,GAAG,MAAM,EACnB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,yBAAyB,CAAC,CAAC,CAAC,GAAG,MAAM;IAmCjD,MAAM,IAAI,IAAI;IAOR,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAKrB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAY7B"}
|