Type Alias: GraphicsShape
ts
type GraphicsShape =
| {
fill?: GraphicsFill;
height: number;
stroke?: GraphicsStroke;
type: "rect";
width: number;
x: number;
y: number;
}
| {
fill?: GraphicsFill;
height: number;
radius: number;
stroke?: GraphicsStroke;
type: "roundedRect";
width: number;
x: number;
y: number;
}
| {
fill?: GraphicsFill;
radius: number;
stroke?: GraphicsStroke;
type: "circle";
x: number;
y: number;
}
| {
fill?: GraphicsFill;
height: number;
stroke?: GraphicsStroke;
type: "ellipse";
width: number;
x: number;
y: number;
}
| {
stroke: GraphicsStroke;
type: "line";
x1: number;
x2: number;
y1: number;
y2: number;
}
| {
fill?: GraphicsFill;
points: ReadonlyArray<number>;
stroke?: GraphicsStroke;
type: "polygon";
};Declarative shape list — backends rebuild their native graphics from this on each change. Coords are entity-local. Extend with paths/arcs/bezier later by adding to the union.