I have two categories, the first one being an enum:
enum Vehicle {
Car = 'car',
Plane = 'plane',
}
The second category is a regular object that utilizes the enum as keys:
type VehicleProperties = {
[Vehicle.Car]: { amountOfWheels: number };
[Vehicle.Plane]: { amountOfWings: number };
}
How can I create a type VehicleConfig
that combines both and meets the following requirements:
const vehicle: VehicleConfig = {
type: Vehicle.Car,
properties: {
amountOfWheels: 4,
}
}