diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2023-08-18 20:41:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-18 20:41:13 +0200 |
commit | b30f0d691dfec74bc855e5550970d0fb35931881 (patch) | |
tree | 2b5006f38acf29ef21227e51f13f078d67b79901 | |
parent | 03322672782a6318b019eff33fe44ec800d6f12c (diff) | |
parent | 1d5151198c727ef6974f21bd40d9076172d5f9b2 (diff) | |
download | svg.js-b30f0d691dfec74bc855e5550970d0fb35931881.tar.gz svg.js-b30f0d691dfec74bc855e5550970d0fb35931881.zip |
Merge pull request #1309 from we125182/1307-add-Frament-declaration
fix: add Fragment declaration in svg.js.d.ts
-rw-r--r-- | svg.js.d.ts | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/svg.js.d.ts b/svg.js.d.ts index dc61bee..ae32919 100644 --- a/svg.js.d.ts +++ b/svg.js.d.ts @@ -1204,12 +1204,11 @@ declare module '@svgdotjs/svg.js' { height: number } - class Container extends Element { + class Containable { circle(size?: NumberAlias): Circle circle(size: number, unit: number): Circle 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 @@ -1240,7 +1239,6 @@ declare module '@svgdotjs/svg.js' { style(): Style text(block: (tspan: Tspan) => void): Text text(text: string): Text - ungroup(parent: Dom, depth?: number): this use(element: Element | string, file?: string): Use viewbox(): Box viewbox(viewbox: ViewBoxLike | string): this @@ -1251,6 +1249,28 @@ declare module '@svgdotjs/svg.js' { zoom(level: NumberAlias, point?: Point): this } + type DynamicExtends<T extends {}> = { + new (...args: any[]): Containable & T + } + + /** + * only for declaration purpose. actually cannot be used. + */ + let ContainableDom: DynamicExtends<Dom> + class Fragment extends ContainableDom{ + constructor(node?: Node) + } + + /** + * only for declaration purpose. actually cannot be used. + */ + let ContainableElement: DynamicExtends<Element> + class Container extends ContainableElement { + constructor() + flatten(parent: Dom, depth?: number): this + ungroup(parent: Dom, depth?: number): this + } + class Defs extends Container { constructor(node?: SVGDefsElement) node: SVGDefsElement |