How can I access to p5.Vector class?
I want to use p5.Vector class. How should I do that?
Same question here, I'm using nextjs with typescript and getting the error: Property 'Vector' does not exist on type 'import("./node_modules/@types/p5/index.d.ts")'.
Even if I use window.p5.Vector as mentioned in this issue. I'm getting this error... Property 'p5' does not exist on type 'Window & typeof globalThis'.
Update: window.p5.Vector does work but gives above error in my ide.
So I added
declare global {
interface Window { p5: p5Types; }
}
I'm now getting this type error again: Property 'Vector' does not exist on type 'import("./node_modules/@types/p5/index.d.ts")'.
So I think the Vector type need to be added to p5Types, anyway it is working sort of for me now.
I ran into the same problem: p5.constructor.Vector does the job !