How can I remove a wider type from a union type without removing its subtypes in TypeScript?
Using the Exclude operator doesn't work. type test = Exclude // produces type test = never I can understand why "except strings" also means excluding all the string literals, but how can I obtain 'a'|'b' out of 'a'|'b'|string? If needed, assume latest TypeScript.
https://stackoverflow.com/questions/51954558/how-can-i-remove-a-wider-type-from-a-union-type-without-removing-its-subtypes-in