devtypes - v2.0.0
    Preparing search index...

    Type Alias IfAll<T, Then, Else>

    IfAll: T extends readonly [
        infer H extends boolean,
        ...(infer R extends boolean[]),
    ]
        ? If<H, IfAll<R, Then, Else>, Else>
        : Then

    Conditional type over multiple boolean conditions.

    Type Parameters

    • T extends readonly boolean[]

      Tuple of boolean conditions

    • Then

      Result if all conditions are true

    • Else = never

      Result if any condition is false

    Evaluates to Then if all conditions in the tuple are true. Otherwise resolves to Else.

    Empty tuples evaluate to Then.

    type A = IfAll< [ true, true ], 'ok', 'fail' >;   // 'ok'
    type B = IfAll< [ true, false ], 'ok', 'fail' >; // 'fail'