I have a type IconName that looks like this:
type IconName = 'cars' | 'mars' | 'truck' | 'warning'
I want then to create another type VehicleIconName which contains all icons name related to a vehicle:
type VehicleIconName = 'cars' | 'truck'
But how can I tell to TypeScript that each strings in VehicleIconName have to be of type IconName too?
So that I couldn't write this:
type VehicleIconName = 'cars' | 'truck' | 'invalidIconName'