export interface IBaseEntity {
id: string
}
export interface IBaseEntityClass {
new(_id?: string, _data?: any): IBaseEntity
}
class Test implements IBaseEntity {
id: string
constructor(_id?: string, _data?: any) {
this.id = 'MOCK_ID'
}
}
let baseEntityClass: IBaseEntityClass = Test; // The class test fulfills the contract of IBaseEntityClass
new baseEntityClass("", {}) // constructing through IBaseEntityClass interface