@kosdev-code/kos-ui-sdk 2.0.41 → 2.1.1
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/core/core/decorators/index.d.ts +4 -0
- package/core/core/decorators/index.d.ts.map +1 -1
- package/core/core/decorators/kos-companion.d.ts +125 -8
- package/core/core/decorators/kos-companion.d.ts.map +1 -1
- package/core/core/decorators/kos-container-aware.d.ts +465 -0
- package/core/core/decorators/kos-container-aware.d.ts.map +1 -0
- package/core/core/decorators/kos-future-aware.d.ts +150 -0
- package/core/core/decorators/kos-future-aware.d.ts.map +1 -0
- package/core/core/decorators/kos-logger-aware.d.ts +96 -0
- package/core/core/decorators/kos-logger-aware.d.ts.map +1 -0
- package/core/core/decorators/kos-trouble-aware.d.ts +71 -0
- package/core/core/decorators/kos-trouble-aware.d.ts.map +1 -0
- package/core/core/decorators/kosModel.d.ts +8 -2
- package/core/core/decorators/kosModel.d.ts.map +1 -1
- package/core/core/decorators/kosTopicHandler.d.ts.map +1 -1
- package/core/core/decorators/propKeys.d.ts +4 -0
- package/core/core/decorators/propKeys.d.ts.map +1 -1
- package/core/core/extension/extension-manager.d.ts +1 -1
- package/core/core/extension/extension-manager.d.ts.map +1 -1
- package/core/core/kosCore.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/index.d.ts +1 -1
- package/core/index.d.ts.map +1 -1
- package/core/util/container-utils.d.ts +3 -2
- package/core/util/container-utils.d.ts.map +1 -1
- package/core/util/observable-proxy-map.d.ts.map +1 -1
- package/index.cjs +79 -76
- package/index.cjs.map +1 -1
- package/index.d.cts +1 -0
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +9672 -7760
- package/index.js.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 +25 -1
- 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 +33 -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 +293 -17
- 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 +41 -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 +186 -7
- 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 +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 +56 -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 +1 -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 +187 -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 +80 -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 +129 -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 +77 -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 +21 -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 +146 -0
- package/models/models/region-info/region-info-model.d.ts +7 -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.map +1 -1
- package/models/models/region-info/types/index.d.ts +141 -13
- package/models/models/region-info/types/index.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 +48 -16
- 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 +114 -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 +55 -7
- 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 +112 -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 +340 -0
- package/models/models/trouble/services/trouble-services.d.ts +3 -3
- package/models/models/trouble/services/trouble-services.d.ts.map +1 -1
- package/models/models/trouble/trouble-model.d.ts +2 -1
- package/models/models/trouble/trouble-model.d.ts.map +1 -1
- package/models/models/trouble/types/index.d.ts +22 -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 +9 -5
- package/models/models/trouble-container/trouble-container-model.d.ts.map +1 -1
- package/models/models/trouble-container/types/index.d.ts +2 -15
- package/models/utils/client.d.ts +8 -8
- package/models/utils/core-registration-manager.d.ts +1 -1
- package/models/utils/core-registration-manager.d.ts.map +1 -1
- package/models/utils/index.d.ts +0 -2
- package/models/utils/index.d.ts.map +1 -1
- package/models/utils/service.d.ts +9 -9
- package/package.json +2 -2
- package/ui/contexts/state-bean/state-bean-provider.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/translation-container/use-translation-container.d.ts +4 -33
- package/ui/hooks/translation-container/use-translation-container.d.ts.map +1 -1
- 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
|
@@ -5,13 +5,146 @@ import { KosContext, KosParentAware } from '../../../../core';
|
|
|
5
5
|
|
|
6
6
|
// --------------- Translation ---------------
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Configuration options for Translation model instances.
|
|
10
|
+
*
|
|
11
|
+
* This interface defines the complete configuration structure for individual translation
|
|
12
|
+
* namespace models, including locale settings, resolution strategies, and custom loading
|
|
13
|
+
* mechanisms. Translation models handle the actual key resolution and interpolation for
|
|
14
|
+
* specific functional areas within KOS applications.
|
|
15
|
+
*
|
|
16
|
+
* @example Basic Translation Configuration
|
|
17
|
+
* ```typescript
|
|
18
|
+
* // Device status translations with English fallback
|
|
19
|
+
* const statusOptions: TranslationOptions = {
|
|
20
|
+
* namespace: 'device-status',
|
|
21
|
+
* currentLocale: 'es',
|
|
22
|
+
* defaultLocale: 'en',
|
|
23
|
+
* descriptor: {
|
|
24
|
+
* 'es': {
|
|
25
|
+
* fallbacks: ['en']
|
|
26
|
+
* },
|
|
27
|
+
* 'en': {
|
|
28
|
+
* fallbacks: []
|
|
29
|
+
* }
|
|
30
|
+
* },
|
|
31
|
+
* kosParentId: 'translation-container'
|
|
32
|
+
* };
|
|
33
|
+
*
|
|
34
|
+
* const statusTranslation = Translation.instance('status-translations')
|
|
35
|
+
* .options(statusOptions)
|
|
36
|
+
* .build();
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @example Custom Bundle Resolution
|
|
40
|
+
* ```typescript
|
|
41
|
+
* // API-based translation loading
|
|
42
|
+
* const apiBundleResolver = async (
|
|
43
|
+
* namespace: string,
|
|
44
|
+
* locale: string,
|
|
45
|
+
* context?: KosContext
|
|
46
|
+
* ): Promise<TranslationResponse> => {
|
|
47
|
+
* const response = await fetch(`/api/translations/${namespace}/${locale}`);
|
|
48
|
+
* return await response.json();
|
|
49
|
+
* };
|
|
50
|
+
*
|
|
51
|
+
* const apiOptions: TranslationOptions = {
|
|
52
|
+
* namespace: 'alerts',
|
|
53
|
+
* currentLocale: 'fr',
|
|
54
|
+
* defaultLocale: 'en',
|
|
55
|
+
* descriptor: {
|
|
56
|
+
* 'fr': { fallbacks: ['en'] },
|
|
57
|
+
* 'en': { fallbacks: [] }
|
|
58
|
+
* },
|
|
59
|
+
* bundleResolver: apiBundleResolver,
|
|
60
|
+
* kosParentId: 'translation-container'
|
|
61
|
+
* };
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* @example Multi-Regional Configuration
|
|
65
|
+
* ```typescript
|
|
66
|
+
* // Complex fallback chains for regional variations
|
|
67
|
+
* const regionalOptions: TranslationOptions = {
|
|
68
|
+
* namespace: 'regional-ui',
|
|
69
|
+
* currentLocale: 'pt-BR',
|
|
70
|
+
* defaultLocale: 'en',
|
|
71
|
+
* descriptor: {
|
|
72
|
+
* 'pt-BR': { fallbacks: ['pt', 'es', 'en'] },
|
|
73
|
+
* 'pt-PT': { fallbacks: ['pt', 'es', 'en'] },
|
|
74
|
+
* 'pt': { fallbacks: ['es', 'en'] },
|
|
75
|
+
* 'es': { fallbacks: ['en'] },
|
|
76
|
+
* 'en': { fallbacks: [] }
|
|
77
|
+
* },
|
|
78
|
+
* kosParentId: 'translation-container'
|
|
79
|
+
* };
|
|
80
|
+
* ```
|
|
81
|
+
*
|
|
82
|
+
* @group KOS Model
|
|
83
|
+
* @category i18n
|
|
84
|
+
*/
|
|
8
85
|
export interface TranslationOptions extends KosParentAware {
|
|
86
|
+
/**
|
|
87
|
+
* Translation namespace identifier, typically corresponding to a feature area.
|
|
88
|
+
* Used to organize translations by functional domain and prevent key conflicts.
|
|
89
|
+
*
|
|
90
|
+
* @example "device-status"
|
|
91
|
+
* @example "user-settings"
|
|
92
|
+
* @example "maintenance-scheduler"
|
|
93
|
+
*/
|
|
9
94
|
namespace: string;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Current active locale for this translation model.
|
|
98
|
+
* Determines which language variant to load and display.
|
|
99
|
+
*
|
|
100
|
+
* @example "en" - English
|
|
101
|
+
* @example "es" - Spanish
|
|
102
|
+
* @example "pt-BR" - Brazilian Portuguese
|
|
103
|
+
*/
|
|
10
104
|
currentLocale: string;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Default fallback locale when translations are missing in the current locale.
|
|
108
|
+
* Typically set to the primary application language.
|
|
109
|
+
*
|
|
110
|
+
* @default "en"
|
|
111
|
+
*/
|
|
11
112
|
defaultLocale: string;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Optional base URL for translation file loading.
|
|
116
|
+
* Used with default file-based resolution strategy.
|
|
117
|
+
*
|
|
118
|
+
* @example "/assets/locales"
|
|
119
|
+
* @example "https://cdn.example.com/translations"
|
|
120
|
+
*/
|
|
12
121
|
rootUrl?: string;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Locale descriptors defining fallback chains and configuration for each locale.
|
|
125
|
+
* Maps locale codes to their fallback hierarchy and metadata.
|
|
126
|
+
*/
|
|
13
127
|
descriptor: Record<string, LocaleDescriptor>;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Optional custom path resolver for translation file loading.
|
|
131
|
+
* Overrides default path construction logic.
|
|
132
|
+
*
|
|
133
|
+
* @param namespace - Target translation namespace
|
|
134
|
+
* @param locale - Target locale code
|
|
135
|
+
* @returns Full path to translation resource
|
|
136
|
+
*/
|
|
14
137
|
resolver?: (namespace: string, locale: string) => string;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Optional custom bundle resolver for advanced translation loading strategies.
|
|
141
|
+
* Enables loading from APIs, device storage, or custom sources.
|
|
142
|
+
*
|
|
143
|
+
* @param namespace - Target translation namespace
|
|
144
|
+
* @param locale - Target locale code
|
|
145
|
+
* @param context - KOS context for accessing shared data
|
|
146
|
+
* @returns Promise resolving to translation data
|
|
147
|
+
*/
|
|
15
148
|
bundleResolver?: (
|
|
16
149
|
namespace: string,
|
|
17
150
|
locale: string,
|
|
@@ -20,12 +153,159 @@ export interface TranslationOptions extends KosParentAware {
|
|
|
20
153
|
}
|
|
21
154
|
|
|
22
155
|
// --------------- TranslationContainer ---------------
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Configuration options for TranslationContainer model instances.
|
|
159
|
+
*
|
|
160
|
+
* This interface defines the configuration structure for translation container models,
|
|
161
|
+
* which manage multiple translation namespaces and coordinate global locale switching.
|
|
162
|
+
* Containers serve as the central orchestration point for internationalization in KOS
|
|
163
|
+
* applications.
|
|
164
|
+
*
|
|
165
|
+
* @example Basic Container Configuration
|
|
166
|
+
* ```typescript
|
|
167
|
+
* // Multi-namespace application translations
|
|
168
|
+
* const containerOptions: TranslationContainerOptions = {
|
|
169
|
+
* lang: 'es',
|
|
170
|
+
* defaultNamespace: 'common',
|
|
171
|
+
* descriptor: {
|
|
172
|
+
* namespaces: {
|
|
173
|
+
* 'common': {
|
|
174
|
+
* basePath: '/assets/locales',
|
|
175
|
+
* locales: {
|
|
176
|
+
* 'en': { file: 'en/common.json', defaultLocale: 'en' },
|
|
177
|
+
* 'es': { file: 'es/common.json', defaultLocale: 'en' },
|
|
178
|
+
* 'fr': { file: 'fr/common.json', defaultLocale: 'en' }
|
|
179
|
+
* }
|
|
180
|
+
* },
|
|
181
|
+
* 'dashboard': {
|
|
182
|
+
* basePath: '/assets/locales',
|
|
183
|
+
* locales: {
|
|
184
|
+
* 'en': { file: 'en/dashboard.json', defaultLocale: 'en' },
|
|
185
|
+
* 'es': { file: 'es/dashboard.json', defaultLocale: 'en' },
|
|
186
|
+
* 'fr': { file: 'fr/dashboard.json', defaultLocale: 'en' }
|
|
187
|
+
* }
|
|
188
|
+
* }
|
|
189
|
+
* }
|
|
190
|
+
* }
|
|
191
|
+
* };
|
|
192
|
+
*
|
|
193
|
+
* const appTranslations = TranslationContainer.instance('app-i18n')
|
|
194
|
+
* .options(containerOptions)
|
|
195
|
+
* .build();
|
|
196
|
+
* ```
|
|
197
|
+
*
|
|
198
|
+
* @example CDN-Based Translation Loading
|
|
199
|
+
* ```typescript
|
|
200
|
+
* // Custom resolver for CDN-hosted translations
|
|
201
|
+
* const cdnResolver = function(
|
|
202
|
+
* namespace: string,
|
|
203
|
+
* locale: string
|
|
204
|
+
* ): string {
|
|
205
|
+
* return `https://cdn.example.com/translations/${namespace}/${locale}.json`;
|
|
206
|
+
* };
|
|
207
|
+
*
|
|
208
|
+
* const cdnOptions: TranslationContainerOptions = {
|
|
209
|
+
* lang: 'ja',
|
|
210
|
+
* resolver: cdnResolver,
|
|
211
|
+
* descriptor: {
|
|
212
|
+
* namespaces: {
|
|
213
|
+
* 'device-control': {
|
|
214
|
+
* basePath: '', // Ignored with custom resolver
|
|
215
|
+
* locales: {
|
|
216
|
+
* 'ja': { file: '', defaultLocale: 'en' },
|
|
217
|
+
* 'en': { file: '', defaultLocale: 'en' }
|
|
218
|
+
* }
|
|
219
|
+
* }
|
|
220
|
+
* }
|
|
221
|
+
* }
|
|
222
|
+
* };
|
|
223
|
+
* ```
|
|
224
|
+
*
|
|
225
|
+
* @example Development Environment Setup
|
|
226
|
+
* ```typescript
|
|
227
|
+
* // Hot-reload friendly configuration for development
|
|
228
|
+
* const devOptions: TranslationContainerOptions = {
|
|
229
|
+
* lang: 'en',
|
|
230
|
+
* rootUrl: '/dev-translations',
|
|
231
|
+
* descriptor: {
|
|
232
|
+
* namespaces: {
|
|
233
|
+
* 'ui': {
|
|
234
|
+
* basePath: '/ui-translations',
|
|
235
|
+
* locales: {
|
|
236
|
+
* 'en': { file: 'en/ui.json', defaultLocale: 'en' },
|
|
237
|
+
* 'es': { file: 'es/ui.json', defaultLocale: 'en' }
|
|
238
|
+
* }
|
|
239
|
+
* },
|
|
240
|
+
* 'forms': {
|
|
241
|
+
* basePath: '/form-translations',
|
|
242
|
+
* locales: {
|
|
243
|
+
* 'en': { file: 'en/forms.json', defaultLocale: 'en' },
|
|
244
|
+
* 'es': { file: 'es/forms.json', defaultLocale: 'en' }
|
|
245
|
+
* }
|
|
246
|
+
* }
|
|
247
|
+
* }
|
|
248
|
+
* }
|
|
249
|
+
* };
|
|
250
|
+
* ```
|
|
251
|
+
*
|
|
252
|
+
* @group KOS Model
|
|
253
|
+
* @category i18n
|
|
254
|
+
*/
|
|
23
255
|
export interface TranslationContainerOptions {
|
|
256
|
+
/**
|
|
257
|
+
* Current application-wide locale setting.
|
|
258
|
+
* Applied to all child translation models when they are created or updated.
|
|
259
|
+
*
|
|
260
|
+
* @example "en" - English
|
|
261
|
+
* @example "es" - Spanish
|
|
262
|
+
* @example "pt-BR" - Brazilian Portuguese
|
|
263
|
+
*/
|
|
24
264
|
lang: string;
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Comprehensive locale and namespace descriptor defining the complete
|
|
268
|
+
* translation structure for the application.
|
|
269
|
+
*/
|
|
25
270
|
descriptor: Localization;
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Optional default namespace for application-wide common translations.
|
|
274
|
+
* When specified, provides easy access to shared UI elements and messages.
|
|
275
|
+
*
|
|
276
|
+
* @example "common"
|
|
277
|
+
* @example "shared"
|
|
278
|
+
* @example "ui-elements"
|
|
279
|
+
*/
|
|
26
280
|
defaultNamespace?: string;
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Optional base URL for all translation file loading.
|
|
284
|
+
* Applied as prefix to all translation resource paths.
|
|
285
|
+
*
|
|
286
|
+
* @example "/assets/locales"
|
|
287
|
+
* @example "https://cdn.example.com/app-translations"
|
|
288
|
+
* @example "/tenant-specific/translations"
|
|
289
|
+
*/
|
|
27
290
|
rootUrl?: string;
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Optional URL for loading translation descriptor dynamically.
|
|
294
|
+
* Enables runtime configuration of translation structure.
|
|
295
|
+
*
|
|
296
|
+
* @example "/api/translations/descriptor"
|
|
297
|
+
* @example "https://config.example.com/translation-manifest.json"
|
|
298
|
+
*/
|
|
28
299
|
descriptorUrl?: string;
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Optional custom resolver for translation file path construction.
|
|
303
|
+
* Overrides default path resolution logic for all namespaces.
|
|
304
|
+
*
|
|
305
|
+
* @param namespace - Target translation namespace
|
|
306
|
+
* @param locale - Target locale code
|
|
307
|
+
* @returns Full path to translation resource
|
|
308
|
+
*/
|
|
29
309
|
resolver?: (
|
|
30
310
|
this: TranslationContainerModel,
|
|
31
311
|
namespace: string,
|
|
@@ -33,6 +313,66 @@ export interface TranslationContainerOptions {
|
|
|
33
313
|
) => string;
|
|
34
314
|
}
|
|
35
315
|
|
|
316
|
+
/**
|
|
317
|
+
* Type definitions for variable interpolation in translation keys.
|
|
318
|
+
*
|
|
319
|
+
* Translation models support sophisticated variable substitution patterns
|
|
320
|
+
* for dynamic content in internationalized applications.
|
|
321
|
+
*
|
|
322
|
+
* @group KOS Model
|
|
323
|
+
* @category Internationalization
|
|
324
|
+
*/
|
|
325
|
+
export type ResolveTranslationOptions<T = string> =
|
|
326
|
+
| {
|
|
327
|
+
/**
|
|
328
|
+
* Context variables for template-based interpolation using {{variable}} syntax.
|
|
329
|
+
*
|
|
330
|
+
* @example
|
|
331
|
+
* ```typescript
|
|
332
|
+
* t('welcome.message', {
|
|
333
|
+
* context: { username: 'John', unreadCount: 5 }
|
|
334
|
+
* })
|
|
335
|
+
* // "Welcome {{username}}, you have {{unreadCount}} messages"
|
|
336
|
+
* // Result: "Welcome John, you have 5 messages"
|
|
337
|
+
* ```
|
|
338
|
+
*/
|
|
339
|
+
context?: Record<string, any>;
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* Data variables for macro-based interpolation using __variable__ syntax.
|
|
343
|
+
*
|
|
344
|
+
* @example
|
|
345
|
+
* ```typescript
|
|
346
|
+
* t('system.info', {
|
|
347
|
+
* data: { version: '2.1.0', platform: 'Linux' }
|
|
348
|
+
* })
|
|
349
|
+
* // "System __version__ running on __platform__"
|
|
350
|
+
* // Result: "System 2.1.0 running on Linux"
|
|
351
|
+
* ```
|
|
352
|
+
*/
|
|
353
|
+
data?: Record<string, any>;
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Contextual modifier for conditional key resolution.
|
|
357
|
+
* Enables different translations based on application state.
|
|
358
|
+
*
|
|
359
|
+
* @example
|
|
360
|
+
* ```typescript
|
|
361
|
+
* // Translation file: { "title": "Create", "title_edit": "Update" }
|
|
362
|
+
* t('title', { context: 'edit' })
|
|
363
|
+
* // Resolves to "title_edit" key, returns "Update"
|
|
364
|
+
* ```
|
|
365
|
+
*/
|
|
366
|
+
context?: string;
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* Fallback value when translation key is not found.
|
|
370
|
+
* Ensures graceful degradation for missing translations.
|
|
371
|
+
*/
|
|
372
|
+
defaultValue?: T;
|
|
373
|
+
}
|
|
374
|
+
| string;
|
|
375
|
+
|
|
36
376
|
declare global {
|
|
37
377
|
interface AbstractModelFactory {
|
|
38
378
|
createTranslation: (id: string, options: TranslationOptions) => Translation;
|
|
@@ -17,7 +17,7 @@ export interface TroubleResponse {
|
|
|
17
17
|
* @internal
|
|
18
18
|
* Retrieves the initial Trouble data.
|
|
19
19
|
*/
|
|
20
|
-
export declare const getTroubles: () => Promise<KosServiceResponse<TroubleResponse[]> | undefined>;
|
|
21
|
-
export declare const resolveTrouble: (troubleId: string, tracker?: string) => Promise<FutureResponse>;
|
|
22
|
-
export declare const bulkResolveTroubles: (troubleIds: string[], tracker?: string) => Promise<FutureResponse>;
|
|
20
|
+
export declare const getTroubles: (servicePath: string) => Promise<KosServiceResponse<TroubleResponse[]> | undefined>;
|
|
21
|
+
export declare const resolveTrouble: (troubleId: string, servicePath?: string, tracker?: string) => Promise<FutureResponse>;
|
|
22
|
+
export declare const bulkResolveTroubles: (troubleIds: string[], servicePath?: string, tracker?: string) => Promise<FutureResponse>;
|
|
23
23
|
//# sourceMappingURL=trouble-services.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trouble-services.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/sdk/kos-ui-sdk/src/models/models/trouble/services/trouble-services.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACL,kBAAkB,EAGnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAkB,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAO1E,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,GAAG,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,IAAI,EAAE,GAAG,CAAC;CACX;AACD;;;;GAIG;AACH,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"trouble-services.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/sdk/kos-ui-sdk/src/models/models/trouble/services/trouble-services.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACL,kBAAkB,EAGnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAkB,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAO1E,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,GAAG,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,IAAI,EAAE,GAAG,CAAC;CACX;AACD;;;;GAIG;AACH,eAAO,MAAM,WAAW,gBAAuB,MAAM,+DAKpD,CAAC;AAEF,eAAO,MAAM,cAAc,cACd,MAAM,kCAEP,MAAM,4BAsBjB,CAAC;AAEF,eAAO,MAAM,mBAAmB,eAClB,MAAM,EAAE,kCAEV,MAAM,4BAuBjB,CAAC"}
|
|
@@ -18,10 +18,11 @@ export declare class TroubleModelImpl<AdditionalData extends object = any> imple
|
|
|
18
18
|
tags: string[];
|
|
19
19
|
data: AdditionalData;
|
|
20
20
|
rank: number;
|
|
21
|
+
servicePath: string;
|
|
21
22
|
group?: string;
|
|
22
23
|
createTime?: string;
|
|
23
24
|
private _mapped;
|
|
24
|
-
constructor(modelId: string, { resolvable, tags, info, id, clientData, rank, ifaces, type, group, createTime, role, color, ...rest }: TroubleOptions, context: KosCreationContext);
|
|
25
|
+
constructor(modelId: string, { resolvable, tags, info, id, clientData, rank, ifaces, type, group, createTime, role, color, servicePath, ...rest }: TroubleOptions, context: KosCreationContext);
|
|
25
26
|
getTitleWithContext(context: string): string;
|
|
26
27
|
getSubtitleWithContext(context: string): string;
|
|
27
28
|
get rawId(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trouble-model.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-ui-sdk/src/models/models/trouble/trouble-model.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACxB,MAAM,eAAe,CAAC;AAGvB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAInE,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAExE,eAAO,MAAM,UAAU,kBAAkB,CAAC;AAM1C,qBACa,gBAAgB,CAAC,cAAc,SAAS,MAAM,GAAG,GAAG,CAC/D,YAAW,YAAY,CAAC,cAAc,CAAC,EAAE,eAAe;IAExD,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,gBAAgB,CAAC;IACzB,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,WAAW,CAAU;IAE7B,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,oBAAoB,CAAC;IACpC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,IAAI,EAAE,cAAc,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"trouble-model.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-ui-sdk/src/models/models/trouble/trouble-model.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACxB,MAAM,eAAe,CAAC;AAGvB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAInE,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAExE,eAAO,MAAM,UAAU,kBAAkB,CAAC;AAM1C,qBACa,gBAAgB,CAAC,cAAc,SAAS,MAAM,GAAG,GAAG,CAC/D,YAAW,YAAY,CAAC,cAAc,CAAC,EAAE,eAAe;IAExD,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,gBAAgB,CAAC;IACzB,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,WAAW,CAAU;IAE7B,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,oBAAoB,CAAC;IACpC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,IAAI,EAAE,cAAc,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,OAAO,CAAwB;gBAErC,OAAO,EAAE,MAAM,EACf,EACE,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,EAAE,EACF,UAAU,EACV,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,UAAU,EACV,IAAI,EACJ,KAAK,EACL,WAAW,EACX,GAAG,IAAI,EACR,EAAE,cAAc,EACjB,OAAO,EAAE,kBAAkB;IAyB7B,mBAAmB,CAAC,OAAO,EAAE,MAAM;IAWnC,sBAAsB,CAAC,OAAO,EAAE,MAAM;IAWtC,IAAI,KAAK,WAER;IACD,IAAI,KAAK,WAER;IAED,IAAI,QAAQ,WAEX;IAED,IAAI,SAAS,WAEZ;IAED,IAAI,UAAU,YAEb;IAED,IAAI,MAAM,uFAET;IAEK,iBAAiB;IAIvB,IAAI,iBAAiB,qEAMpB;IACD,IAAI,QAAQ,YAKX;IACD,IAAI,WAAW,IAAI,OAAO,CAMzB;IAED,UAAU;IAGV,KAAK;IAIL,WAAW;IAML,OAAO,CAAC,OAAO,CAAC,EAAE,MAAM;CAc/B"}
|
|
@@ -28,8 +28,8 @@ import { IKosDataModel } from '../../../core';
|
|
|
28
28
|
* };
|
|
29
29
|
* ```
|
|
30
30
|
*
|
|
31
|
-
* @
|
|
32
|
-
* @
|
|
31
|
+
* @group KOS Model
|
|
32
|
+
* @category Types
|
|
33
33
|
*/
|
|
34
34
|
export interface TroubleOptions<AdditionalData extends object = any> {
|
|
35
35
|
/** Whether this trouble can be resolved through user action */
|
|
@@ -58,6 +58,8 @@ export interface TroubleOptions<AdditionalData extends object = any> {
|
|
|
58
58
|
info: unknown;
|
|
59
59
|
/** Optional grouping identifier for related troubles */
|
|
60
60
|
group?: string;
|
|
61
|
+
/** Service path for the trouble instance */
|
|
62
|
+
servicePath?: string;
|
|
61
63
|
/** Index signature for additional domain-specific data */
|
|
62
64
|
[key: keyof AdditionalData]: AdditionalData[key];
|
|
63
65
|
}
|
|
@@ -80,96 +82,23 @@ export interface TroubleOptions<AdditionalData extends object = any> {
|
|
|
80
82
|
*
|
|
81
83
|
* @template AdditionalData - Type parameter for domain-specific trouble data
|
|
82
84
|
*
|
|
83
|
-
* @
|
|
85
|
+
* @interface
|
|
86
|
+
* @example Basic Usage
|
|
84
87
|
* ```typescript
|
|
85
|
-
* // Check trouble severity
|
|
86
88
|
* function handleTrouble(trouble: TroubleModel) {
|
|
87
89
|
* if (trouble.rank >= 8) {
|
|
88
90
|
* console.error(`Critical trouble: ${trouble.reason}`);
|
|
89
|
-
* notifyOperator(trouble);
|
|
90
|
-
* } else if (trouble.rank >= 5) {
|
|
91
|
-
* console.warn(`Warning: ${trouble.reason}`);
|
|
92
|
-
* }
|
|
93
|
-
*
|
|
94
|
-
* // Check if user can resolve
|
|
95
|
-
* if (trouble.resolvable && hasRole(trouble.role)) {
|
|
96
|
-
* showResolveButton(trouble);
|
|
97
|
-
* }
|
|
98
|
-
* }
|
|
99
|
-
* ```
|
|
100
|
-
*
|
|
101
|
-
* @example
|
|
102
|
-
* ```typescript
|
|
103
|
-
* // Resolve a trouble with proper future handling
|
|
104
|
-
* async function resolveTrouble(trouble: TroubleModel) {
|
|
105
|
-
* if (!trouble.resolvable) {
|
|
106
|
-
* throw new Error('Trouble is not resolvable');
|
|
107
91
|
* }
|
|
108
92
|
*
|
|
109
|
-
*
|
|
110
|
-
* // Resolution returns a FutureResponse with future tracking
|
|
93
|
+
* if (trouble.resolvable) {
|
|
111
94
|
* const futureResponse = await trouble.resolve();
|
|
112
|
-
* if (futureResponse) {
|
|
113
|
-
* console.log(`Resolution started, future ID: ${futureResponse.id}`);
|
|
114
|
-
*
|
|
115
|
-
* // The trouble's future property will be updated with the resolution future
|
|
116
|
-
* // You can track progress through the future model
|
|
117
|
-
* if (trouble.future) {
|
|
118
|
-
* const endState = await trouble.future.waitForCompletion();
|
|
119
|
-
* if (endState === 'COMPLETED') {
|
|
120
|
-
* console.log('Trouble resolved successfully');
|
|
121
|
-
* } else if (endState === 'FAILED') {
|
|
122
|
-
* console.error('Resolution failed');
|
|
123
|
-
* }
|
|
124
|
-
* }
|
|
125
|
-
* }
|
|
126
|
-
* } catch (error) {
|
|
127
|
-
* console.error('Failed to initiate resolution:', error);
|
|
128
|
-
* }
|
|
129
|
-
* }
|
|
130
|
-
* ```
|
|
131
|
-
*
|
|
132
|
-
* @example
|
|
133
|
-
* ```typescript
|
|
134
|
-
* // Using cancellable promise utilities with trouble resolution
|
|
135
|
-
* import { createCancellablePromise } from '@kosdev-code/kos-ui-sdk';
|
|
136
|
-
*
|
|
137
|
-
* async function resolveTroubleWithCancel(trouble: TroubleModel) {
|
|
138
|
-
* const futureResponse = await trouble.resolve();
|
|
139
|
-
*
|
|
140
|
-
* if (futureResponse && trouble.future) {
|
|
141
|
-
* // Create a cancellable promise for the resolution
|
|
142
|
-
* const cancellableResolve = createCancellablePromise(
|
|
143
|
-
* trouble.future.waitForCompletion(),
|
|
144
|
-
* undefined,
|
|
145
|
-
* () => trouble.future?.cancelFuture(),
|
|
146
|
-
* trouble.future
|
|
147
|
-
* );
|
|
148
|
-
*
|
|
149
|
-
* // Subscribe to progress updates
|
|
150
|
-
* const unsubscribe = cancellableResolve.onProgressUpdate((progress, status) => {
|
|
151
|
-
* console.log(`Resolution progress: ${(progress * 100).toFixed(0)}% - ${status}`);
|
|
152
|
-
* });
|
|
153
|
-
*
|
|
154
|
-
* try {
|
|
155
|
-
* const endState = await cancellableResolve;
|
|
156
|
-
* console.log(`Resolution completed with state: ${endState}`);
|
|
157
|
-
* } catch (error) {
|
|
158
|
-
* if (cancellableResolve.isCancelled()) {
|
|
159
|
-
* console.log('Resolution was cancelled');
|
|
160
|
-
* } else {
|
|
161
|
-
* console.error('Resolution failed:', error);
|
|
162
|
-
* }
|
|
163
|
-
* } finally {
|
|
164
|
-
* unsubscribe();
|
|
165
|
-
* }
|
|
166
95
|
* }
|
|
167
96
|
* }
|
|
168
97
|
* ```
|
|
169
98
|
*
|
|
170
|
-
*
|
|
171
|
-
* @
|
|
172
|
-
* @
|
|
99
|
+
* @useDeclaredType
|
|
100
|
+
* @group KOS Model
|
|
101
|
+
* @category Trouble Management
|
|
173
102
|
*
|
|
174
103
|
* @see {@link TroubleAware} - Interface for models that can have troubles
|
|
175
104
|
* @see {@link DeferAware} - Deferral capabilities
|
|
@@ -220,8 +149,8 @@ export interface TroubleModel<AdditionalData extends object = any>
|
|
|
220
149
|
/**
|
|
221
150
|
* Domain-specific trouble data for handle-related issues.
|
|
222
151
|
*
|
|
223
|
-
* @
|
|
224
|
-
* @
|
|
152
|
+
* @group KOS Model
|
|
153
|
+
* @category Domain Data
|
|
225
154
|
*/
|
|
226
155
|
export interface HandleTroubleData {
|
|
227
156
|
/** Path to the affected handle component */
|
|
@@ -231,8 +160,8 @@ export interface HandleTroubleData {
|
|
|
231
160
|
/**
|
|
232
161
|
* Domain-specific trouble data for nozzle-related issues.
|
|
233
162
|
*
|
|
234
|
-
* @
|
|
235
|
-
* @
|
|
163
|
+
* @group KOS Model
|
|
164
|
+
* @category Domain Data
|
|
236
165
|
*/
|
|
237
166
|
export interface NozzleTroubleData {
|
|
238
167
|
/** Path to the affected nozzle component */
|
|
@@ -242,8 +171,8 @@ export interface NozzleTroubleData {
|
|
|
242
171
|
/**
|
|
243
172
|
* Domain-specific trouble data for container-related issues.
|
|
244
173
|
*
|
|
245
|
-
* @
|
|
246
|
-
* @
|
|
174
|
+
* @group KOS Model
|
|
175
|
+
* @category Domain Data
|
|
247
176
|
*/
|
|
248
177
|
export interface ContainerTroubleData {
|
|
249
178
|
/** Identifier of the affected container */
|
|
@@ -270,8 +199,8 @@ export interface ContainerTroubleData {
|
|
|
270
199
|
* }
|
|
271
200
|
* ```
|
|
272
201
|
*
|
|
273
|
-
* @
|
|
274
|
-
* @
|
|
202
|
+
* @group KOS Model
|
|
203
|
+
* @category Capabilities
|
|
275
204
|
*/
|
|
276
205
|
export interface ResolveAware {
|
|
277
206
|
/**
|
|
@@ -314,8 +243,8 @@ export interface ResolveAware {
|
|
|
314
243
|
* }
|
|
315
244
|
* ```
|
|
316
245
|
*
|
|
317
|
-
* @
|
|
318
|
-
* @
|
|
246
|
+
* @group KOS Model
|
|
247
|
+
* @category Capabilities
|
|
319
248
|
*/
|
|
320
249
|
export interface DeferAware {
|
|
321
250
|
/** Whether this item should be deferred based on current conditions */
|
|
@@ -410,8 +339,8 @@ export interface DeferAware {
|
|
|
410
339
|
* }
|
|
411
340
|
* ```
|
|
412
341
|
*
|
|
413
|
-
* @
|
|
414
|
-
* @
|
|
342
|
+
* @group KOS Model
|
|
343
|
+
* @category Interfaces
|
|
415
344
|
*
|
|
416
345
|
* @see {@link TroubleModel} - The trouble model interface
|
|
417
346
|
* @see {@link isTroubleAware} - Type guard for checking TroubleAware
|
|
@@ -9,7 +9,7 @@ import { TroubleAware } from '../types';
|
|
|
9
9
|
* object, which are required by the TroubleAware interface.
|
|
10
10
|
*
|
|
11
11
|
* @category Utilities
|
|
12
|
-
* @
|
|
12
|
+
* @category Trouble Management
|
|
13
13
|
*
|
|
14
14
|
* @param obj - The object to check for trouble awareness. Can be any type.
|
|
15
15
|
*
|
|
@@ -94,5 +94,5 @@ import { TroubleAware } from '../types';
|
|
|
94
94
|
* @see {@link TroubleAware} - The interface this function checks for
|
|
95
95
|
* @see {@link useTroubleDecoration} - Hook that uses this guard internally
|
|
96
96
|
*/
|
|
97
|
-
export declare function isTroubleAware(obj
|
|
97
|
+
export declare function isTroubleAware(obj?: any): obj is TroubleAware;
|
|
98
98
|
//# sourceMappingURL=is-trouble-aware.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-trouble-aware.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/sdk/kos-ui-sdk/src/models/models/trouble/utils/is-trouble-aware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6FG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,YAAY,
|
|
1
|
+
{"version":3,"file":"is-trouble-aware.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/sdk/kos-ui-sdk/src/models/models/trouble/utils/is-trouble-aware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6FG;AACH,wBAAgB,cAAc,CAAC,GAAG,CAAC,EAAE,GAAG,GAAG,GAAG,IAAI,YAAY,CAO7D"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
export type {
|
|
1
|
+
import { TroubleContainerModelImpl } from './trouble-container-model';
|
|
2
|
+
export { Troubles, type TroubleContainerModel, } from './trouble-container-model';
|
|
3
|
+
export type { TroubleContainerOptions } from './types';
|
|
4
|
+
export declare const TroubleContainer: import('../../..').KosModelRegistrationType<TroubleContainerModelImpl, import('./types').TroubleContainerOptions>;
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-ui-sdk/src/models/models/trouble-container/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-ui-sdk/src/models/models/trouble-container/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,KAAK,qBAAqB,GAC3B,MAAM,2BAA2B,CAAC;AAEnC,YAAY,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAEvD,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAEtE,eAAO,MAAM,gBAAgB,mHAAyC,CAAC"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TroubleContainerOptions } from './types';
|
|
2
2
|
import { TroubleModel } from '../trouble/types';
|
|
3
3
|
import { TroubleResponse } from '../trouble/services';
|
|
4
|
-
import {
|
|
4
|
+
import { IKosDataModel, IKosIdentifiable, KosContainerAwareWithProp, KosLoggerAware, KosModelRegistrationType, PublicModelInterface } from '../../../core';
|
|
5
5
|
|
|
6
6
|
export declare const MODEL_TYPE = "trouble-container-model";
|
|
7
|
+
export type TroubleContainerModel = PublicModelInterface<TroubleContainerModelImpl>;
|
|
8
|
+
export interface TroubleContainerModelImpl extends KosContainerAwareWithProp<TroubleModel, "troubles">, KosLoggerAware {
|
|
9
|
+
}
|
|
7
10
|
export declare class Troubles {
|
|
8
11
|
static readonly INDEX_TROUBLES_BY_IFACE = "byIface";
|
|
9
12
|
static readonly INDEX_TROUBLES_BY_TYPE = "byType";
|
|
@@ -12,10 +15,11 @@ export declare class Troubles {
|
|
|
12
15
|
static readonly SORT_KEY_RANK = "rank";
|
|
13
16
|
static readonly TROUBLES_DEFERRED = "true";
|
|
14
17
|
}
|
|
15
|
-
export declare class TroubleContainerModelImpl implements
|
|
18
|
+
export declare class TroubleContainerModelImpl implements IKosIdentifiable, IKosDataModel {
|
|
19
|
+
static Registration: KosModelRegistrationType<TroubleContainerModelImpl, TroubleContainerOptions>;
|
|
16
20
|
id: string;
|
|
17
|
-
|
|
18
|
-
constructor(modelId: string);
|
|
21
|
+
servicePath: string;
|
|
22
|
+
constructor(modelId: string, options: TroubleContainerOptions);
|
|
19
23
|
load(): Promise<void>;
|
|
20
24
|
handleTroubleRemoved(id: string): void;
|
|
21
25
|
handleTroubleAdded(trouble: TroubleResponse): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trouble-container-model.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-ui-sdk/src/models/models/trouble-container/trouble-container-model.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"trouble-container-model.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-ui-sdk/src/models/models/trouble-container/trouble-container-model.ts"],"names":[],"mappings":"AACA,OAAO,EAQL,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,yBAAyB,EAC9B,KAAK,cAAc,EACnB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EAC1B,MAAM,eAAe,CAAC;AAQvB,OAAO,EAAe,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAqCvD,eAAO,MAAM,UAAU,4BAA4B,CAAC;AAEpD,MAAM,MAAM,qBAAqB,GAC/B,oBAAoB,CAAC,yBAAyB,CAAC,CAAC;AAClD,MAAM,WAAW,yBACf,SAAQ,yBAAyB,CAAC,YAAY,EAAE,UAAU,CAAC,EACzD,cAAc;CAAG;AACrB,qBAAa,QAAQ;IACnB,MAAM,CAAC,QAAQ,CAAC,uBAAuB,aAAa;IACpD,MAAM,CAAC,QAAQ,CAAC,sBAAsB,YAAY;IAClD,MAAM,CAAC,QAAQ,CAAC,uBAAuB,aAAa;IACpD,MAAM,CAAC,QAAQ,CAAC,0BAA0B,gBAAgB;IAC1D,MAAM,CAAC,QAAQ,CAAC,aAAa,UAAU;IACvC,MAAM,CAAC,QAAQ,CAAC,iBAAiB,UAAU;CAC5C;AACD,qBAca,yBACX,YAAW,gBAAgB,EAAE,aAAa;IAE1C,MAAM,CAAC,YAAY,EAAE,wBAAwB,CAC3C,yBAAyB,EACzB,uBAAuB,CACxB,CAAC;IACF,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,SAAuB;gBACtB,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB;IAOvD,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IA4B3B,oBAAoB,CAAC,EAAE,EAAE,MAAM;IAW/B,kBAAkB,CAAC,OAAO,EAAE,eAAe;CAgB5C"}
|