mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-01 11:50:54 +08:00
Raphael updates + tests added
This commit is contained in:
+290
-284
@@ -1,285 +1,291 @@
|
||||
interface boundingBox {
|
||||
x: number;
|
||||
y: number;
|
||||
x2: number;
|
||||
y2: number;
|
||||
width: number;
|
||||
height: number;
|
||||
}
|
||||
|
||||
interface raphaelAnimation {
|
||||
delay(delay: number): raphaelAnimation;
|
||||
repeat(repeat: number): raphaelAnimation;
|
||||
}
|
||||
|
||||
interface raphaelFont {
|
||||
|
||||
}
|
||||
|
||||
interface raphaelElement {
|
||||
animate(params: { [key: any]: any; }, ms: number, easing?: string, callback?: Function): raphaelElement;
|
||||
animate(animation: raphaelAnimation): raphaelElement;
|
||||
animateWith(el: raphaelElement, anim: raphaelAnimation, params: JSON, ms: number, easing?: string, callback?: Function): raphaelElement;
|
||||
animateWith(el: raphaelElement, anim: raphaelAnimation, animation: raphaelAnimation): raphaelElement;
|
||||
attr(attrName: string, value: any): raphaelElement;
|
||||
attr(params: { [key: any]: any; }): raphaelElement;
|
||||
attr(attrName: string): any;
|
||||
attr(attrNames: string[]): any[];
|
||||
click(handler: Function): raphaelElement;
|
||||
clone(): raphaelElement;
|
||||
data(key: string): any;
|
||||
data(key: string, value: any): raphaelElement;
|
||||
dblclick(handler: Function): raphaelElement;
|
||||
drag(onmove: (dx: number, dy: number, x: number, y: number, event: DragEvent) =>{ }, onstart: (x: number, y: number, event: DragEvent) =>{ }, onend: (DragEvent) =>{ }, mcontext?: any, scontext?: any, econtext?: any): raphaelElement;
|
||||
getBBox(isWithoutTransform?: bool): boundingBox;
|
||||
glow(glow?: { width?: number; fill?: bool; opacity?: number; offsetx?: number; offsety?: number; color?: string; }): raphaelSet;
|
||||
hide(): raphaelElement;
|
||||
hover(f_in: Function, f_out: Function, icontext?: any, ocontext?: any): raphaelElement;
|
||||
id: string;
|
||||
insertAfter(): raphaelElement;
|
||||
insertBefore(): raphaelElement;
|
||||
isPointInside(x: number, y: number): bool;
|
||||
isVisible(): bool;
|
||||
matrix: raphaelMatrix;
|
||||
mousedown(handler: Function): raphaelElement;
|
||||
mousemove(handler: Function): raphaelElement;
|
||||
mouseout(handler: Function): raphaelElement;
|
||||
mouseover(handler: Function): raphaelElement;
|
||||
mouseup(handler: Function): raphaelElement;
|
||||
next: raphaelElement;
|
||||
node: Element;
|
||||
onDragOver(f: Function): raphaelElement;
|
||||
paper: raphaelPaper;
|
||||
pause(anim?: raphaelAnimation): raphaelElement;
|
||||
prev: raphaelElement;
|
||||
raphael: raphaelStatic;
|
||||
remove();
|
||||
removeData(key?: string): raphaelElement;
|
||||
resume(anim?: raphaelAnimation): raphaelElement;
|
||||
setTime(anim: raphaelAnimation);
|
||||
setTime(anim: raphaelAnimation, value: number): raphaelElement;
|
||||
show(): raphaelElement;
|
||||
status(): { anim: raphaelAnimation; status: number; }[];
|
||||
status(anim: raphaelAnimation): number;
|
||||
status(anim: raphaelAnimation, value: number): raphaelElement;
|
||||
stop(anim?: raphaelAnimation): raphaelElement;
|
||||
toBack(): raphaelElement;
|
||||
toFront(): raphaelElement;
|
||||
touchcancel(handler: Function): raphaelElement;
|
||||
touchend(handler: Function): raphaelElement;
|
||||
touchmove(handler: Function): raphaelElement;
|
||||
touchstart(handler: Function): raphaelElement;
|
||||
transform(): string;
|
||||
transform(tstr: string): raphaelElement;
|
||||
unclick(handler? ): raphaelElement;
|
||||
undblclick(handler? ): raphaelElement;
|
||||
undrag(): raphaelElement;
|
||||
unhover(): raphaelElement;
|
||||
unhover(f_in, f_out): raphaelElement;
|
||||
unmousedown(handler? ): raphaelElement;
|
||||
unmousemove(handler? ): raphaelElement;
|
||||
unmouseout(handler? ): raphaelElement;
|
||||
unmouseover(handler? ): raphaelElement;
|
||||
unmouseup(handler? ): raphaelElement;
|
||||
untouchcancel(handler? ): raphaelElement;
|
||||
untouchend(handler? ): raphaelElement;
|
||||
untouchmove(handler? ): raphaelElement;
|
||||
untouchstart(handler? ): raphaelElement;
|
||||
}
|
||||
|
||||
interface raphaelPath extends raphaelElement {
|
||||
getPointAtLength(length: number): { x: number; y: number; alpha: number; };
|
||||
getSubpath(from: number, to: number): string;
|
||||
getTotalLength(): number;
|
||||
}
|
||||
|
||||
interface raphaelSet {
|
||||
clear();
|
||||
exclude(element: raphaelElement): bool;
|
||||
forEach(callback: Function, thisArg?: any): raphaelSet;
|
||||
pop(): raphaelElement;
|
||||
push(raphaelElement): raphaelElement;
|
||||
splice(index: number, count: number): raphaelSet;
|
||||
splice(index: number, count: number, ...insertion: raphaelElement[]): raphaelSet;
|
||||
length: number;
|
||||
|
||||
[key: number]: raphaelElement;
|
||||
animate(params: { [key: any]: any; }, ms: number, easing?: string, callback?: Function): raphaelElement;
|
||||
animate(animation: raphaelAnimation): raphaelElement;
|
||||
animateWith(el: raphaelElement, anim: raphaelAnimation, params: JSON, ms: number, easing?: string, callback?: Function): raphaelElement;
|
||||
animateWith(el: raphaelElement, anim: raphaelAnimation, animation: raphaelAnimation): raphaelElement;
|
||||
attr(attrName: string, value: any): raphaelElement;
|
||||
attr(params: { [key: any]: any; }): raphaelElement;
|
||||
attr(attrName: string): any;
|
||||
attr(attrNames: string[]): any[];
|
||||
click(handler: Function): raphaelElement;
|
||||
clone(): raphaelElement;
|
||||
data(key: string): any;
|
||||
data(key: string, value: any): raphaelElement;
|
||||
dblclick(handler: Function): raphaelElement;
|
||||
drag(onmove: (dx: number, dy: number, x: number, y: number, event: DragEvent) =>{ }, onstart: (x: number, y: number, event: DragEvent) =>{ }, onend: (DragEvent) =>{ }, mcontext?: any, scontext?: any, econtext?: any): raphaelElement;
|
||||
getBBox(isWithoutTransform?: bool): boundingBox;
|
||||
glow(glow?: { width?: number; fill?: bool; opacity?: number; offsetx?: number; offsety?: number; color?: string; }): raphaelSet;
|
||||
hide(): raphaelElement;
|
||||
hover(f_in: Function, f_out: Function, icontext?: any, ocontext?: any): raphaelElement;
|
||||
id: string;
|
||||
insertAfter(): raphaelElement;
|
||||
insertBefore(): raphaelElement;
|
||||
isPointInside(x: number, y: number): bool;
|
||||
isVisible(): bool;
|
||||
matrix: raphaelMatrix;
|
||||
mousedown(handler: Function): raphaelElement;
|
||||
mousemove(handler: Function): raphaelElement;
|
||||
mouseout(handler: Function): raphaelElement;
|
||||
mouseover(handler: Function): raphaelElement;
|
||||
mouseup(handler: Function): raphaelElement;
|
||||
next: raphaelElement;
|
||||
onDragOver(f: Function): raphaelElement;
|
||||
paper: raphaelPaper;
|
||||
pause(anim?: raphaelAnimation): raphaelElement;
|
||||
prev: raphaelElement;
|
||||
raphael: raphaelStatic;
|
||||
remove();
|
||||
removeData(key?: string): raphaelElement;
|
||||
resume(anim?: raphaelAnimation): raphaelElement;
|
||||
setTime(anim: raphaelAnimation);
|
||||
setTime(anim: raphaelAnimation, value: number): raphaelElement;
|
||||
show(): raphaelElement;
|
||||
status(): { anim: raphaelAnimation; status: number; }[];
|
||||
status(anim: raphaelAnimation): number;
|
||||
status(anim: raphaelAnimation, value: number): raphaelElement;
|
||||
stop(anim?: raphaelAnimation): raphaelElement;
|
||||
toBack(): raphaelElement;
|
||||
toFront(): raphaelElement;
|
||||
touchcancel(handler: Function): raphaelElement;
|
||||
touchend(handler: Function): raphaelElement;
|
||||
touchmove(handler: Function): raphaelElement;
|
||||
touchstart(handler: Function): raphaelElement;
|
||||
transform(): string;
|
||||
transform(tstr: string): raphaelElement;
|
||||
unclick(handler? ): raphaelElement;
|
||||
undblclick(handler? ): raphaelElement;
|
||||
undrag(): raphaelElement;
|
||||
unhover(): raphaelElement;
|
||||
unhover(f_in, f_out): raphaelElement;
|
||||
unmousedown(handler? ): raphaelElement;
|
||||
unmousemove(handler? ): raphaelElement;
|
||||
unmouseout(handler? ): raphaelElement;
|
||||
unmouseover(handler? ): raphaelElement;
|
||||
unmouseup(handler? ): raphaelElement;
|
||||
untouchcancel(handler? ): raphaelElement;
|
||||
untouchend(handler? ): raphaelElement;
|
||||
untouchmove(handler? ): raphaelElement;
|
||||
untouchstart(handler? ): raphaelElement;
|
||||
}
|
||||
|
||||
interface raphaelMatrix {
|
||||
add(a: number, b: number, c: number, d: number, e: number, f: number, matrix: raphaelMatrix): raphaelMatrix;
|
||||
clone(): raphaelMatrix;
|
||||
invert(): raphaelMatrix;
|
||||
rotate(a: number, x: number, y: number);
|
||||
scale(x: number, y?: number, cx?: number, cy?: number);
|
||||
split(): { dx: number; dy: number; scalex: number; scaley: number; shear: number; rotate: number; isSimple: bool; };
|
||||
toTransformString(): string;
|
||||
translate(x: number, y: number);
|
||||
x(x: number, y: number);
|
||||
y(x: number, y: number);
|
||||
}
|
||||
|
||||
interface raphaelPaper {
|
||||
add(JSON): raphaelSet;
|
||||
bottom: raphaelElement;
|
||||
canvas: Element;
|
||||
circle(x: number, y: number, r: number): raphaelElement;
|
||||
clear();
|
||||
defs: Element;
|
||||
ellipse(x: number, y: number, rx: number, ry: number): raphaelElement;
|
||||
forEach(callback: number, thisArg: any): raphaelStatic;
|
||||
getById(id: number): raphaelElement;
|
||||
getElementByPoint(x: number, y: number): raphaelElement;
|
||||
getElementsByPoint(x: number, y: number): raphaelSet;
|
||||
getFont(family: string, weight?: string, style?: string, stretch?: string): raphaelFont;
|
||||
getFont(family: string, weight?: number, style?: string, stretch?: string): raphaelFont;
|
||||
height: number;
|
||||
image(src: string, x: number, y: number, width: number, height: number): raphaelElement;
|
||||
path(pathString?: string): raphaelPath;
|
||||
print(x: number, y: number, str: string, font: raphaelFont, size?: number, origin?: string, letter_spacing?: number): raphaelPath;
|
||||
rect(x: number, y: number, width: number, height: number, r?: number): raphaelElement;
|
||||
remove();
|
||||
renderfix();
|
||||
safari();
|
||||
set(elements?: raphaelElement[]): raphaelSet;
|
||||
setFinish();
|
||||
setSize(width: number, height: number);
|
||||
setStart();
|
||||
setViewBox(x: number, y: number, w: number, h: number, fit: bool);
|
||||
text(x: number, y: number, text: string): raphaelElement;
|
||||
top: raphaelElement;
|
||||
width: number;
|
||||
}
|
||||
|
||||
interface raphaelStatic {
|
||||
(container: HTMLElement, width: number, height: number, callback?: Function): raphaelPaper;
|
||||
(container: string, width: number, height: number, callback?: Function): raphaelPaper;
|
||||
(x: number, y: number, width: number, height: number, callback?: Function): raphaelPaper;
|
||||
(all: Array, callback?: Function): raphaelPaper;
|
||||
(onReadyCallback?: Function): raphaelPaper;
|
||||
|
||||
angle(x1: number, y1: number, x2: number, y2: number, x3?: number, y3?: number): number;
|
||||
animation(params: JSON, ms: number, easing?: string, callback?: Function): raphaelAnimation;
|
||||
bezierBBox(p1x: number, p1y: number, c1x: number, c1y: number, c2x: number, c2y: number, p2x: number, p2y: number): { min: { x: number; y: number; }; max: { x: number; y: number; }; };
|
||||
bezierBBox(bez: Array): { min: { x: number; y: number; }; max: { x: number; y: number; }; };
|
||||
color(clr: string): { r: number; g: number; b: number; hex: string; error: bool; h: number; s: number; v: number; l: number; };
|
||||
createUUID(): string;
|
||||
deg(deg: number): number;
|
||||
easing_formulas: any;
|
||||
el: any;
|
||||
findDotsAtSegment(p1x: number, p1y: number, c1x: number, c1y: number, c2x: number, c2y: number, p2x: number, p2y: number, t: number): { x: number; y: number; m: { x: number; y: number; }; n: { x: number; y: number; }; start: { x: number; y: number; }; end: { x: number; y: number; }; alpha: number; };
|
||||
fn: any;
|
||||
format(token: string, ...parameters: any[]): string;
|
||||
fullfill(token: string, json: JSON): string;
|
||||
getColor(value?: number): string;
|
||||
getColor: { reset(); };
|
||||
getPointAtLength(path: string, length: number): { x: number; y: number; alpha: number; };
|
||||
getRGB(colour:string):{ r: number; g: number; b: number; hex: string; error: bool; };
|
||||
getSubpath(path: string, from: number, to: number): string;
|
||||
getTotalLength(path: string): number;
|
||||
hsb(h: number, s: number, b: number): string;
|
||||
hsb2rgb(h: number, s: number, v: number): { r: number; g: number; b: number; hex: string; };
|
||||
hsl(h: number, s: number, l: number): string;
|
||||
hsl2rgb(h: number, s: number, l: number): { r: number; g: number; b: number; hex: string; };
|
||||
is(o: any, type: string): bool;
|
||||
isBBoxIntersect(bbox1: string, bbox2: string): bool;
|
||||
isPointInsideBBox(bbox: string, x: number, y: number): bool;
|
||||
isPointInsidePath(path: string, x: number, y: number): bool;
|
||||
matrix(a: number, b: number, c: number, d: number, e: number, f: number): raphaelMatrix;
|
||||
ninja();
|
||||
parsePathString(pathString: string): string[];
|
||||
parsePathString(pathString: string[]): string[];
|
||||
parseTransformString(TString: string): string[];
|
||||
parseTransformString(TString: string[]): string[];
|
||||
path2curve(pathString: string): string[];
|
||||
path2curve(pathString: string[]): string[];
|
||||
pathBBox(path: string): boundingBox;
|
||||
pathIntersection(path1: string, path2: string): { x: number; y: number; t1: number; t2: number; segment1: number; segment2: number; bez1: Array; bez2: Array; }[];
|
||||
pathToRelative(pathString: string): string[];
|
||||
pathToRelative(pathString: string[]): string[];
|
||||
rad(deg: number): number;
|
||||
registerFont(font: raphaelFont): raphaelFont;
|
||||
rgb(r: number, g: number, b: number): string;
|
||||
rgb2hsb(r: number, g: number, b: number): { h: number; s: number; b: number; };
|
||||
rgb2hsl(r: number, g: number, b: number): { h: number; s: number; l: number; };
|
||||
setWindow(newwin: Window);
|
||||
snapTo(values: number, value: number, tolerance?: number): number;
|
||||
snapTo(values: number[], value: number, tolerance?: number): number;
|
||||
st: any;
|
||||
svg: bool;
|
||||
toMatrix(path: string, transform: string): raphaelMatrix;
|
||||
toMatrix(path: string, transform: string[]): raphaelMatrix;
|
||||
transformPath(path: string, transform: string): string;
|
||||
transformPath(path: string, transform: string[]): string;
|
||||
type: string;
|
||||
vml: bool;
|
||||
}
|
||||
|
||||
// Type definitions for Raphael 2.1
|
||||
// Project: http://raphaeljs.com
|
||||
// Definitions by: https://github.com/CheCoxshall
|
||||
// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
|
||||
interface boundingBox {
|
||||
x: number;
|
||||
y: number;
|
||||
x2: number;
|
||||
y2: number;
|
||||
width: number;
|
||||
height: number;
|
||||
}
|
||||
|
||||
interface raphaelAnimation {
|
||||
delay(delay: number): raphaelAnimation;
|
||||
repeat(repeat: number): raphaelAnimation;
|
||||
}
|
||||
|
||||
interface raphaelFont {
|
||||
|
||||
}
|
||||
|
||||
interface raphaelElement {
|
||||
animate(params: { [key: any]: any; }, ms: number, easing?: string, callback?: Function): raphaelElement;
|
||||
animate(animation: raphaelAnimation): raphaelElement;
|
||||
animateWith(el: raphaelElement, anim: raphaelAnimation, params: JSON, ms: number, easing?: string, callback?: Function): raphaelElement;
|
||||
animateWith(el: raphaelElement, anim: raphaelAnimation, animation: raphaelAnimation): raphaelElement;
|
||||
attr(attrName: string, value: any): raphaelElement;
|
||||
attr(params: { [key: any]: any; }): raphaelElement;
|
||||
attr(attrName: string): any;
|
||||
attr(attrNames: string[]): any[];
|
||||
click(handler: Function): raphaelElement;
|
||||
clone(): raphaelElement;
|
||||
data(key: string): any;
|
||||
data(key: string, value: any): raphaelElement;
|
||||
dblclick(handler: Function): raphaelElement;
|
||||
drag(onmove: (dx: number, dy: number, x: number, y: number, event: DragEvent) =>{ }, onstart: (x: number, y: number, event: DragEvent) =>{ }, onend: (DragEvent) =>{ }, mcontext?: any, scontext?: any, econtext?: any): raphaelElement;
|
||||
getBBox(isWithoutTransform?: bool): boundingBox;
|
||||
glow(glow?: { width?: number; fill?: bool; opacity?: number; offsetx?: number; offsety?: number; color?: string; }): raphaelSet;
|
||||
hide(): raphaelElement;
|
||||
hover(f_in: Function, f_out: Function, icontext?: any, ocontext?: any): raphaelElement;
|
||||
id: string;
|
||||
insertAfter(): raphaelElement;
|
||||
insertBefore(): raphaelElement;
|
||||
isPointInside(x: number, y: number): bool;
|
||||
isVisible(): bool;
|
||||
matrix: raphaelMatrix;
|
||||
mousedown(handler: Function): raphaelElement;
|
||||
mousemove(handler: Function): raphaelElement;
|
||||
mouseout(handler: Function): raphaelElement;
|
||||
mouseover(handler: Function): raphaelElement;
|
||||
mouseup(handler: Function): raphaelElement;
|
||||
next: raphaelElement;
|
||||
node: Element;
|
||||
onDragOver(f: Function): raphaelElement;
|
||||
paper: raphaelPaper;
|
||||
pause(anim?: raphaelAnimation): raphaelElement;
|
||||
prev: raphaelElement;
|
||||
raphael: raphaelStatic;
|
||||
remove();
|
||||
removeData(key?: string): raphaelElement;
|
||||
resume(anim?: raphaelAnimation): raphaelElement;
|
||||
setTime(anim: raphaelAnimation);
|
||||
setTime(anim: raphaelAnimation, value: number): raphaelElement;
|
||||
show(): raphaelElement;
|
||||
status(): { anim: raphaelAnimation; status: number; }[];
|
||||
status(anim: raphaelAnimation): number;
|
||||
status(anim: raphaelAnimation, value: number): raphaelElement;
|
||||
stop(anim?: raphaelAnimation): raphaelElement;
|
||||
toBack(): raphaelElement;
|
||||
toFront(): raphaelElement;
|
||||
touchcancel(handler: Function): raphaelElement;
|
||||
touchend(handler: Function): raphaelElement;
|
||||
touchmove(handler: Function): raphaelElement;
|
||||
touchstart(handler: Function): raphaelElement;
|
||||
transform(): string;
|
||||
transform(tstr: string): raphaelElement;
|
||||
unclick(handler? ): raphaelElement;
|
||||
undblclick(handler? ): raphaelElement;
|
||||
undrag(): raphaelElement;
|
||||
unhover(): raphaelElement;
|
||||
unhover(f_in, f_out): raphaelElement;
|
||||
unmousedown(handler? ): raphaelElement;
|
||||
unmousemove(handler? ): raphaelElement;
|
||||
unmouseout(handler? ): raphaelElement;
|
||||
unmouseover(handler? ): raphaelElement;
|
||||
unmouseup(handler? ): raphaelElement;
|
||||
untouchcancel(handler? ): raphaelElement;
|
||||
untouchend(handler? ): raphaelElement;
|
||||
untouchmove(handler? ): raphaelElement;
|
||||
untouchstart(handler? ): raphaelElement;
|
||||
}
|
||||
|
||||
interface raphaelPath extends raphaelElement {
|
||||
getPointAtLength(length: number): { x: number; y: number; alpha: number; };
|
||||
getSubpath(from: number, to: number): string;
|
||||
getTotalLength(): number;
|
||||
}
|
||||
|
||||
interface raphaelSet {
|
||||
clear();
|
||||
exclude(element: raphaelElement): bool;
|
||||
forEach(callback: Function, thisArg?: any): raphaelSet;
|
||||
pop(): raphaelElement;
|
||||
push(raphaelElement): raphaelElement;
|
||||
splice(index: number, count: number): raphaelSet;
|
||||
splice(index: number, count: number, ...insertion: raphaelElement[]): raphaelSet;
|
||||
length: number;
|
||||
|
||||
[key: number]: raphaelElement;
|
||||
animate(params: { [key: any]: any; }, ms: number, easing?: string, callback?: Function): raphaelElement;
|
||||
animate(animation: raphaelAnimation): raphaelElement;
|
||||
animateWith(el: raphaelElement, anim: raphaelAnimation, params: JSON, ms: number, easing?: string, callback?: Function): raphaelElement;
|
||||
animateWith(el: raphaelElement, anim: raphaelAnimation, animation: raphaelAnimation): raphaelElement;
|
||||
attr(attrName: string, value: any): raphaelElement;
|
||||
attr(params: { [key: any]: any; }): raphaelElement;
|
||||
attr(attrName: string): any;
|
||||
attr(attrNames: string[]): any[];
|
||||
click(handler: Function): raphaelElement;
|
||||
clone(): raphaelElement;
|
||||
data(key: string): any;
|
||||
data(key: string, value: any): raphaelElement;
|
||||
dblclick(handler: Function): raphaelElement;
|
||||
drag(onmove: (dx: number, dy: number, x: number, y: number, event: DragEvent) =>{ }, onstart: (x: number, y: number, event: DragEvent) =>{ }, onend: (DragEvent) =>{ }, mcontext?: any, scontext?: any, econtext?: any): raphaelElement;
|
||||
getBBox(isWithoutTransform?: bool): boundingBox;
|
||||
glow(glow?: { width?: number; fill?: bool; opacity?: number; offsetx?: number; offsety?: number; color?: string; }): raphaelSet;
|
||||
hide(): raphaelElement;
|
||||
hover(f_in: Function, f_out: Function, icontext?: any, ocontext?: any): raphaelElement;
|
||||
id: string;
|
||||
insertAfter(): raphaelElement;
|
||||
insertBefore(): raphaelElement;
|
||||
isPointInside(x: number, y: number): bool;
|
||||
isVisible(): bool;
|
||||
matrix: raphaelMatrix;
|
||||
mousedown(handler: Function): raphaelElement;
|
||||
mousemove(handler: Function): raphaelElement;
|
||||
mouseout(handler: Function): raphaelElement;
|
||||
mouseover(handler: Function): raphaelElement;
|
||||
mouseup(handler: Function): raphaelElement;
|
||||
next: raphaelElement;
|
||||
onDragOver(f: Function): raphaelElement;
|
||||
paper: raphaelPaper;
|
||||
pause(anim?: raphaelAnimation): raphaelElement;
|
||||
prev: raphaelElement;
|
||||
raphael: raphaelStatic;
|
||||
remove();
|
||||
removeData(key?: string): raphaelElement;
|
||||
resume(anim?: raphaelAnimation): raphaelElement;
|
||||
setTime(anim: raphaelAnimation);
|
||||
setTime(anim: raphaelAnimation, value: number): raphaelElement;
|
||||
show(): raphaelElement;
|
||||
status(): { anim: raphaelAnimation; status: number; }[];
|
||||
status(anim: raphaelAnimation): number;
|
||||
status(anim: raphaelAnimation, value: number): raphaelElement;
|
||||
stop(anim?: raphaelAnimation): raphaelElement;
|
||||
toBack(): raphaelElement;
|
||||
toFront(): raphaelElement;
|
||||
touchcancel(handler: Function): raphaelElement;
|
||||
touchend(handler: Function): raphaelElement;
|
||||
touchmove(handler: Function): raphaelElement;
|
||||
touchstart(handler: Function): raphaelElement;
|
||||
transform(): string;
|
||||
transform(tstr: string): raphaelElement;
|
||||
unclick(handler? ): raphaelElement;
|
||||
undblclick(handler? ): raphaelElement;
|
||||
undrag(): raphaelElement;
|
||||
unhover(): raphaelElement;
|
||||
unhover(f_in, f_out): raphaelElement;
|
||||
unmousedown(handler? ): raphaelElement;
|
||||
unmousemove(handler? ): raphaelElement;
|
||||
unmouseout(handler? ): raphaelElement;
|
||||
unmouseover(handler? ): raphaelElement;
|
||||
unmouseup(handler? ): raphaelElement;
|
||||
untouchcancel(handler? ): raphaelElement;
|
||||
untouchend(handler? ): raphaelElement;
|
||||
untouchmove(handler? ): raphaelElement;
|
||||
untouchstart(handler? ): raphaelElement;
|
||||
}
|
||||
|
||||
interface raphaelMatrix {
|
||||
add(a: number, b: number, c: number, d: number, e: number, f: number, matrix: raphaelMatrix): raphaelMatrix;
|
||||
clone(): raphaelMatrix;
|
||||
invert(): raphaelMatrix;
|
||||
rotate(a: number, x: number, y: number);
|
||||
scale(x: number, y?: number, cx?: number, cy?: number);
|
||||
split(): { dx: number; dy: number; scalex: number; scaley: number; shear: number; rotate: number; isSimple: bool; };
|
||||
toTransformString(): string;
|
||||
translate(x: number, y: number);
|
||||
x(x: number, y: number);
|
||||
y(x: number, y: number);
|
||||
}
|
||||
|
||||
interface raphaelPaper {
|
||||
add(JSON): raphaelSet;
|
||||
bottom: raphaelElement;
|
||||
canvas: Element;
|
||||
circle(x: number, y: number, r: number): raphaelElement;
|
||||
clear();
|
||||
defs: Element;
|
||||
ellipse(x: number, y: number, rx: number, ry: number): raphaelElement;
|
||||
forEach(callback: number, thisArg: any): raphaelStatic;
|
||||
getById(id: number): raphaelElement;
|
||||
getElementByPoint(x: number, y: number): raphaelElement;
|
||||
getElementsByPoint(x: number, y: number): raphaelSet;
|
||||
getFont(family: string, weight?: string, style?: string, stretch?: string): raphaelFont;
|
||||
getFont(family: string, weight?: number, style?: string, stretch?: string): raphaelFont;
|
||||
height: number;
|
||||
image(src: string, x: number, y: number, width: number, height: number): raphaelElement;
|
||||
path(pathString?: string): raphaelPath;
|
||||
print(x: number, y: number, str: string, font: raphaelFont, size?: number, origin?: string, letter_spacing?: number): raphaelPath;
|
||||
rect(x: number, y: number, width: number, height: number, r?: number): raphaelElement;
|
||||
remove();
|
||||
renderfix();
|
||||
safari();
|
||||
set(elements?: raphaelElement[]): raphaelSet;
|
||||
setFinish();
|
||||
setSize(width: number, height: number);
|
||||
setStart();
|
||||
setViewBox(x: number, y: number, w: number, h: number, fit: bool);
|
||||
text(x: number, y: number, text: string): raphaelElement;
|
||||
top: raphaelElement;
|
||||
width: number;
|
||||
}
|
||||
|
||||
interface raphaelStatic {
|
||||
(container: HTMLElement, width: number, height: number, callback?: Function): raphaelPaper;
|
||||
(container: string, width: number, height: number, callback?: Function): raphaelPaper;
|
||||
(x: number, y: number, width: number, height: number, callback?: Function): raphaelPaper;
|
||||
(all: Array, callback?: Function): raphaelPaper;
|
||||
(onReadyCallback?: Function): raphaelPaper;
|
||||
|
||||
angle(x1: number, y1: number, x2: number, y2: number, x3?: number, y3?: number): number;
|
||||
animation(params: JSON, ms: number, easing?: string, callback?: Function): raphaelAnimation;
|
||||
bezierBBox(p1x: number, p1y: number, c1x: number, c1y: number, c2x: number, c2y: number, p2x: number, p2y: number): { min: { x: number; y: number; }; max: { x: number; y: number; }; };
|
||||
bezierBBox(bez: Array): { min: { x: number; y: number; }; max: { x: number; y: number; }; };
|
||||
color(clr: string): { r: number; g: number; b: number; hex: string; error: bool; h: number; s: number; v: number; l: number; };
|
||||
createUUID(): string;
|
||||
deg(deg: number): number;
|
||||
easing_formulas: any;
|
||||
el: any;
|
||||
findDotsAtSegment(p1x: number, p1y: number, c1x: number, c1y: number, c2x: number, c2y: number, p2x: number, p2y: number, t: number): { x: number; y: number; m: { x: number; y: number; }; n: { x: number; y: number; }; start: { x: number; y: number; }; end: { x: number; y: number; }; alpha: number; };
|
||||
fn: any;
|
||||
format(token: string, ...parameters: any[]): string;
|
||||
fullfill(token: string, json: JSON): string;
|
||||
getColor(value?: number): string;
|
||||
getColor: { reset(); };
|
||||
getPointAtLength(path: string, length: number): { x: number; y: number; alpha: number; };
|
||||
getRGB(colour: string): { r: number; g: number; b: number; hex: string; error: bool; };
|
||||
getSubpath(path: string, from: number, to: number): string;
|
||||
getTotalLength(path: string): number;
|
||||
hsb(h: number, s: number, b: number): string;
|
||||
hsb2rgb(h: number, s: number, v: number): { r: number; g: number; b: number; hex: string; };
|
||||
hsl(h: number, s: number, l: number): string;
|
||||
hsl2rgb(h: number, s: number, l: number): { r: number; g: number; b: number; hex: string; };
|
||||
is(o: any, type: string): bool;
|
||||
isBBoxIntersect(bbox1: string, bbox2: string): bool;
|
||||
isPointInsideBBox(bbox: string, x: number, y: number): bool;
|
||||
isPointInsidePath(path: string, x: number, y: number): bool;
|
||||
matrix(a: number, b: number, c: number, d: number, e: number, f: number): raphaelMatrix;
|
||||
ninja();
|
||||
parsePathString(pathString: string): string[];
|
||||
parsePathString(pathString: string[]): string[];
|
||||
parseTransformString(TString: string): string[];
|
||||
parseTransformString(TString: string[]): string[];
|
||||
path2curve(pathString: string): string[];
|
||||
path2curve(pathString: string[]): string[];
|
||||
pathBBox(path: string): boundingBox;
|
||||
pathIntersection(path1: string, path2: string): { x: number; y: number; t1: number; t2: number; segment1: number; segment2: number; bez1: Array; bez2: Array; }[];
|
||||
pathToRelative(pathString: string): string[];
|
||||
pathToRelative(pathString: string[]): string[];
|
||||
rad(deg: number): number;
|
||||
registerFont(font: raphaelFont): raphaelFont;
|
||||
rgb(r: number, g: number, b: number): string;
|
||||
rgb2hsb(r: number, g: number, b: number): { h: number; s: number; b: number; };
|
||||
rgb2hsl(r: number, g: number, b: number): { h: number; s: number; l: number; };
|
||||
setWindow(newwin: Window);
|
||||
snapTo(values: number, value: number, tolerance?: number): number;
|
||||
snapTo(values: number[], value: number, tolerance?: number): number;
|
||||
st: any;
|
||||
svg: bool;
|
||||
toMatrix(path: string, transform: string): raphaelMatrix;
|
||||
toMatrix(path: string, transform: string[]): raphaelMatrix;
|
||||
transformPath(path: string, transform: string): string;
|
||||
transformPath(path: string, transform: string[]): string;
|
||||
type: string;
|
||||
vml: bool;
|
||||
}
|
||||
|
||||
declare var Raphael: raphaelStatic;
|
||||
@@ -35,5 +35,4 @@ Next
|
||||
* jQuery.Validate
|
||||
* PhoneGap
|
||||
* Isotope
|
||||
* Reveal.js
|
||||
* ember.js
|
||||
@@ -0,0 +1,55 @@
|
||||
/// <reference path="../Definitions/raphael-2.1.d.ts" />
|
||||
|
||||
var paper = Raphael(10, 50, 320, 200);
|
||||
var circle = paper.circle(50, 40, 10);
|
||||
circle.attr("fill", "#f00");
|
||||
circle.attr("stroke", "#fff");
|
||||
|
||||
var anim = Raphael.animation({ cx: 10, cy: 20 }, 2e3);
|
||||
|
||||
paper.circle(320, 240, 60).animate({ fill: "#223fa3", stroke: "#000", "stroke-width": 80, "stroke-opacity": 0.5 }, 2000);
|
||||
|
||||
declare var img, src;
|
||||
img.style.display = "none";
|
||||
var r = Raphael("holder", 600, 540);
|
||||
r.image(img.src, 140, 140, 320, 240);
|
||||
|
||||
document.getElementById("holder").innerHTML = "";
|
||||
var R = Raphael("holder", 640, 480);
|
||||
R.circle(320, 240, 200).attr({ fill: "#000", "fill-opacity": .5, "stroke-width": 5 });
|
||||
var img2 = R.image(src, 160, 120, 320, 240);
|
||||
var butt1 = R.set(),
|
||||
butt2 = R.set();
|
||||
butt1.push(R.circle(24.833, 26.917, 26.667).attr({ stroke: "#ccc", fill: "#fff", "fill-opacity": .4, "stroke-width": 2 }),
|
||||
R.path("M12.582,9.551C3.251,16.237,0.921,29.021,7.08,38.564l-2.36,1.689l4.893,2.262l4.893,2.262l-0.568-5.36l-0.567-5.359l-2.365,1.694c-4.657-7.375-2.83-17.185,4.352-22.33c7.451-5.338,17.817-3.625,23.156,3.824c5.337,7.449,3.625,17.813-3.821,23.152l2.857,3.988c9.617-6.893,11.827-20.277,4.935-29.896C35.591,4.87,22.204,2.658,12.582,9.551z").attr({ stroke: "none", fill: "#000" }),
|
||||
R.circle(24.833, 26.917, 26.667).attr({ fill: "#fff", opacity: 0 }));
|
||||
butt2.push(R.circle(24.833, 26.917, 26.667).attr({ stroke: "#ccc", fill: "#fff", "fill-opacity": .4, "stroke-width": 2 }),
|
||||
R.path("M37.566,9.551c9.331,6.686,11.661,19.471,5.502,29.014l2.36,1.689l-4.893,2.262l-4.893,2.262l0.568-5.36l0.567-5.359l2.365,1.694c4.657-7.375,2.83-17.185-4.352-22.33c-7.451-5.338-17.817-3.625-23.156,3.824C6.3,24.695,8.012,35.06,15.458,40.398l-2.857,3.988C2.983,37.494,0.773,24.109,7.666,14.49C14.558,4.87,27.944,2.658,37.566,9.551z").attr({ stroke: "none", fill: "#000" }),
|
||||
R.circle(24.833, 26.917, 26.667).attr({ fill: "#fff", opacity: 0 }));
|
||||
butt1.translate(10, 181);
|
||||
butt2.translate(10, 245);
|
||||
butt1[2].click(function () {
|
||||
angle -= 90;
|
||||
img.stop().animate({ transform: "r" + angle }, 1000, "<>");
|
||||
}).mouseover(function () {
|
||||
butt1[1].animate({ fill: "#fc0" }, 300);
|
||||
}).mouseout(function () {
|
||||
butt1[1].stop().attr({ fill: "#000" });
|
||||
});
|
||||
butt2[2].click(function () {
|
||||
angle += 90;
|
||||
img.animate({ transform: "r" + angle }, 1000, "<>");
|
||||
}).mouseover(function () {
|
||||
butt2[1].animate({ fill: "#fc0" }, 300);
|
||||
}).mouseout(function () {
|
||||
butt2[1].stop().attr({ fill: "#000" });
|
||||
});
|
||||
|
||||
var hldr = document.getElementById("holder"),
|
||||
text = hldr.innerHTML.replace(/^\s+|\s+$|<[^>]+>/g, "");
|
||||
hldr.innerHTML = "";
|
||||
var R2 = Raphael("holder", 640, 480),
|
||||
txt = [],
|
||||
attr = { font: "50px Helvetica", opacity: 0.5 };
|
||||
txt[0] = R2.text(320, 240, text).attr(attr).attr({ fill: "#0f0" });
|
||||
R.safari();
|
||||
Reference in New Issue
Block a user