SVGHelper: { circle: ((cx: number, cy: number, r: number) => SVGCircleElement); group: ((...others: SVGElement[]) => SVGGElement); image: ((src: string, x: number, y: number, w: number, h: number) => SVGImageElement); path: ((d?: string) => SVGPathElement); rect: ((x: number, y: number, w: number, h: number, rx?: number, ry?: number) => SVGRectElement); text: ((x: number, y: number, text?: string) => SVGTextElement); animate: any; createSVGElement: any; drag: any; getAngle: any; getDOMRect: any; getEase: any; setAttrs: any; setTransform: any; svgWrapper: any } = ...
Type declaration
-
circle: ((cx: number, cy: number, r: number) => SVGCircleElement)
-
- (cx: number, cy: number, r: number): SVGCircleElement
-
Parameters
-
cx: number
-
cy: number
-
r: number
Returns SVGCircleElement
-
group: ((...others: SVGElement[]) => SVGGElement)
-
- (...others: SVGElement[]): SVGGElement
-
Parameters
-
Rest
...others: SVGElement[]
Returns SVGGElement
-
image: ((src: string, x: number, y: number, w: number, h: number) => SVGImageElement)
-
- (src: string, x: number, y: number, w: number, h: number): SVGImageElement
-
Parameters
-
src: string
-
x: number
-
y: number
-
w: number
-
h: number
Returns SVGImageElement
-
path: ((d?: string) => SVGPathElement)
-
- (d?: string): SVGPathElement
-
Returns SVGPathElement
-
rect: ((x: number, y: number, w: number, h: number, rx?: number, ry?: number) => SVGRectElement)
-
- (x: number, y: number, w: number, h: number, rx?: number, ry?: number): SVGRectElement
-
Parameters
-
x: number
-
y: number
-
w: number
-
h: number
-
rx: number = 0
-
ry: number = 0
Returns SVGRectElement
-
text: ((x: number, y: number, text?: string) => SVGTextElement)
-
- (x: number, y: number, text?: string): SVGTextElement
-
Parameters
-
x: number
-
y: number
-
text: string = ''
Returns SVGTextElement
-
animate:function
- animate(start: number, end: number, callback: ((val: number) => void), duration: number, endCallback?: Function, easeType?: string): number
-
Parameters
-
start: number
-
end: number
-
callback: ((val: number) => void)
-
- (val: number): void
-
Returns void
-
duration: number
-
Optional
endCallback: Function
-
easeType: string = "ease-in"
Returns number
-
createSVGElement:function
- createSVGElement(name: string, parent?: SVGElement): SVGElement
-
Parameters
-
name: string
-
Optional
parent: SVGElement
Returns SVGElement
-
drag:function
- drag(node: Element, dragMove: ((e: MouseEvent) => void), dragStart: ((e: MouseEvent) => void), dragEnd: ((e: MouseEvent) => void)): (() => void)
-
Parameters
-
node: Element
-
dragMove: ((e: MouseEvent) => void)
-
- (e: MouseEvent): void
-
Returns void
-
dragStart: ((e: MouseEvent) => void)
-
- (e: MouseEvent): void
-
Returns void
-
dragEnd: ((e: MouseEvent) => void)
-
- (e: MouseEvent): void
-
Returns void
Returns (() => void)
-
getAngle:function
-
getDOMRect:function
- getDOMRect(str: any): DOMRect
-
Returns DOMRect
-
getEase:function
-
setAttrs:function
- setAttrs(dom: Element, attrs: Record<string, any>): void
-
Parameters
-
dom: Element
-
attrs: Record<string, any>
Returns void
-
setTransform:function
- setTransform(scale: any, translateX: any, translateY: any): string
-
Parameters
-
scale: any
-
translateX: any
-
translateY: any
Returns string
-
svgWrapper:function
- svgWrapper(svgString: string, parent?: SVGElement): SVGElement
-
Parameters
-
svgString: string
-
Optional
parent: SVGElement
Returns SVGElement