Closed rb1147x closed 3 years ago
Hey @rb1147x, this is indeed an issue in haxe, the problem is @:native isn't yet supported on typedefs. There are proposals and PRs to enable this like https://github.com/HaxeFoundation/haxe/pull/9433 and https://github.com/HaxeFoundation/haxe/issues/5105 but nothing has landed in the compiler yet
You may be able to change these to interfaces to fix for now (although it's not something dts2hx will do automatically because most of the time we need the properties of typedefs for other parts of the externs to work)
I agree this is a pain and it's one of the major long-term issues with haxe js externs
Closing as a duplicate https://github.com/haxiomic/dts2hx/issues/48 https://github.com/haxiomic/dts2hx/issues/55
Oh, okay, thanks for the quick response!
Using Puppeteer there is a function:
page.$eval
and several other functions using the$
character (more info: https://github.com/puppeteer/puppeteer/blob/v5.3.1/docs/api.md#pageselector).Externs get generated as
page.DollarEval
, however, the JS output keepsDollarEval
instead of converting to$eval
Example:
From Puppeteer externs generated by dts2hx:
Usage:
JS output:
Is this maybe a larger Haxe issue not supporting the
$
character in@:native
?Thanks.