1

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";
wyz
  • 21
  • 3

0 Answers0