From af80fa34293d95ef3a1ec18535235fafc6307dd5 Mon Sep 17 00:00:00 2001 From: David Driscoll Date: Sat, 18 Jan 2014 23:13:39 -0500 Subject: [PATCH 1/9] (feat): Updated function methods to be generic This allows those method signatures to be passed through, but gain the benefits of things like throttle, memoize. --- lodash/lodash.d.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 5de99d755a..68ee4f8df1 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -2580,10 +2580,10 @@ declare module _ { * @param options.trailing Specify execution on the trailing edge of the timeout. * @return The new debounced function. **/ - debounce( - func: Function, + debounce( + func: T, wait: number, - options?: DebounceSettings): Function; + options?: DebounceSettings): T; } interface LoDashObjectWrapper { @@ -2670,9 +2670,9 @@ declare module _ { * @param resolver Hash function for storing the result of `fn`. * @return Returns the new memoizing function. **/ - memoize( - func: Function, - resolver?: (n: any) => string): Function; + memoize( + func: T, + resolver?: (n: any) => string): T; } //_.once @@ -2684,7 +2684,7 @@ declare module _ { * @param func Function to only execute once. * @return The new restricted function. **/ - once(func: Function): Function; + once(func: T): T; } //_.partial @@ -2733,10 +2733,10 @@ declare module _ { * @param options.trailing Specify execution on the trailing edge of the timeout. * @return The new throttled function. **/ - throttle( - func: any, + throttle( + func: T, wait: number, - options?: ThrottleSettings): Function; + options?: ThrottleSettings): T; } interface ThrottleSettings { @@ -3764,7 +3764,7 @@ declare module _ { **/ times( n: number, - callback: Function, + callback: (num: number) => TResult, context?: any): TResult[]; } From 53a5613482ae9c7d384dc7cc1e691bc4778ae66c Mon Sep 17 00:00:00 2001 From: David Driscoll Date: Sat, 18 Jan 2014 23:13:39 -0500 Subject: [PATCH 2/9] (feat): Updated function methods to be generic This allows those method signatures to be passed through, but gain the benefits of things like throttle, memoize. --- lodash/lodash-tests.disabled.ts | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/lodash/lodash-tests.disabled.ts b/lodash/lodash-tests.disabled.ts index 18c3cadd6f..aca0bbdf0b 100644 --- a/lodash/lodash-tests.disabled.ts +++ b/lodash/lodash-tests.disabled.ts @@ -592,6 +592,9 @@ source.addEventListener('message', <_.LoDashObjectWrapper>_(function() 'maxWait': 1000 }), false); +var returnedDebounce = _.throttle(function (a) { return a * 5; }, 5); +returnedThrottled(4); + result = _.defer(function() { console.log('deferred'); }); result = <_.LoDashWrapper>_(function() { console.log('deferred'); }).defer(); @@ -608,15 +611,20 @@ var data = { 'curly': { 'name': 'curly', 'age': 60 } }; -var stooge = _.memoize(function(name: string) { return data[name]; }, _.identity); +var stooge = _.memoize(function(name: string) { return data[name]; }, _.identity); stooge('curly'); stooge['cache']['curly'].name = 'jerome'; stooge('curly'); -var initialize = _.once(function(){ }); -initialize(); +var returnedMemoize = _.throttle(function (a) { return a * 5; }, 5); +returnedMemoize(4); + +var initialize = _.once(function(){ }); initialize(); +initialize();'' +var returnedOnce = _.throttle(function (a) { return a * 5; }, 5); +returnedOnce(4); var greetPartial = function(greeting: string, name: string) { return greeting + ' ' + name; }; var hi = _.partial(greetPartial, 'hi'); @@ -638,6 +646,9 @@ jQuery('.interactive').on('click', _.throttle(function() { }, 300000, { 'trailing': false })); +var returnedThrottled = _.throttle(function (a) { return a*5; }, 5); +returnedThrottled(4); + var helloWrap = function(name: string) { return 'hello ' + name; }; var helloWrap2 = _.wrap(helloWrap, function(func) { return 'before, ' + func('moe') + ', after'; @@ -950,9 +961,9 @@ class Mage { } var mage = new Mage(); -result = _.times(3, _.partial(_.random, 1, 6)); -result = _.times(3, function(n: number) { mage.castSpell(n); }); -result = _.times(3, function(n: number) { this.cast(n); }, mage); +result = _.times(3, <() => number>_.partial(_.random, 1, 6)); +result = _.times(3, function(n: number) { mage.castSpell(n); }); +result = _.times(3, function(n: number) { this.cast(n); }, mage); result = _.unescape('Moe, Larry & Curly'); From ed8f9cbc42e84c76db3903afef6afe37b349b28a Mon Sep 17 00:00:00 2001 From: s_kimura Date: Sun, 19 Jan 2014 17:10:31 +0900 Subject: [PATCH 3/9] update to SoundJS v0.5.2. --- soundjs/soundjs.d.ts | 57 ++++++++++++++++---------------------------- 1 file changed, 20 insertions(+), 37 deletions(-) diff --git a/soundjs/soundjs.d.ts b/soundjs/soundjs.d.ts index d51100279b..922d116675 100644 --- a/soundjs/soundjs.d.ts +++ b/soundjs/soundjs.d.ts @@ -1,4 +1,4 @@ -// Type definitions for SoundJS 0.5.0 +// Type definitions for SoundJS 0.5.2 // Project: http://www.createjs.com/#!/SoundJS // Definitions by: Pedro Ferreira // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -19,45 +19,29 @@ declare module createjs { constructor(); // properties - static BASE_PATH: string; static buildDate: string; - static capabilities: Object; flashReady: boolean; showOutput: boolean; + static swfPath: string; static version: string; // methods create(src: string): SoundInstance; - flashLog(data: string): void; getVolume(): number; - 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; + preload(src: string, instance: Object): 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; - unregisterPreloadInstance(flashId: string): void; - unregisterSoundInstance(flashId: string, instance: any): void; - toString(): string; } 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; @@ -66,18 +50,17 @@ declare module createjs { create(src: string): SoundInstance; isPreloadStarted(src: string): boolean; static isSupported(): boolean; - preload(src: string, instance: Object, basePath: string): void; + preload(src: string, instance: Object): void; register(src: string, instances: number): Object; removeAllSounds(): void; removeSound(src: string): void; - toString(): string; } export class Sound { // properties static activePlugin: Object; + static alternateExtensions: any[]; static defaultInterruptBehavior: string; - static DELIMITER: string; static EXTENSION_MAP: Object; static INTERRUPT_ANY: string; static INTERRUPT_EARLY: string; @@ -102,18 +85,18 @@ declare module createjs { 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?: number, preload?: boolean, basePath?: string): Object; static registerSound(src: string, id?: string, data?: Object, preload?: boolean, basePath?: string): Object; + static registerSound(src: Object, id?: string, data?: number, 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 removeManifest(manifest: any[], basePath: string): Object; + static removeSound(src: string, basePath: string): boolean; + static removeSound(src: Object, basePath: string): 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; @@ -128,16 +111,19 @@ declare module createjs { 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 off(type: string, listener: Function, useCapture?: boolean): void; // It is necessary for "arguments.callee" + static on(type: string, listener: (eventObj: Object) => boolean, scope?: Object, once?: boolean, data?: any, useCapture?: boolean): Function; + static on(type: string, listener: (eventObj: Object) => void, scope?: Object, once?: boolean, data?: any, useCapture?: boolean): Function; + static on(type: string, listener: { handleEvent: (eventObj: Object) => boolean; }, scope?: Object, once?: boolean, data?: any, useCapture?: boolean): Object; + static on(type: string, listener: { handleEvent: (eventObj: Object) => void; }, scope?: Object, once?: boolean, data?: any, 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; - + static removeEventListener(type: string, listener: Function, useCapture?: boolean): void; // It is necessary for "arguments.callee" + static toString(): string; + static willTrigger(type: string): boolean; } export class SoundInstance extends EventDispatcher { @@ -149,6 +135,7 @@ declare module createjs { panNode: any; playState: string; sourceNode: any; + src: string; uniqueId: any; //HERE string or number volume: number; @@ -191,15 +178,11 @@ declare module createjs { isPreloadStarted(src: string): boolean; static isSupported(): boolean; playEmptySound(): void; + preload(src: string, instance: Object): 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; } } From 284d2d2fcef4539a4635824f3c7108db4a7cbcd7 Mon Sep 17 00:00:00 2001 From: s_kimura Date: Sun, 19 Jan 2014 17:11:44 +0900 Subject: [PATCH 4/9] update to PreloadJS v0.4.1. --- preloadjs/preloadjs.d.ts | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/preloadjs/preloadjs.d.ts b/preloadjs/preloadjs.d.ts index 418103b54b..f5904fa8c7 100644 --- a/preloadjs/preloadjs.d.ts +++ b/preloadjs/preloadjs.d.ts @@ -1,4 +1,4 @@ -// Type definitions for PreloadJS 0.4.0 +// Type definitions for PreloadJS 0.4.1 // Project: http://www.createjs.com/#!/PreloadJS // Definitions by: Pedro Ferreira // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -22,16 +22,15 @@ declare module createjs { progress: number; // methods - buildPath(src: string, basePath?: string, data?: Object): string; + buildPath(src: string, data?: Object): string; close(): void; load(): void; - toString(): string; - } export class LoadQueue extends AbstractLoader { - constructor(useXHR?: boolean, basePath?: string); - + constructor(useXHR?: boolean, basePath?: string, crossOrigin?: string); + constructor(useXHR?: boolean, basePath?: string, crossOrigin?: boolean); + // properties static BINARY: string; static CSS: string; @@ -39,8 +38,9 @@ declare module createjs { static JAVASCRIPT: string; static JSON: string; static JSONP: string; - static LOAD_TIMEOUT: number; + static loadTimeout: number; maintainScriptOrder: boolean; + static MANIFEST: string; next: LoadQueue; static SOUND: string; stopOnError: boolean; @@ -55,8 +55,9 @@ declare module createjs { 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; + loadManifest(manifest: Object, loadNow?: boolean, basePath?: string): void; + loadManifest(manifest: string, loadNow?: boolean, basePath?: string): void; + loadManifest(manifest: any[], loadNow?: boolean, basePath?: string): void; remove(idsOrUrls: string): void; remove(idsOrUrls: any[]): void; removeAll(): void; @@ -71,18 +72,21 @@ declare module createjs { static version: string; } + export class SamplePlugin { + static fileLoadHandler(event: Object): void; + static getPreloadHandlers(): Object; + static preloadHandler(src: string, type: string, id: string, data: any, basePath: string, queue: LoadQueue): any; + } + export class TagLoader extends AbstractLoader { constructor (item: Object); - // properties - _isAudio: boolean; - // methods getResult(): any; } export class XHRLoader extends AbstractLoader { - constructor (item: Object); + constructor (item: Object, crossOrigin?: string); // methods getAllResponseHeaders(): string; From 380322af6bcb943ce7248ef84b3dec2444f6df38 Mon Sep 17 00:00:00 2001 From: s_kimura Date: Sun, 19 Jan 2014 17:05:53 +0900 Subject: [PATCH 5/9] update to EaselJS v0.7.1. --- createjs/createjs.d.ts | 27 +++++---- easeljs/easeljs-tests.ts | 12 ++++ easeljs/easeljs.d.ts | 121 +++++++++++++++++++-------------------- 3 files changed, 86 insertions(+), 74 deletions(-) diff --git a/createjs/createjs.d.ts b/createjs/createjs.d.ts index 20f2a7574f..556a330258 100644 --- a/createjs/createjs.d.ts +++ b/createjs/createjs.d.ts @@ -1,4 +1,4 @@ -// Type definitions for EaselJS 0.7.0, TweenJS 0.5.0, SoundJS 0.5.0, PreloadJS 0.4.0 +// 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 // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -23,13 +23,13 @@ declare module createjs { // properties bubbles: boolean; cancelable: boolean; - currentTarget: Object; + currentTarget: any; // It is 'Object' type officially, but 'any' is easier to use. defaultPrevented: boolean; eventPhase: number; immediatePropagationStopped: boolean; propagationStopped: boolean; removed: boolean; - target: Object; + target: any; // It is 'Object' type officially, but 'any' is easier to use. timeStamp: number; type: string; @@ -38,15 +38,15 @@ declare module createjs { delta: number; error: string; id: string; - item: any; - loaded: number; + item: any; + loaded: number; name: string; next: string; - params: any[]; + params: any; paused: boolean; progress: number; - rawResult: Object; - result: Object; + rawResult: any; + result: any; runTime: number; src: string; time: number; @@ -78,16 +78,19 @@ declare module createjs { 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; + 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; diff --git a/easeljs/easeljs-tests.ts b/easeljs/easeljs-tests.ts index 6c083da5cd..ff68b79d65 100644 --- a/easeljs/easeljs-tests.ts +++ b/easeljs/easeljs-tests.ts @@ -53,4 +53,16 @@ function test_graphics() { var myGraphics: createjs.Graphics; myGraphics.beginStroke("#F00").beginFill("#00F").drawRect(20, 20, 100, 50).draw(myContext2D); +} + +function colorMatrixTest() { + var shape = new createjs.Shape().set({ x: 100, y: 100 }); + shape.graphics.beginFill("#ff0000").drawCircle(0, 0, 50); + + var matrix = new createjs.ColorMatrix().adjustHue(180).adjustSaturation(100); + shape.filters = [ + new createjs.ColorMatrixFilter(matrix) + ]; + + shape.cache(-50, -50, 100, 100); } \ No newline at end of file diff --git a/easeljs/easeljs.d.ts b/easeljs/easeljs.d.ts index dd15630832..2c5be3aa34 100644 --- a/easeljs/easeljs.d.ts +++ b/easeljs/easeljs.d.ts @@ -1,4 +1,4 @@ -// Type definitions for EaselJS 0.7.0 +// Type definitions for EaselJS 0.7.1 // Project: http://www.createjs.com/#!/EaselJS // Definitions by: Pedro Ferreira , Chris Smith // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -55,6 +55,8 @@ declare module createjs { // methods clone(): Bitmap; + set(props: Object): Bitmap; + setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, regX?: number, regY?: number): Bitmap; } /** @@ -73,6 +75,9 @@ declare module createjs { spriteSheet: SpriteSheet; text: string; + // methods + set(props: Object): BitmapText; + setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, regX?: number, regY?: number): BitmapText; } export class BlurFilter extends Filter { @@ -120,12 +125,8 @@ declare module createjs { clone(): ColorFilter; } - export class ColorMatrix implements Array { - constructor(brightness: number, contrast: number, saturation: number, hue: number); - - static DELTA_INDEX: number[]; - static IDENTITY_MATRIX: number[]; - static LENGTH: number; + export class ColorMatrix { + constructor(brightness?: number, contrast?: number, saturation?: number, hue?: number); // methods adjustBrightness(value: number): ColorMatrix; @@ -135,41 +136,17 @@ declare module createjs { adjustSaturation(value: number): ColorMatrix; clone(): ColorMatrix; concat(...matrix: number[]): ColorMatrix; - copyMatrix(...matrix: ColorMatrix[]): ColorMatrix; + concat(matrix: ColorMatrix): ColorMatrix; + copyMatrix(...matrix: number[]): ColorMatrix; + copyMatrix(matrix: ColorMatrix): ColorMatrix; reset(): ColorMatrix; toArray(): number[]; - - // implements Array interface start - concat(...items: ColorMatrix[]): number[]; - join(separator?: string): string; - pop(): number; - push(...items: number[]): number; - reverse(): number[]; - shift(): number; - slice(start: number, end?: number): number[]; - sort(compareFn?: (a: number, b: number) => number): number[]; - splice(start: number): number[]; - unshift(...items: number[]): number; - indexOf(searchElement: number, fromIndex?: number): number; - - lastIndexOf(searchElement: number, fromIndex?: number): number; - every(callbackfn: (value: number, index: number, array: number[]) => boolean, thisArg?: any): boolean; - some(callbackfn: (value: number, index: number, array: number[]) => boolean, thisArg?: any): boolean; - forEach(callbackfn: (value: number, index: number, array: number[]) => void, thisArg?: any): void; - map(callbackfn: (value: number, index: number, array: number[]) => ColorMatrix, thisArg?: any): ColorMatrix[]; - - filter(callbackfn: (value: number, index: number, array: number[]) => boolean, thisArg?: any): number[]; - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number): number; - reduce(callbackfn: (previousValue: ColorMatrix, currentValue: number, currentIndex: number, array: number[]) => ColorMatrix, initialValue: ColorMatrix): ColorMatrix; - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number): number; - reduceRight(callbackfn: (previousValue: ColorMatrix, currentValue: number, currentIndex: number, array: number[]) => ColorMatrix, initialValue: ColorMatrix): ColorMatrix; - length: number; - [n: number]: number; - // implements Array interface end + toString(): string; } export class ColorMatrixFilter extends Filter { constructor(matrix: number[]); + constructor(matrix: ColorMatrix); // methods clone(): ColorMatrixFilter; @@ -177,7 +154,7 @@ declare module createjs { export class Command { // methods - constructor(f: any, params: any, path: any); + constructor(f: any, params: any, path?: any); exec(scope: any): void; } @@ -187,6 +164,7 @@ declare module createjs { // properties children: DisplayObject[]; mouseChildren: boolean; + tickChildren: boolean; // methods addChild(...child: DisplayObject[]): DisplayObject; @@ -203,7 +181,9 @@ declare module createjs { removeAllChildren(): void; removeChild(...child: DisplayObject[]): boolean; removeChildAt(...index: number[]): boolean; + set(props: Object): Container; setChildIndex(child: DisplayObject, index: number): void; + setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, regX?: number, regY?: number): Container; sortChildren(sortFunction: (a: DisplayObject, b: DisplayObject) => number): void; swapChildren(child1: DisplayObject, child2: DisplayObject): void; swapChildrenAt(index1: number, index2: number): void; @@ -214,7 +194,7 @@ declare module createjs { // properties alpha: number; - cacheCanvas: HTMLCanvasElement; // HTMLCanvasElement or Object + cacheCanvas: any; // HTMLCanvasElement or Object cacheID: number; compositeOperation: string; cursor: string; @@ -238,6 +218,7 @@ declare module createjs { */ snapToPixel: boolean; static suppressCrossDomainErrors: boolean; + tickEnabled: boolean; visible: boolean; x: number; y: number; @@ -274,7 +255,8 @@ declare module createjs { // methods clone(): DisplayObject; // throw error - + set(props: Object): DOMElement; + setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, regX?: number, regY?: number): DOMElement; } @@ -425,6 +407,8 @@ declare module createjs { constructor(type: string, bubbles: boolean, cancelable: boolean, stageX: number, stageY: number, nativeEvent: NativeMouseEvent, pointerID: number, primary: boolean, rawX: number, rawY: number); // properties + localX: number; + localY: number; nativeEvent: NativeMouseEvent; pointerID: number; primary: boolean; @@ -432,7 +416,6 @@ declare module createjs { rawY: number; stageX: number; stageY: number; - target: DisplayObject; // methods clone(): MouseEvent; @@ -442,23 +425,27 @@ declare module createjs { 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; + dispatchEvent(eventObj: Object, target?: Object): boolean; + dispatchEvent(eventObj: string, target?: Object): boolean; + dispatchEvent(eventObj: Event, target?: Object): boolean; + hasEventListener(type: string): boolean; 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; - dispatchEvent(eventObj: string, target?: Object): boolean; - dispatchEvent(eventObj: Object, target?: Object): boolean; - dispatchEvent(eventObj: Event, target?: Object): boolean; - hasEventListener(type: string): boolean; + 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; } @@ -555,6 +542,8 @@ declare module createjs { // methods clone(recursive?: boolean): Shape; + set(props: Object): Shape; + setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, regX?: number, regY?: number): Shape; } @@ -583,6 +572,8 @@ declare module createjs { gotoAndStop(frameOrAnimation: string): void; gotoAndStop(frameOrAnimation: number): void; play(): void; + set(props: Object): Sprite; + setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, regX?: number, regY?: number): Sprite; stop(): void; } @@ -619,6 +610,8 @@ declare module createjs { export class SpriteSheetBuilder extends EventDispatcher { + constructor(); + // properties maxHeight: number; maxWidth: number; @@ -634,9 +627,9 @@ declare module createjs { addMovieClip(source: MovieClip, sourceRect?: Rectangle, scale?: number): void; build(): SpriteSheet; buildAsync(timeSlice?: number): void; - clone(): DisplayObject; // throw error + clone(): void; // throw error stopAsync(): void; - toString(): string; + } @@ -660,7 +653,8 @@ declare module createjs { // properties autoClear: boolean; - canvas: HTMLCanvasElement; + canvas: any; // HTMLCanvasElement or Object + handleEvent: Function; mouseInBounds: boolean; mouseMoveOutside: boolean; mouseX: number; @@ -677,7 +671,6 @@ declare module createjs { clone(): Stage; enableDOMEvents(enable?: boolean): void; enableMouseOver(frequency?: number): void; - handleEvent(evt: Object): void; toDataURL(backgroundColor: string, mimeType: string): string; update(...arg: any[]): void; @@ -703,6 +696,8 @@ declare module createjs { getMeasuredHeight(): number; getMeasuredLineHeight(): number; getMeasuredWidth(): number; + set(props: Object): Text; + setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, regX?: number, regY?: number): Text; } export class Ticker { @@ -731,7 +726,6 @@ declare module createjs { static setFPS(value: number): void; static setInterval(interval: number): void; static setPaused(value: boolean): void; - static toString(): string; // EventDispatcher mixins static addEventListener(type: string, listener: (eventObj: Object) => boolean, useCapture?: boolean): Function; @@ -746,16 +740,19 @@ declare module createjs { 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 off(type: string, listener: Function, useCapture?: boolean): void; // It is necessary for "arguments.callee" + static on(type: string, listener: (eventObj: Object) => boolean, scope?: Object, once?: boolean, data?: any, useCapture?: boolean): Function; + static on(type: string, listener: (eventObj: Object) => void, scope?: Object, once?: boolean, data?: any, useCapture?: boolean): Function; + static on(type: string, listener: { handleEvent: (eventObj: Object) => boolean; }, scope?: Object, once?: boolean, data?: any, useCapture?: boolean): Object; + static on(type: string, listener: { handleEvent: (eventObj: Object) => void; }, scope?: Object, once?: boolean, data?: any, 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; - + static removeEventListener(type: string, listener: Function, useCapture?: boolean): void; // It is necessary for "arguments.callee" + static toString(): string; + static willTrigger(type: string): boolean; } export class TickerEvent { From 6731a49e0447172b1f3ed15fdcec2893e5adac08 Mon Sep 17 00:00:00 2001 From: s_kimura Date: Sun, 19 Jan 2014 17:08:33 +0900 Subject: [PATCH 6/9] update to TweenJS v0.5.1. --- tweenjs/tweenjs.d.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tweenjs/tweenjs.d.ts b/tweenjs/tweenjs.d.ts index d7896d3491..a53dd8e209 100644 --- a/tweenjs/tweenjs.d.ts +++ b/tweenjs/tweenjs.d.ts @@ -1,4 +1,4 @@ -// Type definitions for TweenJS 0.5.0 +// Type definitions for TweenJS 0.5.1 // Project: http://www.createjs.com/#!/TweenJS // Definitions by: Pedro Ferreira , Chris Smith // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -82,7 +82,7 @@ declare module createjs { static priority: any; //methods - static init(tween: Tween, prop: string, value: any): any; + 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; @@ -100,8 +100,8 @@ declare module createjs { // 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; @@ -148,6 +148,7 @@ declare module createjs { setPaused(value: boolean): Tween; setPosition(value: number, actionsMode: number): boolean; static tick(delta: number, paused: boolean): void; + tick(delta: number, paused: boolean): void; tick(delta: number): void; to(props: Object, duration?: number, ease?: (t: number) => number): Tween; wait(duration: number, passive?: boolean): Tween; From fbe21d3831c2056daa839d0c1efa62e322264b11 Mon Sep 17 00:00:00 2001 From: Andrey Kurdyumov Date: Sun, 19 Jan 2014 03:53:13 -0800 Subject: [PATCH 7/9] Update declaration of the Device interface The current version of interface for Device plugin is contains property available. See in the current version. https://github.com/apache/cordova-plugin-device/blob/master/www/device.js --- phonegap/phonegap.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/phonegap/phonegap.d.ts b/phonegap/phonegap.d.ts index f23b473a92..01935142ee 100644 --- a/phonegap/phonegap.d.ts +++ b/phonegap/phonegap.d.ts @@ -257,6 +257,7 @@ interface Contacts { } interface Device { + available: boolean; name: string; cordova: string; platform: string; From 8eacc4ca146c46813642d61a6e4ab94ba4c2bcd8 Mon Sep 17 00:00:00 2001 From: Andrey Kurdyumov Date: Sun, 19 Jan 2014 06:56:23 -0800 Subject: [PATCH 8/9] Added property for query string parameters Property qs for SignalR connection could be used to pass additional parameters to new SignalR persistent/hub connections. It is available since 1.0 and is present in 2.0 version of SignalR --- signalr/signalr.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/signalr/signalr.d.ts b/signalr/signalr.d.ts index 70b03c4ec8..7d1e64b742 100644 --- a/signalr/signalr.d.ts +++ b/signalr/signalr.d.ts @@ -36,6 +36,7 @@ interface SignalR { logging: boolean; messageId: string; url: string; + qs: any; (url: string, queryString?: any, logging?: boolean): SignalR; hubConnection(url?: string): SignalR; From 351b06d30057560ba25a13fbdde3742da39c81a5 Mon Sep 17 00:00:00 2001 From: s_kimura Date: Mon, 20 Jan 2014 09:40:38 +0900 Subject: [PATCH 9/9] append the author's name in the definition file. --- createjs/createjs.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/createjs/createjs.d.ts b/createjs/createjs.d.ts index 556a330258..3ebfd11bf5 100644 --- a/createjs/createjs.d.ts +++ b/createjs/createjs.d.ts @@ -1,6 +1,6 @@ // 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 +// Definitions by: Pedro Ferreira , Chris Smith , Satoru Kimura // Definitions: https://github.com/borisyankov/DefinitelyTyped /*