@statezero/core
Version:
The type-safe frontend client for StateZero - connect directly to your backend models with zero boilerplate
19 lines (18 loc) • 1.07 kB
TypeScript
/**
* Adapts a model instance to a Vue reactive object by directly wrapping
* the instance and incrementing an internal version on relevant events.
*
* @param {Object} modelInstance - An instance of a model class with static modelName and primaryKeyField
* @param {Function} [reactivityFn=reactive] - Which Vue reactivity function to use (reactive or ref)
* @returns {import('vue').Reactive|import('vue').Ref} The reactive model instance, augmented with __version
*/
export function ModelAdaptor(modelInstance: Object, reactivityFn?: Function): any | import("vue").Ref;
/**
* Adapts a queryset to a Vue reactive object and sets up event handling for queryset updates
*
* @param {Object} liveQuerySet - A LiveQueryset instance
* @param {Function} [reactivityFn=reactive] - Which Vue reactivity function to use (reactive or ref)
* @returns {import('vue').Reactive|import('vue').Ref} The reactive queryset
*/
export function QuerySetAdaptor(liveQuerySet: Object, reactivityFn?: Function): any | import("vue").Ref;
export function MetricAdaptor(metric: any): any;