devtypes - v2.0.0
    Preparing search index...

    Type Alias If<Cond, Then, Else>

    If: Cond extends true ? Then : Else

    Conditional type helper.

    Type Parameters

    • Cond extends boolean

      Boolean condition to evaluate

    • Then

      Type returned if the condition is true

    • Else = never

      Type returned if the condition is false (defaults to never)

    Evaluates a boolean condition at the type level and resolves to one of two branches.

    type Result = If< true, string, number >;  // string