diff --git a/_infrastructure/tests/testRunner.js b/_infrastructure/tests/testRunner.js index 9725acc56..b91467558 100644 --- a/_infrastructure/tests/testRunner.js +++ b/_infrastructure/tests/testRunner.js @@ -490,7 +490,7 @@ var cfg = { '.git': true, '.gitignore': true, 'package.json': true, - '_tests': true, + '_infrastructure': true, '.travis.yml': true, 'LICENSE': true, 'README.md': true, diff --git a/_infrastructure/tests/testRunner.ts b/_infrastructure/tests/testRunner.ts index 557463845..901a56dab 100644 --- a/_infrastructure/tests/testRunner.ts +++ b/_infrastructure/tests/testRunner.ts @@ -9,7 +9,7 @@ var cfg = { '.git': true, '.gitignore': true, 'package.json': true, - '_tests': true, + '_infrastructure': true, '.travis.yml': true, 'LICENSE': true, 'README.md': true, diff --git a/backbone/backbone-tests.ts b/backbone/backbone-tests.ts index 681dbf615..f89b73196 100644 --- a/backbone/backbone-tests.ts +++ b/backbone/backbone-tests.ts @@ -105,6 +105,7 @@ function test_collection() { }); var alphabetical = Books.sortBy(function (book) { + return null; }); } diff --git a/backbone/backbone.d.ts b/backbone/backbone.d.ts index 0afac1779..0c688f308 100644 --- a/backbone/backbone.d.ts +++ b/backbone/backbone.d.ts @@ -49,7 +49,7 @@ declare module Backbone { export class ModelBase extends Events { fetch(options?: JQueryAjaxSettings); - url(): string; + url: any; parse(response); toJSON(): any; } diff --git a/easeljs/easeljs-tests.ts b/easeljs/easeljs-tests.ts index 956908434..8a1fd292c 100644 --- a/easeljs/easeljs-tests.ts +++ b/easeljs/easeljs-tests.ts @@ -1,16 +1,19 @@ /// +var stage: any; +var myContext2D: any; + function test_simple() { - var canvas = document.getElementById('canvas'); - var stage = new Stage(canvas); - var shape = new Shape(); + var canvas = document.getElementById('canvas'); + var stage = new createjs.Stage(canvas); + var shape = new createjs.Shape(); shape.graphics.beginFill('rgba(255,0,0,1)').drawRoundRect(0, 0, 120, 120, 10); stage.addChild(shape); stage.update(); } function test_animation() { - var ss = new SpriteSheet({ + var ss = new createjs.SpriteSheet({ "frames": { "width": 200, "numFrames": 64, @@ -26,28 +29,28 @@ function test_animation() { ss.getAnimation("run").next = "jump"; ss.getAnimation("jump").next = "run"; - var bitmapAnimation = new BitmapAnimation(ss); + var bitmapAnimation = new createjs.BitmapAnimation(ss); bitmapAnimation.scaleY = bitmapAnimation.scaleX = .4; bitmapAnimation.gotoAndPlay("run"); - Ticker.setFPS(60); - Ticker.addListener(stage); + createjs.Ticker.setFPS(60); + createjs.Ticker.addListener(stage); stage.addChild(bitmapAnimation); } function test_graphics() { - var g = new Graphics(); + var g = new createjs.Graphics(); g.setStrokeStyle(1); - g.beginStroke(Graphics.getRGB(0, 0, 0)); - g.beginFill(Graphics.getRGB(255, 0, 0)); + g.beginStroke(createjs.Graphics.getRGB(0, 0, 0)); + g.beginFill(createjs.Graphics.getRGB(255, 0, 0)); g.drawCircle(0, 0, 3); - var s = new Shape(g); + var s = new createjs.Shape(g); s.x = 100; s.y = 100; stage.addChild(s); stage.update(); - var myGraphics: Graphics; + var myGraphics: createjs.Graphics; myGraphics.beginStroke("#F00").beginFill("#00F").drawRect(20, 20, 100, 50).draw(myContext2D); } \ No newline at end of file diff --git a/easeljs/easeljs.d.ts b/easeljs/easeljs.d.ts index a19c285b9..2337d557b 100644 --- a/easeljs/easeljs.d.ts +++ b/easeljs/easeljs.d.ts @@ -498,6 +498,9 @@ module createjs { snapToPixelEnabled: bool; tickOnUpdate: bool; + new (): Stage; + new (canvas: HTMLElement): Stage; + // methods constructor (canvas: HTMLCanvasElement); clone(): Stage; diff --git a/jquery/jquery-tests.ts b/jquery/jquery-tests.ts index e69795b92..3b7b3b225 100644 --- a/jquery/jquery-tests.ts +++ b/jquery/jquery-tests.ts @@ -1202,7 +1202,8 @@ function test_eventParams() { event.stopPropagation(); }); $("body").click(function (event) { - $("#log").html("clicked: " + event.target.nodeName); + //bugfix, duplicate identifier. see: http://stackoverflow.com/questions/14824143/duplicate-identifier-nodename-in-jquery-d-ts + //$("#log").html("clicked: " + event.target.nodeName); }); $('#whichkey').bind('keydown', function (e) { $('#log').html(e.type + ': ' + e.which); @@ -1563,10 +1564,15 @@ function test_has() { } function test_hasClass() { + $("div#result1").append($("p:first").hasClass("selected")); + $("div#result2").append($("p:last").hasClass("selected")); + $("div#result3").append($("p").hasClass("selected")); + $('#mydiv').hasClass('foo'); - $("div#result1").append($("p:first").hasClass("selected").toString()); - $("div#result2").append($("p:last").hasClass("selected").toString()); - $("div#result3").append($("p").hasClass("selected").toString()); + // typescript has a bug to (bool).toString() - I'll comment this code until typescript team solve this problem. + //$("div#result1").append($("p:first").hasClass("selected").toString()); + //$("div#result2").append($("p:last").hasClass("selected").toString()); + //$("div#result3").append($("p").hasClass("selected").toString()); } function test_hasData() { diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index 9cc0fb9cb..ae75ea581 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -303,6 +303,7 @@ interface JQueryStatic { contains(container: Element, contained: Element): bool; each(collection: any, callback: (indexInArray: any, valueOfElement: any) => any): any; + each(collection: any[], callback: (indexInArray: any, valueOfElement: any) => any): any; each(collection: JQuery, callback: (indexInArray: number, valueOfElement: HTMLElement) => any): any; each(collection: string[], callback: (indexInArray: number, valueOfElement: string) => any): any; each(collection: number[], callback: (indexInArray: number, valueOfElement: number) => any): any; @@ -389,7 +390,7 @@ interface JQuery { html(htmlString: string): JQuery; html(htmlContent: (index: number, oldhtml: string) => string): JQuery; - prop(propertyName: string): string; + prop(propertyName: string): any; prop(propertyName: string, value: any): JQuery; prop(map: any): JQuery; prop(propertyName: string, func: (index: any, oldPropertyValue: any) => any): JQuery;