Get argument types for function / class constructor

Typescript now has the ConstructorParameters builtin, similar to the Parameters builtin. Make sure you pass the class type, not the instance:

ConstructorParameters<typeof SomeClass>

ConstructorParameter Official Doc

Parameters Official Doc

Leave a Comment