diff options
author | José C. Paiva <josepaiva94@gmail.com> | 2020-06-14 10:11:31 +0100 |
---|---|---|
committer | José C. Paiva <josepaiva94@gmail.com> | 2020-06-14 10:11:31 +0100 |
commit | 201a0bc249864be25417b79434782bc582d76bb2 (patch) | |
tree | d8fe4558b0ca8b1007b4a90d34a80158b6774896 /svg.js.d.ts | |
parent | ec1a37312f3f555033c377d9e7c52f2570f2ae27 (diff) | |
download | svg.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.ts | 17 |
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
|