TypeScript type using Record utility

37 Views Asked by At
    // OLD
    interface IData {
      missions: Missions
      items: Items
    }
    
    // Something new now
    type Keys = "missions" | "items"
    
    type INewDataType = Record<Keys, Missions | Items>

It won't work because in INewDataType type, items or missions can both have Missions or Items.

0

There are 0 best solutions below