Type alias $SelectionFilter<T>

$SelectionFilter<T>: {
    $else: never;
    $then: T;
    selection: "filter";
}

🧰 type util

Default Options for filter selection logic.

filter means the logic returns T when the condition is met, and returns never otherwise.

Type Parameters

  • T

Type declaration

  • $else: never
  • $then: T
  • selection: "filter"

Example

type YourType<
T,
Options extends YourType.$Options = YourType.$Default> = ...

namespace YourType {
export type $Options = $SelectionOptions
export type $Default = $SelectionFilter
}

type R = YourType<ThenType> // ThenType
type X = YourType<ElseType> // never

Generated using TypeDoc