Type Alias IsUnknown<T, $O>

IsUnknown<T, $O>: $SpecialType<T, {
    $any: $ResolveBranch<T, $O, [$Any, $Else]>;
    $else: $ResolveBranch<T, $O, [$Else]>;
    $never: $ResolveBranch<T, $O, [$Never, $Else]>;
    $unknown: $ResolveBranch<T, $O, [$Then]>;
}>

🎭 predicate

Validate if T is exactly unknown.

Type Parameters

type R = IsUnknown<unknown> // true

type R = IsUnknown<number> // false
type R = IsUnknown<never> // false

🔢 customize

Filter to ensure T is exactly unknown.

type R = IsUnknown<unknown, { selection: 'filter' }> // unknown

type R = IsUnknown<number, { selection: 'filter' }> // never
type R = IsUnknown<never, { selection: 'filter' }> // never

🔢 customize

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

type R = IsUnknown<unknown, $SelectionBranch> // $Then
type R = IsUnknown<string, $SelectionBranch> // $Else