Skip to content

Docs / Types: Snap.animate with array of numbers #658

@Steditor

Description

@Steditor

The documentation claims that the setter of the Snap.animate function accepts one number argument:

- setter (function) caring function that accepts one number argument

However, if an array is provided for from and to, the setter will also receive an array:

Snap.svg/src/mina.js

Lines 104 to 113 in b365287

if (isArray(a.start)) {
res = [];
for (var j = 0, jj = a.start.length; j < jj; j++) {
res[j] = +a.start[j] +
(a.end[j] - a.start[j]) * a.easing(a.s);
}
} else {
res = +a.start + (a.end - a.start) * a.easing(a.s);
}
a.set(res);

This should be fixed in the documentation and afterwards then be applied to @types/snapsvg as well: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/snapsvg/index.d.ts#L41

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions