Merge pull request #1342 from gyohk/master

Updated EaselJS definitions to v0.7.0 and TweenJS, SoundJS definitions t...
This commit is contained in:
Basarat Ali Syed
2013-11-29 00:47:36 -08:00
10 changed files with 717 additions and 686 deletions
+99
View File
@@ -0,0 +1,99 @@
// Type definitions for EaselJS 0.7.0, TweenJS 0.5.0, SoundJS 0.5.0, PreloadJS 0.4.0
// Project: http://www.createjs.com/#!/EaselJS
// Definitions by: Pedro Ferreira <https://bitbucket.org/drk4>
// 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: Object;
defaultPrevented: boolean;
eventPhase: number;
immediatePropagationStopped: boolean;
propagationStopped: boolean;
removed: boolean;
target: Object;
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: Object;
result: Object;
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;
on(type: string, listener: (eventObj: Object) => boolean, useCapture?: boolean): Function;
on(type: string, listener: (eventObj: Object) => void, useCapture?: boolean): Function;
on(type: string, listener: { handleEvent: (eventObj: Object) => boolean; }, useCapture?: boolean): Object;
on(type: string, listener: { handleEvent: (eventObj: Object) => void; }, 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;
toString(): string;
}
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;
}
+352 -359
View File
File diff suppressed because it is too large Load Diff
+45 -56
View File
@@ -1,4 +1,4 @@
// Type definitions for PreloadJS 0.3
// Type definitions for PreloadJS 0.4.0
// Project: http://www.createjs.com/#!/PreloadJS
// Definitions by: Pedro Ferreira <https://bitbucket.org/drk4>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -10,94 +10,83 @@
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.
*/
// Library documentation : http://www.createjs.com/Docs/PreloadJS/modules/PreloadJS.html
/// <reference path="../createjs/createjs.d.ts" />
declare module createjs {
export class AbstractLoader {
export class AbstractLoader extends EventDispatcher {
// properties
canceled: boolean;
loaded: boolean;
progress: number;
// methods
buildPath(src: string, basePath?: string, data?: Object): string;
close(): void;
getItem(value: string): Object;
load(): void;
toString(): string;
// events
complete: (event: Object) => any;
error: (event: Object) => any;
fileload: (event: Object) => any;
fileprogress: (event: Object) => any;
loadStart: (event: Object) => any;
// EventDispatcher mixins
addEventListener(type: string, listener: (eventObj: Object) => boolean): any;
removeEventListener(type: string, listener: (eventObj: Function) => boolean): void;
removeEventListener(type: string, listener: (eventObj: Object) => boolean): void;
removeAllEventListeners(type: string): void;
dispatchEvent(eventObj: string, target: Object): boolean;
dispatchEvent(eventObj: Object, target: Object): boolean;
hasEventListener(type: string): boolean;
}
export class PreloadJS {
version: string;
buildDate: string;
}
export class LoadQueue extends AbstractLoader {
constructor (useXHR?: boolean);
constructor(useXHR?: boolean, basePath?: string);
// properties
static BINARY: string;
static CSS: string;
static IMAGE: string;
static JAVASCRIPT: string;
static JSON: string;
static SOUND: string;
static SVG: string;
static TEXT: string;
static JSONP: string;
static LOAD_TIMEOUT: number;
static XML: string;
maintainScriptOrder: boolean;
next: LoadQueue;
static SOUND: string;
stopOnError: boolean;
static SVG: string;
static TEXT: string;
useXHR: boolean;
static XML: string;
// methods
BrowserDetect(): Object;
init(useXHR?: boolean): void;
close(): void;
initialize(useXHR: boolean): void;
installPlugin(plugin: any): void;
load(): void;
loadFile(file: Object, loadNow?: boolean): void;
loadFile(file: string, loadNow?: boolean): void;
loadManifest(manifest: Object[], loadNow?: boolean): void;
loadManifest(manifest: string[], loadNow?: boolean): void;
getItem(value: string): Object;
getResult(value: string, rawResult?: boolean): Object;
removeAll(): 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;
loadManifest(manifest: string[], loadNow?: boolean, basePath?: string): void;
remove(idsOrUrls: string): void;
remove(idsOrUrls: any[]): void;
removeAll(): void;
reset(): void;
setMaxConnections(value: number): void;
setUseXHR(value: boolean): void;
setPaused(value: boolean): void;
setUseXHR(value: boolean): void;
}
export class PreloadJS {
static buildDate: string;
static version: string;
}
export class TagLoader extends AbstractLoader {
constructor (item: Object, srcAttr: string, useXHR: boolean);
constructor (item: string, srcAttr: string, useXHR: boolean);
getResult(): any; // HTMLImageElement or HTMLAudioElement
constructor (item: Object);
// properties
_isAudio: boolean;
// methods
getResult(): any;
}
export class XHRLoader extends AbstractLoader {
constructor (file: Object);
getResult(rawResult?: boolean):any;
constructor (item: Object);
// methods
getAllResponseHeaders(): string;
getResponseHeader(header: string): string;
getResult (rawResult?: boolean): Object;
}
}
+1 -1
View File
@@ -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:Object):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));
-1
View File
@@ -1 +0,0 @@
""
+163 -174
View File
@@ -1,4 +1,4 @@
// Type definitions for SoundJS 0.4
// Type definitions for SoundJS 0.5.0
// Project: http://www.createjs.com/#!/SoundJS
// Definitions by: Pedro Ferreira <https://bitbucket.org/drk4>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -12,205 +12,194 @@
// Library documentation : http://www.createjs.com/Docs/SoundJS/modules/SoundJS.html
/// <reference path="../createjs/createjs.d.ts" />
declare module createjs {
export class FlashPlugin {
constructor();
// properties
static BASE_PATH: string;
static buildDate: string;
static capabilities: Object;
flashReady: boolean;
showOutput: boolean;
static version: string;
// methods
create(src: string): SoundInstance;
preload(src: string, instance: Object): void;
static generateCapabilities(): void;
static isSupported(): boolean;
isPreloadStarted(src: string): boolean;
register(src: string, instances: Number): Object;
setVolume(value: Number): boolean;
getVolume(): Number;
setMute(isMuted: boolean): Boolean;
toString(): string;
// Flash API
unregisterPreloadInstance(flashId: string): void;
unregisterSoundInstance(flashId: string): void;
flashLog(data: string): void;
handleSoundEvent(flashId: string, method: string): void;
handlePreloadEvent(flashId: string, method: string): void;
handleEvent(method: string): void;
handleErrorEvent(error: string): void;
}
export class HTMLAudioPlugin {
// properties
static capabilities: Object;
static MAX_INSTANCES: number;
static AUDIO_READY: string;
static AUDIO_ENDED: string;
static AUDIO_ERROR: string;
static AUDIO_STALLED: string;
capabilities:Object;
defaultNumChannels: number;
// methods
create(src: string): SoundInstance;
static generateCapabilities(): void;
static isSupported(): boolean;
register(src: string, instances: number): Object;
isPreloadStarted(src: string): boolean;
preload(src: string, instance: Object): void;
toString(): string;
}
export class WebAudioPlugin {
// properties
static capabilities: Object;
static MAX_INSTANCES: number;
static AUDIO_READY: string;
static AUDIO_ENDED: string;
static AUDIO_ERROR: string;
static AUDIO_STALLED: string;
arrayBuffers: ArrayBuffer[];
capabilities:Object;
defaultNumChannels: number;
dynamicsCompressorNode: Object;
gainNode: Object;
volume: number;
context: any;
WebAudioLoader(src: string, owner: Object): Function;
// methods
create(src: string): SoundInstance;
static generateCapabilities(): void;
static isSupported(): boolean;
setVolume(value: Number): boolean;
getVolume(): number;
register(src: string, instances: number): Object;
isPreloadStarted(src: string): boolean;
preload(src: string, instance: Object): void;
isPreloadComplete(src : string): boolean;
removeFromPreload(src: string);
setMute(value: number): boolean;
toString(): string;
}
export class SoundInstance {
constructor (src: string, owner: string, flash: string);
// properties
muted: boolean;
owner: HTMLAudioPlugin;
offset: number;
paused: boolean;
delay: number;
pan: number;
duration: number;
playState: string;
delayTimeoutId: number;
src: string;
uniqueId: any; //HERE string or number
volume: number;
// methods
getDuration(): number;
getPan(): number;
getPosition(): number;
flashLog(data: string): void;
getVolume(): number;
mute(isMuted: boolean): boolean;
pause(): boolean;
play(interrupt?: string, delay?: number, offset?: number, loop?: number, volume?: number, pan?: number): void;
resume(): boolean;
setPan(value: number): number;
setPosition(value: number): void;
handleErrorEvent(error: string): void;
handleEvent(method: string): void;
handlePreloadEvent(flashId: string, method: string): void;
handleSoundEvent(flashId: string, method: string): void;
isPreloadStarted(src: string): boolean;
static isSupported(): boolean;
preload(src: string, instance: Object, basePath: string): void;
register(src: string, instances: number): Object;
registerPreloadInstance(flashId: string, instance: any): void;
registerSoundInstance(flashId: string, instance: any): void;
removeAllSounds (): void;
removeSound(src: string): void;
setMute(value: boolean): boolean;
setVolume(value: number): boolean;
stop(): boolean;
// events
complete: () => any;
loop: () => any;
failed: () => any;
interrupted: () => any;
succeeded: () => any;
ready: () => any;
// EventDispatcher mixins
addEventListener(type: string, listener: (eventObj: Object) => boolean): any;
removeEventListener(type: string, listener: (eventObj: Function) => boolean): void;
removeEventListener(type: string, listener: (eventObj: Object) => boolean): void;
removeAllEventListeners(type: string): void;
dispatchEvent(eventObj: string, target: Object): boolean;
dispatchEvent(eventObj: Object, target: Object): boolean;
hasEventListener(type: string): boolean;
unregisterPreloadInstance(flashId: string): void;
unregisterSoundInstance(flashId: string, instance: any): void;
toString(): string;
}
// Class documentation : http://www.createjs.com/Docs/SoundJS/classes/Sound.html
export class HTMLAudioPlugin {
constructor();
// properties
static AUDIO_ENDED: string;
static AUDIO_ERROR: string;
static AUDIO_READY: string;
static AUDIO_SEEKED: string;
static AUDIO_STALLED: string;
defaultNumChannels: number;
enableIOS: boolean;
static MAX_INSTANCES: number;
// methods
create(src: string): SoundInstance;
isPreloadStarted(src: string): boolean;
static isSupported(): boolean;
preload(src: string, instance: Object, basePath: string): void;
register(src: string, instances: number): Object;
removeAllSounds(): void;
removeSound(src: string): void;
toString(): string;
}
export class Sound {
// properties
static activePlugin: Object;
static AUDIO_TIMEOUT: number;
static defaultInterruptBehavior: string;
static DELIMITER: string;
static EXTENSION_MAP: Object;
static INTERRUPT_ANY: string;
static INTERRUPT_EARLY: string;
static INTERRUPT_LATE: string;
static INTERRUPT_NONE: string;
static muted: boolean;
static PLAY_FAILED: string;
static PLAY_FINISHED: string;
static PLAY_INITED: string;
static PLAY_INTERRUPTED: string;
static PLAY_SUCCEEDED: string;
static SUPPORTED_EXTENSIONS: any[];
static EXTENSION_MAP: Object;
static defaultInterruptBehavior: string;
static SUPPORTED_EXTENSIONS: string[];
// methods
static createInstance(src: string): SoundInstance;
static getCapabilities(): Object;
static getCapability(key: string): any; //HERE can return string | number | bool;
static getMute(): boolean;
static getVolume(): number;
static initializeDefaultPlugins(): boolean;
static isReady(): boolean;
static loadComplete(src: string): boolean;
static play(src: string, interrupt?: any, delay?: number, offset?: number, loop?: number, volume?: number, pan?: number): SoundInstance;
static registerManifest(manifest: any[], basePath: string): Object;
static registerPlugin(plugin: Object): boolean;
static registerPlugins(plugins: any[]): boolean;
static registerSound(src: string, id?: string, data?: Object, preload?: boolean, basePath?: string): Object;
static registerSound(src: Object, id?: string, data?: Object, preload?: boolean, basePath?: string): Object;
static removeAllSounds(): void;
static removeManifest(manifest: any[]): Object;
static removeSound(src: string): boolean;
static removeSound(src: Object): boolean;
static setMute(value: boolean): boolean;
static setVolume(value: number): void;
static stop(): void;
static toString(): string;
// EventDispatcher mixins
static addEventListener(type: string, listener: (eventObj: Object) => boolean, useCapture?: boolean): Function;
static addEventListener(type: string, listener: (eventObj: Object) => void, useCapture?: boolean): Function;
static addEventListener(type: string, listener: { handleEvent: (eventObj: Object) => boolean; }, useCapture?: boolean): Object;
static addEventListener(type: string, listener: { handleEvent: (eventObj: Object) => void; }, useCapture?: boolean): Object;
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: (eventObj: Object) => boolean, useCapture?: boolean): void;
static off(type: string, listener: (eventObj: Object) => void, useCapture?: boolean): void;
static off(type: string, listener: { handleEvent: (eventObj: Object) => boolean; }, useCapture?: boolean): void;
static off(type: string, listener: { handleEvent: (eventObj: Object) => void; }, useCapture?: boolean): void;
static on(type: string, listener: (eventObj: Object) => boolean, useCapture?: boolean): Function;
static on(type: string, listener: (eventObj: Object) => void, useCapture?: boolean): Function;
static on(type: string, listener: { handleEvent: (eventObj: Object) => boolean; }, useCapture?: boolean): Object;
static on(type: string, listener: { handleEvent: (eventObj: Object) => void; }, useCapture?: boolean): Object;
static removeAllEventListeners(type?: string): void;
static removeEventListener(type: string, listener: (eventObj: Object) => boolean, useCapture?: boolean): void;
static removeEventListener(type: string, listener: (eventObj: Object) => void, useCapture?: boolean): void;
static removeEventListener(type: string, listener: { handleEvent: (eventObj: Object) => boolean; }, useCapture?: boolean): void;
static removeEventListener(type: string, listener: { handleEvent: (eventObj: Object) => void; }, useCapture?: boolean): void;
}
export class SoundInstance extends EventDispatcher {
constructor(src: string, owner: Object);
// properties
gainNode: any;
pan: number;
panNode: any;
playState: string;
sourceNode: any;
uniqueId: any; //HERE string or number
volume: number;
// methods
static checkPlugin(initializeDefault: boolean): boolean;
static createInstance(src: string): SoundInstance;
static getCapabilities(): Object;
static getCapability(key: string): any; //HERE can return string | number | bool
static getInstanceById(uniqueId: string): SoundInstance;
static getMute(): boolean;
static getMasterVolume(): number;
static getSrcFromId(value: string): string;
static getVolume(): number;
static isReady(): boolean;
static pause(id: string): void;
static play(src: string, interrupt?: string, delay?: number, offset?: number, loop?: number, volume?: number, pan?: number): SoundInstance;
static registerPlugin(plugin: Object): boolean;
static registerPlugins(plugins: Object[]): boolean;
static registerSound(src: Object, id?: string, data?: Object, preload?: boolean): Object;
static registerManifest(manifest: any[]);
static resume(id: string): void;
static setMasterVolume(value: number): boolean;
static setMute(isMuted: boolean): boolean;
static setVolume(value: number, id?: string): boolean;
static stop(): boolean;
// events
static loadComplete: () => any;
// EventDispatcher mixins
static addEventListener(type: string, listener: (eventObj: Object) => boolean): any;
static removeEventListener(type: string, listener: (eventObj: Function) => boolean): void;
static removeEventListener(type: string, listener: (eventObj: Object) => boolean): void;
static removeAllEventListeners(type: string): void;
static dispatchEvent(eventObj: string, target: Object): boolean;
static dispatchEvent(eventObj: Object, target: Object): boolean;
static hasEventListener(type: string): boolean;
getDuration(): number;
getMute(): boolean;
getPan(): number;
getPosition(): number;
getVolume(): number;
pause(): boolean;
play(interrupt?: string, delay?: number, offset?: number, loop?: number, volume?: number, pan?: number): void;
play(interrupt?: Object, delay?: number, offset?: number, loop?: number, volume?: number, pan?: number): void;
resume(): boolean;
setMute(value: boolean): boolean;
setPan(value: number): number;
setPosition(value: number): void;
setVolume(value: number): boolean;
stop(): boolean;
}
export class BrowserDetect {
// properties
static isFirefox: boolean;
static isOpera: boolean;
static isChrome: boolean;
static isIOS: boolean;
static isAndroid: boolean;
static isBlackberry: boolean;
// methods
static init();
export class SoundJS {
static buildDate: string;
static version: string;
}
export class WebAudioPlugin {
constructor();
// properties
context: any;
dynamicsCompressorNode: any;
gainNode: any;
// methods
addPreloadResults(src: string): boolean;
create(src: string): SoundInstance;
getVolume(): number;
isPreloadComplete(src: string): boolean;
isPreloadStarted(src: string): boolean;
static isSupported(): boolean;
playEmptySound(): void;
register(src: string, instances: number): Object;
removeAllSounds(src: string): void;
/**
* @deprecated
*/
removeFromPreload(src: string): void;
removeSound(src: string): void;
setMute(value: boolean): boolean;
setVolume(value: number): boolean;
toString(): string;
}
export function proxy(handler: Function, context: any);
}
-1
View File
@@ -1 +0,0 @@
""
+3 -3
View File
@@ -1,12 +1,12 @@
///<reference path="./tweenjs.d.ts"/>
///<reference path="../easeljs/easeljs.d.ts"/>
declare var target;
var Tween = createjs.Tween;
var target = new createjs.DisplayObject();
// source : http://www.createjs.com/Docs/TweenJS/modules/TweenJS.html
// Chainable modules :
target.alpha = 1;
Tween.get(target).wait(500, false).to({ alpha: 0, visible: false }, 1000).call(onComplete);
createjs.Tween.get(target).wait(500, false).to({ alpha: 0, visible: false }, 1000).call(onComplete);
function onComplete() {
//Tween complete
}
-1
View File
@@ -1 +0,0 @@
""
+54 -90
View File
@@ -1,4 +1,4 @@
// Type definitions for TweenJS 0.5
// Type definitions for TweenJS 0.5.0
// Project: http://www.createjs.com/#!/TweenJS
// Definitions by: Pedro Ferreira <https://bitbucket.org/drk4>, Chris Smith <https://github.com/evilangelist>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -12,16 +12,12 @@
// Library documentation : http://www.createjs.com/Docs/TweenJS/modules/TweenJS.html
/// <reference path="../createjs/createjs.d.ts" />
declare module createjs {
export class TweenJS {
// properties
version: string;
buildDate: string;
}
export class CSSPlugin {
constructor();
// properties
static cssSuffixMap: Object;
@@ -29,9 +25,8 @@ declare module createjs {
static install(): void;
}
export class Ease {
// properties
// methods
static backIn: (amount: number) => number;
static backInOut: (amount: number) => number;
static backOut: (amount: number) => number;
@@ -47,6 +42,16 @@ declare module createjs {
static elasticIn: (amount: number) => number;
static elasticInOut: (amount: number) => number;
static elasticOut: (amount: number) => number;
static get(amount: number): (amount: number) => number;
static getBackIn(amount: number): (amount: number) => number;
static getBackInOut(amount: number): (amount: number) => number;
static getBackOut(amount: number): (amount: number) => number;
static getElasticIn(amplitude: number, period: number): (amount: number) => number;
static getElasticInOut(amplitude: number, period: number): (amount: number) => number;
static getElasticOut(amplitude: number, period: number): (amount: number) => number;
static getPowIn(pow: number): (amount: number) => number;
static getPowInOut(pow: number): (amount: number) => number;
static getPowOut(pow: number): (amount: number) => number;
static linear: (amount: number) => number;
static none: (amount: number) => number; // same as linear
static quadIn: (amount: number) => number;
@@ -61,85 +66,69 @@ declare module createjs {
static sineIn: (amount: number) => number;
static sineInOut: (amount: number) => number;
static sineOut: (amount: number) => number;
}
export class MotionGuidePlugin {
constructor();
// methods
static get(amount: number): (amount: number) => number;
static getBackIn(amount: number): (amount: number) => number;
static getBackInOut(amount: number): (amount: number) => number;
static getBackOut(amount: number): (amount: number) => number;
static getElasticIn(amplitude: number, period: number): (amount: number) => number;
static getElasticInOut(amplitude: number, period: number): (amount: number) => number;
static getElasticOut(amplitude: number, period: number): (amount: number) => number;
static getPowIn(pow: number): (amount: number) => number;
static getPowInOut(pow: number): (amount: number) => number;
static getPowOut(pow: number): (amount: number) => number;
//methods
static install(): Object;
}
export class SamplePlugin {
constructor();
export class Timeline {
// properties
static priority: any;
//methods
static init(tween: Tween, prop: string, value: any): any;
static step(tween: Tween, prop: string, startValue: any, injectProps: Object, endValue: any): void;
static install(): void;
static tween(tween: Tween, prop: string, value: any, startValues: Object, endValues: Object, ratio: number, wait: boolean, end: boolean): any;
}
export class Timeline extends EventDispatcher {
constructor (tweens: Tween[], labels: Object, props: Object);
// properties
duration: number;
ignoreGlobalPause: boolean;
loop: boolean;
position: number;
position: Object;
// methods
addLabel(label: string, position: number): void;
addTween(...tween: Tween[]): void;
getCurrentLabel(): string;
getLabels(): Object[];
getCurrentLabel(): string;
getLabels(): Object[];
gotoAndPlay(positionOrLabel: string): void;
gotoAndPlay(positionOrLabel: number): void;
gotoAndStop(positionOrLabel: string): void;
gotoAndStop(positionOrLabel: number): void;
removeTween(...tween: Tween[]): boolean;
removeTween(...tween: Tween[]): void;
resolve(positionOrLabel: string): number;
resolve(positionOrLabel: number): number;
setLabels(o: Object): void;
setPaused(value: boolean): void;
setPosition(value: number, actionsMode?: number): boolean;
tick(delta: number): void;
toString(): string;
updateDuration(): void;
// EventDispatcher mixins
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;
on(type: string, listener: (eventObj: Object) => boolean, useCapture?: boolean): Function;
on(type: string, listener: (eventObj: Object) => void, useCapture?: boolean): Function;
on(type: string, listener: { handleEvent: (eventObj: Object) => boolean; }, useCapture?: boolean): Object;
on(type: string, listener: { handleEvent: (eventObj: Object) => void; }, useCapture?: boolean): Object;
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;
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;
removeAllEventListeners(type?: string): void;
dispatchEvent(eventObj: string, target?: Object): boolean;
dispatchEvent(eventObj: Object, target?: Object): boolean;
dispatchEvent(eventObj: Event, target?: Object): boolean;
hasEventListener(type: string): boolean;
}
export class Tween {
constructor (target: Object, props: Object, pluginData?: Object);
export class Tween extends EventDispatcher {
constructor(target: Object, props?: Object, pluginData?: Object);
// properties
duration: number;
static IGNORE: Object;
ignoreGlobalPause: boolean;
loop: boolean;
static LOOP: number;
loop: boolean;
static NONE: number;
passive:boolean;
onChange: Function; // deprecated
passive: boolean;
pluginData: Object;
position: number;
static REVERSE: number;
@@ -148,51 +137,26 @@ declare module createjs {
// methods
call(callback: (tweenObject: Tween) => any, params?: any[], scope?: Object): Tween; // when 'params' isn't given, the callback receives a tweenObject
call(callback: (...params: any[]) => any, params?: any[], scope?: Object): Tween; // otherwise, it receives the params only
static get(target: any, props?: Object, pluginData?: Object, override?: boolean): Tween;
static hasActiveTweens(target?: any ): boolean;
static installPlugin(plugin: Object, properties: string[]): void;
static get(target: Object, props?: Object, pluginData?: Object, override?: boolean): Tween;
static hasActiveTweens(target?: Object): boolean;
static installPlugin(plugin: Object, properties: any[]): void;
pause(tween: Tween): Tween;
play(tween: Tween): Tween;
static removeAllTweens(): void;
static removeTweens(target: any): void;
set(props: Object, target?: any ): Tween;
static removeTweens(target: Object): void;
set(props: Object, target?: Object): Tween;
setPaused(value: boolean): Tween;
setPosition(value: number, actionsMode: number): boolean;
static tick(delta: number, paused: boolean): void;
tick(delta: number): void;
to(props: Object, duration?: number, ease?: (amount: number) => number): Tween;
toString(): string;
wait(duration: number, passive: boolean): Tween;
to(props: Object, duration?: number, ease?: (t: number) => number): Tween;
wait(duration: number, passive?: boolean): Tween;
// EventDispatcher mixins
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;
on(type: string, listener: (eventObj: Object) => boolean, useCapture?: boolean): Function;
on(type: string, listener: (eventObj: Object) => void, useCapture?: boolean): Function;
on(type: string, listener: { handleEvent: (eventObj: Object) => boolean; }, useCapture?: boolean): Object;
on(type: string, listener: { handleEvent: (eventObj: Object) => void; }, useCapture?: boolean): Object;
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;
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;
removeAllEventListeners(type?: string): void;
dispatchEvent(eventObj: string, target?: Object): boolean;
dispatchEvent(eventObj: Object, target?: Object): boolean;
dispatchEvent(eventObj: Event, target?: Object): boolean;
hasEventListener(type: string): boolean;
}
export class MotionGuidePlugin {
export class TweenJS {
// properties
//methods
static install(): Object;
static buildDate: string;
static version: string;
}
}