有人知道如何通过声明合并来“扩展”typescript库文件中声明的接口吗?
在我的例子中,我想要扩展typescript内置库中的接口HTMLCanvasElement。我知道如何使用声明合并,但是我没有得到接口HTMLCanvasElement的正确导入。
import {HTMLCanvasElement} from '<what.to.use.here>';
declare module '<what.to.use.here>'{
interface HTMLCanvasElement{
//add my stuff
}
}
感谢您的信任 :)