phaser: phaser/typescript/typings.json is not a module

This Issue is about (delete as applicable)

  • An error in the TypeScript defs

When using typescript@next I get phaser/typescript/typings.json is not a module. This probably happens because of this line: https://github.com/photonstorm/phaser/blob/master/package.json#L51 I never saw someone linking to the typings.json. I think this must be linked to a .d.ts.

Other errors I get: phaser/typescript/typings.json(2,11): error TS1005: ';' expected.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 2
  • Comments: 16 (3 by maintainers)

Most upvoted comments

The PR should be against the Phaser CE repo: https://github.com/photonstorm/phaser-ce

Phaser 3 will have TS defs, yes. They’re being worked on at the moment.

@donaldpipowitch @hccampos From this link, "typings" in package.json should be "./typescripts/phaser.comments.d.ts".

@photonstorm If you agree about it. I can make a pull request to fix that.

I don’t know if I’m doing something wrong, or if phaser has an issue

One of the reasons I chose Phaser was support for typescript. Documentation can always be spotty, but being able to . your way to glory and check signatures is very useful.

I’ve been unable to get intellisense working for phaser. AFAIK, typescript should be able to find the definitions in node_modules if I add it to my project.json since ts2. But it doesn’t. And @types doesn’t work either.

http://stackoverflow.com/questions/38444279/how-should-i-use-types-with-typescript-2

We have written and currently maintain a line of business system that is 210k+ lines written in typescript with a number of API’s that we provide external typings for. It was a real pain in the ass to start with, due to all the constant changes etc until earlier this year but over the last 6 months or so it has really turned into a solid language. As of the current version there is absolutely no way I would write a large system of any kind in plain JavaScript and I don’t believe there is anything I could do in JS that I cannot do in TS.

We use Typescript 2, VS Code (most of the team use the insiders build) and npm as our task runner (see https://medium.freecodecamp.com/why-i-left-gulp-and-grunt-for-npm-scripts-3d6853dd22b8 for good reasons why). It’s incredibly productive and, although this may not be so important here, a massive time saver when it comes to integrating other peoples code into a project.