#9297·excalidraw

Refactor point types ` { x, y }` to the proper unified point type in `@excalidraw/math`

Author: mtolmacsCreated Mar 24, 2025Updated Sep 13, 2026
Labelsgood first issue

Goal: Have a unified point type system across the codebase.

  • Create missing point type ViewportPoint = [x, y] in @excalidraw/math
  • Create unified point type GenericPoint in @excalidraw/math
  • Refactor point generic function type parameters to extend GenericPoint where applicable
  • Refactor object point types (i.e. { x: number, y: number } to use GlobalPoint, LocalPoint, ViewportPoint or a combination as applicable

Note: Watch out for rough-js point types, which are also [x,y] but cannot be refactored. Avoid type casting as much as possible.