Hi, I'm relatively new to typescript. I'm having trouble trying to think of a way to force typescript to limit the possible types it accepts for my Node variable from the previously given NodeCategory in the string, and then continue that pattern even further in. Here's the code:
type MagicNodeCategory = 'Celestial' | 'Elemental' | 'Nature' | 'Shadow' | 'Support'
type CelestialNodeCategory = 'Holy' | 'Unholy'
type ElementalNodeCategory = 'Wind' | 'Fire' | 'Water' | 'Earth'
type Node = `${NodeCategory}-${CelestialNodeCategory | ElementalNodeCategory}`
For example, I want Typescript to recognize that 'Celestial-Holy' and 'Celestial-Unholy' are valid options but 'Celestial-Wind' is not.