Closed pjbatista closed 1 year ago
Actually I only added these extra functions for testing. I thougt when someone is so advancd to use these functions they can just import them from window.js directly. But I guess you are right.
Do you mind creating a PR?
Sure! I made the changes on: https://github.com/pjbatista/svg.js/tree/1124-window-exports. Do I also have to bump the version on package.json
before submitting the PR or do you do that on your end?
Version bumping is not required. There are almost always multiple changes for the next release and I do it right before the release (also because I cant publish it by accident with an already existing version number)
PR created: https://github.com/svgdotjs/svg.js/pull/1126
The following functions from "window.js" are not exported by the module and therefore are unusable outside its own source code:
getWindow
,restoreWindow
,saveWindow
, andwithWindow
. These would be very useful for scoping (e.g. manipulating several SVG files using multiple window contexts), specially when working with svgdom.Currently, the only export from "window.js" is the function
registerWindow
:Adding the remaining functions to the "main.js" and "svg.js.d.ts" files would solve this issue.