Is there a type for “Class” in Typescript? And does “any” include it?

后端 未结 7 773
渐次进展
渐次进展 2020-12-07 18:34

In Java, you can give a class to a method as a parameter using the type \"Class\". I didn\'t find anything similar in the typescript docs - is it possible to hand a class to

7条回答
  •  囚心锁ツ
    2020-12-07 19:27

    Here's an example of a type that includes only classes:

    declare type Class = new (...args: any[]) => T;
    

提交回复
热议问题