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

Hope there will be a place for typescript definition file of p5js #1392

Closed
LujunWeng opened this issue May 7, 2016 · 2 comments · Fixed by #2279
Closed

Hope there will be a place for typescript definition file of p5js #1392

LujunWeng opened this issue May 7, 2016 · 2 comments · Fixed by #2279

Comments

@LujunWeng
Copy link
Contributor

I hope there will be a place for typescript definition files of p5js, so others can contribute to these definition files.

I've made a Definition Request here.

@toolness has made a tool to generate definition files automatically. I think we can start from these generated definition files.

@toolness
Copy link
Member

toolness commented May 7, 2016

Thanks for the comment!

I'd actually like to add my tool itself to the p5.js repository and have those definitions continue to be auto-generated if possible, as it keeps things DRY while also serving as a way to test our own documentation.

There will definitely be some functions, like save(), whose method signatures will be too complex to describe accurately using yuidoc and which therefore will need to have custom definitions in the typescript definitions file, but I think we can work out a way to "merge" such custom definitions with the auto-generated ones.

@LujunWeng
Copy link
Contributor Author

Right now, I'm using the generated definition files. It works well for autocomplete in my IDE. Once there is any mismatch the IDE shows, I turn to the definition files and make modifications manually.

Like yesterday, I added constructor(sketch: (p:any)=>void, node?: HTMLElement|boolean, sync?: boolean); to the p5 class so that new p5(sketch) would not cause an error any more.

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

Successfully merging a pull request may close this issue.

3 participants