summaryrefslogtreecommitdiffstats
path: root/svg.js.d.ts
diff options
context:
space:
mode:
authorJosé C. Paiva <josepaiva94@gmail.com>2020-06-14 10:11:31 +0100
committerJosé C. Paiva <josepaiva94@gmail.com>2020-06-14 10:11:31 +0100
commit201a0bc249864be25417b79434782bc582d76bb2 (patch)
treed8fe4558b0ca8b1007b4a90d34a80158b6774896 /svg.js.d.ts
parentec1a37312f3f555033c377d9e7c52f2570f2ae27 (diff)
downloadsvg.js-201a0bc249864be25417b79434782bc582d76bb2.tar.gz
svg.js-201a0bc249864be25417b79434782bc582d76bb2.zip
Fix types for List and ForeignObject
Diffstat (limited to 'svg.js.d.ts')
-rw-r--r--svg.js.d.ts17
1 files changed, 9 insertions, 8 deletions
diff --git a/svg.js.d.ts b/svg.js.d.ts
index f826335..97000e9 100644
--- a/svg.js.d.ts
+++ b/svg.js.d.ts
@@ -555,13 +555,14 @@ declare module "@svgdotjs/svg.js" {
to(a: any): Morphable;
}
- type ListEachCallback<T> = (el: T, index: number, list: List<T>) => any
+ type ListEachCallback<T extends ElementAlias> =
+ (el: T, index: number, list: List<T>) => any;
// List.js
- class List<T> extends BuiltInArray<T> {
- each(fn: ListEachCallback<T>): List<any>
- each(name: string, ...args: any[]): List<any>
- toArray(): T[]
+ class List<T extends ElementAlias> extends BuiltInArray<T> {
+ each(fn: ListEachCallback<T>): List<any>;
+ each(name: string, ...args: any[]): List<any>;
+ toArray(): T[];
}
class Eventobject {
@@ -1405,9 +1406,9 @@ declare module "@svgdotjs/svg.js" {
// ForeignObject.js
class ForeignObject extends Element {
- constructor(node?: SVGForeignObjectElement, attrs?: object)
- constructor(attrs?: object)
- add(element: Dom, i?: number): ForeignObject
+ constructor(node?: SVGForeignObjectElement, attrs?: object);
+ constructor(attrs?: object);
+ add(element: Dom, i?: number): this;
}
// image.js