I have two types:
type TypeLetter = "TypeA" | "TypeB"
type TypeNumber = "Type1" | "Type2"
I want to limit the ways I can combine values from these types so that only TypeA and Type1 can be together and only TypeB and Type2 can be together.
How can I create a type Restricted to make such a thing happen? In other words, where these are valid:
const valid1: Restricted = {
valLetter: "TypeA"
valNumber: "Type1"
}
const valid2: Restricted = {
valLetter: "TypeB"
valNumber: "Type2"
}
But this is not:
const nope: Restricted = {
valLetter: "TypeB"
valNumber: "Type1"
}