Classes can implement interfaces:
interface ClockInterface {
currentTime: Date;
}
class Clock implements ClockInterface {
currentTime: Date;
constructor(h: number, m: number) { }
}
How can I define a type that "implements" an interface? I don't understand why the following does not work, as it looks completely reasonable to me:
type DigitalClock implements ClockInterface = {
currentTime: Date;
somethingDigital: any;
}