jemgold / figma-js

Little wrapper (+ types) for the Figma API
https://jongold.github.io/figma-js/
MIT License
491 stars 47 forks source link

Duplicate types for Vector #4

Closed jemgold closed 6 years ago

jemgold commented 6 years ago

I can't believe my eyes and tslint missed this one.

We export 2 things called Vector https://figma.com/developers/docs#vector-props https://figma.com/developers/docs#vector-type

This is breaking the postComment call, which uses client_meta: Vector (the type, not the node).

I think perhaps a smart renaming strategy is in order - perhaps renaming all of the node types to VectorNode, LineNode etc etc? Maybe?

This is a high priority bug inasmuch as I'm having to cast to any to post comments rn :D

dvdsgl commented 6 years ago

I renamed Vector to Vector2D in my project. I suggest not appending "Node" to all nodes.

dvdsgl commented 6 years ago

Actually, Vector2 could be a better name.

Another option is to use an inline record and not create a named type since so few Vector2 properties occur.