mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-11-29 01:31:45 +00:00
Updated typing for callback in Set.forEach()
This commit is contained in:
Vendored
+2
-2
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user