Closed rb1147x closed 2 years ago
It looks like jsPDF doesn't define global types, everything is wrapped in the module "jsPDF"
which must be imported because quotes are used
You can verify this by creating a .ts file and trying to access jsPDF through autocomplete (it'll add the import line for you)
So right now this seems to be working as expected given the type definitions
If jsPDF does define a global scope variable, then the ts definitions could be modified upstream to correct
Ahh, I think I understand. Thanks for the explanation.
You could use something like esbuild on the haxe output, so the require() calls get inlined, checkout the three.js example in this repo for how to do that
Right, I saw that and will check it out. Thanks!
Hi,
I'm trying to use the jsPDF library - https://github.com/parallax/jsPDF and they include TS definitions. However, when I run dts2hx with
--global
against this lib it does not appear to produce externs (except several TS type helper files, e.g. AnyOf2.hx).When I run the command without
--global
or with--modular
it generates the haxe externs. Since this is a library to be used client-side in the browser, am I doing something wrong with attempting to generate externs for this lib?Thanks.