entropic-bond 1.51.1 → 1.51.3
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.
|
@@ -189,7 +189,7 @@ export interface PersistentProperty {
|
|
|
189
189
|
isPureReference?: boolean;
|
|
190
190
|
storeInCollection?: string | CollectionPathCallback;
|
|
191
191
|
subCollection?: string;
|
|
192
|
-
|
|
192
|
+
cachedProps?: ClassPropNames<Persistent>[];
|
|
193
193
|
toObjectSpecial?: (classObj: any) => any;
|
|
194
194
|
fromObjectSpecial?: (obj: any) => any;
|
|
195
195
|
searchableArray?: boolean;
|
|
@@ -215,12 +215,12 @@ export declare function persistentReferenceAt(collectionPath: string | Collectio
|
|
|
215
215
|
export declare function persistentReference(target: Persistent, property: string): void;
|
|
216
216
|
/**
|
|
217
217
|
* Decorator to declare a persistent reference (see @persistentReference) that stores
|
|
218
|
-
* the values in
|
|
218
|
+
* the values in cachedProps as values in the reference object. This is useful
|
|
219
219
|
* when you are not able to wait for population of referenced properties.
|
|
220
|
-
* @param
|
|
220
|
+
* @param cachedProps the properties whose values should be stored in the reference object
|
|
221
221
|
* @param storedInCollection indicates the path of the collection where this reference is stored
|
|
222
222
|
*/
|
|
223
|
-
export declare function
|
|
223
|
+
export declare function persistentReferenceWithCachedProps<T extends Persistent>(cachedProps: ClassPropNames<T>[], storeInCollection?: string | CollectionPathCallback): (target: Persistent, property: string) => void;
|
|
224
224
|
/**
|
|
225
225
|
* Decorator for a property that is a reference to a persistent object.
|
|
226
226
|
* In this case, and contrary to the @persistentReference decorator, the reference
|
|
@@ -231,20 +231,20 @@ export declare function persistentReferenceWithPersistentProps<T extends Persist
|
|
|
231
231
|
export declare function persistentPureReference(target: Persistent, property: string, storeInCollection?: string | CollectionPathCallback): void;
|
|
232
232
|
/**
|
|
233
233
|
* Decorator to declare a persistent property as a pure reference (see @persistentPureReference) that stores
|
|
234
|
-
* the values of the properties listed in
|
|
234
|
+
* the values of the properties listed in cachedProps as values in the reference object. This is useful
|
|
235
235
|
* when you only need a few properties to be available without needing to populate the referenced property.
|
|
236
|
-
* @param
|
|
236
|
+
* @param cachedProps the properties whose values should be stored in the reference object
|
|
237
237
|
* @param storedInCollection indicates the path of the collection where this reference is stored
|
|
238
|
-
* @see
|
|
238
|
+
* @see persistentReferenceWithCachedProps
|
|
239
239
|
* @see persistentPureReference
|
|
240
240
|
* @sample
|
|
241
241
|
* class User extends Persistent {
|
|
242
|
-
* @
|
|
242
|
+
* @persistentPureReferenceWithCachedProps( ['name', 'email'] ) private _friend: User
|
|
243
243
|
* }
|
|
244
244
|
* // the reference object will contain the properties name and email of the referenced user
|
|
245
245
|
* // without having to populate the _friend property
|
|
246
246
|
*/
|
|
247
|
-
export declare function
|
|
247
|
+
export declare function persistentPureReferenceWithCachedProps<T extends Persistent>(cachedProps: ClassPropNames<T>[], storeInCollection?: string | CollectionPathCallback): (target: Persistent, property: string) => void;
|
|
248
248
|
export declare function persistentParser(options?: Partial<PersistentProperty>): (target: Persistent, property: string) => void;
|
|
249
249
|
/**
|
|
250
250
|
* Decorator to register a persistent class. Entropic Bond needs that you register
|
|
@@ -61,7 +61,7 @@ interface DocumentChange {
|
|
|
61
61
|
export type DocumentChangeListerner = (change: DocumentChange) => void;
|
|
62
62
|
export interface DocumentChangeListernerHandler {
|
|
63
63
|
uninstall: DocumentListenerUninstaller;
|
|
64
|
-
|
|
64
|
+
nativeHandler: unknown;
|
|
65
65
|
}
|
|
66
66
|
/**
|
|
67
67
|
* The data source interface.
|
|
@@ -71,7 +71,7 @@ export interface DocumentChangeListernerHandler {
|
|
|
71
71
|
* A data source is used by the store to retrieve and save data.
|
|
72
72
|
*/
|
|
73
73
|
export declare abstract class DataSource {
|
|
74
|
-
|
|
74
|
+
installCachedPropsUpdaters(onUpdate?: (doc: Persistent) => void, throwOnNonImplementedListener?: boolean): DocumentChangeListernerHandler[];
|
|
75
75
|
/**
|
|
76
76
|
* Installs a document change listener
|
|
77
77
|
* Implement the required logic to install a listener that will be called
|