I know that the following works:
interface Travel {
travelClass: 'economy' | 'business' | 'first';
username?: String;
}
Now, I want to extract the travelClass so that I can reuse it at other places, something like this:-
type TravelClass 'economy' | 'business' | 'first'
However, it is not compiling.
>Solution :
type requires the use of a =.
type TravelClass = 'economy' | 'business' | 'first'