hxtsdgen
hxtsdgen copied to clipboard
@:optional was not gen of typedef
@:expose
typedef GameType ={
var id:Int;
var ?name:String;
}
will gen
export type GameType = {
id: number;
name: string;
}
should be
export type GameType = {
id: number;
name?: string;
}
I think your syntax isn't entirely correct (though it may be accepted by the compiler).
For a typedef with var prop: Type
it should be:
@:expose
typedef GameType ={
var id:Int;
@:optional var name:String;
}
emm,this is got the same result as var ?name:String
==@:optional var name:String;