import type {If} from './if.d.ts'; import type {IsNever} from './is-never.d.ts'; /** Returns a boolean for whether either of two given types are true. Use-case: Constructing complex conditional types where multiple conditions must be satisfied. @example ``` import type {Or} from 'type-fest'; type TT = Or; //=> true type TF = Or; //=> true type FT = Or; //=> true type FF = Or; //=> false ``` Note: When `boolean` is passed as an argument, it is distributed into separate cases, and the final result is a union of those cases. For example, `And` expands to `And | And`, which simplifies to `true | false` (i.e., `boolean`). @example ``` import type {And} from 'type-fest'; type A = Or; //=> boolean type B = Or; //=> boolean type C = Or; //=> true type D = Or; //=> true type E = Or; //=> boolean ``` Note: If `never` is passed as an argument, it is treated as `false` and the result is computed accordingly. @example ``` import type {Or} from 'type-fest'; type A = Or; //=> true type B = Or; //=> true type C = Or; //=> false type D = Or; //=> false type E = Or; //=> boolean type F = Or; //=> boolean type G = Or; //=> false ``` @see {@link And} */ export type Or = _Or, false, A>, If, false, B>>; // `never` is treated as `false` export type _Or = A extends true ? true : B extends true ? true : false; export {};