forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreatejs.d.ts
102 lines (92 loc) · 6.21 KB
/
createjs.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
// Type definitions for EaselJS 0.7.1, TweenJS 0.5.1, SoundJS 0.5.2, PreloadJS 0.4.1
// Project: http://www.createjs.com/#!/EaselJS
// Definitions by: Pedro Ferreira <https://bitbucket.org/drk4>, Chris Smith <https://github.com/evilangelist>, Satoru Kimura <https://github.com/gyohk>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/*
Copyright (c) 2012 Pedro Ferreira
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
// Common class and methods for CreateJS.
// Library documentation : http://www.createjs.com/Docs/EaselJS/modules/EaselJS.html
// Library documentation : http://www.createjs.com/Docs/PreloadJS/modules/PreloadJS.html
// Library documentation : http://www.createjs.com/Docs/SoundJS/modules/SoundJS.html
// Library documentation : http://www.createjs.com/Docs/TweenJS/modules/TweenJS.html
declare module createjs {
export class Event {
constructor(type: string, bubbles: boolean, cancelable: boolean);
// properties
bubbles: boolean;
cancelable: boolean;
currentTarget: any; // It is 'Object' type officially, but 'any' is easier to use.
defaultPrevented: boolean;
eventPhase: number;
immediatePropagationStopped: boolean;
propagationStopped: boolean;
removed: boolean;
target: any; // It is 'Object' type officially, but 'any' is easier to use.
timeStamp: number;
type: string;
// other event payloads
data: any;
delta: number;
error: string;
id: string;
item: any;
loaded: number;
name: string;
next: string;
params: any;
paused: boolean;
progress: number;
rawResult: any;
result: any;
runTime: number;
src: string;
time: number;
total: number;
// methods
clone(): Event;
preventDefault(): void;
remove(): void;
stopImmediatePropagation(): void;
stopPropagation(): void;
toString(): string;
}
export class EventDispatcher {
constructor();
// methods
addEventListener(type: string, listener: (eventObj: Object) => boolean, useCapture?: boolean): Function;
addEventListener(type: string, listener: (eventObj: Object) => void, useCapture?: boolean): Function;
addEventListener(type: string, listener: { handleEvent: (eventObj: Object) => boolean; }, useCapture?: boolean): Object;
addEventListener(type: string, listener: { handleEvent: (eventObj: Object) => void; }, useCapture?: boolean): Object;
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: (eventObj: Object) => boolean, useCapture?: boolean): void;
off(type: string, listener: (eventObj: Object) => void, useCapture?: boolean): void;
off(type: string, listener: { handleEvent: (eventObj: Object) => boolean; }, useCapture?: boolean): void;
off(type: string, listener: { handleEvent: (eventObj: Object) => void; }, useCapture?: boolean): void;
off(type: string, listener: Function, useCapture?: boolean): void; // It is necessary for "arguments.callee"
on(type: string, listener: (eventObj: Object) => boolean, scope?: Object, once?: boolean, data?: any, useCapture?: boolean): Function;
on(type: string, listener: (eventObj: Object) => void, scope?: Object, once?: boolean, data?: any, useCapture?: boolean): Function;
on(type: string, listener: { handleEvent: (eventObj: Object) => boolean; }, scope?: Object, once?: boolean, data?: any, useCapture?: boolean): Object;
on(type: string, listener: { handleEvent: (eventObj: Object) => void; }, scope?: Object, once?: boolean, data?: any, useCapture?: boolean): Object;
removeAllEventListeners(type?: string): void;
removeEventListener(type: string, listener: (eventObj: Object) => boolean, useCapture?: boolean): void;
removeEventListener(type: string, listener: (eventObj: Object) => void, useCapture?: boolean): void;
removeEventListener(type: string, listener: { handleEvent: (eventObj: Object) => boolean; }, useCapture?: boolean): void;
removeEventListener(type: string, listener: { handleEvent: (eventObj: Object) => void; }, useCapture?: boolean): void;
removeEventListener(type: string, listener: Function, useCapture?: boolean): void; // It is necessary for "arguments.callee"
toString(): string;
willTrigger(type: string): boolean;
}
export function indexOf(array: any[], searchElement: Object): number;
export function proxy(method: (eventObj: Object) => boolean, scope: Object, ...arg: any[]): (eventObj: Object) => any;
export function proxy(method: (eventObj: Object) => void, scope: Object, ...arg: any[]): (eventObj: Object) => any;
export function proxy(method: { handleEvent: (eventObj: Object) => boolean; }, scope: Object, ...arg: any[]): (eventObj: Object) => any;
export function proxy(method: { handleEvent: (eventObj: Object) => void; }, scope: Object, ...arg: any[]): (eventObj: Object) => any;
}