javascript – what is new () in Typescript? – Stack Overflow

new() describes a constructor signature in typescript. What that means is that it describes the shape of the constructor. For instance take {new(): T; }. You are right it is a type. It is the type of a class whose constructor takes in no arguments. Consider the following examples function create(c: { new(): T; } ): T { return new c(); } What this means is that the function create takes an …

Read More