UNPKG

582 BTypeScriptView Raw
1import { Boolean } from './_Internal';
2/**
3 * Logical `&&` operator (behaves like the JS one)
4 * @param B1 Left-hand side
5 * @param B2 Right-hand side
6 * @returns [[Boolean]]
7 * @example
8 * ```ts
9 * import {B} from 'ts-toolbelt'
10 *
11 * type test0 = B.And<B.True, B.False> // False
12 * type test1 = B.And<B.True, B.True> // True
13 * type test2 = B.And<B.True | B.False, B.True> // Boolean
14 * ```
15 */
16export declare type And<B1 extends Boolean, B2 extends Boolean> = {
17 0: {
18 0: 0;
19 1: 0;
20 };
21 1: {
22 0: 0;
23 1: 1;
24 };
25}[B1][B2];