I\'m trying to create a guaranteed lookup for a given enum. As in, there should be exactly one value in the lookup for every key of the enum. I want to guarantee this throug
enum FunStuff {
PARTY = "party",
CAKE = "cake",
PIZZA = "pizza",
}
So then if you want all of your Enum values to be required
type MapOfFunStuff = {
counts: { [key in FunStuff] : number };
}
Then if you only want values in your enum but any amount of them you can add ?
type MapOfFunStuff = {
counts: { [key in FunStuff]? : number };
}