From d9d620fc3e92da83a75449eff78a01b66152b0d2 Mon Sep 17 00:00:00 2001 From: pragdave Date: Sat, 30 May 2020 13:57:36 -0500 Subject: aff foreignObject to types, get get List working --- svg.js.d.ts | 16 +++++++++++++--- 1 file 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 = (el: T, index: number, list: T[]) => T + // List.js - interface List extends BuiltInArray { + class List extends BuiltInArray { // I have no clue how to deal with this // [key: string]: (...arg0: any[]) => List // [key: string]: () => List - each(fn: Function): void - each(...args: any[]): void + each(fn: ListEachCallback): 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); -- cgit v1.2.3