Closed francescoagati closed 5 years ago
Across all targets, typedefs don't exist at compile time. What's your use case?
imagine this type in haxe
@:expose typedef Player = {name:String,surname:String}
in javascript with jsdoc and typescript i want to import the type player generated from haxe in the file App.d.ts in this mode for example
/**
* @param player { import("./App.d.ts").Player }
*/
function walk(player) {
console.log(`Walking ${p.name}...`);
}
Across all targets, typedefs don't exist at compile time
@back2dos So that means they don't exist in the AST? So it'd be impossible to even get hold of them to generate TS type defs, it appears.
typedef
s exist in AST. from them we should generate TS interface
if it's a typedef to a structure, or type
if it's some other type
The problem is that typedefs don't have a name in the AST, isn't it?
They do, that's their purpose - to give a name to a type :)
Typedefs are now supported \o/
sorry for late response @elsassph now i have tested the typedef support in a big project. and all work really good thanks
hi, there is mode for add support for types export?