TypeScript constructor in interface -
the typescript doc says following code: interface clockconstructor { new (hour: number, minute: number): clockinterface; } interface clockinterface { tick(); } function createclock(ctor: clockconstructor, hour: number, minute: number): clockinterface { return new ctor(hour, minute); } class digitalclock implements clockinterface { constructor(h: number, m: number) { } tick() { console.log("beep beep"); } } class analogclock implements clockinterface { constructor(h: number, m: number) { } tick() { console.log("tick tock"); } } let digital = createclock(digitalclock, 12, 17); let analog = createclock(analogclock, 7, 32); ... because createclock’s first parameter of type clockconstructor, in createclock(analogclock, 7, 32), checks analogclock has correct constructor signature. however, compiling same code without constructor, not throw error can see here why that? missing anything?