import { isType } from '../internals'; import { isNever } from '../never/infrastructure'; /** * Evaluates if the specified type is a boolean. * * @example * type A = isBoolean; * // ^? true * type B = isBoolean; * // ^? false * type C = isBoolean; * // ^? true */ export type isBoolean = isType; /** * Evaluates if the specified type is a `true`. */ export type isTrue = isType; /** * Evaluates if the specified type is `false`. */ export type isFalse = isType; /** * Performs a logical AND operation on a tuple of boolean values. * It returns true only when all values in the tuple are true. * * @example * type A = And<[true, true, true]>; * // ^? true * type B = And<[true, false, true]>; * // ^? false */ export type And> = isNever>; /** * Performs a logical OR operation on a tuple of boolean values. * It returns true if at least one value in the tuple is true. * * @example * type A = Or<[false, false, true]>; * // ^? true * type B = Or<[false, false, false]>; * // ^? false */ export type Or> = not>>; /** * Performs a logical NOT operation on a boolean value conditionally. * * @example * type A = Xor; * // ^? false * type B = Xor; * // ^? true * type C = Xor; * // ^? true * type D = Xor; * // ^? falses */ export type Xor = $if; else: T; }>; declare global { /** * @rt_keyword * * Performs a logical NOT operation on a boolean value. * It returns the opposite boolean value of the input. * * @example * type A = not; * // ^? false * type B = not; * // ^? true */ type not = [T] extends [false] ? true : false; }