Say I have the following two types:
type OrganizationType = 'NGO' | 'Business';
type Organization = {
name: string,
type: OrganizationType,
weekdaysOpen: string[],
};
How can I define weekdaysOpen such that its elements are restricted to any (or none) of some predefined values? In this case they would be:
// Allowed elements in weekdaysOpen
'mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun'
Bonus if each allowed value can only appear once.