svgdotjs / svg.js

The lightweight library for manipulating and animating SVG
https://svgjs.dev
Other
11.04k stars 1.08k forks source link

ForeignObject missing in Typescript definitions #1139

Closed crystalfp closed 4 years ago

crystalfp commented 4 years ago

Bug report

The definition for typescript of foreignObject() is missing from svg.js.d.ts Adding the line:

foreignObject(width: number, height: number): Svg

inside class Container extends Element { solves the problem.

Thanks for considering! mario

crystalfp commented 4 years ago

I should add that I haven't found a way to add it, so I edited node_modules\@svgdotjs\svg.js\svg.js.d.ts It is an ugly workaround, but I don't know other ways. Any suggestion?

crystalfp commented 4 years ago

I'm speaking of the last version available on npm (3.0.16). In the git the the problem seems solved.

Fuzzyma commented 4 years ago

Yes this problem is solved in the current master which you can pull and build if you are in need of the fixes. I am waiting for a devdependency to be released before I release the new version