You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TypeScriptLibraryExporter documentation support #1
I think it also contains the ScriptCraft API typings too, which you won’t want if you are not using ScriptCraft.
I have a npm module loading require implementation as well, which is a patch on Walter’s require implementation. It’s in @Magikcraft/MagikCraft in the SMA/js folder.
I’ll dig out the generation code. It works by scraping the bukkit api docs and doing a ghetto transform to TS (Non-AST aware text tansform). Gets about 90% of the way there. The other 10%, plus crawling the site is manual, but we can probably fix that up.
I'm actually already generating a typescript library via java reflection. I'm just thinking about using the javadocs support to help comment the typescript code better.
I'd definitely be interested in the generation code though as it may help with parsing the java docs.
Thanks
Being able to pull reflection data directly from the jar is nice though, I just wish argument names where saved properly in the java bytecode instead of arg0, arg1.... That's why I'm looking into the javadocs as well as code comments.
Anyway I'm thinking about cleaning it up and making it a standalone project so you could just set up a build script and pass the spigot api jar and any additional jars and it would generate a typescript project.
Activity
[-]TypeScriptApiExporter documentation support[/-][+]TypeScriptLibraryExporter documentation support[/+]astorks commentedon Jan 24, 2020
https://github.com/paul-hammant/paranamer
astorks commentedon Jan 25, 2020
Paranamer is now implemented to help with some parameter names. Although full documentation would be nice at least for the bukkit api.
https://github.com/javaparser/javaparser
jwulf commentedon Feb 23, 2020
I have a Bukkit API ts declaration already. Partially auto-generated.
https://github.com/Magikcraft/scriptcraft-types
It’s on npm as well.
I think it also contains the ScriptCraft API typings too, which you won’t want if you are not using ScriptCraft.
I have a npm module loading require implementation as well, which is a patch on Walter’s require implementation. It’s in @Magikcraft/MagikCraft in the SMA/js folder.
jwulf commentedon Feb 23, 2020
I’ll dig out the generation code. It works by scraping the bukkit api docs and doing a ghetto transform to TS (Non-AST aware text tansform). Gets about 90% of the way there. The other 10%, plus crawling the site is manual, but we can probably fix that up.
astorks commentedon Feb 23, 2020
I'm actually already generating a typescript library via java reflection. I'm just thinking about using the javadocs support to help comment the typescript code better.
I'd definitely be interested in the generation code though as it may help with parsing the java docs.
Thanks
jwulf commentedon Feb 24, 2020
No kidding straight outta the ghetto:
https://github.com/jwulf/bukkit-api-scraper/blob/master/index.ts
astorks commentedon Feb 24, 2020
haha, all good. Thanks, I'm sure mine isn't too much better currently:
https://github.com/astorks/ScriptableMC-Engine/blob/dev/ScriptableMC-Tools-TS/src/main/kotlin/com/pixlfox/scriptablemc/TypescriptLibraryExporter.kt
Being able to pull reflection data directly from the jar is nice though, I just wish argument names where saved properly in the java bytecode instead of arg0, arg1.... That's why I'm looking into the javadocs as well as code comments.
Anyway I'm thinking about cleaning it up and making it a standalone project so you could just set up a build script and pass the spigot api jar and any additional jars and it would generate a typescript project.