根据W3C建议的方法getSVGDocument()应返回SVGDocument但lib.d.ts代码:如何在Typescript中使用SVGDocument?
interface GetSVGDocument {
getSVGDocument(): Document;
}
所以,我怎么能这样做呢? :
var svgDoc:SVGDocument= document.getElementById('myId').getSVGDocument();
var svgElement:SVGElement = svgDoc.getElementById("myElement");
... further manipulations on svgElement
更普遍的是,他们是否通过了TypeScript中的SVG实现或者我错过了什么? SVG dom有没有适当的实现,或者我怎么实现它?