}\r
\r
// bare.js\r
- export interface Dom extends Element {\r
+ export interface Dom {\r
new(element: string, inherit?: any): Bare;\r
words(text: string): this;\r
- }\r
- interface Parent {\r
element(element: string, inherit?: Object): Bare;\r
+ addTo(parent: Dom): this;\r
+ putIn(parent: Dom): Dom;\r
+ children(): Element[];\r
+ add(element: Element, i?: number): Element;\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: (index: number, children: Element[]) => void, deep?: boolean): this;\r
+ removeElement(element: Element): this;\r
+ clear(): this;\r
}\r
interface Library { Bare: Bare; }\r
\r
height: number;\r
}\r
\r
- export interface Container extends Parent {\r
+ export interface Container extends Element {\r
new(): Container;\r
}\r
interface Library { Container: Container }\r
\r
type ParentTypeAlias = string | Svg | G;\r
// element.js\r
- export interface Element {\r
+ export interface Element extends Dom {\r
new(): Element;\r
node: LinkedHTMLElement;\r
type: string;\r
cy(): number;\r
move(x: NumberAlias, y: NumberAlias): this;\r
center(x: number, y: number): this;\r
-\r
width(width: NumberAlias): this;\r
width(): number;\r
height(height: NumberAlias): this;\r
height(): number;\r
size(width?: NumberAlias, height?: NumberAlias): this;\r
-\r
- clone(parent?: Parent): Element;\r
+ clone(): this;\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
// Add HTMLElement for Svg inheritance\r
- parent(type?: ParentTypeAlias): Parent | HTMLElement;\r
- doc(): Parent;\r
- parents(): Parent[];\r
-\r
+ parent(type?: ParentTypeAlias): Dom | HTMLElement;\r
+ root(): Svg;\r
+ parents(): Dom[];\r
matches(selector: string): boolean;\r
native(): LinkedHTMLElement;\r
-\r
svg(svg: string): this;\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
rx(): this;\r
ry(ry: number): this;\r
ry(): this;\r
-\r
radius(x: number, y?: number): this;\r
}\r
export interface Circle extends CircleMethods {\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
mousedown(cb: Function): this;\r
\r
type NumberAlias = _Number | number | string;\r
\r
- // parent.js\r
- export interface Parent extends Element {\r
- new(): Parent;\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: (index: number, children: Element[]) => void, deep?: boolean): this;\r
- removeElement(element: Element): this;\r
- clear(): this;\r
- }\r
- interface Library { Parent: Parent }\r
-\r
// path.js\r
interface PathArrayPoint extends Array<number | string> { }\r
type PathArrayAlias = PathArray | (string | number)[] | PathArrayPoint[] | string;\r
// selector.js\r
interface Library {\r
get(id: string): Element;\r
- select(query: string, parent?: HTMLElement): Set;\r
- }\r
- interface Parent {\r
- select(query: string): Set;\r
}\r
\r
// set.js\r
css(style: string, value: any): this;\r
css(style: Object[]): Object;\r
css(): Object;\r
- show (): this;\r
- hide (): this;\r
- visible (): boolean;\r
+ show(): this;\r
+ hide(): this;\r
+ visible(): boolean;\r
}\r
\r
// sugar.js\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
interface Library { Tspan: Tspan; }\r
\r
// textpath.js\r
- export interface TextPath extends Parent {\r
+ export interface TextPath extends Text {\r
new(): TextPath;\r
}\r
interface Text {\r
transform(): Transform;\r
untransform(): this;\r
matrixify(): Matrix;\r
- toParent(parent: Parent): this;\r
+ toParent(parent: Dom): this;\r
toSvg(): this;\r
}\r
interface Transform {\r
Skew: Skew;\r
}\r
\r
- // ungroup.js\r
- interface Parent {\r
- ungroup(parent: Parent, depth?: number): this;\r
- flatten(parent: Parent, depth?: number): this;\r
+ interface Container {\r
+ ungroup(parent: Dom, depth?: number): this;\r
+ flatten(parent: Dom, depth?: number): this;\r
}\r
\r
// use.js\r