interface 和 implements 抽象和验证类的方法
implements,表示对接口的实现,接口通过关键字interface 进行定义
interface RadioProps {switchRadio(trigger: boolean): void}interface BatteryProps {battryStatus(): void}class Child implements RadioProps {switchRadio(trigger: boolean) {}}// 要实现多个接口class Child2 implements RadioProps, BatteryProps {switchRadio(trigger: boolean) {}BatteryProps () {}}// interface接口之间的继承interface BothSwitch extends RadioProps {battryStatus(): void}class Child3 implements BothSwitch {switchRadio(trigger: boolean) {}BatteryProps () {}}
