-
-
Notifications
You must be signed in to change notification settings - Fork 45
Closed
Description
The current type definitions specify that applyToPoint()
requires a Point
and applyToPoints()
requires a Point[]
. This is more restrictive than the actual implementations, which also allow [number, number]
and [number, number][]
, respectively.
One way to fix this is to include a union of types in the function signatures, similar to what was done for fromTriangles()
here:
export function fromTriangles(t1: Array<Array<number>> | Array<Point>, t2: Array<Array<number>> | Array<Point>): Matrix; |
Perhaps a better way would be to change the definition of Point
to include object and array forms, if the intention is to support both forms everywhere. I'm suggesting something like this:
type Point = { x: number; y: number } | [number, number];
The change would go here:
type Point = { x: number; y: number }; |
If this change is made, the function signature for fromTriangles()
can be simplified.
Metadata
Metadata
Assignees
Labels
No labels