I'm struggling to find the right words, so I'll provide an illustration:
// For observables
type UnwrappedObs<T> = T extends Observable<infer T> ? T : never;
// For promises
type UnwrappedPro<T> = T extends PromiseLike<infer T> ? T : never;
// How can I define GenericClass to accommodate any generic type?
type UnwrappedAll<T> = T extends GenericClass<infer T> ? T : never;
Is there a way to declare GenericClass
so it can accept various generics like
Observable | Promise | Pick | Omit | Partial | ...
?