Open utterances-bot opened 5 years ago
When creating externs you may hit problems with reserved keywords (https://haxe.org/manual/expression.html), in which case you can use the @:native
meta:
extern class A {
@:native('default') var default_: String;
...
}
extern interface B {
@:native('class') var clazz: Dynamic;
...
}
var a: A;
a.default_ = 'x'; // will be generated as `a.default = "x"`
This @:native
meta is only supported on classes and interfaces declarations, but not typedefs; most of the time interfaces can be used interchangeably to represent extern JSON objects.
Externs - Haxe - The Cross-platform Toolkit
Haxe is an open source toolkit based on a modern, high level, strictly typed programming language.
https://haxe.org/manual/lf-externs.html