From 3bf4e60dbe0d05ad67192abcfb1aaecbff28e62d Mon Sep 17 00:00:00 2001 From: Boris Yankov Date: Fri, 2 Nov 2012 05:36:50 +0200 Subject: [PATCH] Update CreateJS libs with formatting and header comments --- Definitions/easeljs-0.5.d.ts | 920 ++++++++++++++++----------------- Definitions/preloadjs-0.2.d.ts | 105 ++-- Definitions/soundjs-0.3.d.ts | 157 +++--- Definitions/tweenjs-0.3.d.ts | 202 ++++---- README.md | 5 +- 5 files changed, 671 insertions(+), 718 deletions(-) diff --git a/Definitions/easeljs-0.5.d.ts b/Definitions/easeljs-0.5.d.ts index 4d49690397..2ed572db53 100644 --- a/Definitions/easeljs-0.5.d.ts +++ b/Definitions/easeljs-0.5.d.ts @@ -1,667 +1,631 @@ +// Type definitions for EaselJS 0.5 +// Project: http://www.createjs.com/#!/EaselJS +// Definitions by: Pedro Ferreira +// Definitions: https://github.com/borisyankov/DefinitelyTyped + /* - See https://bitbucket.org/drk4/createjs_ts_definitions for updates/examples - 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. */ - // rename the native MouseEvent, to avoid conflit with createjs's MouseEvent -interface NativeMouseEvent extends MouseEvent - { +/// - } +// rename the native MouseEvent, to avoid conflit with createjs's MouseEvent +interface NativeMouseEvent extends MouseEvent { +} -/// - - -module createjs -{ +module createjs { // :: base classes :: // -export class DisplayObject - { + export class DisplayObject { // properties - alpha: number; - cacheCanvas: HTMLCanvasElement; - cacheID: number; - compositeOperation: string; - filters: Filter[]; - hitArea: DisplayObject; - id: number; - mask: Shape; - mouseEnabled: bool; - name: string; - parent: DisplayObject; - regX: number; - regY: number; - rotation: number; - scaleX: number; - scaleY: number; - shadow: Shadow; - skewX: number; - skewY: number; - snapToPixel: bool; - static suppressCrossDomainErrors: bool; - visible: bool; - x: number; - y: number; + alpha: number; + cacheCanvas: HTMLCanvasElement; + cacheID: number; + compositeOperation: string; + filters: Filter[]; + hitArea: DisplayObject; + id: number; + mask: Shape; + mouseEnabled: bool; + name: string; + parent: DisplayObject; + regX: number; + regY: number; + rotation: number; + scaleX: number; + scaleY: number; + shadow: Shadow; + skewX: number; + skewY: number; + snapToPixel: bool; + static suppressCrossDomainErrors: bool; + visible: bool; + x: number; + y: number; // methods - cache( x: number, y: number, width: number, height: number, scale?: number ): void; - clone(): DisplayObject; - draw( ctx: CanvasRenderingContext2D, ignoreCache: bool ): void; - getCacheDataURL(): void; - getConcatenatedMatrix( mtx: Matrix2D ): Matrix2D; - getMatrix( matrix: Matrix2D ): Matrix2D; - getStage(): Stage; - globalToLocal( x: number, y: number ): Point; - hitTest( x: number, y: number ): bool; - isVisible(): bool; - localToGlobal( x: number, y: number ): Point; - localToLocal( x: number, y: number, target: DisplayObject ): Point; - setTransform( x: number, y: number, scaleX: number, scaleY: number, rotation: number, skewX: number, skewY: number, regX: number, regY: number ): DisplayObject; - setupContext( ctx: CanvasRenderingContext2D ): void; - toString(): string; - uncache(): void; - updateCache( compositeOperation: string ): void; - + cache(x: number, y: number, width: number, height: number, scale?: number): void; + clone(): DisplayObject; + draw(ctx: CanvasRenderingContext2D, ignoreCache: bool): void; + getCacheDataURL(): void; + getConcatenatedMatrix(mtx: Matrix2D): Matrix2D; + getMatrix(matrix: Matrix2D): Matrix2D; + getStage(): Stage; + globalToLocal(x: number, y: number): Point; + hitTest(x: number, y: number): bool; + isVisible(): bool; + localToGlobal(x: number, y: number): Point; + localToLocal(x: number, y: number, target: DisplayObject): Point; + setTransform(x: number, y: number, scaleX: number, scaleY: number, rotation: number, skewX: number, skewY: number, regX: number, regY: number): DisplayObject; + setupContext(ctx: CanvasRenderingContext2D): void; + toString(): string; + uncache(): void; + updateCache(compositeOperation: string): void; + // events - onClick: (event: MouseEvent) => any; - onDoubleClick: (event: MouseEvent) => any; - onMouseOut: (event: MouseEvent) => any; - onMouseOver: (event: MouseEvent) => any; - onPress: (event: MouseEvent) => any; - onTick: () => any; + onClick: (event: MouseEvent) => any; + onDoubleClick: (event: MouseEvent) => any; + onMouseOut: (event: MouseEvent) => any; + onMouseOver: (event: MouseEvent) => any; + onPress: (event: MouseEvent) => any; + onTick: () => any; } -export class Filter - { - applyFilter( ctx: CanvasRenderingContext2D, x: number, y: number, width: number, height: number, targetCtx?: CanvasRenderingContext2D, targetX?: number, targetY?: number ): bool; - clone(): Filter; - getBounds(): Rectangle; - toString(): string; + export class Filter { + applyFilter(ctx: CanvasRenderingContext2D, x: number, y: number, width: number, height: number, targetCtx?: CanvasRenderingContext2D, targetX?: number, targetY?: number): bool; + clone(): Filter; + getBounds(): Rectangle; + toString(): string; } - + // :: The rest :: // -export class AlphaMapFilter extends Filter - { - constructor( alphaMap: Image ); //HERE doesn't recognize Image type - constructor( alphaMap: HTMLCanvasElement ); + export class AlphaMapFilter extends Filter { + constructor (alphaMap: Image); //HERE doesn't recognize Image type + constructor (alphaMap: HTMLCanvasElement); // properties - alphaMap: Image; //HERE can be also an HTMLCanvasElement.. can't overload properties + alphaMap: any; //Image or HTMLCanvasElement // methods - applyFilter( ctx: CanvasRenderingContext2D, x: number, y: number, width: number, height: number, targetCtx?: CanvasRenderingContext2D, targetX?: number, targetY?: number ): bool; - clone(): AlphaMapFilter; - toString(): string; + applyFilter(ctx: CanvasRenderingContext2D, x: number, y: number, width: number, height: number, targetCtx?: CanvasRenderingContext2D, targetX?: number, targetY?: number): bool; + clone(): AlphaMapFilter; + toString(): string; } -export class AlphaMaskFilter extends Filter - { - constructor( mask: Image ); - constructor( mask: HTMLCanvasElement ); + export class AlphaMaskFilter extends Filter { + constructor (mask: Image); + constructor (mask: HTMLCanvasElement); // properties - mask: Image; //HERE or HTMLCanvasElement + mask: Image; //HERE or HTMLCanvasElement // methods - applyFilter( ctx: CanvasRenderingContext2D, x: number, y: number, width: number, height: number, targetCtx?: CanvasRenderingContext2D, targetX?: number, targetY?: number ): bool; - clone(): AlphaMaskFilter; - toString(): string; + applyFilter(ctx: CanvasRenderingContext2D, x: number, y: number, width: number, height: number, targetCtx?: CanvasRenderingContext2D, targetX?: number, targetY?: number): bool; + clone(): AlphaMaskFilter; + toString(): string; } -export class Bitmap extends DisplayObject - { - constructor( imageOrUrl: Image ); - constructor( imageOrUrl: HTMLCanvasElement ); - constructor( imageOrUrl: HTMLVideoElement ); - constructor( imageOrUrl: string ); + export class Bitmap extends DisplayObject { + constructor (imageOrUrl: Image); + constructor (imageOrUrl: HTMLCanvasElement); + constructor (imageOrUrl: HTMLVideoElement); + constructor (imageOrUrl: string); // properties - image; //HERE how to tell the various type possibilities? - snapToPixel: bool; - sourceRect: Rectangle; + image; //HERE how to tell the various type possibilities? + snapToPixel: bool; + sourceRect: Rectangle; // methods - clone(): Bitmap; - draw( ctx: CanvasRenderingContext2D, ignoreCache: bool ): void; - isVisible(): bool; - toString(): string; - uncache(): void; - updateCache(): void; + clone(): Bitmap; + draw(ctx: CanvasRenderingContext2D, ignoreCache: bool): void; + isVisible(): bool; + toString(): string; + uncache(): void; + updateCache(): void; } -export class BitmapAnimation extends DisplayObject - { - constructor( spriteSheet: SpriteSheet ); - + export class BitmapAnimation extends DisplayObject { + constructor (spriteSheet: SpriteSheet); + // properties - currentAnimation: string; - currentAnimationFrame: number; - currentFrame: number; - offset: number; - paused: bool; - snapToPixel: bool; - spriteSheet: SpriteSheet; + currentAnimation: string; + currentAnimationFrame: number; + currentFrame: number; + offset: number; + paused: bool; + snapToPixel: bool; + spriteSheet: SpriteSheet; // methods - advance(): void; - cache(): void; - clone(): BitmapAnimation; - draw( ctx: CanvasRenderingContext2D, ignoreCache: bool ): void; - gotoAndPlay( frameOrAnimation: string ): void; - gotoAndPlay( frameOrAnimation: number ): void; - isVisible(): bool; - play(): void; - stop(): void; - toString(): string; - uncache(): void; - updateCache(): void; + advance(): void; + cache(): void; + clone(): BitmapAnimation; + draw(ctx: CanvasRenderingContext2D, ignoreCache: bool): void; + gotoAndPlay(frameOrAnimation: string): void; + gotoAndPlay(frameOrAnimation: number): void; + isVisible(): bool; + play(): void; + stop(): void; + toString(): string; + uncache(): void; + updateCache(): void; // events - onAnimationEnd: (reference: BitmapAnimation, animationEnded: string) => any; + onAnimationEnd: (reference: BitmapAnimation, animationEnded: string) => any; } -export class BoxBlurFilter extends Filter - { - constructor( blurX: number, blurY: number, quality: number ); + export class BoxBlurFilter extends Filter { + constructor (blurX: number, blurY: number, quality: number); // properties - blurX: number; - blurY: number; - quality: number; + blurX: number; + blurY: number; + quality: number; // methods - applyFilter( ctx: CanvasRenderingContext2D, x: number, y: number, width: number, height: number, targetCtx?: CanvasRenderingContext2D, targetX?: number, targetY?: number ): bool; - clone(): BoxBlurFilter; - getBounds(): Rectangle; - toString(): string; + applyFilter(ctx: CanvasRenderingContext2D, x: number, y: number, width: number, height: number, targetCtx?: CanvasRenderingContext2D, targetX?: number, targetY?: number): bool; + clone(): BoxBlurFilter; + getBounds(): Rectangle; + toString(): string; } -export class ColorFilter extends Filter - { - constructor( redMultiplier?: number, greenMultiplier?: number, blueMultiplier?: number, alphaMultiplier?: number, redOffset?: number, greenOffset?: number, blueOffset?: number, alphaOffset?: number ); + export class ColorFilter extends Filter { + constructor (redMultiplier?: number, greenMultiplier?: number, blueMultiplier?: number, alphaMultiplier?: number, redOffset?: number, greenOffset?: number, blueOffset?: number, alphaOffset?: number); // properties - alphaOffset: number; - blueMultiplier: number; - blueOffset: number; - greenMultiplier: number; - greenOffset: number; - redMultiplier: number; - redOffset: number; + alphaOffset: number; + blueMultiplier: number; + blueOffset: number; + greenMultiplier: number; + greenOffset: number; + redMultiplier: number; + redOffset: number; // methods - applyFilter( ctx: CanvasRenderingContext2D, x: number, y: number, width: number, height: number, targetCtx?: CanvasRenderingContext2D, targetX?: number, targetY?: number ): bool; - clone(): ColorFilter; - toString(): string; + applyFilter(ctx: CanvasRenderingContext2D, x: number, y: number, width: number, height: number, targetCtx?: CanvasRenderingContext2D, targetX?: number, targetY?: number): bool; + clone(): ColorFilter; + toString(): string; } -export class ColorMatrix - { - constructor( brightness: number, contrast: number, saturation: number, hue: number ); + export class ColorMatrix { + constructor (brightness: number, contrast: number, saturation: number, hue: number); // properties - DELTA_INDEX: number[]; - IDENTITY_MATRIX: number[]; - LENGTH: number; + DELTA_INDEX: number[]; + IDENTITY_MATRIX: number[]; + LENGTH: number; // methods - adjustBrightness( value: number ): ColorMatrix; - adjustColor( brightness: number, contrast: number, saturation: number, hue: number ): ColorMatrix; - adjustContrast( value: number ): ColorMatrix; - adjustHue( value: number ): ColorMatrix; - adjustSaturation( value: number ): ColorMatrix; - clone(): ColorMatrix; - concat( matrix: ColorMatrix[] ): ColorMatrix; - copyMatrix( matrix: ColorMatrix[] ): ColorMatrix; - reset(): ColorMatrix; - toArray(): number[]; - } - - -export class ColorMatrixFilter extends Filter - { - constructor( matrix: number[] ); - - // methods - applyFilter( ctx: CanvasRenderingContext2D, x: number, y: number, width: number, height: number, targetCtx?: CanvasRenderingContext2D, targetX?: number, targetY?: number ): bool; - clone(): ColorMatrixFilter; - toString(): string; + adjustBrightness(value: number): ColorMatrix; + adjustColor(brightness: number, contrast: number, saturation: number, hue: number): ColorMatrix; + adjustContrast(value: number): ColorMatrix; + adjustHue(value: number): ColorMatrix; + adjustSaturation(value: number): ColorMatrix; + clone(): ColorMatrix; + concat(matrix: ColorMatrix[]): ColorMatrix; + copyMatrix(matrix: ColorMatrix[]): ColorMatrix; + reset(): ColorMatrix; + toArray(): number[]; } -export class Command //HERE is this supposed to be used? (or just internal of the lib) - { - constructor( f, params, path ); - + export class ColorMatrixFilter extends Filter { + constructor (matrix: number[]); + // methods - exec( scope ): void; + applyFilter(ctx: CanvasRenderingContext2D, x: number, y: number, width: number, height: number, targetCtx?: CanvasRenderingContext2D, targetX?: number, targetY?: number): bool; + clone(): ColorMatrixFilter; + toString(): string; } -export class Container extends DisplayObject + export class Command //HERE is this supposed to be used? (or just internal of the lib) { + constructor (f, params, path); + + // methods + exec(scope): void; + } + + + export class Container extends DisplayObject { // properties - children: DisplayObject[]; + children: DisplayObject[]; // methods - addChild( ...child: DisplayObject[] ): DisplayObject; - addChildAt( ...child: DisplayObject[], index: number ): DisplayObject; //HERE typescript doesnt like having an argument after the variable length argument - clone( recursive?: bool ): Container; - contains( child: DisplayObject ): bool; - draw( ctx: CanvasRenderingContext2D, ignoreCache: bool ): void; - getChildAt( index: number ): DisplayObject; - getChildIndex( child: DisplayObject ): number; - getNumChildren(): number; - getObjectsUnderPoint( x, number, y: number ): DisplayObject[]; - getObjectUnderPoint( x: number, y: number ): DisplayObject; - hitTest( x: number, y: number ): bool; - isVisible(): bool; - removeAllChildren(): void; - removeChild( ...child: DisplayObject[] ): bool; - removeChildAt( ...index: number[] ): bool; - setChildIndex( child: DisplayObject, index: number ): void; - sortChildren( sortFunction: (a: DisplayObject, b: DisplayObject) => number ): void; - swapChildren( child1: DisplayObject, child2: DisplayObject ): void; - swapChildrenAt( index1: number, index2: number ): void; - toString(): string; + addChild(...child: DisplayObject[]): DisplayObject; + addChildAt(...child: DisplayObject[], index: number): DisplayObject; //HERE typescript doesnt like having an argument after the variable length argument + clone(recursive?: bool): Container; + contains(child: DisplayObject): bool; + draw(ctx: CanvasRenderingContext2D, ignoreCache: bool): void; + getChildAt(index: number): DisplayObject; + getChildIndex(child: DisplayObject): number; + getNumChildren(): number; + getObjectsUnderPoint(x, number, y: number): DisplayObject[]; + getObjectUnderPoint(x: number, y: number): DisplayObject; + hitTest(x: number, y: number): bool; + isVisible(): bool; + removeAllChildren(): void; + removeChild(...child: DisplayObject[]): bool; + removeChildAt(...index: number[]): bool; + setChildIndex(child: DisplayObject, index: number): void; + sortChildren(sortFunction: (a: DisplayObject, b: DisplayObject) => number): void; + swapChildren(child1: DisplayObject, child2: DisplayObject): void; + swapChildrenAt(index1: number, index2: number): void; + toString(): string; } -export class DOMElement extends DisplayObject - { - constructor( htmlElement: HTMLElement ); + export class DOMElement extends DisplayObject { + constructor (htmlElement: HTMLElement); // properties - htmlElement: HTMLElement; + htmlElement: HTMLElement; // methods - cache(): void; - clone(): DOMElement; - draw( ctx: CanvasRenderingContext2D, ignoreCache: bool ): void; - globalToLocal(): void; - isVisible(): bool; - localToGlobal(): void; - localToLocal(): void; - toString(): string; - uncache(): void; - updateCache(): void; + cache(): void; + clone(): DOMElement; + draw(ctx: CanvasRenderingContext2D, ignoreCache: bool): void; + globalToLocal(): void; + isVisible(): bool; + localToGlobal(): void; + localToLocal(): void; + toString(): string; + uncache(): void; + updateCache(): void; } -export class Graphics - { + export class Graphics { // properties - BASE_64: Object; - curveTo( cpx: number, cpy: number, x: number, y: number ): Graphics; // same as quadraticCurveTo() - drawRect( x: number, y: number, width: number, height: number ): Graphics; // same as rect() - STROKE_CAPS_MAP: string[]; - STROKE_JOINTS_MAP: string[]; + BASE_64: Object; + curveTo(cpx: number, cpy: number, x: number, y: number): Graphics; // same as quadraticCurveTo() + drawRect(x: number, y: number, width: number, height: number): Graphics; // same as rect() + STROKE_CAPS_MAP: string[]; + STROKE_JOINTS_MAP: string[]; // methods - arc( x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise: bool ): Graphics; - arcTo( x1: number, y1: number, x2: number, y2: number, radius: number ): Graphics; - beginBitmapFill( image: Object, repetition?: string ): Graphics; - beginBitmapStroke( image: Object, repetition?: string ): Graphics; - beginFill( color: string ): Graphics; - beginLinearGradientFill( colors: string[], ratios: number[], x0: number, y0: number, x1: number, y1: number ): Graphics; - beginLinearGradientStroke( colors: string[], ratios: number[], x0: number, y0: number, x1: number, y1: number ): Graphics; - beginRadialGradientFill( colors: string[], ratios: number[], x0: number, y0: number, r0: number, x1: number, y1: number, r1: number ): Graphics; - beginRadialGradientStroke( colors: string[], ratios: number[], x0: number, y0: number, r0: number, x1: number, y1: number, r1: number ): Graphics; - beginStroke( color: string ): Graphics; - bezierCurveTo( cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number ): Graphics; - clear(): Graphics; - clone(): Graphics; - closePath(): Graphics; - decodePath( str: string ): Graphics; - draw( ctx: CanvasRenderingContext2D ): void; - drawAsPath( ctx: CanvasRenderingContext2D ): void; - drawCircle( x: number, y: number, radius: number ): Graphics; - drawEllipse( x: number, y: number, width: number, height: number ): Graphics; - drawPolyStar( x: number, y: number, radius: number, sides: number, pointSize: number, angle: number ): Graphics; - drawRoundRect( x: number, y: number, width: number, height: number, radius: number ): Graphics; - drawRoundRectComplex( x: number, y: number, width: number, height: number, radiusTL: number, radiusTR: number, radiusBR: number, radisBL: number ): Graphics; - endFill(): Graphics; - endStroke(): Graphics; - static getHSL( hue: number, saturation: number, lightness: number, alpha?: number ): string; - static getRGB( red: number, green: number, blue: number, alpha?: number ): string; - lineTo( x: number, y: number ): Graphics; - moveTo( x: number, y: number ): Graphics; - quadraticCurveTo( cpx: number, cpy: number, x: number, y: number ): Graphics; - rect( x: number, y: number, width: number, height: number ): Graphics; - setStrokeStyle( thickness: number, caps?: string, joints?: string, miter?: number ): Graphics; // caps and joints can be a string or number - setStrokeStyle( thickness: number, caps?: number, joints?: string, miter?: number ): Graphics; - setStrokeStyle( thickness: number, caps?: string, joints?: number, miter?: number ): Graphics; - setStrokeStyle( thickness: number, caps?: number, joints?: number, miter?: number ): Graphics; - toString(): string; + arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise: bool): Graphics; + arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): Graphics; + beginBitmapFill(image: Object, repetition?: string): Graphics; + beginBitmapStroke(image: Object, repetition?: string): Graphics; + beginFill(color: string): Graphics; + beginLinearGradientFill(colors: string[], ratios: number[], x0: number, y0: number, x1: number, y1: number): Graphics; + beginLinearGradientStroke(colors: string[], ratios: number[], x0: number, y0: number, x1: number, y1: number): Graphics; + beginRadialGradientFill(colors: string[], ratios: number[], x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): Graphics; + beginRadialGradientStroke(colors: string[], ratios: number[], x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): Graphics; + beginStroke(color: string): Graphics; + bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): Graphics; + clear(): Graphics; + clone(): Graphics; + closePath(): Graphics; + decodePath(str: string): Graphics; + draw(ctx: CanvasRenderingContext2D): void; + drawAsPath(ctx: CanvasRenderingContext2D): void; + drawCircle(x: number, y: number, radius: number): Graphics; + drawEllipse(x: number, y: number, width: number, height: number): Graphics; + drawPolyStar(x: number, y: number, radius: number, sides: number, pointSize: number, angle: number): Graphics; + drawRoundRect(x: number, y: number, width: number, height: number, radius: number): Graphics; + drawRoundRectComplex(x: number, y: number, width: number, height: number, radiusTL: number, radiusTR: number, radiusBR: number, radisBL: number): Graphics; + endFill(): Graphics; + endStroke(): Graphics; + static getHSL(hue: number, saturation: number, lightness: number, alpha?: number): string; + static getRGB(red: number, green: number, blue: number, alpha?: number): string; + lineTo(x: number, y: number): Graphics; + moveTo(x: number, y: number): Graphics; + quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): Graphics; + rect(x: number, y: number, width: number, height: number): Graphics; + setStrokeStyle(thickness: number, caps?: string, joints?: string, miter?: number): Graphics; // caps and joints can be a string or number + setStrokeStyle(thickness: number, caps?: number, joints?: string, miter?: number): Graphics; + setStrokeStyle(thickness: number, caps?: string, joints?: number, miter?: number): Graphics; + setStrokeStyle(thickness: number, caps?: number, joints?: number, miter?: number): Graphics; + toString(): string; } -export class Matrix2D - { - constructor( a: number, b: number, c: number, d: number, tx: number, ty: number ); + export class Matrix2D { + constructor (a: number, b: number, c: number, d: number, tx: number, ty: number); // properties - a: number; - alpha: number; - atx: number; - b: number; - c: number; - compositeOperation: string; - d: number; - static DEG_TO_RAD: number; - static identity: Matrix2D; - shadow: Shadow; - ty: number; + a: number; + alpha: number; + atx: number; + b: number; + c: number; + compositeOperation: string; + d: number; + static DEG_TO_RAD: number; + static identity: Matrix2D; + shadow: Shadow; + ty: number; // methods - append( a: number, b: number, c: number, d: number, tx: number, ty: number ): Matrix2D; - appendMatrix( matrix: Matrix2D ): Matrix2D; - appendProperties( a: number, b: number, c: number, d: number, tx: number, ty: number, alpha: number, shadow: Shadow, compositeOperation: string ): Matrix2D; - appendTransform( x: number, y: number, scaleX: number, scaleY: number, rotation: number, skewX: number, skewY: number, regX?: number, regY?: number ): Matrix2D; - clone(): Matrix2D; - decompose( target: Object ): Matrix2D; - identity(): Matrix2D; - invert(): Matrix2D; - isIdentity(): bool; - prepend( a: number, b: number, c: number, d: number, tx: number, ty: number ): Matrix2D; - prependMatrix( matrix: Matrix2D ): Matrix2D; - prependProperties( alpha: number, shadow: Shadow, compositeOperation: string ): Matrix2D; - prependTransform( x: number, y: number, scaleX: number, scaleY: number, rotation: number, skewX: number, skewY: number, regX?: number, regY?: number ): Matrix2D; - rotate( angle: number ): Matrix2D; - scale( x: number, y: number ): Matrix2D; - skew( skewX: number, skewY: number ): Matrix2D; - toString(): string; - translate( x: number, y: number ): Matrix2D; + append(a: number, b: number, c: number, d: number, tx: number, ty: number): Matrix2D; + appendMatrix(matrix: Matrix2D): Matrix2D; + appendProperties(a: number, b: number, c: number, d: number, tx: number, ty: number, alpha: number, shadow: Shadow, compositeOperation: string): Matrix2D; + appendTransform(x: number, y: number, scaleX: number, scaleY: number, rotation: number, skewX: number, skewY: number, regX?: number, regY?: number): Matrix2D; + clone(): Matrix2D; + decompose(target: Object): Matrix2D; + identity(): Matrix2D; + invert(): Matrix2D; + isIdentity(): bool; + prepend(a: number, b: number, c: number, d: number, tx: number, ty: number): Matrix2D; + prependMatrix(matrix: Matrix2D): Matrix2D; + prependProperties(alpha: number, shadow: Shadow, compositeOperation: string): Matrix2D; + prependTransform(x: number, y: number, scaleX: number, scaleY: number, rotation: number, skewX: number, skewY: number, regX?: number, regY?: number): Matrix2D; + rotate(angle: number): Matrix2D; + scale(x: number, y: number): Matrix2D; + skew(skewX: number, skewY: number): Matrix2D; + toString(): string; + translate(x: number, y: number): Matrix2D; } - -export class MouseEvent - { - constructor( type: string, stageX: number, stageY: number, target: DisplayObject, nativeEvent: NativeMouseEvent, pointerID: number, primary: bool, rawX: number, rawY: number ); - + + export class MouseEvent { + constructor (type: string, stageX: number, stageY: number, target: DisplayObject, nativeEvent: NativeMouseEvent, pointerID: number, primary: bool, rawX: number, rawY: number); + // properties - nativeEvent: NativeMouseEvent; - pointerID: number; - primaryPointer: bool; - rawX: number; - rawY: number; - stageX: number; - stageY: number; - target: DisplayObject; - type: string; + nativeEvent: NativeMouseEvent; + pointerID: number; + primaryPointer: bool; + rawX: number; + rawY: number; + stageX: number; + stageY: number; + target: DisplayObject; + type: string; // methods - clone(): MouseEvent; - toString(): string; + clone(): MouseEvent; + toString(): string; // events - onMouseMove: ( event: MouseEvent ) => any; - onMouseUp: ( event: MouseEvent ) => any; + onMouseMove: (event: MouseEvent) => any; + onMouseUp: (event: MouseEvent) => any; } -export class MovieClip extends Container - { - constructor( mode: string, startPosition: number, loop: bool, labels: Object ); + export class MovieClip extends Container { + constructor (mode: string, startPosition: number, loop: bool, labels: Object); // properties - actionsEnabled: bool; - static INDEPENDENT: string; - loop: bool; - mode: string; - paused: bool; - static SINGLE_FRAME: string; - startPosition: number; - static SYNCHED: string; - timeline: Timeline; //HERE requires tweenJS + actionsEnabled: bool; + static INDEPENDENT: string; + loop: bool; + mode: string; + paused: bool; + static SINGLE_FRAME: string; + startPosition: number; + static SYNCHED: string; + timeline: Timeline; //HERE requires tweenJS // methods - clone(): void; - draw( ctx: CanvasRenderingContext2D, ignoreCache: bool ): void; - gotoAndPlay( positionOrLabel: string ): void; - gotoAndPlay( positionOrLabel: number ): void; - gotoAndStop( positionOrLabel: string ): void; - gotoAndStop( positionOrLabel: number ): void; - isVisible(): bool; - play(): void; - stop(): void; - toString(): string; - } - - -export class Point - { - constructor( x: number, y: number ); - - // properties - x: number; - y: number; - - // methods - clone(): Point; - toString(): string; + clone(): void; + draw(ctx: CanvasRenderingContext2D, ignoreCache: bool): void; + gotoAndPlay(positionOrLabel: string): void; + gotoAndPlay(positionOrLabel: number): void; + gotoAndStop(positionOrLabel: string): void; + gotoAndStop(positionOrLabel: number): void; + isVisible(): bool; + play(): void; + stop(): void; + toString(): string; } -export class Rectangle - { - constructor( x: number, y: number, width: number, height: number ); + export class Point { + constructor (x: number, y: number); // properties - x: number; - y: number; - width: number; - height: number; + x: number; + y: number; // methods - clone(): Rectangle; - toString(): string; + clone(): Point; + toString(): string; } -export class Shadow - { - constructor( color: string, offsetX: number, offsetY: number, blur: number ); + export class Rectangle { + constructor (x: number, y: number, width: number, height: number); // properties - blur: number; - color: string; - static identity: Shadow; - offsetX: number; - offsetY: number; + x: number; + y: number; + width: number; + height: number; // methods - clone(): Shadow; - toString(): string; + clone(): Rectangle; + toString(): string; } -export class Shape extends DisplayObject - { - constructor( graphics?: Graphics ); + export class Shadow { + constructor (color: string, offsetX: number, offsetY: number, blur: number); // properties - graphics: Graphics; + blur: number; + color: string; + static identity: Shadow; + offsetX: number; + offsetY: number; // methods - clone(recursive: bool): Shape; - draw( ctx, CanvasRenderingContext2D, ignoreCache: bool ): void; - isVisible(): bool; - toString(): string; + clone(): Shadow; + toString(): string; + } + + + export class Shape extends DisplayObject { + constructor (graphics?: Graphics); + + // properties + graphics: Graphics; + + // methods + clone(recursive: bool): Shape; + draw(ctx, CanvasRenderingContext2D, ignoreCache: bool): void; + isVisible(): bool; + toString(): string; } // what is returned from .getAnimation() -interface SpriteSheetAnimation - { - frames: number[]; - frequency: number; - name: string; - next: string; + interface SpriteSheetAnimation { + frames: number[]; + frequency: number; + name: string; + next: string; } -export class SpriteSheet - { - constructor( data: Object ); + export class SpriteSheet { + constructor (data: Object); // properties - complete: bool; + complete: bool; // methods - clone(): SpriteSheet; - getAnimation( name: string ): SpriteSheetAnimation; - getAnimations(): string[]; - getFrame( frameIndex: number ): Object; - getNumFrames( animation: string ): number; - toString(): string; + clone(): SpriteSheet; + getAnimation(name: string): SpriteSheetAnimation; + getAnimations(): string[]; + getFrame(frameIndex: number): Object; + getNumFrames(animation: string): number; + toString(): string; // events - onComplete: () => any; + onComplete: () => any; } -export class SpriteSheetBuilder - { + export class SpriteSheetBuilder { // properties - defaultScale: number; - maxWidth: number; - maxHeight: number; - padding: number; - spriteSheet: SpriteSheet; + defaultScale: number; + maxWidth: number; + maxHeight: number; + padding: number; + spriteSheet: SpriteSheet; // methods - addFrame( source: DisplayObject, sourceRect?: Rectangle, scale?: number, setupFunction?: () => any, setupParams?: any[], setupScope?: Object ): number; //HERE returns number or null - addMovieClip( source: MovieClip, sourceRect?: Rectangle, scale?: number ): void; - build(): void; - buildAsync( callback?: ( reference: SpriteSheetBuilder ) => any, timeSlice?: number ): void; - clone(): SpriteSheetBuilder; - stopAsync(): void; - toString(): string; + addFrame(source: DisplayObject, sourceRect?: Rectangle, scale?: number, setupFunction?: () => any, setupParams?: any[], setupScope?: Object): number; //HERE returns number or null + addMovieClip(source: MovieClip, sourceRect?: Rectangle, scale?: number): void; + build(): void; + buildAsync(callback?: (reference: SpriteSheetBuilder) => any, timeSlice?: number): void; + clone(): SpriteSheetBuilder; + stopAsync(): void; + toString(): string; } -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; + 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; } -export class Stage extends Container - { - constructor (canvas: HTMLCanvasElement); - + export class Stage extends Container { + constructor (canvas: HTMLCanvasElement); + // properties - autoClear: bool; - canvas: HTMLCanvasElement; - mouseInBounds: bool; - mouseX: number; - mouseY: number; - snapToPixelEnabled: bool; - tickOnUpdate: bool; - + autoClear: bool; + canvas: HTMLCanvasElement; + mouseInBounds: bool; + mouseX: number; + mouseY: number; + snapToPixelEnabled: bool; + tickOnUpdate: bool; + // methods - clear(): void; - clone(): Stage; - enableMouseOver( frequency: number ): void; - toDataURL( backgroundColor: string, mimeType: string ): string; - toString(): string; - update(): void; + clear(): void; + clone(): Stage; + enableMouseOver(frequency: number): void; + toDataURL(backgroundColor: string, mimeType: string): string; + toString(): string; + update(): void; // events - onMouseDown: ( event: MouseEvent ) => any; - onMouseMove: ( event: MouseEvent ) => any; - onMouseUp: ( event: MouseEvent ) => any; + onMouseDown: (event: MouseEvent) => any; + onMouseMove: (event: MouseEvent) => any; + onMouseUp: (event: MouseEvent) => any; } -export class Text extends DisplayObject - { - constructor(text?: string, font?: string, color?: string); + export class Text extends DisplayObject { + constructor (text?: string, font?: string, color?: string); // properties - color: string; - font: string; - lineHeight: number; - lineWidth: number; - maxWidth: number; - outline: bool; - text: string; - textAlign: string; - textBaseline: string; + color: string; + font: string; + lineHeight: number; + lineWidth: number; + maxWidth: number; + outline: bool; + text: string; + textAlign: string; + textBaseline: string; // methods - clone(): Text; - draw(ctx: CanvasRenderingContext2D, ignoreCache: bool): void; - getMeasuredHeight(): number; - getMeasuredLineHeight(): number; - getMeasuredWidth(): number; - isVisible(): bool; - toString(): string; + clone(): Text; + draw(ctx: CanvasRenderingContext2D, ignoreCache: bool): void; + getMeasuredHeight(): number; + getMeasuredLineHeight(): number; + getMeasuredWidth(): number; + isVisible(): bool; + toString(): string; } -export class Ticker - { + export class Ticker { // properties - static useRAF: bool; + static useRAF: bool; // methods - static addListener( o:Object, pauseable?:bool ): void; - static getFPS(): number; - static getInterval(): number; - static getMeasuredFPS( ticks?: number ): number; - static getPaused(): bool; - static getTicks( pauseable?: bool ): number; - static getTime( pauseable: bool ): number; - static init(): void; - static removeAllListeners(): void; - static removeListener( o: Object ): void; - static setFPS( value: number ): void; - static setInterval( interval: number ): void; - static setPaused( value: bool ): void; + static addListener(o: Object, pauseable?: bool): void; + static getFPS(): number; + static getInterval(): number; + static getMeasuredFPS(ticks?: number): number; + static getPaused(): bool; + static getTicks(pauseable?: bool): number; + static getTime(pauseable: bool): number; + static init(): void; + static removeAllListeners(): void; + static removeListener(o: Object): void; + static setFPS(value: number): void; + static setInterval(interval: number): void; + static setPaused(value: bool): void; // events - tick: ( timeElapsed: number ) => any; + tick: (timeElapsed: number) => any; } -export class Touch - { + export class Touch { // methods - static disable( stage: Stage ): void; - static enable( stage: Stage, singleTouch?: bool, allowDefault?: bool ): bool; - static isSupported(): bool; + static disable(stage: Stage): void; + static enable(stage: Stage, singleTouch?: bool, allowDefault?: bool): bool; + static isSupported(): bool; } -export class UID - { + export class UID { // methods - static get(): number; + static get(): number; } -} - - - +} \ No newline at end of file diff --git a/Definitions/preloadjs-0.2.d.ts b/Definitions/preloadjs-0.2.d.ts index 419cf394bc..fd044e9689 100644 --- a/Definitions/preloadjs-0.2.d.ts +++ b/Definitions/preloadjs-0.2.d.ts @@ -1,82 +1,77 @@ +// Type definitions for PreloadJS 0.2 +// Project: http://www.createjs.com/#!/PreloadJS +// Definitions by: Pedro Ferreira +// Definitions: https://github.com/borisyankov/DefinitelyTyped + /* - See https://bitbucket.org/drk4/createjs_ts_definitions for updates/examples - 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. */ -module createjs -{ -export class AbstractLoader - { +module createjs { + export class AbstractLoader { // properties - canceled: bool; - loaded: bool; - progress: number; + canceled: bool; + loaded: bool; + progress: number; // methods - cancel(): void; - getItem(): Object; - load(): void; + cancel(): void; + getItem(): Object; + load(): void; // events - onComplete: () => any; - onError: () => any; - onFileLoad: () => any; - onFileProgress: () => any; - onLoadStart: () => any; - onProgress: () => any; + onComplete: () => any; + onError: () => any; + onFileLoad: () => any; + onFileProgress: () => any; + onLoadStart: () => any; + onProgress: () => any; } -export class PreloadJS extends AbstractLoader - { - constructor( useXHR2?: bool ); + export class PreloadJS extends AbstractLoader { + constructor (useXHR2?: bool); // properties - static CSS: string; - static IMAGE: string; - static JAVASCRIPT: string; - static JSON: string; - maintainScriptOrder: bool; - next: PreloadJS; - static SOUND: string; - stopOnError: bool; - static TEXT: string; - static TIMEOUT_TIME: number; - useXHR: bool; - static XML: string; + static CSS: string; + static IMAGE: string; + static JAVASCRIPT: string; + static JSON: string; + maintainScriptOrder: bool; + next: PreloadJS; + static SOUND: string; + stopOnError: bool; + static TEXT: string; + static TIMEOUT_TIME: number; + useXHR: bool; + static XML: string; // methods - BrowserDetect(): Object; - close(): void; - getResult( value: string ): Object; - initialize( useXHR: bool ): void; - installPlugin( plugin: () => any ): void; - load(): void; - loadFile( file: Object, loadNow: bool ): void; - loadFile( file: string, loadNow: bool ): void; - loadManifest( manifest: Object[], loadNow: bool ): void; - loadManifest( manifest: string[], loadNow: bool ): void; - setMaxConnections( value: number ): void; - setPaused( value: bool ): void; + BrowserDetect(): Object; + close(): void; + getResult(value: string): Object; + initialize(useXHR: bool): void; + installPlugin(plugin: () => any): void; + load(): void; + loadFile(file: Object, loadNow: bool): void; + loadFile(file: string, loadNow: bool): void; + loadManifest(manifest: Object[], loadNow: bool): void; + loadManifest(manifest: string[], loadNow: bool): void; + setMaxConnections(value: number): void; + setPaused(value: bool): void; } -export class TagLoader extends AbstractLoader - { - constructor( item: Object, srcAttr: string, useXHR: bool ); - constructor( item: string, srcAttr: string, useXHR: bool ); + export class TagLoader extends AbstractLoader { + constructor (item: Object, srcAttr: string, useXHR: bool); + constructor (item: string, srcAttr: string, useXHR: bool); } -export class XHRLoader extends AbstractLoader - { - constructor( file: Object ); + export class XHRLoader extends AbstractLoader { + constructor (file: Object); } } \ No newline at end of file diff --git a/Definitions/soundjs-0.3.d.ts b/Definitions/soundjs-0.3.d.ts index 57f4a97b9f..e9f5c425e8 100644 --- a/Definitions/soundjs-0.3.d.ts +++ b/Definitions/soundjs-0.3.d.ts @@ -1,112 +1,107 @@ +// Type definitions for SoundJS 0.3 +// Project: http://www.createjs.com/#!/SoundJS +// Definitions by: Pedro Ferreira +// Definitions: https://github.com/borisyankov/DefinitelyTyped + /* - See https://bitbucket.org/drk4/createjs_ts_definitions for updates/examples - 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. */ -module createjs -{ -export class FlashPlugin - { +module createjs { + export class FlashPlugin { // properties - static BASE_PATH: string; - static capabilities: Object; - showOutput: bool; + static BASE_PATH: string; + static capabilities: Object; + showOutput: bool; // methods - create( src: string ): SoundInstance; - static generateCapabilities(): void; - static isSupported(): bool; - register( src: string, instances: number ): Object; + create(src: string): SoundInstance; + static generateCapabilities(): void; + static isSupported(): bool; + register(src: string, instances: number): Object; } -export class HTMLAudioPlugin - { + export class HTMLAudioPlugin { // properties - static capabilities: Object; - static MAX_INSTANCES: number; + static capabilities: Object; + static MAX_INSTANCES: number; // methods - create( src: string ): SoundInstance; - static generateCapabilities(): void; - static isSupported(): bool; - register( src: string, instances: number ): Object; + create(src: string): SoundInstance; + static generateCapabilities(): void; + static isSupported(): bool; + register(src: string, instances: number): Object; } -export class SoundInstance - { - constructor( src: string ); + export class SoundInstance { + constructor (src: string); // properties - muted: bool; - owner: HTMLAudioPlugin; - paused: bool; - playState: string; - src: string; - uniqueId: string; //HERE string or number + muted: bool; + owner: HTMLAudioPlugin; + paused: bool; + playState: string; + src: string; + uniqueId: string; //HERE string or number // methods - getDuration(): number; - getPan(): number; - getPosition(): number; - getVolume(): number; - mute( isMuted: bool ): bool; - pause(): bool; - play( interrupt: string, delay: number, offset: number, loop: number, volume: number, pan: number ): void; - resume(): bool; - setPan( value: number ): number; - setPosition( value: number ): void; - setVolume( value: number ): bool; - stop(): bool; + getDuration(): number; + getPan(): number; + getPosition(): number; + getVolume(): number; + mute(isMuted: bool): bool; + pause(): bool; + play(interrupt: string, delay: number, offset: number, loop: number, volume: number, pan: number): void; + resume(): bool; + setPan(value: number): number; + setPosition(value: number): void; + setVolume(value: number): bool; + stop(): bool; // events - onComplete: () => any; - onLoop: () => any; - onPlayFailed: () => any; - onPlayInterrupted: () => any; - onReady: () => any; + onComplete: () => any; + onLoop: () => any; + onPlayFailed: () => any; + onPlayInterrupted: () => any; + onReady: () => any; } -export class SoundJS - { + export class SoundJS { // properties - static activePlugin: Object; - static AUDIO_TIMEOUT: number; - static DELIMITER: string; - static INTERRUPT_ANY: string; - static INTERRUPT_EARLY: string; - static INTERRUPT_LATE: string; - static INTERRUPT_NONE: string; - static muted: bool; - static PLAY_FAILED: string; - static PLAY_FINISHED: string; - static PLAY_INITED: string; - static PLAY_INTERRUPTED: string; - static PLAY_SUCCEEDED: string; + static activePlugin: Object; + static AUDIO_TIMEOUT: number; + static DELIMITER: string; + static INTERRUPT_ANY: string; + static INTERRUPT_EARLY: string; + static INTERRUPT_LATE: string; + static INTERRUPT_NONE: string; + static muted: bool; + static PLAY_FAILED: string; + static PLAY_FINISHED: string; + static PLAY_INITED: string; + static PLAY_INTERRUPTED: string; + static PLAY_SUCCEEDED: string; // methods - static checkPlugin( initializeDefault: bool ): bool; - static getCapabilities(): Object; - static getCapability( key: string ); //HERE can return string | number | bool - static getInstanceById( uniqueId: string ): SoundInstance; - static getMasterVolume(): number; - static getSrcFromId( value: string ): string; - static isReady(): bool; - static pause( id: string ): void; - static play( value: string, interrupt?: string, delay?: number, offset?: number, loop?: number, volume?: number, pan?: number ): SoundInstance; - static registerPlugin( plugin: Object ): bool; - static registerPlugins( plugins: Object[] ): bool; - static resume( id: string ): void; - static setMasterVolume( value: number ): bool; - static setMute( isMuted: bool, id: string ): bool; - static setVolume( value: number, id?: string ): bool; - static stop( id?: string ): bool; + static checkPlugin(initializeDefault: bool): bool; + static getCapabilities(): Object; + static getCapability(key: string); //HERE can return string | number | bool + static getInstanceById(uniqueId: string): SoundInstance; + static getMasterVolume(): number; + static getSrcFromId(value: string): string; + static isReady(): bool; + static pause(id: string): void; + static play(value: string, interrupt?: string, delay?: number, offset?: number, loop?: number, volume?: number, pan?: number): SoundInstance; + static registerPlugin(plugin: Object): bool; + static registerPlugins(plugins: Object[]): bool; + static resume(id: string): void; + static setMasterVolume(value: number): bool; + static setMute(isMuted: bool, id: string): bool; + static setVolume(value: number, id?: string): bool; + static stop(id?: string): bool; } } diff --git a/Definitions/tweenjs-0.3.d.ts b/Definitions/tweenjs-0.3.d.ts index 9c0bf2da4a..31499c9108 100644 --- a/Definitions/tweenjs-0.3.d.ts +++ b/Definitions/tweenjs-0.3.d.ts @@ -1,137 +1,133 @@ +// Type definitions for TweenJS 0.3 +// Project: http://www.createjs.com/#!/TweenJS +// Definitions by: Pedro Ferreira +// Definitions: https://github.com/borisyankov/DefinitelyTyped + /* - See https://bitbucket.org/drk4/createjs_ts_definitions for updates/examples - 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. */ -module createjs -{ -export class CSSPlugin - { +module createjs { + + export class CSSPlugin { // properties - static cssSuffixMap: Object; + static cssSuffixMap: Object; // methods - static install(): void; + static install(): void; } -export class Ease - { + export class Ease { // methods - static backIn(): number; - static backInOut(): number; - static backOut(): number; - static bounceIn( amount: number ): number; - static bounceInOut( amount: number ): number; - static bounceOut( amount: number ): number; - static circIn( amount: number ): number; - static circInOut( amount: number ): number; - static circOut( amount: number ): number; - static cubicIn(): number; - static cubicInOut(): number; - static cubicOut(): number; - static elasticIn(): number; - static elasticInOut(): number; - static elasticOut(): 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; - static quadInOut(): ( amount: number ) => number; - static quadOut(): ( amount: number ) => number; - static quartIn(): ( amount: number ) => number; - static quartInOut(): ( amount: number ) => number; - static quartOut(): ( amount: number ) => number; - static quintIn(): ( amount: number ) => number; - static quintInOut(): ( amount: number ) => number; - static quintOut(): ( amount: number ) => number; - static sineIn( amount: number ): number; - static sineInOut( amount: number ): number; - static sineOut( amount: number ): number; + static backIn(): number; + static backInOut(): number; + static backOut(): number; + static bounceIn(amount: number): number; + static bounceInOut(amount: number): number; + static bounceOut(amount: number): number; + static circIn(amount: number): number; + static circInOut(amount: number): number; + static circOut(amount: number): number; + static cubicIn(): number; + static cubicInOut(): number; + static cubicOut(): number; + static elasticIn(): number; + static elasticInOut(): number; + static elasticOut(): 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; + static quadInOut(): (amount: number) => number; + static quadOut(): (amount: number) => number; + static quartIn(): (amount: number) => number; + static quartInOut(): (amount: number) => number; + static quartOut(): (amount: number) => number; + static quintIn(): (amount: number) => number; + static quintInOut(): (amount: number) => number; + static quintOut(): (amount: number) => number; + static sineIn(amount: number): number; + static sineInOut(amount: number): number; + static sineOut(amount: number): number; } -export class Timeline - { - constructor( tweens: Tween[], labels: Object, props: Object ); + export class Timeline { + constructor (tweens: Tween[], labels: Object, props: Object); // properties - duration: number; - ignoreGlobalPause: bool; - loop: bool; - position: number; + duration: number; + ignoreGlobalPause: bool; + loop: bool; + position: number; // methods - addLabel( label: string, position: number ): void; - addTween( ...tween: Tween[] ): void; - gotoAndPlay( positionOrLabel: string ): void; - gotoAndPlay( positionOrLabel: number ): void; - gotoAndStop( positionOrLabel: string ): void; - gotoAndStop( positionOrLabel: number ): void; - removeTween( ...tween: Tween[] ): void; - resolve( positionOrLabel: string ): number; - resolve( positionOrLabel: number ): number; - setPaused( value: bool ): void; - setPosition( value: number, actionsMode?: number ): void; - tick( delta: number ): void; - toString(): string; - updateDuration(): void; + addLabel(label: string, position: number): void; + addTween(...tween: Tween[]): void; + gotoAndPlay(positionOrLabel: string): void; + gotoAndPlay(positionOrLabel: number): void; + gotoAndStop(positionOrLabel: string): void; + gotoAndStop(positionOrLabel: number): void; + removeTween(...tween: Tween[]): void; + resolve(positionOrLabel: string): number; + resolve(positionOrLabel: number): number; + setPaused(value: bool): void; + setPosition(value: number, actionsMode?: number): void; + tick(delta: number): void; + toString(): string; + updateDuration(): void; // events - onChange: ( instance: Timeline ) => any; + onChange: (instance: Timeline) => any; } -export class Tween - { - constructor( target: Object, props: Object ); + export class Tween { + constructor (target: Object, props: Object); // properties - duration: number; - static IGNORE: Object; - ignoreGlobalPause: bool; - loop: bool; - static LOOP: number; - static NONE: number; - pluginData: Object; - position: number; - static REVERSE: number; - target: Object; + duration: number; + static IGNORE: Object; + ignoreGlobalPause: bool; + loop: bool; + static LOOP: number; + static NONE: number; + pluginData: Object; + position: number; + static REVERSE: number; + target: Object; // methods - call( callback: ( tweenObject: Tween ) => any, params?: any[], scope?: Object ); // when 'params' isn't given, the callback receives a tweenObject - call( callback: ( ...params:any[] ) => any, params?: any[], scope?: Object ); // otherwise, it receives the params only - static get( target, props: Object ): Tween; - static hasActiveTweens( target? ): void; - static installPlugin( plugin: Object, properties: Object ): void; - pause( tween: Tween ): void; - play( tween: Tween ): void; - static removeTweens( target ): void; - set( props: Object, target? ): void; - setPaused( value: bool ): void; - setPosition( value: number, actionsMode: number ): void; - static tick( delta: number, paused: bool ): void; - to( props: Object, duration?: number, ease?: ( amount: number ) => number ): Tween; - toString(): string; - wait( duration: number ): void; + call(callback: (tweenObject: Tween) => any, params?: any[], scope?: Object); // when 'params' isn't given, the callback receives a tweenObject + call(callback: (...params: any[]) => any, params?: any[], scope?: Object); // otherwise, it receives the params only + static get(target, props: Object): Tween; + static hasActiveTweens(target? ): void; + static installPlugin(plugin: Object, properties: Object): void; + pause(tween: Tween): void; + play(tween: Tween): void; + static removeTweens(target): void; + set(props: Object, target? ): void; + setPaused(value: bool): void; + setPosition(value: number, actionsMode: number): void; + static tick(delta: number, paused: bool): void; + to(props: Object, duration?: number, ease?: (amount: number) => number): Tween; + toString(): string; + wait(duration: number): void; // events - onChange: ( instance: Tween ) => any; + onChange: (instance: Tween) => any; } } \ No newline at end of file diff --git a/README.md b/README.md index 5627ed3f0f..77e58de014 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Complete * [CodeMirror](http://codemirror.net) (by [François de Campredon](https://github.com/fdecampredon)) * [Chosen](http://harvesthq.github.com/chosen/) * [dynatree](http://code.google.com/p/dynatree/) (by [François de Campredon](https://github.com/fdecampredon)) -* [EaselJS](http://www.createjs.com/#!/EaselJS) +* [EaselJS](http://www.createjs.com/#!/EaselJS) (by [Pedro Ferreira](https://bitbucket.org/drk4)) * [ember.js](http://emberjs.com/) * [Express](http://expressjs.com/) * [Fancybox](http://fancybox.net/) @@ -38,11 +38,14 @@ Complete * [Node.js](http://nodejs.org/) (from TypeScript samples) * [node_redis](https://github.com/mranney/node_redis) * [node-sqlserver](https://github.com/WindowsAzure/node-sqlserver) +* [PreloadJS](http://www.createjs.com/#!/PreloadJS) (by [Pedro Ferreira](https://bitbucket.org/drk4)) * [QUnit](http://qunitjs.com/) (by [Diullei Gomes](https://github.com/Diullei)) * [Raphael](http://raphaeljs.com/) (by [CheCoxshall](https://github.com/CheCoxshall)) * [Sammy.js](http://sammyjs.org/) +* [SoundJS](http://www.createjs.com/#!/SoundJS) (by [Pedro Ferreira](https://bitbucket.org/drk4)) * [Spin](http://fgnass.github.com/spin.js/) * [Teechart](http://www.steema.com) (by [Steema])(http://www.steema.com) +* [TweenJS](http://www.createjs.com/#!/TweenJS) (by [Pedro Ferreira](https://bitbucket.org/drk4)) * [Underscore.js](http://underscorejs.org/) Next