Documentation / @zerotal/orm / index / WithLoaded
Type Alias: WithLoaded<M, R>
WithLoaded<
M,R> =Omit<M,R> & { [K in R]: M[K] extends ManyToMany<infer T> ? ManyToMany<T> : M[K] extends HasMany<infer T> ? T[] : M[K] extends BelongsTo<infer T> ? T | null : M[K] extends HasOne<infer T> ? T | null : M[K] extends MorphTo<infer T> ? T | null : M[K] extends MorphMany<infer T> ? T[] : M[K] extends MorphOne<infer T> ? T | null : M[K] }
Defined in: packages/orm/src/model/relations/RelationRegistry.ts:168
Narrows the model type M after calling .with(relation).
ManyToMany
Type Parameters
M
M
R
R extends keyof M