Antriel Posted February 16, 2018 Share Posted February 16, 2018 Compiled down the current version of the TS defs for Phaser 3. It's work in progress and hackishly processed to be valid (i.e. doesn't generate TS errors), but it seems to work. Get it here: phaser.d.ts Let me know if there are issues (although there's already plenty that I know of). nkholski, RiCoTeRoX and Fenopiù 3 Link to comment Share on other sites More sharing options...
troyedwardsjr Posted February 16, 2018 Share Posted February 16, 2018 Are member variables working for you? They don't appear to be working for me in your build: Have you found a solution to this yet because I haven't found a solution other than to manually add JSDocs (which would require changes to the source / PR requests), or possibly hacky importing and evaluating of modules from the source and writing a custom parser afterwards from any useful data in the middle of my tsd compilation/transpilation process. Which would be a problem since Scenes appear to have properties or as phaser calls it "plugins" dynamically added to them at runtime and Phaser registers all the plugins when phaser.js is require'd (giving the plugins the necessary mappings to match up with InjectionMap and then becoming Scene property names) which includes calls to global browser objects like "window", which will crash nodejs. Both of these solutions are not ideal and very tedious. Currently, the JSDocs in the source do not appear to be very "TypeScript friendly" for automatic generation. Ideally, I was hoping for TypeScript support on release as stated in the Phaser World dev log over two weeks ago so that I could start my projects. Link to comment Share on other sites More sharing options...
Antriel Posted February 17, 2018 Author Share Posted February 17, 2018 First step is getting the jsdoc convert to valid TS defs without any hacks. That will require lot of fixes in the actual jsdoc. Then we can think about these dynamic plugins, possibly adding custom jsdoc tag for it. It shouldn't be too difficult I hope. In any case it will definitely have to be automatic and based on the jsdoc, not custom per-plugin manual hacks in the converter or anything like that. By the way, a lot of work already went into the jsdoc being TS friendly, but it's more difficult than it might seem on such a big project. JSDoc itself doesn't help there much either Fenopiù and troyedwardsjr 2 Link to comment Share on other sites More sharing options...
RiCoTeRoX Posted February 28, 2018 Share Posted February 28, 2018 @Antriel Where is the github repo of this ? i want to submit some PR Link to comment Share on other sites More sharing options...
Antriel Posted March 1, 2018 Author Share Posted March 1, 2018 Nowhere yet, I'm currently waiting for instructions. PR towards the defs would be mostly pointless as the defs are generated and PR towards the code are also mostly pointless as the majority of issues is with the docs themselves not the generator. Link to comment Share on other sites More sharing options...
Fredrik Posted May 30, 2018 Share Posted May 30, 2018 Hi, does anyone know if there are any typings file for Phaser 3.9.0 available anywhere? Link to comment Share on other sites More sharing options...
YuPi Posted May 31, 2018 Share Posted May 31, 2018 https://github.com/photonstorm/phaser3-docs/tree/master/typescript Pradeep Kumar 1 Link to comment Share on other sites More sharing options...
Recommended Posts