@o3r/core 15.3.0-prerelease.16 → 15.3.0-prerelease.18

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,843 +1,794 @@
1
- import { InputSignal, Signal, EventEmitter } from '@angular/core';
2
- import { Observable, OperatorFunction } from 'rxjs';
3
- import { FormControl } from '@angular/forms';
4
- import * as _ngrx_entity from '@ngrx/entity';
5
- import { EntityAdapter, EntityState } from '@ngrx/entity';
6
- import { Action } from '@ngrx/store';
7
-
1
+ import { EventEmitter, InputSignal, Signal } from "@angular/core";
2
+ import { Observable, OperatorFunction } from "rxjs";
3
+ import { FormControl } from "@angular/forms";
4
+ import { EntityAdapter, EntityState } from "@ngrx/entity";
5
+ import { Action } from "@ngrx/store";
8
6
  /**
9
7
  * Library build time properties
10
8
  */
11
- interface BuildTimeProperties {
12
- /**
13
- * True if the application in launch in debug mode
14
- */
15
- DEBUG_MODE: boolean;
16
- /**
17
- * True if the webStorage option is enabled
18
- */
19
- ENABLE_WEBSTORAGE: boolean;
20
- /**
21
- * Name of the current environment
22
- */
23
- ENVIRONMENT: string;
24
- /**
25
- * Boolean that can be used to activate API calls mocks for development or mock-up purpose.
26
- */
27
- USE_MOCKS: boolean;
28
- /**
29
- * Maximum size of the dev tool history
30
- */
31
- DEVTOOL_HISTORY_SIZE: number | undefined;
32
- /**
33
- * path to bundles in published folder
34
- */
35
- LOCALIZATION_BUNDLES_OUTPUT: string;
36
- /**
37
- * The name of the bundle generated with the default localization components keys
38
- */
39
- DEFAULT_LOC_BUNDLE_NAME: string;
40
- /**
41
- * Indicates the default server prefix to be used in case no dynamic is found
42
- */
43
- APP_BASE_HREF: string | undefined;
44
- /**
45
- * Version of the App based on the package.json
46
- */
47
- APP_VERSION: string;
48
- /**
49
- * Determine if the ghosting is activated on the app
50
- */
51
- ENABLE_GHOSTING: boolean;
9
+ export interface BuildTimeProperties {
10
+ /**
11
+ * True if the application in launch in debug mode
12
+ */
13
+ DEBUG_MODE: boolean;
14
+ /**
15
+ * True if the webStorage option is enabled
16
+ */
17
+ ENABLE_WEBSTORAGE: boolean;
18
+ /**
19
+ * Name of the current environment
20
+ */
21
+ ENVIRONMENT: string;
22
+ /**
23
+ * Boolean that can be used to activate API calls mocks for development or mock-up purpose.
24
+ */
25
+ USE_MOCKS: boolean;
26
+ /**
27
+ * Maximum size of the dev tool history
28
+ */
29
+ DEVTOOL_HISTORY_SIZE: number | undefined;
30
+ /**
31
+ * path to bundles in published folder
32
+ */
33
+ LOCALIZATION_BUNDLES_OUTPUT: string;
34
+ /**
35
+ * The name of the bundle generated with the default localization components keys
36
+ */
37
+ DEFAULT_LOC_BUNDLE_NAME: string;
38
+ /**
39
+ * Indicates the default server prefix to be used in case no dynamic is found
40
+ */
41
+ APP_BASE_HREF: string | undefined;
42
+ /**
43
+ * Version of the App based on the package.json
44
+ */
45
+ APP_VERSION: string;
46
+ /**
47
+ * Determine if the ghosting is activated on the app
48
+ */
49
+ ENABLE_GHOSTING: boolean;
52
50
  }
53
51
  /**
54
52
  * Library build time default properties
55
53
  */
56
- declare const DEFAULT_BUILD_PROPERTIES: Readonly<BuildTimeProperties>;
57
-
58
- interface BootstrapConfig {
59
- /**
60
- * App environment
61
- *
62
- */
63
- environment: 'prod' | 'dev';
54
+ export declare const DEFAULT_BUILD_PROPERTIES: Readonly<BuildTimeProperties>;
55
+ export interface BootstrapConfig {
56
+ /**
57
+ * App environment
58
+ *
59
+ */
60
+ environment: 'prod' | 'dev';
64
61
  }
65
62
  /** Data set injected to the page from the DGP web-server */
66
- interface Dataset {
67
- /**
68
- * Bootstrap configuration
69
- * @example
70
- * ```typescript
71
- * '{ environment: 'prod' }'
72
- * ```
73
- */
74
- bootstrapconfig?: string;
75
- /**
76
- * Dynamic content path
77
- * @example
78
- * ```typescript
79
- * 'my/dynamic/path'
80
- * ```
81
- */
82
- dynamiccontentpath?: string;
83
- /**
84
- * Application basehref url
85
- * @example
86
- * ```typescript
87
- * '/my/base/href'
88
- * ```
89
- */
90
- appbasehref?: string;
91
- }
92
-
63
+ export interface Dataset {
64
+ /**
65
+ * Bootstrap configuration
66
+ * @example
67
+ * ```typescript
68
+ * '{ environment: 'prod' }'
69
+ * ```
70
+ */
71
+ bootstrapconfig?: string;
72
+ /**
73
+ * Dynamic content path
74
+ * @example
75
+ * ```typescript
76
+ * 'my/dynamic/path'
77
+ * ```
78
+ */
79
+ dynamiccontentpath?: string;
80
+ /**
81
+ * Application basehref url
82
+ * @example
83
+ * ```typescript
84
+ * '/my/base/href'
85
+ * ```
86
+ */
87
+ appbasehref?: string;
88
+ }
93
89
  /**
94
90
  * Types available for configuration
95
91
  */
96
- type ConfigurationValueType = string | number | boolean;
92
+ export type ConfigurationValueType = string | number | boolean;
97
93
  /**
98
94
  * Nested configuration allowing one level only
99
95
  * Object should only contain primitive types
100
96
  */
101
- interface NestedConfiguration {
102
- [key: string]: ConfigurationValueType;
97
+ export interface NestedConfiguration {
98
+ [key: string]: ConfigurationValueType;
103
99
  }
104
100
  /**
105
101
  * Interface of configuration that is supported by the cms
106
102
  */
107
- interface Configuration {
108
- [key: string]: ConfigurationValueType | (string | NestedConfiguration)[];
103
+ export interface Configuration {
104
+ [key: string]: ConfigurationValueType | (string | NestedConfiguration)[];
109
105
  }
110
106
  /** Configuration model exported by the CMS */
111
- interface CustomConfig<T extends Partial<Configuration> = Partial<Configuration>> {
112
- /** Component name */
113
- name: string;
114
- /** Component's library name; No library name for global config */
115
- library?: string;
116
- /** Component configuration as key value pairs */
117
- config: T;
107
+ export interface CustomConfig<T extends Partial<Configuration> = Partial<Configuration>> {
108
+ /** Component name */
109
+ name: string;
110
+ /** Component's library name; No library name for global config */
111
+ library?: string;
112
+ /** Component configuration as key value pairs */
113
+ config: T;
118
114
  }
119
115
  /**
120
116
  * Dynamically Configurable item
121
117
  */
122
- interface DynamicConfigurable<T extends Configuration> {
123
- /**
124
- * Configuration override by Angular input mechanism
125
- */
126
- config: Partial<T> | undefined;
127
- /**
128
- * Configuration stream based on the input and the stored configuration
129
- */
130
- config$: Observable<T>;
118
+ export interface DynamicConfigurable<T extends Configuration> {
119
+ /**
120
+ * Configuration override by Angular input mechanism
121
+ */
122
+ config: Partial<T> | undefined;
123
+ /**
124
+ * Configuration stream based on the input and the stored configuration
125
+ */
126
+ config$: Observable<T>;
131
127
  }
132
128
  /**
133
129
  * Dynamically Configurable item working with signal
134
130
  */
135
- interface DynamicConfigurableWithSignal<T extends Configuration> {
136
- /**
137
- * Configuration override by Angular input mechanism
138
- */
139
- config: InputSignal<Partial<T> | undefined>;
140
- /**
141
- * Configuration signal based on the input and the stored configuration
142
- */
143
- configSignal: Signal<T>;
131
+ export interface DynamicConfigurableWithSignal<T extends Configuration> {
132
+ /**
133
+ * Configuration override by Angular input mechanism
134
+ */
135
+ config: InputSignal<Partial<T> | undefined>;
136
+ /**
137
+ * Configuration signal based on the input and the stored configuration
138
+ */
139
+ configSignal: Signal<T>;
144
140
  }
145
141
  /**
146
142
  * Configurable item
147
143
  */
148
- interface Configurable<T extends {}> {
149
- /**
150
- * Configuration
151
- */
152
- config: T;
144
+ export interface Configurable<T extends {}> {
145
+ /**
146
+ * Configuration
147
+ */
148
+ config: T;
153
149
  }
154
150
  /**
155
151
  * Description of a configuration property extracted to the CMS
156
152
  */
157
- interface CategoryDescription {
158
- /** Category name */
159
- name: string;
160
- /** Category description */
161
- label: string;
153
+ export interface CategoryDescription {
154
+ /** Category name */
155
+ name: string;
156
+ /** Category description */
157
+ label: string;
162
158
  }
163
159
  /** Types of components config */
164
- type ConfigType = 'Block' | 'Page' | 'AppRuntimeConfiguration' | 'AppBuildConfiguration' | 'ExposedComponent';
160
+ export type ConfigType = 'Block' | 'Page' | 'AppRuntimeConfiguration' | 'AppBuildConfiguration' | 'ExposedComponent';
165
161
  /**
166
162
  * Interface to define widget parameter to be used on CMS side
167
163
  */
168
- interface ConfigPropertyWidgetParameters {
169
- [parameterName: string]: string | boolean | number | string[] | boolean[] | number[];
164
+ export interface ConfigPropertyWidgetParameters {
165
+ [parameterName: string]: string | boolean | number | string[] | boolean[] | number[];
170
166
  }
171
167
  /**
172
168
  * Interface to define the widget to be used on CMS side
173
169
  */
174
- interface ConfigPropertyWidget {
175
- /** Type of the CMS widget */
176
- type: string;
177
- /** Parameters provided to the CMS widget */
178
- parameters?: ConfigPropertyWidgetParameters;
170
+ export interface ConfigPropertyWidget {
171
+ /** Type of the CMS widget */
172
+ type: string;
173
+ /** Parameters provided to the CMS widget */
174
+ parameters?: ConfigPropertyWidgetParameters;
179
175
  }
180
-
181
176
  /**
182
177
  * Application config
183
178
  * Application config should implement this to be identified by CMS extractor as a 'runtime' config
184
179
  */
185
- interface AppRuntimeConfiguration extends Configuration {
186
- }
180
+ export interface AppRuntimeConfiguration extends Configuration {}
187
181
  /**
188
182
  * Application config
189
183
  * Application config should implement this to be identified by CMS extractor as a 'build time' config
190
184
  */
191
- interface AppBuildConfiguration extends Configuration {
192
- }
193
-
185
+ export interface AppBuildConfiguration extends Configuration {}
194
186
  /**
195
187
  * Type expert to extend only public fields of a class
196
188
  */
197
- type InterfaceOf<T> = {
198
- [P in keyof T]: T[P];
199
- };
200
-
189
+ export type InterfaceOf<T> = { [P in keyof T]: T[P]; };
201
190
  /**
202
191
  * Interface used to define an object of two elements: label & value
203
192
  */
204
- interface LabelValue<T> {
205
- label: string;
206
- value: T;
193
+ export interface LabelValue<T> {
194
+ label: string;
195
+ value: T;
207
196
  }
208
-
209
197
  /** Interface extending Window with Otter Devtools accessor */
210
- interface WindowWithDevtools extends Window {
211
- /** Otter Devtools accessor */
212
- _OTTER_DEVTOOLS_?: Record<string, any>;
198
+ export interface WindowWithDevtools extends Window {
199
+ /** Otter Devtools accessor */
200
+ _OTTER_DEVTOOLS_?: Record<string, any>;
213
201
  }
214
202
  /** Common option used by the different DevKit services */
215
- interface DevtoolsCommonOptions {
216
- /**
217
- * Activated on the application bootstrap
218
- * @default false
219
- */
220
- isActivatedOnBootstrap: boolean;
203
+ export interface DevtoolsCommonOptions {
204
+ /**
205
+ * Activated on the application bootstrap
206
+ * @default false
207
+ */
208
+ isActivatedOnBootstrap: boolean;
221
209
  }
222
210
  /** Common option used by the different Contextualization DevKit services */
223
- interface ContextualizationDevtoolsCommonOptions {
224
- /**
225
- * Activated on the application bootstrap when integrated in CMS context
226
- * @default true
227
- */
228
- isActivatedOnBootstrapWhenCMSContext: boolean;
211
+ export interface ContextualizationDevtoolsCommonOptions {
212
+ /**
213
+ * Activated on the application bootstrap when integrated in CMS context
214
+ * @default true
215
+ */
216
+ isActivatedOnBootstrapWhenCMSContext: boolean;
229
217
  }
230
218
  /**
231
219
  * Dataset injected on the page when in CMS context
232
220
  */
233
- interface ContextualizationDataset {
234
- /** `"true"` when in CMS context */
235
- cmscontext?: string;
221
+ export interface ContextualizationDataset {
222
+ /** `"true"` when in CMS context */
223
+ cmscontext?: string;
236
224
  }
237
225
  /** Interface describing an Otter Devtools service */
238
- interface DevtoolsServiceInterface {
239
- /** Activate the devtools service */
240
- activate(): void;
226
+ export interface DevtoolsServiceInterface {
227
+ /** Activate the devtools service */
228
+ activate(): void;
241
229
  }
242
-
243
230
  /**
244
231
  * Generic translation
245
232
  */
246
- interface Translation {
247
- [x: string]: string;
233
+ export interface Translation {
234
+ [x: string]: string;
248
235
  }
249
-
250
236
  /**
251
237
  * Inputs of the component
252
238
  */
253
- interface ContextInput {
254
- [key: string]: any;
239
+ export interface ContextInput {
240
+ [key: string]: any;
255
241
  }
256
242
  /**
257
243
  * Base outputs of the components
258
244
  */
259
- interface BaseContextOutput {
260
- [key: string]: any;
245
+ export interface BaseContextOutput {
246
+ [key: string]: any;
261
247
  }
262
248
  /**
263
249
  * Type helper to generate the interface of component outputs
264
250
  */
265
- type EventEmitterify<T extends BaseContextOutput> = {
266
- [P in keyof T]: EventEmitter<T[P]>;
267
- };
251
+ export type EventEmitterify<T extends BaseContextOutput> = { [P in keyof T]: EventEmitter<T[P]>; };
268
252
  /**
269
253
  * Context of the component
270
254
  */
271
- type Context<T extends ContextInput = {}, U extends BaseContextOutput = {}> = {
272
- [P in keyof T]: T[P];
273
- } & EventEmitterify<U>;
255
+ export type Context<T extends ContextInput = {}, U extends BaseContextOutput = {}> = { [P in keyof T]: T[P]; } & EventEmitterify<U>;
274
256
  /**
275
257
  * Type helper to generate the template context outputs
276
258
  */
277
- type Functionify<T extends BaseContextOutput> = {
278
- [P in keyof T]: (value: T[P]) => void;
279
- };
259
+ export type Functionify<T extends BaseContextOutput> = { [P in keyof T]: (value: T[P]) => void; };
280
260
  /**
281
261
  * Interface for a context of a child component
282
262
  */
283
- interface TemplateContext<N extends {}, S extends ContextInput = Record<string, unknown>, F extends BaseContextOutput = Record<string, unknown>, W extends Translation = Translation> {
284
- /** Component configuration */
285
- config?: Partial<N>;
286
- /** Component inputs context */
287
- inputs: {
288
- [T in keyof S]: S[T];
289
- } & {
290
- [key: string]: any;
291
- };
292
- /** Component outputs context */
293
- outputs: Functionify<F & {
294
- [key: string]: any;
295
- }>;
296
- /** Component translation */
297
- translations?: Partial<W>;
298
- /** Parent Component Id */
299
- parentId?: string;
300
- /** Form control object to be applied to the form */
301
- formControl?: FormControl;
302
- }
303
-
263
+ export interface TemplateContext<N extends {}, S extends ContextInput = Record<string, unknown>, F extends BaseContextOutput = Record<string, unknown>, W extends Translation = Translation> {
264
+ /** Component configuration */
265
+ config?: Partial<N>;
266
+ /** Component inputs context */
267
+ inputs: { [T in keyof S]: S[T]; } & {
268
+ [key: string]: any;
269
+ };
270
+ /** Component outputs context */
271
+ outputs: Functionify<F & {
272
+ [key: string]: any;
273
+ }>;
274
+ /** Component translation */
275
+ translations?: Partial<W>;
276
+ /** Parent Component Id */
277
+ parentId?: string;
278
+ /** Form control object to be applied to the form */
279
+ formControl?: FormControl;
280
+ }
304
281
  /**
305
282
  * Unique identifier of an item in the extracted metadata
306
283
  */
307
- interface ItemIdentifier {
308
- /**
309
- * Name of the library where the item is originally from
310
- */
311
- library: string;
312
- /**
313
- * Name of the item
314
- */
315
- name: string;
316
- }
317
-
284
+ export interface ItemIdentifier {
285
+ /**
286
+ * Name of the library where the item is originally from
287
+ */
288
+ library: string;
289
+ /**
290
+ * Name of the item
291
+ */
292
+ name: string;
293
+ }
318
294
  /** Type of component */
319
- type ComponentType = 'Block' | 'Page' | 'ExposedComponent' | 'Component';
295
+ export type ComponentType = 'Block' | 'Page' | 'ExposedComponent' | 'Component';
320
296
  /**
321
297
  * Information about an Otter component to provide
322
298
  */
323
- interface OtterComponentInfoToProvide {
324
- /** Type of component */
325
- componentType: ComponentType;
299
+ export interface OtterComponentInfoToProvide {
300
+ /** Type of component */
301
+ componentType: ComponentType;
326
302
  }
327
303
  /**
328
304
  * Information about an Otter component
329
305
  */
330
- interface OtterComponentInfo extends OtterComponentInfoToProvide {
331
- /** Configuration ID */
332
- configId?: string;
333
- /** Translation keys */
334
- translations?: Translation;
335
- /** Component Name */
336
- componentName: string;
306
+ export interface OtterComponentInfo extends OtterComponentInfoToProvide {
307
+ /** Configuration ID */
308
+ configId?: string;
309
+ /** Translation keys */
310
+ translations?: Translation;
311
+ /** Component Name */
312
+ componentName: string;
337
313
  }
338
314
  /**
339
315
  * Private field where Otter component information are stored
340
316
  */
341
- declare const otterComponentInfoPropertyName = "__otter-info__";
317
+ export declare const otterComponentInfoPropertyName = "__otter-info__";
342
318
  /**
343
319
  * Decorates an Angular component to provide Otter information
344
320
  * @param info Information to define the Otter component
345
321
  * @returns the component with the information
346
322
  */
347
- declare function O3rComponent(info: OtterComponentInfoToProvide): <T extends new (...args: any[]) => object>(constructor: T) => T;
348
-
323
+ export declare function O3rComponent(info: OtterComponentInfoToProvide): <T extends new (...args: any[]) => object>(constructor: T) => T;
349
324
  /**
350
325
  * Compute the name of the component with the library's name to generate unique component identifier used in metadata and different modules
351
326
  * @param componentName Name of the component to get the configuration
352
327
  * @param libraryName Name of the library the component is coming from
353
328
  */
354
- declare function computeItemIdentifier<C extends string, L extends string>(componentName: C, libraryName?: L): `${L extends string ? `${L}#` : ''}${C}`;
355
-
329
+ export declare function computeItemIdentifier<C extends string, L extends string>(componentName: C, libraryName?: L): `${L extends string ? `${L}#` : ''}${C}`;
356
330
  /**
357
331
  * Represents an output generated by an Extractor
358
332
  */
359
- interface Output {
360
- /** Name of the output entity */
361
- name: string;
362
- /** Filepath of the entity */
363
- path: string;
333
+ export interface Output {
334
+ /** Name of the output entity */
335
+ name: string;
336
+ /** Filepath of the entity */
337
+ path: string;
364
338
  }
365
-
366
339
  /**
367
340
  * Minimum action field
368
341
  */
369
- interface RulesEngineAction<A extends string = string, V = any> {
370
- /** Type of the action */
371
- actionType: A;
372
- /** Generic value of the action */
373
- value: V;
342
+ export interface RulesEngineAction<A extends string = string, V = any> {
343
+ /** Type of the action */
344
+ actionType: A;
345
+ /** Generic value of the action */
346
+ value: V;
374
347
  }
375
348
  /**
376
349
  * Action handler executed by the rules engine
377
350
  */
378
- interface RulesEngineActionHandler<T extends RulesEngineAction = RulesEngineAction> {
379
- /**
380
- * Execute the actions resulting of the rules engine
381
- * @param actions List of actions executed by the rules engine
382
- */
383
- executeActions(actions: T[]): void | Promise<void>;
384
- /**
385
- * Actions supported by the handler
386
- */
387
- supportingActions: readonly T['actionType'][];
351
+ export interface RulesEngineActionHandler<T extends RulesEngineAction = RulesEngineAction> {
352
+ /**
353
+ * Execute the actions resulting of the rules engine
354
+ * @param actions List of actions executed by the rules engine
355
+ */
356
+ executeActions(actions: T[]): void | Promise<void>;
357
+ /**
358
+ * Actions supported by the handler
359
+ */
360
+ supportingActions: readonly T['actionType'][];
388
361
  }
389
-
390
362
  /**
391
363
  * Logger Client interface.
392
364
  */
393
- interface Logger {
394
- /**
395
- * Log an error.
396
- * @param message Message to log
397
- * @param optionalParams Optional parameters to log
398
- */
399
- error(message?: any, ...optionalParams: any[]): void;
400
- /**
401
- * Log a warning.
402
- * @param message Message to log
403
- * @param optionalParams Optional parameters to log
404
- */
405
- warn(message?: any, ...optionalParams: any[]): void;
406
- /**
407
- * Log a message.
408
- * @param message Message to log
409
- * @param optionalParams Optional parameters to log
410
- */
411
- info?(message?: any, ...optionalParams: any[]): void;
412
- /**
413
- * Log a message.
414
- * @param message Message to log
415
- * @param optionalParams Optional parameters to log
416
- */
417
- log(message?: any, ...optionalParams: any[]): void;
418
- /**
419
- * Log a debug message.
420
- * @param message Message to log
421
- * @param optionalParams Optional parameters to log
422
- */
423
- debug?(message?: any, ...optionalParams: any[]): void;
424
- }
425
-
365
+ export interface Logger {
366
+ /**
367
+ * Log an error.
368
+ * @param message Message to log
369
+ * @param optionalParams Optional parameters to log
370
+ */
371
+ error(message?: any, ...optionalParams: any[]): void;
372
+ /**
373
+ * Log a warning.
374
+ * @param message Message to log
375
+ * @param optionalParams Optional parameters to log
376
+ */
377
+ warn(message?: any, ...optionalParams: any[]): void;
378
+ /**
379
+ * Log a message.
380
+ * @param message Message to log
381
+ * @param optionalParams Optional parameters to log
382
+ */
383
+ info?(message?: any, ...optionalParams: any[]): void;
384
+ /**
385
+ * Log a message.
386
+ * @param message Message to log
387
+ * @param optionalParams Optional parameters to log
388
+ */
389
+ log(message?: any, ...optionalParams: any[]): void;
390
+ /**
391
+ * Log a debug message.
392
+ * @param message Message to log
393
+ * @param optionalParams Optional parameters to log
394
+ */
395
+ debug?(message?: any, ...optionalParams: any[]): void;
396
+ }
426
397
  /** Type of a message exchanged within the Otter Framework */
427
- declare const otterMessageType = "otter";
398
+ export declare const otterMessageType = "otter";
428
399
  /** Target of a message that should be handled by the application */
429
- declare const applicationMessageTarget = "app";
430
- interface OtterMessageContent<DataType extends string = string> {
431
- /** Type of data */
432
- dataType: DataType;
433
- }
434
- interface OtterMessage<Content extends OtterMessageContent = OtterMessageContent, Target extends string | undefined = undefined | string> {
435
- /** Type of the message */
436
- type: typeof otterMessageType;
437
- /** Version of the message (default to the `@o3r/core` version ) */
438
- version?: string;
439
- /** Target of the message */
440
- to: Target;
441
- /** Message content */
442
- content: Content;
400
+ export declare const applicationMessageTarget = "app";
401
+ export interface OtterMessageContent<DataType extends string = string> {
402
+ /** Type of data */
403
+ dataType: DataType;
404
+ }
405
+ export interface OtterMessage<Content extends OtterMessageContent = OtterMessageContent, Target extends string | undefined = undefined | string> {
406
+ /** Type of the message */
407
+ type: typeof otterMessageType;
408
+ /** Version of the message (default to the `@o3r/core` version ) */
409
+ version?: string;
410
+ /** Target of the message */
411
+ to: Target;
412
+ /** Message content */
413
+ content: Content;
443
414
  }
444
415
  /** Type helper to retrieve the data types of a union of MessageContent */
445
- type MessageDataTypes<T extends OtterMessageContent> = T['dataType'];
416
+ export type MessageDataTypes<T extends OtterMessageContent> = T['dataType'];
446
417
  /** Type helper to filter the message that can be received by the application */
447
- type FilterMessageToApplication<T extends OtterMessage> = T extends {
448
- to: infer U;
418
+ export type FilterMessageToApplication<T extends OtterMessage> = T extends {
419
+ to: infer U;
449
420
  } ? U extends (typeof applicationMessageTarget | undefined) ? T : never : never;
450
- type ContentMessageData<T extends OtterMessageContent> = T extends any ? Omit<T, 'dataType'> : never;
451
-
421
+ export type ContentMessageData<T extends OtterMessageContent> = T extends any ? Omit<T, 'dataType'> : never;
452
422
  /** Extension connection notification message content */
453
- interface ConnectContentMessage extends OtterMessageContent<'connect'> {
454
- }
423
+ export interface ConnectContentMessage extends OtterMessageContent<'connect'> {}
455
424
  /** Script Injection message content */
456
- interface InjectContentMessage extends OtterMessageContent<'inject'> {
457
- /** Path to the extension script to inject to the web application */
458
- scriptToInject: string;
425
+ export interface InjectContentMessage extends OtterMessageContent<'inject'> {
426
+ /** Path to the extension script to inject to the web application */
427
+ scriptToInject: string;
459
428
  }
460
429
  /** Requested messages Message Content */
461
- interface RequestMessagesContentMessage<AvailableMessageDataTypes extends string = string> extends OtterMessageContent<'requestMessages'> {
462
- /** If specified, only the listed messages will be re-emitted */
463
- only?: AvailableMessageDataTypes[];
430
+ export interface RequestMessagesContentMessage<AvailableMessageDataTypes extends string = string> extends OtterMessageContent<'requestMessages'> {
431
+ /** If specified, only the listed messages will be re-emitted */
432
+ only?: AvailableMessageDataTypes[];
464
433
  }
465
434
  /** List of common Otter content messages */
466
- type CommonContentMessages = ConnectContentMessage | InjectContentMessage | RequestMessagesContentMessage;
467
-
435
+ export type CommonContentMessages = ConnectContentMessage | InjectContentMessage | RequestMessagesContentMessage;
468
436
  /**
469
437
  * Determine if a message should be handle by the application
470
438
  * @param message Message to analyze
471
439
  */
472
- declare const isToAppOtterMessage: <T extends OtterMessage>(message?: T) => message is FilterMessageToApplication<T & {
473
- to: "app";
440
+ export declare const isToAppOtterMessage: <T extends OtterMessage>(message?: T) => message is FilterMessageToApplication<T & {
441
+ to: "app";
474
442
  }>;
475
443
  /**
476
444
  * Determine if a message is emitted by an Otter tool
477
445
  * @param message Message to analyze
478
446
  */
479
- declare const isOtterMessage: <T extends OtterMessageContent>(message: any) => message is OtterMessage<T>;
447
+ export declare const isOtterMessage: <T extends OtterMessageContent>(message: any) => message is OtterMessage<T>;
480
448
  /**
481
449
  * Send an Otter Message
482
450
  * @param dataType Type of the message
483
451
  * @param content content of the message
484
452
  * @param preStringify determine if the message should JSON.stringify before being send (will use the default mechanism otherwise)
485
453
  */
486
- declare const sendOtterMessage: <T extends OtterMessageContent>(dataType: T["dataType"], content: ContentMessageData<T>, preStringify?: boolean) => void;
487
- declare function filterMessageContent<T extends Event | MessageEvent>(): (source$: Observable<T>) => Observable<OtterMessageContent<string>>;
488
- declare function filterMessageContent<T extends Event | MessageEvent, S extends OtterMessageContent>(predicate: (message: any) => message is S): (source$: Observable<T>) => Observable<S>;
489
-
454
+ export declare const sendOtterMessage: <T extends OtterMessageContent>(dataType: T["dataType"], content: ContentMessageData<T>, preStringify?: boolean) => void;
455
+ export declare function filterMessageContent<T extends Event | MessageEvent>(): (source$: Observable<T>) => Observable<OtterMessageContent<string>>;
456
+ export declare function filterMessageContent<T extends Event | MessageEvent, S extends OtterMessageContent>(predicate: (message: any) => message is S): (source$: Observable<T>) => Observable<S>;
490
457
  /**
491
458
  * Object that define how to serialize a specific state
492
459
  */
493
- interface Serializer<T> {
494
- serialize?: (obj: T) => any;
495
- deserialize?: (data?: any) => T;
496
- reviver?: (key: string, value: any) => any;
497
- replacer?: (key: string, value: any) => any;
498
- initialState?: T;
460
+ export interface Serializer<T> {
461
+ serialize?: (obj: T) => any;
462
+ deserialize?: (data?: any) => T;
463
+ reviver?: (key: string, value: any) => any;
464
+ replacer?: (key: string, value: any) => any;
465
+ initialState?: T;
499
466
  }
500
- declare class StateSerializer<T> implements Serializer<T> {
501
- serialize?: (obj: T) => any;
502
- deserialize?: (data?: any) => T;
503
- replacer?: (key: string, value: any) => any;
504
- initialState?: T;
505
- constructor(serializer: Serializer<T>);
506
- reviver: (_: string, value: any) => any;
467
+ export declare class StateSerializer<T> implements Serializer<T> {
468
+ serialize?: (obj: T) => any;
469
+ deserialize?: (data?: any) => T;
470
+ replacer?: (key: string, value: any) => any;
471
+ initialState?: T;
472
+ constructor(serializer: Serializer<T>);
473
+ reviver: (_: string, value: any) => any;
507
474
  }
508
- interface LocalStateModel {
509
- /**
510
- * Temporary ID of the model in the dictionary
511
- */
512
- tid: string;
475
+ export interface LocalStateModel {
476
+ /**
477
+ * Temporary ID of the model in the dictionary
478
+ */
479
+ tid: string;
513
480
  }
514
481
  /**
515
482
  * Adds an `id` to the given type
516
483
  */
517
- type Idfy<T> = T & {
518
- id: string | number;
484
+ export type Idfy<T> = T & {
485
+ id: string | number;
519
486
  };
520
487
  /**
521
488
  * Payload to update actions
522
489
  */
523
- interface UpdateActionPayload<T> {
524
- stateDetails: Partial<T>;
490
+ export interface UpdateActionPayload<T> {
491
+ stateDetails: Partial<T>;
525
492
  }
526
493
  /**
527
494
  * Payload to set actions
528
495
  */
529
- interface SetActionPayload<T> {
530
- stateDetails: T;
496
+ export interface SetActionPayload<T> {
497
+ stateDetails: T;
531
498
  }
532
499
  /**
533
500
  * Payload to set state actions
534
501
  */
535
- interface SetStateActionPayload<T> {
536
- state: T;
502
+ export interface SetStateActionPayload<T> {
503
+ state: T;
537
504
  }
538
505
  /**
539
506
  * Payload to fail actions
540
507
  */
541
- interface FailActionPayload<T> {
542
- error?: T;
508
+ export interface FailActionPayload<T> {
509
+ error?: T;
543
510
  }
544
- type Keep<T, K extends keyof T> = Partial<T> & Pick<T, K>;
511
+ export type Keep<T, K extends keyof T> = Partial<T> & Pick<T, K>;
545
512
  /** Payload to update entities actions */
546
- interface UpdateEntitiesActionPayload<T, K extends keyof T> {
547
- entities: Keep<T, K>[];
513
+ export interface UpdateEntitiesActionPayload<T, K extends keyof T> {
514
+ entities: Keep<T, K>[];
548
515
  }
549
516
  /** Payload to update entities actions with a field ID */
550
- interface UpdateEntitiesActionPayloadWithId<T extends {
551
- id: string | number;
517
+ export interface UpdateEntitiesActionPayloadWithId<T extends {
518
+ id: string | number;
552
519
  }> {
553
- entities: Keep<T, 'id'>[];
520
+ entities: Keep<T, 'id'>[];
554
521
  }
555
522
  /** Payload to update entities actions */
556
- interface UpdateEntityActionPayload<T, K extends keyof T> {
557
- entity: Keep<T, K>;
523
+ export interface UpdateEntityActionPayload<T, K extends keyof T> {
524
+ entity: Keep<T, K>;
558
525
  }
559
526
  /** Payload to update entities actions with a field ID */
560
- interface UpdateEntityActionPayloadWithId<T extends {
561
- id: string | number;
527
+ export interface UpdateEntityActionPayloadWithId<T extends {
528
+ id: string | number;
562
529
  }> {
563
- entity: Keep<T, 'id'>;
530
+ entity: Keep<T, 'id'>;
564
531
  }
565
532
  /** Payload to set entities and upsert entities actions */
566
- interface SetEntitiesActionPayload<T> {
567
- entities: T[];
533
+ export interface SetEntitiesActionPayload<T> {
534
+ entities: T[];
568
535
  }
569
536
  /** Payload to set entity and upsert entity actions */
570
- interface SetEntityActionPayload<T> {
571
- entity: T;
537
+ export interface SetEntityActionPayload<T> {
538
+ entity: T;
572
539
  }
573
540
  /** Payload to fail entities actions */
574
- interface FailEntitiesActionPayload<T> extends FailActionPayload<T> {
575
- ids?: (string | number)[];
541
+ export interface FailEntitiesActionPayload<T> extends FailActionPayload<T> {
542
+ ids?: (string | number)[];
576
543
  }
577
544
  /**
578
545
  * Payload to clear the store in case of failure
579
546
  */
580
- interface ClearOnFailurePayload {
581
- /** Clear store on failure */
582
- clearOnFailure?: boolean;
547
+ export interface ClearOnFailurePayload {
548
+ /** Clear store on failure */
549
+ clearOnFailure?: boolean;
583
550
  }
584
-
585
- type RequestId = string;
551
+ export type RequestId = string;
586
552
  /**
587
553
  * Interface representing an asynchronous request
588
554
  */
589
- interface AsyncRequest {
590
- /** ID of the request */
591
- requestId: RequestId;
555
+ export interface AsyncRequest {
556
+ /** ID of the request */
557
+ requestId: RequestId;
592
558
  }
593
559
  /**
594
560
  * Represents a store item that can be manipulated via asynchronous calls
595
561
  */
596
- interface AsyncStoreItem {
597
- /**
598
- * IDs of the active asynchronous requests for this item.
599
- */
600
- requestIds: RequestId[];
601
- /**
602
- * Has a recent call failed.
603
- * This is reset back to false the next time a new async process is started and there are no active requests.
604
- */
605
- isFailure?: boolean;
606
- /**
607
- * Is an asynchronous process ongoing on that item
608
- */
609
- isPending?: boolean;
562
+ export interface AsyncStoreItem {
563
+ /**
564
+ * IDs of the active asynchronous requests for this item.
565
+ */
566
+ requestIds: RequestId[];
567
+ /**
568
+ * Has a recent call failed.
569
+ * This is reset back to false the next time a new async process is started and there are no active requests.
570
+ */
571
+ isFailure?: boolean;
572
+ /**
573
+ * Is an asynchronous process ongoing on that item
574
+ */
575
+ isPending?: boolean;
610
576
  }
611
577
  /**
612
578
  * Payload for actions relying on asynchronous requests
613
579
  */
614
- interface FromApiActionPayload<T> extends Partial<AsyncRequest> {
615
- /** Promise call from API */
616
- call: Promise<T>;
580
+ export interface FromApiActionPayload<T> extends Partial<AsyncRequest> {
581
+ /** Promise call from API */
582
+ call: Promise<T>;
617
583
  }
618
584
  /**
619
585
  * Unwraps the type of a FromApiActionPayload
620
586
  */
621
- type ExtractFromApiActionPayloadType<T extends FromApiActionPayload<any>> = T['call'] extends Promise<infer U> ? U : never;
587
+ export type ExtractFromApiActionPayloadType<T extends FromApiActionPayload<any>> = T['call'] extends Promise<infer U> ? U : never;
622
588
  /**
623
589
  * Payload for actions relying on asynchronous requests
624
590
  */
625
- interface FromApiActionPayloadWithEntityId<T> extends FromApiActionPayload<T> {
626
- /** ID of the entity affected by the call */
627
- id?: string;
591
+ export interface FromApiActionPayloadWithEntityId<T> extends FromApiActionPayload<T> {
592
+ /** ID of the entity affected by the call */
593
+ id?: string;
628
594
  }
629
595
  /** Add an optional request ID to the given object */
630
- type WithRequestId<T> = T & Partial<AsyncRequest>;
596
+ export type WithRequestId<T> = T & Partial<AsyncRequest>;
631
597
  /** Payload to set entities actions from async */
632
- interface SetAsyncStoreItemActionPayload<T> extends SetActionPayload<T>, Partial<AsyncRequest> {
633
- }
598
+ export interface SetAsyncStoreItemActionPayload<T> extends SetActionPayload<T>, Partial<AsyncRequest> {}
634
599
  /** Payload to update entities actions from async */
635
- interface UpdateAsyncStoreItemEntitiesActionPayload<T extends object, K extends keyof T> extends UpdateEntitiesActionPayload<T, K>, Partial<AsyncRequest> {
636
- }
600
+ export interface UpdateAsyncStoreItemEntitiesActionPayload<T extends object, K extends keyof T> extends UpdateEntitiesActionPayload<T, K>, Partial<AsyncRequest> {}
637
601
  /** Payload to update entities actions from async with a field ID */
638
- interface UpdateAsyncStoreItemEntitiesActionPayloadWithId<T extends {
639
- id: string | number;
640
- }> extends UpdateEntitiesActionPayloadWithId<T>, Partial<AsyncRequest> {
641
- }
602
+ export interface UpdateAsyncStoreItemEntitiesActionPayloadWithId<T extends {
603
+ id: string | number;
604
+ }> extends UpdateEntitiesActionPayloadWithId<T>, Partial<AsyncRequest> {}
642
605
  /** Payload to update entity actions from async */
643
- interface UpdateAsyncStoreItemEntityActionPayload<T extends object, K extends keyof T> extends UpdateEntityActionPayload<T, K>, Partial<AsyncRequest> {
644
- }
606
+ export interface UpdateAsyncStoreItemEntityActionPayload<T extends object, K extends keyof T> extends UpdateEntityActionPayload<T, K>, Partial<AsyncRequest> {}
645
607
  /** Payload to update entity actions from async with a field ID */
646
- interface UpdateAsyncStoreItemEntityActionPayloadWithId<T extends {
647
- id: string | number;
648
- }> extends UpdateEntityActionPayloadWithId<T>, Partial<AsyncRequest> {
649
- }
608
+ export interface UpdateAsyncStoreItemEntityActionPayloadWithId<T extends {
609
+ id: string | number;
610
+ }> extends UpdateEntityActionPayloadWithId<T>, Partial<AsyncRequest> {}
650
611
  /** Payload to set/upsert entities actions from async */
651
- interface SetAsyncStoreItemEntitiesActionPayload<T extends object> extends SetEntitiesActionPayload<T>, Partial<AsyncRequest> {
652
- }
612
+ export interface SetAsyncStoreItemEntitiesActionPayload<T extends object> extends SetEntitiesActionPayload<T>, Partial<AsyncRequest> {}
653
613
  /** Payload to set/upsert entity actions from async */
654
- interface SetAsyncStoreItemEntityActionPayload<T extends object> extends SetEntityActionPayload<T>, Partial<AsyncRequest> {
655
- }
614
+ export interface SetAsyncStoreItemEntityActionPayload<T extends object> extends SetEntityActionPayload<T>, Partial<AsyncRequest> {}
656
615
  /** Payload to fail entity actions from async */
657
- interface FailAsyncStoreItemEntityActionPayload<T extends object> extends FailActionPayload<T>, Partial<AsyncRequest> {
658
- }
616
+ export interface FailAsyncStoreItemEntityActionPayload<T extends object> extends FailActionPayload<T>, Partial<AsyncRequest> {}
659
617
  /** Payload to fail entities actions from async */
660
- interface FailAsyncStoreItemEntitiesActionPayload<T extends object> extends FailEntitiesActionPayload<T>, Partial<AsyncRequest> {
661
- }
618
+ export interface FailAsyncStoreItemEntitiesActionPayload<T extends object> extends FailEntitiesActionPayload<T>, Partial<AsyncRequest> {}
662
619
  /** Status for all the elements inside a cart */
663
- type EntityStatus<T, U extends keyof T = never> = {
664
- [P in keyof Omit<T, 'id' | U>]?: AsyncStoreItem;
665
- };
620
+ export type EntityStatus<T, U extends keyof T = never> = { [P in keyof Omit<T, 'id' | U>]?: AsyncStoreItem; };
666
621
  /**
667
622
  * Extends an Entity model with a status property that holds async information for each of its sub-resources
668
623
  */
669
- type EntityWithStatus<T> = T & {
670
- status: EntityStatus<T>;
624
+ export type EntityWithStatus<T> = T & {
625
+ status: EntityStatus<T>;
671
626
  };
672
627
  /** Modifies the given type that extends AsyncStoreItem to remove those properties */
673
- type EntityWithoutAsyncStoreItem<T extends AsyncStoreItem> = Omit<T, keyof AsyncStoreItem>;
674
-
628
+ export type EntityWithoutAsyncStoreItem<T extends AsyncStoreItem> = Omit<T, keyof AsyncStoreItem>;
675
629
  /** Adapter for Asynchronous Entity Store */
676
- interface EntityAsyncRequestAdapter<T extends AsyncStoreItem> extends EntityAdapter<T> {
677
- /**
678
- * Updates the AsyncStoreItem properties of each entity matching an id from the list of given ids, when a request has failed.
679
- * @param state Actual state
680
- * @param ids Ids of the entity to be updated with AsyncStoreItem properties
681
- * @param requestId Id of request which has failed
682
- */
683
- failRequestMany<V extends EntityState<T> & AsyncStoreItem>(state: V, ids?: (string | number)[], requestId?: string): V;
684
- /**
685
- * Adds AsyncStoreItem property to the global store, or the entity if it already exists, when a request is triggered.
686
- * @param state Actual state
687
- * @param id Id of the entity to update
688
- * @param requestId Id of the request which is triggered
689
- */
690
- addRequestOne<V extends EntityState<T> & AsyncStoreItem>(state: V, id: string | number | null | undefined, requestId: string): V;
691
- /**
692
- * Adds AsyncStoreItem properties for each entity matching the given ids, when a request is triggered
693
- * @param state Actual state
694
- * @param ids Ids of the entity to be updated with AsyncStoreItem properties
695
- * @param requestId Id of request which is triggered
696
- */
697
- addRequestMany<V extends EntityState<T>>(state: V, ids: (string | number)[], requestId: string): V;
698
- /**
699
- * Updates the state with the given entity. Update the global or the current entity's status if it exists.
700
- * @param state Actual state
701
- * @param entity Payload item;
702
- * @param requestId Id of request which has resolved if any
703
- */
704
- resolveRequestOne<V extends EntityState<T> & AsyncStoreItem>(state: V, entity: EntityWithoutAsyncStoreItem<T> & Record<'id', string | number>, requestId?: string): V;
705
- /**
706
- * Updates the state with the given entity. Update the global or the current entity's status if it exists.
707
- * @param state Actual state
708
- * @param entity Payload item;
709
- * @param requestId Id of request which has resolved if any
710
- * @param idProperty Property of the entity containing its unique identifier
711
- */
712
- resolveRequestOne<V extends EntityState<T> & AsyncStoreItem, W extends keyof T>(state: V, entity: EntityWithoutAsyncStoreItem<T> & Record<W, string | number>, requestId?: string, idProperty?: W): V;
713
- /**
714
- * Updates the state with the given entities. Updates also AsyncStoreItem properties of each entity, when a request is resolved.
715
- * @param state Actual state
716
- * @param entities Payload items;
717
- * @param requestId Id of request which has resolved if any
718
- */
719
- resolveRequestMany<V extends EntityState<T>>(state: V, entities: (Partial<T> & Record<'id', string | number>)[], requestId?: string): V;
720
- /**
721
- * Updates the state with the given entities. Updates also AsyncStoreItem properties of each entity, when a request is resolved.
722
- * @param state Actual state
723
- * @param entities Payload items;
724
- * @param requestId Id of request which has resolved if any
725
- * @param idProperty Property of the entity containing its unique identifier
726
- */
727
- resolveRequestMany<V extends EntityState<T>, W extends keyof T>(state: V, entities: (Partial<T> & Record<W, string | number>)[], requestId?: string, idProperty?: W): V;
630
+ export interface EntityAsyncRequestAdapter<T extends AsyncStoreItem> extends EntityAdapter<T> {
631
+ /**
632
+ * Updates the AsyncStoreItem properties of each entity matching an id from the list of given ids, when a request has failed.
633
+ * @param state Actual state
634
+ * @param ids Ids of the entity to be updated with AsyncStoreItem properties
635
+ * @param requestId Id of request which has failed
636
+ */
637
+ failRequestMany<V extends EntityState<T> & AsyncStoreItem>(state: V, ids?: (string | number)[], requestId?: string): V;
638
+ /**
639
+ * Adds AsyncStoreItem property to the global store, or the entity if it already exists, when a request is triggered.
640
+ * @param state Actual state
641
+ * @param id Id of the entity to update
642
+ * @param requestId Id of the request which is triggered
643
+ */
644
+ addRequestOne<V extends EntityState<T> & AsyncStoreItem>(state: V, id: string | number | null | undefined, requestId: string): V;
645
+ /**
646
+ * Adds AsyncStoreItem properties for each entity matching the given ids, when a request is triggered
647
+ * @param state Actual state
648
+ * @param ids Ids of the entity to be updated with AsyncStoreItem properties
649
+ * @param requestId Id of request which is triggered
650
+ */
651
+ addRequestMany<V extends EntityState<T>>(state: V, ids: (string | number)[], requestId: string): V;
652
+ /**
653
+ * Updates the state with the given entity. Update the global or the current entity's status if it exists.
654
+ * @param state Actual state
655
+ * @param entity Payload item;
656
+ * @param requestId Id of request which has resolved if any
657
+ */
658
+ resolveRequestOne<V extends EntityState<T> & AsyncStoreItem>(state: V, entity: EntityWithoutAsyncStoreItem<T> & Record<'id', string | number>, requestId?: string): V;
659
+ /**
660
+ * Updates the state with the given entity. Update the global or the current entity's status if it exists.
661
+ * @param state Actual state
662
+ * @param entity Payload item;
663
+ * @param requestId Id of request which has resolved if any
664
+ * @param idProperty Property of the entity containing its unique identifier
665
+ */
666
+ resolveRequestOne<V extends EntityState<T> & AsyncStoreItem, W extends keyof T>(state: V, entity: EntityWithoutAsyncStoreItem<T> & Record<W, string | number>, requestId?: string, idProperty?: W): V;
667
+ /**
668
+ * Updates the state with the given entities. Updates also AsyncStoreItem properties of each entity, when a request is resolved.
669
+ * @param state Actual state
670
+ * @param entities Payload items;
671
+ * @param requestId Id of request which has resolved if any
672
+ */
673
+ resolveRequestMany<V extends EntityState<T>>(state: V, entities: (Partial<T> & Record<'id', string | number>)[], requestId?: string): V;
674
+ /**
675
+ * Updates the state with the given entities. Updates also AsyncStoreItem properties of each entity, when a request is resolved.
676
+ * @param state Actual state
677
+ * @param entities Payload items;
678
+ * @param requestId Id of request which has resolved if any
679
+ * @param idProperty Property of the entity containing its unique identifier
680
+ */
681
+ resolveRequestMany<V extends EntityState<T>, W extends keyof T>(state: V, entities: (Partial<T> & Record<W, string | number>)[], requestId?: string, idProperty?: W): V;
728
682
  }
729
683
  /**
730
684
  * Create an Asynchronous Request Entity Adapter
731
685
  * @param adapter Entity Adapter
732
686
  */
733
- declare function createEntityAsyncRequestAdapter<T extends AsyncStoreItem>(adapter: EntityAdapter<T>): EntityAsyncRequestAdapter<T>;
734
-
687
+ export declare function createEntityAsyncRequestAdapter<T extends AsyncStoreItem>(adapter: EntityAdapter<T>): EntityAsyncRequestAdapter<T>;
735
688
  /**
736
689
  * Adapter to help manipulate AsyncStoreItems to register new request and update the status when they fail or resolve.
737
690
  */
738
- interface AsyncStoreItemAdapter {
739
- /**
740
- * Adds a request to an AsyncStoreItem.
741
- * If the item had a failure and no ongoing requests, sets it's failure status back to false
742
- * @param item
743
- * @param requestId
744
- */
745
- addRequest<T extends AsyncStoreItem>(item: T, requestId: string): T;
746
- /**
747
- * Updates an AsyncStoreItem when a request has resolved.
748
- * Removes it from its requestIds array.
749
- * If no requestId provided, the method returns the current status of the AsyncStoreItem
750
- * @param item
751
- * @param requestId
752
- */
753
- resolveRequest<T extends AsyncStoreItem>(item: T, requestId?: string): T;
754
- /**
755
- * Updates an AsyncStoreItem when a request has failed.
756
- * Removes it from its requestIds array and set its failure status.
757
- * @param item
758
- * @param requestId
759
- */
760
- failRequest<T extends AsyncStoreItem>(item: T, requestId?: string): T;
761
- /**
762
- * Add AsyncStoreItem properties (with initial values) to the given entity
763
- * @param entityItem
764
- * @returns Given item improved with AsyncStoreItem properties
765
- */
766
- initialize<T extends object>(entityItem: T): T & AsyncStoreItem;
767
- /**
768
- * Extract only AsyncStoreItem properties from the given entity
769
- * @param entityItem A model containing AsyncStoreItem properties
770
- * @returns Object containing only AsyncStoreItem properties
771
- */
772
- extractAsyncStoreItem<T extends AsyncStoreItem>(entityItem: T): AsyncStoreItem;
773
- /**
774
- * Clear AsyncStoreItem properties from the given entity
775
- * @param entityItem A model containing AsyncStoreItem properties
776
- */
777
- clearAsyncStoreItem<T extends AsyncStoreItem>(entityItem: T): T;
778
- /**
779
- * Merges an AsyncStoreItem collection into one item that gives an overall status.
780
- * @param items
781
- */
782
- merge(...items: (AsyncStoreItem | undefined)[]): AsyncStoreItem;
783
- /**
784
- * Add a request to the given subResource of an EntityStatus object
785
- * @param status
786
- * @param subResource
787
- * @param requestId
788
- */
789
- entityStatusAddRequest<T extends EntityStatus<T>>(status: T, subResource: keyof T, requestId: string): T;
790
- /**
791
- * Resolve a request on the given subResource of an EntityStatus object
792
- * @param status
793
- * @param subResource
794
- * @param requestId
795
- */
796
- entityStatusResolveRequest<T extends EntityStatus<T>>(status: T, subResource: keyof T, requestId?: string): T;
797
- /**
798
- * Fail a request to the given subResource of an EntityStatus object
799
- * @param status
800
- * @param subResource
801
- * @param requestId
802
- */
803
- entityStatusFailRequest<T extends EntityStatus<T>>(status: T, subResource: keyof T, requestId?: string): T;
804
- /**
805
- * Reset the failure status of the given subResource of an EntityStatus object
806
- * @param status
807
- * @param subResource
808
- */
809
- entityStatusResetFailure<T extends EntityStatus<T>>(status: T, subResource: keyof T): T;
810
- /**
811
- * Reset the failure status of the given AsyncStoreItem to false
812
- * @param entityItem
813
- * @returns AsyncStoreItem with the updated failure status
814
- */
815
- resetFailureStatus<T extends AsyncStoreItem>(entityItem: T): T;
816
- /**
817
- * Set the pending status of the given AsyncStoreItem to true
818
- * @param entityItem
819
- * @returns AsyncStoreItem with the updated pending status
820
- */
821
- setLoadingStatus<T extends AsyncStoreItem>(entityItem: T): T;
822
- }
823
- declare const asyncStoreItemAdapter: AsyncStoreItemAdapter;
824
-
691
+ export interface AsyncStoreItemAdapter {
692
+ /**
693
+ * Adds a request to an AsyncStoreItem.
694
+ * If the item had a failure and no ongoing requests, sets it's failure status back to false
695
+ * @param item
696
+ * @param requestId
697
+ */
698
+ addRequest<T extends AsyncStoreItem>(item: T, requestId: string): T;
699
+ /**
700
+ * Updates an AsyncStoreItem when a request has resolved.
701
+ * Removes it from its requestIds array.
702
+ * If no requestId provided, the method returns the current status of the AsyncStoreItem
703
+ * @param item
704
+ * @param requestId
705
+ */
706
+ resolveRequest<T extends AsyncStoreItem>(item: T, requestId?: string): T;
707
+ /**
708
+ * Updates an AsyncStoreItem when a request has failed.
709
+ * Removes it from its requestIds array and set its failure status.
710
+ * @param item
711
+ * @param requestId
712
+ */
713
+ failRequest<T extends AsyncStoreItem>(item: T, requestId?: string): T;
714
+ /**
715
+ * Add AsyncStoreItem properties (with initial values) to the given entity
716
+ * @param entityItem
717
+ * @returns Given item improved with AsyncStoreItem properties
718
+ */
719
+ initialize<T extends object>(entityItem: T): T & AsyncStoreItem;
720
+ /**
721
+ * Extract only AsyncStoreItem properties from the given entity
722
+ * @param entityItem A model containing AsyncStoreItem properties
723
+ * @returns Object containing only AsyncStoreItem properties
724
+ */
725
+ extractAsyncStoreItem<T extends AsyncStoreItem>(entityItem: T): AsyncStoreItem;
726
+ /**
727
+ * Clear AsyncStoreItem properties from the given entity
728
+ * @param entityItem A model containing AsyncStoreItem properties
729
+ */
730
+ clearAsyncStoreItem<T extends AsyncStoreItem>(entityItem: T): T;
731
+ /**
732
+ * Merges an AsyncStoreItem collection into one item that gives an overall status.
733
+ * @param items
734
+ */
735
+ merge(...items: (AsyncStoreItem | undefined)[]): AsyncStoreItem;
736
+ /**
737
+ * Add a request to the given subResource of an EntityStatus object
738
+ * @param status
739
+ * @param subResource
740
+ * @param requestId
741
+ */
742
+ entityStatusAddRequest<T extends EntityStatus<T>>(status: T, subResource: keyof T, requestId: string): T;
743
+ /**
744
+ * Resolve a request on the given subResource of an EntityStatus object
745
+ * @param status
746
+ * @param subResource
747
+ * @param requestId
748
+ */
749
+ entityStatusResolveRequest<T extends EntityStatus<T>>(status: T, subResource: keyof T, requestId?: string): T;
750
+ /**
751
+ * Fail a request to the given subResource of an EntityStatus object
752
+ * @param status
753
+ * @param subResource
754
+ * @param requestId
755
+ */
756
+ entityStatusFailRequest<T extends EntityStatus<T>>(status: T, subResource: keyof T, requestId?: string): T;
757
+ /**
758
+ * Reset the failure status of the given subResource of an EntityStatus object
759
+ * @param status
760
+ * @param subResource
761
+ */
762
+ entityStatusResetFailure<T extends EntityStatus<T>>(status: T, subResource: keyof T): T;
763
+ /**
764
+ * Reset the failure status of the given AsyncStoreItem to false
765
+ * @param entityItem
766
+ * @returns AsyncStoreItem with the updated failure status
767
+ */
768
+ resetFailureStatus<T extends AsyncStoreItem>(entityItem: T): T;
769
+ /**
770
+ * Set the pending status of the given AsyncStoreItem to true
771
+ * @param entityItem
772
+ * @returns AsyncStoreItem with the updated pending status
773
+ */
774
+ setLoadingStatus<T extends AsyncStoreItem>(entityItem: T): T;
775
+ }
776
+ export declare const asyncStoreItemAdapter: AsyncStoreItemAdapter;
825
777
  /**
826
778
  * Determine if the action is an AsyncRequest action
827
779
  * @param action Redux Action
828
780
  */
829
- declare function isCallAction<T = any>(action?: any): action is FromApiActionPayload<T>;
781
+ export declare function isCallAction<T = any>(action?: any): action is FromApiActionPayload<T>;
830
782
  /**
831
783
  * Determine if the action is an AsyncRequest action with a Request ID
832
784
  * @param action Redux Action
833
785
  */
834
- declare function isIdentifiedCallAction<T = any>(action?: any): action is FromApiActionPayload<T> & AsyncRequest;
786
+ export declare function isIdentifiedCallAction<T = any>(action?: any): action is FromApiActionPayload<T> & AsyncRequest;
835
787
  /**
836
788
  * Determine if the given item implements the AsyncRequest interface
837
789
  * @param item
838
790
  */
839
- declare function isAsyncRequest<T>(item: any): item is T & AsyncRequest;
840
-
791
+ export declare function isAsyncRequest<T>(item: any): item is T & AsyncRequest;
841
792
  /**
842
793
  * Custom operator to use instead of SwitchMap with effects based on FromApi actions.
843
794
  * It makes sure to emit an action when the inner subscription is unsubscribed in order to keep the store up-to-date with pending information.
@@ -845,7 +796,7 @@ declare function isAsyncRequest<T>(item: any): item is T & AsyncRequest;
845
796
  * @param errorHandler function that returns the action to emit in case the FromApi call fails
846
797
  * @param cancelRequestActionFactory function that returns the action to emit in case the FromApi action is 'cancelled' because a new action was received by the switchMap
847
798
  */
848
- declare function fromApiEffectSwitchMap<T extends FromApiActionPayload<any>, S extends ExtractFromApiActionPayloadType<T>, U extends Action, V extends Action, W extends Action>(successHandler: (result: S, action: T) => U | Observable<U> | Promise<U>, errorHandler?: (error: any, action: T) => Observable<V>, cancelRequestActionFactory?: (props: AsyncRequest, action: T) => W): OperatorFunction<T, U | V | W>;
799
+ export declare function fromApiEffectSwitchMap<T extends FromApiActionPayload<any>, S extends ExtractFromApiActionPayloadType<T>, U extends Action, V extends Action, W extends Action>(successHandler: (result: S, action: T) => U | Observable<U> | Promise<U>, errorHandler?: (error: any, action: T) => Observable<V>, cancelRequestActionFactory?: (props: AsyncRequest, action: T) => W): OperatorFunction<T, U | V | W>;
849
800
  /**
850
801
  * Same as {@link fromApiEffectSwitchMap}, instead one inner subscription is kept by id.
851
802
  * @param successHandler
@@ -853,79 +804,75 @@ declare function fromApiEffectSwitchMap<T extends FromApiActionPayload<any>, S e
853
804
  * @param cancelRequestActionFactory
854
805
  * @param cleanUpTimer
855
806
  */
856
- declare function fromApiEffectSwitchMapById<T extends FromApiActionPayload<any> & {
857
- id: string;
807
+ export declare function fromApiEffectSwitchMapById<T extends FromApiActionPayload<any> & {
808
+ id: string;
858
809
  }, S extends ExtractFromApiActionPayloadType<T>, U extends Action, V extends Action, W extends Action>(successHandler: (result: S, action: T) => U | Observable<U> | Promise<U>, errorHandler?: (error: any, action: T) => Observable<V>, cancelRequestActionFactory?: (props: AsyncRequest, action: T) => W, cleanUpTimer?: number): OperatorFunction<T, U | V | W>;
859
-
860
810
  /**
861
811
  * Returns a creator that makes sure that requestId is defined in the action's properties by generating one
862
812
  * if needed.
863
813
  */
864
- declare const asyncProps: <P extends object>() => (props: P) => P & AsyncRequest;
865
-
814
+ export declare const asyncProps: <P extends object>() => (props: P) => P & AsyncRequest;
866
815
  /**
867
816
  * Serializer for asynchronous store.
868
817
  * @param state State of an asynchronous store to serialize
869
818
  * @returns a plain json object to pass to json.stringify
870
819
  */
871
- declare function asyncSerializer<T extends AsyncStoreItem>(state: T): T;
820
+ export declare function asyncSerializer<T extends AsyncStoreItem>(state: T): T;
872
821
  /**
873
822
  * Serializer for asynchronous entity store.
874
823
  * @param state State of an asynchronous entity store to serialize
875
824
  * @returns a plain json object to pass to json.stringify
876
825
  */
877
- declare function asyncEntitySerializer<T extends AsyncStoreItem & EntityState<AsyncStoreItem>>(state: T): T & {
878
- entities: _ngrx_entity.Dictionary<AsyncStoreItem>;
826
+ export declare function asyncEntitySerializer<T extends AsyncStoreItem & EntityState<AsyncStoreItem>>(state: T): T & {
827
+ entities: import("@ngrx/entity").Dictionary<AsyncStoreItem>;
879
828
  };
880
829
  /**
881
830
  * Serializer for asynchronous entity store with status.
882
831
  * @param state State of an asynchronous entity store with status to serialize
883
832
  * @returns a plain json object to pass to json.stringify
884
833
  */
885
- declare function asyncEntityWithStatusSerializer<T extends AsyncStoreItem & EntityState<AsyncStoreItem & {
886
- status: EntityStatus<T['entities']['status']>;
834
+ export declare function asyncEntityWithStatusSerializer<T extends AsyncStoreItem & EntityState<AsyncStoreItem & {
835
+ status: EntityStatus<T['entities']['status']>;
887
836
  }>>(state: T): T & {
888
- entities: _ngrx_entity.Dictionary<AsyncStoreItem & {
889
- status: EntityStatus<T["entities"]["status"]>;
890
- }>;
837
+ entities: import("@ngrx/entity").Dictionary<AsyncStoreItem & {
838
+ status: EntityStatus<T["entities"]["status"]>;
839
+ }>;
891
840
  };
892
-
893
841
  /**
894
842
  * Pad number
895
843
  * @param val
896
844
  * @param digits
897
845
  */
898
- declare function padNumber(val: number, digits?: number): string;
846
+ export declare function padNumber(val: number, digits?: number): string;
899
847
  /**
900
848
  * Returns TRUE if bootstrap config environment is production FALSE otherwise
901
849
  * @param dataset
902
850
  * @returns TRUE if bootstrap config environment is production FALSE otherwise
903
851
  */
904
- declare function isProductionEnvironment(dataset: Dataset): boolean;
905
-
852
+ export declare function isProductionEnvironment(dataset: Dataset): boolean;
906
853
  /** Reviver Mapper to detect and create object on deepFill */
907
- interface PrimitiveReviverMapper<T = any> {
908
- /** Condition to fill to be determine as */
909
- condition: (data: any) => boolean;
910
- /**
911
- * Construct the primitive type if needed
912
- * @param data to be constructed
913
- * @default {@link defaultConstruct}
914
- */
915
- construct?: (data: any) => T;
854
+ export interface PrimitiveReviverMapper<T = any> {
855
+ /** Condition to fill to be determine as */
856
+ condition: (data: any) => boolean;
857
+ /**
858
+ * Construct the primitive type if needed
859
+ * @param data to be constructed
860
+ * @default {@link defaultConstruct}
861
+ */
862
+ construct?: (data: any) => T;
916
863
  }
917
864
  /**
918
865
  * Check if an object is not an array or a date
919
866
  * @param obj
920
867
  * @param additionalMappers
921
868
  */
922
- declare function isObject(obj: any, additionalMappers?: PrimitiveReviverMapper[]): boolean;
869
+ export declare function isObject(obj: any, additionalMappers?: PrimitiveReviverMapper[]): boolean;
923
870
  /**
924
871
  * Return a new reference of the given object
925
872
  * @param obj
926
873
  * @param additionalMappers
927
874
  */
928
- declare function immutablePrimitive(obj: any, additionalMappers?: PrimitiveReviverMapper[]): any;
875
+ export declare function immutablePrimitive(obj: any, additionalMappers?: PrimitiveReviverMapper[]): any;
929
876
  /**
930
877
  * Deep fill of base object using source
931
878
  * It will do a deep merge of the objects, overriding arrays
@@ -934,12 +881,11 @@ declare function immutablePrimitive(obj: any, additionalMappers?: PrimitiveReviv
934
881
  * @param source
935
882
  * @param additionalMappers Map of conditions of type mapper
936
883
  */
937
- declare function deepFill<T extends {
938
- [x: string]: any;
884
+ export declare function deepFill<T extends {
885
+ [x: string]: any;
939
886
  }>(base: T, source?: {
940
- [x: string]: any;
887
+ [x: string]: any;
941
888
  }, additionalMappers?: PrimitiveReviverMapper[]): T;
942
-
943
889
  /**
944
890
  * Buffers and emits data for lazy/progressive rendering of big lists
945
891
  * That could solve issues with long-running tasks when trying to render an array
@@ -947,8 +893,5 @@ declare function deepFill<T extends {
947
893
  * @param delayMs Delay between data emits
948
894
  * @param concurrency Amount of elements that should be emitted at once
949
895
  */
950
- declare function lazyArray<T>(delayMs?: number, concurrency?: number): (source$: Observable<T[]>) => Observable<T[]>;
951
-
952
- export { DEFAULT_BUILD_PROPERTIES, O3rComponent, StateSerializer, applicationMessageTarget, asyncEntitySerializer, asyncEntityWithStatusSerializer, asyncProps, asyncSerializer, asyncStoreItemAdapter, computeItemIdentifier, createEntityAsyncRequestAdapter, deepFill, filterMessageContent, fromApiEffectSwitchMap, fromApiEffectSwitchMapById, immutablePrimitive, isAsyncRequest, isCallAction, isIdentifiedCallAction, isObject, isOtterMessage, isProductionEnvironment, isToAppOtterMessage, lazyArray, otterComponentInfoPropertyName, otterMessageType, padNumber, sendOtterMessage };
953
- export type { AppBuildConfiguration, AppRuntimeConfiguration, AsyncRequest, AsyncStoreItem, AsyncStoreItemAdapter, BaseContextOutput, BootstrapConfig, BuildTimeProperties, CategoryDescription, ClearOnFailurePayload, CommonContentMessages, ComponentType, ConfigPropertyWidget, ConfigPropertyWidgetParameters, ConfigType, Configurable, Configuration, ConfigurationValueType, ConnectContentMessage, ContentMessageData, Context, ContextInput, ContextualizationDataset, ContextualizationDevtoolsCommonOptions, CustomConfig, Dataset, DevtoolsCommonOptions, DevtoolsServiceInterface, DynamicConfigurable, DynamicConfigurableWithSignal, EntityAsyncRequestAdapter, EntityStatus, EntityWithStatus, EntityWithoutAsyncStoreItem, EventEmitterify, ExtractFromApiActionPayloadType, FailActionPayload, FailAsyncStoreItemEntitiesActionPayload, FailAsyncStoreItemEntityActionPayload, FailEntitiesActionPayload, FilterMessageToApplication, FromApiActionPayload, FromApiActionPayloadWithEntityId, Functionify, Idfy, InjectContentMessage, InterfaceOf, ItemIdentifier, Keep, LabelValue, LocalStateModel, Logger, MessageDataTypes, NestedConfiguration, OtterComponentInfo, OtterComponentInfoToProvide, OtterMessage, OtterMessageContent, Output, PrimitiveReviverMapper, RequestId, RequestMessagesContentMessage, RulesEngineAction, RulesEngineActionHandler, Serializer, SetActionPayload, SetAsyncStoreItemActionPayload, SetAsyncStoreItemEntitiesActionPayload, SetAsyncStoreItemEntityActionPayload, SetEntitiesActionPayload, SetEntityActionPayload, SetStateActionPayload, TemplateContext, Translation, UpdateActionPayload, UpdateAsyncStoreItemEntitiesActionPayload, UpdateAsyncStoreItemEntitiesActionPayloadWithId, UpdateAsyncStoreItemEntityActionPayload, UpdateAsyncStoreItemEntityActionPayloadWithId, UpdateEntitiesActionPayload, UpdateEntitiesActionPayloadWithId, UpdateEntityActionPayload, UpdateEntityActionPayloadWithId, WindowWithDevtools, WithRequestId };
954
- //# sourceMappingURL=o3r-core.d.ts.map
896
+ export declare function lazyArray<T>(delayMs?: number, concurrency?: number): (source$: Observable<T[]>) => Observable<T[]>;
897
+ //# sourceMappingURL=o3r-core.d.ts.map