Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type definitions for transform and compose should accept a single Matrix[] #65

Closed
estollnitz opened this issue Nov 28, 2019 · 1 comment

Comments

@estollnitz
Copy link
Contributor

estollnitz commented Nov 28, 2019

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:

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
@chrvadala
Copy link
Owner

Fixed with v2.2 by @estollnitz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants