generated at
Exclude<U, E>
U が、 E の部分型ならば E を返し、そうでなければ never を返す
いまのところ、両方の引数がunion型であるものしか見たことがないmrsekut


定義
ts
type Exclude<U, E> = U extends E ? never : U



両方の引数がunion型の場合、 U - E をやっているイメージになる
union型 T から、union型 U を取り除く
例.ts
type A = Exclude<'X'|'B'|'C', 'X'>; // 'B'|'C' type A = Exclude<'X' , 'X'|'B'|'C'> // never
引けない場合は never になる