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 types #11

Closed
NoraCodes opened this issue Nov 1, 2017 · 7 comments
Closed

TypeScript types #11

NoraCodes opened this issue Nov 1, 2017 · 7 comments
Labels

Comments

@NoraCodes
Copy link

Currently, I have issues using this library with my typescript project; could you include a TypeScript types definition file?

Many thanks.

@simonbrunel
Copy link
Member

@LeoTindall I don't use TypeScript (and not familiar with it), what are your issues? what do you need exactly?

@NoraCodes
Copy link
Author

The problem is that the TypeScript type checker complains when I try to configure the library. I'm happy to submit a PR with the d.ts file, I was just wondering if you'd be willing to accept it.

@bitflower
Copy link

@LeoTindall are you planning on adding this to the Chart.js typings or a seperate file for the plugin?

@simonbrunel
Copy link
Member

@LeoTindall sorry for the late reply: I'm not against the TypeScript definition in this repository (as long as it respects the ESLint code style), however since this plugin is not written using TypeScript, this file will likely not be maintained.

Wouldn't be easier to simply update the Chart.js TypeScript and allow any type for options.plugins.* (and Chart.defaults.global.plugins.*), which should make your checker happy? This will also be compatible with other plugins.

@NoraCodes
Copy link
Author

Not a bad idea! I'll make a PR against their repo, thanks.

@simonbrunel
Copy link
Member

@LeoTindall sounds good, can you please link that ticket to your PR when ready?

@LiamDotPro
Copy link

@LeoTindall How do I integrate this into my existing typescript project? It throws errors saying it can't find the definition for various files.

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

No branches or pull requests

4 participants