I'm using typescript: 4.3.5
I have an abstract class:
abstract class Parent {
public get<Type>(id: number): Observable<Type> {
...
}
}
and a child class:
class Child extends Parent {
public get<{id: number}>(id: number): Observable<{id: number}> {
...
}
}
I cannot get the ReturnType of the get method for the child class
If i do this:
type T = ReturnType<Child['get']>;
I expect to get {id: string} but it does not work... I just get from my IDE:
<{id: string}>(id: number) => Observable<{id: string}> extends ((...args: any) => infer R) ? R : any
Is there a way to do it? thanks