aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpragdave <dave@pragdave.me>2020-05-30 13:57:36 -0500
committerpragdave <dave@pragdave.me>2020-05-30 13:57:36 -0500
commitd9d620fc3e92da83a75449eff78a01b66152b0d2 (patch)
tree2a0451c33534d7996809654956764e06135a6a6c
parentc8cb22863bf8c3ac157f6098be9154908aea9ec2 (diff)
downloadsvg.js-d9d620fc3e92da83a75449eff78a01b66152b0d2.tar.gz
svg.js-d9d620fc3e92da83a75449eff78a01b66152b0d2.zip
aff foreignObject to types, get get List working
-rw-r--r--svg.js.d.ts16
1 files changed, 13 insertions, 3 deletions
diff --git a/svg.js.d.ts b/svg.js.d.ts
index e397e05..213828f 100644
--- a/svg.js.d.ts
+++ b/svg.js.d.ts
@@ -548,13 +548,15 @@ declare module "@svgdotjs/svg.js" {
to(a: any): Morphable;
}
+ type ListEachCallback<T> = (el: T, index: number, list: T[]) => T
+
// List.js
- interface List<T> extends BuiltInArray<T> {
+ class List<T> extends BuiltInArray<T> {
// I have no clue how to deal with this
// [key: string]: (...arg0: any[]) => List<T>
// [key: string]: () => List<any>
- each(fn: Function): void
- each(...args: any[]): void
+ each(fn: ListEachCallback<T>): T[]
+ each(...args: any[]): T[]
toArray(): T[]
}
@@ -1055,6 +1057,7 @@ declare module "@svgdotjs/svg.js" {
clip(): ClipPath;
ellipse(width?: number, height?: number): Ellipse;
flatten(parent: Dom, depth?: number): this;
+ foreignObject(width: number, height: number) : ForeignObject
gradient(type: string, block?: (stop: Gradient) => void): Gradient;
group(): G;
@@ -1382,6 +1385,13 @@ declare module "@svgdotjs/svg.js" {
target(): string;
}
+
+ // ForeignObject.js
+ class ForeignObject extends Element {
+ constructor(node: HTMLElement, attrs?: any)
+ add(element: Dom) : ForeignObject
+ }
+
// image.js
class Image extends Shape {
constructor(node?: SVGImageElement);