p5.js icon indicating copy to clipboard operation
p5.js copied to clipboard

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

Open yanglebupt opened this issue 1 year ago • 2 comments

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

yanglebupt avatar Jan 25 '24 13:01 yanglebupt

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!

welcome[bot] avatar Jan 25 '24 13:01 welcome[bot]

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.

lindapaiste avatar Jan 25 '24 16:01 lindapaiste

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.

limzykenneth avatar Mar 12 '24 15:03 limzykenneth