microsoft / dts-gen

dts-gen creates starter TypeScript definition files for any module or library.
MIT License
2.44k stars 101 forks source link

dts-gen - Java.type() #150

Open uuk007 opened 4 years ago

uuk007 commented 4 years ago

I am trying to generate TypeScript definition file (.d.ts) from JavaScript file (*.js)...It has converted most of the files expect js file contains the following statement

return Java.type('com.test.TestExample').START_ELEMENT

When i compile the file, i am getting the following exception:

ReferenceError: Java is not defined
at Function.get ATTRIBUTE [as ATTRIBUTE] (eval at <anonymous> (C:\Users\uuk\AppData\Roaming\npm\node_modules\dts-gen\bin\lib\run.js:71:64), <anonymous>:95:27)
at getResult (C:\Users\uuk\AppData\Roaming\npm\node_modules\dts-gen\bin\lib\index.js:148:47)
at getTopLevelDeclarations (C:\Users\uuk\AppData\Roaming\npm\node_modules\dts-gen\bin\lib\index.js:124:17)
at Object.generateIdentifierDeclarationFile (C:\Users\uuk\AppData\Roaming\npm\node_modules\dts-gen\bin\lib\index.js:68:20)
at Object.<anonymous> (C:\Users\uuk\AppData\Roaming\npm\node_modules\dts-gen\bin\lib\run.js:71:24)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)

I feel modules related to Java is not getting loaded...

Can you please help me to resolve this?