Type Alias NotAssignable<A, B, $O>

NotAssignable<A, B, $O>: $SpecialType<B, {
    $any: $ResolveBranch<A, $O, [0 extends 1 & A
        ? $Any
        : unknown, $Else]>;
    $else: $SpecialType<A, {
        $any: $ResolveBranch<A, $O, [$Any, $Else]>;
        $else: NotAssignable.$<A, B, $O>;
        $never: $ResolveBranch<A, $O, [$Never, $Else]>;
        $unknown: $ResolveBranch<A, $O, [$Unknown, $Else]>;
    }>;
    $never: $ResolveBranch<A, $O, [A, never] extends [never, A]
        ? [$Never, $Else]
        : [$Then]>;
    $unknown: $ResolveBranch<A, $O, [[A, unknown] extends [unknown, A]
        ? $Unknown
        : unknown, $Else]>;
}>

🎭 predicate

Validate if A is not assignable to B.

Type Parameters

type R = NotAssignable<any, any> // false
type R = NotAssignable<any, 1> // false
type R = NotAssignable<unknown, unknown> // false
type R = NotAssignable<never, never> // false
type R = NotAssignable<1, 1> // false
type R = NotAssignable<'a', 'a'> // false
type R = NotAssignable<'a', 'b'> // true
type R = NotAssignable<'a', string> // false

🔢 customize

Filter to ensure A is not assignable to B.

type R = NotAssignable<any, any, { selection: 'filter' }> // never
type R = NotAssignable<string, number, { selection: 'filter' }> // string

🔢 customize

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

type R = NotAssignable<any, any, NotAssignable.$Branch> // $Else

🔢 customize

Override special types branch.

type R = NotAssignable<any, any, { $any: 1 }> // 1
type R = NotAssignable<unknown, any, { $unknown: 1 }> // 1
type R = NotAssignable<never, any, { $never: 1 }> // 1