I want to make a list or array from all possible variants of a custom type.
Ex. The custom type:
export type FruitType= 'Apple' | 'Orange' | 'Strawberry' | 'Banana';
Wanted result:
const FruitArray = ['Apple', 'Orange', 'Strawberry', 'Banana']
Is this achievable or is hardcoding the list the only way?
I'm working in React with typescript