Type Alias IsNotVoid<T, $O>

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

🎭 predicate

Validate if T is not void.

Type Parameters

type R = IsNotVoid<void> // false

type R = IsNotVoid<never> // true
type R = IsNotVoid<unknown> // true
type R = IsNotVoid<string | boolean> // true

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

🔢 customize

Filter to ensure T is not void, otherwise returns never.

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

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

🔢 customize:

Disable distribution of union types.

type R = IsNotVoid<void | string> // boolean
type R = IsNotVoid<void | string, { distributive: false }> // true

🔢 customize

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

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