phaser icon indicating copy to clipboard operation
phaser copied to clipboard

hitAreaCallback type definition

Open SylvainBreton opened this issue 4 years ago • 5 comments

Version

  • Phaser Version: 3.55 but same code on 3.60
  • Operating system: Ubuntu

Description

In phaser/types/phaser.d.ts, Phaser.Types.Input.HitAreaCallback is defined as follow :

type HitAreaCallback = (hitArea: any, x: number, y: number, gameObject: Phaser.GameObjects.GameObject)=>void;

I think that there is an issue here as the definition is different from the one given in As this definition is different from the one given in phaser/src/input/typedefs/HitAreaCallback.js

Additional Information

Change phaser/types/phaser.d.ts l62860 to type HitAreaCallback = (hitArea: any, x: number, y: number, gameObject: Phaser.GameObjects.GameObject)=>boolean;

SylvainBreton avatar Dec 22 '21 08:12 SylvainBreton

I think this is from a problem in the tsgen parser. It has all the function types return void.

samme avatar Dec 23 '21 21:12 samme

I have a fix for this issue, but I can't make a pull request: `ERROR: Permission to photonstorm/phaser.git denied to xmahle.

cc @samme @photonstorm

xmahle avatar Feb 27 '22 18:02 xmahle

Also noticed that you are not returning null types, so nullable flag is ignored in the parser. I fixed that also...

xmahle avatar Feb 27 '22 19:02 xmahle

Nice...

xmahle avatar Feb 28 '22 22:02 xmahle

Sorry, forgot to close this issue after merging this PR a while ago!

photonstorm avatar Nov 18 '22 21:11 photonstorm