Type alias If<T, A, B>

If<T, A, B>: T extends true ? A : T extends false ? B : A | B

A type that conditionally selects one of two types based on a boolean value.

Type Parameters

  • T extends boolean

    The boolean value to test.

  • A

    The type to select if T is true.

  • B = null

    The type to select if T is false.

Generated using TypeDoc