Libraries
    Preparing search index...

    Type Alias WithRelation<TSchema, TRels, TKey, TKind, TForeign, TVariantUnion>

    WithRelation: Entity<
        TSchema,
        TRels & Record<TKey, RelationInfo<TKind, TForeign>>,
        TVariantUnion,
    >

    Return type for an Entity method that adds a relation: keeps TSchema, extends TRels with one more entry, and preserves TVariantUnion.

    Type Parameters

    • TSchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
    • TRels extends Record<string, RelationInfo>
    • TKey extends string
    • TKind extends "belongsTo" | "hasOne" | "hasMany" | "belongsToMany"
    • TForeign extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
    • TVariantUnion = never