As far as I know, it is impossible to get the name TResult , but if you provide the appropriate design function, you can get the name.
Declaration:
execute<TResult>(ctor: { new (): TResult }) : <TResult> { console.log(ctor.name) //Prints out SomeClass return <any>null; }
Application:
execute<SomeClass>(SomeClass);
Roookian
source share