From e9b3be70b97b647102a135420194d97b870b7ea1 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Wed, 18 Dec 2013 12:02:58 +0400 Subject: [PATCH 01/49] rx.async: uninlined Promise definition --- rx.js/rx.async.d.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rx.js/rx.async.d.ts b/rx.js/rx.async.d.ts index 5ee13b89a..2e511444a 100644 --- a/rx.js/rx.async.d.ts +++ b/rx.js/rx.async.d.ts @@ -84,7 +84,11 @@ declare module Rx { fromEvent(element: Node, eventName: string, selector?: (arguments: any[]) => T): Observable; fromEventPattern(addHandler: (handler: Function) => void, removeHandler: (handler: Function) => void, selector?: (arguments: any[])=>T): Observable; - fromPromise(promise: { then(onFulfill: (value: T) => any, onReject?: (reason: any) => any): any; }): Observable; + fromPromise(promise: Promise): Observable; fromPromise(promise: any): Observable; } + + interface Promise { + then(onFulfill: (value: T) => any, onReject?: (reason: any) => any): any; + } } From be24e3e48c3a0b81abe899b4119c59c72207b83f Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Wed, 18 Dec 2013 20:03:39 +0400 Subject: [PATCH 02/49] jake: fix test --- jake/jake-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jake/jake-tests.ts b/jake/jake-tests.ts index 74e5cc92f..3459083dc 100644 --- a/jake/jake-tests.ts +++ b/jake/jake-tests.ts @@ -9,7 +9,7 @@ task('default', function (params) { }); desc('This task has prerequisites.'); -task('hasPrereqs', ['foo', 'bar', 'baz'], function (params) { +task('hasPrereqs', ['foo', 'bar', 'baz'], function () { console.log('Ran some prereqs first.'); }); From aa920d9dd4f012e16c3b5933c9540e51e445d4f2 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Wed, 18 Dec 2013 20:11:15 +0400 Subject: [PATCH 03/49] jqrangeslider: fixed definition order in JQuery instance extensions (fixes test) --- jqrangeslider/jqrangeslider.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/jqrangeslider/jqrangeslider.d.ts b/jqrangeslider/jqrangeslider.d.ts index 7dcb3060f..ef688e5d9 100644 --- a/jqrangeslider/jqrangeslider.d.ts +++ b/jqrangeslider/jqrangeslider.d.ts @@ -57,18 +57,18 @@ interface JQDateRangeSliderOptions extends JQRangeSliderOptions { } interface JQuery { - rangeSlider(options?: JQNumericRangeSliderOptions): JQuery; rangeSlider(method: string): any; rangeSlider(method: string, value: number): JQuery; rangeSlider(method: string, min: number, max: number): JQuery; + rangeSlider(options?: JQNumericRangeSliderOptions): JQuery; - editRangeSlider(options?: JQNumericRangeSliderOptions): JQuery; editRangeSlider(method: string): any; editRangeSlider(method: string, value: number): JQuery; - editRangeSlider(method: string, min: number, max: number): JQuery; + editRangeSlider(method: string, min: number, max: number): JQuery + editRangeSlider(options?: JQNumericRangeSliderOptions): JQuery; - dateRangeSlider(options?: JQRangeSliderOptions): JQuery; dateRangeSlider(method: string): any; dateRangeSlider(method: string, value: Date): JQuery; - dateRangeSlider(method: string, min: Date, max: Date): JQuery; + dateRangeSlider(method: string, min: Date, max: Date): JQuery + dateRangeSlider(options?: JQRangeSliderOptions): JQuery; } From 192357c268c04874f1a69ff9fab2c5d06a380fac Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Wed, 18 Dec 2013 20:13:50 +0400 Subject: [PATCH 04/49] jquery.bbq: fixed test --- jquery.bbq/jquery.bbq-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery.bbq/jquery.bbq-tests.ts b/jquery.bbq/jquery.bbq-tests.ts index c9a337d71..6bf301f3c 100644 --- a/jquery.bbq/jquery.bbq-tests.ts +++ b/jquery.bbq/jquery.bbq-tests.ts @@ -587,7 +587,7 @@ QUnit.module( 'jQuery.fn' ); $.elemUrlAttr({ span: 'arbitrary_attr' }); var test_elems = 'a form link span'.split(' '); -function init_url_attr( container, url ) { +function init_url_attr( _, url ) { var container = $('
').hide().appendTo('body'); $.each( test_elems, function(i,v){ $('<' + v + '/>') From 2d749660af6a0cea69a44eb7f2bd4ec1029bad68 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Wed, 18 Dec 2013 20:19:02 +0400 Subject: [PATCH 05/49] jquery.gridster: removed type parameter from GridsterOptions.serialize_params (fixes test) --- jquery.gridster/gridster.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery.gridster/gridster.d.ts b/jquery.gridster/gridster.d.ts index 6019ebb06..968c0f333 100644 --- a/jquery.gridster/gridster.d.ts +++ b/jquery.gridster/gridster.d.ts @@ -138,7 +138,7 @@ interface GridsterOptions { /** * Return the data you want for each widget in the serialization. **/ - serialize_params?: ($w: JQuery, wgd: GridsterCoords) => T; + serialize_params?: ($w: JQuery, wgd: GridsterCoords) => any; /** * An object with all options for Collision class you want to overwrite. @see GridsterCollision or docs for more info. From 8a69bce6a6e7bfb75810ea13df85c39a251a3ef9 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Wed, 18 Dec 2013 20:26:25 +0400 Subject: [PATCH 06/49] jquery.tinycarousel: updated callback function in the options (fixes test) --- jquery.tinycarousel/jquery.tinycarousel.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery.tinycarousel/jquery.tinycarousel.d.ts b/jquery.tinycarousel/jquery.tinycarousel.d.ts index 83a030107..2f4f4563a 100644 --- a/jquery.tinycarousel/jquery.tinycarousel.d.ts +++ b/jquery.tinycarousel/jquery.tinycarousel.d.ts @@ -50,7 +50,7 @@ declare module JQueryTinyCarousel { /** * Function that executes after every move (default: null) */ - callback? : Function; + callback? : (element: HTMLElement, index: number) => void; } } interface JQuery { From d33450a368d89dea183340d71e8d50ae1b39047c Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Wed, 18 Dec 2013 20:36:55 +0400 Subject: [PATCH 07/49] jquery.validation: fix test --- jquery.validation/jquery.validation-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jquery.validation/jquery.validation-tests.ts b/jquery.validation/jquery.validation-tests.ts index b8f7a16ae..e0bdc4660 100644 --- a/jquery.validation/jquery.validation-tests.ts +++ b/jquery.validation/jquery.validation-tests.ts @@ -142,12 +142,12 @@ function test_validate() { $(".selector").validate({ highlight: function (element, errorClass, validClass) { $(element).addClass(errorClass).removeClass(validClass); - $(element.form).find("label[for=" + element.id + "]") + $((element).form).find("label[for=" + element.id + "]") .addClass(errorClass); }, unhighlight: function (element, errorClass, validClass) { $(element).removeClass(errorClass).addClass(validClass); - $(element.form).find("label[for=" + element.id + "]") + $((element).form).find("label[for=" + element.id + "]") .removeClass(errorClass); } }); From 85492e5dfa78aa1c3decfbf3e66bb87bb64a06d7 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Wed, 18 Dec 2013 20:55:02 +0400 Subject: [PATCH 08/49] jquery: fix test --- jquery/jquery-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery/jquery-tests.ts b/jquery/jquery-tests.ts index 0a935ce44..2842c1ea3 100644 --- a/jquery/jquery-tests.ts +++ b/jquery/jquery-tests.ts @@ -2372,7 +2372,7 @@ function test_EventIsCallable() { var ev = jQuery.Event('click'); } -$.when($.ajax("/my/page.json")).then((a,b,c) => a.asdf); // is type JQueryPromise +$.when($.ajax("/my/page.json")).then(a => a.asdf); // is type JQueryPromise $.when("asdf", "jkl;").done((x,y) => x.length + y.length, (x,y) => x.length + y.length); var f1 = $.when("fetch"); // Is type JQueryPromise From c50db1735b1ff19801b5917593c21fb5017d9c2d Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Wed, 18 Dec 2013 21:27:57 +0400 Subject: [PATCH 09/49] moment: fixed test --- moment/moment-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/moment/moment-tests.ts b/moment/moment-tests.ts index 9dd64d407..e993a3ad2 100644 --- a/moment/moment-tests.ts +++ b/moment/moment-tests.ts @@ -258,7 +258,7 @@ moment.lang('en', { }); moment.lang('en', { - months : function (momentToFormat, format) { + months : function (momentToFormat: Moment, format: string) { // momentToFormat is the moment currently being formatted // format is the formatting string if (/^MMMM/.test(format)) { // if the format starts with 'MMMM' @@ -277,7 +277,7 @@ moment.lang('en', { }); moment.lang('en', { - monthsShort : function (momentToFormat, format) { + monthsShort : function (momentToFormat: Moment, format: string) { if (/^MMMM/.test(format)) { return this.nominative[momentToFormat.month()]; } else { From 32797d6a56cc343411e8924054749834bcc958be Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Thu, 19 Dec 2013 00:37:19 +0400 Subject: [PATCH 10/49] moment: fixed test again --- moment/moment-tests.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/moment/moment-tests.ts b/moment/moment-tests.ts index e993a3ad2..5150f7ebc 100644 --- a/moment/moment-tests.ts +++ b/moment/moment-tests.ts @@ -293,7 +293,7 @@ moment.lang('en', { }); moment.lang('en', { - weekdays : function (momentToFormat, format) { + weekdays : function (momentToFormat: Moment) { return this.weekdays[momentToFormat.day()]; } }); @@ -303,7 +303,7 @@ moment.lang('en', { }); moment.lang('en', { - weekdaysShort : function (momentToFormat, format) { + weekdaysShort : function (momentToFormat: Moment) { return this.weekdaysShort[momentToFormat.day()]; } }); @@ -313,7 +313,7 @@ moment.lang('en', { }); moment.lang('en', { - weekdaysMin : function (momentToFormat, format) { + weekdaysMin : function (momentToFormat: Moment) { return this.weekdaysMin[momentToFormat.day()]; } }); From 6128eab4892dafb12f06eb0ade78fe567fe88195 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Thu, 19 Dec 2013 10:47:40 +0400 Subject: [PATCH 11/49] phonegap: fixed definition errors --- phonegap/phonegap-tests.ts | 4 ++-- phonegap/phonegap.d.ts | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/phonegap/phonegap-tests.ts b/phonegap/phonegap-tests.ts index 78b45609b..1eaff6040 100644 --- a/phonegap/phonegap-tests.ts +++ b/phonegap/phonegap-tests.ts @@ -318,7 +318,7 @@ function test_file() { var reader = new FileReader(); reader.onloadend = function (evt) { console.log("Read as data URL"); - console.log(evt.target.result); + console.log((evt.target).result); }; reader.readAsDataURL(file); } @@ -326,7 +326,7 @@ function test_file() { var reader = new FileReader(); reader.onloadend = function (evt) { console.log("Read as text"); - console.log(evt.target.result); + console.log((evt.target).result); }; reader.readAsText(file); } diff --git a/phonegap/phonegap.d.ts b/phonegap/phonegap.d.ts index 6e873163b..f23b473a9 100644 --- a/phonegap/phonegap.d.ts +++ b/phonegap/phonegap.d.ts @@ -3,10 +3,6 @@ // Definitions by: Boris Yankov // Definitions: https://github.com/borisyankov/DefinitelyTyped -interface EventTarget { - result: any; -} - interface GeolocationError { code: number; message: string; @@ -54,7 +50,7 @@ interface CameraOptions { mediaType?: number; correctOrientation?: boolean; saveToPhotoAlbum?: boolean; - popoverOptions?: number; + popoverOptions?: CameraPopoverOptions; } interface CameraPictureSourceTypeObject { From 4697228830bbd3584da9a2a9ecffedd162f23b74 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Thu, 19 Dec 2013 10:55:24 +0400 Subject: [PATCH 12/49] swipeview: fixed definition and test --- swipeview/swipeview-tests.ts | 16 ++++++++-------- swipeview/swipeview.d.ts | 6 +----- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/swipeview/swipeview-tests.ts b/swipeview/swipeview-tests.ts index 52a5681ce..02564e11b 100644 --- a/swipeview/swipeview-tests.ts +++ b/swipeview/swipeview-tests.ts @@ -47,9 +47,9 @@ var i; for (i = 0; i < 3; i++) { - upcoming = gallery.masterPages[i].dataset.upcomingPageIndex; + upcoming = (gallery.masterPages[i].dataset).upcomingPageIndex; - if (upcoming != gallery.masterPages[i].dataset.pageIndex) { + if (upcoming != (gallery.masterPages[i].dataset).pageIndex) { el = gallery.masterPages[i].querySelector('img'); el.className = 'loading'; el.src = slides[upcoming].img; @@ -104,9 +104,9 @@ var carousel: SwipeView, i; for (i = 0; i < 3; i++) { - upcoming = carousel.masterPages[i].dataset.upcomingPageIndex; + upcoming = (carousel.masterPages[i].dataset).upcomingPageIndex; - if (upcoming != carousel.masterPages[i].dataset.pageIndex) { + if (upcoming != (carousel.masterPages[i].dataset).pageIndex) { el = carousel.masterPages[i].querySelector('span'); el.innerHTML = slides[upcoming]; } @@ -216,8 +216,8 @@ function demo3() { ereader.slider.removeChild(container); ereader.updatePageCount(pages.length); - ereader.masterPages[0].dataset.pageIndex = pages.length - 1; - ereader.masterPages[0].dataset.upcomingPageIndex = ereader.masterPages[0].dataset.pageIndex; + (ereader.masterPages[0].dataset).pageIndex = pages.length - 1; + (ereader.masterPages[0].dataset).upcomingPageIndex = (ereader.masterPages[0].dataset).pageIndex; // Load initial data for (i = 0; i < 3; i++) { @@ -240,9 +240,9 @@ function demo3() { i; for (i = 0; i < 3; i++) { - upcoming = ereader.masterPages[i].dataset.upcomingPageIndex; + upcoming = (ereader.masterPages[i].dataset).upcomingPageIndex; - if (upcoming != ereader.masterPages[i].dataset.pageIndex) { + if (upcoming != (ereader.masterPages[i].dataset).pageIndex) { el = ereader.masterPages[i].querySelector('div'); el.innerHTML = pages[upcoming]; } diff --git a/swipeview/swipeview.d.ts b/swipeview/swipeview.d.ts index 7ce476b83..8e079fa7d 100644 --- a/swipeview/swipeview.d.ts +++ b/swipeview/swipeview.d.ts @@ -16,13 +16,9 @@ interface SwipeViewOptions { loop?: boolean; } -interface PageHTMLElement extends HTMLElement { - dataset: any; -} - declare class SwipeView { - masterPages: PageHTMLElement[]; + masterPages: HTMLElement[]; currentMasterPage: number; wrapper: HTMLElement; slider: HTMLElement; From 8d79cda5140e7989be45a310bc60cacaccd0b262 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Thu, 19 Dec 2013 12:40:58 +0400 Subject: [PATCH 13/49] siesta: fixed definition Browser.firesAtLeastNTimes --- siesta/siesta.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/siesta/siesta.d.ts b/siesta/siesta.d.ts index 449bf262c..aaf6692bf 100644 --- a/siesta/siesta.d.ts +++ b/siesta/siesta.d.ts @@ -770,7 +770,7 @@ declare module Siesta { elementFromPoint(x: number, y: number, shallow?: boolean): HTMLElement; - firesAtLeastNTimes(observable: any, event: string, n: number, desc: string); + firesAtLeastNTimes(observable: any, event: string, n: number, desc: string): void; firesOk(options: any): void; From 22d5789d9e66a36991be56c10ffa7cefc4b94ea1 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Thu, 19 Dec 2013 12:43:43 +0400 Subject: [PATCH 14/49] commander: fixed test --- commander/commander-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commander/commander-tests.ts b/commander/commander-tests.ts index eff20f28d..495426edd 100644 --- a/commander/commander-tests.ts +++ b/commander/commander-tests.ts @@ -18,7 +18,7 @@ program program .command('setup [env]') .description('run setup commands for all envs') - .action(function (env) { + .action(function (env?) { env = env || 'all'; console.log('setup for %s env(s)', env); }); @@ -27,7 +27,7 @@ program // $ deploy production program .command('*') - .action(function (env) { + .action(function (env?) { console.log('deploying "%s"', env); }); From d6768e5ca83af92fa3cf78c4a5f3b2014bc4a6f9 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Thu, 19 Dec 2013 14:20:32 +0400 Subject: [PATCH 15/49] couchbase: fixed test --- couchbase/couchbase-tests.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/couchbase/couchbase-tests.ts b/couchbase/couchbase-tests.ts index f4d1b1061..4305300ee 100644 --- a/couchbase/couchbase-tests.ts +++ b/couchbase/couchbase-tests.ts @@ -4,10 +4,14 @@ import couchbase = require('couchbase'); var db = new couchbase.Connection({ bucket: "default" }, function (err) { if (err) throw err; - db.set('testdoc', { name: 'Frank' }, function (err, result) { - if (err) throw err; + // TS 0.9.5 bug https://typescript.codeplex.com/workitem/2035, todo: remove cast after fix + (db).set('testdoc', { name: 'Frank' }, function (err, result) { + if (err) throw err; - db.get('testdoc', function (err, result) { + var s: string = err.message; + + // TS 0.9.5 bug https://typescript.codeplex.com/workitem/2035, todo: remove cast after fix + (db).get('testdoc', function (err, result) { if (err) throw err; console.log(result.value); From 750401e208911c1e2c203879687bf54898ee24ed Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Thu, 19 Dec 2013 14:39:30 +0400 Subject: [PATCH 16/49] crossfilter: fixed definition and test --- crossfilter/crossfilter-tests.ts | 14 ++++++++------ crossfilter/crossfilter.d.ts | 4 ++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/crossfilter/crossfilter-tests.ts b/crossfilter/crossfilter-tests.ts index 222096566..745ed3aa4 100644 --- a/crossfilter/crossfilter-tests.ts +++ b/crossfilter/crossfilter-tests.ts @@ -44,28 +44,30 @@ paymentsByTotal.filterFunction(d => 0 <= d && d < 10 || 20 <= d && d < 30); paymentsByTotal.filterAll(); // selects all payments var topPayments = paymentsByTotal.top(4); // the top four payments, by total -topPayments[0]; // the biggest payment +{var p: Payment = topPayments[0];} // the biggest payment topPayments[1]; // the second-biggest payment var allPayments = paymentsByTotal.top(Infinity); var bottomPayments = paymentsByTotal.bottom(4); // the bottom four payments, by total -bottomPayments[0]; // the smallest payment +{var p: Payment = bottomPayments[0];} // the smallest payment bottomPayments[1]; // the second-smallest payment var paymentGroupsByTotal = paymentsByTotal.group(total => Math.floor(total / 100)); paymentGroupsByTotal.size(); -paymentGroupsByTotal.reduce((p, v) => p + 1, (p, v) => p - 1, () => 0); +// bug of TS 0.9.5 https://typescript.codeplex.com/discussions/471751 +//paymentGroupsByTotal.reduce((p, v) => p + 1, (p, v) => p - 1, () => 0); +paymentGroupsByTotal.reduce((p, v) => p + 1, (p, v) => p - 1, () => 0); paymentGroupsByTotal.reduceCount(); var paymentsByType = payments.dimension(d => d.type), paymentVolumeByType = paymentsByType.group().reduceSum(d => d.total), topTypes = paymentVolumeByType.top(1); -topTypes[0].key; // the top payment type (e.g., "tab") -topTypes[0].value; // the payment volume for that type (e.g., 900) +{var s: string = topTypes[0].key;} // the top payment type (e.g., "tab") +{var n: number = topTypes[0].value;} // the payment volume for that type (e.g., 900) interface Group { count: number; @@ -101,7 +103,7 @@ topTotals[0].value; // reduced value for that type (e.g., {count:8, total:920}) paymentGroupsByTotal.orderNatural(); -var paymentCountByType = paymentsByType.group(); +var paymentCountByType = paymentsByType.group().reduceCount(); topTypes = paymentCountByType.top(1); topTypes[0].key; // the top payment type (e.g., "tab") topTypes[0].value; // the count of payments of that type (e.g., 8) diff --git a/crossfilter/crossfilter.d.ts b/crossfilter/crossfilter.d.ts index e01cf1fcb..c98d20867 100644 --- a/crossfilter/crossfilter.d.ts +++ b/crossfilter/crossfilter.d.ts @@ -102,8 +102,8 @@ declare module CrossFilter { top(k: number): T[]; bottom(k: number): T[]; dispose(): void; - group(): Group; - group(groupValue: (data: T) => TGroup): Group; + group(): Group; + group(groupValue: (data: TDimension) => TGroup): Group; groupAll(): GroupAll; } } From 5a2fe2364f8e4c266a74a473146ab8044fde8359 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Thu, 19 Dec 2013 14:48:32 +0400 Subject: [PATCH 17/49] dhtmlxgantt: fixed test --- dhtmlxgantt/dhtmlxgantt-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dhtmlxgantt/dhtmlxgantt-tests.ts b/dhtmlxgantt/dhtmlxgantt-tests.ts index 0b491ce2b..1bfc7a089 100644 --- a/dhtmlxgantt/dhtmlxgantt-tests.ts +++ b/dhtmlxgantt/dhtmlxgantt-tests.ts @@ -28,6 +28,6 @@ gantt.init("scheduler_here", start); gantt.load("/data/events"); //events -gantt.attachEvent("onBeforeLightbox", function (id: string) { +gantt.attachEvent("onBeforeLightbox", function (id?: string) { gantt.showTask(id); }); \ No newline at end of file From 6dc1c510dea597d7621a95fba1246a39bbab5975 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Thu, 19 Dec 2013 14:49:41 +0400 Subject: [PATCH 18/49] dhtmlxscheduler: fixed test --- dhtmlxscheduler/dhtmlxscheduler-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dhtmlxscheduler/dhtmlxscheduler-tests.ts b/dhtmlxscheduler/dhtmlxscheduler-tests.ts index d526a1eaf..2f1f2d9ce 100644 --- a/dhtmlxscheduler/dhtmlxscheduler-tests.ts +++ b/dhtmlxscheduler/dhtmlxscheduler-tests.ts @@ -28,6 +28,6 @@ scheduler.init("scheduler_here", start); scheduler.load("/data/events"); //events -scheduler.attachEvent("onEmptyClick", function (ev: Event) { +scheduler.attachEvent("onEmptyClick", function (ev?: Event) { var date: Date = scheduler.getActionData(ev).date; }); \ No newline at end of file From f0e73667f229bb7d96a5bb3f382c1224e39e04d2 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Thu, 19 Dec 2013 14:54:18 +0400 Subject: [PATCH 19/49] expect.js: fixed definition (fixes test) --- expect.js/expect.js.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/expect.js/expect.js.d.ts b/expect.js/expect.js.d.ts index 82f85b19d..e19f769b6 100644 --- a/expect.js/expect.js.d.ts +++ b/expect.js/expect.js.d.ts @@ -17,14 +17,14 @@ declare module Expect { * * @param fn callback to match error string against */ - throwError(fn?: Function): void; + throwError(fn?: (exception: any) => void): void; /** * Assert that the function throws. * * @param fn callback to match error string against */ - throwException(fn?: Function): void; + throwException(fn?: (exception: any) => void): void; /** * Assert that the function throws. From 555838d5996475036d2b968222c919d1f7aac0d9 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Thu, 19 Dec 2013 14:59:25 +0400 Subject: [PATCH 20/49] fabricjs: fixed test --- fabricjs/fabricjs-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fabricjs/fabricjs-tests.ts b/fabricjs/fabricjs-tests.ts index b230e2249..df0d217e8 100644 --- a/fabricjs/fabricjs-tests.ts +++ b/fabricjs/fabricjs-tests.ts @@ -8,10 +8,10 @@ function sample1() { canvas.on({ 'object:moving': function (e) { - e.target.opacity = 0.5; + (e.target).opacity = 0.5; }, 'object:modified': function (e) { - e.target.opacity = 1; + (e.target).opacity = 1; } }); From bf40f2595785aa0ea8dad374ca6b29c58541bb45 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Thu, 19 Dec 2013 15:06:13 +0400 Subject: [PATCH 21/49] gamepad: fixed test --- gamepad/gamepad-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gamepad/gamepad-tests.ts b/gamepad/gamepad-tests.ts index 7491d7970..e6ca9d272 100644 --- a/gamepad/gamepad-tests.ts +++ b/gamepad/gamepad-tests.ts @@ -18,7 +18,7 @@ window.requestAnimationFrame(runAnimation); }; -()=>{ +(()=>{ window.addEventListener('GamepadConnected', (e: GamepadEvent)=>{ console.log('Gamepad ' + e.gamepad.index + ' connected!'); }, false); @@ -69,4 +69,4 @@ runAnimation(); } -}(); \ No newline at end of file +})(); \ No newline at end of file From e628a5ec4c8328c8219f7f3e0e7750d1ca99d32f Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Thu, 19 Dec 2013 15:21:17 +0400 Subject: [PATCH 22/49] gldatepicker: fixed definition to align with 0.9.5 --- gldatepicker/gldatepicker.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gldatepicker/gldatepicker.d.ts b/gldatepicker/gldatepicker.d.ts index 34781491f..3ed84c219 100644 --- a/gldatepicker/gldatepicker.d.ts +++ b/gldatepicker/gldatepicker.d.ts @@ -64,6 +64,6 @@ interface GlDatePicker { } interface JQuery { - glDatePicker(options?: GlDatePickerOptions): JQuery; - glDatePicker(ret: boolean): GlDatePicker; + glDatePicker(ret: boolean): GlDatePicker; + glDatePicker(options?: GlDatePickerOptions): JQuery; } \ No newline at end of file From 97f46965dd957961c49e5cece702fadb97ed1f8e Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Thu, 19 Dec 2013 15:33:09 +0400 Subject: [PATCH 23/49] greasemonkey: fixed test --- greasemonkey/greasemonkey-tests.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/greasemonkey/greasemonkey-tests.ts b/greasemonkey/greasemonkey-tests.ts index 914c8f4e3..a0185c4a4 100644 --- a/greasemonkey/greasemonkey-tests.ts +++ b/greasemonkey/greasemonkey-tests.ts @@ -96,9 +96,9 @@ GM_xmlhttpRequest({ "Accept": "text/xml" // If not specified, browser defaults will be used. }, onload: function(response) { - var responseXML = response.responseXML; + var responseXML = (response).responseXML; // Inject responseXML into existing Object (only appropriate for XML content). - if (!response.responseXML) { + if (!responseXML) { responseXML = new DOMParser() .parseFromString(response.responseText, "text/xml"); } @@ -205,7 +205,7 @@ var finalUrl: string = syncResult.finalUrl; var readyState: number = syncResult.readyState; var responseHeaders: string = syncResult.responseHeaders; var responseText: string = syncResult.responseText; -var status: number = syncResult.status; +(function() { var status: number = syncResult.status; })(); // conflict with state defined in lib.d.ts var statusText: string = syncResult.statusText; //// Asynchronous From 3668128825d5e458e1dc324ec1c89930b1598118 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Thu, 19 Dec 2013 15:40:27 +0400 Subject: [PATCH 24/49] jquery: fixed definition for bind (fixes hammerjs test) --- jquery/jquery.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index e68d50e36..e8a050194 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -863,7 +863,8 @@ interface JQuery { toggle(showOrHide: boolean): JQuery; // Events - bind(eventType: string, eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + bind(eventType: string, eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; + bind(eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery; bind(eventType: string, eventData: any, preventBubble: boolean): JQuery; bind(eventType: string, preventBubble: boolean): JQuery; bind(...events: any[]): JQuery; From 7d38e1ff5ef792701650691f85e176b840999fe7 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Thu, 19 Dec 2013 15:42:57 +0400 Subject: [PATCH 25/49] i18next: fixed test --- i18next/i18next-tests.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/i18next/i18next-tests.ts b/i18next/i18next-tests.ts index 7a07ed829..2b4ce5a45 100644 --- a/i18next/i18next-tests.ts +++ b/i18next/i18next-tests.ts @@ -24,7 +24,6 @@ describe('i18next', function () { dynamicLoad: false, useLocalStorage: false, sendMissing: false, - resStore: false, getAsync: true, returnObjectTrees: false, debug: true, From ebc032b8e1ccb37a718695a4d66dc48db8ebd809 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Thu, 19 Dec 2013 19:30:43 +0400 Subject: [PATCH 26/49] pdf: fixed definition (fixes test) --- pdf/pdf-tests.ts | 2 -- pdf/pdf.d.ts | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/pdf/pdf-tests.ts b/pdf/pdf-tests.ts index d40ffd578..90542b503 100644 --- a/pdf/pdf-tests.ts +++ b/pdf/pdf-tests.ts @@ -1,7 +1,5 @@ /// -var pdf: PDFPageProxy; - // // Fetch the PDF document from the URL using promises // diff --git a/pdf/pdf.d.ts b/pdf/pdf.d.ts index bddfca74f..6641000bc 100644 --- a/pdf/pdf.d.ts +++ b/pdf/pdf.d.ts @@ -27,7 +27,7 @@ interface PDFPromise { isRejected(): boolean; resolve(value: T): void; reject(reason: string): void; - then(onResolve: (promise: T) => void, onReject?: (reason: string) => void): PDFPromise; + then(onResolve: (promise: T) => void, onReject?: (reason: string) => void): PDFPromise; } interface PDFTreeNode { From f95666a5237c149c82448a90ff46d926eb52706e Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Thu, 19 Dec 2013 19:43:44 +0400 Subject: [PATCH 27/49] phonejs: added .tscparams to set implicit any --- phonejs/dx.phonejs-tests.ts.tscparams | 1 + 1 file changed, 1 insertion(+) create mode 100644 phonejs/dx.phonejs-tests.ts.tscparams diff --git a/phonejs/dx.phonejs-tests.ts.tscparams b/phonejs/dx.phonejs-tests.ts.tscparams new file mode 100644 index 000000000..3cc762b55 --- /dev/null +++ b/phonejs/dx.phonejs-tests.ts.tscparams @@ -0,0 +1 @@ +"" \ No newline at end of file From 16e66ad1ddbb65bbe38b5312189f99b213ed6ac8 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Thu, 19 Dec 2013 19:44:01 +0400 Subject: [PATCH 28/49] pixi: fixed test --- pixi/pixi-tests.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pixi/pixi-tests.ts b/pixi/pixi-tests.ts index 93ff79593..de452f72e 100644 --- a/pixi/pixi-tests.ts +++ b/pixi/pixi-tests.ts @@ -1,6 +1,8 @@ /// /// +function PixiTests() +{ var stage = new PIXI.Stage(0xFFFFFF, true); @@ -1188,3 +1190,5 @@ function update22() requestAnimFrame(update); } + +} \ No newline at end of file From 4070ed0e7912445f36acc103d757fccb5c90e7db Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Thu, 19 Dec 2013 19:46:26 +0400 Subject: [PATCH 29/49] requirejs: fixed test --- requirejs/require-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirejs/require-tests.ts b/requirejs/require-tests.ts index c66567e7b..a8cfdc87e 100644 --- a/requirejs/require-tests.ts +++ b/requirejs/require-tests.ts @@ -31,7 +31,7 @@ require.config({ // load AMD module main.ts (compiled to main.js) // and include shims $, _, Backbone -require(['main'], (main, $, _, Backbone) => { +require(['main'], (main: any, $: any, _: any, Backbone: any) => { var app = main.AppMain(); app.run(); @@ -39,5 +39,5 @@ require(['main'], (main, $, _, Backbone) => { }); var recOne = require.config({ baseUrl: 'js' }); -recOne(['core'], function (core) {/*some code*/}); +recOne(['core'], function (core: any) {/*some code*/}); From b56ddda6d96f258f80f2b0e2507c0d868a3b1ef6 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Thu, 19 Dec 2013 19:48:57 +0400 Subject: [PATCH 30/49] rethinkdb: fixed test --- rethinkdb/rethinkdb-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rethinkdb/rethinkdb-tests.ts b/rethinkdb/rethinkdb-tests.ts index 4e6d78449..e94e5271c 100644 --- a/rethinkdb/rethinkdb-tests.ts +++ b/rethinkdb/rethinkdb-tests.ts @@ -10,7 +10,7 @@ r.connect({host:"localhost", port: 28015}, function(err, conn) { users.insert({name: "bob"}).run(conn, function() {}) - users.filter(function(doc) { + users.filter(function(doc?) { return doc("henry").eq("bob") }) .between("james", "beth") From e355ec2bb949edfa47e88522c8bb67dfd95daa62 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Thu, 19 Dec 2013 19:50:19 +0400 Subject: [PATCH 31/49] routie: fixed tests --- routie/routie-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routie/routie-tests.ts b/routie/routie-tests.ts index aaf075675..323142c7e 100644 --- a/routie/routie-tests.ts +++ b/routie/routie-tests.ts @@ -25,7 +25,7 @@ routie("users/bob"); // window.location.hash will be #users/bob // Routie also supports regex style routes, so you can do advanced routing like this: -routie("users/:name", function (name) { +routie("users/:name", function (name: string) { // name == "bob"; }); @@ -33,7 +33,7 @@ routie("users/bob"); // Optional params: -routie("users/?:name", function (name) { +routie("users/?:name", function (name: string) { //name == undefined //then //name == bob From 203f087391a935db187a2ccc810af220d4ab45ce Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Thu, 19 Dec 2013 20:04:21 +0400 Subject: [PATCH 32/49] royalslider: fixed tests --- royalslider/royalslider-tests.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/royalslider/royalslider-tests.ts b/royalslider/royalslider-tests.ts index 03294c464..8ec25e91a 100644 --- a/royalslider/royalslider-tests.ts +++ b/royalslider/royalslider-tests.ts @@ -8,7 +8,7 @@ $(".royalSlider").royalSlider({ keyboardNavEnabled: true }); -jQuery(document).ready(function ($) { +jQuery(document).ready(function () { $(".royalSlider").royalSlider({ // general options go gere autoScaleSlider: true, @@ -20,7 +20,7 @@ jQuery(document).ready(function ($) { }); }); -jQuery(document).ready(function ($) { +jQuery(document).ready(function () { $(".royalSlider").royalSlider({ // general options go gere autoScaleSlider: true, @@ -32,7 +32,7 @@ jQuery(document).ready(function ($) { }); }); -jQuery(document).ready(function ($) { +jQuery(document).ready(function () { $(".royalSlider").royalSlider({ // general options go gere autoScaleSlider: true, @@ -45,7 +45,7 @@ jQuery(document).ready(function ($) { }); -jQuery(document).ready(function ($) { +jQuery(document).ready(function () { $(".royalSlider").royalSlider({ // general options go gere autoScaleSlider: true, @@ -57,7 +57,7 @@ jQuery(document).ready(function ($) { }); }); -jQuery(document).ready(function ($) { +jQuery(document).ready(function () { $(".royalSlider").royalSlider({ // general options go gere autoScaleSlider: true, @@ -69,7 +69,7 @@ jQuery(document).ready(function ($) { }); }); -jQuery(document).ready(function ($) { +jQuery(document).ready(function () { $(".royalSlider").royalSlider({ // general options go gere autoScaleSlider: true, @@ -81,7 +81,7 @@ jQuery(document).ready(function ($) { }); }); -jQuery(document).ready(function ($) { +jQuery(document).ready(function () { $(".royalSlider").royalSlider({ // general options go gere keyboardNavEnabled: true, @@ -171,7 +171,7 @@ slider.ev.on('rsAfterSlideChange', function (event) { slider.ev.on('rsBeforeAnimStart', function (event) { // before animation between slides start }); -slider.ev.on('rsBeforeMove', function (event, type, userAction) { +slider.ev.on('rsBeforeMove', function (event: JQueryEventObject, type?: string, userAction?: boolean) { // before any transition start (including after drag release) // "type" - can be "next", "prev", or ID of slide to move // userAction (Boolean) - defines if action is triggered by user (e.g. will be false if movement is triggered by autoPlay) @@ -188,7 +188,7 @@ slider.ev.on('rsDragRelease', function () { slider.ev.on('rsBeforeDestroy', function () { // triggers before slider in destroyed }); -slider.ev.on('rsOnCreateVideoElement', function (e, url) { +slider.ev.on('rsOnCreateVideoElement', function (e: JQueryEventObject, url?: string) { // triggers before video element is created, after click on play button. // Read more in Tips&Tricks section }); @@ -214,7 +214,7 @@ slider.slides[2].holder.on('rsAfterContentSet', function () { // fires when third slide content is loaded and added to DOM }); // or globally -slider.ev.on('rsAfterContentSet', function (e, slideObject) { +slider.ev.on('rsAfterContentSet', function (e: JQueryEventObject, slideObject?: RoyalSlider.RoyalSlider) { // fires when every time when slide content is loaded and added to DOM }); @@ -224,7 +224,7 @@ slider.ev.on('rsAfterContentSet', function (e, slideObject) { slider.ev.on('rsAfterInit', function () { // after slider is initialized, }); -slider.ev.on('rsBeforeParseNode', function (e, content, obj) { +slider.ev.on('rsBeforeParseNode', function (e: JQueryEventObject, content?: any, obj?: any) { // before slide node is parsed // content - HTML object of slide that is parsed // obj - RoyalSlider data object (stores image URLs) From 400f0f22b69a18466e2bfe28717b923008fa226c Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Fri, 20 Dec 2013 12:18:16 +0400 Subject: [PATCH 33/49] sammyjs: fixed definition, align with 0.9.5 bugs (fixes test) --- sammyjs/sammyjs.d.ts | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/sammyjs/sammyjs.d.ts b/sammyjs/sammyjs.d.ts index 1c9ca4877..b4fd40880 100644 --- a/sammyjs/sammyjs.d.ts +++ b/sammyjs/sammyjs.d.ts @@ -6,26 +6,20 @@ /// -interface SammyFunc { - (): Sammy.Application; - (selector: string): Sammy.Application; - (handler: Function): Sammy.Application; - (selector: string, handler: Function): Sammy.Application; -} - declare function Sammy(): Sammy.Application; declare function Sammy(selector: string): Sammy.Application; declare function Sammy(handler: Function): Sammy.Application; declare function Sammy(selector: string, handler: Function): Sammy.Application; -interface JQueryStatic { - sammy: SammyFunc; - log: Function; -} - declare module Sammy { + interface SammyFunc { + (): Sammy.Application; + (selector: string): Sammy.Application; + (handler: Function): Sammy.Application; + (selector: string, handler: Function): Sammy.Application; + } - export function Cache(app, options); + export function Cache(app, options); export function DataCacheProxy(initial, $element); export var DataLocationProxy:DataLocationProxy; export function DefaultLocationProxy(app, run_interval_every); @@ -279,5 +273,10 @@ declare module Sammy { SessionStorage(name, element); isAvailable(type); Template(app, method_alias); - } + } +} + +interface JQueryStatic { + sammy: Sammy.SammyFunc; + log: Function; } \ No newline at end of file From 5384a5d80363a7826305286fcb4a84a76763d5f3 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Fri, 20 Dec 2013 13:17:37 +0400 Subject: [PATCH 34/49] select2: fixed test --- select2/select2-tests.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/select2/select2-tests.ts b/select2/select2-tests.ts index 665618daf..bacbc70d8 100644 --- a/select2/select2-tests.ts +++ b/select2/select2-tests.ts @@ -144,12 +144,13 @@ $("#e11_2").select2({ data: [{ id: 0, text: 'story' }, { id: 1, text: 'bug' }, { id: 2, text: 'task' }] }); function log(e) { - var e = $("
  • " + e + "
  • "); - $("#events_11").append(e); - e.animate({ opacity: 1 }, 10000, 'linear', function () { e.animate({ opacity: 0 }, 2000, 'linear', function () { e.remove(); }); }); + var item = $("
  • " + e + "
  • "); + $("#events_11").append(item); + item.animate({ opacity: 1 }, 10000, 'linear', function () { item.animate({ opacity: 0 }, 2000, 'linear', function () { item.remove(); }); }); } $("#e11") - .on("change", function (e) { log(JSON.stringify({ val: e.val, added: e.added, removed: e.removed })); }) + // TS 0.9.5: correct overload not resolved https://typescript.codeplex.com/discussions/472172 + .on("change", function (e: Select2JQueryEventObject) { log(JSON.stringify({ val: e.val, added: e.added, removed: e.removed })); }) .on("open", function () { log("open"); }); $("#e11_2") .on("change", function (e) { log(JSON.stringify({ val: e.val, added: e.added, removed: e.removed })); }) From f8a439ab721025de6d669565030c1979801b32f4 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Fri, 20 Dec 2013 14:02:30 +0400 Subject: [PATCH 35/49] sencha_touch: added .tscparams for tests (fixes errors) --- sencha_touch/SenchaTouch-Tests.ts.tscparams | 1 + 1 file changed, 1 insertion(+) create mode 100644 sencha_touch/SenchaTouch-Tests.ts.tscparams diff --git a/sencha_touch/SenchaTouch-Tests.ts.tscparams b/sencha_touch/SenchaTouch-Tests.ts.tscparams new file mode 100644 index 000000000..3cc762b55 --- /dev/null +++ b/sencha_touch/SenchaTouch-Tests.ts.tscparams @@ -0,0 +1 @@ +"" \ No newline at end of file From 8c94906a4355404f4f21e2b28442c77f22b6c37d Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Fri, 20 Dec 2013 14:08:29 +0400 Subject: [PATCH 36/49] slickgrid: fixed definitions and tests --- slickgrid/SlickGrid-tests.ts | 2 -- slickgrid/SlickGrid.d.ts | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/slickgrid/SlickGrid-tests.ts b/slickgrid/SlickGrid-tests.ts index a5fa63e03..1b41d1a0b 100644 --- a/slickgrid/SlickGrid-tests.ts +++ b/slickgrid/SlickGrid-tests.ts @@ -1,8 +1,6 @@ /// /// -declare var $: any; - interface MyData extends Slick.SlickData { title: string; duration: string; diff --git a/slickgrid/SlickGrid.d.ts b/slickgrid/SlickGrid.d.ts index becc6f617..9579997ad 100644 --- a/slickgrid/SlickGrid.d.ts +++ b/slickgrid/SlickGrid.d.ts @@ -1320,7 +1320,7 @@ declare module Slick { } // todo: merge with existing column definition - export interface Column { + export interface Column { sortCol?: string; sortAsc?: boolean; } From 5d8961d1754b48800c9ee6f6150f36d8278f730b Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Fri, 20 Dec 2013 14:14:06 +0400 Subject: [PATCH 37/49] titanium: fixed tests --- titanium/titanium-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/titanium/titanium-tests.ts b/titanium/titanium-tests.ts index 3899824c7..a4057b80c 100644 --- a/titanium/titanium-tests.ts +++ b/titanium/titanium-tests.ts @@ -111,7 +111,7 @@ function test_map() { mapview.regionFit = true; mapview.userLocation = true; mapview.annotations = [mountainView]; - mapview.addEventListener('click', function(evt) { + mapview.addEventListener('click', function(evt?) { if (evt.clicksource === 'leftButton' || evt.clicksource === 'leftPane') { alert(evt.title + ' left button clicked'); } From c36a44bfb518ae9315640a2fb644a62eb112bc5d Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Fri, 20 Dec 2013 14:17:53 +0400 Subject: [PATCH 38/49] viewporter: fixed tests --- viewporter/viewporter-tests.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/viewporter/viewporter-tests.ts b/viewporter/viewporter-tests.ts index 35c8c2ae4..9ce0be298 100644 --- a/viewporter/viewporter-tests.ts +++ b/viewporter/viewporter-tests.ts @@ -119,7 +119,7 @@ function test_swipey() { }).trigger(viewporter.ACTIVE ? 'viewportchange' : 'resize'); $('canvas').bind(iOS ? 'touchstart' : 'mousedown', function (e) { e.preventDefault(); - var touches = iOS ? e.originalEvent.changedTouches : [e.originalEvent]; + var touches = iOS ? (e.originalEvent).changedTouches : [e.originalEvent]; var identifier; for (var i = 0; i < touches.length; i++) { identifier = touches[i].identifier || 'mouse'; @@ -133,7 +133,7 @@ function test_swipey() { }); $('canvas').bind(iOS ? 'touchmove' : 'mousemove', function (e) { - var touches = iOS ? e.originalEvent.changedTouches : [e.originalEvent]; + var touches = iOS ? (e.originalEvent).changedTouches : [e.originalEvent]; var identifier; for (var i = 0; i < touches.length; i++) { identifier = touches[i].identifier || 'mouse'; @@ -144,7 +144,7 @@ function test_swipey() { }); $('canvas').bind(iOS ? 'touchend' : 'mouseup', function (e) { - var touches = iOS ? e.originalEvent.changedTouches : [e.originalEvent]; + var touches = iOS ? (e.originalEvent).changedTouches : [e.originalEvent]; var identifier; for (var i = 0; i < touches.length; i++) { identifier = touches[i].identifier || 'mouse'; From e720d1ddfb703a42bcba2d6f65362b0643c98c58 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Sun, 22 Dec 2013 13:56:30 +0400 Subject: [PATCH 39/49] select2: fixed another error in tests --- select2/select2-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/select2/select2-tests.ts b/select2/select2-tests.ts index bacbc70d8..d3a21b188 100644 --- a/select2/select2-tests.ts +++ b/select2/select2-tests.ts @@ -153,7 +153,7 @@ $("#e11") .on("change", function (e: Select2JQueryEventObject) { log(JSON.stringify({ val: e.val, added: e.added, removed: e.removed })); }) .on("open", function () { log("open"); }); $("#e11_2") - .on("change", function (e) { log(JSON.stringify({ val: e.val, added: e.added, removed: e.removed })); }) + .on("change", function (e: Select2JQueryEventObject) { log(JSON.stringify({ val: e.val, added: e.added, removed: e.removed })); }) .on("open", function () { log("open"); }); $("#e12").select2({ tags: ["red", "green", "blue"] }); $("#e20").select2({ From 81628bea7cb3ccad16db392bea0d967d79b29352 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Sun, 22 Dec 2013 14:06:22 +0400 Subject: [PATCH 40/49] node-git: improved definition to fix tests --- node-git/node-git.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node-git/node-git.d.ts b/node-git/node-git.d.ts index dadfc8ba8..7e29b0ffd 100644 --- a/node-git/node-git.d.ts +++ b/node-git/node-git.d.ts @@ -17,7 +17,7 @@ declare module "git" { git(functionName:any, options:any, ...args:any[]):void; // last element is callback - call_git(prefix:string, command:any, postfix:string, options:any, args:any, callback:Function):void; + call_git(prefix:string, command:any, postfix:string, options:any, args:any, callback: (error: any, result: string) => void):void; rev_list(callback:Function):void; From 004918955f4951bef2b5d559d75558176dc3900a Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Sun, 22 Dec 2013 14:08:36 +0400 Subject: [PATCH 41/49] node-ffi: fixed tests for --noImplicitAny --- node-ffi/node-ffi-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node-ffi/node-ffi-tests.ts b/node-ffi/node-ffi-tests.ts index c646af703..407036d39 100644 --- a/node-ffi/node-ffi-tests.ts +++ b/node-ffi/node-ffi-tests.ts @@ -26,7 +26,7 @@ import TArray = require('ref-array'); { var func = ffi.ForeignFunction(new Buffer(10), 'int', [ 'int' ]); func(-5); - func.async(-5, function(err, res) {}); + func.async(-5, function(err: any, res: any) {}); } { var printfPointer = ffi.DynamicLibrary().get('printf'); From 4fce4a3a03688af03cd686d05646cbe4fca36ae4 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Sun, 22 Dec 2013 14:22:32 +0400 Subject: [PATCH 42/49] handlebars: fixed tests --- handlebars/handlebars-tests.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/handlebars/handlebars-tests.ts b/handlebars/handlebars-tests.ts index 1846f943d..937f93191 100644 --- a/handlebars/handlebars-tests.ts +++ b/handlebars/handlebars-tests.ts @@ -10,7 +10,7 @@ var context = { body: 'Me too!' }] }; -Handlebars.registerHelper('fullName', (person) => { +Handlebars.registerHelper('fullName', (person: typeof context.author) => { return person.firstName + ' ' + person.lastName; }); @@ -28,17 +28,18 @@ var data = { 'name': 'Alan', 'hometown': 'Somewhere, TX', 'kids': [{'name': 'Jimmy', 'age': '12'}, {'name': 'Sally', 'age': '4'}]}; var result = template(data); -Handlebars.registerHelper('link_to', (context) => { +Handlebars.registerHelper('link_to', (context: typeof post) => { return '' + context.body + ''; }); -var context2 = { posts: [{url: '/hello-world', body: 'Hello World!'}] }; +var post = { url: '/hello-world', body: 'Hello World!' }; +var context2 = { posts: [post] }; var source2 = '
      {{#posts}}
    • {{{link_to this}}}
    • {{/posts}}
    '; var template2 = Handlebars.compile(source2); template2(context2); -Handlebars.registerHelper('link_to', (title, context) => { +Handlebars.registerHelper('link_to', (title: string, context: typeof post) => { return '' + title + '!'; }); @@ -48,7 +49,7 @@ var template3 = Handlebars.compile(source3); template3(context3); var source4 = '
      {{#people}}
    • {{#link}}{{name}}{{/link}}
    • {{/people}}
    '; -Handlebars.registerHelper('link', function(context) { +Handlebars.registerHelper('link', function(context: any) { return '' + context.fn(this) + ''; }); var template4 = Handlebars.compile(source4); @@ -67,13 +68,13 @@ var data3 = { 'people': [ ]}; template5(data3); -Handlebars.registerHelper('list', (items, fn) => { +Handlebars.registerHelper('list', (items: any, fn: (item: any) => string) => { var out = '
      '; for(var i=0, l=items.length; i' + fn(items[i]) + ''; } return out + '
    '; }); -Handlebars.registerHelper('fullName', (person) => { +Handlebars.registerHelper('fullName', (person: typeof context.author) => { return person.firstName + ' ' + person.lastName; }); From a5ed7728b10be8b040e4eb08e709a5b199fadd8d Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Sun, 22 Dec 2013 14:47:48 +0400 Subject: [PATCH 43/49] cryptojs: fixed tests --- cryptojs/test/aes-tests.ts | 4 ++-- cryptojs/test/des-tests.ts | 4 ++-- cryptojs/test/pad-iso10126-tests.ts | 4 ++-- cryptojs/test/rabbit-legacy-tests.ts | 4 ++-- cryptojs/test/rabbit-tests.ts | 4 ++-- cryptojs/test/rc4-tests.ts | 4 ++-- cryptojs/test/tripledes-tests.ts | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/cryptojs/test/aes-tests.ts b/cryptojs/test/aes-tests.ts index eaef25447..d4f0d9537 100644 --- a/cryptojs/test/aes-tests.ts +++ b/cryptojs/test/aes-tests.ts @@ -63,9 +63,9 @@ YUI.add('algo-aes-test', function (Y) { // Replace random method with one that returns a predictable value C.lib.WordArray.random = function (nBytes) { - var words = []; + var words: number[] = []; for (var i = 0; i < nBytes; i += 4) { - words.push([0x11223344]); + words.push(0x11223344); } return C.lib.WordArray.create(words, nBytes); diff --git a/cryptojs/test/des-tests.ts b/cryptojs/test/des-tests.ts index 5e18608e0..d889abab1 100644 --- a/cryptojs/test/des-tests.ts +++ b/cryptojs/test/des-tests.ts @@ -87,9 +87,9 @@ YUI.add('algo-des-test', function (Y) { // Replace random method with one that returns a predictable value C.lib.WordArray.random = function (nBytes) { - var words = []; + var words: number[] = []; for (var i = 0; i < nBytes; i += 4) { - words.push([0x11223344]); + words.push(0x11223344); } return C.lib.WordArray.create(words, nBytes); diff --git a/cryptojs/test/pad-iso10126-tests.ts b/cryptojs/test/pad-iso10126-tests.ts index de46f7d81..2961c9a32 100644 --- a/cryptojs/test/pad-iso10126-tests.ts +++ b/cryptojs/test/pad-iso10126-tests.ts @@ -15,9 +15,9 @@ YUI.add('pad-iso10126-test', function (Y) { // Replace random method with one that returns a predictable value C.lib.WordArray.random = function (nBytes) { - var words = []; + var words: number[] = []; for (var i = 0; i < nBytes; i += 4) { - words.push([0x11223344]); + words.push(0x11223344); } return C.lib.WordArray.create(words, nBytes); diff --git a/cryptojs/test/rabbit-legacy-tests.ts b/cryptojs/test/rabbit-legacy-tests.ts index 658d62b25..30f368717 100644 --- a/cryptojs/test/rabbit-legacy-tests.ts +++ b/cryptojs/test/rabbit-legacy-tests.ts @@ -63,9 +63,9 @@ YUI.add('algo-rabbit-legacy-test', function (Y) { // Replace random method with one that returns a predictable value C.lib.WordArray.random = function (nBytes) { - var words = []; + var words: number[] = []; for (var i = 0; i < nBytes; i += 4) { - words.push([0x11223344]); + words.push(0x11223344); } return C.lib.WordArray.create(words, nBytes); diff --git a/cryptojs/test/rabbit-tests.ts b/cryptojs/test/rabbit-tests.ts index e8e0d3e3c..a5690face 100644 --- a/cryptojs/test/rabbit-tests.ts +++ b/cryptojs/test/rabbit-tests.ts @@ -67,9 +67,9 @@ YUI.add('algo-rabbit-test', function (Y) { // Replace random method with one that returns a predictable value C.lib.WordArray.random = function (nBytes) { - var words = []; + var words: number[] = []; for (var i = 0; i < nBytes; i += 4) { - words.push([0x11223344]); + words.push(0x11223344); } return C.lib.WordArray.create(words, nBytes); diff --git a/cryptojs/test/rc4-tests.ts b/cryptojs/test/rc4-tests.ts index 5a4e5aa6f..a827c0921 100644 --- a/cryptojs/test/rc4-tests.ts +++ b/cryptojs/test/rc4-tests.ts @@ -51,9 +51,9 @@ YUI.add('algo-rc4-test', function (Y) { // Replace random method with one that returns a predictable value C.lib.WordArray.random = function (nBytes) { - var words = []; + var words: number[] = []; for (var i = 0; i < nBytes; i += 4) { - words.push([0x11223344]); + words.push(0x11223344); } return C.lib.WordArray.create(words, nBytes); diff --git a/cryptojs/test/tripledes-tests.ts b/cryptojs/test/tripledes-tests.ts index 2227d3710..cbc123ea3 100644 --- a/cryptojs/test/tripledes-tests.ts +++ b/cryptojs/test/tripledes-tests.ts @@ -71,9 +71,9 @@ YUI.add('algo-tripledes-test', function (Y) { // Replace random method with one that returns a predictable value C.lib.WordArray.random = function (nBytes) { - var words = []; + var words: number[] = []; for (var i = 0; i < nBytes; i += 4) { - words.push([0x11223344]); + words.push(0x11223344); } return C.lib.WordArray.create(words, nBytes); From 21317218e904f7410ce599e20f3e18d674b81fa3 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Sun, 22 Dec 2013 14:51:03 +0400 Subject: [PATCH 44/49] azure-mobile-services-client: fixed tests --- azure-mobile-services-client/AzureMobileServicesClient-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-mobile-services-client/AzureMobileServicesClient-tests.ts b/azure-mobile-services-client/AzureMobileServicesClient-tests.ts index 4d1765b25..7a3b9b956 100644 --- a/azure-mobile-services-client/AzureMobileServicesClient-tests.ts +++ b/azure-mobile-services-client/AzureMobileServicesClient-tests.ts @@ -59,7 +59,7 @@ query.read().done(printOut); //Execute query remotly and return data filtered //testing more complicated Query in composition with previous using function Predicate and Projection var minlength = 15; //parameter value for filter Predicate -query.where(function (len: number) { return this.text != null && this.text.length > len }, minlength) +query.where(function (len?: number) { return this.text != null && this.text.length > len }, minlength) .orderByDescending('id').skip(2).take(3) //some other ordering and paging filters .select(function () { return { abc: this.text + '|' + this.id }; }) //Projection .read().done(printOut); //return 3 object {abd: 'ttttttttttttttt|ID'} From 6b4ed37ddbbae456222d428e9648fa7b40287b71 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Sun, 22 Dec 2013 14:55:09 +0400 Subject: [PATCH 45/49] angular-ui: fixed router tests --- angular-ui/angular-ui-router-tests.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/angular-ui/angular-ui-router-tests.ts b/angular-ui/angular-ui-router-tests.ts index 3d7ce3b5c..38f8b5ca0 100644 --- a/angular-ui/angular-ui-router-tests.ts +++ b/angular-ui/angular-ui-router-tests.ts @@ -2,6 +2,10 @@ var myApp = angular.module('testModule'); +interface MyAppScope extends ng.IScope { + items: string[]; + things: string[]; +} myApp.config(( $stateProvider: ng.ui.IStateProvider, @@ -19,7 +23,7 @@ myApp.config(( .state('state1.list', { url: "/list", templateUrl: "partials/state1.list.html", - controller: function($scope) { + controller: function ($scope: MyAppScope) { $scope.items = ["A", "List", "Of", "Items"]; } }) @@ -30,7 +34,7 @@ myApp.config(( .state('state2.list', { url: "/list", templateUrl: "partials/state2.list.html", - controller: function($scope) { + controller: function ($scope: MyAppScope) { $scope.things = ["A", "Set", "Of", "Things"]; } }).state('index', { From 9f8b7460b06bc0b1e4df17a5fa38430b03aec0a4 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Sun, 22 Dec 2013 15:47:53 +0400 Subject: [PATCH 46/49] node-git: updated definition to fix --noImplicitAny error --- node-git/node-git.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/node-git/node-git.d.ts b/node-git/node-git.d.ts index 7e29b0ffd..f10d217cb 100644 --- a/node-git/node-git.d.ts +++ b/node-git/node-git.d.ts @@ -46,9 +46,9 @@ declare module "git" { // not implemented! clone(options:any, originalPath:any, targetPath:any, callback:Function):void; - diff(commit1:any, commit2:any, callback:Function):void; + diff(commit1:any, commit2:any, callback: (error: any, patch: string) => void):void; - diff(commit1:any, commit2:any, options:any, callback:Function):void; + diff(commit1: any, commit2: any, options: any, callback: (error: any, patch: string) => void):void; fs_exist(path:any, callback:Function):void; @@ -488,11 +488,11 @@ declare module "git" { fork_bare(path:any, options:any, callback:Function):void; // buggy? - diff(a:string, callback:Function):void; + diff(a: string, callback: (error: any, patch: string) => void):void; - diff(a:string, b:string, callback:Function):void; + diff(a: string, b: string, callback: (error: any, patch: string) => void):void; - diff(a:string, b:string, paths:any, callback:Function):void; + diff(a: string, b: string, paths: any, callback: (error: any, patch: string) => void):void; commit_diff(commit:string, callback:Function):void; From f57187fb4a9144d71d435982fdbba099e51a9d3b Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Sun, 22 Dec 2013 15:52:14 +0400 Subject: [PATCH 47/49] q: fixed definition and tests to align with 0.9.5 function call resolution --- q/Q-tests.ts | 4 ++-- q/Q.d.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/q/Q-tests.ts b/q/Q-tests.ts index 21fc95138..d08ae5111 100644 --- a/q/Q-tests.ts +++ b/q/Q-tests.ts @@ -23,7 +23,7 @@ Q.delay(8, 1000).then(x => x.toExponential()); Q.delay(Q("asdf"), 1000).then(x => x.length); Q.delay("asdf", 1000).then(x => x.length); -var eventualAdd = Q.promised((a: number, b: number) => a + b); +var eventualAdd = Q.promised((a?: number, b?: number) => a + b); eventualAdd(Q(1), Q(2)).then(x => x.toExponential()); var eventually = function (eventually) { @@ -90,7 +90,7 @@ Q.all(promiseArray).then(nums => nums.map(num => num.toPrecision(2)).join(',')); Q.all(myNums).then(nums => nums.map(Math.round)); -Q.fbind((dateString) => new Date(dateString), "11/11/1991")().then(d => d.toLocaleDateString()); +Q.fbind((dateString?) => new Date(dateString), "11/11/1991")().then(d => d.toLocaleDateString()); Q.when(8, num => num + "!"); Q.when(Q(8), num => num + "!").then(str => str.split(',')); diff --git a/q/Q.d.ts b/q/Q.d.ts index 31537423f..d61c34d54 100644 --- a/q/Q.d.ts +++ b/q/Q.d.ts @@ -106,8 +106,8 @@ declare module Q { export function nsend(nodeModule: any, functionName: string, ...args: any[]): Promise; export function nmcall(nodeModule: any, functionName: string, ...args: any[]): Promise; + export function all(promises: IPromise[]): Promise; export function all(promises: any[]): Promise; - export function all(promises: IPromise[]): Promise; export function allSettled(promises: any[]): Promise[]>; export function allSettled(promises: IPromise[]): Promise[]>; From 723b48805e7dc0e2a6fc23c684ffe55a1f2dee62 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Sun, 22 Dec 2013 17:08:51 +0400 Subject: [PATCH 48/49] angularjs: fixed resource tests --- angularjs/angular-resource-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angularjs/angular-resource-tests.ts b/angularjs/angular-resource-tests.ts index b223b8171..c31bef09c 100644 --- a/angularjs/angular-resource-tests.ts +++ b/angularjs/angular-resource-tests.ts @@ -83,5 +83,5 @@ var resourceService: ng.resource.IResourceService; resourceClass = resourceServiceFactoryFunction(resourceService); -resourceServiceFactoryFunction = function (resourceService) { return resourceClass }; +resourceServiceFactoryFunction = function (resourceService) { return resourceClass; }; mod = mod.factory('factory name', resourceServiceFactoryFunction); From f4a56aea3f89a823483bbf0ab6e9d49084e16fda Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Mon, 23 Dec 2013 03:46:41 +0400 Subject: [PATCH 49/49] angularjs: fixed another error in resource tests --- angularjs/angular-resource-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angularjs/angular-resource-tests.ts b/angularjs/angular-resource-tests.ts index c31bef09c..2870b21ad 100644 --- a/angularjs/angular-resource-tests.ts +++ b/angularjs/angular-resource-tests.ts @@ -83,5 +83,5 @@ var resourceService: ng.resource.IResourceService; resourceClass = resourceServiceFactoryFunction(resourceService); -resourceServiceFactoryFunction = function (resourceService) { return resourceClass; }; +resourceServiceFactoryFunction = function (resourceService: ng.resource.IResourceService) { return resourceClass; }; mod = mod.factory('factory name', resourceServiceFactoryFunction);