excalidraw/excalidraw

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

オープン

#9,297 opened on 2025/03/24

 (12 件のコメント) (0 件のリアクション) (0 人の担当者)TypeScript (14,958 件のフォーク)batch import
good first issue

Repository metrics

Stars
 (130,212 個のスター)
PR merge metrics
 (平均マージ 5d 7h) (30d で 18 merged PRs)

説明

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.

コントリビューターガイド