From: pragdave Date: Sun, 31 May 2020 00:31:32 +0000 (-0500) Subject: Fix up List (maybe). ForeignObject still open for discussion X-Git-Tag: 3.1.0~19^2~5 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8383e46f0b8b8b9f7908716cee102bf63d3d2056;p=svg.js.git Fix up List (maybe). ForeignObject still open for discussion --- diff --git a/svg.js.d.ts b/svg.js.d.ts index 213828f..8cb3252 100644 --- a/svg.js.d.ts +++ b/svg.js.d.ts @@ -548,15 +548,12 @@ declare module "@svgdotjs/svg.js" { to(a: any): Morphable; } - type ListEachCallback = (el: T, index: number, list: T[]) => T + type ListEachCallback = (el: T, index: number, list: T[]) => any // List.js - class List extends BuiltInArray { - // I have no clue how to deal with this - // [key: string]: (...arg0: any[]) => List - // [key: string]: () => List - each(fn: ListEachCallback): T[] - each(...args: any[]): T[] + class List extends BuiltInArray implements ElementAlias { + each(fn: ListEachCallback): any[] + each(name: string, ...args: any[]): any[] toArray(): T[] }