Jump to content

typescript: arcade body: definition bug @ phaser-docs


Recommended Posts

I am re-writing this one... thought it was solved but it is not.

There is an typescript mismatch between the Phaser3 ts definitions and a body of Phaser.Physics.Arcade.Body.

>body< is only defined as an object. So I get typescript errors for using:
onFloor(); onCeiling(); setVelocity; etc. etc. for every method which should be available.
This can be found in the docs:
1. I enable physics for the sprite
2. run this in a JS file to disable ts. (tested, working, with all methods)
3. run it in ts, I get an error: That <any body method> is not available in type "object".

It's not that certain line, but somewere the track of the physics body definition is broken on typescript. (updated docs, ts, phaser to newest version)

 * If this Game Object is enabled for physics then this property will contain a reference to a Physics Body.
body: object;

I don't know how to address this "bug", since it should be fixed in the live code which is automatically generated by the phaser docs repo.
And I am not experienced enough in the build process of the docs. maybe someone can look after this and tell me how to.




Link to comment
Share on other sites

  • 2 years later...

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...