ForeignKey<T>: T extends null | undefined
    ? T
    : T & {
        [ForeignKeyBrand]?: true;
    }

This is a Branded Type. You can use it to tag fields from your class that are foreign keys. They will become optional in Model.init (as foreign keys are added by association methods, like Model.hasMany.

Type Parameters

  • T