processing / p5.js

p5.js is a client-side JS platform that empowers artists, designers, students, and anyone to learn to code and express themselves creatively on the web. It is based on the core principles of Processing. http://twitter.com/p5xjs —
http://p5js.org/
GNU Lesser General Public License v2.1
21.4k stars 3.28k forks source link

p5.Vector.d.ts: Can **class Vector** be changed to **interface Vector** declaration? #6768

Closed yanglebupt closed 5 months ago

yanglebupt commented 7 months ago

Topic

In order to expand the static properties on the class Vector, it seems necessary to change the class declaration to interface declaration in p5.Vector.d.ts file.

屏幕截图 2024-01-25 215254
welcome[bot] commented 7 months ago

Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, please make sure to fill out the inputs in the issue forms. Thank you!

lindapaiste commented 7 months ago

It’s definitely a class and should stay a class.

If you explain what you are trying to achieve then I might be able to help you. static properties would go on the VectorConstructor type, whereas the Vector type describes the type of each instance of the class.

limzykenneth commented 5 months ago

Types for p5.js is maintained externally at: https://github.com/p5-types/p5.ts. This issue should probably be filed there. I'll close this for now.