Let's kick things off by delving into an illustrative example:
enum Season {
Spring,
Summer,
Autumn,
Winter
}
interface WinterForecast {
season: Season.Winter;
snowfall: number;
}
interface RestOfYearForecast {
season: Season.Spring | Season.Summer | Season.Autumn; // Is there a way to condense this?
rainfall: number;
}
Is there a method to specify the season
in RestOfYearForecast
as "all seasons except Winter" rather than listing each possible value?