diff --git a/soundjs/soundjs-tests.ts b/soundjs/soundjs-tests.ts new file mode 100644 index 0000000000..419587c255 --- /dev/null +++ b/soundjs/soundjs-tests.ts @@ -0,0 +1,13 @@ +/// + + +// Sample from : http://www.createjs.com/Docs/SoundJS/modules/SoundJS.html +// 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) { + // 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)); + instance.setVolume(0.5); +} \ No newline at end of file diff --git a/soundjs/soundjs.d.ts b/soundjs/soundjs.d.ts index 0cd0e71d2c..8a2d87cc59 100644 --- a/soundjs/soundjs.d.ts +++ b/soundjs/soundjs.d.ts @@ -10,6 +10,8 @@ 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/SoundJS/modules/SoundJS.html + declare module createjs { export class FlashPlugin { // properties @@ -141,7 +143,7 @@ declare module createjs { hasEventListener(type: string): boolean; } - + // Class documentation : http://www.createjs.com/Docs/SoundJS/classes/Sound.html export class Sound { // properties static activePlugin: Object; @@ -176,7 +178,7 @@ declare module createjs { 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 registerSound(src: Object, id?: string, data?: Object, preload?: boolean): Object; static registerManifest(manifest: Array); static resume(id: string): void; static setMasterVolume(value: number): boolean; @@ -185,16 +187,16 @@ declare module createjs { static stop(): boolean; // events - static loadComplete: () => any; + 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; + 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; } export class BrowserDetect { @@ -208,5 +210,7 @@ declare module createjs { // methods static init(); - } + } + + export function proxy(handler: Function, context: any); } diff --git a/tweenjs/tweenjs-test.ts b/tweenjs/tweenjs-tests.ts similarity index 100% rename from tweenjs/tweenjs-test.ts rename to tweenjs/tweenjs-tests.ts diff --git a/tweenjs/tweenjs.d.ts b/tweenjs/tweenjs.d.ts index 2d6a4a216c..8c5fd933ab 100644 --- a/tweenjs/tweenjs.d.ts +++ b/tweenjs/tweenjs.d.ts @@ -10,6 +10,8 @@ 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/TweenJS/modules/TweenJS.html + declare module createjs { export class TweenJS {