collectype / types/utility / Constructor
Constructor<
T> = (items) =>T
Defined in: types/utility.ts:15
Generic constructor type for a class that takes an array of items as its only argument. Used to type the constructor parameter for function classes in CollecType collections.
T
The instance type returned by the constructor.
any[]
T
// Suppose you have a class:
class MyFunctions {
constructor(items: string[]) {}
}
// You can use Constructor<MyFunctions> to type a constructor:
const fnClass: Constructor<MyFunctions> = MyFunctions;