Skip to content

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

@estollnitz

Description

@estollnitz

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions