Is it possible to retrieve the opposite of a specified custom type within a variable using Typescript?
For example, if I define a type like this:
type Result = 'table' | 'grid';
Then any variable with the type Result can only be assigned either 'table' or 'grid'.
Is there a way to access the opposite value of 'table', such as 'grid'? Similar to how negation is used with booleans, for instance:
let a = false;
// a is false
a = !a;
// a is true
I'm not looking for the exact same syntax, but rather a similar concept of retrieving the opposite of a specific custom type?