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:
|
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
The documentation claims that the setter of the
Snap.animatefunction accepts one number argument:Snap.svg/src/animation.js
Line 97 in b365287
However, if an array is provided for
fromandto, the setter will also receive an array:Snap.svg/src/mina.js
Lines 104 to 113 in b365287
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