Added typescript definitions#12
Conversation
|
Thanks! I don't know much about typescript but I'll merge this in and include as part of 0.2.0. Is this all that's needed to get it working with the language? |
|
Yes it is. A person using typescript would simply copy the .d.ts file next to the phaser.d.ts file in their project structure, include a reference to it in their project and voila, code completion baby! There are definitely errors and things missing with the definition though so I'll fix and send pull requests as I run into them. |
|
Okay, sounds great. I'm happy to entrust you with the typescript definitions and let you know of any API changes as they develop. 😉 |
| enableBody(body:Phaser.Physics.Arcade.Body):void; | ||
| convertTilemap(map:Phaser.Tilemap, layer:number | string | Phaser.TilemapLayer, slopeMap:Object):Phaser.Tilemap; | ||
| convertTilemapLayer(layer:Phaser.TilemapLayer, slopeMap:Object):Phaser.TilemapLayer; | ||
| collide(i:number, body:Phaser.Physics.Arcade.Body, tile:Phaser.Tile, overlapOnly:boolean):boolean; |
There was a problem hiding this comment.
I've noticed this collide definition isn't right, and same with the above in the plugin definition.
They seem to be duplicated from the SatSolver#collide definition below, which is correct, but these two up here are different; public-facing rather than internal.
There was a problem hiding this comment.
I'm not following what is wrong. All three of those classes have identical collide definitions in the source:
https://github.com/hexus/phaser-arcade-slopes/blob/master/src/ArcadeSlopes.js#L196
https://github.com/hexus/phaser-arcade-slopes/blob/master/src/ArcadeSlopes/SatSolver.js#L493
https://github.com/hexus/phaser-arcade-slopes/blob/master/src/ArcadeSlopes/Facade.js#L145
Are you referencing the i:number part? If that's the case, Type/Javascript don't have an integer type.
There was a problem hiding this comment.
My bad, I was recalling Phaser's collision method. :) Too many methods called collide to remember correctly. 😁
No description provided.