You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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" />constcol=color(255);// is type checked and knows that col is p5.Color
@pflannerysuggests 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.
The text was updated successfully, but these errors were encountered:
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!
A convenient way to get typesafety when using p5 is to reference the definition files in your JavaScript file.
@pflannery suggests making the global mode definitions more easily available, and I quoute:
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.
The text was updated successfully, but these errors were encountered: