Type alias IsNotBoolean<T, $O>

IsNotBoolean<T, $O>: $SpecialType<T, $MergeOptions<$O, {
    $else: IsNotBoolean.$<T, $O>;
    $then: $ResolveBranch<T, $O, [$Then]>;
}>>

🎭 predicate

Validate if T is not boolean.

Type Parameters

Example

type R = IsNotBoolean<boolean> // false
type R = IsNotBoolean<true> // false
type R = IsNotBoolean<false> // false

type R = IsNotBoolean<number> // true
type R = IsNotBoolean<unknown> // true
type R = IsNotBoolean<string | boolean> // boolean

🔢 customize

Filter to ensure T is not boolean, including true and false, otherwise returns never.

Example

type R = IsNotBoolean<boolean, { selection: 'filter' }> // never
type R = IsNotBoolean<true, { selection: 'filter' }> // never
type R = IsNotBoolean<false, { selection: 'filter' }> // never

type R = IsNotBoolean<number, { selection: 'filter' }> // number
type R = IsNotBoolean<unknown, { selection: 'filter' }> // unknown
type R = IsNotBoolean<never, { selection: 'filter' }> // never
type R = IsNotBoolean<string | boolean, { selection: 'filter' }> // string

🔢 customize:

Disable distribution of union types.

type R = IsNotBoolean<boolean | 1> // boolean
type R = IsNotBoolean<boolean | 1, { distributive: false }> // true

🔢 customize

Use unique branch identifiers to allow precise processing of the result.

Example

type R = IsNotBoolean<boolean, $SelectionBranch> // $Else
type R = IsNotBoolean<string, $SelectionBranch> // $Then

Generated using TypeDoc