Closed dvdsgl closed 6 years ago
@dvdsgl any suggestions on this one too?
I wonder if we could namespace types - https://www.figma.com/developers/docs breaks them into Node Properties and File Format Types
Well, you could create a types.ts
module with base types, and nodes.ts
with nodes, etc., then import types with a prefix or an alias.
I renamed the primitive struct to Rect
:
/** A rectangle that expresses a bounding box in absolute coordinates */
export interface Rect {
/** X coordinate of top left corner of the rectangle */
x: number;
/** Y coordinate of top left corner of the rectangle */
y: number;
/** Width of the rectangle */
width: number;
/** Height of the rectangle */
height: number;
}
The
Rectangle
node type and theRectangle
primitive have the same name.