Type Alias IsVoid<T, $O>

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

🎭 predicate

Validate if T is void.

Type Parameters

type R = IsVoid<void> // true

type R = IsVoid<never> // false
type R = IsVoid<unknown> // false
type R = IsVoid<string | boolean> // false

type R = IsVoid<string | void> // boolean

🔢 customize

Filter to ensure T is void, otherwise returns never.

type R = IsVoid<void, { selection: 'filter' }> // void

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

type R = IsVoid<string | void> // void

🔢 customize:

Disable distribution of union types.

type R = IsVoid<void | 1> // boolean
type R = IsVoid<void | 1, { distributive: false }> // false

🔢 customize

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

type R = IsVoid<void, $SelectionBranch> // $Then
type R = IsVoid<string, $SelectionBranch> // $Else