@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.
- package/fesm2022/o3r-core.mjs +300 -470
- package/fesm2022/o3r-core.mjs.map +1 -1
- package/package.json +12 -12
- package/types/o3r-core.d.ts +553 -610
- package/types/o3r-core.d.ts.map +1 -1
package/types/o3r-core.d.ts
CHANGED
|
@@ -1,843 +1,794 @@
|
|
|
1
|
-
import { InputSignal, Signal
|
|
2
|
-
import { Observable, OperatorFunction } from
|
|
3
|
-
import { FormControl } from
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
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
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
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
|
-
|
|
151
|
-
|
|
152
|
-
|
|
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
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
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
|
-
|
|
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
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
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
|
-
|
|
206
|
-
|
|
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
|
-
|
|
212
|
-
|
|
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
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
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
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
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
|
-
|
|
235
|
-
|
|
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
|
-
|
|
240
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
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
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
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
|
-
|
|
325
|
-
|
|
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
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
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
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
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
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
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
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
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
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
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
|
-
|
|
432
|
-
|
|
433
|
-
}
|
|
434
|
-
interface OtterMessage<Content extends OtterMessageContent = OtterMessageContent, Target extends string | undefined = undefined | string> {
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
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
|
-
|
|
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
|
-
|
|
458
|
-
|
|
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
|
-
|
|
463
|
-
|
|
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
|
-
|
|
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
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
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
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
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
|
-
|
|
511
|
-
|
|
512
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
517
|
+
export interface UpdateEntitiesActionPayloadWithId<T extends {
|
|
518
|
+
id: string | number;
|
|
552
519
|
}> {
|
|
553
|
-
|
|
520
|
+
entities: Keep<T, 'id'>[];
|
|
554
521
|
}
|
|
555
522
|
/** Payload to update entities actions */
|
|
556
|
-
interface UpdateEntityActionPayload<T, K extends keyof T> {
|
|
557
|
-
|
|
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
|
-
|
|
527
|
+
export interface UpdateEntityActionPayloadWithId<T extends {
|
|
528
|
+
id: string | number;
|
|
562
529
|
}> {
|
|
563
|
-
|
|
530
|
+
entity: Keep<T, 'id'>;
|
|
564
531
|
}
|
|
565
532
|
/** Payload to set entities and upsert entities actions */
|
|
566
|
-
interface SetEntitiesActionPayload<T> {
|
|
567
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
582
|
-
|
|
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
|
-
|
|
591
|
-
|
|
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
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
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
|
-
|
|
616
|
-
|
|
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
|
-
|
|
627
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
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
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
834
|
+
export declare function asyncEntityWithStatusSerializer<T extends AsyncStoreItem & EntityState<AsyncStoreItem & {
|
|
835
|
+
status: EntityStatus<T['entities']['status']>;
|
|
887
836
|
}>>(state: T): T & {
|
|
888
|
-
|
|
889
|
-
|
|
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
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
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
|
-
|
|
884
|
+
export declare function deepFill<T extends {
|
|
885
|
+
[x: string]: any;
|
|
939
886
|
}>(base: T, source?: {
|
|
940
|
-
|
|
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
|