Assume I have two types:
type Season = 'WINTER' | 'SUMMER';
type Activity = 'SKIING' | 'SNOWBOARDING' | 'SWIMMING' | 'SUNBATHING'
and also
seasonActivities: Record<Season, Activity []> = {
WINTER = ['SKIING', 'SNOWBOARDING'],
SUMMER = [ 'SWIMMING', 'SUNBATHING']
}
Is there any way of using the type system to guarantee that seasonActivities
contains all possible values of Activity
?
Is there any way of using the type system to guarantee that seasonActivities
does not contain duplicate values of Activity
?