-
-
Notifications
You must be signed in to change notification settings - Fork 45
Closed
Description
The implementations of transform()
and compose
currently accept either multiple Matrix
parameters or a single Matrix[]
parameter. Unfortunately, the current type definitions do not cover the case of a single Matrix[]
parameter. This requires TypeScript code to be written as transform(...fromDefinition(arrayOfDefinitions))
when in fact, the ...
should be uneccessary.
I propose adding the following overloads without ...
:
export function transform(matrices: Matrix[]): Matrix;
export function compose(matrices: Matrix[]): Matrix;
These would appear adjacent to the following lines:
export function transform(...matrices: Matrix[]): Matrix; export function compose(...matrices: Matrix[]): Matrix;
And the documentation can be improved by changing the parameter description as follows:
* @param matrices {...Matrix | Matrix[]} Matrices listed as separate parameters or in an array
* @param matrices {Matrix[]} Array of affine matrix transformation-matrix/src/transform.js
Line 39 in 06321d4
* @param matrices {Matrix[]} Array of matrix
Metadata
Metadata
Assignees
Labels
No labels