entropic-bond 1.52.0 → 1.52.1
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.
|
@@ -229,8 +229,31 @@ export declare function persistentReference(target: Persistent, property: string
|
|
|
229
229
|
* @param storedInCollection indicates the path of the collection where this reference is stored
|
|
230
230
|
* @see persistentReference
|
|
231
231
|
* @see persistentPureReferenceWithCachedProps
|
|
232
|
+
* @sample
|
|
233
|
+
* class User extends Persistent {
|
|
234
|
+
* @persistentReferenceWithCachedProps( ['name', 'email'] ) private _friend: User
|
|
235
|
+
* }
|
|
236
|
+
*/
|
|
237
|
+
export declare function persistentReferenceWithCachedProps<T extends Persistent>(cachedProps: ClassPropNamesOfType<T, Primitive>[], storeInCollection?: string | CollectionPathCallback): (target: Persistent, property: string) => void;
|
|
238
|
+
/**
|
|
239
|
+
* Decorator to declare a persistent reference (see @persistentReference) that stores
|
|
240
|
+
* the values in cachedProps as values in the reference object. If
|
|
241
|
+
* DataSource.installCachedPropsUpdaters has been called, the cached
|
|
242
|
+
* properties are updated in the background when the reference is updates.
|
|
243
|
+
* This is useful
|
|
244
|
+
* when you are not able to wait for population of referenced properties.
|
|
245
|
+
* @param propType The type of the referenced property or an instance of it
|
|
246
|
+
* @param cachedProps the properties whose values should be stored in the reference object
|
|
247
|
+
* @param storeInCollection indicates the path of the collection where this reference is stored
|
|
248
|
+
* @see persistentReference
|
|
249
|
+
* @see persistentPureReferenceWithCachedProps
|
|
250
|
+
* @see DataSource.installCachedPropsUpdaters
|
|
251
|
+
* @sample
|
|
252
|
+
* class User extends Persistent {
|
|
253
|
+
* @persistentReferenceWithUpgradableCachedProps( User, ['name', 'email'] ) private _friend: User
|
|
254
|
+
* }
|
|
232
255
|
*/
|
|
233
|
-
export declare function
|
|
256
|
+
export declare function persistentReferenceWithUpdatableCachedProps<T extends Persistent>(propType: PersistentConstructor<T> | T, cachedProps: ClassPropNamesOfType<T, Primitive>[], storeInCollection?: string | CollectionPathCallback): (target: Persistent, property: string) => void;
|
|
234
257
|
/**
|
|
235
258
|
* Decorator for a property that is a reference to a persistent object.
|
|
236
259
|
* In this case, and contrary to the @persistentReference decorator, the reference
|
|
@@ -254,7 +277,27 @@ export declare function persistentPureReference(target: Persistent, property: st
|
|
|
254
277
|
* // the reference object will contain the properties name and email of the referenced user
|
|
255
278
|
* // without having to populate the _friend property
|
|
256
279
|
*/
|
|
257
|
-
export declare function persistentPureReferenceWithCachedProps<T extends Persistent>(
|
|
280
|
+
export declare function persistentPureReferenceWithCachedProps<T extends Persistent>(cachedProps: ClassPropNamesOfType<T, Primitive>[], storeInCollection?: string | CollectionPathCallback): (target: Persistent, property: string) => void;
|
|
281
|
+
/**
|
|
282
|
+
* Decorator to declare a persistent property as a pure reference
|
|
283
|
+
* (see @persistentPureReference) that stores the values of the properties listed
|
|
284
|
+
* in cachedProps as values in the reference object. If
|
|
285
|
+
* DataSource.installCachedPropsUpdaters has been called, the cached
|
|
286
|
+
* properties are updated in the background when the reference is updates.
|
|
287
|
+
* This is useful when you only need a few properties to be available without
|
|
288
|
+
* needing to populate the referenced property.
|
|
289
|
+
* @param propType The type of the referenced property or an instance of it
|
|
290
|
+
* @param cachedProps the properties whose values should be stored in the reference object
|
|
291
|
+
* @param storedInCollection indicates the path of the collection where this reference is stored
|
|
292
|
+
* @see persistentReferenceWithCachedProps
|
|
293
|
+
* @see persistentPureReference
|
|
294
|
+
* @see DataSource.installCachedPropsUpdaters
|
|
295
|
+
* @sample
|
|
296
|
+
* class User extends Persistent {
|
|
297
|
+
* @persistentPureReferenceWithUpdatableCachedProps( User, ['name', 'email'] ) private _friend: User
|
|
298
|
+
* }
|
|
299
|
+
*/
|
|
300
|
+
export declare function persistentPureReferenceWithUpdatableCachedProps<T extends Persistent>(propType: PersistentConstructor<T> | T, cachedProps: ClassPropNamesOfType<T, Primitive>[], storeInCollection?: string | CollectionPathCallback): (target: Persistent, property: string) => void;
|
|
258
301
|
export declare function persistentParser(options?: Partial<PersistentProperty>): (target: Persistent, property: string) => void;
|
|
259
302
|
/**
|
|
260
303
|
* Decorator to register a persistent class. Entropic Bond needs that you register
|