Merge pull request #47 from noobiept/noobiept-createjs

Noobiept createjs
This commit is contained in:
Boris Yankov
2012-11-02 22:05:00 -07:00
2 changed files with 13 additions and 12 deletions

View File

@@ -93,7 +93,7 @@ module createjs {
alphaMap: any; //Image or HTMLCanvasElement
// methods
constructor (alphaMap: Image); //HERE doesn't recognize Image type
constructor (alphaMap: HTMLImageElement);
constructor (alphaMap: HTMLCanvasElement);
clone(): AlphaMapFilter;
}
@@ -101,10 +101,10 @@ module createjs {
export class AlphaMaskFilter extends Filter {
// properties
mask: Image; //HERE or HTMLCanvasElement
mask: any; // HTMLImageElement or HTMLCanvasElement
// methods
constructor (mask: Image);
constructor (mask: HTMLImageElement);
constructor (mask: HTMLCanvasElement);
clone(): AlphaMaskFilter;
}
@@ -112,12 +112,12 @@ module createjs {
export class Bitmap extends DisplayObject {
// properties
image: any; //HERE how to tell the various type possibilities?
image: any; // HTMLImageElement or HTMLCanvasElement or HTMLVideoElement
snapToPixel: bool;
sourceRect: Rectangle;
// methods
constructor (imageOrUrl: Image);
constructor (imageOrUrl: HTMLImageElement);
constructor (imageOrUrl: HTMLCanvasElement);
constructor (imageOrUrl: HTMLVideoElement);
constructor (imageOrUrl: string);
@@ -223,7 +223,8 @@ module createjs {
// methods
addChild(...child: DisplayObject[]): DisplayObject;
addChildAt(...child: DisplayObject[], index: number): DisplayObject; //HERE typescript doesnt like having an argument after the variable length argument
//addChildAt(...child: DisplayObject[], index: number): DisplayObject; //HERE typescript doesnt like having an argument after the variable length argument
addChildAt(...child: any[]): DisplayObject;
clone(recursive?: bool): Container;
contains(child: DisplayObject): bool;
getChildAt(index: number): DisplayObject;
@@ -470,7 +471,7 @@ module createjs {
spriteSheet: SpriteSheet;
// methods
addFrame(source: DisplayObject, sourceRect?: Rectangle, scale?: number, setupFunction?: () => any, setupParams?: any[], setupScope?: Object): number; //HERE returns number or null
addFrame(source: DisplayObject, sourceRect?: Rectangle, scale?: number, setupFunction?: () => any, setupParams?: any[], setupScope?: Object): any; //HERE returns number or null
addMovieClip(source: MovieClip, sourceRect?: Rectangle, scale?: number): void;
build(): void;
buildAsync(callback?: (reference: SpriteSheetBuilder) => any, timeSlice?: number): void;
@@ -482,9 +483,9 @@ module createjs {
export class SpriteSheetUtils {
static addFlippedFrames(spriteSheet: SpriteSheet, horizontal?: bool, vertical?: bool, both?: bool): void;
static extractFrame(spriteSheet: Image, frame: number): Image; //HERE
static flip(spriteSheet: Image, flipData: Object): void;
static mergeAlpha(rgbImage: Image, alphaImage: Image, canvas?: HTMLCanvasElement): HTMLCanvasElement;
static extractFrame(spriteSheet: HTMLImageElement, frame: number): HTMLImageElement;
static flip(spriteSheet: HTMLImageElement, flipData: Object): void;
static mergeAlpha(rgbImage: HTMLImageElement, alphaImage: HTMLImageElement, canvas?: HTMLCanvasElement): HTMLCanvasElement;
}

View File

@@ -45,7 +45,7 @@ module createjs {
paused: bool;
playState: string;
src: string;
uniqueId: string; //HERE string or number
uniqueId: any; //HERE string or number
// methods
getDuration(): number;
@@ -89,7 +89,7 @@ module createjs {
// methods
static checkPlugin(initializeDefault: bool): bool;
static getCapabilities(): Object;
static getCapability(key: string); //HERE can return string | number | bool
static getCapability(key: string): any; //HERE can return string | number | bool
static getInstanceById(uniqueId: string): SoundInstance;
static getMasterVolume(): number;
static getSrcFromId(value: string): string;