Updated typing for callback in Set.forEach()

This commit is contained in:
Terry Mun
2019-01-04 21:40:24 +01:00
parent b40e204bbf
commit 2ff95235fb
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -313,10 +313,10 @@ declare namespace Snap {
bind(attr:string,element:Snap.Element,eattr:string):Snap.Set;
clear():Snap.Set;
exclude(element:Snap.Element):boolean;
forEach(callback:Function,thisArg?:Object):Snap.Set;
forEach(callback:(el:Snap.Element,index?:number)=>void|boolean),thisArg?:Object):Snap.Set;
pop():Snap.Element;
push(el:Snap.Element):Snap.Set;
push(...els:Snap.element[]):Snap.Set;
push(...els:Snap.Element[]):Snap.Set;
remove(): Snap.Set;
splice(index:number,count:number,...insertion:Snap.Element[]):Snap.Set;
}
+1 -1
View File
@@ -34,7 +34,7 @@
function forEachTest() {
const colors = ['red', 'green', 'blue'];
return new Promise(resolve => {
rectSet.forEach((element, idx) => element.attr({ fill: colors[idx] || '#aaa' }));
rectSet.forEach((element,idx) => element.attr({ fill: colors[idx] || '#aaa' }));
resolve();
});
}