From 47b04c598595640bffdd56d13148d11946514c49 Mon Sep 17 00:00:00 2001 From: Jan Zarnikov Date: Thu, 5 Dec 2013 12:14:18 +0100 Subject: [PATCH 1/2] raphael - made types of dom-elements more specific --- raphael/raphael.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/raphael/raphael.d.ts b/raphael/raphael.d.ts index e201a1d1bf..2b9dc0858e 100644 --- a/raphael/raphael.d.ts +++ b/raphael/raphael.d.ts @@ -53,7 +53,7 @@ interface RaphaelElement { mouseover(handler: Function): RaphaelElement; mouseup(handler: Function): RaphaelElement; next: RaphaelElement; - node: Element; + node: SVGElement; onDragOver(f: Function): RaphaelElement; paper: RaphaelPaper; pause(anim?: RaphaelAnimation): RaphaelElement; @@ -195,10 +195,10 @@ interface RaphaelMatrix { interface RaphaelPaper { add(JSON): RaphaelSet; bottom: RaphaelElement; - canvas: Element; + canvas: SVGSVGElement; circle(x: number, y: number, r: number): RaphaelElement; clear(); - defs: Element; + defs: SVGDefsElement; ellipse(x: number, y: number, rx: number, ry: number): RaphaelElement; forEach(callback: number, thisArg: any): RaphaelStatic; getById(id: number): RaphaelElement; From 5b340615406e6ad8085a521fa8da2f19456e4903 Mon Sep 17 00:00:00 2001 From: Jan Zarnikov Date: Thu, 5 Dec 2013 12:31:53 +0100 Subject: [PATCH 2/2] tween.js - more detailed definition of callback functions, added new yoyo() and repeat() function to Tween --- tween.js/tween.js.d.ts | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/tween.js/tween.js.d.ts b/tween.js/tween.js.d.ts index 9b6d387f37..df5826bd21 100644 --- a/tween.js/tween.js.d.ts +++ b/tween.js/tween.js.d.ts @@ -1,6 +1,6 @@ -// Type definitions for tween.js r7 +// Type definitions for tween.js r12 // Project: https://github.com/sole/tween.js/ -// Definitions by: https://github.com/sunetos +// Definitions by: https://github.com/sunetos and https://github.com/jzarnikov // Definitions: https://github.com/borisyankov/DefinitelyTyped declare module TWEEN { @@ -9,7 +9,7 @@ declare module TWEEN { export function removeAll(): void; export function add(tween:Tween): void; export function remove(tween:Tween): void; - export function update(time:number): boolean; + export function update(time?:number): boolean; export class Tween { constructor(object?:any); @@ -17,13 +17,15 @@ declare module TWEEN { start(time?:number): Tween; stop(): Tween; delay(amount:number): Tween; - easing(easing): Tween; - interpolation(interpolation:Function): Tween; + easing(easing: (k: number) => number): Tween; + interpolation(interpolation: (v:number[], k:number) => number): Tween; chain(...tweens:Tween[]): Tween; - onStart(callback:Function): Tween; - onUpdate(callback:Function): Tween; - onComplete(callback:Function): Tween; - update(time: number): boolean; + onStart(callback: (object?: any) => void): Tween; + onUpdate(callback: (object?: any) => void): Tween; + onComplete(callback: (object?: any) => void): Tween; + update(time: number): boolean; + repeat(times: number): Tween; + yoyo(enable: boolean): Tween; } export var Easing: TweenEasing; export var Interpolation: TweenInterpolation;