Suggestion
Given a union type:
type X = ["a", number] | ["b", string] | ["c"]
It would be nice to have a mapping from the first element in the tuple to the tuple type. I think a common sense way to do this would be to generate a map using the key in syntax:
type Y = {
[T[0] in X]: T
}
However, that doesn't work. I think this could be very powerful for unions of objects as well rather than having to hardcode the relationship yourself.
Checklist
My suggestion meets these guidelines:
Suggestion
Given a union type:
It would be nice to have a mapping from the first element in the tuple to the tuple type. I think a common sense way to do this would be to generate a map using the
key insyntax:However, that doesn't work. I think this could be very powerful for unions of objects as well rather than having to hardcode the relationship yourself.
Checklist
My suggestion meets these guidelines: