elsassph / hxtsdgen

TypeScript declaration file generator for Haxe JavaScript output target
65 stars 12 forks source link

d.ts file not generated at all? #18

Closed bary12 closed 5 years ago

bary12 commented 5 years ago

Haxe version: 3.4.7 hxtsdgen version: 0.1.1 OS: Ubuntu 18.04 x64

main.d.ts is not generated at all (the command find . -name "*.d.ts" does not find anything). There is also no error and the compilation output is clean.

build.hxml

-cp src
-main Main
-js out/out.js
-lib hxtsdgen

src/Main.hx

package ;
@:expose
@:keep
class MyClass {
    public var test: Int;
}

class Main {
    static public function main() {

    }
}

I tried everything, including actually using MyClass in Main, -dce no and I even tried reversing the order of -lib and -js but nothing worked.

bary12 commented 5 years ago

adding

--macro hxtsdgen.Generator.use()

like in extraParams.hxml solved the problem. If this is the intended usage, it is not documented.

elsassph commented 5 years ago

Sorry, the haxelib was missing a file (extraParams.hxml as you found out) adding the build macro. I pushed a new 0.1.2 version.

The .d.ts should be located in the same folder where out.js is generated.

bary12 commented 5 years ago

Thanks for the quick response! Works now.