If there is a type:
type Text1 = "a" | "b";
So, how to define a string that not in Text1
? Similar to the following:
type Text2 = Exclude<string, Text1>;
// I hope to get an error here, but not
const a: Text2 = "a";
If there is a type:
type Text1 = "a" | "b";
So, how to define a string that not in Text1
? Similar to the following:
type Text2 = Exclude<string, Text1>;
// I hope to get an error here, but not
const a: Text2 = "a";