Dynamic Super Types #11967
Labels
Awaiting More Feedback
This means we'd like to hear from more people who would be helped by this feature
Suggestion
An idea for TypeScript
Now, that #11929 is PR landed. I would really love to have some syntax to specify an arbitrary
super type of T
. This can be especially helpful in creating strongly typed ORM database frameworks.Proposal
If
K
is constrained to be a key ofT
i.eK extends keyof T
. Then the syntax:Means spread the keys
K
and values ofT
in{}
.Example
Here is an example usage of an envisioned ORM framework:
The text was updated successfully, but these errors were encountered: