entropic-bond 1.50.0 → 1.50.2
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/lib/auth/auth-mock.d.ts +22 -0
- package/lib/auth/auth-mock.spec.d.ts +1 -0
- package/lib/auth/auth.d.ts +131 -0
- package/lib/auth/user-auth-types.d.ts +19 -0
- package/lib/cloud-functions/cloud-functions-mock.d.ts +11 -0
- package/lib/cloud-functions/cloud-functions-mock.spec.d.ts +1 -0
- package/lib/cloud-functions/cloud-functions.d.ts +19 -0
- package/lib/cloud-storage/cloud-storage.d.ts +24 -0
- package/lib/cloud-storage/cloud-storage.spec.d.ts +1 -0
- package/lib/cloud-storage/mock-cloud-storage.d.ts +20 -0
- package/lib/cloud-storage/stored-file.d.ts +39 -0
- package/lib/entropic-bond.js +1667 -0
- package/lib/entropic-bond.umd.cjs +7 -0
- package/lib/index.d.ts +19 -0
- package/lib/observable/observable.d.ts +52 -0
- package/lib/observable/observable.spec.d.ts +1 -0
- package/lib/persistent/entropic-component.d.ts +76 -0
- package/lib/persistent/entropic-component.spec.d.ts +1 -0
- package/lib/persistent/persistent.d.ts +281 -0
- package/lib/persistent/persistent.spec.d.ts +67 -0
- package/lib/server-auth/server-auth-mock.d.ts +12 -0
- package/lib/server-auth/server-auth-mock.spec.d.ts +1 -0
- package/lib/server-auth/server-auth.d.ts +24 -0
- package/lib/store/data-source.d.ts +137 -0
- package/lib/store/json-data-source.d.ts +68 -0
- package/lib/store/json-data-source.spec.d.ts +1 -0
- package/lib/store/mocks/test-user.d.ts +49 -0
- package/lib/store/model.d.ts +238 -0
- package/lib/store/model.spec.d.ts +1 -0
- package/lib/store/store.d.ts +62 -0
- package/lib/store/store.spec.d.ts +1 -0
- package/lib/types/utility-types.d.ts +45 -0
- package/lib/types/utility-types.spec.d.ts +1 -0
- package/lib/utils/test-utils/test-person.d.ts +33 -0
- package/{src/utils/utils.ts → lib/utils/utils.d.ts} +10 -34
- package/lib/utils/utils.spec.d.ts +1 -0
- package/package.json +7 -4
- package/.github/workflows/release.yml +0 -26
- package/CHANGELOG.md +0 -1151
- package/docs/.nojekyll +0 -1
- package/docs/README.md +0 -94
- package/docs/classes/Auth.md +0 -391
- package/docs/classes/AuthMock.md +0 -278
- package/docs/classes/AuthService.md +0 -188
- package/docs/classes/CloudFunctions.md +0 -123
- package/docs/classes/CloudFunctionsMock.md +0 -97
- package/docs/classes/CloudStorage.md +0 -215
- package/docs/classes/DataSource.md +0 -248
- package/docs/classes/EntropicComponent.md +0 -666
- package/docs/classes/JsonDataSource.md +0 -328
- package/docs/classes/MockCloudStorage.md +0 -279
- package/docs/classes/Model.md +0 -274
- package/docs/classes/Observable.md +0 -120
- package/docs/classes/Persistent.md +0 -420
- package/docs/classes/ServerAuth.md +0 -211
- package/docs/classes/ServerAuthMock.md +0 -176
- package/docs/classes/ServerAuthService.md +0 -130
- package/docs/classes/Store.md +0 -218
- package/docs/classes/StoredFile.md +0 -636
- package/docs/enums/StoredFileEvent.md +0 -41
- package/docs/interfaces/AuthError.md +0 -30
- package/docs/interfaces/CloudFunctionsService.md +0 -69
- package/docs/interfaces/Collection.md +0 -13
- package/docs/interfaces/CustomCredentials.md +0 -7
- package/docs/interfaces/DocumentReference.md +0 -49
- package/docs/interfaces/JsonRawData.md +0 -7
- package/docs/interfaces/SignData.md +0 -63
- package/docs/interfaces/StoreParams.md +0 -52
- package/docs/interfaces/StoredFileChange.md +0 -41
- package/docs/interfaces/UploadControl.md +0 -90
- package/docs/interfaces/UserCredentials.md +0 -113
- package/docs/interfaces/Values.md +0 -17
- package/docs/modules.md +0 -1273
- package/src/auth/auth-mock.spec.ts +0 -168
- package/src/auth/auth-mock.ts +0 -129
- package/src/auth/auth.ts +0 -185
- package/src/auth/user-auth-types.ts +0 -21
- package/src/cloud-functions/cloud-functions-mock.spec.ts +0 -136
- package/src/cloud-functions/cloud-functions-mock.ts +0 -23
- package/src/cloud-functions/cloud-functions.ts +0 -83
- package/src/cloud-storage/cloud-storage.spec.ts +0 -207
- package/src/cloud-storage/cloud-storage.ts +0 -60
- package/src/cloud-storage/mock-cloud-storage.ts +0 -72
- package/src/cloud-storage/stored-file.ts +0 -102
- package/src/index.ts +0 -19
- package/src/observable/observable.spec.ts +0 -105
- package/src/observable/observable.ts +0 -67
- package/src/persistent/entropic-component.spec.ts +0 -143
- package/src/persistent/entropic-component.ts +0 -135
- package/src/persistent/persistent.spec.ts +0 -828
- package/src/persistent/persistent.ts +0 -650
- package/src/server-auth/server-auth-mock.spec.ts +0 -53
- package/src/server-auth/server-auth-mock.ts +0 -45
- package/src/server-auth/server-auth.ts +0 -49
- package/src/store/data-source.ts +0 -186
- package/src/store/json-data-source.spec.ts +0 -100
- package/src/store/json-data-source.ts +0 -256
- package/src/store/mocks/mock-data.json +0 -155
- package/src/store/mocks/test-user.ts +0 -122
- package/src/store/model.spec.ts +0 -659
- package/src/store/model.ts +0 -462
- package/src/store/store.spec.ts +0 -30
- package/src/store/store.ts +0 -113
- package/src/types/utility-types.spec.ts +0 -117
- package/src/types/utility-types.ts +0 -116
- package/src/utils/test-utils/test-person.ts +0 -44
- package/src/utils/utils.spec.ts +0 -95
- package/tsconfig-build.json +0 -7
- package/tsconfig-cjs.json +0 -9
- package/tsconfig.json +0 -33
- package/vite.config.ts +0 -22
|
@@ -1,666 +0,0 @@
|
|
|
1
|
-
[entropic-bond](../README.md) / [Exports](../modules.md) / EntropicComponent
|
|
2
|
-
|
|
3
|
-
# Class: EntropicComponent
|
|
4
|
-
|
|
5
|
-
Derived classes from EntropicComponent will have the ability to notify
|
|
6
|
-
property changes by calling one of the provided notification methods.
|
|
7
|
-
It extends Persistent class therefore EntropicComponent children will have
|
|
8
|
-
persistance through the Entropic Bond persistence mechanism
|
|
9
|
-
|
|
10
|
-
## Hierarchy
|
|
11
|
-
|
|
12
|
-
- [`Persistent`](Persistent.md)
|
|
13
|
-
|
|
14
|
-
↳ **`EntropicComponent`**
|
|
15
|
-
|
|
16
|
-
## Table of contents
|
|
17
|
-
|
|
18
|
-
### Constructors
|
|
19
|
-
|
|
20
|
-
- [constructor](EntropicComponent.md#constructor)
|
|
21
|
-
|
|
22
|
-
### Accessors
|
|
23
|
-
|
|
24
|
-
- [className](EntropicComponent.md#classname)
|
|
25
|
-
- [id](EntropicComponent.md#id)
|
|
26
|
-
|
|
27
|
-
### Methods
|
|
28
|
-
|
|
29
|
-
- [beforeSerialize](EntropicComponent.md#beforeserialize)
|
|
30
|
-
- [changeProp](EntropicComponent.md#changeprop)
|
|
31
|
-
- [clone](EntropicComponent.md#clone)
|
|
32
|
-
- [fromObject](EntropicComponent.md#fromobject)
|
|
33
|
-
- [getPersistentProperties](EntropicComponent.md#getpersistentproperties)
|
|
34
|
-
- [notify](EntropicComponent.md#notify)
|
|
35
|
-
- [onChange](EntropicComponent.md#onchange)
|
|
36
|
-
- [onSerialized](EntropicComponent.md#onserialized)
|
|
37
|
-
- [pushAndNotify](EntropicComponent.md#pushandnotify)
|
|
38
|
-
- [removeAndNotify](EntropicComponent.md#removeandnotify)
|
|
39
|
-
- [removeOnChange](EntropicComponent.md#removeonchange)
|
|
40
|
-
- [setId](EntropicComponent.md#setid)
|
|
41
|
-
- [toObject](EntropicComponent.md#toobject)
|
|
42
|
-
- [annotations](EntropicComponent.md#annotations)
|
|
43
|
-
- [classFactory](EntropicComponent.md#classfactory)
|
|
44
|
-
- [classesExtending](EntropicComponent.md#classesextending)
|
|
45
|
-
- [createInstance](EntropicComponent.md#createinstance)
|
|
46
|
-
- [registerFactory](EntropicComponent.md#registerfactory)
|
|
47
|
-
- [registeredClasses](EntropicComponent.md#registeredclasses)
|
|
48
|
-
|
|
49
|
-
## Constructors
|
|
50
|
-
|
|
51
|
-
### constructor
|
|
52
|
-
|
|
53
|
-
• **new EntropicComponent**(`id?`)
|
|
54
|
-
|
|
55
|
-
Returns a new instance of Persistent class.
|
|
56
|
-
|
|
57
|
-
#### Parameters
|
|
58
|
-
|
|
59
|
-
| Name | Type |
|
|
60
|
-
| :------ | :------ |
|
|
61
|
-
| `id` | `string` |
|
|
62
|
-
|
|
63
|
-
#### Inherited from
|
|
64
|
-
|
|
65
|
-
[Persistent](Persistent.md).[constructor](Persistent.md#constructor)
|
|
66
|
-
|
|
67
|
-
#### Defined in
|
|
68
|
-
|
|
69
|
-
[persistent/persistent.ts:124](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/persistent/persistent.ts#L124)
|
|
70
|
-
|
|
71
|
-
## Accessors
|
|
72
|
-
|
|
73
|
-
### className
|
|
74
|
-
|
|
75
|
-
• `get` **className**(): `string`
|
|
76
|
-
|
|
77
|
-
Gets the class name of this instance.
|
|
78
|
-
|
|
79
|
-
#### Returns
|
|
80
|
-
|
|
81
|
-
`string`
|
|
82
|
-
|
|
83
|
-
#### Inherited from
|
|
84
|
-
|
|
85
|
-
Persistent.className
|
|
86
|
-
|
|
87
|
-
#### Defined in
|
|
88
|
-
|
|
89
|
-
[persistent/persistent.ts:131](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/persistent/persistent.ts#L131)
|
|
90
|
-
|
|
91
|
-
___
|
|
92
|
-
|
|
93
|
-
### id
|
|
94
|
-
|
|
95
|
-
• `get` **id**(): `string`
|
|
96
|
-
|
|
97
|
-
Returns the id of this instance.
|
|
98
|
-
|
|
99
|
-
#### Returns
|
|
100
|
-
|
|
101
|
-
`string`
|
|
102
|
-
|
|
103
|
-
the id of this instance
|
|
104
|
-
|
|
105
|
-
#### Inherited from
|
|
106
|
-
|
|
107
|
-
Persistent.id
|
|
108
|
-
|
|
109
|
-
#### Defined in
|
|
110
|
-
|
|
111
|
-
[persistent/persistent.ts:147](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/persistent/persistent.ts#L147)
|
|
112
|
-
|
|
113
|
-
## Methods
|
|
114
|
-
|
|
115
|
-
### beforeSerialize
|
|
116
|
-
|
|
117
|
-
▸ `Protected` **beforeSerialize**(): `void`
|
|
118
|
-
|
|
119
|
-
This method is called by the persistence engine before the instance is
|
|
120
|
-
serialized.
|
|
121
|
-
|
|
122
|
-
#### Returns
|
|
123
|
-
|
|
124
|
-
`void`
|
|
125
|
-
|
|
126
|
-
#### Inherited from
|
|
127
|
-
|
|
128
|
-
[Persistent](Persistent.md).[beforeSerialize](Persistent.md#beforeserialize)
|
|
129
|
-
|
|
130
|
-
#### Defined in
|
|
131
|
-
|
|
132
|
-
[persistent/persistent.ts:161](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/persistent/persistent.ts#L161)
|
|
133
|
-
|
|
134
|
-
___
|
|
135
|
-
|
|
136
|
-
### changeProp
|
|
137
|
-
|
|
138
|
-
▸ `Protected` **changeProp**<`P`\>(`propName`, `value`): `boolean`
|
|
139
|
-
|
|
140
|
-
Changes the value of the property and notifies the subscribers about the change.
|
|
141
|
-
This is a helper method that can be used in the property setter.
|
|
142
|
-
|
|
143
|
-
#### Type parameters
|
|
144
|
-
|
|
145
|
-
| Name | Type |
|
|
146
|
-
| :------ | :------ |
|
|
147
|
-
| `P` | extends keyof [`EntropicComponent`](EntropicComponent.md) |
|
|
148
|
-
|
|
149
|
-
#### Parameters
|
|
150
|
-
|
|
151
|
-
| Name | Type | Description |
|
|
152
|
-
| :------ | :------ | :------ |
|
|
153
|
-
| `propName` | `P` | the name of the property to be changed |
|
|
154
|
-
| `value` | [`EntropicComponent`](EntropicComponent.md)[`P`] | the new value for the property |
|
|
155
|
-
|
|
156
|
-
#### Returns
|
|
157
|
-
|
|
158
|
-
`boolean`
|
|
159
|
-
|
|
160
|
-
true in case the property has been effectively changed, false otherwise
|
|
161
|
-
|
|
162
|
-
#### Defined in
|
|
163
|
-
|
|
164
|
-
[persistent/entropic-component.ts:46](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/persistent/entropic-component.ts#L46)
|
|
165
|
-
|
|
166
|
-
___
|
|
167
|
-
|
|
168
|
-
### clone
|
|
169
|
-
|
|
170
|
-
▸ **clone**(`instance`): `void`
|
|
171
|
-
|
|
172
|
-
Copy the persistent properties of the given instance to this instance.
|
|
173
|
-
The property `id` will be ignored.
|
|
174
|
-
Only the properties that are not null or undefined will be copied.
|
|
175
|
-
|
|
176
|
-
**`See`**
|
|
177
|
-
|
|
178
|
-
- fromObject
|
|
179
|
-
- toObject
|
|
180
|
-
|
|
181
|
-
#### Parameters
|
|
182
|
-
|
|
183
|
-
| Name | Type | Description |
|
|
184
|
-
| :------ | :------ | :------ |
|
|
185
|
-
| `instance` | [`Persistent`](Persistent.md) | the instance to be copied |
|
|
186
|
-
|
|
187
|
-
#### Returns
|
|
188
|
-
|
|
189
|
-
`void`
|
|
190
|
-
|
|
191
|
-
this instance
|
|
192
|
-
|
|
193
|
-
#### Inherited from
|
|
194
|
-
|
|
195
|
-
[Persistent](Persistent.md).[clone](Persistent.md#clone)
|
|
196
|
-
|
|
197
|
-
#### Defined in
|
|
198
|
-
|
|
199
|
-
[persistent/persistent.ts:183](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/persistent/persistent.ts#L183)
|
|
200
|
-
|
|
201
|
-
___
|
|
202
|
-
|
|
203
|
-
### fromObject
|
|
204
|
-
|
|
205
|
-
▸ **fromObject**(`obj`): [`EntropicComponent`](EntropicComponent.md)
|
|
206
|
-
|
|
207
|
-
Initializes the persistent properties of this instance from the properties
|
|
208
|
-
of given object.
|
|
209
|
-
|
|
210
|
-
**`See`**
|
|
211
|
-
|
|
212
|
-
- clone
|
|
213
|
-
- toObject
|
|
214
|
-
|
|
215
|
-
#### Parameters
|
|
216
|
-
|
|
217
|
-
| Name | Type | Description |
|
|
218
|
-
| :------ | :------ | :------ |
|
|
219
|
-
| `obj` | [`PersistentObject`](../modules.md#persistentobject)<[`EntropicComponent`](EntropicComponent.md)\> | the object to be copied |
|
|
220
|
-
|
|
221
|
-
#### Returns
|
|
222
|
-
|
|
223
|
-
[`EntropicComponent`](EntropicComponent.md)
|
|
224
|
-
|
|
225
|
-
this instance
|
|
226
|
-
|
|
227
|
-
#### Inherited from
|
|
228
|
-
|
|
229
|
-
[Persistent](Persistent.md).[fromObject](Persistent.md#fromobject)
|
|
230
|
-
|
|
231
|
-
#### Defined in
|
|
232
|
-
|
|
233
|
-
[persistent/persistent.ts:197](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/persistent/persistent.ts#L197)
|
|
234
|
-
|
|
235
|
-
___
|
|
236
|
-
|
|
237
|
-
### getPersistentProperties
|
|
238
|
-
|
|
239
|
-
▸ **getPersistentProperties**(): readonly `PersistentProperty`[]
|
|
240
|
-
|
|
241
|
-
Returns an array of the persistent properties of this instance.
|
|
242
|
-
|
|
243
|
-
#### Returns
|
|
244
|
-
|
|
245
|
-
readonly `PersistentProperty`[]
|
|
246
|
-
|
|
247
|
-
an array of the persistent properties of this instance
|
|
248
|
-
|
|
249
|
-
#### Inherited from
|
|
250
|
-
|
|
251
|
-
[Persistent](Persistent.md).[getPersistentProperties](Persistent.md#getpersistentproperties)
|
|
252
|
-
|
|
253
|
-
#### Defined in
|
|
254
|
-
|
|
255
|
-
[persistent/persistent.ts:167](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/persistent/persistent.ts#L167)
|
|
256
|
-
|
|
257
|
-
___
|
|
258
|
-
|
|
259
|
-
### notify
|
|
260
|
-
|
|
261
|
-
▸ `Protected` **notify**<`T`\>(`event`): `void`
|
|
262
|
-
|
|
263
|
-
Notifies the subscribers a property or group of properties change.
|
|
264
|
-
This is a helper function to be used when you want to notify property changes.
|
|
265
|
-
|
|
266
|
-
#### Type parameters
|
|
267
|
-
|
|
268
|
-
| Name | Type |
|
|
269
|
-
| :------ | :------ |
|
|
270
|
-
| `T` | extends [`EntropicComponent`](EntropicComponent.md)<`T`\> |
|
|
271
|
-
|
|
272
|
-
#### Parameters
|
|
273
|
-
|
|
274
|
-
| Name | Type | Description |
|
|
275
|
-
| :------ | :------ | :------ |
|
|
276
|
-
| `event` | `Partial`<[`ClassProps`](../modules.md#classprops)<`T`\>\> | the event with the changed properties |
|
|
277
|
-
|
|
278
|
-
#### Returns
|
|
279
|
-
|
|
280
|
-
`void`
|
|
281
|
-
|
|
282
|
-
#### Defined in
|
|
283
|
-
|
|
284
|
-
[persistent/entropic-component.ts:64](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/persistent/entropic-component.ts#L64)
|
|
285
|
-
|
|
286
|
-
___
|
|
287
|
-
|
|
288
|
-
### onChange
|
|
289
|
-
|
|
290
|
-
▸ **onChange**(`listenerCallback`): [`Unsubscriber`](../modules.md#unsubscriber)
|
|
291
|
-
|
|
292
|
-
Subscribes a listener callback function. Every time a property is changed,
|
|
293
|
-
the listener callback will be called with the property change event.
|
|
294
|
-
|
|
295
|
-
#### Parameters
|
|
296
|
-
|
|
297
|
-
| Name | Type | Description |
|
|
298
|
-
| :------ | :------ | :------ |
|
|
299
|
-
| `listenerCallback` | [`PropChangeCallback`](../modules.md#propchangecallback)<[`EntropicComponent`](EntropicComponent.md)\> | the listener callback |
|
|
300
|
-
|
|
301
|
-
#### Returns
|
|
302
|
-
|
|
303
|
-
[`Unsubscriber`](../modules.md#unsubscriber)
|
|
304
|
-
|
|
305
|
-
a function to unsubscribe the listener from further notifications
|
|
306
|
-
|
|
307
|
-
#### Defined in
|
|
308
|
-
|
|
309
|
-
[persistent/entropic-component.ts:25](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/persistent/entropic-component.ts#L25)
|
|
310
|
-
|
|
311
|
-
___
|
|
312
|
-
|
|
313
|
-
### onSerialized
|
|
314
|
-
|
|
315
|
-
▸ `Protected` **onSerialized**(): `void`
|
|
316
|
-
|
|
317
|
-
This method is called by the persistence engine when the instance has been
|
|
318
|
-
just serialized. It is called after the properties are initialized.
|
|
319
|
-
|
|
320
|
-
#### Returns
|
|
321
|
-
|
|
322
|
-
`void`
|
|
323
|
-
|
|
324
|
-
#### Inherited from
|
|
325
|
-
|
|
326
|
-
[Persistent](Persistent.md).[onSerialized](Persistent.md#onserialized)
|
|
327
|
-
|
|
328
|
-
#### Defined in
|
|
329
|
-
|
|
330
|
-
[persistent/persistent.ts:155](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/persistent/persistent.ts#L155)
|
|
331
|
-
|
|
332
|
-
___
|
|
333
|
-
|
|
334
|
-
### pushAndNotify
|
|
335
|
-
|
|
336
|
-
▸ `Protected` **pushAndNotify**<`T`\>(`arrayPropName`, `element`, `isUnique?`): [`Elements`](../modules.md#elements)<`T`[[`ClassArrayPropNames`](../modules.md#classarraypropnames)<`T`\>]\>
|
|
337
|
-
|
|
338
|
-
Inserts a new element in an arbitrary array property of this class and
|
|
339
|
-
fires a change event if successfully inserted. To avoid repeated elements
|
|
340
|
-
to be inserted, you can pass a function that checks for inequity.
|
|
341
|
-
|
|
342
|
-
#### Type parameters
|
|
343
|
-
|
|
344
|
-
| Name | Type |
|
|
345
|
-
| :------ | :------ |
|
|
346
|
-
| `T` | extends [`EntropicComponent`](EntropicComponent.md)<`T`\> |
|
|
347
|
-
|
|
348
|
-
#### Parameters
|
|
349
|
-
|
|
350
|
-
| Name | Type | Description |
|
|
351
|
-
| :------ | :------ | :------ |
|
|
352
|
-
| `arrayPropName` | [`ClassArrayPropNames`](../modules.md#classarraypropnames)<`T`\> | the name of the array property of this class where you want to insert the new element. |
|
|
353
|
-
| `element` | [`Elements`](../modules.md#elements)<`T`[[`ClassArrayPropNames`](../modules.md#classarraypropnames)<`T`\>]\> | the element to be inserted |
|
|
354
|
-
| `isUnique?` | [`CompareFunction`](../modules.md#comparefunction)<`T`\> | a function that checks for inequity of the two elements passed as parameter. If the returned value is true, the value will be pushed into the array. When the function is not provided, the element will be inserted regardless it is already in the array. |
|
|
355
|
-
|
|
356
|
-
#### Returns
|
|
357
|
-
|
|
358
|
-
[`Elements`](../modules.md#elements)<`T`[[`ClassArrayPropNames`](../modules.md#classarraypropnames)<`T`\>]\>
|
|
359
|
-
|
|
360
|
-
the inserted element or undefined if the element was not inserted.
|
|
361
|
-
|
|
362
|
-
#### Defined in
|
|
363
|
-
|
|
364
|
-
[persistent/entropic-component.ts:83](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/persistent/entropic-component.ts#L83)
|
|
365
|
-
|
|
366
|
-
___
|
|
367
|
-
|
|
368
|
-
### removeAndNotify
|
|
369
|
-
|
|
370
|
-
▸ `Protected` **removeAndNotify**<`T`\>(`arrayPropName`, `element`, `isEqual`): [`Elements`](../modules.md#elements)<`T`[[`ClassArrayPropNames`](../modules.md#classarraypropnames)<`T`\>]\>
|
|
371
|
-
|
|
372
|
-
Removes an element from an arbitrary array property of this class and fires
|
|
373
|
-
a change event on operation success.
|
|
374
|
-
|
|
375
|
-
#### Type parameters
|
|
376
|
-
|
|
377
|
-
| Name | Type |
|
|
378
|
-
| :------ | :------ |
|
|
379
|
-
| `T` | extends [`EntropicComponent`](EntropicComponent.md)<`T`\> |
|
|
380
|
-
|
|
381
|
-
#### Parameters
|
|
382
|
-
|
|
383
|
-
| Name | Type | Description |
|
|
384
|
-
| :------ | :------ | :------ |
|
|
385
|
-
| `arrayPropName` | [`ClassArrayPropNames`](../modules.md#classarraypropnames)<`T`\> | the name of the array property of this class where you want to insert the new element. |
|
|
386
|
-
| `element` | [`Elements`](../modules.md#elements)<`T`[[`ClassArrayPropNames`](../modules.md#classarraypropnames)<`T`\>]\> | the element to be inserted |
|
|
387
|
-
| `isEqual` | [`CompareFunction`](../modules.md#comparefunction)<`T`\> | a function that checks for equity of the two elements passed as parameter. If the returned value is true, the value will be removed from the array. |
|
|
388
|
-
|
|
389
|
-
#### Returns
|
|
390
|
-
|
|
391
|
-
[`Elements`](../modules.md#elements)<`T`[[`ClassArrayPropNames`](../modules.md#classarraypropnames)<`T`\>]\>
|
|
392
|
-
|
|
393
|
-
the removed element or undefined if the element was not removed.
|
|
394
|
-
|
|
395
|
-
#### Defined in
|
|
396
|
-
|
|
397
|
-
[persistent/entropic-component.ts:112](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/persistent/entropic-component.ts#L112)
|
|
398
|
-
|
|
399
|
-
___
|
|
400
|
-
|
|
401
|
-
### removeOnChange
|
|
402
|
-
|
|
403
|
-
▸ **removeOnChange**(`listenerCallback`): `void`
|
|
404
|
-
|
|
405
|
-
Removes the listener callback subscrition from the notifications.
|
|
406
|
-
|
|
407
|
-
#### Parameters
|
|
408
|
-
|
|
409
|
-
| Name | Type | Description |
|
|
410
|
-
| :------ | :------ | :------ |
|
|
411
|
-
| `listenerCallback` | [`PropChangeCallback`](../modules.md#propchangecallback)<[`EntropicComponent`](EntropicComponent.md)\> | the listener callback to remove |
|
|
412
|
-
|
|
413
|
-
#### Returns
|
|
414
|
-
|
|
415
|
-
`void`
|
|
416
|
-
|
|
417
|
-
#### Defined in
|
|
418
|
-
|
|
419
|
-
[persistent/entropic-component.ts:34](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/persistent/entropic-component.ts#L34)
|
|
420
|
-
|
|
421
|
-
___
|
|
422
|
-
|
|
423
|
-
### setId
|
|
424
|
-
|
|
425
|
-
▸ `Protected` **setId**(`value`): `void`
|
|
426
|
-
|
|
427
|
-
Sets the id of this instance.
|
|
428
|
-
|
|
429
|
-
#### Parameters
|
|
430
|
-
|
|
431
|
-
| Name | Type | Description |
|
|
432
|
-
| :------ | :------ | :------ |
|
|
433
|
-
| `value` | `string` | the id of this instance |
|
|
434
|
-
|
|
435
|
-
#### Returns
|
|
436
|
-
|
|
437
|
-
`void`
|
|
438
|
-
|
|
439
|
-
#### Inherited from
|
|
440
|
-
|
|
441
|
-
[Persistent](Persistent.md).[setId](Persistent.md#setid)
|
|
442
|
-
|
|
443
|
-
#### Defined in
|
|
444
|
-
|
|
445
|
-
[persistent/persistent.ts:139](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/persistent/persistent.ts#L139)
|
|
446
|
-
|
|
447
|
-
___
|
|
448
|
-
|
|
449
|
-
### toObject
|
|
450
|
-
|
|
451
|
-
▸ **toObject**(): [`PersistentObject`](../modules.md#persistentobject)<[`EntropicComponent`](EntropicComponent.md)\>
|
|
452
|
-
|
|
453
|
-
Returns a plain object representation of this instance.
|
|
454
|
-
Only the properties that are not null or undefined will be copied.
|
|
455
|
-
|
|
456
|
-
**`See`**
|
|
457
|
-
|
|
458
|
-
- fromObject
|
|
459
|
-
- clone
|
|
460
|
-
|
|
461
|
-
#### Returns
|
|
462
|
-
|
|
463
|
-
[`PersistentObject`](../modules.md#persistentobject)<[`EntropicComponent`](EntropicComponent.md)\>
|
|
464
|
-
|
|
465
|
-
a plain object representation of this instance
|
|
466
|
-
|
|
467
|
-
#### Inherited from
|
|
468
|
-
|
|
469
|
-
[Persistent](Persistent.md).[toObject](Persistent.md#toobject)
|
|
470
|
-
|
|
471
|
-
#### Defined in
|
|
472
|
-
|
|
473
|
-
[persistent/persistent.ts:225](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/persistent/persistent.ts#L225)
|
|
474
|
-
|
|
475
|
-
___
|
|
476
|
-
|
|
477
|
-
### annotations
|
|
478
|
-
|
|
479
|
-
▸ `Static` **annotations**(`className`): `unknown`
|
|
480
|
-
|
|
481
|
-
Returns the annotation associated with a registered class
|
|
482
|
-
|
|
483
|
-
**`Throws`**
|
|
484
|
-
|
|
485
|
-
an error if the class is not registered
|
|
486
|
-
|
|
487
|
-
**`See`**
|
|
488
|
-
|
|
489
|
-
registerFactory
|
|
490
|
-
|
|
491
|
-
#### Parameters
|
|
492
|
-
|
|
493
|
-
| Name | Type | Description |
|
|
494
|
-
| :------ | :------ | :------ |
|
|
495
|
-
| `className` | `string` \| [`Persistent`](Persistent.md) \| [`PersistentConstructor`](../modules.md#persistentconstructor) | the name of the class to be retrieved |
|
|
496
|
-
|
|
497
|
-
#### Returns
|
|
498
|
-
|
|
499
|
-
`unknown`
|
|
500
|
-
|
|
501
|
-
the annotation associated with the class
|
|
502
|
-
|
|
503
|
-
#### Inherited from
|
|
504
|
-
|
|
505
|
-
[Persistent](Persistent.md).[annotations](Persistent.md#annotations)
|
|
506
|
-
|
|
507
|
-
#### Defined in
|
|
508
|
-
|
|
509
|
-
[persistent/persistent.ts:111](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/persistent/persistent.ts#L111)
|
|
510
|
-
|
|
511
|
-
___
|
|
512
|
-
|
|
513
|
-
### classFactory
|
|
514
|
-
|
|
515
|
-
▸ `Static` **classFactory**(`className`): [`PersistentConstructor`](../modules.md#persistentconstructor)
|
|
516
|
-
|
|
517
|
-
Returns the constructor of a registered class
|
|
518
|
-
|
|
519
|
-
**`Throws`**
|
|
520
|
-
|
|
521
|
-
an error if the class is not registered
|
|
522
|
-
|
|
523
|
-
**`See`**
|
|
524
|
-
|
|
525
|
-
- registerFactory
|
|
526
|
-
- registeredClasses
|
|
527
|
-
- classesExtending
|
|
528
|
-
- annotations
|
|
529
|
-
|
|
530
|
-
#### Parameters
|
|
531
|
-
|
|
532
|
-
| Name | Type | Description |
|
|
533
|
-
| :------ | :------ | :------ |
|
|
534
|
-
| `className` | `string` | the name of the class to be retrieved |
|
|
535
|
-
|
|
536
|
-
#### Returns
|
|
537
|
-
|
|
538
|
-
[`PersistentConstructor`](../modules.md#persistentconstructor)
|
|
539
|
-
|
|
540
|
-
the constructor of the class
|
|
541
|
-
|
|
542
|
-
#### Inherited from
|
|
543
|
-
|
|
544
|
-
[Persistent](Persistent.md).[classFactory](Persistent.md#classfactory)
|
|
545
|
-
|
|
546
|
-
#### Defined in
|
|
547
|
-
|
|
548
|
-
[persistent/persistent.ts:76](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/persistent/persistent.ts#L76)
|
|
549
|
-
|
|
550
|
-
___
|
|
551
|
-
|
|
552
|
-
### classesExtending
|
|
553
|
-
|
|
554
|
-
▸ `Static` **classesExtending**(`derivedFrom`): `string`[]
|
|
555
|
-
|
|
556
|
-
Returns the names of all registered classes that extend a given class
|
|
557
|
-
|
|
558
|
-
**`See`**
|
|
559
|
-
|
|
560
|
-
- registerFactory
|
|
561
|
-
- classFactory
|
|
562
|
-
|
|
563
|
-
#### Parameters
|
|
564
|
-
|
|
565
|
-
| Name | Type | Description |
|
|
566
|
-
| :------ | :------ | :------ |
|
|
567
|
-
| `derivedFrom` | `Function` \| [`PersistentConstructor`](../modules.md#persistentconstructor) | the class to be extended |
|
|
568
|
-
|
|
569
|
-
#### Returns
|
|
570
|
-
|
|
571
|
-
`string`[]
|
|
572
|
-
|
|
573
|
-
the names of all registered classes that extend the given class
|
|
574
|
-
|
|
575
|
-
#### Inherited from
|
|
576
|
-
|
|
577
|
-
[Persistent](Persistent.md).[classesExtending](Persistent.md#classesextending)
|
|
578
|
-
|
|
579
|
-
#### Defined in
|
|
580
|
-
|
|
581
|
-
[persistent/persistent.ts:98](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/persistent/persistent.ts#L98)
|
|
582
|
-
|
|
583
|
-
___
|
|
584
|
-
|
|
585
|
-
### createInstance
|
|
586
|
-
|
|
587
|
-
▸ `Static` **createInstance**<`T`\>(`obj`): `T`
|
|
588
|
-
|
|
589
|
-
#### Type parameters
|
|
590
|
-
|
|
591
|
-
| Name | Type |
|
|
592
|
-
| :------ | :------ |
|
|
593
|
-
| `T` | extends [`Persistent`](Persistent.md)<`T`\> |
|
|
594
|
-
|
|
595
|
-
#### Parameters
|
|
596
|
-
|
|
597
|
-
| Name | Type |
|
|
598
|
-
| :------ | :------ |
|
|
599
|
-
| `obj` | `string` \| [`PersistentObject`](../modules.md#persistentobject)<`T`\> |
|
|
600
|
-
|
|
601
|
-
#### Returns
|
|
602
|
-
|
|
603
|
-
`T`
|
|
604
|
-
|
|
605
|
-
#### Inherited from
|
|
606
|
-
|
|
607
|
-
[Persistent](Persistent.md).[createInstance](Persistent.md#createinstance)
|
|
608
|
-
|
|
609
|
-
#### Defined in
|
|
610
|
-
|
|
611
|
-
[persistent/persistent.ts:384](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/persistent/persistent.ts#L384)
|
|
612
|
-
|
|
613
|
-
___
|
|
614
|
-
|
|
615
|
-
### registerFactory
|
|
616
|
-
|
|
617
|
-
▸ `Static` **registerFactory**(`className`, `factory`, `annotation?`): `void`
|
|
618
|
-
|
|
619
|
-
Registers a class to be used by the persistence engine.
|
|
620
|
-
|
|
621
|
-
#### Parameters
|
|
622
|
-
|
|
623
|
-
| Name | Type | Description |
|
|
624
|
-
| :------ | :------ | :------ |
|
|
625
|
-
| `className` | `string` | the name of the class to be registered |
|
|
626
|
-
| `factory` | [`PersistentConstructor`](../modules.md#persistentconstructor) | the constructor of the registered class |
|
|
627
|
-
| `annotation?` | `unknown` | an annotation associated with the class |
|
|
628
|
-
|
|
629
|
-
#### Returns
|
|
630
|
-
|
|
631
|
-
`void`
|
|
632
|
-
|
|
633
|
-
#### Inherited from
|
|
634
|
-
|
|
635
|
-
[Persistent](Persistent.md).[registerFactory](Persistent.md#registerfactory)
|
|
636
|
-
|
|
637
|
-
#### Defined in
|
|
638
|
-
|
|
639
|
-
[persistent/persistent.ts:62](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/persistent/persistent.ts#L62)
|
|
640
|
-
|
|
641
|
-
___
|
|
642
|
-
|
|
643
|
-
### registeredClasses
|
|
644
|
-
|
|
645
|
-
▸ `Static` **registeredClasses**(): `string`[]
|
|
646
|
-
|
|
647
|
-
Returns the names of all registered classes
|
|
648
|
-
|
|
649
|
-
**`See`**
|
|
650
|
-
|
|
651
|
-
- registerFactory
|
|
652
|
-
- classFactory
|
|
653
|
-
|
|
654
|
-
#### Returns
|
|
655
|
-
|
|
656
|
-
`string`[]
|
|
657
|
-
|
|
658
|
-
the names of all registered classes
|
|
659
|
-
|
|
660
|
-
#### Inherited from
|
|
661
|
-
|
|
662
|
-
[Persistent](Persistent.md).[registeredClasses](Persistent.md#registeredclasses)
|
|
663
|
-
|
|
664
|
-
#### Defined in
|
|
665
|
-
|
|
666
|
-
[persistent/persistent.ts:87](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/persistent/persistent.ts#L87)
|