/** * Negates a boolean type. * * @template T - The boolean type to negate. */ export type NOT = T extends false ? true : false; /** * Represents the exclusive OR (XOR) operation on boolean types. * If `T` is `false`, returns true if `U` is `true`, otherwise returns `false`. * If `T` is `true`, returns true if `U` is `false`, otherwise returns `false`. * * @template T - The first boolean type. * @template U - The second boolean type. */ export type XOR = T extends false ? (U extends false ? false : true) : (U extends false ? true : false); /** * Represents the logical AND operation between two boolean types. * If `T` is `false`, the result is always `false`. Otherwise, the result is `U`. * * @template T - The first boolean type. * @template U - The second boolean type. */ export type AND = T extends false ? false : U; /** * Represents the NAND (Not-AND) type. * It takes two boolean types `T` and `U` as input and returns the negation of their logical AND operation. * * @template T - The first boolean type. * @template U - The second boolean type. */ export type NAND = NOT>; /** * Represents a type that performs a logical OR operation on two boolean types. * If the first type is `false`, the result is the second type. Otherwise, the result is `true`. * * @template T - The first boolean type. * @template U - The second boolean type. */ export type OR = T extends false ? U : true; /** * Represents the logical NOR (Not-OR) operation on two boolean types. * It returns `true` if both input types are `false`, otherwise it returns `false`. * * @template T - The first boolean type. * @template U - The second boolean type. * @returns The result of the NOR operation. */ export type NOR = NOT>;