Questions tagged [construct-signature]

1 questions
3
votes
0 answers

Trying to create object based on generic type - Argument of type 'typeof X' is not assignable to parameter of type 'new (...args: any[]) => typeof X'

What I want to achieve is to have a function with a generic type T and to be able to create objects of said type. I figured I had to use construct signatures and I thought that I could use a generic constraint to define that my class needs a…
Markus Weninger
  • 11,931
  • 7
  • 64
  • 137