SVG 有一个 beginElement()
method .但我似乎无法在 lib.d.ts 中找到它。
目前,我必须将变量转换为“any”才能从 TypeScript 调用它而不会出现任何错误。
谁能指出包含该方法的确切 TypeScript 类?
最佳答案
该定义不存在。然而,你可以很容易地自己添加它,因为 typescript 接口(interface)是开放式的:
interface SVGElement extends Element {
beginElement(): SVGElement;
}
var foo = new SVGElement();
foo.beginElement();
关于type-conversion - SVG 的 beginElement() 方法属于哪个 TypeScript 类?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19679215/