Skip to content

Commit 380322a

Browse files
committed
update to EaselJS v0.7.1.
1 parent 7bbf3c4 commit 380322a

File tree

3 files changed

+86
-74
lines changed

3 files changed

+86
-74
lines changed

createjs/createjs.d.ts

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Type definitions for EaselJS 0.7.0, TweenJS 0.5.0, SoundJS 0.5.0, PreloadJS 0.4.0
1+
// Type definitions for EaselJS 0.7.1, TweenJS 0.5.1, SoundJS 0.5.2, PreloadJS 0.4.1
22
// Project: http://www.createjs.com/#!/EaselJS
33
// Definitions by: Pedro Ferreira <https://bitbucket.org/drk4>
44
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -23,13 +23,13 @@ declare module createjs {
2323
// properties
2424
bubbles: boolean;
2525
cancelable: boolean;
26-
currentTarget: Object;
26+
currentTarget: any; // It is 'Object' type officially, but 'any' is easier to use.
2727
defaultPrevented: boolean;
2828
eventPhase: number;
2929
immediatePropagationStopped: boolean;
3030
propagationStopped: boolean;
3131
removed: boolean;
32-
target: Object;
32+
target: any; // It is 'Object' type officially, but 'any' is easier to use.
3333
timeStamp: number;
3434
type: string;
3535

@@ -38,15 +38,15 @@ declare module createjs {
3838
delta: number;
3939
error: string;
4040
id: string;
41-
item: any;
42-
loaded: number;
41+
item: any;
42+
loaded: number;
4343
name: string;
4444
next: string;
45-
params: any[];
45+
params: any;
4646
paused: boolean;
4747
progress: number;
48-
rawResult: Object;
49-
result: Object;
48+
rawResult: any;
49+
result: any;
5050
runTime: number;
5151
src: string;
5252
time: number;
@@ -78,16 +78,19 @@ declare module createjs {
7878
off(type: string, listener: (eventObj: Object) => void, useCapture?: boolean): void;
7979
off(type: string, listener: { handleEvent: (eventObj: Object) => boolean; }, useCapture?: boolean): void;
8080
off(type: string, listener: { handleEvent: (eventObj: Object) => void; }, useCapture?: boolean): void;
81-
on(type: string, listener: (eventObj: Object) => boolean, useCapture?: boolean): Function;
82-
on(type: string, listener: (eventObj: Object) => void, useCapture?: boolean): Function;
83-
on(type: string, listener: { handleEvent: (eventObj: Object) => boolean; }, useCapture?: boolean): Object;
84-
on(type: string, listener: { handleEvent: (eventObj: Object) => void; }, useCapture?: boolean): Object;
81+
off(type: string, listener: Function, useCapture?: boolean): void; // It is necessary for "arguments.callee"
82+
on(type: string, listener: (eventObj: Object) => boolean, scope?: Object, once?: boolean, data?: any, useCapture?: boolean): Function;
83+
on(type: string, listener: (eventObj: Object) => void, scope?: Object, once?: boolean, data?: any, useCapture?: boolean): Function;
84+
on(type: string, listener: { handleEvent: (eventObj: Object) => boolean; }, scope?: Object, once?: boolean, data?: any, useCapture?: boolean): Object;
85+
on(type: string, listener: { handleEvent: (eventObj: Object) => void; }, scope?: Object, once?: boolean, data?: any, useCapture?: boolean): Object;
8586
removeAllEventListeners(type?: string): void;
8687
removeEventListener(type: string, listener: (eventObj: Object) => boolean, useCapture?: boolean): void;
8788
removeEventListener(type: string, listener: (eventObj: Object) => void, useCapture?: boolean): void;
8889
removeEventListener(type: string, listener: { handleEvent: (eventObj: Object) => boolean; }, useCapture?: boolean): void;
8990
removeEventListener(type: string, listener: { handleEvent: (eventObj: Object) => void; }, useCapture?: boolean): void;
91+
removeEventListener(type: string, listener: Function, useCapture?: boolean): void; // It is necessary for "arguments.callee"
9092
toString(): string;
93+
willTrigger(type: string): boolean;
9194
}
9295

9396
export function indexOf(array: any[], searchElement: Object): number;

easeljs/easeljs-tests.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,16 @@ function test_graphics() {
5353

5454
var myGraphics: createjs.Graphics;
5555
myGraphics.beginStroke("#F00").beginFill("#00F").drawRect(20, 20, 100, 50).draw(myContext2D);
56+
}
57+
58+
function colorMatrixTest() {
59+
var shape = new createjs.Shape().set({ x: 100, y: 100 });
60+
shape.graphics.beginFill("#ff0000").drawCircle(0, 0, 50);
61+
62+
var matrix = new createjs.ColorMatrix().adjustHue(180).adjustSaturation(100);
63+
shape.filters = [
64+
new createjs.ColorMatrixFilter(matrix)
65+
];
66+
67+
shape.cache(-50, -50, 100, 100);
5668
}

0 commit comments

Comments
 (0)