我在尝试给 Date 添加一个方法
interface Date {
f(): string
}
Date.prototype.f = function(){
return 'hello';
}
console.log(new Date().f());
这样是没有问题的。
可是导出就出现了问题,也就是添加一行 export {} 之后,就编译不了了。
我在尝试给 Date 添加一个方法
interface Date {
f(): string
}
Date.prototype.f = function(){
return 'hello';
}
console.log(new Date().f());
这样是没有问题的。
可是导出就出现了问题,也就是添加一行 export {} 之后,就编译不了了。