RepositoryStorageClassMixIn
Function: RepositoryStorageClassMixIn()
RepositoryStorageClassMixIn<
TBase>(Base): {new (...args):(Anonymous class)<TBase>;prototype:(Anonymous class)<any>;aggregate<T,G,M>(this,spec,params?):Promise<AggregationResult<AggregatedRow<InstanceType<T>,G,M>>>;count<T>(this,filter?,params?,options?):Promise<CountResult>;create<T>(this,data,save):Promise<InstanceType<T>>;getRepository<T>(this):Repository<T>;iterate<T>(this,query,params?):AsyncGenerator<InstanceType<T>,any,any>;iterate<T>(this,filter,options?):AsyncGenerator<InstanceType<T>,any,any>;query<T>(this,query,params?):Promise<{continuationToken?:string;results:InstanceType<T>[]; }>;query<T>(this,filter,options?):Promise<{continuationToken?:string;results:InstanceType<T>[]; }>;ref<T>(this,key):ModelRefWithCreate<InstanceType<T>>; } &TBase
Defined in: packages/models/src/repositories/hooks.ts:51
MixIn that adds static repository methods (create, query, iterate, ref, getRepository) to a base class, enabling Model classes to access their repository directly.
Type Parameters
TBase
TBase extends new (...args) => object
Parameters
Base
TBase
The base class to augment
Returns
{new (...args): (Anonymous class)<TBase>; prototype: (Anonymous class)<any>; aggregate<T, G, M>(this, spec, params?): Promise<AggregationResult<AggregatedRow<InstanceType<T>, G, M>>>; count<T>(this, filter?, params?, options?): Promise<CountResult>; create<T>(this, data, save): Promise<InstanceType<T>>; getRepository<T>(this): Repository<T>; iterate<T>(this, query, params?): AsyncGenerator<InstanceType<T>, any, any>; iterate<T>(this, filter, options?): AsyncGenerator<InstanceType<T>, any, any>; query<T>(this, query, params?): Promise<{ continuationToken?: string; results: InstanceType<T>[]; }>; query<T>(this, filter, options?): Promise<{ continuationToken?: string; results: InstanceType<T>[]; }>; ref<T>(this, key): ModelRefWithCreate<InstanceType<T>>; } & TBase
the augmented class with repository methods