Preview deployment

typealias If

export type If<Value extends boolean, TrueResult, FalseResult = null> = Value extends true ? TrueResult : Value extends false  ? FalseResult  : TrueResult | FalseResult;

Type Parameters

Value extends boolean

TrueResult

optional
FalseResult? = null

Union Members

Value extends true ? TrueResult : Value extends false ? FalseResult : TrueResult | FalseResult