I have a Typescript enum...
enum Animals {
CAT = 'cat',
DOG = 'dog',
FISH = 'fish'
}
I have a function who's parameter can be one of the values of the enum. How do I type that??
function getAnimal (param: ValueOf<Animal>) {
return 'Your animal is a ' + param;
}
The goal is for me to be able to export this function elsewhere in my code, and get the intellisense to say that param can be 'cat'|'dog'|'fish'