@eui/base 22.0.0-alpha.55 → 22.0.0-alpha.56

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,16 +1,15 @@
1
- import { HttpErrorResponse, HttpClient } from '@angular/common/http';
2
- import { Observable, Subscription, Subject } from 'rxjs';
3
- import { Injector, Type } from '@angular/core';
4
- import { Selector } from 'reselect';
5
-
6
- declare const isObject: <T>(item: T) => boolean;
7
- declare function merge<T>(target: T): T;
8
- declare function merge<T, A>(target: T, a: A): T & A;
9
- declare function merge<T, A, B>(target: T, a: A, b: B): T & A & B;
10
- declare function merge<T, A, B, C>(target: T, a: A, b: B, c: C): T & A & B & C;
11
- declare function merge<T, A, B, C, D>(target: T, a: A, b: B, c: C, d: D): T & A & B & C & D;
12
- declare function merge<T, A, B, C, D, E>(target: T, a: A, b: B, c: C, d: D, e: E): T & A & B & C & D & E;
13
- declare function merge<T, A, B, C, D, E, F>(target: T, a: A, b: B, c: C, d: D, e: E, f: F): T & A & B & C & D & E & F;
1
+ import { HttpClient, HttpErrorResponse } from "@angular/common/http";
2
+ import { Observable, Subject, Subscription } from "rxjs";
3
+ import { Injector, Type } from "@angular/core";
4
+ import { Selector } from "reselect";
5
+ export declare const isObject: <T>(item: T) => boolean;
6
+ export declare function merge<T>(target: T): T;
7
+ export declare function merge<T, A>(target: T, a: A): T & A;
8
+ export declare function merge<T, A, B>(target: T, a: A, b: B): T & A & B;
9
+ export declare function merge<T, A, B, C>(target: T, a: A, b: B, c: C): T & A & B & C;
10
+ export declare function merge<T, A, B, C, D>(target: T, a: A, b: B, c: C, d: D): T & A & B & C & D;
11
+ export declare function merge<T, A, B, C, D, E>(target: T, a: A, b: B, c: C, d: D, e: E): T & A & B & C & D & E;
12
+ export declare function merge<T, A, B, C, D, E, F>(target: T, a: A, b: B, c: C, d: D, e: E, f: F): T & A & B & C & D & E & F;
14
13
  /**
15
14
  * deep merge of two or more objects
16
15
  *
@@ -18,9 +17,8 @@ declare function merge<T, A, B, C, D, E, F>(target: T, a: A, b: B, c: C, d: D, e
18
17
  * @param sources immutable sources to apply to target
19
18
  * @returns a new merged object
20
19
  */
21
- declare const mergeDeep: <T extends object, S>(target: T, ...sources: S[]) => any;
22
- declare const mergeAll: <T>(array: Array<T>) => T;
23
-
20
+ export declare const mergeDeep: <T extends object, S>(target: T, ...sources: S[]) => any;
21
+ export declare const mergeAll: <T>(array: Array<T>) => T;
24
22
  /**
25
23
  * XMLHttpRequest configuration having the following parameters
26
24
  * url: the path to the request, mandatory
@@ -31,271 +29,262 @@ declare const mergeAll: <T>(array: Array<T>) => T;
31
29
  * withCredentials: True when credentials are to be included in a cross-origin request. False otherwise.
32
30
  * timeout - time in milliseconds. A non-zero value will terminate the execution after the given time has passed
33
31
  */
