export type Not = Value extends true ? false : true; export type And = First extends true ? Second : false; export type Or = First extends true ? true : Second; export type Unless = Condition extends true ? ElseValue : ThenValue; export type AndUnless = Condition extends true ? ElseValue : ThenValue; // Whether any of T's union element is the same as one of U's union element. // `&` does not work here. export type Intersects = true extends (T extends U ? true : false) ? true : false;