Browse Source

fix toParent type

tags/3.2.0
Alejandro Leal 1 year ago
parent
commit
efee17bc32
1 changed files with 6 additions and 5 deletions
  1. 6
    5
      svg.js.d.ts

+ 6
- 5
svg.js.d.ts View File

declare class BuiltInArray<T> extends Array<T> { } declare class BuiltInArray<T> extends Array<T> { }
// trick to have nice attribute list for CSS // trick to have nice attribute list for CSS
declare type CSSStyleName = Exclude<keyof CSSStyleDeclaration, "parentRule" | "length" >
declare type CSSStyleName = Exclude<keyof CSSStyleDeclaration, "parentRule" | "length">
declare module "@svgdotjs/svg.js" { declare module "@svgdotjs/svg.js" {
reset(): this reset(): this
finish(): this finish(): this
reverse(r?: boolean): this reverse(r?: boolean): this
ease(fn: EasingCallback) : this
ease(kind: EasingLiteral) : this
ease(fn: EasingCallback): this
ease(kind: EasingLiteral): this
active(): boolean active(): boolean
active(a: boolean): this active(a: boolean): this
addTransform(m: Matrix): this addTransform(m: Matrix): this
clip(): ClipPath; clip(): ClipPath;
ellipse(width?: number, height?: number): Ellipse; ellipse(width?: number, height?: number): Ellipse;
flatten(parent: Dom, depth?: number): this; flatten(parent: Dom, depth?: number): this;
foreignObject(width: number, height: number) : ForeignObject
foreignObject(width: number, height: number): ForeignObject
gradient(type: string, block?: (stop: Gradient) => void): Gradient; gradient(type: string, block?: (stop: Gradient) => void): Gradient;
group(): G; group(): G;
* then the result is only provided the list up until Svg root element which mean no Dom parent element is included. * then the result is only provided the list up until Svg root element which mean no Dom parent element is included.
* @param util a parent type * @param util a parent type
*/ */
parents<T extends Dom>(util: QuerySelector | T | null ): List<Element>
parents<T extends Dom>(util: QuerySelector | T | null): List<Element>
/** /**
* Get reference svg element based on the given attribute. * Get reference svg element based on the given attribute.
* @param attr a svg attribute * @param attr a svg attribute
timeline(tl: Timeline): this timeline(tl: Timeline): this
toggleClass(name: string): this; toggleClass(name: string): this;
toParent(parent: Dom): this; toParent(parent: Dom): this;
toParent(parent: Dom, i: number): this;
toSvg(): this; toSvg(): this;
touchcancel(cb: Function | null): this; touchcancel(cb: Function | null): this;
touchend(cb: Function | null): this; touchend(cb: Function | null): this;

Loading…
Cancel
Save