Problem
Sixteen call sites coerce values through blanket double-casts, hiding real shape differences between spec types and erasing type safety exactly where the render engine meets the canvas API.
Solution
Each cast is replaced with an honest derived type or a narrow typed helper — small declared interfaces for canvas API gaps, derived types for spec-shape differences — so the compiler verifies what each call site actually relies on.
Acceptance criteria
Impacted code
16 sites across packages/figma-from-specs/src/: Component, Styles primitives/composites, Elements, Effects, Subcomponents.
Implementation details are tracked internally.
Problem
Sixteen call sites coerce values through blanket double-casts, hiding real shape differences between spec types and erasing type safety exactly where the render engine meets the canvas API.
Solution
Each cast is replaced with an honest derived type or a narrow typed helper — small declared interfaces for canvas API gaps, derived types for spec-shape differences — so the compiler verifies what each call site actually relies on.
Acceptance criteria
Impacted code
16 sites across
packages/figma-from-specs/src/: Component, Styles primitives/composites, Elements, Effects, Subcomponents.