Closed serjek closed 2 years ago
The generated code references the source enum, for example: https://try.haxe.org/#aAcC35B5
@:jsRequire("react-native-rate", "AndroidMarket") @:enum extern abstract AndroidMarket(Int) from Int to Int {
var Google;
var Amazon;
var Other;
}
class Test {
static function main() {
var x: AndroidMarket = Google;
trace(x);
}
}
Generates
console.log("Test.hx:11:",AndroidMarket.Google);
Is it generating something different for you? If so, what are your compiler arguments and haxe version?
Hey sorry for false alarm, it works as expected. For some reason I got removed the @:jsRequire
part when first checked, generated again and it's working now. Closing the issue!
No worries :), glad it's working
npx dts2hx react-native-rate
AndroidMarket.hx
file. It has followingenum abstract
declatation:Expected: resulting enum should be correctly enumerated like so:
Experienced: resulting enumeration starts with 0 which results in incorrect params passed to lib.