type Cartoon = { kind: 'cat', name: 'Tom'} | { kind: 'mouse', name: 'Jerry' }
type Animal = 'cat' | 'mouse' // I am trying to figure out how to create the type Animal based on the values of kind in Cartoon.
Here I have a Cartoon union type with types that all have a "kind" key. My goal is to generate a new type called Animal that includes a union of all the values assigned to kind in Cartoon.
Your assistance will be greatly appreciated!