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

Move the TypeScript definitions files for global mode to a more convenient place #2572

Closed
Zalastax opened this issue Jan 21, 2018 · 1 comment

Comments

@Zalastax
Copy link
Member

A convenient way to get typesafety when using p5 is to reference the definition files in your JavaScript file.

/// <reference types="p5/lib/p5.global-mode" />
const col = color(255); // is type checked and knows that col is p5.Color

@pflannery suggests making the global mode definitions more easily available, and I quoute:

It could probably be improved if "p5.global-mode.d.ts" was renamed to "global.d.ts" so the statement becomes
types="p5/lib/global", or even better if we moved the file and could state something simple like types="p5/browser" as the reference.

We can for sure rename the file to just global, but is it also possible to move it oustide the lib folder? I don't want to make the build script/folder layout too complicated. To me, a rename and some good documentation seems best.

@kjhollen
Copy link
Member

I'm closing this because #2571 is the plan for typescript support. thank you for offering to take care of the migration, and I hope the master's thesis wraps up smoothly @Zalastax!

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

No branches or pull requests

2 participants