entropic-bond 1.49.0 → 1.50.0

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.
Files changed (141) hide show
  1. package/.github/workflows/release.yml +26 -0
  2. package/CHANGELOG.md +1151 -0
  3. package/docs/.nojekyll +1 -0
  4. package/docs/README.md +94 -0
  5. package/docs/classes/Auth.md +391 -0
  6. package/docs/classes/AuthMock.md +278 -0
  7. package/docs/classes/AuthService.md +188 -0
  8. package/docs/classes/CloudFunctions.md +123 -0
  9. package/docs/classes/CloudFunctionsMock.md +97 -0
  10. package/docs/classes/CloudStorage.md +215 -0
  11. package/docs/classes/DataSource.md +248 -0
  12. package/docs/classes/EntropicComponent.md +666 -0
  13. package/docs/classes/JsonDataSource.md +328 -0
  14. package/docs/classes/MockCloudStorage.md +279 -0
  15. package/docs/classes/Model.md +274 -0
  16. package/docs/classes/Observable.md +120 -0
  17. package/docs/classes/Persistent.md +420 -0
  18. package/docs/classes/ServerAuth.md +211 -0
  19. package/docs/classes/ServerAuthMock.md +176 -0
  20. package/docs/classes/ServerAuthService.md +130 -0
  21. package/docs/classes/Store.md +218 -0
  22. package/docs/classes/StoredFile.md +636 -0
  23. package/docs/enums/StoredFileEvent.md +41 -0
  24. package/docs/interfaces/AuthError.md +30 -0
  25. package/docs/interfaces/CloudFunctionsService.md +69 -0
  26. package/docs/interfaces/Collection.md +13 -0
  27. package/docs/interfaces/CustomCredentials.md +7 -0
  28. package/docs/interfaces/DocumentReference.md +49 -0
  29. package/docs/interfaces/JsonRawData.md +7 -0
  30. package/docs/interfaces/SignData.md +63 -0
  31. package/docs/interfaces/StoreParams.md +52 -0
  32. package/docs/interfaces/StoredFileChange.md +41 -0
  33. package/docs/interfaces/UploadControl.md +90 -0
  34. package/docs/interfaces/UserCredentials.md +113 -0
  35. package/docs/interfaces/Values.md +17 -0
  36. package/docs/modules.md +1273 -0
  37. package/package.json +23 -19
  38. package/src/auth/auth-mock.spec.ts +168 -0
  39. package/src/auth/auth-mock.ts +129 -0
  40. package/src/auth/auth.ts +185 -0
  41. package/src/auth/user-auth-types.ts +21 -0
  42. package/src/cloud-functions/cloud-functions-mock.spec.ts +136 -0
  43. package/src/cloud-functions/cloud-functions-mock.ts +23 -0
  44. package/src/cloud-functions/cloud-functions.ts +83 -0
  45. package/src/cloud-storage/cloud-storage.spec.ts +207 -0
  46. package/src/cloud-storage/cloud-storage.ts +60 -0
  47. package/src/cloud-storage/mock-cloud-storage.ts +72 -0
  48. package/src/cloud-storage/stored-file.ts +102 -0
  49. package/src/index.ts +19 -0
  50. package/src/observable/observable.spec.ts +105 -0
  51. package/src/observable/observable.ts +67 -0
  52. package/src/persistent/entropic-component.spec.ts +143 -0
  53. package/src/persistent/entropic-component.ts +135 -0
  54. package/src/persistent/persistent.spec.ts +828 -0
  55. package/src/persistent/persistent.ts +650 -0
  56. package/src/server-auth/server-auth-mock.spec.ts +53 -0
  57. package/src/server-auth/server-auth-mock.ts +45 -0
  58. package/src/server-auth/server-auth.ts +49 -0
  59. package/src/store/data-source.ts +186 -0
  60. package/src/store/json-data-source.spec.ts +100 -0
  61. package/src/store/json-data-source.ts +256 -0
  62. package/src/store/mocks/mock-data.json +155 -0
  63. package/src/store/mocks/test-user.ts +122 -0
  64. package/src/store/model.spec.ts +659 -0
  65. package/src/store/model.ts +462 -0
  66. package/src/store/store.spec.ts +30 -0
  67. package/src/store/store.ts +113 -0
  68. package/src/types/utility-types.spec.ts +117 -0
  69. package/src/types/utility-types.ts +116 -0
  70. package/src/utils/test-utils/test-person.ts +44 -0
  71. package/src/utils/utils.spec.ts +95 -0
  72. package/{lib/utils/utils.d.ts → src/utils/utils.ts} +34 -10
  73. package/tsconfig-build.json +7 -0
  74. package/tsconfig-cjs.json +9 -0
  75. package/tsconfig.json +33 -0
  76. package/vite.config.ts +22 -0
  77. package/lib/auth/auth-mock.d.ts +0 -22
  78. package/lib/auth/auth-mock.js +0 -111
  79. package/lib/auth/auth-mock.js.map +0 -1
  80. package/lib/auth/auth.d.ts +0 -131
  81. package/lib/auth/auth.js +0 -149
  82. package/lib/auth/auth.js.map +0 -1
  83. package/lib/auth/user-auth-types.d.ts +0 -19
  84. package/lib/auth/user-auth-types.js +0 -3
  85. package/lib/auth/user-auth-types.js.map +0 -1
  86. package/lib/cloud-functions/cloud-functions-mock.d.ts +0 -11
  87. package/lib/cloud-functions/cloud-functions-mock.js +0 -19
  88. package/lib/cloud-functions/cloud-functions-mock.js.map +0 -1
  89. package/lib/cloud-functions/cloud-functions.d.ts +0 -19
  90. package/lib/cloud-functions/cloud-functions.js +0 -64
  91. package/lib/cloud-functions/cloud-functions.js.map +0 -1
  92. package/lib/cloud-storage/cloud-storage.d.ts +0 -24
  93. package/lib/cloud-storage/cloud-storage.js +0 -37
  94. package/lib/cloud-storage/cloud-storage.js.map +0 -1
  95. package/lib/cloud-storage/mock-cloud-storage.d.ts +0 -20
  96. package/lib/cloud-storage/mock-cloud-storage.js +0 -68
  97. package/lib/cloud-storage/mock-cloud-storage.js.map +0 -1
  98. package/lib/cloud-storage/stored-file.d.ts +0 -39
  99. package/lib/cloud-storage/stored-file.js +0 -106
  100. package/lib/cloud-storage/stored-file.js.map +0 -1
  101. package/lib/index.d.ts +0 -19
  102. package/lib/index.js +0 -36
  103. package/lib/index.js.map +0 -1
  104. package/lib/observable/observable.d.ts +0 -52
  105. package/lib/observable/observable.js +0 -66
  106. package/lib/observable/observable.js.map +0 -1
  107. package/lib/persistent/entropic-component.d.ts +0 -76
  108. package/lib/persistent/entropic-component.js +0 -109
  109. package/lib/persistent/entropic-component.js.map +0 -1
  110. package/lib/persistent/persistent.d.ts +0 -281
  111. package/lib/persistent/persistent.js +0 -539
  112. package/lib/persistent/persistent.js.map +0 -1
  113. package/lib/server-auth/server-auth-mock.d.ts +0 -12
  114. package/lib/server-auth/server-auth-mock.js +0 -39
  115. package/lib/server-auth/server-auth-mock.js.map +0 -1
  116. package/lib/server-auth/server-auth.d.ts +0 -24
  117. package/lib/server-auth/server-auth.js +0 -36
  118. package/lib/server-auth/server-auth.js.map +0 -1
  119. package/lib/store/data-source.d.ts +0 -137
  120. package/lib/store/data-source.js +0 -62
  121. package/lib/store/data-source.js.map +0 -1
  122. package/lib/store/json-data-source.d.ts +0 -68
  123. package/lib/store/json-data-source.js +0 -199
  124. package/lib/store/json-data-source.js.map +0 -1
  125. package/lib/store/mocks/test-user.d.ts +0 -49
  126. package/lib/store/mocks/test-user.js +0 -135
  127. package/lib/store/mocks/test-user.js.map +0 -1
  128. package/lib/store/model.d.ts +0 -238
  129. package/lib/store/model.js +0 -417
  130. package/lib/store/model.js.map +0 -1
  131. package/lib/store/store.d.ts +0 -62
  132. package/lib/store/store.js +0 -102
  133. package/lib/store/store.js.map +0 -1
  134. package/lib/types/utility-types.d.ts +0 -45
  135. package/lib/types/utility-types.js +0 -3
  136. package/lib/types/utility-types.js.map +0 -1
  137. package/lib/utils/test-utils/test-person.d.ts +0 -33
  138. package/lib/utils/test-utils/test-person.js +0 -25
  139. package/lib/utils/test-utils/test-person.js.map +0 -1
  140. package/lib/utils/utils.js +0 -76
  141. package/lib/utils/utils.js.map +0 -1
@@ -0,0 +1,666 @@
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)