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