Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which TypeScript class does SVG's beginElement() method belong to?

SVG has a beginElement() method. But I cant seem to locate it in lib.d.ts. Currently I have to cast the variable to 'any' to call it from TypeScript without any errors.

Can someone point me to the exact TypeScript class that contains that method?

like image 894
pdeva Avatar asked Oct 28 '25 21:10

pdeva


1 Answers

The definition for that is not present. However you can quite easily add it yourself as typescript interfaces are open-ended:

interface SVGElement extends Element {
    beginElement(): SVGElement;
}

var foo = new SVGElement();
foo.beginElement();
like image 53
basarat Avatar answered Oct 30 '25 19:10

basarat



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!