diff --git a/createjs/createjs.d.ts b/createjs/createjs.d.ts
index 9e66e79ee..7e6be561a 100644
--- a/createjs/createjs.d.ts
+++ b/createjs/createjs.d.ts
@@ -65,19 +65,19 @@ declare module createjs {
constructor();
// methods
- addEventListener(type: string, listener: Function, useCapture?: boolean): any;
+ addEventListener(type: string, listener: (eventObj: Object) => any, useCapture?: boolean): any;
addEventListener(type: string, listener: Object, useCapture?: boolean): any;
dispatchEvent(eventObj: Object, target?: Object): boolean;
dispatchEvent(eventObj: string, target?: Object): boolean;
dispatchEvent(eventObj: Event, target?: Object): boolean;
hasEventListener(type: string): boolean;
static initialize(target: Object): void;
- off(type: string, listener: Function, useCapture?: boolean): void;
+ off(type: string, listener: (eventObj: Object) => any, useCapture?: boolean): void;
off(type: string, listener: Object, useCapture?: boolean): void;
- on(type: string, listener, scope?: Function, once?: boolean, data?: any, useCapture?: boolean): Function;
- on(type: string, listener, scope?: Object, once?: boolean, data?: any, useCapture?: boolean): Function;
+ on(type: string, listener: (eventObj: Object) => any, scope?: Object, once?: boolean, data?: any, useCapture?: boolean): Function;
+ on(type: string, listener: Object, scope?: Object, once?: boolean, data?: any, useCapture?: boolean): Function;
removeAllEventListeners(type?: string): void;
- removeEventListener(type: string, listener: Function, useCapture?: boolean): void;
+ removeEventListener(type: string, listener: (eventObj: Object) => any, useCapture?: boolean): void;
removeEventListener(type: string, listener: Object, useCapture?: boolean): void;
toString(): string;
}
diff --git a/easeljs/easeljs-tests.ts b/easeljs/easeljs-tests.ts
index 268e7381e..75eabca23 100644
--- a/easeljs/easeljs-tests.ts
+++ b/easeljs/easeljs-tests.ts
@@ -30,7 +30,7 @@ function test_animation() {
ss.getAnimation("run").next = "jump";
ss.getAnimation("jump").next = "run";
- var sprite = new createjs.Sprite(ss);
+ var sprite:createjs.Sprite = new createjs.Sprite(ss);
sprite.scaleY = sprite.scaleX = .4;
sprite.gotoAndPlay("run");
diff --git a/easeljs/easeljs.d.ts b/easeljs/easeljs.d.ts
index cdc798f63..d72dfa14c 100644
--- a/easeljs/easeljs.d.ts
+++ b/easeljs/easeljs.d.ts
@@ -398,7 +398,7 @@ declare module createjs {
// properties
static BASE_64: Object;
- static Command: Function;
+ static Command: any;
static STROKE_CAPS_MAP: string[];
static STROKE_JOINTS_MAP: string[];
@@ -431,7 +431,7 @@ declare module createjs {
endStroke(): Graphics;
static getHSL(hue: number, saturation: number, lightness: number, alpha?: number): string;
static getRGB(r: number, g: number, b: number, alpha?: number): string;
- inject(callback: Function, data: Object): Graphics;
+ inject(callback: (data: any) => any, data: any): Graphics;
isEmpty(): boolean;
lineTo(x: number, y: number): Graphics;
moveTo(x: number, y: number): Graphics;
@@ -540,22 +540,6 @@ declare module createjs {
clone(): MouseEvent;
toString(): string;
- // EventDispatcher mixins
- addEventListener(type: string, listener: Function, useCapture?: boolean): any;
- addEventListener(type: string, listener: Object, useCapture?: boolean): any;
- dispatchEvent(eventObj: Object, target?: Object): boolean;
- dispatchEvent(eventObj: string, target?: Object): boolean;
- dispatchEvent(eventObj: Event, target?: Object): boolean;
- hasEventListener(type: string): boolean;
- static initialize(target: Object): void;
- off(type: string, listener: Function, useCapture?: boolean): void;
- off(type: string, listener: Object, useCapture?: boolean): void;
- on(type: string, listener, scope?: Function, once?: boolean, data?: any, useCapture?: boolean): Function;
- on(type: string, listener, scope?: Object, once?: boolean, data?: any, useCapture?: boolean): Function;
- removeAllEventListeners(type?: string): void;
- removeEventListener(type: string, listener: Function, useCapture?: boolean): void;
- removeEventListener(type: string, listener: Object, useCapture?: boolean): void;
-
// events
/*
mousemove: (event: MouseEvent) => any; // deprecated
@@ -664,8 +648,8 @@ declare module createjs {
export class Sprite extends DisplayObject {
- constructor(spriteSheet: SpriteSheet, frameOrAnimation: string);
- constructor(spriteSheet: SpriteSheet, frameOrAnimation: number);
+ constructor(spriteSheet: SpriteSheet, frameOrAnimation?: string);
+ constructor(spriteSheet: SpriteSheet, frameOrAnimation?: number);
// properties
currentAnimation: string;
@@ -861,18 +845,18 @@ declare module createjs {
static setPaused(value: boolean): void;
// EventDispatcher mixins
- static addEventListener(type: string, listener: Function, useCapture?: boolean): any;
+ static addEventListener(type: string, listener: (eventObj: Object) => any, useCapture?: boolean): any;
static addEventListener(type: string, listener: Object, useCapture?: boolean): any;
static dispatchEvent(eventObj: Object, target?: Object): boolean;
static dispatchEvent(eventObj: string, target?: Object): boolean;
static dispatchEvent(eventObj: Event, target?: Object): boolean;
static hasEventListener(type: string): boolean;
- static off(type: string, listener: Function, useCapture?: boolean): void;
+ static off(type: string, listener: (eventObj: Object) => any, useCapture?: boolean): void;
static off(type: string, listener: Object, useCapture?: boolean): void;
- static on(type: string, listener, scope?: Function, once?: boolean, data?: any, useCapture?: boolean): Function;
- static on(type: string, listener, scope?: Object, once?: boolean, data?: any, useCapture?: boolean): Function;
+ static on(type: string, listener: (eventObj: Object) => any, scope?: Object, once?: boolean, data?: any, useCapture?: boolean): Function;
+ static on(type: string, listener: Object, scope?: Object, once?: boolean, data?: any, useCapture?: boolean): Function;
static removeAllEventListeners(type?: string): void;
- static removeEventListener(type: string, listener: Function, useCapture?: boolean): void;
+ static removeEventListener(type: string, listener: (eventObj: Object) => any, useCapture?: boolean): void;
static removeEventListener(type: string, listener: Object, useCapture?: boolean): void;
// events
diff --git a/preloadjs/preloadjs.d.ts b/preloadjs/preloadjs.d.ts
index 3ac27237d..21ace1154 100644
--- a/preloadjs/preloadjs.d.ts
+++ b/preloadjs/preloadjs.d.ts
@@ -65,7 +65,7 @@ declare module createjs {
// methods
getItem(value: string): Object;
getResult(value: string, rawResult?: boolean): Object;
- installPlugin(plugin: Function): void;
+ installPlugin(plugin: any): void;
loadFile(file: Object, loadNow?: boolean, basePath?: string): void;
loadFile(file: string, loadNow?: boolean, basePath?: string): void;
loadManifest(manifest: Object[], loadNow?: boolean, basePath?: string): void;
diff --git a/soundjs/soundjs-tests.ts b/soundjs/soundjs-tests.ts
index 419587c25..fed2f37ff 100644
--- a/soundjs/soundjs-tests.ts
+++ b/soundjs/soundjs-tests.ts
@@ -5,7 +5,7 @@
// Feature set example:
createjs.Sound.addEventListener("fileload", createjs.proxy(this.loadHandler, this));
createjs.Sound.registerSound("path/to/mySound.mp3|path/to/mySound.ogg", "sound");
-function loadHandler(event) {
+function loadHandler(event):void {
// This is fired for each sound that is registered.
var instance = createjs.Sound.play("sound"); // play using id. Could also use full sourcepath or event.src.
instance.addEventListener("complete", createjs.proxy(this.handleComplete, this));
diff --git a/soundjs/soundjs.d.ts b/soundjs/soundjs.d.ts
index 27b505501..d5836d3ef 100644
--- a/soundjs/soundjs.d.ts
+++ b/soundjs/soundjs.d.ts
@@ -122,19 +122,19 @@ declare module createjs {
*/
// EventDispatcher mixins
- static addEventListener(type: string, listener: Function, useCapture?: boolean): any;
+ static addEventListener(type: string, listener: (eventObj: Object) => any, useCapture?: boolean): any;
static addEventListener(type: string, listener: Object, useCapture?: boolean): any;
static dispatchEvent(eventObj: Object, target?: Object): boolean;
static dispatchEvent(eventObj: string, target?: Object): boolean;
static dispatchEvent(eventObj: Event, target?: Object): boolean;
static hasEventListener(type: string): boolean;
- static off(type: string, listener: Function, useCapture?: boolean): void;
+ static off(type: string, listener: (eventObj: Object) => any, useCapture?: boolean): void;
static off(type: string, listener: Object, useCapture?: boolean): void;
- static on(type: string, listener, scope?: Function, once?: boolean, data?: any, useCapture?: boolean): Function;
- static on(type: string, listener, scope?: Object, once?: boolean, data?: any, useCapture?: boolean): Function;
- static removeEventListener(type: string, listener: Function, useCapture?: boolean): void;
- static removeEventListener(type: string, listener: Object, useCapture?: boolean): void;
+ static on(type: string, listener: (eventObj: Object) => any, scope?: Object, once?: boolean, data?: any, useCapture?: boolean): Function;
+ static on(type: string, listener: Object, scope?: Object, once?: boolean, data?: any, useCapture?: boolean): Function;
static removeAllEventListeners(type?: string): void;
+ static removeEventListener(type: string, listener: (eventObj: Object) => any, useCapture?: boolean): void;
+ static removeEventListener(type: string, listener: Object, useCapture?: boolean): void;
}
@@ -211,6 +211,6 @@ declare module createjs {
removeFromPreload(src: string): void;
removeSound(src: string): void;
setMute(value: boolean): boolean;
- setVolume(value: Number): boolean;
+ setVolume(value: number): boolean;
}
}
diff --git a/tweenjs/tweenjs-tests.ts b/tweenjs/tweenjs-tests.ts
index 2eeef2f90..63b0752e9 100644
--- a/tweenjs/tweenjs-tests.ts
+++ b/tweenjs/tweenjs-tests.ts
@@ -1,6 +1,7 @@
///
+///
-declare var target;
+var target: createjs.DisplayObject = new createjs.DisplayObject();
var Tween = createjs.Tween;
// source : http://www.createjs.com/Docs/TweenJS/modules/TweenJS.html
diff --git a/tweenjs/tweenjs.d.ts b/tweenjs/tweenjs.d.ts
index 171642e6e..a1e622c5a 100644
--- a/tweenjs/tweenjs.d.ts
+++ b/tweenjs/tweenjs.d.ts
@@ -142,7 +142,7 @@ declare module createjs {
target: Object;
// methods
- call(callback: Function, params?: any[], scope?: Object): Tween;
+ call(callback: (...params: any[]) => any, params?: any[], scope?: Object): Tween;
static get(target: Object, props?: Object, pluginData?: Object, override?: boolean): Tween;
static hasActiveTweens(target?: Object): boolean;
static installPlugin(plugin: Object, properties: any[]): void;