Excludes from union type T those types that are assignable to U. This is a relaxed version that doesn't require U to extend T.
T
U
The union type to exclude from.
The type to exclude.
The union T minus any types assignable to U.
type Union = 'a' | 'b' | 'c';type Remaining = RelaxedExclude<Union, 'a' | 'd'>; // 'b' | 'c'type NonStrings = RelaxedExclude<string | number | boolean, string>; // number | boolean Copy
type Union = 'a' | 'b' | 'c';type Remaining = RelaxedExclude<Union, 'a' | 'd'>; // 'b' | 'c'type NonStrings = RelaxedExclude<string | number | boolean, string>; // number | boolean
Excludes from union type
Tthose types that are assignable toU. This is a relaxed version that doesn't requireUto extendT.