interface A {
(el?: HTMLElement, options?: Options): any;
new(el?: HTMLElement, options?: Options): any;
}
const F:A = function(){
}
函数F会报错:
不能将类型“() => void”分配给类型“A”。
类型“() => void”提供的内容与签名“new (el?: HTMLElement | undefined, options?: Options | undefined): any”不匹配。ts(2322)
编译成