Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript definitions is not working as it should #276

Closed
dolanmiu opened this issue Jul 9, 2017 · 2 comments
Closed

Typescript definitions is not working as it should #276

dolanmiu opened this issue Jul 9, 2017 · 2 comments

Comments

@dolanmiu
Copy link

dolanmiu commented Jul 9, 2017

This Issue is about (✏️ delete as applicable)

  • An error in the TypeScript defs
    • Phaser version(s): 2.8.1 and below
    • What should happen: Type definitions should just work OOTB without the need of third party libraries (typings)
    • What happens instead: You need to install typings and another dependency

From reading the below, its best practice to include a "types:" section in the package.json to make it work out of the box:

https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html

Quote:

Including declarations in your npm package

If your package has a main .js file, you will need to indicate the main declaration file in your package.json file as well. Set the types property to point to your bundled declaration file. For example:

{
    "name": "awesome",
    "author": "Vandelay Industries",
    "version": "1.0.0",
    "main": "./lib/main.js",
    "types": "./lib/main.d.ts"
}
@dolanmiu dolanmiu changed the title Typescript is broken Typescript definitions is not working as it should Jul 9, 2017
@samme samme closed this as completed in c2a6b1e Jul 10, 2017
@samme
Copy link
Collaborator

samme commented Jul 28, 2017

@dolanmiu have you noticed any difference since v2.8.2?

@dolanmiu
Copy link
Author

I will try 2.8.2 tonight, still using 2.8.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants