(Translated by https://www.hiragana.jp/)
phaser-ce/typescript at master · hardylr/phaser-ce · GitHub
Skip to content

Latest commit

 

History

History
 
 

typescript

TypeScript Definitions

Since v2.8.2 Phaser's definitions will likely be found automatically when Phaser is installed with npm.

If necessary, reference phaser.d.ts (or phaser.comments.d.ts) in your project. phaser.d.ts, pixi.d.ts, p2.d.ts must remain siblings in the same directory.

{
  "files": [
    "PATH/TO/phaser.d.ts"
  ]
}

For npm-installed Phaser, the path will be ./node_modules/phaser-ce/typescript/phaser.d.ts.

Using Typings

You can use typings, the TypeScript Definition Manager, to include Phaser's typescript definitions in your project:

  • Make sure that typings is installed in your system: npm install -g typings
  • Install phaser typescript definitions as a global dependency:
typings install github:photonstorm/phaser-ce/typescript/typings.json -GD

This will make phaser typescript definitions available for your compiler so that there is no need to reference them from your source files. For more information, check the official typings site.

Contributing

If you find any mistakes in these definitions or you feel they can be improved in any way, please open an issue or make a pull request.

Note

Creature defs are not yet provided.

The Box2D defs come from https://github.com/SBCGames/Phaser-Box2D-Typescript-defs.