Skip to main content

Interface: Type<T>

Represents a JavaScript class constructor that can be called with new to create instances of type T.

Example​

class MyService {
constructor(private name: string) {}
}
const serviceCtor: Type<MyService> = MyService;
const instance = new serviceCtor('Aurora');

Type Parameters​

T​

T = unknown

The type of object created by this constructor. Defaults to unknown.

Constructors​

Constructor​

new Type(...args): T

Constructor signature for creating an instance of T.

Parameters​

args​

...any[]

Arguments passed to the class constructor.

Returns​

T

A new instance of type T.