Excludes from union type T those types that are assignable to U. This is a stricter version that requires U to extend T.
T
U
The union type to exclude from.
The type to exclude, must extend T.
The union T minus U.
type Union = 'a' | 'b' | 'c';type Remaining = StrictExclude<Union, 'a' | 'b'>; // 'c'// type Invalid = StrictExclude<Union, 'a' | 'd'>; // Error: 'd' is not assignable to Union Copy
type Union = 'a' | 'b' | 'c';type Remaining = StrictExclude<Union, 'a' | 'b'>; // 'c'// type Invalid = StrictExclude<Union, 'a' | 'd'>; // Error: 'd' is not assignable to Union
Excludes from union type
Tthose types that are assignable toU. This is a stricter version that requiresUto extendT.