34
- interface XHRConfig {
35
- url: string;
36
- method?: string;
37
- responseType?: XMLHttpRequestResponseType;
38
- headers?: {
39
- [key: string]: string;
40
- };
41
- body?: Document | XMLHttpRequestBodyInit;
42
- withCredentials?: boolean;
43
- timeout?: number;
32
+ export interface XHRConfig {
33
+ url: string;
34
+ method?: string;
35
+ responseType?: XMLHttpRequestResponseType;
36
+ headers?: {
37
+ [key: string]: string;
38
+ };
39
+ body?: Document | XMLHttpRequestBodyInit;
40
+ withCredentials?: boolean;
41
+ timeout?: number;
44
42
  }
45
43
  /**
46
44
  * Default xhr configuration
47
45
  */
48
- declare const DEFAULT_XHR_CONFIG: XHRConfig;
46
+ export declare const DEFAULT_XHR_CONFIG: XHRConfig;
49
47
  /**
50
48
  * Utility function to call a XMLHttpRequest and send the response as a Promise. The response can be parameterized
51
49
  *
52
50
  * @param config xhr configuration
53
51
  */
54
- declare function xhr<T>(urlOrConfig: string | XHRConfig): Promise<T>;
55
-
56
- declare class UxErrorOutput<DETAILS = unknown> implements UxErrorInfo, UxHttpErrorInfo, UxErrorFeedback {
57
- code?: string;
58
- requestId?: string;
59
- doc?: string;
60
- details?: DETAILS;
61
- severity: UxMessageSeverity;
62
- msgId: string;
63
- description: string;
64
- errGroupMap?: Array<UxErrorGroupMap>;
65
- subErrors?: SubErrors;
66
- constructor(info: UxErrorInfo & UxHttpErrorInfo, errorFeedback: UxErrorFeedback, subErrors?: SubErrors, errGroupMap?: Array<UxErrorGroupMap>);
67
- getFeedBacks(byKey?: string): Array<UxErrorFeedback>;
68
- private checkAttribute;
69
- }
70
- declare class UxErrorGroupOnClickEvent {
71
- groupId: string;
72
- err?: UxErrorFeedback;
73
- constructor(groupId: string, err?: UxErrorFeedback);
74
- }
75
- interface UxErrorFollowMap {
76
- [groupId: string]: boolean;
77
- }
78
- type UxErrorGroupMap = {
79
- id: string;
80
- description: string;
81
- severity: UxMessageSeverity;
52
+ export declare function xhr<T>(urlOrConfig: string | XHRConfig): Promise<T>;
53
+ export declare class UxErrorOutput<DETAILS = unknown> implements UxErrorInfo, UxHttpErrorInfo, UxErrorFeedback {
54
+ code?: string;
55
+ requestId?: string;
56
+ doc?: string;
57
+ details?: DETAILS;
58
+ severity: UxMessageSeverity;
59
+ msgId: string;
60
+ description: string;
61
+ errGroupMap?: Array<UxErrorGroupMap>;
62
+ subErrors?: SubErrors;
63
+ constructor(info: UxErrorInfo & UxHttpErrorInfo, errorFeedback: UxErrorFeedback, subErrors?: SubErrors, errGroupMap?: Array<UxErrorGroupMap>);
64
+ getFeedBacks(byKey?: string): Array<UxErrorFeedback>;
65
+ private checkAttribute;
66
+ }
67
+ export declare class UxErrorGroupOnClickEvent {
68
+ groupId: string;
69
+ err?: UxErrorFeedback;
70
+ constructor(groupId: string, err?: UxErrorFeedback);
71
+ }
72
+ export interface UxErrorFollowMap {
73
+ [groupId: string]: boolean;
74
+ }
75
+ export type UxErrorGroupMap = {
76
+ id: string;
77
+ description: string;
78
+ severity: UxMessageSeverity;
82
79
  };
83
- type UxErrorGroupItem = {
84
- groupId: string;
85
- description: string;
86
- severity: UxMessageSeverity;
87
- errors: Array<UxErrorFeedback>;
80
+ export type UxErrorGroupItem = {
81
+ groupId: string;
82
+ description: string;
83
+ severity: UxMessageSeverity;
84
+ errors: Array<UxErrorFeedback>;
88
85
  };
89
- interface UxErrorInfo<DETAILS = unknown> {
90
- code?: string;
91
- doc?: string;
92
- details?: DETAILS;
93
- }
94
- interface UxHttpErrorInfo {
95
- requestId?: string;
96
- }
97
- interface UxErrorFeedback extends UxErrorMessage {
98
- severity?: UxMessageSeverity;
99
- attributes?: UxValidationErrorAttributes;
100
- errGroupId?: string;
101
- br?: string;
102
- doc?: string;
103
- }
104
- interface UxErrorMessage {
105
- msgId: string;
106
- description?: string;
107
- }
108
- type UxValidationErrorAttributes = Array<UxValidationErrorAttribute>;
109
- interface UxValidationErrorAttribute {
110
- key: string | Array<string>;
111
- value: string;
112
- }
113
- declare enum UxMessageSeverity {
114
- info = "info",
115
- warning = "warning",
116
- danger = "danger",
117
- success = "success"
118
- }
119
- declare enum UxMessageSeverityMetrics {
120
- info = 0,
121
- warning = 1,
122
- danger = 2,
123
- success = 3
124
- }
125
- type SubErrors = Array<UxValidationErrorClass>;
126
- declare class UxValidationErrorClass<Details = object> implements UxErrorInfo<Details>, UxErrorFeedback {
127
- msgId: string;
128
- description?: string;
129
- severity: UxMessageSeverity;
130
- attributes: UxValidationErrorAttributes;
131
- br?: string;
132
- doc?: string;
133
- details?: Details;
134
- errGroupId?: string;
135
- constructor(data: UxValidationErrorClass);
136
- }
137
- type ErrorMappingHandler<Error = object> = (err: Error) => UxErrorOutput;
138
- interface UxHttpErrorResponse extends HttpErrorResponse {
139
- uxHttpErrorOutput: UxErrorOutput;
140
- }
141
- declare const transformToUxHttpResponse: (resp: HttpErrorResponse, mapper: ErrorMappingHandler) => UxHttpErrorResponse;
142
- type UxErrorFeedbackEventType = UxPublishErrorFeedbackEvent | UxClearErrorFeedbackEvent;
143
- declare class UxPublishErrorFeedbackEvent {
144
- err: UxErrorOutput;
145
- id?: string;
146
- groupId?: string;
147
- accumulate?: boolean;
148
- constructor(err: UxErrorOutput, id?: string, groupId?: string, accumulate?: boolean);
149
- }
150
- declare class UxClearErrorFeedbackEvent {
151
- id?: string;
152
- groupId?: string;
153
- constructor(id?: string, groupId?: string);
154
- }
155
-
156
- declare class UxBadgeLegacy {
157
- label: string;
158
- typeClass: string;
159
- constructor(values?: object);
160
- }
161
- declare class UxLinkLegacy<METADATA = unknown> {
162
- id: string;
163
- label: string;
164
- ariaIconLabel: string;
165
- subLabel: string;
166
- typeLabel: string;
167
- typeLabelClass: string;
168
- url: string;
169
- urlExternal: string;
170
- urlExternalTarget: string;
171
- disabled: boolean;
172
- children: UxLinkLegacy<METADATA>[];
173
- parent: UxLinkLegacy<METADATA>;
174
- iconClass: string;
175
- iconTypeClass: string;
176
- hasIconBg: boolean;
177
- active: boolean;
178
- metadata: METADATA;
179
- visible: boolean;
180
- expanded: boolean;
181
- command: () => void;
182
- hasMarker: boolean;
183
- markerTypeClass: string;
184
- hasTag: boolean;
185
- tagTypeClass: string;
186
- tagLabel: string;
187
- tagCount: string;
188
- badgeTypeClass: string;
189
- badgeLabel: string;
190
- badges: UxBadgeLegacy[];
191
- tooltipLabel: string;
192
- typeClass: string;
193
- isHome: boolean;
194
- isSeparator: boolean;
195
- isScreenReaderClickable: boolean;
196
- allowedRightId: string;
197
- allowedRightIds: string[];
198
- deniedRightId: string;
199
- deniedRightIds: string[];
200
- selected: boolean;
201
- indeterminate: boolean;
202
- e2eAttr: string;
203
- category: string;
204
- constructor(values?: object);
205
- get hasChildren(): boolean;
206
- }
207
-
208
- interface UxFormValidationError {
209
- uxValidationError: UxValidationErrorFeedback;
210
- }
211
- interface UxValidationErrorFeedback {
212
- message: string | UxValidationErrorI18nMessage;
213
- /**
214
- * danger, warning, info
215
- */
216
- type: string;
217
- }
218
- interface UxValidationErrorI18nMessage {
219
- id: string;
220
- params?: object;
221
- }
222
-
223
- interface UxModalLegacy {
224
- id: string;
225
- isOpen: boolean;
226
- isFullHeight?: boolean;
227
- }
228
-
229
- interface HttpErrorHandlerConfig {
230
- /**
231
- * The list of routes, from specific to generic. The first matching one is handled.
232
- */
233
- routes: HttpErrorRouteConfig[];
234
- }
235
- interface HttpErrorRouteConfig {
236
- /**
237
- * The path to match against, a URL string that uses router matching notation. Can include wildcard characters (*).
238
- */
239
- path: string;
240
- /**
241
- * Default behaviour, if error status code does not match
242
- */
243
- default?: HttpErrorCallbackFn | string | null;
244
- /**
245
- * What to do in case of an error status code.
246
- * if callback function, call it
247
- * if it's string, redirect the router to it
248
- * if null, do nothing
249
- */
250
- [key: number]: HttpErrorCallbackFn | string | null;
86
+ export interface UxErrorInfo<DETAILS = unknown> {
87
+ code?: string;
88
+ doc?: string;
89
+ details?: DETAILS;
90
+ }
91
+ export interface UxHttpErrorInfo {
92
+ requestId?: string;
93
+ }
94
+ export interface UxErrorFeedback extends UxErrorMessage {
95
+ severity?: UxMessageSeverity;
96
+ attributes?: UxValidationErrorAttributes;
97
+ errGroupId?: string;
98
+ br?: string;
99
+ doc?: string;
100
+ }
101
+ export interface UxErrorMessage {
102
+ msgId: string;
103
+ description?: string;
104
+ }
105
+ export type UxValidationErrorAttributes = Array<UxValidationErrorAttribute>;
106
+ export interface UxValidationErrorAttribute {
107
+ key: string | Array<string>;
108
+ value: string;
109
+ }
110
+ export declare enum UxMessageSeverity {
111
+ info = "info",
112
+ warning = "warning",
113
+ danger = "danger",
114
+ success = "success"
115
+ }
116
+ export declare enum UxMessageSeverityMetrics {
117
+ info = 0,
118
+ warning = 1,
119
+ danger = 2,
120
+ success = 3
121
+ }
122
+ export type SubErrors = Array<UxValidationErrorClass>;
123
+ export declare class UxValidationErrorClass<Details = object> implements UxErrorInfo<Details>, UxErrorFeedback {
124
+ msgId: string;
125
+ description?: string;
126
+ severity: UxMessageSeverity;
127
+ attributes: UxValidationErrorAttributes;
128
+ br?: string;
129
+ doc?: string;
130
+ details?: Details;
131
+ errGroupId?: string;
132
+ constructor(data: UxValidationErrorClass);
133
+ }
134
+ export type ErrorMappingHandler<Error = object> = (err: Error) => UxErrorOutput;
135
+ export interface UxHttpErrorResponse extends HttpErrorResponse {
136
+ uxHttpErrorOutput: UxErrorOutput;
137
+ }
138
+ export declare const transformToUxHttpResponse: (resp: HttpErrorResponse, mapper: ErrorMappingHandler) => UxHttpErrorResponse;
139
+ export type UxErrorFeedbackEventType = UxPublishErrorFeedbackEvent | UxClearErrorFeedbackEvent;
140
+ export declare class UxPublishErrorFeedbackEvent {
141
+ err: UxErrorOutput;
142
+ id?: string;
143
+ groupId?: string;
144
+ accumulate?: boolean;
145
+ constructor(err: UxErrorOutput, id?: string, groupId?: string, accumulate?: boolean);
146
+ }
147
+ export declare class UxClearErrorFeedbackEvent {
148
+ id?: string;
149
+ groupId?: string;
150
+ constructor(id?: string, groupId?: string);
151
+ }
152
+ export declare class UxBadgeLegacy {
153
+ label: string;
154
+ typeClass: string;
155
+ constructor(values?: object);
156
+ }
157
+ export declare class UxLinkLegacy<METADATA = unknown> {
158
+ id: string;
159
+ label: string;
160
+ ariaIconLabel: string;
161
+ subLabel: string;
162
+ typeLabel: string;
163
+ typeLabelClass: string;
164
+ url: string;
165
+ urlExternal: string;
166
+ urlExternalTarget: string;
167
+ disabled: boolean;
168
+ children: UxLinkLegacy<METADATA>[];
169
+ parent: UxLinkLegacy<METADATA>;
170
+ iconClass: string;
171
+ iconTypeClass: string;
172
+ hasIconBg: boolean;
173
+ active: boolean;
174
+ metadata: METADATA;
175
+ visible: boolean;
176
+ expanded: boolean;
177
+ command: () => void;
178
+ hasMarker: boolean;
179
+ markerTypeClass: string;
180
+ hasTag: boolean;
181
+ tagTypeClass: string;
182
+ tagLabel: string;
183
+ tagCount: string;
184
+ badgeTypeClass: string;
185
+ badgeLabel: string;
186
+ badges: UxBadgeLegacy[];
187
+ tooltipLabel: string;
188
+ typeClass: string;
189
+ isHome: boolean;
190
+ isSeparator: boolean;
191
+ isScreenReaderClickable: boolean;
192
+ allowedRightId: string;
193
+ allowedRightIds: string[];
194
+ deniedRightId: string;
195
+ deniedRightIds: string[];
196
+ selected: boolean;
197
+ indeterminate: boolean;
198
+ e2eAttr: string;
199
+ category: string;
200
+ constructor(values?: object);
201
+ get hasChildren(): boolean;
202
+ }
203
+ export interface UxFormValidationError {
204
+ uxValidationError: UxValidationErrorFeedback;
205
+ }
206
+ export interface UxValidationErrorFeedback {
207
+ message: string | UxValidationErrorI18nMessage;
208
+ /**
209
+ * danger, warning, info
210
+ */
211
+ type: string;
212
+ }
213
+ export interface UxValidationErrorI18nMessage {
214
+ id: string;
215
+ params?: object;
216
+ }
217
+ export interface UxModalLegacy {
218
+ id: string;
219
+ isOpen: boolean;
220
+ isFullHeight?: boolean;
221
+ }
222
+ export interface HttpErrorHandlerConfig {
223
+ /**
224
+ * The list of routes, from specific to generic. The first matching one is handled.
225
+ */
226
+ routes: HttpErrorRouteConfig[];
227
+ }
228
+ export interface HttpErrorRouteConfig {
229
+ /**
230
+ * The path to match against, a URL string that uses router matching notation. Can include wildcard characters (*).
231
+ */
232
+ path: string;
233
+ /**
234
+ * Default behaviour, if error status code does not match
235
+ */
236
+ default?: HttpErrorCallbackFn | string | null;
237
+ /**
238
+ * What to do in case of an error status code.
239
+ * if callback function, call it
240
+ * if it's string, redirect the router to it
241
+ * if null, do nothing
242
+ */
243
+ [key: number]: HttpErrorCallbackFn | string | null;
244
+ }
245
+ export type HttpErrorCallbackFn = (error: HttpErrorResponse, injector: Injector) => void;
246
+ export interface EuiStoreServiceModel<T> {
247
+ select<K>(mapFn: (state: T) => K): Observable<K | Partial<K>>;
251
248
  }
252
- type HttpErrorCallbackFn = (error: HttpErrorResponse, injector: Injector) => void;
253
-
254
- interface EuiStoreServiceModel<T> {
255
- select<K>(mapFn: (state: T) => K): Observable<K | Partial<K>>;
256
- }
257
-
258
249
  type HTTPMethod = 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'TRACE' | 'PATCH';
259
- interface ApiQueueItem<PAYLOAD = unknown> {
260
- uri: string;
261
- method: HTTPMethod | string;
262
- payload?: PAYLOAD;
263
- timestamp?: number;
264
- }
265
- interface ApiQueue {
266
- [id: string]: ApiQueueItem;
267
- }
268
-
269
- interface UserDetails {
270
- userId: string;
271
- firstName?: string;
272
- lastName?: string;
273
- fullName?: string;
274
- }
275
- interface UserPreferences<DASHBOARD = any, T = any> {
276
- dashboard?: DASHBOARD;
277
- lang?: string;
278
- [key: string]: string | DASHBOARD | T;
279
- }
280
- declare const initialUserPreferences: UserPreferences;
281
-
250
+ export interface ApiQueueItem<PAYLOAD = unknown> {
251
+ uri: string;
252
+ method: HTTPMethod | string;
253
+ payload?: PAYLOAD;
254
+ timestamp?: number;
255
+ }
256
+ export interface ApiQueue {
257
+ [id: string]: ApiQueueItem;
258
+ }
259
+ export interface UserDetails {
260
+ userId: string;
261
+ firstName?: string;
262
+ lastName?: string;
263
+ fullName?: string;
264
+ }
265
+ export interface UserPreferences<DASHBOARD = any, T = any> {
266
+ dashboard?: DASHBOARD;
267
+ lang?: string;
268
+ [key: string]: string | DASHBOARD | T;
269
+ }
270
+ export declare const initialUserPreferences: UserPreferences;
282
271
  /**
283
272
  * The EuiEnvConfig is the environment specific configuration object for the EUI library.
284
273
  */
285
- interface EuiEnvConfig<T = unknown> {
286
- /**
287
- * The envAppHandlersConfig contains the environment specific handlers' configuration.
288
- */
289
- envAppHandlersConfig?: EuiAppHandlersConfig;
290
- /**
291
- * The envDynamicConfig contains the environment specific dynamic configuration.
292
- */
293
- envDynamicConfig?: EnvDynamicConfig;
294
- /**
295
- * The loadedEnvDynamicConfig contains the loaded environment specific dynamic configuration.
296
- */
297
- loadedEnvDynamicConfig?: EuiAppJsonConfig;
298
- [key: string]: EuiAppHandlersConfig | EnvDynamicConfig | EuiAppJsonConfig | T;
274
+ export interface EuiEnvConfig<T = unknown> {
275
+ /**
276
+ * The envAppHandlersConfig contains the environment specific handlers' configuration.
277
+ */
278
+ envAppHandlersConfig?: EuiAppHandlersConfig;
279
+ /**
280
+ * The envDynamicConfig contains the environment specific dynamic configuration.
281
+ */
282
+ envDynamicConfig?: EnvDynamicConfig;
283
+ /**
284
+ * The loadedEnvDynamicConfig contains the loaded environment specific dynamic configuration.
285
+ */
286
+ loadedEnvDynamicConfig?: EuiAppJsonConfig;
287
+ [key: string]: EuiAppHandlersConfig | EnvDynamicConfig | EuiAppJsonConfig | T;
299
288
  }
300
289
  /**
301
290
  * The EnvDynamicConfig is the dynamic configuration object for the EUI library that uses the dynamic configuration to
@@ -303,62 +292,59 @@ interface EuiEnvConfig<T = unknown> {
303
292
  * The dynamic configuration can be fetched from a local path or a web service, can be merged or deep merged with the
304
293
  * default configuration at runtime and can be awaited for a specific duration to resolve the request.
305
294
  */
306
- interface EnvDynamicConfig {
307
- /** uri which can be local path or webservice, should store/return json-config which implements EuiAppJsonConfig*/
308
- uri: string;
309
- /**
310
- * Dynamic config will be awaiting 2000ms(default) to resolve the request,
311
- * to change this duration you can use this parameter
312
- */
313
- configTimeout?: number;
314
- /**
315
- * Dynamic configuration overwrites to the config properties of EuiAppJsonConfig
316
- * in the default configuration (global, modules, versions, [key: string]: any; )
317
- * To merge the data for specific config property/ies you can define them as array, e.g.['modules','global']
318
- * Note: When deepMerge:true is not provided, If there is common sub property for the merged object,
319
- * dynamic fetched config will be overwriting it, otherwise It will be merged deeply.
320
- */
321
- merge?: Array<string>;
322
- /**
323
- * If merge array is provided, the way of merging will be one-level merge as default.
324
- * To have deep merge functionality, you have to define deepMerge:true
325
- */
326
- deepMerge?: boolean;
295
+ export interface EnvDynamicConfig {
296
+ /** uri which can be local path or webservice, should store/return json-config which implements EuiAppJsonConfig*/
297
+ uri: string;
298
+ /**
299
+ * Dynamic config will be awaiting 2000ms(default) to resolve the request,
300
+ * to change this duration you can use this parameter
301
+ */
302
+ configTimeout?: number;
303
+ /**
304
+ * Dynamic configuration overwrites to the config properties of EuiAppJsonConfig
305
+ * in the default configuration (global, modules, versions, [key: string]: any; )
306
+ * To merge the data for specific config property/ies you can define them as array, e.g.['modules','global']
307
+ * Note: When deepMerge:true is not provided, If there is common sub property for the merged object,
308
+ * dynamic fetched config will be overwriting it, otherwise It will be merged deeply.
309
+ */
310
+ merge?: Array<string>;
311
+ /**
312
+ * If merge array is provided, the way of merging will be one-level merge as default.
313
+ * To have deep merge functionality, you have to define deepMerge:true
314
+ */
315
+ deepMerge?: boolean;
327
316
  }
328
-
329
317
  /**
330
318
  * EuiConfig is the main configuration object for the EUI library. It is used to provide the configuration to the EUI library.
331
319
  * The EUI library uses the configuration to initialize the services and components.
332
320
  */
333
- interface EuiConfig {
334
- /**
335
- * The appConfig contains the global configuration and the modules' configuration.
336
- */
337
- appConfig: EuiAppConfig;
338
- /**
339
- * The environment contains the environment specific configuration.
340
- */
341
- environment: EuiEnvConfig;
342
- }
343
-
344
- interface EuiLanguage {
345
- /** the ISO language code e.g. en or fr */
346
- code: string;
347
- /** the label of the language translated in that language */
348
- label: string;
349
- /** languages with rght to left writing */
350
- isRtl?: boolean;
351
- }
352
-
353
- interface I18nResource {
354
- /** prefix of the resource could be like the 2 char language code e.g. /en */
355
- prefix: string;
356
- /** suffix can be either .json or anything related of the resource HTTP call */
357
- suffix?: string;
358
- /**
321
+ export interface EuiConfig {
322
+ /**
323
+ * The appConfig contains the global configuration and the modules' configuration.
324
+ */
325
+ appConfig: EuiAppConfig;
326
+ /**
327
+ * The environment contains the environment specific configuration.
328
+ */
329
+ environment: EuiEnvConfig;
330
+ }
331
+ export interface EuiLanguage {
332
+ /** the ISO language code e.g. en or fr */
333
+ code: string;
334
+ /** the label of the language translated in that language */
335
+ label: string;
336
+ /** languages with rght to left writing */
337
+ isRtl?: boolean;
338
+ }
339
+ export interface I18nResource {
340
+ /** prefix of the resource could be like the 2 char language code e.g. /en */
341
+ prefix: string;
342
+ /** suffix can be either .json or anything related of the resource HTTP call */
343
+ suffix?: string;
344
+ /**
359
345
  It is an ID of the function which should be defined into the customHandlers with the interface TranslationsCompiler
360
346
  */
361
- compileTranslations?: string;
347
+ compileTranslations?: string;
362
348
  }
363
349
  /**
364
350
  * a factory to compile translations into the main object holding them all
@@ -367,604 +353,574 @@ interface I18nResource {
367
353
  * @param lang the translations language
368
354
  * @returns the pre-processed translations
369
355
  */
370
- type TranslationsCompiler<T = unknown, C = unknown> = (translations: T, lang: string) => C;
371
- interface I18nConfig {
372
- icuEnabled?: boolean;
373
- i18nService: I18nServiceConfig;
374
- i18nLoader: I18nLoaderConfig;
375
- }
376
- interface I18nServiceConfig {
377
- /** an ISO 2 char code array of available languages */
378
- languages?: (string | EuiLanguage)[];
379
- /** default language to be used in case of not any has been set */
380
- defaultLanguage?: string;
381
- }
382
- interface I18nLoaderConfig {
383
- /**
384
- * Those folders will be used to load the translations files from {@link https://angular.io/guide/workspace-config#extra-build-and-test-options assets}.
385
- * e.g [`${environment.apiBaseUrl}translations/`, `${environment.apiBaseUrl}translations?lang=`]
386
- * Important! the language code will be added automatically to the end of the url except if the url ends with a slash.
387
- */
388
- i18nFolders?: string | string[];
389
- /**
390
- * Array of service urls to translation, don't add the language it will be added e.g. http://net1/trans/en
391
- * Keep in mind that the url should be the prefix and not contain any suffix.
392
- */
393
- i18nServices?: string | string[];
394
- /**
395
- * It is a set of more customized resources to be loaded. You can provide a function to compile the translations or simply
396
- * provide the prefix and suffix of the resource, or both.
397
- *
398
- * @example
399
- * ```typescript
400
- * export function CompileTranslations(translations: any): any {
401
- * const result = {};
402
- * translations.forEach((translation: any) => {
403
- * // extract the key and value from the translation object
404
- * const key = translation['key'];
405
- * const value = translation['value'];
406
- * if (key && value) {
407
- * result[key] = value;
408
- * }
409
- * });
410
- * return result;
411
- * }
412
- * export const appConfig: EuiAppConfig = {
413
- * ...,
414
- * customHandler: {
415
- * 'CompileTranslations_ID': CompileTranslations
416
- * }
417
- * };
418
- * export const GLOBAL: GlobalConfig = {
419
- * ...,
420
- * i18n: {
421
- * i18nLoader: {
422
- * i18nFolders: ['i18n-eui'],
423
- * i18nResources: [{
424
- * prefix: 'api/translations/',
425
- * compileTranslations: 'CompileTranslations_ID',
426
- * }]
427
- * }
428
- * }
429
- * };
430
- *
431
- */
432
- i18nResources?: I18nResource | I18nResource[];
433
- }
434
- declare const getI18nServiceConfigFromBase: (baseGlobalConfig: GlobalConfig) => I18nServiceConfig;
435
- declare const getI18nServiceConfig: (config: I18nServiceConfig) => I18nServiceConfig;
436
- declare const getI18nLoaderConfig: (config: I18nLoaderConfig) => I18nLoaderConfig;
356
+ export type TranslationsCompiler<T = unknown, C = unknown> = (translations: T, lang: string) => C;
357
+ export interface I18nConfig {
358
+ icuEnabled?: boolean;
359
+ i18nService: I18nServiceConfig;
360
+ i18nLoader: I18nLoaderConfig;
361
+ }
362
+ export interface I18nServiceConfig {
363
+ /** an ISO 2 char code array of available languages */
364
+ languages?: (string | EuiLanguage)[];
365
+ /** default language to be used in case of not any has been set */
366
+ defaultLanguage?: string;
367
+ }
368
+ export interface I18nLoaderConfig {
369
+ /**
370
+ * Those folders will be used to load the translations files from {@link https://angular.io/guide/workspace-config#extra-build-and-test-options assets}.
371
+ * e.g [`${environment.apiBaseUrl}translations/`, `${environment.apiBaseUrl}translations?lang=`]
372
+ * Important! the language code will be added automatically to the end of the url except if the url ends with a slash.
373
+ */
374
+ i18nFolders?: string | string[];
375
+ /**
376
+ * Array of service urls to translation, don't add the language it will be added e.g. http://net1/trans/en
377
+ * Keep in mind that the url should be the prefix and not contain any suffix.
378
+ */
379
+ i18nServices?: string | string[];
380
+ /**
381
+ * It is a set of more customized resources to be loaded. You can provide a function to compile the translations or simply
382
+ * provide the prefix and suffix of the resource, or both.
383
+ *
384
+ * @example
385
+ * ```typescript
386
+ * export function CompileTranslations(translations: any): any {
387
+ * const result = {};
388
+ * translations.forEach((translation: any) => {
389
+ * // extract the key and value from the translation object
390
+ * const key = translation['key'];
391
+ * const value = translation['value'];
392
+ * if (key && value) {
393
+ * result[key] = value;
394
+ * }
395
+ * });
396
+ * return result;
397
+ * }
398
+ * export const appConfig: EuiAppConfig = {
399
+ * ...,
400
+ * customHandler: {
401
+ * 'CompileTranslations_ID': CompileTranslations
402
+ * }
403
+ * };
404
+ * export const GLOBAL: GlobalConfig = {
405
+ * ...,
406
+ * i18n: {
407
+ * i18nLoader: {
408
+ * i18nFolders: ['i18n-eui'],
409
+ * i18nResources: [{
410
+ * prefix: 'api/translations/',
411
+ * compileTranslations: 'CompileTranslations_ID',
412
+ * }]
413
+ * }
414
+ * }
415
+ * };
416
+ *
417
+ */
418
+ i18nResources?: I18nResource | I18nResource[];
419
+ }
420
+ export declare const getI18nServiceConfigFromBase: (baseGlobalConfig: GlobalConfig) => I18nServiceConfig;
421
+ export declare const getI18nServiceConfig: (config: I18nServiceConfig) => I18nServiceConfig;
422
+ export declare const getI18nLoaderConfig: (config: I18nLoaderConfig) => I18nLoaderConfig;
437
423
  /**
438
424
  * returns a language code based on https://tools.ietf.org/rfc/bcp/bcp47.txt specification. To get the Browser's
439
425
  * it's using the navigator.language, splits by hyphen and get the first part.
440
426
  */
441
- declare const getBrowserDefaultLanguage: () => string;
427
+ export declare const getBrowserDefaultLanguage: () => string;
442
428
  /**
443
429
  * returns an array of DOMStrings representing the user's preferred languages. The language is described using BCP 47
444
430
  * language tags. In the returned array they are ordered by preference with the most preferred language first.
445
431
  * The array languages will be lower cased 2 char code.
446
432
  */
447
- declare const getBrowserPreferredLanguages: () => string[];
448
-
433
+ export declare const getBrowserPreferredLanguages: () => string[];
449
434
  /** Log level */
450
- declare enum LogLevel {
451
- OFF = 0,
452
- FATAL = 1,
453
- ERROR = 2,
454
- WARN = 3,
455
- INFO = 4,
456
- DEBUG = 5,
457
- TRACE = 6,
458
- ALL = 7
435
+ export declare enum LogLevel {
436
+ OFF = 0,
437
+ FATAL = 1,
438
+ ERROR = 2,
439
+ WARN = 3,
440
+ INFO = 4,
441
+ DEBUG = 5,
442
+ TRACE = 6,
443
+ ALL = 7
459
444
  }
460
445
  /** Associated log level names */
461
- declare enum LogLevelName {
462
- FATAL = "FATAL",
463
- ERROR = "ERROR",
464
- WARN = "WARNING",
465
- INFO = "INFO",
466
- DEBUG = "DEBUG",
467
- TRACE = "TRACE"
446
+ export declare enum LogLevelName {
447
+ FATAL = "FATAL",
448
+ ERROR = "ERROR",
449
+ WARN = "WARNING",
450
+ INFO = "INFO",
451
+ DEBUG = "DEBUG",
452
+ TRACE = "TRACE"
468
453
  }
469
454
  /** The code position from where the log has been triggered */
470
- interface LogPosition {
471
- file: string;
472
- line: number;
473
- column: number;
455
+ export interface LogPosition {
456
+ file: string;
457
+ line: number;
458
+ column: number;
474
459
  }
475
460
  /** The log event sent to the log appenders */
476
- interface LogEvent<MESSAGES = unknown> {
477
- /** event's log level */
478
- level: LogLevel;
479
- /** event's log level name */
480
- levelName: string;
481
- /** the name of the logger who triggered the event */
482
- loggerName: string;
483
- /** event's timestamp */
484
- timestamp: Date;
485
- /** log messages */
486
- messages: MESSAGES[];
487
- }
488
-
461
+ export interface LogEvent<MESSAGES = unknown> {
462
+ /** event's log level */
463
+ level: LogLevel;
464
+ /** event's log level name */
465
+ levelName: string;
466
+ /** the name of the logger who triggered the event */
467
+ loggerName: string;
468
+ /** event's timestamp */
469
+ timestamp: Date;
470
+ /** log messages */
471
+ messages: MESSAGES[];
472
+ }
489
473
  /**
490
474
  * Abstract Log Appender
491
475
  */
492
- declare abstract class LogAppender<CFG extends LogAppenderConfig = LogAppenderConfig> {
493
- protected config: CFG;
494
- protected injector: Injector;
495
- constructor(config: CFG, injector?: Injector);
496
- /**
497
- * Gets the config
498
- *
499
- * @returns the config
500
- */
501
- getConfig(): CFG;
502
- /**
503
- * Logs a Log Event
504
- *
505
- * @param event log event
506
- */
507
- abstract append(event: LogEvent): void;
476
+ export declare abstract class LogAppender<CFG extends LogAppenderConfig = LogAppenderConfig> {
477
+ protected config: CFG;
478
+ protected injector: Injector;
479
+ constructor(config: CFG, injector?: Injector);
480
+ /**
481
+ * Gets the config
482
+ *
483
+ * @returns the config
484
+ */
485
+ getConfig(): CFG;
486
+ /**
487
+ * Logs a Log Event
488
+ *
489
+ * @param event log event
490
+ */
491
+ abstract append(event: LogEvent): void;
508
492
  }
509
-
510
493
  /**
511
494
  * Url Appender
512
495
  */
513
- declare class UrlAppender extends LogAppender<UrlAppenderConfig> {
514
- config: UrlAppenderConfig;
515
- protected injector: Injector;
516
- protected http: HttpClient;
517
- constructor(config: UrlAppenderConfig, injector: Injector);
518
- /**
519
- * Logs an event to a server
520
- */
521
- append(event: LogEvent): void;
522
- /**
523
- * Maps a LogEvent into a UrlLogEvent
524
- */
525
- protected toUrlEvent(event: LogEvent): UrlLogEvent;
526
- /**
527
- * returns the code position from where the log has been triggered
528
- */
529
- protected getPosition(): LogPosition;
530
- /**
531
- * returns the url of the current page
532
- */
533
- protected getLocation(): string;
534
- /**
535
- * check messages if object type is Error and make its properties enumerable
536
- */
537
- protected filterErrorType(event: LogEvent): LogEvent;
496
+ export declare class UrlAppender extends LogAppender<UrlAppenderConfig> {
497
+ config: UrlAppenderConfig;
498
+ protected injector: Injector;
499
+ protected http: HttpClient;
500
+ constructor(config: UrlAppenderConfig, injector: Injector);
501
+ /**
502
+ * Logs an event to a server
503
+ */
504
+ append(event: LogEvent): void;
505
+ /**
506
+ * Maps a LogEvent into a UrlLogEvent
507
+ */
508
+ protected toUrlEvent(event: LogEvent): UrlLogEvent;
509
+ /**
510
+ * returns the code position from where the log has been triggered
511
+ */
512
+ protected getPosition(): LogPosition;
513
+ /**
514
+ * returns the url of the current page
515
+ */
516
+ protected getLocation(): string;
517
+ /**
518
+ * check messages if object type is Error and make its properties enumerable
519
+ */
520
+ protected filterErrorType(event: LogEvent): LogEvent;
538
521
  }
539
-
540
522
  /** Default console prefix converters */
541
- declare const DEFAULT_CONSOLE_APPENDER_PREFIX_CONVERTERS: ConsoleAppenderPrefixConverters;
523
+ export declare const DEFAULT_CONSOLE_APPENDER_PREFIX_CONVERTERS: ConsoleAppenderPrefixConverters;
542
524
  /**
543
525
  * Console Appender
544
526
  */
545
- declare class ConsoleAppender extends LogAppender<ConsoleAppenderConfig> {
546
- config: ConsoleAppenderConfig;
547
- constructor(config?: ConsoleAppenderConfig);
548
- /**
549
- * Logs an event in the console
550
- */
551
- append(event: LogEvent): void;
552
- /**
553
- * Returns the prefix to be added to the messages
554
- *
555
- * @param event the log event
556
- * @returns the formatted prefix, as string
557
- */
558
- protected getPrefix(event: LogEvent): string;
559
- /**
560
- * Utility method to replace a placeholder
561
- *
562
- * @param str the string with placeholders
563
- * @param find the placeholder
564
- * @param replace the string to replace the placeholder
565
- * @returns the converted string
566
- */
567
- protected convert(str: string, find: string, replace: string): string;
527
+ export declare class ConsoleAppender extends LogAppender<ConsoleAppenderConfig> {
528
+ config: ConsoleAppenderConfig;
529
+ constructor(config?: ConsoleAppenderConfig);
530
+ /**
531
+ * Logs an event in the console
532
+ */
533
+ append(event: LogEvent): void;
534
+ /**
535
+ * Returns the prefix to be added to the messages
536
+ *
537
+ * @param event the log event
538
+ * @returns the formatted prefix, as string
539
+ */
540
+ protected getPrefix(event: LogEvent): string;
541
+ /**
542
+ * Utility method to replace a placeholder
543
+ *
544
+ * @param str the string with placeholders
545
+ * @param find the placeholder
546
+ * @param replace the string to replace the placeholder
547
+ * @returns the converted string
548
+ */
549
+ protected convert(str: string, find: string, replace: string): string;
568
550
  }
569
-
570
551
  /**
571
552
  * Logger
572
553
  */
573
- declare class Logger {
574
- protected name: string;
575
- protected level: LogLevel;
576
- protected appenders: LogAppender[];
577
- constructor(name: string, level: LogLevel, appenders: LogAppender[]);
578
- static isEnabledFor(enabledFromLevel: LogLevel, level: LogLevel): boolean;
579
- /**
580
- * Gets the logger name
581
- *
582
- * @returns the logger name
583
- */
584
- getName(): string;
585
- /**
586
- * Gets the log level
587
- *
588
- * @returns the log level
589
- */
590
- getLevel(): LogLevel;
591
- /**
592
- * Sets the log level
593
- *
594
- * @param level log level
595
- */
596
- setLevel(level: LogLevel): void;
597
- /**
598
- * Fatal log
599
- *
600
- * @param message mandatory message
601
- * @param additionalMessages optional messages
602
- */
603
- fatal<T, S>(message: T, ...additionalMessages: S[]): void;
604
- /**
605
- * Error log
606
- *
607
- * @param message mandatory message
608
- * @param additionalMessages optional messages
609
- */
610
- error<M, A>(message: M, ...additionalMessages: A[]): void;
611
- /**
612
- * Warning log
613
- *
614
- * @param message mandatory message
615
- * @param additionalMessages optional messages
616
- */
617
- warn<M, A>(message: M, ...additionalMessages: A[]): void;
618
- /**
619
- * Info log
620
- *
621
- * @param message mandatory message
622
- * @param additionalMessages optional messages
623
- */
624
- info<M, A>(message: M, ...additionalMessages: A[]): void;
625
- /**
626
- * Debug log
627
- *
628
- * @param message mandatory message
629
- * @param additionalMessages optional messages
630
- */
631
- debug<M, A>(message: M, ...additionalMessages: A[]): void;
632
- /**
633
- * Trace log
634
- *
635
- * @param message mandatory message
636
- * @param additionalMessages optional messages
637
- */
638
- trace<M, A>(message: M, ...additionalMessages: A[]): void;
639
- isDisabled: () => boolean;
640
- isEnabledFor: (level: LogLevel) => boolean;
641
- isFatalEnabled: () => boolean;
642
- isErrorEnabled: () => boolean;
643
- isWarnEnabled: () => boolean;
644
- isInfoEnabled: () => boolean;
645
- isDebugEnabled: () => boolean;
646
- isTraceEnabled: () => boolean;
647
- isAllEnabled: () => boolean;
648
- /**
649
- * Generic log method, checking the log level and calling the specified appenders
650
- *
651
- * @param event the log event
652
- */
653
- protected log(event: LogEvent): void;
654
- }
655
-
656
- declare class LoggerMock extends Logger {
657
- constructor();
658
- getLevel(): null;
659
- setLevel(): void;
660
- fatal(): void;
661
- error(): void;
662
- warn(): void;
663
- info(): void;
664
- debug(): void;
665
- trace(): void;
666
- isDisabled: () => boolean;
667
- isEnabledFor: () => boolean;
668
- isFatalEnabled: () => boolean;
669
- isErrorEnabled: () => boolean;
670
- isWarnEnabled: () => boolean;
671
- isInfoEnabled: () => boolean;
672
- isDebugEnabled: () => boolean;
673
- isTraceEnabled: () => boolean;
674
- isAllEnabled: () => boolean;
675
- }
676
-
677
- /** generic log appender configuration */
678
-
679
- interface LogAppenderConfig {
680
- /** appender log level. It overrides the main log level */
681
- logLevel?: LogLevel;
554
+ export declare class Logger {
555
+ protected name: string;
556
+ protected level: LogLevel;
557
+ protected appenders: LogAppender[];
558
+ constructor(name: string, level: LogLevel, appenders: LogAppender[]);
559
+ static isEnabledFor(enabledFromLevel: LogLevel, level: LogLevel): boolean;
560
+ /**
561
+ * Gets the logger name
562
+ *
563
+ * @returns the logger name
564
+ */
565
+ getName(): string;
566
+ /**
567
+ * Gets the log level
568
+ *
569
+ * @returns the log level
570
+ */
571
+ getLevel(): LogLevel;
572
+ /**
573
+ * Sets the log level
574
+ *
575
+ * @param level log level
576
+ */
577
+ setLevel(level: LogLevel): void;
578
+ /**
579
+ * Fatal log
580
+ *
581
+ * @param message mandatory message
582
+ * @param additionalMessages optional messages
583
+ */
584
+ fatal<T, S>(message: T, ...additionalMessages: S[]): void;
585
+ /**
586
+ * Error log
587
+ *
588
+ * @param message mandatory message
589
+ * @param additionalMessages optional messages
590
+ */
591
+ error<M, A>(message: M, ...additionalMessages: A[]): void;
592
+ /**
593
+ * Warning log
594
+ *
595
+ * @param message mandatory message
596
+ * @param additionalMessages optional messages
597
+ */
598
+ warn<M, A>(message: M, ...additionalMessages: A[]): void;
599
+ /**
600
+ * Info log
601
+ *
602
+ * @param message mandatory message
603
+ * @param additionalMessages optional messages
604
+ */
605
+ info<M, A>(message: M, ...additionalMessages: A[]): void;
606
+ /**
607
+ * Debug log
608
+ *
609
+ * @param message mandatory message
610
+ * @param additionalMessages optional messages
611
+ */
612
+ debug<M, A>(message: M, ...additionalMessages: A[]): void;
613
+ /**
614
+ * Trace log
615
+ *
616
+ * @param message mandatory message
617
+ * @param additionalMessages optional messages
618
+ */
619
+ trace<M, A>(message: M, ...additionalMessages: A[]): void;
620
+ isDisabled: () => boolean;
621
+ isEnabledFor: (level: LogLevel) => boolean;
622
+ isFatalEnabled: () => boolean;
623
+ isErrorEnabled: () => boolean;
624
+ isWarnEnabled: () => boolean;
625
+ isInfoEnabled: () => boolean;
626
+ isDebugEnabled: () => boolean;
627
+ isTraceEnabled: () => boolean;
628
+ isAllEnabled: () => boolean;
629
+ /**
630
+ * Generic log method, checking the log level and calling the specified appenders
631
+ *
632
+ * @param event the log event
633
+ */
634
+ protected log(event: LogEvent): void;
635
+ }
636
+ export declare class LoggerMock extends Logger {
637
+ constructor();
638
+ getLevel(): null;
639
+ setLevel(): void;
640
+ fatal(): void;
641
+ error(): void;
642
+ warn(): void;
643
+ info(): void;
644
+ debug(): void;
645
+ trace(): void;
646
+ isDisabled: () => boolean;
647
+ isEnabledFor: () => boolean;
648
+ isFatalEnabled: () => boolean;
649
+ isErrorEnabled: () => boolean;
650
+ isWarnEnabled: () => boolean;
651
+ isInfoEnabled: () => boolean;
652
+ isDebugEnabled: () => boolean;
653
+ isTraceEnabled: () => boolean;
654
+ isAllEnabled: () => boolean;
655
+ }
656
+ export interface LogAppenderConfig {
657
+ /** appender log level. It overrides the main log level */
658
+ logLevel?: LogLevel;
682
659
  }
683
660
  /** console appender configuration */
684
- interface ConsoleAppenderConfig extends LogAppenderConfig {
685
- /** customizable prefix to be added to the log messages */
686
- prefixFormat?: string;
687
- /** pluggable custom prefix converters */
688
- prefixConverters?: ConsoleAppenderPrefixConverters;
661
+ export interface ConsoleAppenderConfig extends LogAppenderConfig {
662
+ /** customizable prefix to be added to the log messages */
663
+ prefixFormat?: string;
664
+ /** pluggable custom prefix converters */
665
+ prefixConverters?: ConsoleAppenderPrefixConverters;
689
666
  }
690
667
  /** The type of pluggable console prefix converters */
691
- type ConsoleAppenderPrefixConverters = {
692
- [key: string]: (event: LogEvent) => string;
668
+ export type ConsoleAppenderPrefixConverters = {
669
+ [key: string]: (event: LogEvent) => string;
693
670
  };
694
671
  /** log configuration */
695
- interface LogConfig {
696
- /** the name of the default logger, if LogService is used directly. Default: root */
697
- baseLoggerName?: string;
698
- /** log level. Default: LogLevel.ERROR */
699
- logLevel?: LogLevel;
700
- /** a list of log appenders' types. Default: ConsoleAppender with prefixFormat: '[{level}]' */
701
- logAppenders?: LogAppenderType | LogAppenderType[];
672
+ export interface LogConfig {
673
+ /** the name of the default logger, if LogService is used directly. Default: root */
674
+ baseLoggerName?: string;
675
+ /** log level. Default: LogLevel.ERROR */
676
+ logLevel?: LogLevel;
677
+ /** a list of log appenders' types. Default: ConsoleAppender with prefixFormat: '[{level}]' */
678
+ logAppenders?: LogAppenderType | LogAppenderType[];
702
679
  }
703
680
  /** log appender type, containing also the configuration of the specified appender */
704
- type LogAppenderType = Type<LogAppender> | LogAppenderTypeConfig | ConsoleAppenderTypeConfig | UrlAppenderTypeConfig;
681
+ export type LogAppenderType = Type<LogAppender> | LogAppenderTypeConfig | ConsoleAppenderTypeConfig | UrlAppenderTypeConfig;
705
682
  /** log appender configuration including also the type of the appender */
706
- interface LogAppenderTypeConfig extends LogAppenderConfig {
707
- /** the log appender type */
708
- type: Type<LogAppender>;
709
- /** additional configuration specific to the log appender */
710
- [key: string]: any;
683
+ export interface LogAppenderTypeConfig extends LogAppenderConfig {
684
+ /** the log appender type */
685
+ type: Type<LogAppender>;
686
+ /** additional configuration specific to the log appender */
687
+ [key: string]: any;
711
688
  }
712
689
  /** console appender configuration including also the type of the console appender */
713
- interface ConsoleAppenderTypeConfig extends ConsoleAppenderConfig {
714
- /** the console appender type */
715
- type: Type<ConsoleAppender>;
690
+ export interface ConsoleAppenderTypeConfig extends ConsoleAppenderConfig {
691
+ /** the console appender type */
692
+ type: Type<ConsoleAppender>;
716
693
  }
717
694
  /** url appender configuration including also the type of the url appender */
718
- interface UrlAppenderTypeConfig extends UrlAppenderConfig {
719
- /** the url appender type */
720
- type: Type<UrlAppender>;
695
+ export interface UrlAppenderTypeConfig extends UrlAppenderConfig {
696
+ /** the url appender type */
697
+ type: Type<UrlAppender>;
721
698
  }
722
699
  /** url appender configuration */
723
- interface UrlAppenderConfig extends LogAppenderConfig {
724
- /** url to POST the log event to a server */
725
- url: string;
726
- /** extended log event triggered after the mentioned level. If missing, the extended log level is not triggered */
727
- detailedEventFromLevel?: LogLevel;
700
+ export interface UrlAppenderConfig extends LogAppenderConfig {
701
+ /** url to POST the log event to a server */
702
+ url: string;
703
+ /** extended log event triggered after the mentioned level. If missing, the extended log level is not triggered */
704
+ detailedEventFromLevel?: LogLevel;
728
705
  }
729
706
  /** url log event */
730
- interface UrlLogEvent extends LogEvent {
731
- /** the code position from where the log has been triggered */
732
- position?: LogPosition;
733
- /** the url of the current page */
734
- location?: string;
735
- }
736
-
737
- /** User API configuration */
738
-
739
- interface LocaleServiceConfig {
740
- /**
741
- * When enabled changes from I18nService will be reflected to locale state
742
- */
743
- bindWithTranslate?: boolean;
707
+ export interface UrlLogEvent extends LogEvent {
708
+ /** the code position from where the log has been triggered */
709
+ position?: LogPosition;
710
+ /** the url of the current page */
711
+ location?: string;
712
+ }
713
+ export interface LocaleServiceConfig {
714
+ /**
715
+ * When enabled changes from I18nService will be reflected to locale state
716
+ */
717
+ bindWithTranslate?: boolean;
744
718
  }
745
719
  /**
746
720
  * responsible to extract the attributes "available" and "id" from the locale configuration
747
721
  */
748
- declare const getLocaleServiceConfigFromBase: (baseGlobalConfig: GlobalConfig) => LocaleServiceConfig;
749
-
750
- interface AppState<T = any> {
751
- version?: string;
752
- /** flag to indicate if the application is online/offline. Default: true */
753
- connected?: boolean;
754
- loadedConfigModules?: LoadedConfigModules;
755
- status?: string;
756
- currentModule?: string;
757
- apiQueue?: ApiQueue;
758
- [key: string]: string | boolean | LoadedConfigModules | ApiQueue | T;
759
- }
760
- declare const initialAppState: AppState;
722
+ export declare const getLocaleServiceConfigFromBase: (baseGlobalConfig: GlobalConfig) => LocaleServiceConfig;
723
+ export interface AppState<T = any> {
724
+ version?: string;
725
+ /** flag to indicate if the application is online/offline. Default: true */
726
+ connected?: boolean;
727
+ loadedConfigModules?: LoadedConfigModules;
728
+ status?: string;
729
+ currentModule?: string;
730
+ apiQueue?: ApiQueue;
731
+ [key: string]: string | boolean | LoadedConfigModules | ApiQueue | T;
732
+ }
733
+ export declare const initialAppState: AppState;
761
734
  /**
762
735
  * LoadedConfigModules
763
736
  * @property lastAddedModule - the last module added to the store
764
737
  * @property modulesConfig - the modules configuration
765
738
  */
766
- interface LoadedConfigModules {
767
- lastAddedModule?: string;
768
- modulesConfig: ModulesConfig;
769
- }
770
-
771
- interface UserState extends UserDetails {
772
- userId: string;
773
- firstName?: string;
774
- lastName?: string;
775
- fullName?: string;
776
- preferences?: UserPreferences;
777
- rights?: EuiUserRight[];
778
- }
779
- declare const initialUserState: UserState;
780
-
739
+ export interface LoadedConfigModules {
740
+ lastAddedModule?: string;
741
+ modulesConfig: ModulesConfig;
742
+ }
743
+ export interface UserState extends UserDetails {
744
+ userId: string;
745
+ firstName?: string;
746
+ lastName?: string;
747
+ fullName?: string;
748
+ preferences?: UserPreferences;
749
+ rights?: EuiUserRight[];
750
+ }
751
+ export declare const initialUserState: UserState;
781
752
  /**
782
753
  * The notifications state.
783
754
  * @template LIST The type of the list of notifications.
784
755
  */
785
- interface NotificationsState<LIST = unknown> {
786
- list?: LIST[];
756
+ export interface NotificationsState<LIST = unknown> {
757
+ list?: LIST[];
787
758
  }
788
759
  /**
789
760
  * The initial state of the notifications state.
790
761
  */
791
- declare const initialNotificationsState: NotificationsState;
792
-
793
- interface I18nState {
794
- activeLang: string;
762
+ export declare const initialNotificationsState: NotificationsState;
763
+ export interface I18nState {
764
+ activeLang: string;
795
765
  }
796
- declare const initialI18nState: I18nState;
797
-
766
+ export declare const initialI18nState: I18nState;
798
767
  /**
799
768
  * The locale state is used to store the current locale id and the list of available locales.
800
769
  */
801
- interface LocaleState {
802
- /** The current locale id e.g. 'en-US' */
803
- id: string;
770
+ export interface LocaleState {
771
+ /** The current locale id e.g. 'en-US' */
772
+ id: string;
804
773
  }
805
774
  /**
806
775
  * The initial state of the locale state. The default locale is English US ('en').
807
776
  */
808
- declare const initialLocaleState: LocaleState;
809
-
810
- interface CoreState {
811
- app?: AppState;
812
- user?: UserState;
813
- notifications?: NotificationsState;
814
- i18n?: I18nState;
815
- locale?: LocaleState;
816
- }
817
- declare const initialCoreState: CoreState;
818
-
819
- declare const getAppVersion: Selector<AppState, string>;
820
- declare const getAppConnection: Selector<AppState, boolean>;
777
+ export declare const initialLocaleState: LocaleState;
778
+ export interface CoreState {
779
+ app?: AppState;
780
+ user?: UserState;
781
+ notifications?: NotificationsState;
782
+ i18n?: I18nState;
783
+ locale?: LocaleState;
784
+ }
785
+ export declare const initialCoreState: CoreState;
786
+ export declare const getAppVersion: Selector<AppState, string>;
787
+ export declare const getAppConnection: Selector<AppState, boolean>;
821
788
  /**
822
789
  * Returns the loaded config modules from the app state
823
790
  * @deprecated It will be removed in the future.
824
791
  */
825
- declare const getAppLoadedConfigModules: Selector<AppState, LoadedConfigModules>;
792
+ export declare const getAppLoadedConfigModules: Selector<AppState, LoadedConfigModules>;
826
793
  /**
827
794
  * Returns the last added module from the app state
828
795
  * @deprecated It will be removed in the future.
829
796
  */
830
- declare const getLastAddedModule: Selector<AppState, string>;
831
- declare const getAppStatus: Selector<AppState, string>;
832
- declare const getCurrentModule: Selector<AppState, string>;
833
- declare const getApiQueue: Selector<AppState, ApiQueue>;
834
- declare const getApiQueueItem: (itemId: string) => Selector<AppState, ApiQueueItem>;
835
-
836
- declare const getAppState: (state: CoreState) => AppState;
837
- declare const getUserState: (state: CoreState) => UserState;
838
- declare const getNotificationsState: (state: CoreState) => NotificationsState;
839
- declare const getI18nState: (state: CoreState) => I18nState;
840
- declare const getLocaleState: (state: CoreState) => LocaleState;
841
-
842
- declare const getActiveLang: Selector<CoreState, string>;
843
-
844
- declare const getUserDetails: Selector<CoreState, UserDetails>;
845
- declare const getUserPreferences: Selector<CoreState, UserPreferences>;
846
- declare const getUserId: Selector<CoreState, string>;
847
- declare const getUserFirstName: Selector<CoreState, string>;
848
- declare const getUserLastName: Selector<CoreState, string>;
849
- declare const getUserFullName: Selector<CoreState, string>;
850
- declare const getUserLang: Selector<UserPreferences, string>;
851
- declare const getUserRights: Selector<CoreState, EuiUserRight[]>;
852
- declare const getUserRight: (rightId: string) => Selector<CoreState, EuiUserRight>;
853
- declare const getUserRightPermissions: (rightId: string) => Selector<CoreState, string[]>;
854
- declare const getUserDashboard: Selector<UserPreferences<unknown>, unknown>;
855
-
856
- declare const getNotificationsList: Selector<AppState, unknown[]>;
857
-
858
- /** User API configuration */
859
-
860
- interface UserConfig {
861
- defaultUserPreferences?: UserPreferences;
862
- }
863
-
864
- type EuiAppConfig = EuiAppJsonConfig & EuiAppHandlersConfig;
865
- interface EuiAppJsonConfig<T = any> {
866
- global: GlobalConfig;
867
- modules?: ModulesConfig;
868
- versions?: VersionsConfig;
869
- [key: string]: GlobalConfig | T;
870
- }
871
- interface EuiAppHandlersConfig<T = any> {
872
- httpErrorHandler?: HttpErrorHandlerConfig;
873
- errorMappingHandler?: ErrorMappingHandler;
874
- log?: LogConfig;
875
- customHandler?: {
876
- [handlerId: string]: T;
877
- };
878
- }
879
- interface GlobalConfig<T = any> {
880
- /** show/hide connection status */
881
- showConnectionStatus?: ConnectionStatus;
882
- user?: UserConfig;
883
- i18n?: I18nConfig;
884
- locale?: LocaleServiceConfig;
885
- eui?: EuiGlobalConfig;
886
- [key: string]: boolean | UserConfig | I18nConfig | LocaleServiceConfig | EuiGlobalConfig | ConnectionStatus | T;
887
- }
888
- interface EuiGlobalConfig {
889
- assetsBaseUrl?: string;
890
- theme?: string;
891
- }
892
- interface ConnectionStatus {
893
- messageBox: {
894
- lifespan: number;
895
- };
896
- enabled: boolean;
897
- }
898
- interface ModulesConfig {
899
- [module: string]: ModuleConfig;
900
- }
901
- interface ModuleConfig<T = any> extends LogConfig, I18nLoaderConfig {
902
- [key: string]: string | string[] | I18nResource | I18nResource[] | LogLevel | LogAppenderType | LogAppenderType[] | T;
903
- }
904
- interface VersionsConfig {
905
- app?: string;
906
- [module: string]: string;
907
- }
908
-
909
- interface EuiServiceModel<T> {
910
- init(t: T): Observable<EuiServiceStatus>;
911
- /**
912
- * retrieves the State of the service. If you don't pass anything it will retrieve the whole State
913
- * of that service. If you pass a selector or MapFunction it will retrieve a slice of the state. If
914
- * you pass a string that's a key of the Service State type it will retrieve that slice of the state.
915
- */
916
- getState<K = T>(): Observable<T>;
917
- getState<K>(mapFn: (state: T) => K): Observable<K>;
918
- getState<A extends keyof T>(key: A): Observable<T[A]>;
919
- getState<K>(keyOrMapFn?: ((state: T) => K) | string): Observable<K>;
920
- updateState(t: T): void;
921
- }
922
- type DeepPartial<T> = {
923
- [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
924
- };
925
- declare abstract class EuiService<T> implements EuiServiceModel<T> {
926
- protected stateInstance: T;
927
- protected prevStateInstance: T;
928
- protected $stateSubs: Subscription;
929
- protected $stateLazyLoadSubs: Subscription;
930
- onStateChange: Subject<T>;
931
- protected constructor(defaultState: T);
932
- initEuiService(): void;
933
- abstract init(t?: T): Observable<EuiServiceStatus>;
934
- abstract getState<K = T>(): Observable<T>;
935
- abstract getState<K>(mapFn?: (state: T) => K): Observable<K>;
936
- abstract getState<A extends keyof T>(key?: A): Observable<T[A]>;
937
- abstract getState<K>(keyOrMapFn?: ((state: T) => K) | string): Observable<K>;
938
- abstract updateState(t: DeepPartial<T>): void;
939
- protected unSubscribe(): void;
940
- /**
941
- * deep merge two objects
942
- * @param target the object that will be merged into
943
- * @param source the object that will be merged from
944
- */
945
- protected deepMerge<T>(target: T, source: DeepPartial<T>): T;
946
- /**
947
- * checks if the given item is an object
948
- * @param item the item that will be checked
949
- */
950
- private isObject;
951
- /**
952
- * returns a copy of the given value whether this value is object or primitive. For the arrays it will cover
953
- * multidimensional arrays, but it will not cover an object that contain functions. JSON.parse and JSON.stringify
954
- * might have performance issues on large scale objects but that's an edge case scenario. In case that happens in
955
- * the future follow the technique of NGRX with function caching.
956
- *
957
- * @param state
958
- */
959
- private copy;
960
- }
961
- declare abstract class EuiLazyService<T> extends EuiService<T> {
962
- protected stateInstance: T;
963
- protected $stateSubs: Subscription;
964
- protected $stateLazyLoadSubs: Subscription;
965
- protected constructor(defaultState: T);
966
- abstract lazyLoadInit(moduleConfig: ModuleConfig, moduleName?: string): Observable<EuiServiceStatus>;
967
- initEuiService(storeForLazyLoad?: EuiStoreServiceModel<T>): void;
797
+ export declare const getLastAddedModule: Selector<AppState, string>;
798
+ export declare const getAppStatus: Selector<AppState, string>;
799
+ export declare const getCurrentModule: Selector<AppState, string>;
800
+ export declare const getApiQueue: Selector<AppState, ApiQueue>;
801
+ export declare const getApiQueueItem: (itemId: string) => Selector<AppState, ApiQueueItem>;
802
+ export declare const getAppState: (state: CoreState) => AppState;
803
+ export declare const getUserState: (state: CoreState) => UserState;
804
+ export declare const getNotificationsState: (state: CoreState) => NotificationsState;
805
+ export declare const getI18nState: (state: CoreState) => I18nState;
806
+ export declare const getLocaleState: (state: CoreState) => LocaleState;
807
+ export declare const getActiveLang: Selector<CoreState, string>;
808
+ export declare const getUserDetails: Selector<CoreState, UserDetails>;
809
+ export declare const getUserPreferences: Selector<CoreState, UserPreferences>;
810
+ export declare const getUserId: Selector<CoreState, string>;
811
+ export declare const getUserFirstName: Selector<CoreState, string>;
812
+ export declare const getUserLastName: Selector<CoreState, string>;
813
+ export declare const getUserFullName: Selector<CoreState, string>;
814
+ export declare const getUserLang: Selector<UserPreferences, string>;
815
+ export declare const getUserRights: Selector<CoreState, EuiUserRight[]>;
816
+ export declare const getUserRight: (rightId: string) => Selector<CoreState, EuiUserRight>;
817
+ export declare const getUserRightPermissions: (rightId: string) => Selector<CoreState, string[]>;
818
+ export declare const getUserDashboard: Selector<UserPreferences<unknown>, unknown>;
819
+ export declare const getNotificationsList: Selector<AppState, unknown[]>;
820
+ export interface UserConfig {
821
+ defaultUserPreferences?: UserPreferences;
822
+ }
823
+ export type EuiAppConfig = EuiAppJsonConfig & EuiAppHandlersConfig;
824
+ export interface EuiAppJsonConfig<T = any> {
825
+ global: GlobalConfig;
826
+ modules?: ModulesConfig;
827
+ versions?: VersionsConfig;
828
+ [key: string]: GlobalConfig | T;
829
+ }
830
+ export interface EuiAppHandlersConfig<T = any> {
831
+ httpErrorHandler?: HttpErrorHandlerConfig;
832
+ errorMappingHandler?: ErrorMappingHandler;
833
+ log?: LogConfig;
834
+ customHandler?: {
835
+ [handlerId: string]: T;
836
+ };
837
+ }
838
+ export interface GlobalConfig<T = any> {
839
+ /** show/hide connection status */
840
+ showConnectionStatus?: ConnectionStatus;
841
+ user?: UserConfig;
842
+ i18n?: I18nConfig;
843
+ locale?: LocaleServiceConfig;
844
+ eui?: EuiGlobalConfig;
845
+ [key: string]: boolean | UserConfig | I18nConfig | LocaleServiceConfig | EuiGlobalConfig | ConnectionStatus | T;
846
+ }
847
+ export interface EuiGlobalConfig {
848
+ assetsBaseUrl?: string;
849
+ theme?: string;
850
+ }
851
+ export interface ConnectionStatus {
852
+ messageBox: {
853
+ lifespan: number;
854
+ };
855
+ enabled: boolean;
856
+ }
857
+ export interface ModulesConfig {
858
+ [module: string]: ModuleConfig;
859
+ }
860
+ export interface ModuleConfig<T = any> extends LogConfig, I18nLoaderConfig {
861
+ [key: string]: string | string[] | I18nResource | I18nResource[] | LogLevel | LogAppenderType | LogAppenderType[] | T;
862
+ }
863
+ export interface VersionsConfig {
864
+ app?: string;
865
+ [module: string]: string;
866
+ }
867
+ export interface EuiServiceModel<T> {
868
+ init(t: T): Observable<EuiServiceStatus>;
869
+ /**
870
+ * retrieves the State of the service. If you don't pass anything it will retrieve the whole State
871
+ * of that service. If you pass a selector or MapFunction it will retrieve a slice of the state. If
872
+ * you pass a string that's a key of the Service State type it will retrieve that slice of the state.
873
+ */
874
+ getState<K = T>(): Observable<T>;
875
+ getState<K>(mapFn: (state: T) => K): Observable<K>;
876
+ getState<A extends keyof T>(key: A): Observable<T[A]>;
877
+ getState<K>(keyOrMapFn?: ((state: T) => K) | string): Observable<K>;
878
+ updateState(t: T): void;
879
+ }
880
+ export type DeepPartial<T> = { [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P]; };
881
+ export declare abstract class EuiService<T> implements EuiServiceModel<T> {
882
+ protected stateInstance: T;
883
+ protected prevStateInstance: T;
884
+ protected $stateSubs: Subscription;
885
+ protected $stateLazyLoadSubs: Subscription;
886
+ onStateChange: Subject<T>;
887
+ protected constructor(defaultState: T);
888
+ initEuiService(): void;
889
+ abstract init(t?: T): Observable<EuiServiceStatus>;
890
+ abstract getState<K = T>(): Observable<T>;
891
+ abstract getState<K>(mapFn?: (state: T) => K): Observable<K>;
892
+ abstract getState<A extends keyof T>(key?: A): Observable<T[A]>;
893
+ abstract getState<K>(keyOrMapFn?: ((state: T) => K) | string): Observable<K>;
894
+ abstract updateState(t: DeepPartial<T>): void;
895
+ protected unSubscribe(): void;
896
+ /**
897
+ * deep merge two objects
898
+ * @param target the object that will be merged into
899
+ * @param source the object that will be merged from
900
+ */
901
+ protected deepMerge<T>(target: T, source: DeepPartial<T>): T;
902
+ /**
903
+ * checks if the given item is an object
904
+ * @param item the item that will be checked
905
+ */
906
+ private isObject;
907
+ /**
908
+ * returns a copy of the given value whether this value is object or primitive. For the arrays it will cover
909
+ * multidimensional arrays, but it will not cover an object that contain functions. JSON.parse and JSON.stringify
910
+ * might have performance issues on large scale objects but that's an edge case scenario. In case that happens in
911
+ * the future follow the technique of NGRX with function caching.
912
+ *
913
+ * @param state
914
+ */
915
+ private copy;
916
+ }
917
+ export declare abstract class EuiLazyService<T> extends EuiService<T> {
918
+ protected stateInstance: T;
919
+ protected $stateSubs: Subscription;
920
+ protected $stateLazyLoadSubs: Subscription;
921
+ protected constructor(defaultState: T);
922
+ abstract lazyLoadInit(moduleConfig: ModuleConfig, moduleName?: string): Observable<EuiServiceStatus>;
923
+ initEuiService(storeForLazyLoad?: EuiStoreServiceModel<T>): void;
968
924
  }
969
925
  /**
970
926
  * EuiServiceStatus is a model that represents the status of the service. It has a boolean property that indicates
@@ -974,289 +930,279 @@ declare abstract class EuiLazyService<T> extends EuiService<T> {
974
930
  * @property success a boolean property that indicates whether the service was successful or not
975
931
  * @property error an optional property that contains the error message
976
932
  */
977
- interface EuiServiceStatus<T = unknown> {
978
- success: boolean;
979
- error?: T;
980
- }
981
-
982
- interface EuiPaginationConfig {
983
- totalItems?: number;
984
- pageSize?: number;
985
- currentPage?: number;
986
- pageWindowSize?: number;
987
- }
988
- declare const DefaultConfig: EuiPaginationConfig;
989
- declare class EuiPagination {
990
- private totalItems;
991
- private pageSize;
992
- private currentPage;
993
- private pageWindowSize;
994
- private constructor();
995
- static create(config?: EuiPaginationConfig): EuiPagination;
996
- getFirstPage(): number;
997
- getLastPage(): number;
998
- isFirstPageActive(): boolean;
999
- isLastPageActive(): boolean;
1000
- hasItems(): boolean;
1001
- getPagesCount(): number;
1002
- getPages(): Array<number>;
1003
- goToPage(page: number): void;
1004
- goToFirstPage(): void;
1005
- goToLastPage(): void;
1006
- goToNextPage(): void;
1007
- goToPreviousPage(): void;
1008
- hasPreviousPage(): boolean;
1009
- hasNextPage(): boolean;
1010
- getTotalItems(): number;
1011
- getPageSize(): number;
1012
- setPageSize(size: number): void;
1013
- getCurrentPage(): number;
1014
- getPageWindowSize(): number;
1015
- setPageWindowSize(size: number): void;
1016
- getShowingFrom(): number;
1017
- getShowingTo(): number;
1018
- }
1019
- declare const range: (start: number, end?: number, step?: number) => Array<number>;
1020
-
1021
- declare const EUI_COLORS: {
1022
- text: string;
1023
- default: string;
1024
- black: string;
1025
- white: string;
1026
- primary: string;
1027
- primaryDark: string;
1028
- primaryDarker: string;
1029
- primaryDarkest: string;
1030
- primaryDarkester: string;
1031
- primaryDarkester2: string;
1032
- primaryLight: string;
1033
- primaryLighter: string;
1034
- primaryLightest: string;
1035
- primaryLightester: string;
1036
- primaryLightester2: string;
1037
- accent: string;
1038
- accentDark: string;
1039
- accentDarker: string;
1040
- accentDarkest: string;
1041
- accentDarkester: string;
1042
- accentDarkester2: string;
1043
- accentLight: string;
1044
- accentLighter: string;
1045
- accentLightest: string;
1046
- accentLightester: string;
1047
- accentLightester2: string;
1048
- info: string;
1049
- infoDark: string;
1050
- infoDarker: string;
1051
- infoDarkest: string;
1052
- infoDarkester: string;
1053
- infoDarkester2: string;
1054
- infoLight: string;
1055
- infoLighter: string;
1056
- infoLightest: string;
1057
- infoLightester: string;
1058
- infoLightester2: string;
1059
- success: string;
1060
- successDark: string;
1061
- successDarker: string;
1062
- successDarkest: string;
1063
- successDarkester: string;
1064
- successDarkester2: string;
1065
- successLight: string;
1066
- successLighter: string;
1067
- successLightest: string;
1068
- successLightester: string;
1069
- successLightester2: string;
1070
- warning: string;
1071
- warningDark: string;
1072
- warningDarker: string;
1073
- warningDarkest: string;
1074
- warningDarkester: string;
1075
- warningDarkester2: string;
1076
- warningLight: string;
1077
- warningLighter: string;
1078
- warningLightest: string;
1079
- warningLightester: string;
1080
- warningLightester2: string;
1081
- danger: string;
1082
- dangerDark: string;
1083
- dangerDarker: string;
1084
- dangerDarkest: string;
1085
- dangerDarkester: string;
1086
- dangerDarkester2: string;
1087
- dangerLight: string;
1088
- dangerLighter: string;
1089
- dangerLightest: string;
1090
- dangerLightester: string;
1091
- dangerLightester2: string;
1092
- grey: string;
1093
- greyDark: string;
1094
- greyDarker: string;
1095
- greyDarkest: string;
1096
- greyDarkester: string;
1097
- greyDarkester2: string;
1098
- greyLight: string;
1099
- greyLighter: string;
1100
- greyLightest: string;
1101
- greyLightester: string;
1102
- greyLightester2: string;
933
+ export interface EuiServiceStatus<T = unknown> {
934
+ success: boolean;
935
+ error?: T;
936
+ }
937
+ export interface EuiPaginationConfig {
938
+ totalItems?: number;
939
+ pageSize?: number;
940
+ currentPage?: number;
941
+ pageWindowSize?: number;
942
+ }
943
+ export declare const DefaultConfig: EuiPaginationConfig;
944
+ export declare class EuiPagination {
945
+ private totalItems;
946
+ private pageSize;
947
+ private currentPage;
948
+ private pageWindowSize;
949
+ private constructor();
950
+ static create(config?: EuiPaginationConfig): EuiPagination;
951
+ getFirstPage(): number;
952
+ getLastPage(): number;
953
+ isFirstPageActive(): boolean;
954
+ isLastPageActive(): boolean;
955
+ hasItems(): boolean;
956
+ getPagesCount(): number;
957
+ getPages(): Array<number>;
958
+ goToPage(page: number): void;
959
+ goToFirstPage(): void;
960
+ goToLastPage(): void;
961
+ goToNextPage(): void;
962
+ goToPreviousPage(): void;
963
+ hasPreviousPage(): boolean;
964
+ hasNextPage(): boolean;
965
+ getTotalItems(): number;
966
+ getPageSize(): number;
967
+ setPageSize(size: number): void;
968
+ getCurrentPage(): number;
969
+ getPageWindowSize(): number;
970
+ setPageWindowSize(size: number): void;
971
+ getShowingFrom(): number;
972
+ getShowingTo(): number;
973
+ }
974
+ export declare const range: (start: number, end?: number, step?: number) => Array<number>;
975
+ export declare const EUI_COLORS: {
976
+ text: string;
977
+ default: string;
978
+ black: string;
979
+ white: string;
980
+ primary: string;
981
+ primaryDark: string;
982
+ primaryDarker: string;
983
+ primaryDarkest: string;
984
+ primaryDarkester: string;
985
+ primaryDarkester2: string;
986
+ primaryLight: string;
987
+ primaryLighter: string;
988
+ primaryLightest: string;
989
+ primaryLightester: string;
990
+ primaryLightester2: string;
991
+ accent: string;
992
+ accentDark: string;
993
+ accentDarker: string;
994
+ accentDarkest: string;
995
+ accentDarkester: string;
996
+ accentDarkester2: string;
997
+ accentLight: string;
998
+ accentLighter: string;
999
+ accentLightest: string;
1000
+ accentLightester: string;
1001
+ accentLightester2: string;
1002
+ info: string;
1003
+ infoDark: string;
1004
+ infoDarker: string;
1005
+ infoDarkest: string;
1006
+ infoDarkester: string;
1007
+ infoDarkester2: string;
1008
+ infoLight: string;
1009
+ infoLighter: string;
1010
+ infoLightest: string;
1011
+ infoLightester: string;
1012
+ infoLightester2: string;
1013
+ success: string;
1014
+ successDark: string;
1015
+ successDarker: string;
1016
+ successDarkest: string;
1017
+ successDarkester: string;
1018
+ successDarkester2: string;
1019
+ successLight: string;
1020
+ successLighter: string;
1021
+ successLightest: string;
1022
+ successLightester: string;
1023
+ successLightester2: string;
1024
+ warning: string;
1025
+ warningDark: string;
1026
+ warningDarker: string;
1027
+ warningDarkest: string;
1028
+ warningDarkester: string;
1029
+ warningDarkester2: string;
1030
+ warningLight: string;
1031
+ warningLighter: string;
1032
+ warningLightest: string;
1033
+ warningLightester: string;
1034
+ warningLightester2: string;
1035
+ danger: string;
1036
+ dangerDark: string;
1037
+ dangerDarker: string;
1038
+ dangerDarkest: string;
1039
+ dangerDarkester: string;
1040
+ dangerDarkester2: string;
1041
+ dangerLight: string;
1042
+ dangerLighter: string;
1043
+ dangerLightest: string;
1044
+ dangerLightester: string;
1045
+ dangerLightester2: string;
1046
+ grey: string;
1047
+ greyDark: string;
1048
+ greyDarker: string;
1049
+ greyDarkest: string;
1050
+ greyDarkester: string;
1051
+ greyDarkester2: string;
1052
+ greyLight: string;
1053
+ greyLighter: string;
1054
+ greyLightest: string;
1055
+ greyLightester: string;
1056
+ greyLightester2: string;
1103
1057
  };
1104
-
1105
- interface EuiAuthConfig {
1106
- isLoggedIn?: boolean;
1107
- redirectUrl?: string;
1108
- loginPageUrl?: string;
1109
- }
1110
- declare const EUI_DEFAULT_AUTH_CONFIG: EuiAuthConfig;
1111
-
1112
- type EuiLanguageCode = string | EuiLanguage;
1113
- declare class EuiEuLanguages {
1114
- private static languages;
1115
- private static allLanguages;
1116
- /**
1117
- * Matches the given string array to the EU languages and returns a EuiLanguage array.
1118
- * In case that no codes provided it returns the EU Languages array.
1119
- *
1120
- * @param codes A string array of 2 char codes
1121
- */
1122
- static getLanguages(codes?: EuiLanguageCode[]): EuiLanguage[];
1123
- /**
1124
- * filters and removes language codes that are not part of the EULanguage
1125
- * e.g. 'ko' does not map to any EULanguage code on the array.
1126
- * { code: 'ko', label: 'whatever' } is valid though
1127
- *
1128
- * @param codes codes A string array of 2 char codescodes A string array of 2 char codes
1129
- */
1130
- static filterInvalidLanguageCodes(codes: EuiLanguageCode[]): EuiLanguageCode[];
1131
- /**
1132
- * return the given list ordered based on the EULanguage order
1133
- *
1134
- * @param codes codes A string array of 2 char codes
1135
- */
1136
- static getOrderedLanguages(codes?: EuiLanguageCode[]): EuiLanguage[];
1137
- /**
1138
- * retrieve language codes (string array) from a given array of string and EuiLanguage items
1139
- *
1140
- * @param array It can be an mixed array of string and EuiLanguage items
1141
- */
1142
- static getLanguageCodes(array: EuiLanguageCode[]): string[];
1143
- /**
1144
- * filter non EU languages from given array
1145
- *
1146
- * @param array An array of EuiLanguage items
1147
- */
1148
- static filterNonEULanguages(array: EuiLanguage[]): EuiLanguage[];
1149
- /**
1150
- * filter EU Languages from given array
1151
- *
1152
- * @param array An array of EuiLanguage items
1153
- */
1154
- static filterEULanguages(array: EuiLanguage[]): EuiLanguage[];
1155
- /**
1156
- * @param code language code, ex. 'lu'
1157
- */
1158
- static getLanguageByCode(code: string): EuiLanguage;
1159
- /**
1160
- * @param code language code, ex. 'lu'
1161
- */
1162
- static isEuLanguage(code: string): boolean;
1163
- /**
1164
- * Returns array of EuiLanguage that match the given codes. If codes array is empty, returns all languages.
1165
- * @param codes A string array of 2 char codes, ex. ['en', 'de']
1166
- */
1167
- static getAllLanguagesByCodes(codes: string[]): EuiLanguage[];
1168
- }
1169
-
1170
- interface EuiUserRight {
1171
- id: string;
1172
- permissions?: string[];
1173
- }
1174
-
1175
- interface EuiMenuItem<METADATA = unknown> {
1176
- id?: string;
1177
- e2eAttr?: string;
1058
+ export interface EuiAuthConfig {
1059
+ isLoggedIn?: boolean;
1060
+ redirectUrl?: string;
1061
+ loginPageUrl?: string;
1062
+ }
1063
+ export declare const EUI_DEFAULT_AUTH_CONFIG: EuiAuthConfig;
1064
+ export type EuiLanguageCode = string | EuiLanguage;
1065
+ export declare class EuiEuLanguages {
1066
+ private static languages;
1067
+ private static allLanguages;
1068
+ /**
1069
+ * Matches the given string array to the EU languages and returns a EuiLanguage array.
1070
+ * In case that no codes provided it returns the EU Languages array.
1071
+ *
1072
+ * @param codes A string array of 2 char codes
1073
+ */
1074
+ static getLanguages(codes?: EuiLanguageCode[]): EuiLanguage[];
1075
+ /**
1076
+ * filters and removes language codes that are not part of the EULanguage
1077
+ * e.g. 'ko' does not map to any EULanguage code on the array.
1078
+ * { code: 'ko', label: 'whatever' } is valid though
1079
+ *
1080
+ * @param codes codes A string array of 2 char codescodes A string array of 2 char codes
1081
+ */
1082
+ static filterInvalidLanguageCodes(codes: EuiLanguageCode[]): EuiLanguageCode[];
1083
+ /**
1084
+ * return the given list ordered based on the EULanguage order
1085
+ *
1086
+ * @param codes codes A string array of 2 char codes
1087
+ */
1088
+ static getOrderedLanguages(codes?: EuiLanguageCode[]): EuiLanguage[];
1089
+ /**
1090
+ * retrieve language codes (string array) from a given array of string and EuiLanguage items
1091
+ *
1092
+ * @param array It can be an mixed array of string and EuiLanguage items
1093
+ */
1094
+ static getLanguageCodes(array: EuiLanguageCode[]): string[];
1095
+ /**
1096
+ * filter non EU languages from given array
1097
+ *
1098
+ * @param array An array of EuiLanguage items
1099
+ */
1100
+ static filterNonEULanguages(array: EuiLanguage[]): EuiLanguage[];
1101
+ /**
1102
+ * filter EU Languages from given array
1103
+ *
1104
+ * @param array An array of EuiLanguage items
1105
+ */
1106
+ static filterEULanguages(array: EuiLanguage[]): EuiLanguage[];
1107
+ /**
1108
+ * @param code language code, ex. 'lu'
1109
+ */
1110
+ static getLanguageByCode(code: string): EuiLanguage;
1111
+ /**
1112
+ * @param code language code, ex. 'lu'
1113
+ */
1114
+ static isEuLanguage(code: string): boolean;
1115
+ /**
1116
+ * Returns array of EuiLanguage that match the given codes. If codes array is empty, returns all languages.
1117
+ * @param codes A string array of 2 char codes, ex. ['en', 'de']
1118
+ */
1119
+ static getAllLanguagesByCodes(codes: string[]): EuiLanguage[];
1120
+ }
1121
+ export interface EuiUserRight {
1122
+ id: string;
1123
+ permissions?: string[];
1124
+ }
1125
+ export interface EuiMenuItem<METADATA = unknown> {
1126
+ id?: string;
1127
+ e2eAttr?: string;
1128
+ label?: string;
1129
+ initials?: string;
1130
+ url?: string;
1131
+ queryParams?: any;
1132
+ urlExternal?: string;
1133
+ urlExternalTarget?: string;
1134
+ link?: boolean;
1135
+ iconClass?: string;
1136
+ iconTypeClass?: string;
1137
+ iconSvgName?: string;
1138
+ iconSvgUrl?: string;
1139
+ iconLabel?: string;
1140
+ expanded?: boolean;
1141
+ active?: boolean;
1142
+ children?: EuiMenuItem[];
1143
+ parent?: EuiMenuItem;
1144
+ visible?: boolean;
1145
+ tagLabel?: string;
1146
+ tagTypeClass?: string;
1147
+ tooltip?: string;
1148
+ hasMarker?: boolean;
1149
+ markerTypeClass?: string;
1150
+ /**
1151
+ * Optional status descriptor rendered in the menu item's end block: a status tag plus a group
1152
+ * of small status icons. Independent of `tagLabel` / `hasMarker` and purely additive.
1153
+ */
1154
+ statusMetadata?: {
1155
+ /** Short status label (e.g. `DRAFT`, `DEMO`). */
1156
+ status?: string;
1157
+ /** Marker color variant (e.g. `info`, `danger`, `success`); drives the left circle-fill marker. */
1158
+ colorVariant?: string;
1159
+ /** Icon keys rendered as small `eui-icon-svg` in the end block (e.g. `wc`, `react`, `figma`). */
1160
+ statusIcons?: string[];
1161
+ };
1162
+ category?: string;
1163
+ disabled?: boolean;
1164
+ filtered?: boolean;
1165
+ actionIcon?: {
1166
+ /** icon can also include the set in the format of `icon:set` */
1167
+ icon: string;
1168
+ color?: string;
1178
1169
  label?: string;
1179
- initials?: string;
1180
- url?: string;
1181
- queryParams?: any;
1182
- urlExternal?: string;
1183
- urlExternalTarget?: string;
1184
- link?: boolean;
1185
- iconClass?: string;
1186
- iconTypeClass?: string;
1187
- iconSvgName?: string;
1188
- iconSvgUrl?: string;
1189
- iconLabel?: string;
1190
- expanded?: boolean;
1191
- active?: boolean;
1192
- children?: EuiMenuItem[];
1193
- parent?: EuiMenuItem;
1194
- visible?: boolean;
1195
- tagLabel?: string;
1196
- tagTypeClass?: string;
1197
- tooltip?: string;
1198
- hasMarker?: boolean;
1199
- markerTypeClass?: string;
1200
- /**
1201
- * Optional status descriptor rendered in the menu item's end block: a status tag plus a group
1202
- * of small status icons. Independent of `tagLabel` / `hasMarker` and purely additive.
1203
- */
1204
- statusMetadata?: {
1205
- /** Short status label (e.g. `DRAFT`, `DEMO`). */
1206
- status?: string;
1207
- /** Marker color variant (e.g. `info`, `danger`, `success`); drives the left circle-fill marker. */
1208
- colorVariant?: string;
1209
- /** Icon keys rendered as small `eui-icon-svg` in the end block (e.g. `wc`, `react`, `figma`). */
1210
- statusIcons?: string[];
1211
- };
1212
- category?: string;
1213
- disabled?: boolean;
1214
- filtered?: boolean;
1215
- actionIcon?: {
1216
- /** icon can also include the set in the format of `icon:set` */
1217
- icon: string;
1218
- color?: string;
1219
- label?: string;
1220
- action?: (event: unknown) => void;
1221
- };
1222
- command?: (...params: any[]) => void;
1223
- allowedRightId?: string;
1224
- allowedRightIds?: string[];
1225
- deniedRightId?: string;
1226
- deniedRightIds?: string[];
1227
- metadata?: METADATA;
1228
- isMegaMenu?: boolean;
1229
- megaMenuColIndex?: number;
1230
- megaMenuColLabel?: string;
1231
- }
1232
-
1170
+ action?: (event: unknown) => void;
1171
+ };
1172
+ command?: (...params: any[]) => void;
1173
+ allowedRightId?: string;
1174
+ allowedRightIds?: string[];
1175
+ deniedRightId?: string;
1176
+ deniedRightIds?: string[];
1177
+ metadata?: METADATA;
1178
+ isMegaMenu?: boolean;
1179
+ megaMenuColIndex?: number;
1180
+ megaMenuColLabel?: string;
1181
+ }
1233
1182
  /**
1234
1183
  * Is used to define the structure of objects used for handling messages or notifications in a user interface. It allows
1235
1184
  * for flexibility by allowing additional custom properties while also providing a set of predefined properties like
1236
1185
  * severity, summary, detail, life, and sticky for common message attributes.
1237
1186
  */
1238
- interface EuiGrowlMessage {
1239
- severity?: 'success' | 'warning' | 'info' | 'danger' | string;
1240
- summary?: string;
1241
- detail?: string;
1242
- life?: number;
1243
- sticky?: boolean;
1244
- filled?: boolean;
1245
- /**
1246
- * The timeout property is used to define the time in milliseconds before the message is automatically removed from the
1247
- * user interface. This property is only used when the sticky property is set to false.
1248
- */
1249
- timeout?: number;
1250
- /** @internal */
1251
- dismissed?: boolean;
1187
+ export interface EuiGrowlMessage {
1188
+ severity?: 'success' | 'warning' | 'info' | 'danger' | string;
1189
+ summary?: string;
1190
+ detail?: string;
1191
+ life?: number;
1192
+ sticky?: boolean;
1193
+ filled?: boolean;
1194
+ /**
1195
+ * The timeout property is used to define the time in milliseconds before the message is automatically removed from the
1196
+ * user interface. This property is only used when the sticky property is set to false.
1197
+ */
1198
+ timeout?: number;
1199
+ /** @internal */
1200
+ dismissed?: boolean;
1252
1201
  }
1253
-
1254
1202
  /**
1255
1203
  * polyfill for usage of crypto.randomUUID() on non HTTPS environments EUI-10272
1256
1204
  * Please remove in the future when EC Policy for HTTPS is enforced.
1257
1205
  */
1258
- type UUID = `${string}-${string}-${string}-${string}-${string}`;
1259
-
1260
- export { ConsoleAppender, DEFAULT_CONSOLE_APPENDER_PREFIX_CONVERTERS, DEFAULT_XHR_CONFIG, DefaultConfig, EUI_COLORS, EUI_DEFAULT_AUTH_CONFIG, EuiEuLanguages, EuiLazyService, EuiPagination, EuiService, LogAppender, LogLevel, LogLevelName, Logger, LoggerMock, UrlAppender, UxBadgeLegacy, UxClearErrorFeedbackEvent, UxErrorGroupOnClickEvent, UxErrorOutput, UxLinkLegacy, UxMessageSeverity, UxMessageSeverityMetrics, UxPublishErrorFeedbackEvent, UxValidationErrorClass, getActiveLang, getApiQueue, getApiQueueItem, getAppConnection, getAppLoadedConfigModules, getAppState, getAppStatus, getAppVersion, getBrowserDefaultLanguage, getBrowserPreferredLanguages, getCurrentModule, getI18nLoaderConfig, getI18nServiceConfig, getI18nServiceConfigFromBase, getI18nState, getLastAddedModule, getLocaleServiceConfigFromBase, getLocaleState, getNotificationsList, getNotificationsState, getUserDashboard, getUserDetails, getUserFirstName, getUserFullName, getUserId, getUserLang, getUserLastName, getUserPreferences, getUserRight, getUserRightPermissions, getUserRights, getUserState, initialAppState, initialCoreState, initialI18nState, initialLocaleState, initialNotificationsState, initialUserPreferences, initialUserState, isObject, merge, mergeAll, mergeDeep, range, transformToUxHttpResponse, xhr };
1261
- export type { ApiQueue, ApiQueueItem, AppState, ConnectionStatus, ConsoleAppenderConfig, ConsoleAppenderPrefixConverters, ConsoleAppenderTypeConfig, CoreState, DeepPartial, EnvDynamicConfig, ErrorMappingHandler, EuiAppConfig, EuiAppHandlersConfig, EuiAppJsonConfig, EuiAuthConfig, EuiConfig, EuiEnvConfig, EuiGlobalConfig, EuiGrowlMessage, EuiLanguage, EuiLanguageCode, EuiMenuItem, EuiPaginationConfig, EuiServiceModel, EuiServiceStatus, EuiStoreServiceModel, EuiUserRight, GlobalConfig, HttpErrorCallbackFn, HttpErrorHandlerConfig, HttpErrorRouteConfig, I18nConfig, I18nLoaderConfig, I18nResource, I18nServiceConfig, I18nState, LoadedConfigModules, LocaleServiceConfig, LocaleState, LogAppenderConfig, LogAppenderType, LogAppenderTypeConfig, LogConfig, LogEvent, LogPosition, ModuleConfig, ModulesConfig, NotificationsState, SubErrors, TranslationsCompiler, UUID, UrlAppenderConfig, UrlAppenderTypeConfig, UrlLogEvent, UserConfig, UserDetails, UserPreferences, UserState, UxErrorFeedback, UxErrorFeedbackEventType, UxErrorFollowMap, UxErrorGroupItem, UxErrorGroupMap, UxErrorInfo, UxErrorMessage, UxFormValidationError, UxHttpErrorInfo, UxHttpErrorResponse, UxModalLegacy, UxValidationErrorAttribute, UxValidationErrorAttributes, UxValidationErrorFeedback, UxValidationErrorI18nMessage, VersionsConfig, XHRConfig };
1262
- //# sourceMappingURL=eui-base.d.ts.map
1206
+ export type UUID = `${string}-${string}-${string}-${string}-${string}`;
1207
+ export {};
1208
+ //# sourceMappingURL=eui-base.d.ts.map