Is there a way to retrieve the inner type of a generic type in Typescript, specifically T
of myType<T>
?
Take this example:
export class MyClass {
myMethod(): Observable<{ prop1: string, ... }> {
....
}
}
type myClassReturn = ReturnType<MyClass['myMethod']>;
// The current type is 'Observable<{ prop1: string, ... }>'.
// How can I change it to '{ prop1: string, ... }'?
Appreciate any help. Thank you!