Refactor typescript type generation by davepagurek · Pull Request #8114 · processing/p5.js

Noticed one more thing I was missing: types for p5.strands GLSL methods. So far the types for those are pretty unspecific, e.g. getTexture(param0: any, param1: any): any, because it'll take a bit more thought to figure out the best way to type p5.strands objects. They act in many ways like regular numbers sometimes, but also have extra methods on them. You can create vectors like arrays, but then those get extra properties like .xy. We also support + between those without them turning into a string. (Maybe the best way forward is to patch methods onto number?) There are also some things like Sampler2D which need a new type. So for now they're all just any and I can make a new issue for someone to improve this further in the future.

One other typing speedbump: p5.strands/GLSL have a length(vec) method. Adding a global type for this is tough for TypeScript because length already exists on window. For now I'm just ignoring outputting that method. We might want to make an alias for length for TS users since we can't easily "undo" the existing length property.