Consider:
enum allowedValues {'x','y'}
export interface X {
evaluation: string[]; // TODO: how to constrain to contain only the values 'x' or 'y';
}
I tried declaring evaluation as the enum: evaluation: shownEvaluation[];
I also tried evaluation: keyof allowedValues;
Is it possible to constrain the values of an array with Typescript to a given subset of string values?