This is the enum:
enum PossibleValues {
A = 'A',
B = 'B',
C = 'C'
}
And this is the type that uses the enum for one of the fields:
export interface MyInterface {
name: string;
age: number;
value: PossibleValues;
}
I was assuming that in this case, for value it should only accept the values from enum (A, B or C) but I can put there other values and it works fine.
Is there a way to restrict the possible values to the ones from enum?