phaserjs / phaser

Phaser is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.
https://phaser.io
MIT License
36.94k stars 7.08k forks source link

phaser.d.ts has issue "Required parameter cannot follow optional parameter" in definition of some methods #370

Closed wombatbuddy closed 10 years ago

wombatbuddy commented 10 years ago

In the definition of this methods: "collideHandler" "collideSpriteVsSprite" "collideSpriteVsGroup" "collideGroupVsSelf" "collideGroupVsGroup" "separate" last required parameter follows the optional parameters.

Console output: phaser.d.ts(1741,135): error TS1016: Required parameter cannot follow optional parameter. phaser.d.ts(1742,163): error TS1016: Required parameter cannot follow optional parameter. phaser.d.ts(1743,159): error TS1016: Required parameter cannot follow optional parameter. phaser.d.ts(1744,133): error TS1016: Required parameter cannot follow optional parameter. phaser.d.ts(1745,156): error TS1016: Required parameter cannot follow optional parameter. phaser.d.ts(1748,142): error TS1016: Required parameter cannot follow optional parameter.

photonstorm commented 10 years ago

Could you try the defs file in the dev branch please? Have just pushed up a new build that fixes the above and would like to know if it now works properly or there are further errors.

wombatbuddy commented 10 years ago

It seems that it is not a file with typescript definitions. This file contains HTML code. Need to load another.

photonstorm commented 10 years ago

Here you want this one specifically: https://github.com/photonstorm/phaser/raw/dev/build/phaser.d.ts

wombatbuddy commented 10 years ago

Ok this issue fixed. but there is still the issue which is described here https://github.com/photonstorm/phaser/issues/369 and other. Do I need to create "New issue" for them or describe it here in comment?

photonstorm commented 10 years ago

Comments here are fine, or even better would be to fix them in the defs file and submit it to me for merging :)

photonstorm commented 10 years ago

I've fixed #369 btw.

wombatbuddy commented 10 years ago

Definition of class "SAT" is absent at (1724:24)

photonstorm commented 10 years ago

Yeah I'm tempted to change that to "any" until I've added it.

thinkong commented 10 years ago

369 doesn't seem to be fixed in the dev branch...

line 1750 ish..

     separateTiles(body: Phaser.Physics.Arcade.Body, tile: <Phaser.Tile>Array): boolean; 

should be

     separateTiles(body: Phaser.Physics.Arcade.Body, tile: Array<Phaser.Tile>): boolean;
photonstorm commented 10 years ago

You need to learn markdown guys :)

photonstorm commented 10 years ago

Ok see the latest commit. I've added the missing SAT class and the fix for #369 is pushed too.

thinkong commented 10 years ago

woot! thank you :+1: confirmed that the compiler now works :smile:

think i might as well just fork the dev branch.. and add the typescript defs as i need them

photonstorm commented 10 years ago

Sweet. Closing this off for now.