@eui/core 22.0.0-alpha.55 → 22.0.0-alpha.57
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/CHANGELOG.md +43 -0
- package/docs/changelog.html +68 -0
- package/docs/interfaces/Schema-10.html +1 -1
- package/docs/interfaces/Schema-11.html +1 -1
- package/docs/interfaces/Schema-7.html +1 -1
- package/docs/interfaces/Schema-8.html +1 -1
- package/docs/js/search/search_index.js +2 -2
- package/docs/json/documentation.json +52 -52
- package/docs/llms.txt +27 -27
- package/docs/miscellaneous/functions.html +135 -135
- package/docs/miscellaneous/variables.html +2 -2
- package/docs/properties.html +1 -1
- package/fesm2022/eui-core.mjs +5768 -5464
- package/fesm2022/eui-core.mjs.map +1 -1
- package/package.json +2 -2
- package/types/eui-core.d.ts +2099 -2168
- package/types/eui-core.d.ts.map +1 -1
package/types/eui-core.d.ts
CHANGED
|
@@ -1,41 +1,38 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<CoreModule, never, never, never>;
|
|
24
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<CoreModule>;
|
|
1
|
+
import { ApiQueueItem, AppState, ConnectionStatus, CoreState, DeepPartial, ErrorMappingHandler, EuiAppConfig, EuiAppHandlersConfig, EuiAppJsonConfig, EuiConfig, EuiEnvConfig, EuiGrowlMessage, EuiLanguage, EuiLazyService, EuiMenuItem, EuiService, EuiServiceStatus, EuiUserRight, GlobalConfig, HttpErrorHandlerConfig, HttpErrorRouteConfig, I18nLoaderConfig, I18nServiceConfig, I18nState, LocaleServiceConfig, LocaleState, LogAppender, LogConfig, LogLevel, Logger, LoggerMock, ModuleConfig, NotificationsState, UserDetails, UserPreferences, UserState } from "@eui/base";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { AfterViewChecked, DebugElement, ElementRef, EnvironmentProviders, ErrorHandler, InjectionToken, Injector, ModuleWithProviders, OnDestroy, PipeTransform, Provider, Signal, Type } from "@angular/core";
|
|
4
|
+
import { HttpClient, HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest, HttpResponseBase } from "@angular/common/http";
|
|
5
|
+
import { ActivatedRoute, Router } from "@angular/router";
|
|
6
|
+
import { BehaviorSubject, Observable, Subject } from "rxjs";
|
|
7
|
+
import { LangChangeEvent, TranslateLoader, TranslateService, TranslationObject } from "@ngx-translate/core";
|
|
8
|
+
import { ComponentType, DomPortalOutlet } from "@angular/cdk/portal";
|
|
9
|
+
import { ComponentFixture } from "@angular/core/testing";
|
|
10
|
+
import { AbstractControl, FormArray, FormControl, FormGroup } from "@angular/forms";
|
|
11
|
+
export * from "@eui/base";
|
|
12
|
+
export declare const CORE_ROOT_GUARD: InjectionToken<void>;
|
|
13
|
+
export declare class CoreModule {
|
|
14
|
+
/**
|
|
15
|
+
* No more providing config from forRoot, you have to use EUI_CONFIG_TOKEN to pass config via providers.
|
|
16
|
+
*/
|
|
17
|
+
static forRoot(): ModuleWithProviders<CoreModule>;
|
|
18
|
+
static forChild(moduleName: string): ModuleWithProviders<CoreModule>;
|
|
19
|
+
constructor();
|
|
20
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CoreModule, never>;
|
|
21
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<CoreModule, never, never, never>;
|
|
22
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<CoreModule>;
|
|
25
23
|
}
|
|
26
24
|
declare const createEuiCoreRootGuard: (core: any) => string;
|
|
27
|
-
declare class EuiCoreRootGuardClass {
|
|
28
|
-
|
|
25
|
+
export declare class EuiCoreRootGuardClass {
|
|
26
|
+
constructor();
|
|
29
27
|
}
|
|
30
28
|
declare const euiCoreRootGuardClass: () => EuiCoreRootGuardClass;
|
|
31
|
-
|
|
32
29
|
/**
|
|
33
30
|
* Function to be used before the AppModule is bootstrapped. It is currently used to load dynamic configurations.
|
|
34
31
|
* It needs to be added in your application main.ts file.
|
|
35
32
|
* @param envConfig the current environment configuration
|
|
36
33
|
* @returns the updated environment configuration, as a promise
|
|
37
34
|
*/
|
|
38
|
-
declare function preInitApp(envConfig: EuiEnvConfig): Promise<EuiEnvConfig>;
|
|
35
|
+
export declare function preInitApp(envConfig: EuiEnvConfig): Promise<EuiEnvConfig>;
|
|
39
36
|
/**
|
|
40
37
|
* Function to load asynchronously a dynamic configuration (from a local path or a web service)
|
|
41
38
|
*
|
|
@@ -43,493 +40,465 @@ declare function preInitApp(envConfig: EuiEnvConfig): Promise<EuiEnvConfig>;
|
|
|
43
40
|
* @param timeout possible timeout
|
|
44
41
|
* @returns EuiAppJsonConfig promise
|
|
45
42
|
*/
|
|
46
|
-
declare function loadEuiDynamicEnvironmentConfig(url: string, timeout?: number): Promise<EuiAppJsonConfig>;
|
|
47
|
-
|
|
43
|
+
export declare function loadEuiDynamicEnvironmentConfig(url: string, timeout?: number): Promise<EuiAppJsonConfig>;
|
|
48
44
|
/**
|
|
49
45
|
* Initializes the app with the necessary configurations. Use this in combination with `provideAppInitializer(euiInitApp_Env)`
|
|
50
46
|
*/
|
|
51
|
-
declare function provideEuiInitializer(): EnvironmentProviders;
|
|
52
|
-
|
|
53
|
-
declare function
|
|
54
|
-
declare function
|
|
55
|
-
declare
|
|
56
|
-
|
|
57
|
-
declare const
|
|
58
|
-
declare const
|
|
59
|
-
declare const
|
|
60
|
-
declare const
|
|
61
|
-
declare const
|
|
62
|
-
declare const
|
|
63
|
-
declare const
|
|
64
|
-
declare
|
|
65
|
-
declare
|
|
66
|
-
declare function
|
|
67
|
-
declare function
|
|
68
|
-
declare function
|
|
69
|
-
declare function
|
|
70
|
-
declare function
|
|
71
|
-
declare function
|
|
72
|
-
declare
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
declare const errorCodes: {
|
|
76
|
-
ERR_GENERIC: string;
|
|
47
|
+
export declare function provideEuiInitializer(): EnvironmentProviders;
|
|
48
|
+
export declare function getCoreProviders(): Provider[];
|
|
49
|
+
export declare function getDependencyProviders(): Provider[];
|
|
50
|
+
export declare function getCoreChildProviders(moduleName: string): Provider[];
|
|
51
|
+
export declare const EUI_CONFIG_TOKEN: InjectionToken<EuiConfig>;
|
|
52
|
+
export declare const MODULE_NAME_TOKEN: InjectionToken<string>;
|
|
53
|
+
export declare const MODULE_CONFIG_TOKEN: InjectionToken<ModuleConfig<any>>;
|
|
54
|
+
export declare const CONFIG_TOKEN: InjectionToken<EuiAppConfig>;
|
|
55
|
+
export declare const GLOBAL_CONFIG_TOKEN: InjectionToken<GlobalConfig<any>>;
|
|
56
|
+
export declare const BASE_NAME_TOKEN: InjectionToken<string>;
|
|
57
|
+
export declare const ROOT_LOG_CONFIG_TOKEN: InjectionToken<LogConfig>;
|
|
58
|
+
export declare const SHOW_CONNECTION_STATUS_TOKEN: InjectionToken<boolean>;
|
|
59
|
+
export declare const HTTP_ERROR_HANDLER_CONFIG_TOKEN: InjectionToken<HttpErrorHandlerConfig>;
|
|
60
|
+
export declare function getGlobalConfig(appConfig: EuiAppConfig): GlobalConfig;
|
|
61
|
+
export declare function getShowConnectionStatus(globalConfig: GlobalConfig): ConnectionStatus;
|
|
62
|
+
export declare function getModuleConfig(appConfig: EuiAppConfig, moduleName: string): ModuleConfig;
|
|
63
|
+
export declare function getHttpErrorHandlingConfig(appConfig: EuiAppConfig): HttpErrorHandlerConfig;
|
|
64
|
+
export declare function getRootLogConfig(appConfig: EuiAppConfig): LogConfig;
|
|
65
|
+
export declare function prepareEuiAppConfigToken(euiConfig: EuiConfig): EuiAppConfig;
|
|
66
|
+
export declare function mergeAppHandlerConfigToAppConfig(euiAppConfig: EuiAppConfig, envAppHandler: EuiAppHandlersConfig): EuiAppConfig;
|
|
67
|
+
export declare function mergeAppJsonConfigToAppConfig(euiAppConfig: EuiAppConfig, envAppJsonConfig: EuiAppJsonConfig, merge: Array<string>, isDeepMerge: boolean): EuiAppConfig;
|
|
68
|
+
export declare const errorCodes: {
|
|
69
|
+
ERR_GENERIC: string;
|
|
77
70
|
};
|
|
78
|
-
declare class ErrorSubClass {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
71
|
+
export declare class ErrorSubClass {
|
|
72
|
+
code?: string;
|
|
73
|
+
message: string;
|
|
74
|
+
stack: string;
|
|
75
|
+
name: string;
|
|
76
|
+
constructor(code?: string, msg?: string, args?: any);
|
|
84
77
|
}
|
|
85
|
-
declare class EuiError extends ErrorSubClass {
|
|
86
|
-
|
|
78
|
+
export declare class EuiError extends ErrorSubClass {
|
|
79
|
+
constructor(code?: string, msg?: string, args?: any);
|
|
87
80
|
}
|
|
88
|
-
|
|
89
|
-
declare const
|
|
90
|
-
declare const
|
|
91
|
-
declare const LOG_APPENDERS_TOKEN: InjectionToken<LogAppender<_eui_base.LogAppenderConfig>[]>;
|
|
81
|
+
export declare const BASE_LOGGER_NAME_TOKEN: InjectionToken<string>;
|
|
82
|
+
export declare const LOG_LEVEL_TOKEN: InjectionToken<LogLevel>;
|
|
83
|
+
export declare const LOG_APPENDERS_TOKEN: InjectionToken<LogAppender<import("@eui/base").LogAppenderConfig>[]>;
|
|
92
84
|
/**
|
|
93
85
|
* Log service, responsible for getting or creating loggers. It itself acts as a base logger
|
|
94
86
|
*/
|
|
95
|
-
declare class LogService extends Logger {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
|
|
87
|
+
export declare class LogService extends Logger {
|
|
88
|
+
protected name: string;
|
|
89
|
+
protected level: LogLevel;
|
|
90
|
+
protected appenders: LogAppender[];
|
|
91
|
+
/** the list of persistent loggers */
|
|
92
|
+
protected loggers: {};
|
|
93
|
+
constructor();
|
|
94
|
+
/**
|
|
95
|
+
* Gets a logger by name. If the logger does not exist, it is created
|
|
96
|
+
*
|
|
97
|
+
* @param loggerName logger name
|
|
98
|
+
* @param persist optional parameter. Set it to true if you want to reuse the logger. By default, it is set to false
|
|
99
|
+
* @returns the logger
|
|
100
|
+
*/
|
|
101
|
+
getLogger(loggerName: string, persist?: boolean): Logger;
|
|
102
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LogService, never>;
|
|
103
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
104
|
+
}
|
|
105
|
+
export declare class LogServiceMock extends LoggerMock {
|
|
106
|
+
getLogger(): LoggerMock;
|
|
107
|
+
}
|
|
118
108
|
/**
|
|
119
109
|
* Log Module
|
|
120
110
|
*/
|
|
121
|
-
declare class LogModule {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
declare function
|
|
155
|
-
declare function ConsoleHttpErrorCallbackFn(error: HttpErrorResponse): void;
|
|
156
|
-
declare function LogHttpErrorCallbackFn(error: HttpErrorResponse, injector: Injector): void;
|
|
157
|
-
declare function GrowlHttpErrorCallbackFn(error: HttpErrorResponse, injector: Injector): void;
|
|
158
|
-
|
|
111
|
+
export declare class LogModule {
|
|
112
|
+
/** method called in your root module to provide the LogService */
|
|
113
|
+
static forRoot(config?: LogConfig): ModuleWithProviders<LogModule>;
|
|
114
|
+
/** method called in your other (non root, lazy loaded) modules to import a different instance of LogService */
|
|
115
|
+
static forChild(config?: LogConfig): ModuleWithProviders<LogModule>;
|
|
116
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LogModule, never>;
|
|
117
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<LogModule, never, never, never>;
|
|
118
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<LogModule>;
|
|
119
|
+
}
|
|
120
|
+
export declare class GlobalErrorHandler extends ErrorHandler {
|
|
121
|
+
protected logService: LogService;
|
|
122
|
+
handleError(error: any): void;
|
|
123
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GlobalErrorHandler, never>;
|
|
124
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
125
|
+
}
|
|
126
|
+
export declare class HttpErrorHandlerInterceptor implements HttpInterceptor {
|
|
127
|
+
protected config: HttpErrorHandlerConfig;
|
|
128
|
+
protected injector: Injector;
|
|
129
|
+
protected router: Router;
|
|
130
|
+
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>;
|
|
131
|
+
/**
|
|
132
|
+
* Search in the configuration for the first matching route
|
|
133
|
+
*
|
|
134
|
+
* @param error http error response
|
|
135
|
+
* @returns HttpErrorRouteConfig or null
|
|
136
|
+
*/
|
|
137
|
+
protected getRouteConfig(error: HttpErrorResponse): HttpErrorRouteConfig | null;
|
|
138
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HttpErrorHandlerInterceptor, never>;
|
|
139
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
140
|
+
}
|
|
141
|
+
export declare function AlertHttpErrorCallbackFn(error: HttpErrorResponse): void;
|
|
142
|
+
export declare function ConsoleHttpErrorCallbackFn(error: HttpErrorResponse): void;
|
|
143
|
+
export declare function LogHttpErrorCallbackFn(error: HttpErrorResponse, injector: Injector): void;
|
|
144
|
+
export declare function GrowlHttpErrorCallbackFn(error: HttpErrorResponse, injector: Injector): void;
|
|
159
145
|
/**
|
|
160
146
|
* A function that takes an `Action` and a `State`, and returns a `State`.
|
|
161
147
|
* See `createReducer`.
|
|
162
148
|
*/
|
|
163
149
|
interface ActionReducer<T, V extends Action = Action> {
|
|
164
|
-
|
|
150
|
+
(state: T | undefined, action: V): T;
|
|
165
151
|
}
|
|
166
|
-
type ActionReducerMap<T, V extends Action = Action> = {
|
|
167
|
-
[p in keyof T]: ActionReducer<T[p], V>;
|
|
168
|
-
};
|
|
152
|
+
type ActionReducerMap<T, V extends Action = Action> = { [p in keyof T]: ActionReducer<T[p], V>; };
|
|
169
153
|
interface Action<Type extends string = string> {
|
|
170
|
-
|
|
154
|
+
type: Type;
|
|
171
155
|
}
|
|
172
|
-
|
|
173
156
|
/**
|
|
174
157
|
* @deprecated it will be removed in the next major version
|
|
175
158
|
*/
|
|
176
|
-
declare enum CoreAppActionTypes {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
159
|
+
export declare enum CoreAppActionTypes {
|
|
160
|
+
INIT_STORE = "[App] Init store",
|
|
161
|
+
UPDATE_APP_VERSION = "[App] Update version",
|
|
162
|
+
UPDATE_APP_CONNECTION = "[App] Update connection",
|
|
163
|
+
ADD_APP_LOADED_CONFIG_MODULES = "[App] Update app loaded config modules",
|
|
164
|
+
UPDATE_APP_STATUS = "[App] Update status",
|
|
165
|
+
UPDATE_CURRENT_MODULE = "[App] Update current module",
|
|
166
|
+
ACTIVATED_ROUTE = "[App] Activated route",
|
|
167
|
+
ADD_API_QUEUE_ITEM = "[App] Add API queue item",
|
|
168
|
+
REMOVE_API_QUEUE_ITEM = "[App] Remove API queue item",
|
|
169
|
+
EMPTY_API_QUEUE = "[App] empty API queue"
|
|
187
170
|
}
|
|
188
171
|
/**
|
|
189
172
|
* @deprecated it will be removed in the next major version
|
|
190
173
|
*/
|
|
191
|
-
declare class InitStoreAction implements Action {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
174
|
+
export declare class InitStoreAction implements Action {
|
|
175
|
+
payload: {
|
|
176
|
+
version?: string;
|
|
177
|
+
};
|
|
178
|
+
type: CoreAppActionTypes;
|
|
179
|
+
constructor(payload: {
|
|
180
|
+
version?: string;
|
|
181
|
+
});
|
|
199
182
|
}
|
|
200
183
|
/**
|
|
201
184
|
* @deprecated it will be removed in the next major version
|
|
202
185
|
*/
|
|
203
|
-
declare class UpdateAppVersionAction implements Action {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
186
|
+
export declare class UpdateAppVersionAction implements Action {
|
|
187
|
+
payload: string;
|
|
188
|
+
type: CoreAppActionTypes;
|
|
189
|
+
constructor(payload: string);
|
|
207
190
|
}
|
|
208
191
|
/**
|
|
209
192
|
* @deprecated it will be removed in the next major version
|
|
210
193
|
*/
|
|
211
|
-
declare class UpdateAppConnectionAction implements Action {
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
194
|
+
export declare class UpdateAppConnectionAction implements Action {
|
|
195
|
+
payload: boolean;
|
|
196
|
+
type: CoreAppActionTypes;
|
|
197
|
+
constructor(payload: boolean);
|
|
215
198
|
}
|
|
216
199
|
/**
|
|
217
200
|
* @deprecated it will be removed in the next major version
|
|
218
201
|
*/
|
|
219
|
-
declare class AddAppLoadedConfigModulesAction implements Action {
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
202
|
+
export declare class AddAppLoadedConfigModulesAction implements Action {
|
|
203
|
+
payload: {
|
|
204
|
+
moduleName: string;
|
|
205
|
+
moduleConfig: ModuleConfig;
|
|
206
|
+
};
|
|
207
|
+
type: CoreAppActionTypes;
|
|
208
|
+
constructor(payload: {
|
|
209
|
+
moduleName: string;
|
|
210
|
+
moduleConfig: ModuleConfig;
|
|
211
|
+
});
|
|
229
212
|
}
|
|
230
213
|
/**
|
|
231
214
|
* @deprecated it will be removed in the next major version
|
|
232
215
|
*/
|
|
233
|
-
declare class UpdateAppStatusAction implements Action {
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
216
|
+
export declare class UpdateAppStatusAction implements Action {
|
|
217
|
+
payload: string;
|
|
218
|
+
type: CoreAppActionTypes;
|
|
219
|
+
constructor(payload: string);
|
|
237
220
|
}
|
|
238
221
|
/**
|
|
239
222
|
* @deprecated it will be removed in the next major version
|
|
240
223
|
*/
|
|
241
|
-
declare class UpdateCurrentModuleAction implements Action {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
224
|
+
export declare class UpdateCurrentModuleAction implements Action {
|
|
225
|
+
payload: string;
|
|
226
|
+
type: CoreAppActionTypes;
|
|
227
|
+
constructor(payload: string);
|
|
245
228
|
}
|
|
246
229
|
/**
|
|
247
230
|
* @deprecated it will be removed in the next major version
|
|
248
231
|
*/
|
|
249
|
-
declare class ActivatedRouteAction implements Action {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
232
|
+
export declare class ActivatedRouteAction implements Action {
|
|
233
|
+
payload: ActivatedRoute;
|
|
234
|
+
type: CoreAppActionTypes;
|
|
235
|
+
constructor(payload: ActivatedRoute);
|
|
253
236
|
}
|
|
254
237
|
/**
|
|
255
238
|
* @deprecated it will be removed in the next major version
|
|
256
239
|
*/
|
|
257
|
-
declare class AddApiQueueItemAction implements Action {
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
240
|
+
export declare class AddApiQueueItemAction implements Action {
|
|
241
|
+
payload: {
|
|
242
|
+
id: string;
|
|
243
|
+
item: ApiQueueItem;
|
|
244
|
+
};
|
|
245
|
+
type: CoreAppActionTypes;
|
|
246
|
+
constructor(payload: {
|
|
247
|
+
id: string;
|
|
248
|
+
item: ApiQueueItem;
|
|
249
|
+
});
|
|
267
250
|
}
|
|
268
251
|
/**
|
|
269
252
|
* @deprecated it will be removed in the next major version
|
|
270
253
|
*/
|
|
271
|
-
declare class RemoveApiQueueItemAction implements Action {
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
254
|
+
export declare class RemoveApiQueueItemAction implements Action {
|
|
255
|
+
payload: string;
|
|
256
|
+
type: CoreAppActionTypes;
|
|
257
|
+
constructor(payload: string);
|
|
275
258
|
}
|
|
276
259
|
/**
|
|
277
260
|
* @deprecated it will be removed in the next major version
|
|
278
261
|
*/
|
|
279
|
-
declare class EmptyApiQueueAction implements Action {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
262
|
+
export declare class EmptyApiQueueAction implements Action {
|
|
263
|
+
payload: any;
|
|
264
|
+
type: CoreAppActionTypes;
|
|
265
|
+
constructor(payload: any);
|
|
283
266
|
}
|
|
284
267
|
/**
|
|
285
268
|
* @deprecated it will be removed in the next major version
|
|
286
269
|
*/
|
|
287
|
-
type CoreAppActions = InitStoreAction | UpdateAppVersionAction | UpdateAppConnectionAction | AddAppLoadedConfigModulesAction | UpdateAppStatusAction | UpdateCurrentModuleAction | ActivatedRouteAction | AddApiQueueItemAction | RemoveApiQueueItemAction;
|
|
288
|
-
|
|
270
|
+
export type CoreAppActions = InitStoreAction | UpdateAppVersionAction | UpdateAppConnectionAction | AddAppLoadedConfigModulesAction | UpdateAppStatusAction | UpdateCurrentModuleAction | ActivatedRouteAction | AddApiQueueItemAction | RemoveApiQueueItemAction;
|
|
289
271
|
/**
|
|
290
272
|
* @deprecated it will be removed in the next major version
|
|
291
273
|
*/
|
|
292
|
-
declare enum CoreI18nActionTypes {
|
|
293
|
-
|
|
274
|
+
export declare enum CoreI18nActionTypes {
|
|
275
|
+
UPDATE_I18N_STATE = "[I18n] Update I18n State"
|
|
294
276
|
}
|
|
295
277
|
/**
|
|
296
278
|
* @deprecated it will be removed in the next major version
|
|
297
279
|
*/
|
|
298
|
-
declare class UpdateI18nStateAction implements Action {
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
280
|
+
export declare class UpdateI18nStateAction implements Action {
|
|
281
|
+
payload: I18nState;
|
|
282
|
+
type: CoreI18nActionTypes;
|
|
283
|
+
constructor(payload: I18nState);
|
|
302
284
|
}
|
|
303
285
|
/**
|
|
304
286
|
* @deprecated it will be removed in the next major version
|
|
305
287
|
*/
|
|
306
|
-
type CoreI18nActions = UpdateI18nStateAction;
|
|
307
|
-
|
|
288
|
+
export type CoreI18nActions = UpdateI18nStateAction;
|
|
308
289
|
/**
|
|
309
290
|
* @deprecated it will be removed in the next major version
|
|
310
291
|
*/
|
|
311
|
-
declare enum CoreUserActionTypes {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
292
|
+
export declare enum CoreUserActionTypes {
|
|
293
|
+
UPDATE_USER_STATE = "[User] Update User state",
|
|
294
|
+
UPDATE_USER_DETAILS = "[User] Update details",
|
|
295
|
+
UPDATE_USER_PREFERENCES = "[User] Update preferences",
|
|
296
|
+
UPDATE_USER_RIGHTS = "[User] Update rights",
|
|
297
|
+
UPDATE_USER_DASHBOARD = "[User] Update dashboard"
|
|
317
298
|
}
|
|
318
299
|
/**
|
|
319
300
|
* @deprecated it will be removed in the next major version
|
|
320
301
|
*/
|
|
321
|
-
declare class UpdateUserStateAction implements Action {
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
302
|
+
export declare class UpdateUserStateAction implements Action {
|
|
303
|
+
payload: UserState;
|
|
304
|
+
type: CoreUserActionTypes;
|
|
305
|
+
constructor(payload: UserState);
|
|
325
306
|
}
|
|
326
307
|
/**
|
|
327
308
|
* @deprecated it will be removed in the next major version
|
|
328
309
|
*/
|
|
329
|
-
declare class UpdateUserDetailsAction implements Action {
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
310
|
+
export declare class UpdateUserDetailsAction implements Action {
|
|
311
|
+
payload: UserDetails;
|
|
312
|
+
type: CoreUserActionTypes;
|
|
313
|
+
constructor(payload: UserDetails);
|
|
333
314
|
}
|
|
334
315
|
/**
|
|
335
316
|
* @deprecated it will be removed in the next major version
|
|
336
317
|
*/
|
|
337
|
-
declare class UpdateUserPreferencesAction implements Action {
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
318
|
+
export declare class UpdateUserPreferencesAction implements Action {
|
|
319
|
+
payload: UserPreferences;
|
|
320
|
+
type: CoreUserActionTypes;
|
|
321
|
+
constructor(payload: UserPreferences);
|
|
341
322
|
}
|
|
342
323
|
/**
|
|
343
324
|
* @deprecated it will be removed in the next major version
|
|
344
325
|
*/
|
|
345
|
-
declare class UpdateUserRightsAction implements Action {
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
326
|
+
export declare class UpdateUserRightsAction implements Action {
|
|
327
|
+
payload: EuiUserRight[];
|
|
328
|
+
type: CoreUserActionTypes;
|
|
329
|
+
constructor(payload: EuiUserRight[]);
|
|
349
330
|
}
|
|
350
331
|
/**
|
|
351
332
|
* @deprecated it will be removed in the next major version
|
|
352
333
|
*/
|
|
353
|
-
declare class UpdateUserDashboardAction implements Action {
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
334
|
+
export declare class UpdateUserDashboardAction implements Action {
|
|
335
|
+
payload: unknown;
|
|
336
|
+
type: CoreUserActionTypes;
|
|
337
|
+
constructor(payload: unknown);
|
|
357
338
|
}
|
|
358
339
|
/**
|
|
359
340
|
* @deprecated it will be removed in the next major version
|
|
360
341
|
*/
|
|
361
|
-
type CoreUserActions = UpdateUserDetailsAction | UpdateUserPreferencesAction | UpdateUserRightsAction | UpdateUserDashboardAction;
|
|
362
|
-
|
|
342
|
+
export type CoreUserActions = UpdateUserDetailsAction | UpdateUserPreferencesAction | UpdateUserRightsAction | UpdateUserDashboardAction;
|
|
363
343
|
/**
|
|
364
344
|
* @deprecated it will be removed in the next major version
|
|
365
345
|
*/
|
|
366
|
-
declare enum CoreNotificationsActionTypes {
|
|
367
|
-
|
|
346
|
+
export declare enum CoreNotificationsActionTypes {
|
|
347
|
+
UPDATE_NOTIFICATIONS_LIST = "[Notif] Update list"
|
|
368
348
|
}
|
|
369
349
|
/**
|
|
370
350
|
* @deprecated it will be removed in the next major version
|
|
371
351
|
*/
|
|
372
|
-
declare class UpdateNotificationsListAction implements Action {
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
352
|
+
export declare class UpdateNotificationsListAction implements Action {
|
|
353
|
+
payload: any[];
|
|
354
|
+
type: CoreNotificationsActionTypes;
|
|
355
|
+
constructor(payload: any[]);
|
|
376
356
|
}
|
|
377
357
|
/**
|
|
378
358
|
* @deprecated it will be removed in the next major version
|
|
379
359
|
*/
|
|
380
|
-
type CoreNotificationsActions = UpdateNotificationsListAction;
|
|
381
|
-
|
|
360
|
+
export type CoreNotificationsActions = UpdateNotificationsListAction;
|
|
382
361
|
/**
|
|
383
362
|
* @deprecated it will be removed in the next major version
|
|
384
363
|
*/
|
|
385
|
-
declare enum CoreLocaleActionTypes {
|
|
386
|
-
|
|
364
|
+
export declare enum CoreLocaleActionTypes {
|
|
365
|
+
UPDATE_LOCALE_STATE = "[Locale] Update Locale State"
|
|
387
366
|
}
|
|
388
367
|
/**
|
|
389
368
|
* @deprecated it will be removed in the next major version
|
|
390
369
|
*/
|
|
391
|
-
declare class UpdateLocaleStateAction implements Action {
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
370
|
+
export declare class UpdateLocaleStateAction implements Action {
|
|
371
|
+
payload: LocaleState;
|
|
372
|
+
type: CoreLocaleActionTypes;
|
|
373
|
+
constructor(payload: LocaleState);
|
|
395
374
|
}
|
|
396
375
|
/**
|
|
397
376
|
* @deprecated it will be removed in the next major version
|
|
398
377
|
*/
|
|
399
|
-
type CoreLocaleActions = UpdateLocaleStateAction;
|
|
400
|
-
|
|
378
|
+
export type CoreLocaleActions = UpdateLocaleStateAction;
|
|
401
379
|
/**
|
|
402
380
|
* @deprecated it will be removed in the next major version
|
|
403
381
|
*/
|
|
404
|
-
declare const coreAppReducers: (state: AppState, action: Action) => AppState;
|
|
405
|
-
|
|
382
|
+
export declare const coreAppReducers: (state: AppState, action: Action) => AppState;
|
|
406
383
|
/**
|
|
407
384
|
* @deprecated it will be removed in the next major version
|
|
408
385
|
*/
|
|
409
386
|
declare const coreReducers: ActionReducerMap<CoreState, any>;
|
|
410
|
-
|
|
411
387
|
/**
|
|
412
388
|
* @deprecated it will be removed in the next major version
|
|
413
389
|
*/
|
|
414
|
-
declare const corI18nReducers: (state: I18nState, action: Action) => I18nState;
|
|
415
|
-
|
|
390
|
+
export declare const corI18nReducers: (state: I18nState, action: Action) => I18nState;
|
|
416
391
|
/**
|
|
417
392
|
* @deprecated it will be removed in the next major version
|
|
418
393
|
*/
|
|
419
|
-
declare const coreUserReducers: (state: UserState, action: Action) => UserState;
|
|
420
|
-
|
|
394
|
+
export declare const coreUserReducers: (state: UserState, action: Action) => UserState;
|
|
421
395
|
/**
|
|
422
396
|
* @deprecated it will be removed in the next major version
|
|
423
397
|
*/
|
|
424
|
-
declare const coreNotificationsReducers: (state: NotificationsState, action: Action) => NotificationsState;
|
|
425
|
-
|
|
398
|
+
export declare const coreNotificationsReducers: (state: NotificationsState, action: Action) => NotificationsState;
|
|
426
399
|
/**
|
|
427
400
|
* Utility meta-reducer to load the state from the local storage
|
|
428
401
|
* @param platformId the platformId based on PLATFORM_ID token of Angular
|
|
429
402
|
* @deprecated it will be removed in the next major version
|
|
430
403
|
*/
|
|
431
|
-
declare function localStorageSync<S extends CoreState>(platformId: unknown): ((reducer: ActionReducer<S>) => (state: S, action: Action) => S);
|
|
404
|
+
export declare function localStorageSync<S extends CoreState>(platformId: unknown): ((reducer: ActionReducer<S>) => (state: S, action: Action) => S);
|
|
432
405
|
/**
|
|
433
406
|
* Utility meta-reducer to load the state from the local storage
|
|
434
407
|
* @param reducer the action reducer
|
|
435
408
|
*/
|
|
436
|
-
declare function localStorageSync<S extends CoreState>(reducer: ActionReducer<S>): (state: S, action: Action) => S;
|
|
409
|
+
export declare function localStorageSync<S extends CoreState>(reducer: ActionReducer<S>): (state: S, action: Action) => S;
|
|
437
410
|
/**
|
|
438
411
|
* Utility meta-reducer to load the state from the session storage
|
|
439
412
|
* @param platformId the platformId based on PLATFORM_ID token of Angular
|
|
440
413
|
* @deprecated it will be removed in the next major version
|
|
441
414
|
*/
|
|
442
|
-
declare function sessionStorageSync<S extends CoreState>(platformId: unknown): ((reducer: ActionReducer<S>) => (state: S, action: Action) => S);
|
|
415
|
+
export declare function sessionStorageSync<S extends CoreState>(platformId: unknown): ((reducer: ActionReducer<S>) => (state: S, action: Action) => S);
|
|
443
416
|
/**
|
|
444
417
|
* Utility meta-reducer to load the state from the session storage
|
|
445
418
|
* @param reducer the action reducer
|
|
446
419
|
* @deprecated it will be removed in the next major version
|
|
447
420
|
*/
|
|
448
|
-
declare function sessionStorageSync<S extends CoreState>(reducer: ActionReducer<S>): (state: S, action: Action) => S;
|
|
421
|
+
export declare function sessionStorageSync<S extends CoreState>(reducer: ActionReducer<S>): (state: S, action: Action) => S;
|
|
449
422
|
/**
|
|
450
423
|
*
|
|
451
424
|
* @param storage Type of storage to load the state from
|
|
452
425
|
* @deprecated it will be removed in the next major version
|
|
453
426
|
*/
|
|
454
|
-
declare const loadState: <S extends CoreState>(storage?: Storage | null) => S;
|
|
455
|
-
|
|
427
|
+
export declare const loadState: <S extends CoreState>(storage?: Storage | null) => S;
|
|
456
428
|
/**
|
|
457
429
|
* @deprecated it will be removed in the next major version
|
|
458
430
|
*/
|
|
459
|
-
declare const coreLocaleReducers: (state: LocaleState, action: Action) => LocaleState;
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<StoreServiceMock>;
|
|
531
|
-
}
|
|
532
|
-
|
|
431
|
+
export declare const coreLocaleReducers: (state: LocaleState, action: Action) => LocaleState;
|
|
432
|
+
export declare enum BrowserStorageType {
|
|
433
|
+
local = 0,
|
|
434
|
+
session = 1
|
|
435
|
+
}
|
|
436
|
+
export type Handler<T> = (state: T[keyof T]) => Partial<T[keyof T]>;
|
|
437
|
+
export declare class StoreService<T = any> {
|
|
438
|
+
protected logService: LogService;
|
|
439
|
+
private platformId;
|
|
440
|
+
/**
|
|
441
|
+
* autoSave handlers to call before saving in local Storage
|
|
442
|
+
*/
|
|
443
|
+
protected _autoSaveHandlers: {
|
|
444
|
+
[key: string]: Handler<T>;
|
|
445
|
+
};
|
|
446
|
+
/** storage instance e.g. localStorage, sessionStorage */
|
|
447
|
+
private _storage;
|
|
448
|
+
private state;
|
|
449
|
+
private isHandlingAutoSave;
|
|
450
|
+
constructor();
|
|
451
|
+
init(version?: string, storageType?: BrowserStorageType): void;
|
|
452
|
+
/**
|
|
453
|
+
* Add an autoSave handler for a specific state slice
|
|
454
|
+
* @param stateSlice
|
|
455
|
+
* @param handler
|
|
456
|
+
* @deprecated it will be removed in the next major version
|
|
457
|
+
*/
|
|
458
|
+
addAutoSaveHandler(stateSlice: string, handler: Handler<T>): void;
|
|
459
|
+
handleAutoSave(): void;
|
|
460
|
+
/**
|
|
461
|
+
* This method is used to update the state of the service with a new state.
|
|
462
|
+
*
|
|
463
|
+
* @param state
|
|
464
|
+
*/
|
|
465
|
+
updateState(state: DeepPartial<T>): void;
|
|
466
|
+
/**
|
|
467
|
+
* @deprecated it will be removed in next version. Use updateState(partialState: DeepPartial<T>) instead
|
|
468
|
+
* @param slice
|
|
469
|
+
* @param reducer
|
|
470
|
+
*/
|
|
471
|
+
updateState(slice: DeepPartial<T>, reducer: (state: T, action: DeepPartial<T>) => T): void;
|
|
472
|
+
select(key?: any): Observable<T[any]>;
|
|
473
|
+
/**
|
|
474
|
+
* filters and save the state with the Browser storage
|
|
475
|
+
* @param state type of CoreState
|
|
476
|
+
*/
|
|
477
|
+
protected saveState(state: CoreState): void;
|
|
478
|
+
/**
|
|
479
|
+
* deep merge two objects
|
|
480
|
+
* @param target the object that will be merged into
|
|
481
|
+
* @param source the object that will be merged from
|
|
482
|
+
*/
|
|
483
|
+
private deepMerge;
|
|
484
|
+
/**
|
|
485
|
+
* checks if the given item is an object
|
|
486
|
+
* @param item the item that will be checked
|
|
487
|
+
*/
|
|
488
|
+
private isObject;
|
|
489
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StoreService<any>, never>;
|
|
490
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
491
|
+
}
|
|
492
|
+
export declare const PLATFORM_BROWSER_ID = "browser";
|
|
493
|
+
export declare class StoreServiceMock extends StoreService {
|
|
494
|
+
constructor();
|
|
495
|
+
init(): void;
|
|
496
|
+
addAutoSaveHandler(): void;
|
|
497
|
+
handleAutoSave(): void;
|
|
498
|
+
select(): Observable<object>;
|
|
499
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StoreServiceMock, never>;
|
|
500
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
501
|
+
}
|
|
533
502
|
/**
|
|
534
503
|
* Service class for managing and processing a queue of API requests.
|
|
535
504
|
*
|
|
@@ -564,481 +533,475 @@ declare class StoreServiceMock extends StoreService {
|
|
|
564
533
|
* console.log('Processed all items in the queue with continuation on errors:', results);
|
|
565
534
|
* });
|
|
566
535
|
*/
|
|
567
|
-
declare class ApiQueueService {
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
}
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
}
|
|
815
|
-
|
|
536
|
+
export declare class ApiQueueService {
|
|
537
|
+
protected store: StoreService<any>;
|
|
538
|
+
protected http: HttpClient;
|
|
539
|
+
protected logService: LogService;
|
|
540
|
+
private readonly logger;
|
|
541
|
+
private readonly getAppState;
|
|
542
|
+
private getApiQueue;
|
|
543
|
+
private getApiQueueItem;
|
|
544
|
+
constructor();
|
|
545
|
+
/**
|
|
546
|
+
* Adds an item to the queue by dispatching an action to the store.
|
|
547
|
+
* This function is specifically designed to enqueue API call requests represented by `ApiQueueItem` objects.
|
|
548
|
+
* Each item is identified by a unique `id`, which is used to manage the queue.
|
|
549
|
+
*
|
|
550
|
+
* @param {string} id - The unique identifier for the queue item. It's crucial to ensure that this ID is unique within the queue.
|
|
551
|
+
* If an item with the same ID already exists, the new item will overwrite the existing one.
|
|
552
|
+
* WARNING: Duplicate IDs will lead to overwriting of queue items.
|
|
553
|
+
*
|
|
554
|
+
* @param {ApiQueueItem} item - The item to be enqueued. This should be an object of type `ApiQueueItem`.
|
|
555
|
+
* The `method` property of the item must be one of the allowed methods ('post', 'put', 'get').
|
|
556
|
+
* If an unsupported method is provided, the function will throw an error.
|
|
557
|
+
*
|
|
558
|
+
* @throws {Error} Throws an error if the `method` property of the `item` is not one of the allowed methods.
|
|
559
|
+
* The error message is: `[ApiQueue] method "${item.method}" is not allowed`.
|
|
560
|
+
*
|
|
561
|
+
* @example
|
|
562
|
+
* // Example of adding an item to the API queue
|
|
563
|
+
* addQueueItem('12345', { method: 'post', url: '/api/data', payload: {...} });
|
|
564
|
+
*
|
|
565
|
+
* @returns {void} This function does not return a value. It adds the item to the queue via a dispatch action.
|
|
566
|
+
*/
|
|
567
|
+
addQueueItem(id: string, item: ApiQueueItem): void;
|
|
568
|
+
/**
|
|
569
|
+
* Retrieves the current state of the API queue and converts it into an array of Observables.
|
|
570
|
+
*
|
|
571
|
+
* This method subscribes to the store to access the API queue. It then maps the queue object,
|
|
572
|
+
* which is an associative array, into a linear array of ApiQueueItem instances. If the queue is empty,
|
|
573
|
+
* a warning is logged. This method is useful for tracking the state and contents of the API queue
|
|
574
|
+
* at a given moment.
|
|
575
|
+
*
|
|
576
|
+
* Note: This method takes a snapshot of the queue at the time of subscription. It does not provide
|
|
577
|
+
* a continuous stream of queue updates. To get real-time updates, consider subscribing directly
|
|
578
|
+
* to the store's observable.
|
|
579
|
+
*
|
|
580
|
+
* @returns {Observable<ApiQueueItem[]>} An Observable that emits an array of ApiQueueItem.
|
|
581
|
+
* The array represents all items currently in the queue. If the queue is empty, it emits an empty array.
|
|
582
|
+
*
|
|
583
|
+
* @example
|
|
584
|
+
* // Example usage
|
|
585
|
+
* this.getQueue().subscribe(queueItems => {
|
|
586
|
+
* console.log('Current queue items:', queueItems);
|
|
587
|
+
* });
|
|
588
|
+
*/
|
|
589
|
+
getQueue(): Observable<ApiQueueItem[]>;
|
|
590
|
+
/**
|
|
591
|
+
* Retrieves a specific item from the API queue by its ID.
|
|
592
|
+
*
|
|
593
|
+
* This method subscribes to the store and selects a single item from the API queue based on the provided ID.
|
|
594
|
+
* It employs a pipeline to fetch the item: the `getApiQueueItem` selector is used to retrieve the item,
|
|
595
|
+
* and a `map` operator processes the result. If the item with the specified ID does not exist in the queue,
|
|
596
|
+
* a warning is logged, and `null` is returned.
|
|
597
|
+
*
|
|
598
|
+
* This method is ideal for accessing a specific queue item when its ID is known, allowing for targeted
|
|
599
|
+
* operations or checks on that particular item.
|
|
600
|
+
*
|
|
601
|
+
* @param {string} id - The unique identifier of the item within the queue.
|
|
602
|
+
* @returns {Observable<ApiQueueItem | null>} An Observable emitting the requested ApiQueueItem.
|
|
603
|
+
* If no item with the given ID exists in the queue, the Observable emits `null`.
|
|
604
|
+
*
|
|
605
|
+
* @example
|
|
606
|
+
* // Example usage
|
|
607
|
+
* this.getQueueItem('item123').subscribe(item => {
|
|
608
|
+
* if (item) {
|
|
609
|
+
* console.log('Found item:', item);
|
|
610
|
+
* } else {
|
|
611
|
+
* console.log('Item not found in the queue');
|
|
612
|
+
* }
|
|
613
|
+
* });
|
|
614
|
+
*/
|
|
615
|
+
getQueueItem(id: string): Observable<ApiQueueItem>;
|
|
616
|
+
/**
|
|
617
|
+
* Removes a specific item from the API queue using its ID.
|
|
618
|
+
*
|
|
619
|
+
* This method dispatches an action to remove an item from the queue, identified by the provided ID.
|
|
620
|
+
* It is essential for managing the queue by eliminating items that are no longer needed or have been processed.
|
|
621
|
+
* The function does not return any value, as it primarily triggers an action within the store.
|
|
622
|
+
*
|
|
623
|
+
* Note: This method assumes the existence of the item in the queue. It does not perform a check
|
|
624
|
+
* to confirm the presence of the item before attempting to remove it. Therefore, it's recommended
|
|
625
|
+
* to verify the item's existence in the queue if uncertainty exists.
|
|
626
|
+
*
|
|
627
|
+
* @param {string} id - The unique identifier of the item to be removed from the queue.
|
|
628
|
+
*
|
|
629
|
+
* @example
|
|
630
|
+
* // Example usage
|
|
631
|
+
* this.removeQueueItem('item123');
|
|
632
|
+
* // The item with ID 'item123' will be dispatched for removal from the queue.
|
|
633
|
+
*/
|
|
634
|
+
removeQueueItem(id: string): void;
|
|
635
|
+
/**
|
|
636
|
+
* Clears all items from the API queue.
|
|
637
|
+
*
|
|
638
|
+
* This method dispatches an action to empty the entire API queue, effectively removing all items that are currently queued.
|
|
639
|
+
* It is useful for scenarios where a complete reset of the queue is required, such as during initialization or after processing
|
|
640
|
+
* a batch of items. The function does not return any value, as its primary purpose is to trigger a state change in the store.
|
|
641
|
+
*
|
|
642
|
+
* Note: Use this method with caution as it will irreversibly clear all items in the queue. Ensure that this action does not
|
|
643
|
+
* disrupt any ongoing processes that rely on the queue's contents.
|
|
644
|
+
*
|
|
645
|
+
* @example
|
|
646
|
+
* // Example usage
|
|
647
|
+
* this.removeAllQueueItem();
|
|
648
|
+
* // This will dispatch an action to empty the entire API queue.
|
|
649
|
+
*/
|
|
650
|
+
removeAllQueueItem(): void;
|
|
651
|
+
/**
|
|
652
|
+
* Processes an item from the API queue identified by its ID.
|
|
653
|
+
*
|
|
654
|
+
* Retrieves the specified item from the queue and applies processing logic as defined in `buildHttpRequest`.
|
|
655
|
+
* If the item is not found, logs a warning and returns an Observable emitting `null`.
|
|
656
|
+
*
|
|
657
|
+
* @param {string} id - The unique identifier of the item within the queue to be processed.
|
|
658
|
+
* @returns {Observable<any>} An Observable that emits the result of processing the queue item.
|
|
659
|
+
* If the item does not exist, the Observable emits `null`.
|
|
660
|
+
*
|
|
661
|
+
* @example
|
|
662
|
+
* // Example usage
|
|
663
|
+
* this.processQueueItem('item123').subscribe(result => {
|
|
664
|
+
* if (result) {
|
|
665
|
+
* console.log('Processing result:', result);
|
|
666
|
+
* } else {
|
|
667
|
+
* console.log('Item not found in the queue');
|
|
668
|
+
* }
|
|
669
|
+
* });
|
|
670
|
+
*/
|
|
671
|
+
processQueueItem<T>(id: string): Observable<T>;
|
|
672
|
+
/**
|
|
673
|
+
* Processes all items in the API queue and collects their responses.
|
|
674
|
+
*
|
|
675
|
+
* Iterates over each item in the queue and processes them using `buildHttpRequest`. If a request fails,
|
|
676
|
+
* the method can either continue processing the remaining items or stop, based on the `continueOnError` parameter.
|
|
677
|
+
* It returns an Observable that emits an array containing the responses or errors from all the processed items.
|
|
678
|
+
*
|
|
679
|
+
* The function currently returns `Observable<any[]>` indicating an array of any type. Future improvements
|
|
680
|
+
* should aim to specify a more accurate return type or utilize generics for increased type safety.
|
|
681
|
+
*
|
|
682
|
+
* @param {boolean} [continueOnError=true] - Determines whether to continue with the next item in the queue
|
|
683
|
+
* after a request failure. Defaults to `true`.
|
|
684
|
+
* @returns {Observable<any[]>} An Observable emitting an array of either responses or errors from the processed
|
|
685
|
+
* queue items.
|
|
686
|
+
*
|
|
687
|
+
* @example
|
|
688
|
+
* this.processAllQueueItems().subscribe(results => {
|
|
689
|
+
* // Handle the array of responses or errors
|
|
690
|
+
* });
|
|
691
|
+
*/
|
|
692
|
+
processAllQueueItems<T>(continueOnError?: boolean): Observable<T[]>;
|
|
693
|
+
/**
|
|
694
|
+
* Processes all items in the queue sequentially, based on their timestamp ordering.
|
|
695
|
+
*
|
|
696
|
+
* This method first orders the items in the API queue by their timestamp, either in ascending or descending
|
|
697
|
+
* order as specified by the `ascending` parameter. It then processes each item using `buildHttpRequest`, ensuring
|
|
698
|
+
* that each request is completed before the next begins. This sequential processing is crucial when the order of
|
|
699
|
+
* execution matters for HTTP requests in the queue. The method returns an Observable that emits the responses
|
|
700
|
+
* following the same order as the queue items were processed.
|
|
701
|
+
*
|
|
702
|
+
* The function currently returns `Observable<any>`, indicating a broad type. Future improvements should focus on
|
|
703
|
+
* specifying a more accurate return type or utilizing generics for increased type safety.
|
|
704
|
+
*
|
|
705
|
+
* @param {boolean} [ascending=true] - Determines whether the queue items are processed in ascending order of their
|
|
706
|
+
* timestamp. Defaults to `true`.
|
|
707
|
+
* @returns {Observable<any>} An Observable emitting the responses of the HTTP requests in the order they were processed.
|
|
708
|
+
*
|
|
709
|
+
* @example
|
|
710
|
+
* this.processAllQueueItemsSequential().subscribe(response => {
|
|
711
|
+
* // Handle each response in the order of queue processing
|
|
712
|
+
* });
|
|
713
|
+
*/
|
|
714
|
+
processAllQueueItemsSequential<T>(ascending?: boolean): Observable<T>;
|
|
715
|
+
/**
|
|
716
|
+
* Compares two queue items based on their timestamp and determines their order.
|
|
717
|
+
*
|
|
718
|
+
* This protected method is used to sort queue items. It takes two queue items as input, each represented
|
|
719
|
+
* as a tuple containing an item ID and the `ApiQueueItem` object. The method compares these items based on
|
|
720
|
+
* the `timestamp` property of the `ApiQueueItem` objects. It returns a number indicating the order in which
|
|
721
|
+
* these items should be sorted.
|
|
722
|
+
*
|
|
723
|
+
* A positive return value indicates that the first item should come after the second, a negative value
|
|
724
|
+
* indicates the opposite, and zero indicates that they are equal in terms of timestamp.
|
|
725
|
+
*
|
|
726
|
+
* @param {[string, ApiQueueItem]} a - The first queue item tuple for comparison.
|
|
727
|
+
* @param {[string, ApiQueueItem]} b - The second queue item tuple for comparison.
|
|
728
|
+
* @returns {number} A number indicating the order of the items: negative if `a` is earlier than `b`,
|
|
729
|
+
* positive if `a` is later than `b`, and zero if they are equal.
|
|
730
|
+
* @beta
|
|
731
|
+
*/
|
|
732
|
+
protected sortOnTimestamp(a: [string, ApiQueueItem], b: [string, ApiQueueItem]): number;
|
|
733
|
+
/**
|
|
734
|
+
* Constructs and executes an HTTP request based on the provided queue item details.
|
|
735
|
+
*
|
|
736
|
+
* This private method takes an ID and an `ApiQueueItem` object to build and execute an HTTP request.
|
|
737
|
+
* It determines the HTTP method (like GET, POST, etc.) from the `method` property of the `ApiQueueItem`,
|
|
738
|
+
* and uses the `uri` and `payload` properties for the request's URL and body, respectively. After the
|
|
739
|
+
* request is executed, the corresponding queue item is removed from the queue.
|
|
740
|
+
*
|
|
741
|
+
* The method is generic, allowing the caller to specify the expected response type `T`. By default,
|
|
742
|
+
* it uses `any` type, but specifying a more concrete type enhances type safety and clarity in usage.
|
|
743
|
+
*
|
|
744
|
+
* @param {string} id - The ID of the queue item being processed.
|
|
745
|
+
* @param {ApiQueueItem} item - The queue item containing details for the HTTP request.
|
|
746
|
+
* @returns {Observable<T>} An Observable of type T, representing the response of the HTTP request.
|
|
747
|
+
*
|
|
748
|
+
* @example
|
|
749
|
+
* // Example usage for a specific response type
|
|
750
|
+
* this.buildHttpRequest<MyResponseType>('item123', queueItem)
|
|
751
|
+
* .subscribe(response => {
|
|
752
|
+
* // Handle the response
|
|
753
|
+
* });
|
|
754
|
+
*
|
|
755
|
+
* @template T - The expected type of the HTTP response. Defaults to `any`.
|
|
756
|
+
*/
|
|
757
|
+
private buildHttpRequest;
|
|
758
|
+
/**
|
|
759
|
+
* A state reducer that adds an item to the API queue.
|
|
760
|
+
* @param state
|
|
761
|
+
* @param action
|
|
762
|
+
*/
|
|
763
|
+
private addApiQueueItem;
|
|
764
|
+
/**
|
|
765
|
+
* A state reducer that removes an item from the API queue.
|
|
766
|
+
* @param state
|
|
767
|
+
* @param action
|
|
768
|
+
*/
|
|
769
|
+
private removeApiQueueItem;
|
|
770
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ApiQueueService, never>;
|
|
771
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
772
|
+
}
|
|
773
|
+
export declare class ApiQueueServiceMock extends ApiQueueService {
|
|
774
|
+
constructor();
|
|
775
|
+
getQueue(): Observable<ApiQueueItem[]>;
|
|
776
|
+
getQueueItem(id: string): Observable<ApiQueueItem>;
|
|
777
|
+
removeAllQueueItem(): void;
|
|
778
|
+
processAllQueueItems<T>(): Observable<T>;
|
|
779
|
+
addQueueItem(): void;
|
|
780
|
+
removeQueueItem(): void;
|
|
781
|
+
processQueueItem<T>(): Observable<T>;
|
|
782
|
+
}
|
|
816
783
|
/**
|
|
817
784
|
* Converts legacy ngx-translate interpolations ({{var}}) to ICU-compatible format ({var}).
|
|
818
785
|
* Double braces are never valid ICU syntax, so any {{word}} is guaranteed to be legacy.
|
|
819
786
|
*/
|
|
820
|
-
declare function convertLegacyInterpolations(value: string): string;
|
|
787
|
+
export declare function convertLegacyInterpolations(value: string): string;
|
|
821
788
|
/**
|
|
822
789
|
* Recursively walks a translation object and converts all legacy {{var}} interpolations
|
|
823
790
|
* to ICU-compatible {var} format in string leaf values.
|
|
824
791
|
*/
|
|
825
|
-
declare function transformTranslations<T>(translations: T): T;
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
getPath(lang: string): string;
|
|
861
|
-
}
|
|
862
|
-
|
|
863
|
-
interface ResourceError {
|
|
864
|
-
isError: boolean;
|
|
865
|
-
error?: string;
|
|
866
|
-
resource?: I18nResourceImpl;
|
|
792
|
+
export declare function transformTranslations<T>(translations: T): T;
|
|
793
|
+
export declare class I18nResourceImpl {
|
|
794
|
+
protected prefix: string;
|
|
795
|
+
protected suffix: string;
|
|
796
|
+
protected compileTranslationsFn: (translations: unknown, lang: string) => unknown;
|
|
797
|
+
/**
|
|
798
|
+
* Resource constructor
|
|
799
|
+
*
|
|
800
|
+
* @param prefix the prefix of the resource
|
|
801
|
+
* @param suffix the suffix of the resource, optional parameter
|
|
802
|
+
* @param compileTranslationsFn compiler function, optional parameter
|
|
803
|
+
*/
|
|
804
|
+
constructor(prefix: string, suffix?: string, compileTranslationsFn?: (translations: unknown, lang: string) => unknown);
|
|
805
|
+
/**
|
|
806
|
+
* Translations pre-processor
|
|
807
|
+
*
|
|
808
|
+
* @param translations the object to be pre-processed
|
|
809
|
+
* @param lang the translations language
|
|
810
|
+
* @returns the pre-processed translations
|
|
811
|
+
*/
|
|
812
|
+
compileTranslations(translations: unknown, lang: string): unknown;
|
|
813
|
+
/**
|
|
814
|
+
* Indicates whether other object is equal-to this one.
|
|
815
|
+
*
|
|
816
|
+
* @param obj the reference object with which to compare
|
|
817
|
+
* @returns true if this object is the same as obj, false otherwise
|
|
818
|
+
*/
|
|
819
|
+
equals(obj: I18nResourceImpl): boolean;
|
|
820
|
+
/**
|
|
821
|
+
* The path to the resource
|
|
822
|
+
*
|
|
823
|
+
* @param lang the resource language
|
|
824
|
+
* @returns the path
|
|
825
|
+
*/
|
|
826
|
+
getPath(lang: string): string;
|
|
867
827
|
}
|
|
868
|
-
interface
|
|
869
|
-
|
|
828
|
+
interface ResourceError {
|
|
829
|
+
isError: boolean;
|
|
830
|
+
error?: string;
|
|
831
|
+
resource?: I18nResourceImpl;
|
|
832
|
+
}
|
|
833
|
+
export interface LoadedResources {
|
|
834
|
+
translations: TranslationObject;
|
|
835
|
+
hasError: boolean;
|
|
836
|
+
errors?: Array<LoadedResourcesError>;
|
|
837
|
+
}
|
|
838
|
+
export interface LoadedResourcesError {
|
|
839
|
+
resource: I18nResourceImpl;
|
|
840
|
+
error: string;
|
|
841
|
+
}
|
|
842
|
+
export interface TranslationKeys {
|
|
843
|
+
[key: string]: string;
|
|
844
|
+
}
|
|
845
|
+
export declare class I18nLoader implements TranslateLoader {
|
|
846
|
+
protected http: HttpClient;
|
|
847
|
+
protected logService: LogService;
|
|
848
|
+
protected euiAppConfig: EuiAppConfig;
|
|
849
|
+
protected resources: I18nResourceImpl[];
|
|
850
|
+
protected failedResources: Array<LoadedResourcesError>;
|
|
851
|
+
private logger;
|
|
852
|
+
private icuEnabled;
|
|
853
|
+
constructor();
|
|
854
|
+
/**
|
|
855
|
+
* Gets the translations from the server
|
|
856
|
+
*
|
|
857
|
+
* @param lang
|
|
858
|
+
* @returns Observable<object>
|
|
859
|
+
*/
|
|
860
|
+
getTranslation(lang: string): Observable<TranslationObject>;
|
|
861
|
+
/**
|
|
862
|
+
* Adds resources
|
|
863
|
+
*
|
|
864
|
+
* @param config loader configuration
|
|
865
|
+
* @returns Observable<any> | false
|
|
866
|
+
*/
|
|
867
|
+
addResources(config: I18nLoaderConfig): I18nResourceImpl[];
|
|
868
|
+
/**
|
|
869
|
+
* Removes resources from the loader instance
|
|
870
|
+
*/
|
|
871
|
+
removeResources(removedResources: I18nResourceImpl[]): void;
|
|
872
|
+
/**
|
|
873
|
+
* Loads an array of resources, by language
|
|
874
|
+
*
|
|
875
|
+
* @param resources the definition of the resources
|
|
876
|
+
* @param lang the resource language to load
|
|
877
|
+
* @returns Observable<any>
|
|
878
|
+
*/
|
|
879
|
+
loadResources(resources: I18nResourceImpl[], lang: string): Observable<{
|
|
870
880
|
hasError: boolean;
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
* @param config loader configuration
|
|
900
|
-
* @returns Observable<any> | false
|
|
901
|
-
*/
|
|
902
|
-
addResources(config: I18nLoaderConfig): I18nResourceImpl[];
|
|
903
|
-
/**
|
|
904
|
-
* Removes resources from the loader instance
|
|
905
|
-
*/
|
|
906
|
-
removeResources(removedResources: I18nResourceImpl[]): void;
|
|
907
|
-
/**
|
|
908
|
-
* Loads an array of resources, by language
|
|
909
|
-
*
|
|
910
|
-
* @param resources the definition of the resources
|
|
911
|
-
* @param lang the resource language to load
|
|
912
|
-
* @returns Observable<any>
|
|
913
|
-
*/
|
|
914
|
-
loadResources(resources: I18nResourceImpl[], lang: string): Observable<{
|
|
915
|
-
hasError: boolean;
|
|
916
|
-
translations: TranslationObject;
|
|
917
|
-
errors?: LoadedResourcesError[];
|
|
918
|
-
}>;
|
|
919
|
-
/**
|
|
920
|
-
* Returns resources that failed
|
|
921
|
-
*/
|
|
922
|
-
getFailedResources(): Array<LoadedResourcesError>;
|
|
923
|
-
/**
|
|
924
|
-
* Create resources from a config file
|
|
925
|
-
*
|
|
926
|
-
* @param config loader configuration
|
|
927
|
-
* @returns I18nResourceImpl[] resources
|
|
928
|
-
*/
|
|
929
|
-
protected createResources(config: I18nLoaderConfig): I18nResourceImpl[];
|
|
930
|
-
/**
|
|
931
|
-
* Loads a resource, by language
|
|
932
|
-
*
|
|
933
|
-
* @param resource the definition of the resource
|
|
934
|
-
* @param lang the resource language to load
|
|
935
|
-
* @returns Observable<any>
|
|
936
|
-
*/
|
|
937
|
-
protected loadResource(resource: I18nResourceImpl, lang: string): Observable<TranslationKeys | ResourceError>;
|
|
938
|
-
private getResourceCompileFunction;
|
|
939
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<I18nLoader, never>;
|
|
940
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<I18nLoader>;
|
|
941
|
-
}
|
|
942
|
-
declare const translateConfig: {
|
|
943
|
-
loader: i0.ClassProvider;
|
|
881
|
+
translations: TranslationObject;
|
|
882
|
+
errors?: LoadedResourcesError[];
|
|
883
|
+
}>;
|
|
884
|
+
/**
|
|
885
|
+
* Returns resources that failed
|
|
886
|
+
*/
|
|
887
|
+
getFailedResources(): Array<LoadedResourcesError>;
|
|
888
|
+
/**
|
|
889
|
+
* Create resources from a config file
|
|
890
|
+
*
|
|
891
|
+
* @param config loader configuration
|
|
892
|
+
* @returns I18nResourceImpl[] resources
|
|
893
|
+
*/
|
|
894
|
+
protected createResources(config: I18nLoaderConfig): I18nResourceImpl[];
|
|
895
|
+
/**
|
|
896
|
+
* Loads a resource, by language
|
|
897
|
+
*
|
|
898
|
+
* @param resource the definition of the resource
|
|
899
|
+
* @param lang the resource language to load
|
|
900
|
+
* @returns Observable<any>
|
|
901
|
+
*/
|
|
902
|
+
protected loadResource(resource: I18nResourceImpl, lang: string): Observable<TranslationKeys | ResourceError>;
|
|
903
|
+
private getResourceCompileFunction;
|
|
904
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<I18nLoader, never>;
|
|
905
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
906
|
+
}
|
|
907
|
+
export declare const translateConfig: {
|
|
908
|
+
loader: import("@angular/core").ClassProvider;
|
|
944
909
|
};
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
}
|
|
1041
|
-
|
|
910
|
+
export interface ModuleLoadEvent {
|
|
911
|
+
ready: boolean;
|
|
912
|
+
name: string;
|
|
913
|
+
error?: any;
|
|
914
|
+
}
|
|
915
|
+
export declare class I18nService<T extends I18nState = I18nState> extends EuiLazyService<T | I18nState> implements OnDestroy {
|
|
916
|
+
protected config: I18nServiceConfig;
|
|
917
|
+
protected onModuleLoad: BehaviorSubject<ModuleLoadEvent>;
|
|
918
|
+
protected baseGlobalConfig: GlobalConfig<any>;
|
|
919
|
+
protected translateService: TranslateService;
|
|
920
|
+
protected logService: LogService;
|
|
921
|
+
private translateLoader;
|
|
922
|
+
protected store: StoreService<T>;
|
|
923
|
+
private static readonly DEFAULT_STATE;
|
|
924
|
+
private document;
|
|
925
|
+
/**
|
|
926
|
+
* a single signal holding the state - initial state is null
|
|
927
|
+
*/
|
|
928
|
+
private state;
|
|
929
|
+
/**
|
|
930
|
+
* a BehaviorSubject holding the state - initial state is null
|
|
931
|
+
* This is the main source of truth for the state
|
|
932
|
+
*/
|
|
933
|
+
private stateSubject;
|
|
934
|
+
private subNotifier;
|
|
935
|
+
constructor();
|
|
936
|
+
ngOnDestroy(): void;
|
|
937
|
+
getState(): Observable<T>;
|
|
938
|
+
/**
|
|
939
|
+
* @deprecated this will be removed in a future version
|
|
940
|
+
* @param mapFn
|
|
941
|
+
*/
|
|
942
|
+
getState<K = T>(mapFn?: (state: T) => K): Observable<K>;
|
|
943
|
+
getState<a extends keyof DeepPartial<T>>(key?: a): Observable<DeepPartial<a>>;
|
|
944
|
+
updateState(state: DeepPartial<T>): void;
|
|
945
|
+
/**
|
|
946
|
+
* @deprecated it will be removed in next version. Use updateState(partialState: DeepPartial<T>) instead
|
|
947
|
+
* @param slice
|
|
948
|
+
* @param reducer
|
|
949
|
+
*/
|
|
950
|
+
updateState(slice: DeepPartial<T>, reducer: (state: T, action: DeepPartial<T>) => T): void;
|
|
951
|
+
/**
|
|
952
|
+
* This method is used to get the state as readonly signal.
|
|
953
|
+
*/
|
|
954
|
+
getSignal(): Signal<T>;
|
|
955
|
+
init(langState?: T): Observable<EuiServiceStatus>;
|
|
956
|
+
/**
|
|
957
|
+
* A pipe function that could serve as a wrapper of another observable
|
|
958
|
+
* e.g. ngx-translate i18n.onReady('my_module').pipe(switchMap(()=>translate.get('eui.KEY')));
|
|
959
|
+
* WARNING: onReady will emit only once for a loaded Module, going to another and then going back will not result
|
|
960
|
+
* into another emission.
|
|
961
|
+
*
|
|
962
|
+
* @param moduleName the name of the module that has been given through the eUI globalConfig. In case non provided
|
|
963
|
+
* fetch module name from the state.
|
|
964
|
+
*/
|
|
965
|
+
onReady(moduleName?: string): Observable<ModuleLoadEvent>;
|
|
966
|
+
lazyLoad(config: I18nLoaderConfig): Observable<EuiServiceStatus>;
|
|
967
|
+
lazyLoadInit(moduleConfig: ModuleConfig, moduleName?: string): Observable<EuiServiceStatus>;
|
|
968
|
+
/**
|
|
969
|
+
* Add resources based of a config loader
|
|
970
|
+
*
|
|
971
|
+
* @param config I18nLoaderConfig
|
|
972
|
+
* @param moduleName
|
|
973
|
+
* @return Promise<EuiServiceStatus> an EuiServiceStatus when translation has fully loaded
|
|
974
|
+
*/
|
|
975
|
+
addResources(config: I18nLoaderConfig, moduleName?: string): Observable<EuiServiceStatus>;
|
|
976
|
+
/**
|
|
977
|
+
* Prepares the default language
|
|
978
|
+
*/
|
|
979
|
+
private preparedDefaultLanguage;
|
|
980
|
+
/**
|
|
981
|
+
* @param initLanguage if given default language to override default language coming from the
|
|
982
|
+
* configuration token.
|
|
983
|
+
*/
|
|
984
|
+
private setup;
|
|
985
|
+
private bindActiveLangStateToTranslateService;
|
|
986
|
+
private bindTranslateServiceLangChangeToState;
|
|
987
|
+
private setDefaultLanguage;
|
|
988
|
+
/**
|
|
989
|
+
* change the currently used language
|
|
990
|
+
*
|
|
991
|
+
* @param lang is the language code based on the convention you used e.g. (en or en-EN)
|
|
992
|
+
* @returns Observable that returns an object contain the object translation for given language after language
|
|
993
|
+
* fully loaded.
|
|
994
|
+
*/
|
|
995
|
+
private use;
|
|
996
|
+
/**
|
|
997
|
+
* updates the HTML element lang attribute
|
|
998
|
+
*
|
|
999
|
+
* @private
|
|
1000
|
+
*/
|
|
1001
|
+
private updateHTMLDOMLang;
|
|
1002
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<I18nService<any>, never>;
|
|
1003
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
1004
|
+
}
|
|
1042
1005
|
/**
|
|
1043
1006
|
* Service for managing user permissions within the application.
|
|
1044
1007
|
* This class extends `EuiService` and is responsible for handling user rights and permissions.
|
|
@@ -1056,832 +1019,819 @@ declare class I18nService<T extends I18nState = I18nState> extends EuiLazyServic
|
|
|
1056
1019
|
* console.log('User has ADMIN rights');
|
|
1057
1020
|
* }
|
|
1058
1021
|
*/
|
|
1059
|
-
declare class EuiPermissionService extends EuiService<EuiUserRight[]> {
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
}
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
EH: string;
|
|
1620
|
-
YE: string;
|
|
1621
|
-
ZM: string;
|
|
1622
|
-
ZW: string;
|
|
1022
|
+
export declare class EuiPermissionService extends EuiService<EuiUserRight[]> {
|
|
1023
|
+
private log;
|
|
1024
|
+
protected store: StoreService<any>;
|
|
1025
|
+
private readonly logger;
|
|
1026
|
+
constructor();
|
|
1027
|
+
/**
|
|
1028
|
+
* Initializes the permission service with a set of user rights.
|
|
1029
|
+
* This method sets up the initial state of the service based on the provided user rights.
|
|
1030
|
+
* It should be called before using other methods of the service to ensure it is properly configured.
|
|
1031
|
+
*
|
|
1032
|
+
* @param {EuiUserRight[]} rights - An array of user rights to initialize the service with.
|
|
1033
|
+
* Each `EuiUserRight` object should contain at least an `id` property,
|
|
1034
|
+
* and optionally a `permissions` property which is an array of strings.
|
|
1035
|
+
*
|
|
1036
|
+
* @returns {Observable<EuiServiceStatus>} An Observable that emits the status of the initialization.
|
|
1037
|
+
* The status object includes a `success` boolean indicating
|
|
1038
|
+
* whether the initialization was successful, and an `error` property
|
|
1039
|
+
* with a message in case of failure.
|
|
1040
|
+
*
|
|
1041
|
+
* @example
|
|
1042
|
+
* // Example of initializing the service with two user rights
|
|
1043
|
+
* const userRights = [
|
|
1044
|
+
* { id: 'ADMIN', permissions: ['CREATE', 'READ', 'UPDATE', 'DELETE'] },
|
|
1045
|
+
* { id: 'USER', permissions: ['READ'] }
|
|
1046
|
+
* ];
|
|
1047
|
+
* permissionService.init(userRights).subscribe(status => {
|
|
1048
|
+
* if (status.success) {
|
|
1049
|
+
* console.log('Initialization successful');
|
|
1050
|
+
* } else {
|
|
1051
|
+
* console.error('Initialization failed:', status.error);
|
|
1052
|
+
* }
|
|
1053
|
+
* });
|
|
1054
|
+
*
|
|
1055
|
+
* @throws {Error} Throws an error if the `rights` parameter is not an array of `EuiUserRight` objects.
|
|
1056
|
+
*/
|
|
1057
|
+
init(rights: EuiUserRight[]): Observable<EuiServiceStatus>;
|
|
1058
|
+
/**
|
|
1059
|
+
* Retrieves the current user rights from the service's state.
|
|
1060
|
+
* This getter provides access to the array of `EuiUserRight` objects that represent the current rights
|
|
1061
|
+
* of the user. It is a protected method, intended for internal use within the service or by subclasses.
|
|
1062
|
+
*
|
|
1063
|
+
* @returns {EuiUserRight[]} An array of `EuiUserRight` objects representing the current user rights.
|
|
1064
|
+
* Each `EuiUserRight` object typically contains an `id` property, and may
|
|
1065
|
+
* also include a `permissions` property which is an array of strings.
|
|
1066
|
+
*
|
|
1067
|
+
* @example
|
|
1068
|
+
* // Example of accessing user rights within a subclass or within the service
|
|
1069
|
+
* const currentRights = this.userRights;
|
|
1070
|
+
* currentRights.forEach(right => {
|
|
1071
|
+
* console.log(`Right ID: ${right.id}, Permissions: ${right.permissions.join(', ')}`);
|
|
1072
|
+
* });
|
|
1073
|
+
*
|
|
1074
|
+
* @protected
|
|
1075
|
+
*/
|
|
1076
|
+
protected get userRights(): EuiUserRight[];
|
|
1077
|
+
/**
|
|
1078
|
+
* Retrieves the current state of user rights by subscribing to changes.
|
|
1079
|
+
* This method is used to access the current state of user rights in the service. It returns an Observable
|
|
1080
|
+
* that emits the current user rights. The method is generic and can be parameterized to return a specific
|
|
1081
|
+
* type that extends from `EuiUserRight[]`.
|
|
1082
|
+
*
|
|
1083
|
+
* @template K - The type of the user rights state to be returned. Defaults to `EuiUserRight[]` if not specified.
|
|
1084
|
+
*
|
|
1085
|
+
* @returns {Observable<K>} An Observable that emits the current state of user rights.
|
|
1086
|
+
* The type of the emitted value is `K`, which is `EuiUserRight[]` by default.
|
|
1087
|
+
*
|
|
1088
|
+
* @example
|
|
1089
|
+
* // Example of subscribing to the user rights state
|
|
1090
|
+
* permissionService.getState().subscribe(currentRights => {
|
|
1091
|
+
* console.log('Current User Rights:', currentRights);
|
|
1092
|
+
* });
|
|
1093
|
+
*
|
|
1094
|
+
* // Example with a specific type
|
|
1095
|
+
* permissionService.getState<CustomUserRightType[]>().subscribe(customRights => {
|
|
1096
|
+
* console.log('Custom User Rights:', customRights);
|
|
1097
|
+
* });
|
|
1098
|
+
*/
|
|
1099
|
+
getState<K = EuiUserRight[]>(): Observable<K>;
|
|
1100
|
+
/**
|
|
1101
|
+
* Updates the state of the service with a new set of user rights.
|
|
1102
|
+
* This method is used to modify the current user rights in the service. It takes an array of `EuiUserRight`
|
|
1103
|
+
* objects and updates the service's state. This change is then propagated to all subscribers of the state.
|
|
1104
|
+
*
|
|
1105
|
+
* @param {EuiUserRight[]} rights - An array of `EuiUserRight` objects to update the service's state with.
|
|
1106
|
+
* Each `EuiUserRight` object should contain an `id` property,
|
|
1107
|
+
* and optionally a `permissions` property which is an array of strings.
|
|
1108
|
+
*
|
|
1109
|
+
* @example
|
|
1110
|
+
* // Example of updating the service's state with new user rights
|
|
1111
|
+
* const newUserRights = [
|
|
1112
|
+
* { id: 'USER', permissions: ['READ', 'COMMENT'] },
|
|
1113
|
+
* { id: 'MODERATOR', permissions: ['READ', 'WRITE', 'DELETE'] }
|
|
1114
|
+
* ];
|
|
1115
|
+
* permissionService.updateState(newUserRights);
|
|
1116
|
+
*/
|
|
1117
|
+
updateState(rights: EuiUserRight[]): void;
|
|
1118
|
+
/**
|
|
1119
|
+
* Checks if the user has the specified attribute permission.
|
|
1120
|
+
* This method interprets a string that represents a combination of rights and/or permissions
|
|
1121
|
+
* and determines whether the user has the specified permissions. The string format can be
|
|
1122
|
+
* 'RIGHT.PERMISSION' or just 'RIGHT'. For multiple rights, it can be 'RIGHT1.RIGHT2.PERMISSION'.
|
|
1123
|
+
*
|
|
1124
|
+
* @param {string} rightsAndPermission - A string representing the rights and/or permissions to check.
|
|
1125
|
+
* Format can be 'RIGHT', 'RIGHT.PERMISSION', or 'RIGHT1.RIGHT2.PERMISSION'.
|
|
1126
|
+
*
|
|
1127
|
+
* @returns {boolean} True if the user has the specified attribute permission, false otherwise.
|
|
1128
|
+
*
|
|
1129
|
+
* @example
|
|
1130
|
+
* // Check a single right
|
|
1131
|
+
* const hasRight = permissionService.checkAttributePermission('VIEW');
|
|
1132
|
+
*
|
|
1133
|
+
* // Check a right with a specific permission
|
|
1134
|
+
* const hasRightWithPermission = permissionService.checkAttributePermission('EDIT.APPROVE');
|
|
1135
|
+
*
|
|
1136
|
+
* // Check multiple rights with a specific permission
|
|
1137
|
+
* const hasMultipleRights = permissionService.checkAttributePermission('ADMIN.VIEW.APPROVE');
|
|
1138
|
+
*/
|
|
1139
|
+
checkAttributePermission(rightsAndPermission: string): boolean;
|
|
1140
|
+
/**
|
|
1141
|
+
* Checks if the user has a specific right.
|
|
1142
|
+
* This method determines whether the user possesses a particular right identified by its ID.
|
|
1143
|
+
*
|
|
1144
|
+
* @param {string} rightId - The ID of the right to check.
|
|
1145
|
+
*
|
|
1146
|
+
* @returns {boolean} True if the user has the specified right, false otherwise.
|
|
1147
|
+
*
|
|
1148
|
+
* @example
|
|
1149
|
+
* // Check if the user has the 'ADMIN' right
|
|
1150
|
+
* const isAdmin = permissionService.checkRight('ADMIN');
|
|
1151
|
+
*/
|
|
1152
|
+
checkRight(rightId: string): boolean;
|
|
1153
|
+
/**
|
|
1154
|
+
* Checks if the user has a specific permission within a right.
|
|
1155
|
+
* This method determines whether the user has a specific permission associated with a given right.
|
|
1156
|
+
*
|
|
1157
|
+
* @param {string} rightId - The ID of the right.
|
|
1158
|
+
* @param {string} permission - The permission to check within the right.
|
|
1159
|
+
*
|
|
1160
|
+
* @returns {boolean} True if the user has the specified permission in the given right, false otherwise.
|
|
1161
|
+
*
|
|
1162
|
+
* @example
|
|
1163
|
+
* // Check if the user has 'APPROVE' permission in the 'EDIT' right
|
|
1164
|
+
* const canApproveEdit = permissionService.checkPermission('EDIT', 'APPROVE');
|
|
1165
|
+
*/
|
|
1166
|
+
checkPermission(rightId: string, permission: string): boolean;
|
|
1167
|
+
/**
|
|
1168
|
+
* Checks if the user has all the specified rights.
|
|
1169
|
+
* This private method determines whether the user possesses all the rights provided in the array.
|
|
1170
|
+
* Each right in the array is checked against the user's current rights.
|
|
1171
|
+
*
|
|
1172
|
+
* @param {EuiUserRight[]} rights - An array of rights to check against the user's rights.
|
|
1173
|
+
*
|
|
1174
|
+
* @returns {boolean} True if the user has all the specified rights, false otherwise.
|
|
1175
|
+
*
|
|
1176
|
+
* @example
|
|
1177
|
+
* // Example usage within the service
|
|
1178
|
+
* const requiredRights = [{ id: 'VIEW' }, { id: 'EDIT' }];
|
|
1179
|
+
* const hasAllRequiredRights = this.haveAllRights(requiredRights);
|
|
1180
|
+
*
|
|
1181
|
+
* @private
|
|
1182
|
+
*/
|
|
1183
|
+
private haveAllRights;
|
|
1184
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EuiPermissionService, never>;
|
|
1185
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
1186
|
+
}
|
|
1187
|
+
export declare class EuiDynamicMenuService {
|
|
1188
|
+
menuLinks: Array<EuiMenuItem>;
|
|
1189
|
+
private euiPermission;
|
|
1190
|
+
private store;
|
|
1191
|
+
constructor();
|
|
1192
|
+
getMenuLinks(): EuiMenuItem[];
|
|
1193
|
+
filterEuiMenuItemsWithRights(links: Array<EuiMenuItem>): Array<EuiMenuItem>;
|
|
1194
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EuiDynamicMenuService, never>;
|
|
1195
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
1196
|
+
}
|
|
1197
|
+
export declare const DYNAMIC_COMPONENT_CONFIG: InjectionToken<object>;
|
|
1198
|
+
export declare class EuiDynamicComponentService {
|
|
1199
|
+
private injector;
|
|
1200
|
+
private appRef;
|
|
1201
|
+
private portalHost;
|
|
1202
|
+
private portal;
|
|
1203
|
+
private portalComponentInstance;
|
|
1204
|
+
/**
|
|
1205
|
+
* Adds a component to portal host dynamically
|
|
1206
|
+
* @param component The component to be injected
|
|
1207
|
+
* @param el The element reference for the component to be injected
|
|
1208
|
+
* @param config The data to be passed (config) for the DYNAMIC_COMPONENT_CONFIG token
|
|
1209
|
+
*/
|
|
1210
|
+
add<T>(component: ComponentType<T>, el?: ElementRef, config?: any): any;
|
|
1211
|
+
/**
|
|
1212
|
+
* detaches a portalHost
|
|
1213
|
+
* @param portalHostRef reference of portal host to be detached
|
|
1214
|
+
*/
|
|
1215
|
+
remove(portalHostRef: DomPortalOutlet): void;
|
|
1216
|
+
/**
|
|
1217
|
+
* creates a custom injector to be used when providing custom injection tokens to components inside a portal
|
|
1218
|
+
* @param data to be used by DYNAMIC_COMPONENT_CONFIG token
|
|
1219
|
+
*/
|
|
1220
|
+
private createInjector;
|
|
1221
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EuiDynamicComponentService, never>;
|
|
1222
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
1223
|
+
}
|
|
1224
|
+
export interface UIState<BP = any, DI = any, AMD = any, BPV = any> {
|
|
1225
|
+
appName?: string;
|
|
1226
|
+
appShortName?: string;
|
|
1227
|
+
appSubTitle?: string;
|
|
1228
|
+
appBaseFontSize?: string;
|
|
1229
|
+
isSidebarOpen?: boolean;
|
|
1230
|
+
isSidebarActive?: boolean;
|
|
1231
|
+
hasSidebar?: boolean;
|
|
1232
|
+
hasSideContainer?: boolean;
|
|
1233
|
+
hasBreadcrumb?: boolean;
|
|
1234
|
+
hasHeader?: boolean;
|
|
1235
|
+
isShrinkHeaderActive?: boolean;
|
|
1236
|
+
hasHeaderLogo?: boolean;
|
|
1237
|
+
hasHeaderEnvironment?: boolean;
|
|
1238
|
+
hasToolbar?: boolean;
|
|
1239
|
+
hasToolbarMegaMenu?: boolean;
|
|
1240
|
+
hasToolbarMenu?: boolean;
|
|
1241
|
+
environmentValue?: string;
|
|
1242
|
+
isSidebarHidden?: boolean;
|
|
1243
|
+
isSidebarFocused?: boolean;
|
|
1244
|
+
hasSidebarCollapsedVariant?: boolean;
|
|
1245
|
+
hasTopMessage?: boolean;
|
|
1246
|
+
hasFixedPosition?: boolean;
|
|
1247
|
+
windowWidth?: number;
|
|
1248
|
+
windowHeight?: number;
|
|
1249
|
+
mainContentHeight?: number;
|
|
1250
|
+
pageHeaderHeight?: number;
|
|
1251
|
+
breakpoint?: string;
|
|
1252
|
+
wrapperClasses?: string;
|
|
1253
|
+
breakpoints?: BP;
|
|
1254
|
+
breakpointValues?: BPV;
|
|
1255
|
+
menuLinks?: EuiMenuItem[];
|
|
1256
|
+
sidebarLinks?: EuiMenuItem[];
|
|
1257
|
+
combinedLinks?: EuiMenuItem[];
|
|
1258
|
+
isBlockDocumentActive?: boolean;
|
|
1259
|
+
deviceInfo: DI;
|
|
1260
|
+
activeLanguage: string;
|
|
1261
|
+
languages: (string | EuiLanguage)[];
|
|
1262
|
+
appMetadata: AMD;
|
|
1263
|
+
hasModalActive?: boolean;
|
|
1264
|
+
isDimmerActive?: boolean;
|
|
1265
|
+
}
|
|
1266
|
+
export declare class EuiAppShellService {
|
|
1267
|
+
navigationStartCustomHandler: () => void;
|
|
1268
|
+
navigationEndCustomHandler: () => void;
|
|
1269
|
+
protected config: GlobalConfig<any>;
|
|
1270
|
+
private http;
|
|
1271
|
+
private platformId;
|
|
1272
|
+
private document;
|
|
1273
|
+
private router;
|
|
1274
|
+
private storeService;
|
|
1275
|
+
private i18nService;
|
|
1276
|
+
get state$(): Observable<UIState>;
|
|
1277
|
+
get breakpoint$(): Observable<string>;
|
|
1278
|
+
get breakpoints$(): Observable<any>;
|
|
1279
|
+
get state(): UIState;
|
|
1280
|
+
set isSidebarOpen(isOpen: boolean);
|
|
1281
|
+
get isSidebarOpen(): boolean;
|
|
1282
|
+
set isSidebarActive(isActive: boolean);
|
|
1283
|
+
set sidebarLinks(links: EuiMenuItem[]);
|
|
1284
|
+
set hasSidebarCollapsedVariant(isActive: boolean);
|
|
1285
|
+
set menuLinks(links: EuiMenuItem[]);
|
|
1286
|
+
set isBlockDocumentActive(isActive: boolean);
|
|
1287
|
+
get hasHeader(): boolean;
|
|
1288
|
+
get isDimmerActive(): boolean;
|
|
1289
|
+
set isDimmerActive(isActive: boolean);
|
|
1290
|
+
private _state$;
|
|
1291
|
+
private _breakpoint$;
|
|
1292
|
+
private _breakpoints$;
|
|
1293
|
+
constructor();
|
|
1294
|
+
setState(nextState: UIState<any, any, any, any>, updateI18?: boolean): void;
|
|
1295
|
+
/**
|
|
1296
|
+
* Emits a slice from the state whether that changes
|
|
1297
|
+
*
|
|
1298
|
+
* @param key can be 'key' or 'key.sub.sub'
|
|
1299
|
+
*/
|
|
1300
|
+
getState<T = any>(key?: string): Observable<T>;
|
|
1301
|
+
sidebarToggle(): void;
|
|
1302
|
+
dimmerActiveToggle(): void;
|
|
1303
|
+
setDimmerActiveState(activeState: boolean): void;
|
|
1304
|
+
fetchAppMetadata(metadataFilePath?: string): void;
|
|
1305
|
+
activateSidebar(): void;
|
|
1306
|
+
activateSideContainer(): void;
|
|
1307
|
+
deactivateSideContainer(): void;
|
|
1308
|
+
activateSidebarHeader(): void;
|
|
1309
|
+
activateSidebarFooter(): void;
|
|
1310
|
+
activateHeader(): void;
|
|
1311
|
+
activateBreadcrumb(): void;
|
|
1312
|
+
activateTopMessage(height: number): void;
|
|
1313
|
+
activateToolbar(): void;
|
|
1314
|
+
activateToolbarMegaMenu(): void;
|
|
1315
|
+
activateToolbarMenu(): void;
|
|
1316
|
+
/**
|
|
1317
|
+
* Returns the current value of --eui-f-size-base CSS variable
|
|
1318
|
+
*/
|
|
1319
|
+
getBaseFontSize(): string;
|
|
1320
|
+
/**
|
|
1321
|
+
* Updates the current value of --eui-f-size-base CSS variable and the UIState appBaseFontSize
|
|
1322
|
+
*/
|
|
1323
|
+
setBaseFontSize(newsize: string): void;
|
|
1324
|
+
private getWrapperClasses;
|
|
1325
|
+
private getBreakpoint;
|
|
1326
|
+
private getBreakpoints;
|
|
1327
|
+
private getJson;
|
|
1328
|
+
private extractData;
|
|
1329
|
+
private handleError;
|
|
1330
|
+
private bindActiveLanguageToAppShellState;
|
|
1331
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EuiAppShellService, never>;
|
|
1332
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
1333
|
+
}
|
|
1334
|
+
export declare const EUI_COUNTRIES: {
|
|
1335
|
+
AF: string;
|
|
1336
|
+
AX: string;
|
|
1337
|
+
AL: string;
|
|
1338
|
+
DZ: string;
|
|
1339
|
+
AS: string;
|
|
1340
|
+
AD: string;
|
|
1341
|
+
AO: string;
|
|
1342
|
+
AI: string;
|
|
1343
|
+
AQ: string;
|
|
1344
|
+
AG: string;
|
|
1345
|
+
AR: string;
|
|
1346
|
+
AM: string;
|
|
1347
|
+
AW: string;
|
|
1348
|
+
AU: string;
|
|
1349
|
+
AT: string;
|
|
1350
|
+
AZ: string;
|
|
1351
|
+
BS: string;
|
|
1352
|
+
BH: string;
|
|
1353
|
+
BD: string;
|
|
1354
|
+
BB: string;
|
|
1355
|
+
BY: string;
|
|
1356
|
+
BE: string;
|
|
1357
|
+
BZ: string;
|
|
1358
|
+
BJ: string;
|
|
1359
|
+
BM: string;
|
|
1360
|
+
BT: string;
|
|
1361
|
+
BO: string;
|
|
1362
|
+
BA: string;
|
|
1363
|
+
BW: string;
|
|
1364
|
+
BV: string;
|
|
1365
|
+
BR: string;
|
|
1366
|
+
VG: string;
|
|
1367
|
+
IO: string;
|
|
1368
|
+
BN: string;
|
|
1369
|
+
BG: string;
|
|
1370
|
+
BF: string;
|
|
1371
|
+
BI: string;
|
|
1372
|
+
KH: string;
|
|
1373
|
+
CM: string;
|
|
1374
|
+
CA: string;
|
|
1375
|
+
CV: string;
|
|
1376
|
+
KY: string;
|
|
1377
|
+
CF: string;
|
|
1378
|
+
TD: string;
|
|
1379
|
+
CL: string;
|
|
1380
|
+
CN: string;
|
|
1381
|
+
HK: string;
|
|
1382
|
+
MO: string;
|
|
1383
|
+
CX: string;
|
|
1384
|
+
CC: string;
|
|
1385
|
+
CO: string;
|
|
1386
|
+
KM: string;
|
|
1387
|
+
CG: string;
|
|
1388
|
+
CD: string;
|
|
1389
|
+
CK: string;
|
|
1390
|
+
CR: string;
|
|
1391
|
+
CI: string;
|
|
1392
|
+
HR: string;
|
|
1393
|
+
CU: string;
|
|
1394
|
+
CY: string;
|
|
1395
|
+
CZ: string;
|
|
1396
|
+
DK: string;
|
|
1397
|
+
DJ: string;
|
|
1398
|
+
DM: string;
|
|
1399
|
+
DO: string;
|
|
1400
|
+
EC: string;
|
|
1401
|
+
EG: string;
|
|
1402
|
+
SV: string;
|
|
1403
|
+
GQ: string;
|
|
1404
|
+
ER: string;
|
|
1405
|
+
EE: string;
|
|
1406
|
+
ET: string;
|
|
1407
|
+
FK: string;
|
|
1408
|
+
FO: string;
|
|
1409
|
+
FJ: string;
|
|
1410
|
+
FI: string;
|
|
1411
|
+
FR: string;
|
|
1412
|
+
GF: string;
|
|
1413
|
+
PF: string;
|
|
1414
|
+
TF: string;
|
|
1415
|
+
GA: string;
|
|
1416
|
+
GM: string;
|
|
1417
|
+
GE: string;
|
|
1418
|
+
DE: string;
|
|
1419
|
+
GH: string;
|
|
1420
|
+
GI: string;
|
|
1421
|
+
GR: string;
|
|
1422
|
+
GL: string;
|
|
1423
|
+
GD: string;
|
|
1424
|
+
GP: string;
|
|
1425
|
+
GU: string;
|
|
1426
|
+
GT: string;
|
|
1427
|
+
GG: string;
|
|
1428
|
+
GN: string;
|
|
1429
|
+
GW: string;
|
|
1430
|
+
GY: string;
|
|
1431
|
+
HT: string;
|
|
1432
|
+
HM: string;
|
|
1433
|
+
VA: string;
|
|
1434
|
+
HN: string;
|
|
1435
|
+
HU: string;
|
|
1436
|
+
IS: string;
|
|
1437
|
+
IN: string;
|
|
1438
|
+
ID: string;
|
|
1439
|
+
IR: string;
|
|
1440
|
+
IQ: string;
|
|
1441
|
+
IE: string;
|
|
1442
|
+
IM: string;
|
|
1443
|
+
IL: string;
|
|
1444
|
+
IT: string;
|
|
1445
|
+
JM: string;
|
|
1446
|
+
JP: string;
|
|
1447
|
+
JE: string;
|
|
1448
|
+
JO: string;
|
|
1449
|
+
KZ: string;
|
|
1450
|
+
KE: string;
|
|
1451
|
+
KI: string;
|
|
1452
|
+
KP: string;
|
|
1453
|
+
KR: string;
|
|
1454
|
+
KW: string;
|
|
1455
|
+
KG: string;
|
|
1456
|
+
LA: string;
|
|
1457
|
+
LV: string;
|
|
1458
|
+
LB: string;
|
|
1459
|
+
LS: string;
|
|
1460
|
+
LR: string;
|
|
1461
|
+
LY: string;
|
|
1462
|
+
LI: string;
|
|
1463
|
+
LT: string;
|
|
1464
|
+
LU: string;
|
|
1465
|
+
MK: string;
|
|
1466
|
+
MG: string;
|
|
1467
|
+
MW: string;
|
|
1468
|
+
MY: string;
|
|
1469
|
+
MV: string;
|
|
1470
|
+
ML: string;
|
|
1471
|
+
MT: string;
|
|
1472
|
+
MH: string;
|
|
1473
|
+
MQ: string;
|
|
1474
|
+
MR: string;
|
|
1475
|
+
MU: string;
|
|
1476
|
+
YT: string;
|
|
1477
|
+
MX: string;
|
|
1478
|
+
FM: string;
|
|
1479
|
+
MD: string;
|
|
1480
|
+
MC: string;
|
|
1481
|
+
MN: string;
|
|
1482
|
+
ME: string;
|
|
1483
|
+
MS: string;
|
|
1484
|
+
MA: string;
|
|
1485
|
+
MZ: string;
|
|
1486
|
+
MM: string;
|
|
1487
|
+
NA: string;
|
|
1488
|
+
NR: string;
|
|
1489
|
+
NP: string;
|
|
1490
|
+
NL: string;
|
|
1491
|
+
AN: string;
|
|
1492
|
+
NC: string;
|
|
1493
|
+
NZ: string;
|
|
1494
|
+
NI: string;
|
|
1495
|
+
NE: string;
|
|
1496
|
+
NG: string;
|
|
1497
|
+
NU: string;
|
|
1498
|
+
NF: string;
|
|
1499
|
+
MP: string;
|
|
1500
|
+
NO: string;
|
|
1501
|
+
OM: string;
|
|
1502
|
+
PK: string;
|
|
1503
|
+
PW: string;
|
|
1504
|
+
PS: string;
|
|
1505
|
+
PA: string;
|
|
1506
|
+
PG: string;
|
|
1507
|
+
PY: string;
|
|
1508
|
+
PE: string;
|
|
1509
|
+
PH: string;
|
|
1510
|
+
PN: string;
|
|
1511
|
+
PL: string;
|
|
1512
|
+
PT: string;
|
|
1513
|
+
PR: string;
|
|
1514
|
+
QA: string;
|
|
1515
|
+
RE: string;
|
|
1516
|
+
RO: string;
|
|
1517
|
+
RU: string;
|
|
1518
|
+
RW: string;
|
|
1519
|
+
BL: string;
|
|
1520
|
+
SH: string;
|
|
1521
|
+
KN: string;
|
|
1522
|
+
LC: string;
|
|
1523
|
+
MF: string;
|
|
1524
|
+
PM: string;
|
|
1525
|
+
VC: string;
|
|
1526
|
+
WS: string;
|
|
1527
|
+
SM: string;
|
|
1528
|
+
ST: string;
|
|
1529
|
+
SA: string;
|
|
1530
|
+
SN: string;
|
|
1531
|
+
RS: string;
|
|
1532
|
+
SC: string;
|
|
1533
|
+
SL: string;
|
|
1534
|
+
SG: string;
|
|
1535
|
+
SK: string;
|
|
1536
|
+
SI: string;
|
|
1537
|
+
SB: string;
|
|
1538
|
+
SO: string;
|
|
1539
|
+
ZA: string;
|
|
1540
|
+
GS: string;
|
|
1541
|
+
SS: string;
|
|
1542
|
+
ES: string;
|
|
1543
|
+
LK: string;
|
|
1544
|
+
SD: string;
|
|
1545
|
+
SR: string;
|
|
1546
|
+
SJ: string;
|
|
1547
|
+
SZ: string;
|
|
1548
|
+
SE: string;
|
|
1549
|
+
CH: string;
|
|
1550
|
+
SY: string;
|
|
1551
|
+
TW: string;
|
|
1552
|
+
TJ: string;
|
|
1553
|
+
TZ: string;
|
|
1554
|
+
TH: string;
|
|
1555
|
+
TL: string;
|
|
1556
|
+
TG: string;
|
|
1557
|
+
TK: string;
|
|
1558
|
+
TO: string;
|
|
1559
|
+
TT: string;
|
|
1560
|
+
TN: string;
|
|
1561
|
+
TR: string;
|
|
1562
|
+
TM: string;
|
|
1563
|
+
TC: string;
|
|
1564
|
+
TV: string;
|
|
1565
|
+
UG: string;
|
|
1566
|
+
UA: string;
|
|
1567
|
+
AE: string;
|
|
1568
|
+
GB: string;
|
|
1569
|
+
US: string;
|
|
1570
|
+
UM: string;
|
|
1571
|
+
UY: string;
|
|
1572
|
+
UZ: string;
|
|
1573
|
+
VU: string;
|
|
1574
|
+
VE: string;
|
|
1575
|
+
VN: string;
|
|
1576
|
+
VI: string;
|
|
1577
|
+
WF: string;
|
|
1578
|
+
EH: string;
|
|
1579
|
+
YE: string;
|
|
1580
|
+
ZM: string;
|
|
1581
|
+
ZW: string;
|
|
1623
1582
|
};
|
|
1624
|
-
interface EuiTimeZone {
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
}
|
|
1628
|
-
declare const EUI_TIMEZONES: EuiTimeZone[];
|
|
1629
|
-
declare class EuiTimezoneService {
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
}
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
COMPACT = "compact"
|
|
1583
|
+
export interface EuiTimeZone {
|
|
1584
|
+
name: string;
|
|
1585
|
+
desc: string;
|
|
1586
|
+
}
|
|
1587
|
+
export declare const EUI_TIMEZONES: EuiTimeZone[];
|
|
1588
|
+
export declare class EuiTimezoneService {
|
|
1589
|
+
/**
|
|
1590
|
+
* Convert country ISO code to country name (in english)
|
|
1591
|
+
*/
|
|
1592
|
+
iso2country(iso: string): string;
|
|
1593
|
+
/**
|
|
1594
|
+
* Gets the list of ISO-codes for all countries
|
|
1595
|
+
*/
|
|
1596
|
+
getCountries(): string[];
|
|
1597
|
+
getTimezones(): EuiTimeZone[];
|
|
1598
|
+
getTimezone(tz: string): EuiTimeZone;
|
|
1599
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EuiTimezoneService, never>;
|
|
1600
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
1601
|
+
}
|
|
1602
|
+
export declare enum EuiTheme {
|
|
1603
|
+
DEFAULT = "default",
|
|
1604
|
+
ECL_EC = "ecl-ec",
|
|
1605
|
+
ECL_EC_RTL = "ecl-ec-rtl",
|
|
1606
|
+
ECL_EU = "ecl-eu",
|
|
1607
|
+
ECL_EU_RTL = "ecl-eu-rtl",
|
|
1608
|
+
DARK = "dark",
|
|
1609
|
+
HIGH_CONTRAST = "high-contrast",
|
|
1610
|
+
COMPACT = "compact"
|
|
1653
1611
|
}
|
|
1654
1612
|
interface IEuiTheme {
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
}
|
|
1660
|
-
interface ThemeState {
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
}
|
|
1664
|
-
declare class EuiThemeService {
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
}
|
|
1686
|
-
|
|
1613
|
+
name: EuiTheme;
|
|
1614
|
+
isActive: boolean;
|
|
1615
|
+
styleSheet: string;
|
|
1616
|
+
cssClass: string;
|
|
1617
|
+
}
|
|
1618
|
+
export interface ThemeState {
|
|
1619
|
+
themes: IEuiTheme[];
|
|
1620
|
+
theme: any;
|
|
1621
|
+
}
|
|
1622
|
+
export declare class EuiThemeService {
|
|
1623
|
+
private document;
|
|
1624
|
+
protected config: GlobalConfig<any>;
|
|
1625
|
+
private asService;
|
|
1626
|
+
private _state$;
|
|
1627
|
+
constructor();
|
|
1628
|
+
get state$(): Observable<ThemeState>;
|
|
1629
|
+
get state(): ThemeState;
|
|
1630
|
+
isDefault(): boolean;
|
|
1631
|
+
isEclEc(): boolean;
|
|
1632
|
+
isEclEcRtl(): boolean;
|
|
1633
|
+
isEclEu(): boolean;
|
|
1634
|
+
isEclEuRtl(): boolean;
|
|
1635
|
+
isDark(): boolean;
|
|
1636
|
+
isHighContrast(): boolean;
|
|
1637
|
+
isCompact(): boolean;
|
|
1638
|
+
setActiveTheme(theme: EuiTheme, isActive: boolean): void;
|
|
1639
|
+
private _renderTheme;
|
|
1640
|
+
private _renderThemeCss;
|
|
1641
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EuiThemeService, never>;
|
|
1642
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
1643
|
+
}
|
|
1687
1644
|
/**
|
|
1688
1645
|
* Generic storage service. Concrete storage services must extend this class
|
|
1689
1646
|
*/
|
|
1690
|
-
declare abstract class StorageService {
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
}
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
}
|
|
1722
|
-
|
|
1647
|
+
export declare abstract class StorageService {
|
|
1648
|
+
/**
|
|
1649
|
+
* utility function, to determine the storage implementation
|
|
1650
|
+
*/
|
|
1651
|
+
abstract name(): string;
|
|
1652
|
+
/**
|
|
1653
|
+
* retrieve an object from storage
|
|
1654
|
+
* @param key the associated key
|
|
1655
|
+
* @returns the value or undefined, if case of error
|
|
1656
|
+
*/
|
|
1657
|
+
abstract get(key: string): any;
|
|
1658
|
+
abstract get<T>(key: string): T;
|
|
1659
|
+
/**
|
|
1660
|
+
* sets an object in storage
|
|
1661
|
+
* @param key the associated key
|
|
1662
|
+
* @param value the value to set
|
|
1663
|
+
*/
|
|
1664
|
+
abstract set(key: string, value: any): void;
|
|
1665
|
+
abstract set<T>(key: string, value: T): void;
|
|
1666
|
+
/**
|
|
1667
|
+
* removes an object from storage
|
|
1668
|
+
* @param key the associated key
|
|
1669
|
+
*/
|
|
1670
|
+
abstract remove(key: string): void;
|
|
1671
|
+
}
|
|
1672
|
+
export declare class StorageServiceMock extends StorageService {
|
|
1673
|
+
name(): string;
|
|
1674
|
+
get(): null;
|
|
1675
|
+
set(): void;
|
|
1676
|
+
remove(): void;
|
|
1677
|
+
}
|
|
1723
1678
|
/**
|
|
1724
1679
|
* Generic asynchronous storage service. Concrete asynchronous storage services must extend this class
|
|
1725
1680
|
*/
|
|
1726
|
-
declare abstract class AsyncStorageService extends StorageService {
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
}
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
}
|
|
1775
|
-
|
|
1681
|
+
export declare abstract class AsyncStorageService extends StorageService {
|
|
1682
|
+
/**
|
|
1683
|
+
* reflects the readiness of the storage
|
|
1684
|
+
* @returns one time emission Observable<any>
|
|
1685
|
+
*/
|
|
1686
|
+
abstract ready(): Observable<any>;
|
|
1687
|
+
/**
|
|
1688
|
+
* retrieve an object from async storage
|
|
1689
|
+
* @param key the associated key
|
|
1690
|
+
* @returns one time emission Observable of value
|
|
1691
|
+
*/
|
|
1692
|
+
abstract get(key: string): Observable<any>;
|
|
1693
|
+
abstract get<T>(key: string): Observable<T>;
|
|
1694
|
+
/**
|
|
1695
|
+
* sets an object in async storage
|
|
1696
|
+
* @param key the associated key
|
|
1697
|
+
* @param value the value to set
|
|
1698
|
+
* @returns one time emission Observable
|
|
1699
|
+
*/
|
|
1700
|
+
abstract set(key: string, value: any): Observable<any>;
|
|
1701
|
+
abstract set<T>(key: string, value: T): Observable<any>;
|
|
1702
|
+
/**
|
|
1703
|
+
* removes an object from async storage
|
|
1704
|
+
* @param key the associated key
|
|
1705
|
+
* @returns one time emission Observable
|
|
1706
|
+
*/
|
|
1707
|
+
abstract remove(key: string): Observable<any>;
|
|
1708
|
+
/**
|
|
1709
|
+
* asynchronous helper for set function
|
|
1710
|
+
* @param key the associated key
|
|
1711
|
+
* @param value the value to set
|
|
1712
|
+
*/
|
|
1713
|
+
setAsync(key: string, value: any): void;
|
|
1714
|
+
/**
|
|
1715
|
+
* asynchronous helper for remove function
|
|
1716
|
+
* @param key the associated key
|
|
1717
|
+
*/
|
|
1718
|
+
removeAsync(key: string): void;
|
|
1719
|
+
}
|
|
1720
|
+
export declare class AsyncStorageServiceMock extends AsyncStorageService {
|
|
1721
|
+
ready(): Observable<any>;
|
|
1722
|
+
name(): string;
|
|
1723
|
+
get(): Observable<any>;
|
|
1724
|
+
set(): Observable<any>;
|
|
1725
|
+
remove(): Observable<any>;
|
|
1726
|
+
setAsync(): void;
|
|
1727
|
+
removeAsync(): void;
|
|
1728
|
+
}
|
|
1776
1729
|
/**
|
|
1777
1730
|
* localStorage service
|
|
1778
1731
|
*/
|
|
1779
|
-
declare class LocalStorageService extends StorageService {
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
}
|
|
1807
|
-
|
|
1732
|
+
export declare class LocalStorageService extends StorageService {
|
|
1733
|
+
static NAME: string;
|
|
1734
|
+
protected log: LogService;
|
|
1735
|
+
private platformId;
|
|
1736
|
+
/**
|
|
1737
|
+
* the name of the storage service
|
|
1738
|
+
*/
|
|
1739
|
+
name(): string;
|
|
1740
|
+
/**
|
|
1741
|
+
* retrieve an object from local storage
|
|
1742
|
+
* @param key the associated key
|
|
1743
|
+
* @returns the value or undefined, if case of error
|
|
1744
|
+
*/
|
|
1745
|
+
get(key: string): any;
|
|
1746
|
+
/**
|
|
1747
|
+
* sets an object in local storage
|
|
1748
|
+
* @param key the associated key
|
|
1749
|
+
* @param value the value to set
|
|
1750
|
+
*/
|
|
1751
|
+
set(key: string, value: any): void;
|
|
1752
|
+
/**
|
|
1753
|
+
* removes an object from local storage
|
|
1754
|
+
* @param key the associated key
|
|
1755
|
+
*/
|
|
1756
|
+
remove(key: string): void;
|
|
1757
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LocalStorageService, never>;
|
|
1758
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
1759
|
+
}
|
|
1808
1760
|
/**
|
|
1809
1761
|
* sessionStorage service
|
|
1810
1762
|
*/
|
|
1811
|
-
declare class SessionStorageService extends StorageService {
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
}
|
|
1838
|
-
|
|
1763
|
+
export declare class SessionStorageService extends StorageService {
|
|
1764
|
+
protected log: LogService;
|
|
1765
|
+
static NAME: string;
|
|
1766
|
+
/**
|
|
1767
|
+
* the name of the storage service
|
|
1768
|
+
*/
|
|
1769
|
+
name(): string;
|
|
1770
|
+
/**
|
|
1771
|
+
* retrieve an object from session storage
|
|
1772
|
+
* @param key the associated key
|
|
1773
|
+
* @returns the value or undefined, if case of error
|
|
1774
|
+
*/
|
|
1775
|
+
get(key: string): any;
|
|
1776
|
+
/**
|
|
1777
|
+
* sets an object in session storage
|
|
1778
|
+
* @param key the associated key
|
|
1779
|
+
* @param value the value to set
|
|
1780
|
+
*/
|
|
1781
|
+
set(key: string, value: any): void;
|
|
1782
|
+
/**
|
|
1783
|
+
* removes an object from session storage
|
|
1784
|
+
* @param key the associated key
|
|
1785
|
+
*/
|
|
1786
|
+
remove(key: string): void;
|
|
1787
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SessionStorageService, never>;
|
|
1788
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
1789
|
+
}
|
|
1839
1790
|
/** @internal */
|
|
1840
|
-
declare const localForage: any;
|
|
1841
|
-
declare const LOCAL_FORAGE_SERVICE_CONFIG_TOKEN: InjectionToken<any>;
|
|
1791
|
+
export declare const localForage: any;
|
|
1792
|
+
export declare const LOCAL_FORAGE_SERVICE_CONFIG_TOKEN: InjectionToken<any>;
|
|
1842
1793
|
/**
|
|
1843
1794
|
* localforage service, using the localForage javascript library
|
|
1844
1795
|
* https://localforage.github.io/localForage
|
|
1845
1796
|
*/
|
|
1846
|
-
declare class LocalForageService extends AsyncStorageService {
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
}
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
declare const LOCALE_ID_MAPPER: InjectionToken<LocaleMapper>;
|
|
1797
|
+
export declare class LocalForageService extends AsyncStorageService {
|
|
1798
|
+
protected config: any;
|
|
1799
|
+
protected log: LogService;
|
|
1800
|
+
static NAME: string;
|
|
1801
|
+
constructor();
|
|
1802
|
+
/**
|
|
1803
|
+
* the name of the storage service
|
|
1804
|
+
*/
|
|
1805
|
+
name(): string;
|
|
1806
|
+
/**
|
|
1807
|
+
* reflects the readiness of the storage
|
|
1808
|
+
* @returns one time emission Observable<void>
|
|
1809
|
+
*/
|
|
1810
|
+
ready(): Observable<any>;
|
|
1811
|
+
/**
|
|
1812
|
+
* retrieve an object from localforage
|
|
1813
|
+
* @param key the associated key
|
|
1814
|
+
* @returns one time emission Observable of value
|
|
1815
|
+
*/
|
|
1816
|
+
get(key: string): Observable<any>;
|
|
1817
|
+
/**
|
|
1818
|
+
* sets an object in localforage
|
|
1819
|
+
* @param key the associated key
|
|
1820
|
+
* @param value the value to set
|
|
1821
|
+
* @returns one time emission Observable
|
|
1822
|
+
*/
|
|
1823
|
+
set(key: string, value: any): Observable<any>;
|
|
1824
|
+
/**
|
|
1825
|
+
* removes an object from localforage
|
|
1826
|
+
* @param key the associated key
|
|
1827
|
+
* @returns one time emission Observable
|
|
1828
|
+
*/
|
|
1829
|
+
remove(key: string): Observable<any>;
|
|
1830
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LocalForageService, never>;
|
|
1831
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
1832
|
+
}
|
|
1833
|
+
export type LocaleMapper = (locale: string) => string;
|
|
1834
|
+
export declare const LOCALE_ID_MAPPER: InjectionToken<LocaleMapper>;
|
|
1885
1835
|
/**
|
|
1886
1836
|
* LocaleService is responsible for managing locale states and configurations in an Angular application.
|
|
1887
1837
|
* It utilizes the CLDR library to load and construct the locale for each region. This service allows
|
|
@@ -1895,107 +1845,105 @@ declare const LOCALE_ID_MAPPER: InjectionToken<LocaleMapper>;
|
|
|
1895
1845
|
* @template L - The type of the locale data.
|
|
1896
1846
|
* @extends EuiService<T | LocaleState>
|
|
1897
1847
|
*/
|
|
1898
|
-
declare class LocaleService<T extends LocaleState = LocaleState> extends EuiService<T | LocaleState> implements OnDestroy {
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
}
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
}
|
|
1998
|
-
|
|
1848
|
+
export declare class LocaleService<T extends LocaleState = LocaleState> extends EuiService<T | LocaleState> implements OnDestroy {
|
|
1849
|
+
protected store: StoreService<any>;
|
|
1850
|
+
protected baseGlobalConfig: GlobalConfig<any>;
|
|
1851
|
+
protected locale_id: string;
|
|
1852
|
+
private static readonly DEFAULT_STATE;
|
|
1853
|
+
private localeMapper;
|
|
1854
|
+
private i18n;
|
|
1855
|
+
private log;
|
|
1856
|
+
private readonly logger;
|
|
1857
|
+
private subNotifier;
|
|
1858
|
+
protected config: LocaleServiceConfig;
|
|
1859
|
+
/**
|
|
1860
|
+
* a single signal holding the state - initial state is null
|
|
1861
|
+
*/
|
|
1862
|
+
private state;
|
|
1863
|
+
/**
|
|
1864
|
+
* a BehaviorSubject holding the state - initial state is null
|
|
1865
|
+
* This is the main source of truth for the state
|
|
1866
|
+
*/
|
|
1867
|
+
private stateSubject;
|
|
1868
|
+
constructor();
|
|
1869
|
+
ngOnDestroy(): void;
|
|
1870
|
+
getState(): Observable<T>;
|
|
1871
|
+
/**
|
|
1872
|
+
* Retrieves the state of the locale service. This method is overloaded to allow different ways of accessing the state.
|
|
1873
|
+
*
|
|
1874
|
+
* @template K - The type of the value to be returned. Defaults to the type of the locale state (T).
|
|
1875
|
+
*
|
|
1876
|
+
* @param {((state: T) => K)} [mapFn] - A function that maps the state to a specific form.
|
|
1877
|
+
* Takes the current state as an argument and returns the transformed state.
|
|
1878
|
+
* @returns {Observable<K>} - An observable that emits the transformed state.
|
|
1879
|
+
*/
|
|
1880
|
+
getState<K = T>(mapFn?: (state: T) => K): Observable<K>;
|
|
1881
|
+
/**
|
|
1882
|
+
* @template a - A key that extends the keys of the state type T.
|
|
1883
|
+
* @param {a} [key] - A specific key to access a part of the state.
|
|
1884
|
+
* The key should be a property name of the state object.
|
|
1885
|
+
* @returns {Observable<Partial<a>>} - An observable that emits the value of the specified key in the state.
|
|
1886
|
+
* @param key
|
|
1887
|
+
*/
|
|
1888
|
+
getState<a extends keyof DeepPartial<T>>(key?: a): Observable<DeepPartial<a>>;
|
|
1889
|
+
/**
|
|
1890
|
+
* Initializes the LocaleService with necessary configurations and state.
|
|
1891
|
+
* Binds language changes to the state and dynamically loads the appropriate locales.
|
|
1892
|
+
*
|
|
1893
|
+
* @param {LocaleState} [state] - Optional initial state for the locale service.
|
|
1894
|
+
* @returns {Observable<EuiServiceStatus>} - Observable emitting the status of the initialization.
|
|
1895
|
+
*/
|
|
1896
|
+
init(state?: LocaleState): Observable<EuiServiceStatus>;
|
|
1897
|
+
/**
|
|
1898
|
+
* This method is used to update the state of the service with a new state.
|
|
1899
|
+
*
|
|
1900
|
+
* @param state
|
|
1901
|
+
*/
|
|
1902
|
+
updateState(state: DeepPartial<T>): void;
|
|
1903
|
+
/**
|
|
1904
|
+
* This method is used to get the state as readonly signal.
|
|
1905
|
+
*/
|
|
1906
|
+
getSignal(): Signal<T>;
|
|
1907
|
+
/**
|
|
1908
|
+
* Retrieves the previous locale used in the application.
|
|
1909
|
+
*
|
|
1910
|
+
* @returns {string} - The previous locale identifier.
|
|
1911
|
+
*/
|
|
1912
|
+
get previousLocale(): string;
|
|
1913
|
+
/**
|
|
1914
|
+
* Retrieves the current locale used in the application.
|
|
1915
|
+
*
|
|
1916
|
+
* @returns {string} - The current locale identifier.
|
|
1917
|
+
*/
|
|
1918
|
+
get currentLocale(): string;
|
|
1919
|
+
/**
|
|
1920
|
+
* Listens for language changes and dynamically sets the locale accordingly.
|
|
1921
|
+
*
|
|
1922
|
+
* @private
|
|
1923
|
+
*/
|
|
1924
|
+
private bindTranslateServiceLangChangeToState;
|
|
1925
|
+
/**
|
|
1926
|
+
* Checks if a given locale string is valid according to the Intl.Locale API. (based on BCP 47)
|
|
1927
|
+
* A valid locale string can be used to create a new Intl.Locale object without throwing an error.
|
|
1928
|
+
*
|
|
1929
|
+
* @param localeString - The locale string to be validated.
|
|
1930
|
+
* @returns {boolean} - Returns true if the locale string is valid, false otherwise.
|
|
1931
|
+
*/
|
|
1932
|
+
private isValidLocale;
|
|
1933
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LocaleService<any>, never>;
|
|
1934
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
1935
|
+
}
|
|
1936
|
+
export declare class LocaleServiceMock<T extends LocaleState = LocaleState> extends LocaleService<T> {
|
|
1937
|
+
protected locale_id: string;
|
|
1938
|
+
private DEFAULT_LOCALE;
|
|
1939
|
+
private stateSub;
|
|
1940
|
+
constructor();
|
|
1941
|
+
getState(): Observable<T>;
|
|
1942
|
+
updateState(state: T): void;
|
|
1943
|
+
init(state?: T): Observable<EuiServiceStatus>;
|
|
1944
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LocaleServiceMock<any>, never>;
|
|
1945
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
1946
|
+
}
|
|
1999
1947
|
/**
|
|
2000
1948
|
* The status of a library
|
|
2001
1949
|
* @enum Status
|
|
@@ -2003,10 +1951,10 @@ declare class LocaleServiceMock<T extends LocaleState = LocaleState> extends Loc
|
|
|
2003
1951
|
* @property {string} LOADED - the library is loaded
|
|
2004
1952
|
* @property {string} ERROR - the library failed to load
|
|
2005
1953
|
*/
|
|
2006
|
-
declare enum Status {
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
1954
|
+
export declare enum Status {
|
|
1955
|
+
LOADING = "loading",
|
|
1956
|
+
LOADED = "loaded",
|
|
1957
|
+
ERROR = "error"
|
|
2010
1958
|
}
|
|
2011
1959
|
/**
|
|
2012
1960
|
* A library is a set of script and style dependencies
|
|
@@ -2040,59 +1988,58 @@ declare enum Status {
|
|
|
2040
1988
|
* status: Status.LOADING,
|
|
2041
1989
|
* };
|
|
2042
1990
|
*/
|
|
2043
|
-
interface Library {
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
1991
|
+
export interface Library {
|
|
1992
|
+
/** global variable object name that the script will give to the library */
|
|
1993
|
+
name: string;
|
|
1994
|
+
/** a set of script and style dependencies */
|
|
1995
|
+
dependencies: Dependency[];
|
|
1996
|
+
/** the status of the library e.g. LOADED */
|
|
1997
|
+
status: Status;
|
|
2050
1998
|
}
|
|
2051
1999
|
/**
|
|
2052
2000
|
* A dependency is a script or style that can be loaded dynamically
|
|
2053
2001
|
*/
|
|
2054
|
-
interface Dependency {
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2002
|
+
export interface Dependency {
|
|
2003
|
+
/** an identifier for the dependency */
|
|
2004
|
+
name: string;
|
|
2005
|
+
/**
|
|
2006
|
+
* the url of the dependency
|
|
2007
|
+
* @example
|
|
2008
|
+
* https://cdn.quilljs.com/1.3.6/quill.js
|
|
2009
|
+
*/
|
|
2010
|
+
url: string;
|
|
2011
|
+
/** the type of the dependency. Is it a style or script? */
|
|
2012
|
+
type: 'js' | 'css';
|
|
2013
|
+
/**
|
|
2014
|
+
* an array of dependencies corresponds to the Dependency.name
|
|
2015
|
+
* that must be loaded before this dependency
|
|
2016
|
+
* @example
|
|
2017
|
+
* ['quill-better-table']
|
|
2018
|
+
* where 'quill-better-table' is the name of the dependency
|
|
2019
|
+
* const betterTable: Dependency = {
|
|
2020
|
+
* name: 'quill-better-table',
|
|
2021
|
+
* url: 'https://cdn.quilljs.com/1.3.6/quill.js',
|
|
2022
|
+
* type: 'js',
|
|
2023
|
+
* requires: ['quill-better-table'],
|
|
2024
|
+
* }
|
|
2025
|
+
*/
|
|
2026
|
+
requires: string[];
|
|
2027
|
+
/** the status of the dependency */
|
|
2028
|
+
status?: Status;
|
|
2029
|
+
/** the number of times the dependency has been loaded */
|
|
2030
|
+
retries?: number;
|
|
2083
2031
|
}
|
|
2084
2032
|
/**
|
|
2085
2033
|
* Configuration for different policies
|
|
2086
2034
|
*/
|
|
2087
|
-
interface Policy {
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2035
|
+
export interface Policy {
|
|
2036
|
+
/** Maximum number of retry attempts */
|
|
2037
|
+
maxAttempts: number;
|
|
2038
|
+
/** Time between retries in milliseconds */
|
|
2039
|
+
retryInterval: number;
|
|
2040
|
+
/** Time in milliseconds before considering a load attempt as failed */
|
|
2041
|
+
timeout: number;
|
|
2094
2042
|
}
|
|
2095
|
-
|
|
2096
2043
|
/**
|
|
2097
2044
|
* A service for loading external dependencies dynamically to the DOM and keeping track of their status. Dependencies
|
|
2098
2045
|
* can be loaded in any order and can have prerequisites. The service will load the prerequisites first and then load
|
|
@@ -2128,163 +2075,160 @@ interface Policy {
|
|
|
2128
2075
|
* loader.addDependency('Quill', 'https://cdn.quilljs.com/1.3.6/quill.js', 'js', ['QuillStyle']);
|
|
2129
2076
|
* loader.addDependency('QuillStyle', 'https://cdn.quilljs.com/1.3.6/quill.snow.css', 'css');
|
|
2130
2077
|
*/
|
|
2131
|
-
declare class EuiLoaderService {
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
}
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<UserServiceMock<any>>;
|
|
2286
|
-
}
|
|
2287
|
-
|
|
2078
|
+
export declare class EuiLoaderService {
|
|
2079
|
+
/**
|
|
2080
|
+
* Stores the status and details of each dependency
|
|
2081
|
+
*/
|
|
2082
|
+
private dependencies;
|
|
2083
|
+
/** Observable that emits the name of the dependency when its status changes */
|
|
2084
|
+
private onStatusChange;
|
|
2085
|
+
/**
|
|
2086
|
+
* Configuration for policies such as Retry and timeout for failed loads
|
|
2087
|
+
*/
|
|
2088
|
+
private policy;
|
|
2089
|
+
/**
|
|
2090
|
+
* Add a dependency with its type (JS or CSS) and dependencies
|
|
2091
|
+
*
|
|
2092
|
+
* @param name The name of the dependency
|
|
2093
|
+
* @param url The URL of the dependency
|
|
2094
|
+
* @param type The type of the dependency (JS or CSS)
|
|
2095
|
+
* @param requires The dependencies that must be loaded before this one (optional)
|
|
2096
|
+
*/
|
|
2097
|
+
addDependency(name: string, url: string, type: 'js' | 'css', requires?: string[]): void;
|
|
2098
|
+
/**
|
|
2099
|
+
* Remove a dependency from the DOM
|
|
2100
|
+
*
|
|
2101
|
+
* @param name The name of the dependency
|
|
2102
|
+
*/
|
|
2103
|
+
removeDependency(name: string): void;
|
|
2104
|
+
/**
|
|
2105
|
+
* Allow users to configure the retry policy
|
|
2106
|
+
*
|
|
2107
|
+
* @param maxAttempts The maximum number of retry attempts
|
|
2108
|
+
* @param retryInterval The time between retries in milliseconds
|
|
2109
|
+
*/
|
|
2110
|
+
setRetryPolicy(maxAttempts: number, retryInterval: number): void;
|
|
2111
|
+
/**
|
|
2112
|
+
* Allow users to configure the timeout policy
|
|
2113
|
+
*
|
|
2114
|
+
* @param time The time in milliseconds before considering a load attempt as failed
|
|
2115
|
+
* @see setRetryPolicy
|
|
2116
|
+
* @see statusChanges
|
|
2117
|
+
*/
|
|
2118
|
+
setTimeoutPolicy(time: number): void;
|
|
2119
|
+
/**
|
|
2120
|
+
* Get the status of a dependency
|
|
2121
|
+
*
|
|
2122
|
+
* @param name The name of the dependency
|
|
2123
|
+
* @returns The status of the dependency
|
|
2124
|
+
* @deprecated Prefer using statusChanges instead
|
|
2125
|
+
* @see statusChanges
|
|
2126
|
+
*/
|
|
2127
|
+
getDependencyStatus(name: string): Status | null;
|
|
2128
|
+
/**
|
|
2129
|
+
* Get the status of a dependency as an observable
|
|
2130
|
+
*
|
|
2131
|
+
* @param name The name of the dependency
|
|
2132
|
+
*/
|
|
2133
|
+
statusChanges(name: string): Observable<Status>;
|
|
2134
|
+
/**
|
|
2135
|
+
* Load a dependency and its prerequisites
|
|
2136
|
+
*
|
|
2137
|
+
* @param name The name of the dependency
|
|
2138
|
+
* @see loadDependency
|
|
2139
|
+
*/
|
|
2140
|
+
private loadDependency;
|
|
2141
|
+
/**
|
|
2142
|
+
* Load a JS script and append it to the root of the DOM
|
|
2143
|
+
* @param dependency
|
|
2144
|
+
*/
|
|
2145
|
+
private loadScript;
|
|
2146
|
+
/**
|
|
2147
|
+
* Load a CSS style and append it to the head of the document
|
|
2148
|
+
* @param dependency
|
|
2149
|
+
*/
|
|
2150
|
+
private loadStyle;
|
|
2151
|
+
/**
|
|
2152
|
+
* Error handling for a failed load
|
|
2153
|
+
* @param name
|
|
2154
|
+
* @param error
|
|
2155
|
+
*/
|
|
2156
|
+
private handleError;
|
|
2157
|
+
/**
|
|
2158
|
+
* Get the script element from the DOM
|
|
2159
|
+
*
|
|
2160
|
+
* @param url
|
|
2161
|
+
* @private
|
|
2162
|
+
*/
|
|
2163
|
+
private getScript;
|
|
2164
|
+
/**
|
|
2165
|
+
* Get the style element from the DOM
|
|
2166
|
+
*
|
|
2167
|
+
* @param url
|
|
2168
|
+
* @private
|
|
2169
|
+
*/
|
|
2170
|
+
private getStyle;
|
|
2171
|
+
/**
|
|
2172
|
+
* Reload a dependency which can be either a script or a style. First remove
|
|
2173
|
+
* the element from the DOM and then load it again.
|
|
2174
|
+
*
|
|
2175
|
+
* @param dependency
|
|
2176
|
+
* @private
|
|
2177
|
+
*/
|
|
2178
|
+
private reloadDependency;
|
|
2179
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EuiLoaderService, never>;
|
|
2180
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
2181
|
+
}
|
|
2182
|
+
export declare class UserService<T extends UserState = UserState> extends EuiService<T | UserState> {
|
|
2183
|
+
protected store: StoreService<any>;
|
|
2184
|
+
private static readonly DEFAULT_STATE;
|
|
2185
|
+
/**
|
|
2186
|
+
* a single signal holding the state - initial state is null
|
|
2187
|
+
*/
|
|
2188
|
+
private state;
|
|
2189
|
+
/**
|
|
2190
|
+
* a BehaviorSubject holding the state - initial state is null
|
|
2191
|
+
* This is the main source of truth for the state
|
|
2192
|
+
*/
|
|
2193
|
+
private stateSubject;
|
|
2194
|
+
constructor();
|
|
2195
|
+
init(state: T): Observable<EuiServiceStatus>;
|
|
2196
|
+
getState(): Observable<T>;
|
|
2197
|
+
/**
|
|
2198
|
+
* @deprecated this will be removed in a future version
|
|
2199
|
+
* @param mapFn
|
|
2200
|
+
*/
|
|
2201
|
+
getState<K = T>(mapFn?: (state: T) => K): Observable<K>;
|
|
2202
|
+
getState<a extends keyof DeepPartial<T>>(key?: a): Observable<DeepPartial<a>>;
|
|
2203
|
+
/**
|
|
2204
|
+
* This method is used to update the state of the service with a new state.
|
|
2205
|
+
*
|
|
2206
|
+
* @param state
|
|
2207
|
+
*/
|
|
2208
|
+
updateState(state: DeepPartial<T>): void;
|
|
2209
|
+
/**
|
|
2210
|
+
* @deprecated it will be removed in next version. Use updateState(partialState: DeepPartial<T>) instead
|
|
2211
|
+
* @param slice
|
|
2212
|
+
* @param reducer
|
|
2213
|
+
*/
|
|
2214
|
+
updateState(slice: DeepPartial<T>, reducer: (state: T, action: DeepPartial<T>) => T): void;
|
|
2215
|
+
/**
|
|
2216
|
+
* This method is used to get the signal of the service.
|
|
2217
|
+
*/
|
|
2218
|
+
getSignal(): Signal<T>;
|
|
2219
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<UserService<any>, never>;
|
|
2220
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
2221
|
+
}
|
|
2222
|
+
export declare class UserServiceMock<T> extends UserService {
|
|
2223
|
+
constructor();
|
|
2224
|
+
init(userState: UserState): Observable<EuiServiceStatus>;
|
|
2225
|
+
getState<K = T>(mapFn?: (state: T) => K): Observable<K>;
|
|
2226
|
+
getState<a extends keyof T>(key?: a): Observable<T[a]>;
|
|
2227
|
+
updateState(userState: UserState): void;
|
|
2228
|
+
updateState<a extends keyof T>(slice: T[a], reducer: (state: any, action: T[a]) => any): void;
|
|
2229
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<UserServiceMock<any>, never>;
|
|
2230
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
2231
|
+
}
|
|
2288
2232
|
/**
|
|
2289
2233
|
* @description
|
|
2290
2234
|
* Centralized service for managing application-wide `eui-growl` notifications.
|
|
@@ -2293,175 +2237,164 @@ declare class UserServiceMock<T> extends UserService {
|
|
|
2293
2237
|
* Supports both temporary auto-dismissing messages and persistent sticky notifications.
|
|
2294
2238
|
* Injected at root level, ensuring a single instance across the entire application.
|
|
2295
2239
|
*/
|
|
2296
|
-
declare class EuiGrowlService {
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
}
|
|
2359
|
-
|
|
2360
|
-
declare const LANG_PARAM_KEY = "X-Lang-Param";
|
|
2240
|
+
export declare class EuiGrowlService {
|
|
2241
|
+
readonly growlMessages: BehaviorSubject<EuiGrowlMessage[]>;
|
|
2242
|
+
readonly isGrowlSticky: BehaviorSubject<boolean>;
|
|
2243
|
+
readonly isCloseAllSticky: BehaviorSubject<boolean>;
|
|
2244
|
+
readonly growlLife: BehaviorSubject<number>;
|
|
2245
|
+
readonly growlPosition: BehaviorSubject<string>;
|
|
2246
|
+
readonly growlCallback: BehaviorSubject<() => void>;
|
|
2247
|
+
readonly ariaGrowlLive: BehaviorSubject<"off" | "polite" | "assertive">;
|
|
2248
|
+
/**
|
|
2249
|
+
* Displays a growl notification message with customizable behavior and appearance.
|
|
2250
|
+
* Validates message severity and manages message lifecycle through reactive streams.
|
|
2251
|
+
* Danger severity messages default to sticky behavior unless explicitly configured.
|
|
2252
|
+
*
|
|
2253
|
+
* @param msg - Message object containing severity, summary, and detail properties
|
|
2254
|
+
* @param isSticky - When true, message persists until manually dismissed; defaults to false except for danger messages
|
|
2255
|
+
* @param isMultiple - When true, appends message to existing queue; when false, clears previous messages
|
|
2256
|
+
* @param life - Duration in milliseconds before auto-dismissal; defaults to 3000ms
|
|
2257
|
+
* @param position - Screen position for message display (e.g., 'bottom-right', 'top-center')
|
|
2258
|
+
* @param callback - Optional function executed when message is clicked
|
|
2259
|
+
* @param ariaLive - ARIA live region politeness level for screen reader announcements
|
|
2260
|
+
* @throws Error if message severity is not one of: 'info', 'warning', 'success', 'danger'
|
|
2261
|
+
*/
|
|
2262
|
+
growl(msg: EuiGrowlMessage, isSticky?: boolean, isMultiple?: boolean, life?: number, position?: string, callback?: () => void, ariaLive?: 'off' | 'polite' | 'assertive'): void;
|
|
2263
|
+
/**
|
|
2264
|
+
* Removes all currently displayed growl messages from the notification queue.
|
|
2265
|
+
* Clears both sticky and temporary messages immediately.
|
|
2266
|
+
*/
|
|
2267
|
+
clearGrowl(): void;
|
|
2268
|
+
/**
|
|
2269
|
+
* Displays a success growl notification with predefined styling and behavior.
|
|
2270
|
+
* Message is non-sticky and auto-dismisses after the default duration.
|
|
2271
|
+
*
|
|
2272
|
+
* @param msg - Detail text to display in the notification
|
|
2273
|
+
* @param position - Optional screen position override; defaults to service-configured position
|
|
2274
|
+
*/
|
|
2275
|
+
growlSuccess(msg: string, position?: string): void;
|
|
2276
|
+
/**
|
|
2277
|
+
* Displays an error growl notification with predefined styling and behavior.
|
|
2278
|
+
* Message is non-sticky but can be configured to persist based on severity handling.
|
|
2279
|
+
*
|
|
2280
|
+
* @param msg - Detail text to display in the notification
|
|
2281
|
+
* @param position - Optional screen position override; defaults to service-configured position
|
|
2282
|
+
*/
|
|
2283
|
+
growlError(msg: string, position?: string): void;
|
|
2284
|
+
/**
|
|
2285
|
+
* Displays a warning growl notification with predefined styling and behavior.
|
|
2286
|
+
* Message is non-sticky and auto-dismisses after the default duration.
|
|
2287
|
+
*
|
|
2288
|
+
* @param msg - Detail text to display in the notification
|
|
2289
|
+
* @param position - Optional screen position override; defaults to service-configured position
|
|
2290
|
+
*/
|
|
2291
|
+
growlWarning(msg: string, position?: string): void;
|
|
2292
|
+
/**
|
|
2293
|
+
* Displays an informational growl notification with predefined styling and behavior.
|
|
2294
|
+
* Message is non-sticky and auto-dismisses after the default duration.
|
|
2295
|
+
*
|
|
2296
|
+
* @param msg - Detail text to display in the notification
|
|
2297
|
+
* @param position - Optional screen position override; defaults to service-configured position
|
|
2298
|
+
*/
|
|
2299
|
+
growlInfo(msg: string, position?: string): void;
|
|
2300
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EuiGrowlService, never>;
|
|
2301
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
2302
|
+
}
|
|
2303
|
+
export declare const LANG_PARAM_KEY = "X-Lang-Param";
|
|
2361
2304
|
/**
|
|
2362
2305
|
* Interceptor for adding the current language as parameter
|
|
2363
2306
|
* Add the header (LANG_PARAM_KEY, <language parameter>) to your request http headers
|
|
2364
2307
|
*/
|
|
2365
|
-
declare class AddLangParamInterceptor implements HttpInterceptor {
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
}
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CsrfPreventionInterceptor, never>;
|
|
2387
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<CsrfPreventionInterceptor>;
|
|
2388
|
-
}
|
|
2389
|
-
|
|
2308
|
+
export declare class AddLangParamInterceptor implements HttpInterceptor {
|
|
2309
|
+
protected translateService: TranslateService;
|
|
2310
|
+
intercept<T>(req: HttpRequest<T>, next: HttpHandler): Observable<HttpEvent<T>>;
|
|
2311
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AddLangParamInterceptor, never>;
|
|
2312
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
2313
|
+
}
|
|
2314
|
+
export declare class CachePreventionInterceptor implements HttpInterceptor {
|
|
2315
|
+
intercept<T>(req: HttpRequest<T>, next: HttpHandler): Observable<HttpEvent<T>>;
|
|
2316
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CachePreventionInterceptor, never>;
|
|
2317
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
2318
|
+
}
|
|
2319
|
+
export declare class CorsSecurityInterceptor implements HttpInterceptor {
|
|
2320
|
+
intercept<T>(request: HttpRequest<T>, next: HttpHandler): Observable<HttpEvent<T>>;
|
|
2321
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CorsSecurityInterceptor, never>;
|
|
2322
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
2323
|
+
}
|
|
2324
|
+
export declare class CsrfPreventionInterceptor implements HttpInterceptor {
|
|
2325
|
+
intercept<T>(request: HttpRequest<T>, next: HttpHandler): Observable<HttpEvent<T>>;
|
|
2326
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CsrfPreventionInterceptor, never>;
|
|
2327
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
2328
|
+
}
|
|
2390
2329
|
interface body {
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
}
|
|
2396
|
-
declare class EuLoginSessionTimeoutHandlingInterceptor implements HttpInterceptor {
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
}
|
|
2405
|
-
|
|
2406
|
-
declare
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
declare const diffDays: (dateStart: Date, dateEnd: Date) => number;
|
|
2415
|
-
declare const diffDaysFromToday: (date: Date) => number;
|
|
2416
|
-
|
|
2330
|
+
success: boolean;
|
|
2331
|
+
status: string;
|
|
2332
|
+
code: number;
|
|
2333
|
+
message: string;
|
|
2334
|
+
}
|
|
2335
|
+
export declare class EuLoginSessionTimeoutHandlingInterceptor implements HttpInterceptor {
|
|
2336
|
+
intercept<T extends body>(request: HttpRequest<T>, next: HttpHandler): Observable<HttpEvent<T>>;
|
|
2337
|
+
protected checkRequestSuccessForEULoginSessionTimeout<T extends body, E>(request: HttpRequest<T>, event: HttpEvent<E>): void;
|
|
2338
|
+
protected checkRequestErrorForEULoginSessionTimeout<T = unknown>(request: HttpRequest<T>, response: HttpResponseBase): void;
|
|
2339
|
+
protected isSsoResponse(body: string | body): boolean;
|
|
2340
|
+
protected reauthenticate(): void;
|
|
2341
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EuLoginSessionTimeoutHandlingInterceptor, never>;
|
|
2342
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
2343
|
+
}
|
|
2344
|
+
export declare const UX_ERROR_MAPPING_HANDLER_TOKEN: InjectionToken<ErrorMappingHandler>;
|
|
2345
|
+
export declare class UxRequestErrorModelInterceptor implements HttpInterceptor {
|
|
2346
|
+
private errorMappingHandler;
|
|
2347
|
+
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>;
|
|
2348
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<UxRequestErrorModelInterceptor, never>;
|
|
2349
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
2350
|
+
}
|
|
2351
|
+
export declare const diffDays: (dateStart: Date, dateEnd: Date) => number;
|
|
2352
|
+
export declare const diffDaysFromToday: (date: Date) => number;
|
|
2417
2353
|
/**
|
|
2418
2354
|
* Provides read-only equivalent of jQuery's position function:
|
|
2419
2355
|
* http://api.jquery.com/position/
|
|
2420
2356
|
*/
|
|
2421
|
-
declare const position: (nativeEl: HTMLElement) => {
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2357
|
+
export declare const position: (nativeEl: HTMLElement) => {
|
|
2358
|
+
width: number;
|
|
2359
|
+
height: number;
|
|
2360
|
+
top: number;
|
|
2361
|
+
left: number;
|
|
2426
2362
|
};
|
|
2427
2363
|
/**
|
|
2428
2364
|
* Provides read-only equivalent of jQuery's offset function:
|
|
2429
2365
|
* http://api.jquery.com/offset/
|
|
2430
2366
|
*/
|
|
2431
|
-
declare const offset: (nativeEl: HTMLElement) => {
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2367
|
+
export declare const offset: (nativeEl: HTMLElement) => {
|
|
2368
|
+
width: number;
|
|
2369
|
+
height: number;
|
|
2370
|
+
top: number;
|
|
2371
|
+
left: number;
|
|
2436
2372
|
};
|
|
2437
2373
|
/**
|
|
2438
2374
|
* returns the closest, non-statically positioned parentOffset of a given element
|
|
2439
2375
|
* @param nativeEl
|
|
2440
2376
|
*/
|
|
2441
|
-
declare const parentOffsetEl: (nativeEl: HTMLElement) => Element | Document;
|
|
2442
|
-
declare const getViewElement: <F>(fixture: ComponentFixture<F>, componentClass: string, klass?: string) => {
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2377
|
+
export declare const parentOffsetEl: (nativeEl: HTMLElement) => Element | Document;
|
|
2378
|
+
export declare const getViewElement: <F>(fixture: ComponentFixture<F>, componentClass: string, klass?: string) => {
|
|
2379
|
+
de: DebugElement;
|
|
2380
|
+
el: HTMLElement;
|
|
2381
|
+
domElement: HTMLElement;
|
|
2446
2382
|
};
|
|
2447
|
-
declare const closestMatchingParent: (target: HTMLElement, className: string) => HTMLElement | null;
|
|
2448
|
-
|
|
2449
|
-
declare const
|
|
2450
|
-
|
|
2451
|
-
declare const markFormGroupTouched: (FormControls: {
|
|
2452
|
-
[key: string]: AbstractControl;
|
|
2383
|
+
export declare const closestMatchingParent: (target: HTMLElement, className: string) => HTMLElement | null;
|
|
2384
|
+
export declare const consumeEvent: (event: Event) => boolean;
|
|
2385
|
+
export declare const markFormGroupTouched: (FormControls: {
|
|
2386
|
+
[key: string]: AbstractControl;
|
|
2453
2387
|
} | AbstractControl[]) => void;
|
|
2454
|
-
declare const markControlsTouched: (group: FormGroup | FormArray) => void;
|
|
2455
|
-
declare const validateEmail: (c: FormControl) => {
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2388
|
+
export declare const markControlsTouched: (group: FormGroup | FormArray) => void;
|
|
2389
|
+
export declare const validateEmail: (c: FormControl) => {
|
|
2390
|
+
validateEmail: {
|
|
2391
|
+
valid: boolean;
|
|
2392
|
+
};
|
|
2459
2393
|
};
|
|
2460
|
-
|
|
2461
2394
|
/**
|
|
2462
2395
|
* returns a random string with radix=36
|
|
2463
2396
|
*/
|
|
2464
|
-
declare const uniqueId: () => string;
|
|
2397
|
+
export declare const uniqueId: () => string;
|
|
2465
2398
|
/**
|
|
2466
2399
|
* Its job is to parse number and format it based on given input.
|
|
2467
2400
|
* @param value can be a number or a string number
|
|
@@ -2469,60 +2402,56 @@ declare const uniqueId: () => string;
|
|
|
2469
2402
|
* @param inDecimalSeparator separator for decimal part of the number default is ','
|
|
2470
2403
|
* @param inThousandSeparator separator for the whole part of the number default is ''
|
|
2471
2404
|
*/
|
|
2472
|
-
declare const formatNumber: (value: number | string, fractionSize?: number, inDecimalSeparator?: string, inThousandSeparator?: string) => string;
|
|
2473
|
-
|
|
2405
|
+
export declare const formatNumber: (value: number | string, fractionSize?: number, inDecimalSeparator?: string, inThousandSeparator?: string) => string;
|
|
2474
2406
|
/**
|
|
2475
2407
|
* @deprecated it will be removed in the future. Consult the angular documentation for a replacement.
|
|
2476
2408
|
* @param error
|
|
2477
2409
|
*/
|
|
2478
|
-
declare const handleError: (error: HttpErrorResponse) => Observable<never>;
|
|
2479
|
-
|
|
2410
|
+
export declare const handleError: (error: HttpErrorResponse) => Observable<never>;
|
|
2480
2411
|
/**
|
|
2481
2412
|
* check if a value is null or undefined. If it's not both returns true otherwise false
|
|
2482
2413
|
*
|
|
2483
2414
|
* @param value
|
|
2484
2415
|
*/
|
|
2485
|
-
declare const isDefined: <T>(value: T | undefined | null) => value is T;
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
}
|
|
2525
|
-
|
|
2416
|
+
export declare const isDefined: <T>(value: T | undefined | null) => value is T;
|
|
2417
|
+
export declare abstract class CssUtils {
|
|
2418
|
+
static readonly setHtmlClass: (inputClass: string, document: Document) => void;
|
|
2419
|
+
/**
|
|
2420
|
+
* Get the value of a CSS variable. Using getComputedStyle to get the value of the CSS variable (Browser Specific API)
|
|
2421
|
+
* @param inputProperty
|
|
2422
|
+
* @param document
|
|
2423
|
+
* @param platform
|
|
2424
|
+
*/
|
|
2425
|
+
static readonly getCssVarValue: (inputProperty: string, document: Document, platform: unknown) => string;
|
|
2426
|
+
static readonly setCssVarValue: (propertyName: string, propertyValue: string, document: Document) => void;
|
|
2427
|
+
static readonly setCssVar: (inputProperty: string, outputProperty: string, document: Document, platform: unknown) => void;
|
|
2428
|
+
static readonly initCssVars: (document: Document, platform: unknown) => void;
|
|
2429
|
+
static readonly getBreakpointValues: (document: Document, platform: unknown) => any;
|
|
2430
|
+
static readonly activateEditModeCssVars: (isActive: boolean, document: Document) => void;
|
|
2431
|
+
static readonly activateHeaderCssVars: (document: Document, platform: unknown) => void;
|
|
2432
|
+
static readonly activateBreadcrumbCssVars: (document: Document, platform: unknown) => void;
|
|
2433
|
+
static readonly activateTopMessageCssVars: (height: number, document: Document) => void;
|
|
2434
|
+
static readonly activateToolbarCssVars: (document: Document, platform: unknown) => void;
|
|
2435
|
+
static readonly activateToolbarMegaMenuCssVars: (document: Document, platform: unknown) => void;
|
|
2436
|
+
static readonly activateFooterCssVars: (document: Document, platform: unknown) => void;
|
|
2437
|
+
static readonly setHeaderShrinkCssVar: (active: boolean, document: Document, platform: unknown) => void;
|
|
2438
|
+
static readonly activateSidebarCssVars: (document: Document, platform: unknown, hasSidebarCollapsedVariant?: boolean) => void;
|
|
2439
|
+
static readonly activateSideContainerCssVars: (document: Document, platform: unknown) => void;
|
|
2440
|
+
static readonly deactivateSideContainerCssVars: (document: Document, platform: unknown) => void;
|
|
2441
|
+
static readonly setSideContainerWidth: (width: number, document: Document) => void;
|
|
2442
|
+
static readonly removeSidebarCssVars: (document: Document) => void;
|
|
2443
|
+
static readonly activateSidebarHeaderCssVars: (document: Document, platform: unknown) => void;
|
|
2444
|
+
static readonly activateSidebarFooterCssVars: (document: Document, platform: unknown) => void;
|
|
2445
|
+
/**
|
|
2446
|
+
* Gets the viewport height and width and multiply it by 1% to get a value for a vh/vw unit
|
|
2447
|
+
* Sets the value in the --eui-app-vh custom property to the root of the document
|
|
2448
|
+
* Sets the value in the --eui-app-vw custom property to the root of the document
|
|
2449
|
+
* Example for 100% height: calc(var(--eui-app-vh, 1vh) * 100);
|
|
2450
|
+
* Example for 50% height: calc(var(--eui-app-vh, 1vh) * 50);
|
|
2451
|
+
* Example for 50% width: calc(var(--eui-app-vw, 1vw) * 50);
|
|
2452
|
+
*/
|
|
2453
|
+
static setAppViewportCssVars(platform: unknown): void;
|
|
2454
|
+
}
|
|
2526
2455
|
/**
|
|
2527
2456
|
* Safely resolves a service from the injector only when needed.
|
|
2528
2457
|
* Avoids instantiation errors that can occur with `inject(..., { optional: true })`.
|
|
@@ -2531,62 +2460,64 @@ declare abstract class CssUtils {
|
|
|
2531
2460
|
* @param injector The injector to use (defaults to the current injector)
|
|
2532
2461
|
* @returns The service instance or null if unavailable
|
|
2533
2462
|
*/
|
|
2534
|
-
declare function injectOptional<T>(token: Type<T> | InjectionToken<T>, injector?: Injector): T | null;
|
|
2535
|
-
|
|
2536
|
-
declare const
|
|
2537
|
-
declare
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
}
|
|
2573
|
-
declare class TranslateMockModule {
|
|
2574
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TranslateMockModule, never>;
|
|
2575
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<TranslateMockModule, never, [typeof TranslateMockPipe, typeof TranslateMockDirective], [typeof TranslateMockPipe, typeof TranslateMockDirective]>;
|
|
2576
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<TranslateMockModule>;
|
|
2577
|
-
}
|
|
2578
|
-
|
|
2579
|
-
declare class EuiAppShellServiceMock {
|
|
2580
|
-
breakpointSubject: BehaviorSubject<string>;
|
|
2581
|
-
breakpoints$: Observable<string>;
|
|
2582
|
-
state$: Observable<any>;
|
|
2583
|
-
appRouter: {
|
|
2584
|
-
navigate: (url: any) => string;
|
|
2463
|
+
export declare function injectOptional<T>(token: Type<T> | InjectionToken<T>, injector?: Injector): T | null;
|
|
2464
|
+
export declare const TRANSLATED_STRING = "i18n";
|
|
2465
|
+
export declare const DEFAULT_LANGUAGE = "en";
|
|
2466
|
+
export declare class TranslateServiceMock {
|
|
2467
|
+
onLangChangeSubject: Subject<LangChangeEvent>;
|
|
2468
|
+
onTranslationChangeSubject: Subject<string>;
|
|
2469
|
+
onFallbackLangChangeSubject: Subject<string>;
|
|
2470
|
+
isLoadedSubject: BehaviorSubject<boolean>;
|
|
2471
|
+
onLangChange: Observable<LangChangeEvent>;
|
|
2472
|
+
onTranslationChange: Observable<string>;
|
|
2473
|
+
onFallbackLangChange: Observable<string>;
|
|
2474
|
+
isLoaded: Observable<boolean>;
|
|
2475
|
+
currentLang: import("@angular/core").WritableSignal<string>;
|
|
2476
|
+
languages: string[];
|
|
2477
|
+
get(content: string): Observable<string>;
|
|
2478
|
+
use(lang: string): void;
|
|
2479
|
+
addLangs(langs: string[]): void;
|
|
2480
|
+
getBrowserLang(): string;
|
|
2481
|
+
getLangs(): string[];
|
|
2482
|
+
getTranslation(): Observable<any>;
|
|
2483
|
+
instant(key: string | string[]): string;
|
|
2484
|
+
setFallbackLang(lang: string): void;
|
|
2485
|
+
}
|
|
2486
|
+
export declare class TranslateMockPipe implements PipeTransform {
|
|
2487
|
+
transform(text: string): string;
|
|
2488
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TranslateMockPipe, never>;
|
|
2489
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<TranslateMockPipe, "translate", true>;
|
|
2490
|
+
}
|
|
2491
|
+
export declare class TranslateMockDirective implements AfterViewChecked {
|
|
2492
|
+
readonly translateParams: import("@angular/core").InputSignal<unknown>;
|
|
2493
|
+
private readonly _element;
|
|
2494
|
+
ngAfterViewChecked(): void;
|
|
2495
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TranslateMockDirective, never>;
|
|
2496
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TranslateMockDirective, "[translate]", never, {
|
|
2497
|
+
"translateParams": {
|
|
2498
|
+
"alias": "translateParams";
|
|
2499
|
+
"required": false;
|
|
2500
|
+
"isSignal": true;
|
|
2585
2501
|
};
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
export
|
|
2592
|
-
|
|
2502
|
+
}, {}, never, never, true, never>;
|
|
2503
|
+
}
|
|
2504
|
+
export declare class TranslateLoaderMock implements TranslateLoader {
|
|
2505
|
+
getTranslation(): Observable<Record<string, string>>;
|
|
2506
|
+
}
|
|
2507
|
+
export declare class TranslateMockModule {
|
|
2508
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TranslateMockModule, never>;
|
|
2509
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<TranslateMockModule, never, [typeof TranslateMockPipe, typeof TranslateMockDirective], [typeof TranslateMockPipe, typeof TranslateMockDirective]>;
|
|
2510
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<TranslateMockModule>;
|
|
2511
|
+
}
|
|
2512
|
+
export declare class EuiAppShellServiceMock {
|
|
2513
|
+
breakpointSubject: BehaviorSubject<string>;
|
|
2514
|
+
breakpoints$: Observable<string>;
|
|
2515
|
+
state$: Observable<any>;
|
|
2516
|
+
appRouter: {
|
|
2517
|
+
navigate: (url: any) => string;
|
|
2518
|
+
};
|
|
2519
|
+
getState(): Observable<any>;
|
|
2520
|
+
consumeEvent(): void;
|
|
2521
|
+
}
|
|
2522
|
+
export { createEuiCoreRootGuard, euiCoreRootGuardClass, coreReducers as reducers };
|
|
2523
|
+
//# sourceMappingURL=eui-core.d.ts.map
|