EntityFactory
Index
Constructors
Methods
Constructors
constructor
Parameters
Returns EntityFactory
Methods
create
Parameters
entityName: EntityName<T>
data: EntityData<T>
options: FactoryOptions = {}
Returns New<T, P>
createEmbeddable
Parameters
entityName: EntityName<T>
data: EntityData<T>
options: Pick<FactoryOptions, convertCustomTypes | newEntity> = {}
Returns T
createReference
Parameters
entityName: EntityName<T>
id: (T extends { [PrimaryKeyProp]?: PK } ? PK extends keyof T<T> ? ReadonlyPrimary<UnwrapPrimary<T<T>[PK<PK>]>> : PK extends keyof T<T>[] ? ReadonlyPrimary<PrimaryPropToType<T<T>, PK<PK>>> : PK : T extends { _id?: PK } ? string | ReadonlyPrimary<PK> : T extends { uuid?: PK } ? ReadonlyPrimary<PK> : T extends { id?: PK } ? ReadonlyPrimary<PK> : T) | (T extends { [PrimaryKeyProp]?: PK } ? PK extends keyof T<T> ? ReadonlyPrimary<UnwrapPrimary<T<T>[PK<PK>]>> : PK extends keyof T<T>[] ? ReadonlyPrimary<PrimaryPropToType<T<T>, PK<PK>>> : PK : T extends { _id?: PK } ? string | ReadonlyPrimary<PK> : T extends { uuid?: PK } ? ReadonlyPrimary<PK> : T extends { id?: PK } ? ReadonlyPrimary<PK> : T)[] | Record<string, T extends { [PrimaryKeyProp]?: PK } ? PK extends keyof T<T> ? ReadonlyPrimary<UnwrapPrimary<T<T>[PK<PK>]>> : PK extends keyof T<T>[] ? ReadonlyPrimary<PrimaryPropToType<T<T>, PK<PK>>> : PK : T extends { _id?: PK } ? string | ReadonlyPrimary<PK> : T extends { uuid?: PK } ? ReadonlyPrimary<PK> : T extends { id?: PK } ? ReadonlyPrimary<PK> : T>
options: Pick<FactoryOptions, schema | convertCustomTypes | merge> = {}
Returns T
getComparator
Returns EntityComparator
mergeData
Parameters
meta: EntityMetadata<T>
entity: T
data: EntityData<T>
options: FactoryOptions = {}
Returns void