\r
// array.js\r
type ArrayAlias = _Array | number[] | string;\r
- \r
+\r
interface _Array {\r
new (array?: ArrayAlias, fallback?: number[]): _Array;\r
value: number[];\r
merge(box: Box): Box;\r
transform(m: Matrix): Box\r
}\r
- \r
+\r
export interface BBox extends Box {\r
new (element?: Element): BBox;\r
}\r
}\r
interface Element {\r
bbox(): BBox;\r
- rbox(): RBox;\r
+ rbox(element?: Element): RBox;\r
tbox(): TBox;\r
}\r
interface Library {\r
unclip(): this;\r
}\r
interface Library { ClipPath: ClipPath; }\r
- \r
+\r
// color.js\r
interface ColorLike {\r
r: number;\r
g: number;\r
b: number;\r
}\r
- \r
+\r
type ColorAlias = string | ColorLike;\r
- \r
+\r
export interface Color extends ColorLike{\r
new (): Color;\r
new (color: ColorAlias): Color;\r
width: number;\r
height:number;\r
}\r
- \r
+\r
export interface Container extends Parent {\r
new (): Container;\r
}\r
}\r
interface Library { Doc: Doc; }\r
\r
+ type ParentTypeAlias = string | Doc | Nested | G;\r
// element.js\r
export interface Element {\r
new (): Element;\r
toggleClass(name: string): this;\r
\r
reference(type: string): Element;\r
-\r
+ // Add HTMLElement for Doc inheritance\r
+ parent(type?: ParentTypeAlias): Parent | HTMLElement;\r
+ doc(): Parent;\r
parents(): Parent[];\r
\r
matches(selector: string): boolean;\r
native(): LinkedHTMLElement;\r
\r
svg(svg: string): this;\r
- \r
- writeDataToDom(): this,\r
- setData(data: object): this,\r
- \r
+ svg(): string;\r
+\r
+ writeDataToDom(): this;\r
+ setData(data: object): this;\r
+\r
is(cls: any): boolean;\r
}\r
interface Library { Element: Element; }\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
+ off(event: string, cb?: Function, context?: Object): this;\r
fire(event: string, data?: any): this;\r
fire(event: Event): this;\r
+ event(): Event | CustomEvent;\r
\r
click(cb: Function): this;\r
dblclick(cb: Function): this;\r
offset?: number;\r
opacity?: number;\r
}\r
- \r
+\r
// gradient.js\r
export interface Stop extends Element {\r
new (): Stop;\r
\r
// line.js\r
interface ArrayPoint extends Array<number> { }\r
- type PointArrayAlias = ArrayPoint | number[] | PointArray | string;\r
- \r
+ type PointArrayAlias = ArrayPoint[] | number[] | PointArray | string;\r
+\r
export interface Line extends Shape {\r
new (): Line;\r
array(): PointArray;\r
f: number;\r
matrix: Matrix;\r
}\r
- \r
+\r
interface MatrixLike {\r
a: number;\r
b: number;\r
e: number;\r
f: number;\r
}\r
- \r
+\r
type MatrixAlias = MatrixLike | number[] | Element | string;\r
- \r
+\r
export interface Matrix {\r
new (): Matrix;\r
new (source: MatrixAlias): Matrix;\r
// memory.js\r
interface Element {\r
remember(name: string, value: any): this;\r
- remember(obj: Object): this;\r
remember(name: string): any;\r
+ remember(obj: Object): this;\r
forget(...keys: string[]): this;\r
forget(): this;\r
memory(): Object;\r
at(pos: number): _Number;\r
}\r
interface Library { Number: _Number; }\r
- \r
+\r
type NumberAlias = _Number | number | string;\r
\r
// parent.js\r
// path.js\r
interface PathArrayPoint extends Array<number | string> { }\r
type PathArrayAlias = PathArray | (string | number)[] | PathArrayPoint[] | string;\r
- \r
+\r
export interface Path extends Shape {\r
new (): Path;\r
morphArray: PathArray;\r
new (point: Point): Point;\r
new (position: { x: number, y: number }): Point;\r
new (x: number, y: number): Point;\r
+ \r
+ x: number;\r
+ y: number;\r
\r
clone(): Point;\r
morph(point: Point): this;\r
// selector.js\r
interface Library {\r
get(id: string): Element;\r
- select(query: string, parent: HTMLElement): Set;\r
+ select(query: string, parent?: HTMLElement): Set;\r
}\r
interface Parent {\r
select(query: string): Set;\r
last(): Element;\r
valueOf(): Element[];\r
bbox(): BBox;\r
+ click(cb: Function): Set;\r
}\r
interface Container { set(members?: Element[]): Set; }\r
interface Library { Set: Set; }\r
d?: number;\r
e?: number;\r
f?: number;\r
+ scale?: number;\r
}\r
export interface Transformation {\r
new (...transform: Transform[]): Transformation;\r
element(element: Element, file?: string): this;\r
}\r
interface Container {\r
- use(element: Element, file?: string): Use;\r
+ use(element: Element | string, file?: string): Use;\r
}\r
interface Library { Use: Use; }\r
\r
\r
// viewbox.js\r
type ViewBoxAlias = ViewBoxLike | number[] | string | Element;\r
- \r
+\r
interface ViewBox {\r
new (source: ViewBoxAlias): ViewBox;\r
new (x: number, y: number, width: number, height: number): ViewBox;\r
\r
export interface Animation {\r
stop(): Animation;\r
+ finish(): Animation;\r
+ pause(): Animation;\r
+ play(): Animation;\r
+ reverse(reversed?: boolean): Animation;\r
\r
attr(name: string, value: any, namespace?: string): Animation;\r
attr(obj: Object): Animation;\r
viewbox(x: number, y: number, w: number, h: number): Animation;\r
\r
move(x: number, y: number, anchor?: boolean): Animation;\r
+ dmove(x: number, y: number): Animation;\r
x(x: number, anchor?: boolean): Animation;\r
y(y: number, anchor?: boolean): Animation;\r
\r
during(cb: (pos: number) => void): Animation;\r
to(value: number): Animation;\r
after(cb: () => void): Animation;\r
+ \r
+ delay(delayMS: number): Animation;\r
\r
- rotate(degrees: number, cx?: number, cy?: number): Animation\r
- skew(skewX: number, skewY?: number, cx?: number, cy?: number): Animation\r
- scale(scaleX: number, scaleY?: number, cx?: number, cy?: number): Animation\r
- translate(x: number, y: number): Animation\r
+ rotate(degrees: number, cx?: number, cy?: number): Animation;\r
+ skew(skewX: number, skewY?: number, cx?: number, cy?: number): Animation;\r
+ scale(scaleX: number, scaleY?: number, cx?: number, cy?: number): Animation;\r
+ translate(x: number, y: number): Animation;\r
+ transform(t: Transform, relative?: boolean): Animation;\r
\r
// TODO style, etc, bbox...\r
}\r
-}\r
+}
\ No newline at end of file