This is the api that is passed to the custom JS generator.

Fields

types:Array<Type>

all the types that were compiled by Haxe

setTypeAccessor(callb:Type ‑> String):Void

define the JS code that gets generated when a class or enum is accessed in a typed expression

setCurrentClass(c:ClassType):Void

select the current classe

quoteString(s:String):String

quote and escape the given string constant

outputFile:String

the file in which the JS code can be generated

main:Null<TypedExpr>

the main call expression, if a -main class is defined

isKeyword(ident:String):Bool

tells if the given identifier is a JS keyword

hasFeature(f:String):Bool

check if a feature is used

generateValue(e:TypedExpr):String

generate the JS code for a given typed expression-value

generateStatement(e:TypedExpr):String

generate the JS code for any given typed expression

buildMetaData(t:BaseType):Null<TypedExpr>

create the metadata expression for the given type

addFeature(f:String):Bool

add a feature