Is there a way to make a generic T extend either type1 or type2 in TypeScript?
type1
type2
For example, I have the following: