EntityFactory
Index
Constructors
Methods
Constructors
constructor
Parameters
Returns EntityFactory
Methods
create
Type parameters
- T: object
- P: string = string
Parameters
entityName: EntityName<T>
data: EntityData<T>
options: FactoryOptions = {}
Returns New<T, P>
createEmbeddable
Type parameters
- T: object
Parameters
entityName: EntityName<T>
data: EntityData<T>
options: Pick<FactoryOptions, convertCustomTypes | newEntity> = {}
Returns T
createReference
Type parameters
- T: object
Parameters
entityName: EntityName<T>
id: (T extends { [PrimaryKeyProp]?: PK } ? PK extends keyof T ? ReadonlyPrimary<UnwrapPrimary<T[PK]>> : PK extends keyof T[] ? ReadonlyPrimary<PrimaryPropToType<T, 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 ? ReadonlyPrimary<UnwrapPrimary<T[PK]>> : PK extends keyof T[] ? ReadonlyPrimary<PrimaryPropToType<T, 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 ? ReadonlyPrimary<UnwrapPrimary<T[PK]>> : PK extends keyof T[] ? ReadonlyPrimary<PrimaryPropToType<T, 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
Type parameters
- T: object
Parameters
meta: EntityMetadata<T>
entity: T
data: EntityData<T>
options: FactoryOptions = {}
Returns void