You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
type num = VALUE.ZERO | VALUE.ONE | VALUE.TWO;
const number0: num = 0;
const number1: num = 1;
const number2: num = 2;
const number3: num = 3; // Success??
Examples
How do I define a type constraint in my enumeration value?
enum VALUE {
ZERO,
ONE,
TWO,
}
type KEY = keyof typeof VALUE; // "ZERO" | "ONE" | "TWO"