--- /dev/null
+// todo add SVG.FX\r
+declare namespace svgjs {\r
+ export interface Library {\r
+ (selector: string): Doc;\r
+ (domElement: HTMLElement): Doc;\r
+ ns: string;\r
+ xmlns: string;\r
+ xlink: string;\r
+ svgjs: string;\r
+ supported: boolean;\r
+\r
+ did: number;\r
+ eid(name: string): string;\r
+\r
+ create(name: string): any;\r
+ extend(parent: Object, obj: Object): void;\r
+ invent(config: Object): any;\r
+ atopt(node: HTMLElement): Element;\r
+ }\r
+ interface LinkedHTMLElement extends HTMLElement {\r
+ instance: Element;\r
+ }\r
+\r
+ // arrange.js\r
+ interface Element {\r
+ front(): this;\r
+ back(): this;\r
+ forward(): this;\r
+ backward(): this;\r
+\r
+ siblings(): Element[];\r
+ position(): number;\r
+ next(): Element;\r
+ previous(): Element;\r
+ before(element: Element): Element;\r
+ after(element: Element): Element;\r
+ }\r
+\r
+ // array.js\r
+ interface _Array {\r
+ (array: any[], fallback?: any): _Array;\r
+ value: any[];\r
+ morph(array: any[]): this;\r
+ settle(): number;\r
+ at(pos: number): any;\r
+ toString(): string;\r
+ valueOf(): any[];\r
+ // parse(array:any[]):any[];\r
+ split(string: string): any[];\r
+ reverse(): this;\r
+ }\r
+ interface Library { Array(array: any[], fallback?: any): void }\r
+\r
+ // attr.js\r
+ interface Element {\r
+ attr(name: string): any;\r
+ attr(obj: Object): this;\r
+ attr(name: string, value: any, namespace?: string): this;\r
+ }\r
+\r
+ // bare.js\r
+ export interface Bare extends Element {\r
+ (element: string, inherit?: any): Bare;\r
+ words(text: any): this;\r
+ }\r
+ interface Parent {\r
+ element(element: string, inherit?: any): Bare;\r
+ symbol(): Bare;\r
+ }\r
+ interface Library { Bare(element: string, inherit?: any): void; }\r
+\r
+ // boxes.js\r
+ export interface BBox {\r
+ (element?: Element)\r
+ height: number;\r
+ width: number;\r
+ y: number;\r
+ x: number;\r
+ cx: number;\r
+ cy: number;\r
+ merge(bbox: BBox): BBox;\r
+ }\r
+ export interface RBox extends BBox { }\r
+ export interface TBox extends BBox { }\r
+ interface Container {\r
+ bbox(): BBox;\r
+ rbox(): RBox;\r
+ tbox(): TBox;\r
+ }\r
+ interface Library {\r
+ BBox(element?: Element): void;\r
+ RBox(element?: Element): void;\r
+ TBox(element?: Element): void;\r
+ }\r
+\r
+ // clip.js\r
+ export interface ClipPath extends Container { }\r
+ interface Container {\r
+ clip(): ClipPath;\r
+ }\r
+ interface Element {\r
+ clipWith(element: Element): this;\r
+ clipper: ClipPath;\r
+ unclip(): this;\r
+ }\r
+ interface Library { ClipPath(): void; }\r
+\r
+ // color.js\r
+ export interface Color {\r
+ (color: string): Color;\r
+ (color: Color): Color;\r
+ r: number;\r
+ g: number;\r
+ b: number;\r
+\r
+ toString(): string;\r
+ toHex(): string;\r
+ toRgb(): string;\r
+ brightness(): number;\r
+ morph(color: Color): Color;\r
+ morph(color: string): Color;\r
+ at(pos: number): Color;\r
+ }\r
+ interface Library {\r
+ Color(color: string): void;\r
+ Color(color: Color): void;\r
+ }\r
+\r
+ // container.js\r
+ export interface Container extends Parent {\r
+ viewbox(): ViewBox;\r
+ viewbox(v): this;\r
+ }\r
+ interface Library { Container(): void }\r
+\r
+ // data.js\r
+ interface Element {\r
+ data(name: string): any;\r
+ data(name: string, value: any, sustain?: boolean): this;\r
+ }\r
+\r
+ // default.js\r
+ interface Library {\r
+ defaults: {\r
+ attrs: {\r
+ 'fill-opacity': number;\r
+ 'stroke-opacity': number;\r
+ 'stroke-width': number;\r
+ 'stroke-linejoin': string;\r
+ 'stroke-linecap': string;\r
+ 'fill': string;\r
+ 'stroke': string;\r
+ 'opacity': number;\r
+ 'x': number;\r
+ 'y': number;\r
+ 'cx': number;\r
+ 'cy': number;\r
+ 'width': number;\r
+ 'height': number;\r
+ 'r': number;\r
+ 'rx': number;\r
+ 'ry': number;\r
+ 'offset': number;\r
+ 'stop-opacity': number;\r
+ 'stop-color': string;\r
+ 'font-size': number;\r
+ 'font-family': string;\r
+ 'text-anchor': string;\r
+ }\r
+ }\r
+ }\r
+\r
+ // defs.js\r
+ export interface Defs extends Container { }\r
+ interface Library { Defs(): void }\r
+\r
+ // doc.js\r
+ export interface Doc extends Container {\r
+ (selector: string): Doc;\r
+ (domElement: HTMLElement): Doc;\r
+ namespace(): this;\r
+ defs(): Defs;\r
+ parent(): HTMLElement;\r
+ spof(spof): this;\r
+ remove(): this;\r
+ }\r
+ interface Library {\r
+ Doc(selector: string): void;\r
+ Doc(domElement: HTMLElement): void;\r
+ }\r
+\r
+ // element.js\r
+ export interface Element {\r
+ node: LinkedHTMLElement;\r
+ type: string;\r
+\r
+ x(x: number): this;\r
+ x(): number;\r
+ y(y: number): this;\r
+ y(): number;\r
+ cx(x: number, anchor?: boolean): this;\r
+ cx(): number;\r
+ cy(y: number, anchor?: boolean): this;\r
+ cy(): number;\r
+ move(x: number, y: number): this;\r
+ center(x: number, y: number): this;\r
+\r
+ width(width: number): this;\r
+ width(): number;\r
+ height(height: number): this;\r
+ height(): number;\r
+ size(w: number, h: number, anchor?: boolean): this;\r
+\r
+ clone(): Element;\r
+ remove(): this;\r
+ replace(element: Element): Element;\r
+\r
+ addTo(parent: Parent): this;\r
+ putIn(parent: Parent): Parent;\r
+\r
+ id(): string;\r
+ id(id: string): this;\r
+\r
+ inside(x: number, y: number): boolean;\r
+\r
+ show(): this;\r
+ hide(): this;\r
+ visible(): boolean;\r
+\r
+ toString(): string;\r
+\r
+ classes(): string[];\r
+ hasClass(name: string): boolean;\r
+ addClass(name: string): this;\r
+ removeClass(name: string): this;\r
+ toggleClass(name: string): this;\r
+\r
+ reference(type: string): Element;\r
+\r
+ parents(): Parent[];\r
+\r
+ matches(selector: string): boolean;\r
+ native(): LinkedHTMLElement;\r
+\r
+ svg(svg: string): this;\r
+ is(cls: any): boolean;\r
+ }\r
+ interface Library { Element(): void; }\r
+\r
+ // ellipse.js\r
+ interface CircleMethods extends Shape {\r
+ x(rx: any): this;\r
+ x(): any;\r
+ y(ry: any): this;\r
+ y(): any;\r
+\r
+ rx(rx: any): this;\r
+ rx(): any;\r
+ ry(ry: any): this;\r
+ ry(): any;\r
+\r
+ width(): number;\r
+ width(width: any): this;\r
+ height(): number;\r
+ height(height: any): this;\r
+\r
+ size(width: any, height: any): this;\r
+ radius(x: number, y?: number): this;\r
+ }\r
+ export interface Circle extends CircleMethods { }\r
+ export interface Ellipse extends CircleMethods { }\r
+ interface Container {\r
+ circle(size?: any): Circle;\r
+ ellipse(width?: any, height?: any): Ellipse;\r
+ }\r
+ interface Library {\r
+ Circle(): void;\r
+ Ellipse(): void;\r
+ }\r
+\r
+ // event.js\r
+ interface Element {\r
+ on(event: string, cb: Function, context?: Object): this;\r
+ off(event: string, cb: Function, context?: Object): this;\r
+ fire(event: string, data?: any): this;\r
+\r
+ click(cb: Function): this;\r
+ dblclick(cb: Function): this;\r
+ mousedown(cb: Function): this;\r
+ mouseup(cb: Function): this;\r
+ mouseover(cb: Function): this;\r
+ mouseout(cb: Function): this;\r
+ mousemove(cb: Function): this;\r
+ touchstart(cb: Function): this;\r
+ touchmove(cb: Function): this;\r
+ touchleave(cb: Function): this;\r
+ touchend(cb: Function): this;\r
+ touchcancel(cb: Function): this;\r
+ }\r
+\r
+ //fx.js\r
+ interface Library {\r
+ easing: {\r
+ '-'(pos: number): number;\r
+ '<>'(pos: number): number;\r
+ '>'(pos: number): number;\r
+ '<'(pos: number): number;\r
+ }\r
+ }\r
+ interface Element {\r
+ animate(duration?: number, ease?: string, delay?: number): Animation;\r
+ animate(info: { ease?: string; duration?: number; delay?: number }): Animation;\r
+ }\r
+ // TODO finishs FX\r
+\r
+ // gradient.js\r
+ export interface Stop extends Element {\r
+ update(offset?: number | _Number, color?: any, opacity?: number | _Number): this;\r
+ update(opts: { color: string | Color, offset: number | _Number, opacity: number | _Number }): this;\r
+ }\r
+ export interface Gradient extends Container {\r
+ (type: string): Gradient;\r
+ at(offset?: number | _Number, color?: any, opacity?: number | _Number): Stop;\r
+ at(opts: { color: string | Color, offset: number | _Number, opacity: number | _Number }): Stop;\r
+ update(block?: Function): this;\r
+ fill(): this;\r
+ toString(): string;\r
+ from(x, y): this;\r
+ to(x, y): this;\r
+ radius(x: number, y?: number): this;\r
+ }\r
+ interface Container { gradient(type: string, block?: (stop: Gradient) => any): Gradient; }\r
+ interface Library { gradient(type: string): void }\r
+\r
+ // group.js\r
+ export interface G extends Container {\r
+ gbox(): BBox;\r
+ }\r
+ interface Container { group(): G; }\r
+ interface Library { G(): void; }\r
+\r
+ // hyperlink.js\r
+ export interface A extends Container {\r
+ to(url: any): this;\r
+ show(target?: any): this;\r
+ target(target: any): this;\r
+ }\r
+ interface Container { link(url?: string): A; }\r
+ interface Element {\r
+ linkTo(url: string): A;\r
+ linkTo(url: (link: A) => any): A;\r
+ }\r
+ interface Library { A(): void; }\r
+\r
+ // image.js\r
+ export interface Image extends Shape {\r
+ load(url?: string): this;\r
+ loaded(cb: (image: Image, info: { width: number, height: number, ratio: number, url: string }) => any): this;\r
+ }\r
+ interface Container {\r
+ image(): Image;\r
+ image(href: string, size?: number): Image;\r
+ image(href: string, width?: number, height?: number): Image;\r
+ }\r
+ interface Library { Image(): void; }\r
+\r
+ // line.js\r
+ export interface Line extends Shape {\r
+ array(): PointArray;\r
+ plot(points: number[][]): this;\r
+ plot(x1: number, y1: number, x2: number, y2: number): this;\r
+ move(x: number, y: number): this;\r
+ size(width: number, height: number): this;\r
+ }\r
+ interface Container {\r
+ line(points: number[][]): Line;\r
+ line(x1: number, y1: number, x2: number, y2: number): Line;\r
+ }\r
+ interface Library { Line(): void; }\r
+\r
+ // marker.js\r
+ export interface Marker extends Container {\r
+ ref(x, y): this;\r
+ update(block: (marker: Marker) => any): this;\r
+ toString(): string;\r
+ }\r
+ interface Container { marker(width?: number, height?: number, block?: (marker: Marker) => any): Marker }\r
+ interface Defs { marker(width?: number, height?: number, block?: (marker: Marker) => any): Marker }\r
+ interface _marker {\r
+ marker(position: string, width?: number, height?: number, block?: (marker: Marker) => any): Marker;\r
+ marker(position: string, marker: Marker): Marker;\r
+ }\r
+ interface Line extends _marker { }\r
+ interface Polyline extends _marker { }\r
+ interface Polygon extends _marker { }\r
+ interface Path extends _marker { }\r
+ interface Library { Marker(): void; }\r
+\r
+ // mask.js\r
+ export interface Mask extends Container {\r
+ targets: Element[];\r
+ }\r
+ interface Container { mask(): Mask; }\r
+ interface Element {\r
+ maskWith(mask: Mask): this;\r
+ maskWith(element: Element): this;\r
+ masker: Mask;\r
+ unmask(): this;\r
+ }\r
+ interface Library { Mask(): void; }\r
+\r
+ // matrix.js\r
+ interface MatrixExtract {\r
+ x: number;\r
+ y: number;\r
+ transformedX: number;\r
+ transformedY: number;\r
+ skewX: number;\r
+ skewY: number;\r
+ scaleX: number;\r
+ scaleY: number;\r
+ rotation: number;\r
+ a: number;\r
+ b: number;\r
+ c: number;\r
+ d: number;\r
+ e: number;\r
+ f: number;\r
+ matrix: Matrix;\r
+ }\r
+ export interface Matrix {\r
+ (source: any): Matrix;\r
+ a: number;\r
+ b: number;\r
+ c: number;\r
+ d: number;\r
+ e: number;\r
+ f: number;\r
+ extract(): MatrixExtract;\r
+ clone(): Matrix;\r
+ morph(matrix: Matrix): Matrix;\r
+ at(pos: number): Matrix;\r
+ multiply(matrix: Matrix): Matrix;\r
+ inverse(): Matrix;\r
+ translate(x: number, y: number): Matrix;\r
+ scale(x: number, y?: number, cx?: number, cy?: number): Matrix;\r
+ rotate(r: number, cx?: number, cy?: number): Matrix;\r
+ flip(a: string, offset: number): Matrix;\r
+ skew(x: number, y: number, cx: number, cy: number): Matrix;\r
+ skewX(x: number, cx?: number, cy?: number): Matrix;\r
+ skewY(y: number, cx?: number, cy?: number): Matrix;\r
+ around(cx: number, cy: number, matrix: Matrix): Matrix;\r
+ native(): SVGMatrix;\r
+ toString(): string;\r
+ }\r
+ interface Container {\r
+ ctm(): Matrix;\r
+ screenCTM(): Matrix;\r
+ }\r
+ interface Library { Martix(): void }\r
+\r
+ // memory.js\r
+ interface Element {\r
+ remember(name: string, value: any): this;\r
+ remember(obj: Object): this;\r
+ remember(name: string): any;\r
+ forget(...keys: string[]): this;\r
+ forget(): this;\r
+ memory(): Object;\r
+ }\r
+\r
+ // nested.js\r
+ export interface Nested extends Container { }\r
+ interface Container { nested(): Nested; }\r
+ interface Library { Nested(): void; }\r
+\r
+ // number.js\r
+ interface _Number {\r
+ (value: any, unit?: any): _Number;\r
+ toString(): string;\r
+ toJSON(): Object;\r
+ valueOf(): number;\r
+ plus(number: number): _Number;\r
+ minus(number: number): _Number;\r
+ times(number: number): _Number;\r
+ divide(number: number): _Number;\r
+ to(unit: string): _Number;\r
+ morph(number: any): this;\r
+ at(pos: number): _Number;\r
+ }\r
+ interface Library { Number(value: any, unit?: any): _Number; }\r
+\r
+ // parent.js\r
+ export interface Parent extends Element {\r
+ children(): Element[];\r
+ add(element: Element, i?: number): this;\r
+ put(element: Element, i?: number): Element;\r
+ has(element: Element): boolean;\r
+ index(element: Element): number;\r
+ get(i: number): Element;\r
+ first(): Element;\r
+ last(): Element;\r
+ each(block: Function, deep?: boolean): this;\r
+ removeElement(element: Element): this;\r
+ clear(): this;\r
+ defs(): Defs;\r
+ }\r
+\r
+ // path.js\r
+ export interface Path extends Shape {\r
+ morphArray: PathArray;\r
+ array(): PathArray;\r
+ plot(d: string): this;\r
+ plot(pathArray: PathArray): this;\r
+ }\r
+ interface Container {\r
+ path(): Path;\r
+ path(d: string): Path;\r
+ plot(pathArray: PathArray): Path;\r
+ }\r
+\r
+ // pathArray.js\r
+ interface PathArrayPoint extends Array<any> { }\r
+ export interface PathArray extends _Array {\r
+ (d: string): PathArray;\r
+ (array: PathArrayPoint[]): PathArray;\r
+ move(x: number, y: number): this;\r
+ size(width: number, height: number): this;\r
+ parse(array: any[]): any[];\r
+ bbox(): BBox;\r
+ }\r
+ interface Library {\r
+ PathArray(d: string): void;\r
+ PathArray(points: PathArrayPoint[]): void;\r
+ }\r
+\r
+ // pattern.js\r
+ export interface Pattern extends Container {\r
+ update(block: (pattern: Pattern) => any): this;\r
+ toString(): string;\r
+ }\r
+ interface Container {\r
+ pattern(width?: number, height?: number, block?: (pattern: Pattern) => any): Pattern\r
+ }\r
+ interface Library { Pattern(): void }\r
+\r
+ // point.js\r
+ interface ArrayPoint extends Array<number> { }\r
+ export interface Point {\r
+ (): Point;\r
+ (position: ArrayPoint): Point;\r
+ (position: { x: number, y: number }): Point;\r
+ (x: number, y: number): Point;\r
+\r
+ clone(): Point;\r
+ morph(point: Point): Point;\r
+ at(pos: number): Point;\r
+ native(): SVGPoint;\r
+ transform(matrix: Matrix): Point;\r
+ }\r
+ interface Library {\r
+ Point(): void;\r
+ Point(position: ArrayPoint): void;\r
+ Point(position: { x: number, y: number }): void;\r
+ Point(x: number, y: number): void;\r
+ }\r
+ interface Element {\r
+ point(): Point;\r
+ point(position: ArrayPoint): Point;\r
+ point(position: { x: number, y: number }): Point;\r
+ point(x: number, y: number): Point;\r
+ }\r
+\r
+ // pointArray.js\r
+ export interface PointArray extends _Array {\r
+ (points: string): PointArray;\r
+ (points: ArrayPoint[]): PointArray;\r
+ toStirng(): string;\r
+ toLine(): {\r
+ x1: number;\r
+ y1: number;\r
+ x2: number;\r
+ y2: number;\r
+ };\r
+ parse(points: string): ArrayPoint[];\r
+ move(x: number, y: number): this;\r
+ size(width: number, height: number): this;\r
+ bbox(): BBox;\r
+ }\r
+ interface Library {\r
+ PointArray(points: string): void;\r
+ PointArray(points: ArrayPoint[]): void;\r
+ }\r
+\r
+ // poly.js\r
+ interface poly extends Shape {\r
+ array(): PointArray;\r
+ plot(p: string): this;\r
+ plot(p: ArrayPoint[]): this;\r
+ move(x: number, y: number): this;\r
+ size(width: number, height: number): this;\r
+ }\r
+ export interface PolyLine extends poly { }\r
+ interface Library { PolyLine(): void; }\r
+ interface Container {\r
+ polyLine(points: string): PolyLine;\r
+ polyLine(points: ArrayPoint[]): PolyLine;\r
+ }\r
+ export interface Polygon extends poly { }\r
+ interface Library { Polygon(): void; }\r
+ interface Container {\r
+ polygon(points: string): Polygon;\r
+ polygon(points: ArrayPoint[]): Polygon;\r
+ }\r
+\r
+ // rect.js\r
+ export interface Rect extends Shape { }\r
+ interface Library { Rect(): void; }\r
+ interface Container {\r
+ rect(width?: number, height?: number): Rect;\r
+ }\r
+\r
+ // regex.js\r
+ interface Library {\r
+ regex: {\r
+ numberAndUnit: RegExp;\r
+ hex: RegExp;\r
+ rgb: RegExp;\r
+ reference: RegExp;\r
+ matrix: RegExp;\r
+ matrixElements: RegExp;\r
+ whitespace: RegExp;\r
+ isHex: RegExp;\r
+ isRgb: RegExp;\r
+ isCss: RegExp;\r
+ isBlank: RegExp;\r
+ isNumber: RegExp;\r
+ isPercent: RegExp;\r
+ isImage: RegExp;\r
+ negExp: RegExp;\r
+ comma: RegExp;\r
+ hyphen: RegExp;\r
+ pathLetters: RegExp;\r
+ isPathLetter: RegExp;\r
+ whitespaces: RegExp;\r
+ X: RegExp;\r
+ }\r
+ }\r
+\r
+ // selector.js\r
+ interface Library {\r
+ get(id: string): Element;\r
+ select(query: string, parent: HTMLElement): Element;\r
+ }\r
+ interface Parent {\r
+ select(query: string): Element;\r
+ }\r
+\r
+ // set.js\r
+ export interface Set {\r
+ (members?: Element[]): Set;\r
+ add(...elments: Element[]): this;\r
+ remove(element: Element): this;\r
+ each(block: Function): this;\r
+ clear(): this;\r
+ length(): number;\r
+ has(element: Element): this;\r
+ index(element: Element): number;\r
+ get(i: number): Element;\r
+ first(): Element;\r
+ last(): Element;\r
+ valueOf(): Element[];\r
+ bbox(): BBox;\r
+ }\r
+ interface Container { set(members?: Element[]): Set; }\r
+ interface Library { Set(members?: Element[]): void; }\r
+\r
+ // shape.js\r
+ export interface Shape extends Element { }\r
+ interface Library { Shape(): void; }\r
+\r
+ // style.js\r
+ interface Element {\r
+ style(styles: Object): this;\r
+ style(style: string): any;\r
+ style(style: string, value: any): this;\r
+ }\r
+\r
+ // sugar.js\r
+ interface StrokeData {\r
+ color?: string;\r
+ width?: number;\r
+ opacity?: number;\r
+ linecap?: string;\r
+ linejoin?: string;\r
+ miterlimit?: number;\r
+ dasharray?: string;\r
+ dashoffset?: number;\r
+ }\r
+ interface Element {\r
+ fill(fill: { color?: string; opacity?: number, rule?: string }): this;\r
+ fill(color: string): this;\r
+ fill(pattern: Element): this;\r
+ stroke(stroke: StrokeData): this;\r
+ stroke(color: string): this;\r
+ rotate(d: number, cx?: number, cy?: number): this;\r
+ skew(x: number, y: number, cx?: number, cy?: number): this;\r
+ scale(x: number, y: number, cx?: number, cy?: number): this;\r
+ scale(scale: number): this;\r
+ translate(x: number, y: number): this;\r
+ flip(a: any, offset?: number): this;\r
+ martix(m: any): this;\r
+ opacity(o: number): this;\r
+ opacity(): number;\r
+ dx(x: number): this;\r
+ dy(y: number): this;\r
+ dmove(x: number, y: number): this;\r
+ }\r
+ interface Path {\r
+ length(): number;\r
+ pointAt(length: number): { x: number, y: number };\r
+ }\r
+ interface FontData {\r
+ family?: string;\r
+ size?: number;\r
+ anchor?: string;\r
+ leading?: string;\r
+ weight?: string;\r
+ style?: string\r
+ }\r
+ interface Parent {\r
+ font(font: FontData): this;\r
+ }\r
+ interface Text {\r
+ font(font: FontData): this;\r
+ }\r
+\r
+ // text.js\r
+ export interface Text extends Shape {\r
+ clone(): Text;\r
+ text(): string;\r
+ text(text: any): this;\r
+ size(fontSize: number): this;\r
+ leading(fontSize: number): this;\r
+ lines(): number;\r
+ rebuild(enabled: boolean): this;\r
+ build(enabled: boolean): this;\r
+ plain(text: any): this;\r
+ tspan(text: any): Tspan;\r
+ clear(): this;\r
+ length(): number;\r
+ }\r
+ interface Container {\r
+ text(text: any): Text;\r
+ plain(text: any): Text;\r
+ }\r
+ interface Library { Text(): void; }\r
+ export interface Tspan extends Shape {\r
+ text(): string;\r
+ text(text: any): this;\r
+ dx(x: number): this;\r
+ dy(y: number): this;\r
+ newLine(): this;\r
+ plain(text: any): this;\r
+ tspan(text: any): Tspan;\r
+ clear(): this;\r
+ length(): number;\r
+ }\r
+\r
+ // textpath.js\r
+ export interface TextPath extends Parent { }\r
+ interface Text {\r
+ path(d: any): this;\r
+ plot(d: any): this;\r
+ track(): Element;\r
+ textPath(): Element;\r
+ }\r
+ interface Library { TextPath(): void; }\r
+\r
+ // transform.js\r
+ interface Element {\r
+ transform(t: Transform): Element;\r
+ transform(): Transform;\r
+ untransform(): this;\r
+ matrixify(): Matrix;\r
+ toParent(parent: Parent): this;\r
+ toDoc(doc: Parent): this;\r
+ }\r
+ interface Transform {\r
+ x?: number;\r
+ y?: number;\r
+ rotation?: number;\r
+ cx?: number;\r
+ cy?: number;\r
+ scaleX?: number;\r
+ scaleY?: number;\r
+ skewX?: number;\r
+ skewY?: number;\r
+ matrix?: string; // 1,0,0,1,0,0\r
+ a?: number; // direct digits of matrix\r
+ b?: number;\r
+ c?: number;\r
+ d?: number;\r
+ e?: number;\r
+ f?: number;\r
+ }\r
+ export interface Transformation {\r
+ (...Transform): Transformation;\r
+ (source: Transform, inversed?: boolean): Transformation;\r
+ at(pos: number): Matrix;\r
+ }\r
+ export interface Translate extends Transformation { }\r
+ export interface Rotate extends Transformation { }\r
+ export interface Scale extends Transformation { }\r
+ export interface Skew extends Transformation { }\r
+\r
+ // ungroup.js\r
+ interface Parent {\r
+ ungroup(parent: Parent, depth?: number): this;\r
+ flatten(parent: Parent, depth?: number): this;\r
+ }\r
+\r
+ // use.js\r
+ export interface Use extends Shape {\r
+ element(element: Element, file?: string): this;\r
+ }\r
+ interface Container {\r
+ use(element: Element, file?: string): Use;\r
+ }\r
+ interface Library { Use(): void; }\r
+\r
+ // utilities.js\r
+ interface Library {\r
+ utils: {\r
+ map(arrya: any[], block: Function): any;\r
+ radians(d: number): number;\r
+ degrees(r: number): number;\r
+ }\r
+ }\r
+\r
+ // viewbox.js\r
+ interface ViewBox {\r
+ (source: Element): ViewBox;\r
+ (source: string): ViewBox;\r
+ (source: any[]): ViewBox;\r
+ x: number;\r
+ y: number;\r
+ width: number;\r
+ height: number;\r
+ zoom?: number;\r
+ }\r
+ interface Container {\r
+ toString(): string;\r
+ morph(v: { x: number, y: number, width: number, height: number }): this;\r
+ morph(v: any[]): this;\r
+ // at(pos:number):ViewBox;\r
+ }\r
+ interface Library {\r
+ ViewBox(source: Element): void;\r
+ ViewBox(source: string): void;\r
+ ViewBox(source: any[]): void;\r
+ }\r
+\r
+ export interface Animation {\r
+ stop(): Animation;\r
+\r
+ attr(name: string, value: any, namespace?: string): Animation;\r
+ attr(obj: Object): Animation;\r
+ attr(name: string): any;\r
+\r
+ viewbox(x: number, y: number, w: number, h: number): Animation;\r
+\r
+ move(x: number, y: number, anchor?: boolean): Animation;\r
+ x(x: number, anchor?: boolean): Animation;\r
+ y(y: number, anchor?: boolean): Animation;\r
+\r
+ center(x: number, y: number, anchor?: boolean): Animation;\r
+ cx(x: number, anchor?: boolean): Animation;\r
+ cy(y: number, anchor?: boolean): Animation;\r
+\r
+ size(w: number, h: number, anchor?: boolean): Animation;\r
+ during(cb: (pos: number) => void): Animation;\r
+ to(value: number): Animation;\r
+ after(cb: () => void): Animation;\r
+\r
+ // TODO style, etc, bbox...\r
+ }\r
+}\r
+\r
+declare var SVG: svgjs.Library;\r
+declare module "svg.js" {\r
+ export default SVG;\r
+}\r