You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why don't we have generic for the model attributes?
e.g.
interfaceTypedModelAttributes{id: number;optionalData?: object;}classTypedModelextendsModel<TypedModelAttributes>{
...
}// usageTypedModel.build({ ... })// will be type-checked by "TypedModelAttributes"TypedModel.findOne({where: { ... })// will be type-checked by "keyof TypedModelAttributes"
...
It is more accurate and will bring a lot of conveniences than current <K extends keyof this> way.