Union of all types in another type. Typescript
If you want the union type of all the types of the values in another type in typescript you can use the keyof operator.
type Thing = {
foo: string;
bar: boolean;
}
type ThingTypes = Thing[keyof Thing];
// string | boolean