From 694b1d528f0b8d7a9bcb355d106107859332e009 Mon Sep 17 00:00:00 2001 From: Basarat Syed Date: Wed, 19 Jun 2013 18:08:15 +1000 Subject: [PATCH 01/57] Fixed for TS0.9 : angular-resource: declare required chai-assert: 'declare' modifier not allowed for code already in an ambient context. chai: Trailing comma not allowed --- angularjs/angular-resource.d.ts | 2 +- chai/chai-assert.d.ts | 2 +- chai/chai.d.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/angularjs/angular-resource.d.ts b/angularjs/angular-resource.d.ts index 953ce7ef4..21731a36d 100644 --- a/angularjs/angular-resource.d.ts +++ b/angularjs/angular-resource.d.ts @@ -9,7 +9,7 @@ /////////////////////////////////////////////////////////////////////////////// // ngResource module (angular-resource.js) /////////////////////////////////////////////////////////////////////////////// -module ng.resource { +declare module ng.resource { /////////////////////////////////////////////////////////////////////////// // ResourceService diff --git a/chai/chai-assert.d.ts b/chai/chai-assert.d.ts index b31b7bde5..ab1a23d14 100644 --- a/chai/chai-assert.d.ts +++ b/chai/chai-assert.d.ts @@ -107,7 +107,7 @@ declare module chai ifError(val:any, msg?:string); } //node module - declare var assert:Assert; + var assert:Assert; } //browser global declare var assert:chai.Assert; \ No newline at end of file diff --git a/chai/chai.d.ts b/chai/chai.d.ts index df9e12382..5034b8153 100644 --- a/chai/chai.d.ts +++ b/chai/chai.d.ts @@ -35,7 +35,7 @@ declare module chai { interface TypeComparison { (type: string, message?: string): bool; - instanceof(type: Object, ): bool; + instanceof(type: Object): bool; } interface NumericComparison { From 92011c177255e66e5199ef4732376c1df975332e Mon Sep 17 00:00:00 2001 From: Nicholas Wolverson Date: Wed, 19 Jun 2013 13:32:56 +0100 Subject: [PATCH 02/57] Fix Knockout tests for 0.9/generics Allows ko.observable() --- knockout.mapping/knockout.mapping.d.ts | 2 +- knockout/knockout.d.ts | 1 + .../knockout-templatingBehaviors-tests.ts | 42 +++++++++---------- knockout/tests/knockout-tests.ts | 28 ++++++------- 4 files changed, 36 insertions(+), 37 deletions(-) diff --git a/knockout.mapping/knockout.mapping.d.ts b/knockout.mapping/knockout.mapping.d.ts index 69b6ccaff..010f18801 100644 --- a/knockout.mapping/knockout.mapping.d.ts +++ b/knockout.mapping/knockout.mapping.d.ts @@ -13,7 +13,7 @@ interface KnockoutMappingCreateOptions { interface KnockoutMappingUpdateOptions { data: any; parent: any; - observable: KnockoutObservableAny; + observable: KnockoutObservable; } interface KnockoutMappingOptions { diff --git a/knockout/knockout.d.ts b/knockout/knockout.d.ts index ba9e74303..67858f088 100644 --- a/knockout/knockout.d.ts +++ b/knockout/knockout.d.ts @@ -95,6 +95,7 @@ interface KnockoutObservableStatic { fn: KnockoutObservableFunctions; (value: T): KnockoutObservable; + (): KnockoutObservable; } /** use as method to get/set the value */ diff --git a/knockout/tests/knockout-templatingBehaviors-tests.ts b/knockout/tests/knockout-templatingBehaviors-tests.ts index b000015f2..7be02d4cd 100644 --- a/knockout/tests/knockout-templatingBehaviors-tests.ts +++ b/knockout/tests/knockout-templatingBehaviors-tests.ts @@ -2,8 +2,6 @@ /// /// -declare var $; - var dummyTemplateEngine = function (templates?) { var inMemoryTemplates = templates || {}; var inMemoryTemplateData = {}; @@ -137,7 +135,7 @@ describe('Templating', function() { }); it('Should automatically rerender into DOM element when dependencies change', function () { - var dependency = new ko.observable("A"); + var dependency = ko.observable("A"); ko.setTemplateEngine(new dummyTemplateEngine({ someTemplate: function () { return "Value = " + dependency(); } @@ -153,7 +151,7 @@ describe('Templating', function() { }); it('Should not rerender DOM element if observable accessed in \'afterRender\' callaback is changed', function () { - var observable = new ko.observable("A"), count = 0; + var observable = ko.observable("A"), count = 0; var myCallback = function(elementsArray, dataItem) { observable(); // access observable in callback }; @@ -171,7 +169,7 @@ describe('Templating', function() { }); it('If the supplied data item is observable, evaluates it and has subscription on it', function () { - var observable = new ko.observable("A"); + var observable = ko.observable("A"); ko.setTemplateEngine(new dummyTemplateEngine({ someTemplate: function (data) { return "Value = " + data; } @@ -184,7 +182,7 @@ describe('Templating', function() { }); it('Should stop updating DOM nodes when the dependency next changes if the DOM node has been removed from the document', function () { - var dependency = new ko.observable("A"); + var dependency = ko.observable("A"); var template = { someTemplate: function () { return "Value = " + dependency() } }; ko.setTemplateEngine(new dummyTemplateEngine(template)); @@ -275,7 +273,7 @@ describe('Templating', function() { }); it('Should rerender chained templates when their dependencies change, without rerendering parent templates', function () { - var observable = new ko.observable("ABC"); + var observable = ko.observable("ABC"); var timesRenderedOuter = 0, timesRenderedInner = 0; ko.setTemplateEngine(new dummyTemplateEngine({ outerTemplate: function () { timesRenderedOuter++; return "outer template output, [renderTemplate:innerTemplate]" }, // [renderTemplate:...] is special syntax supported by dummy template engine @@ -390,7 +388,7 @@ describe('Templating', function() { }); it('Data binding syntax should support \'foreach\' option, whereby it renders for each item in an array but doesn\'t rerender everything if you push or splice', function () { - var myArray = new ko.observableArray([{ personName: "Bob" }, { personName: "Frank"}]); + var myArray = ko.observableArray([{ personName: "Bob" }, { personName: "Frank"}]); ko.setTemplateEngine(new dummyTemplateEngine({ itemTemplate: "
The item is [js: personName]
" })); testNode.innerHTML = "
"; @@ -406,7 +404,7 @@ describe('Templating', function() { }); it('Data binding \'foreach\' option should apply bindings within the context of each item in the array', function () { - var myArray = new ko.observableArray([{ personName: "Bob" }, { personName: "Frank"}]); + var myArray = ko.observableArray([{ personName: "Bob" }, { personName: "Frank"}]); ko.setTemplateEngine(new dummyTemplateEngine({ itemTemplate: "The item is " })); testNode.innerHTML = "
"; @@ -479,7 +477,7 @@ describe('Templating', function() { }); it('Data binding \'foreach\' option should apply bindings with an $index in the context', function () { - var myArray = new ko.observableArray([{ personName: "Bob" }, { personName: "Frank"}]); + var myArray = ko.observableArray([{ personName: "Bob" }, { personName: "Frank"}]); ko.setTemplateEngine(new dummyTemplateEngine({ itemTemplate: "The item # is " })); testNode.innerHTML = "
"; @@ -488,7 +486,7 @@ describe('Templating', function() { }); it('Data binding \'foreach\' option should update bindings that reference an $index if the list changes', function () { - var myArray = new ko.observableArray([{ personName: "Bob" }, { personName: "Frank"}]); + var myArray = ko.observableArray([{ personName: "Bob" }, { personName: "Frank"}]); ko.setTemplateEngine(new dummyTemplateEngine({ itemTemplate: "The item is " })); testNode.innerHTML = "
"; @@ -504,7 +502,7 @@ describe('Templating', function() { }); it('Data binding \'foreach\' option should accept array with "undefined" and "null" items', function () { - var myArray = new ko.observableArray([undefined, null]); + var myArray = ko.observableArray([undefined, null]); ko.setTemplateEngine(new dummyTemplateEngine({ itemTemplate: "The item is " })); testNode.innerHTML = "
"; @@ -513,8 +511,8 @@ describe('Templating', function() { }); it('Data binding \'foreach\' option should update DOM nodes when a dependency of their mapping function changes', function() { - var myObservable = new ko.observable("Steve"); - var myArray = new ko.observableArray([{ personName: "Bob" }, { personName: myObservable }, { personName: "Another" }]); + var myObservable = ko.observable("Steve"); + var myArray = ko.observableArray([{ personName: "Bob" }, { personName: myObservable }, { personName: "Another" }]); ko.setTemplateEngine(new dummyTemplateEngine({ itemTemplate: "
The item is [js: ko.utils.unwrapObservable(personName)]
" })); testNode.innerHTML = "
"; @@ -535,7 +533,7 @@ describe('Templating', function() { }); it('Data binding \'foreach\' option should treat a null parameter as meaning \'no items\'', function() { - var myArray = new ko.observableArray(["A", "B"]); + var myArray = ko.observableArray(["A", "B"]); ko.setTemplateEngine(new dummyTemplateEngine({ itemTemplate: "hello" })); testNode.innerHTML = "
"; @@ -551,7 +549,7 @@ describe('Templating', function() { it('Data binding \'foreach\' option should accept an \"as\" option to define an alias for the iteration variable', function() { // Note: There are more detailed specs (e.g., covering nesting) associated with the "foreach" binding which // uses this templating functionality internally. - var myArray = new ko.observableArray(["A", "B"]); + var myArray = ko.observableArray(["A", "B"]); ko.setTemplateEngine(new dummyTemplateEngine({ itemTemplate: "[js:myAliasedItem]" })); testNode.innerHTML = "
"; @@ -561,7 +559,7 @@ describe('Templating', function() { it('Data binding \'foreach\' option should stop tracking inner observables when the container node is removed', function() { var innerObservable = ko.observable("some value"); - var myArray = new ko.observableArray([{obsVal:innerObservable}, {obsVal:innerObservable}]); + var myArray = ko.observableArray([{obsVal:innerObservable}, {obsVal:innerObservable}]); ko.setTemplateEngine(new dummyTemplateEngine({ itemTemplate: "The item is [js: ko.utils.unwrapObservable(obsVal)]" })); testNode.innerHTML = "
"; @@ -574,7 +572,7 @@ describe('Templating', function() { it('Data binding \'foreach\' option should stop tracking inner observables related to each array item when that array item is removed', function() { var innerObservable = ko.observable("some value"); - var myArray = new ko.observableArray([{obsVal:innerObservable}, {obsVal:innerObservable}]); + var myArray = ko.observableArray([{obsVal:innerObservable}, {obsVal:innerObservable}]); ko.setTemplateEngine(new dummyTemplateEngine({ itemTemplate: "The item is [js: ko.utils.unwrapObservable(obsVal)]" })); testNode.innerHTML = "
"; @@ -588,7 +586,7 @@ describe('Templating', function() { }); it('Data binding syntax should omit any items whose \'_destroy\' flag is set (unwrapping the flag if it is observable)', function() { - var myArray = new ko.observableArray([{ someProp: 1 }, { someProp: 2, _destroy: 'evals to true' }, { someProp : 3 }, { someProp: 4, _destroy: ko.observable(false) }]); + var myArray = ko.observableArray([{ someProp: 1 }, { someProp: 2, _destroy: 'evals to true' }, { someProp : 3 }, { someProp: 4, _destroy: ko.observable(false) }]); ko.setTemplateEngine(new dummyTemplateEngine({ itemTemplate: "
someProp=[js: someProp]
" })); testNode.innerHTML = "
"; @@ -597,7 +595,7 @@ describe('Templating', function() { }); it('Data binding syntax should include any items whose \'_destroy\' flag is set if you use includeDestroyed', function() { - var myArray = new ko.observableArray([{ someProp: 1 }, { someProp: 2, _destroy: 'evals to true' }, { someProp : 3 }]); + var myArray = ko.observableArray([{ someProp: 1 }, { someProp: 2, _destroy: 'evals to true' }, { someProp : 3 }]); ko.setTemplateEngine(new dummyTemplateEngine({ itemTemplate: "
someProp=[js: someProp]
" })); testNode.innerHTML = "
"; @@ -677,7 +675,7 @@ describe('Templating', function() { }); it('Should be able to render a different template for each array entry by passing a function as template name, with the array entry\'s binding context available as a second parameter', function() { - var myArray = new ko.observableArray([ + var myArray = ko.observableArray([ { preferredTemplate: 1, someProperty: 'firstItemValue' }, { preferredTemplate: 2, someProperty: 'secondItemValue' } ]); @@ -700,7 +698,7 @@ describe('Templating', function() { it('Data binding \'templateOptions\' should be passed to template', function() { var myModel = { someAdditionalData: { myAdditionalProp: "someAdditionalValue" }, - people: new ko.observableArray([ + people: ko.observableArray([ { name: "Alpha" }, { name: "Beta" } ]) diff --git a/knockout/tests/knockout-tests.ts b/knockout/tests/knockout-tests.ts index 6682eb363..e2fbf4c02 100644 --- a/knockout/tests/knockout-tests.ts +++ b/knockout/tests/knockout-tests.ts @@ -53,7 +53,7 @@ function test_computed() { }); } - function MyViewModel() { + function MyViewModel1() { this.price = ko.observable(25.99); this.formattedPrice = ko.computed({ @@ -68,7 +68,7 @@ function test_computed() { }); } - function MyViewModel() { + function MyViewModel2() { this.acceptedNumericValue = ko.observable(123); this.lastInputWasValid = ko.observable(true); @@ -90,13 +90,13 @@ function test_computed() { } class GetterViewModel { - private _selectedRange: KnockoutObservableAny; + private _selectedRange: KnockoutObservable; constructor() { this._selectedRange = ko.observable(); } - public range: KnockoutObservableAny; + public range: KnockoutObservable; } function testGetter() { @@ -333,12 +333,12 @@ function test_more() { return target; }; - function AppViewModel(first, last) { + function AppViewModel2(first, last) { this.firstName = ko.observable(first).extend({ required: "Please enter a first name" }); this.lastName = ko.observable(last).extend({ required: "" }); } - ko.applyBindings(new AppViewModel("Bob", "Smith")); + ko.applyBindings(new AppViewModel2("Bob", "Smith")); var first; this.firstName = ko.observable(first).extend({ required: "Please enter a first name", logChange: "first name" }); @@ -347,7 +347,7 @@ function test_more() { return name.toUpperCase(); }).extend({ throttle: 500 }); - function AppViewModel() { + function AppViewModel3() { this.instantaneousValue = ko.observable(); this.throttledValue = ko.computed(this.instantaneousValue) .extend({ throttle: 400 }); @@ -420,7 +420,7 @@ function test_more() { this.done = ko.observable(done); } - function AppViewModel() { + function AppViewModel4() { this.tasks = ko.observableArray([ new Task('Find new desktop background', true), new Task('Put shiny stickers on laptop', false), @@ -430,7 +430,7 @@ function test_more() { this.doneTasks = this.tasks.filterByProperty("done", true); } - ko.applyBindings(new AppViewModel()); + ko.applyBindings(new AppViewModel4()); this.doneTasks = ko.computed(function () { var all = this.tasks(), done = []; for (var i = 0; i < all.length; i++) @@ -441,7 +441,7 @@ function test_more() { } function test_mappingplugin() { - var viewModel = { + var viewModel0 = { serverTime: ko.observable(), numUsers: ko.observable() } @@ -449,8 +449,8 @@ function test_mappingplugin() { serverTime: '2010-01-07', numUsers: 3 }; - viewModel.serverTime(data.serverTime); - viewModel.numUsers(data.numUsers); + viewModel0.serverTime(data.serverTime); + viewModel0.numUsers(data.numUsers); var viewModel = ko.mapping.fromJS(data); ko.mapping.fromJS(data, viewModel); @@ -526,7 +526,7 @@ function test_misc() { return this; }; - this.myObservable = ko.observable("myValue").publishOn("myTopic"); + this.myObservable = >ko.observable("myValue").publishOn("myTopic"); ko.subscribable.fn.subscribeTo = function (topic) { postbox.subscribe(this, null, topic); @@ -534,7 +534,7 @@ function test_misc() { return this; }; - this.observableFromAnotherVM = ko.observable().subscribeTo("myTopic"); + this.observableFromAnotherVM = >ko.observable().subscribeTo("myTopic"); postbox.subscribe(function (newValue) { this(newValue); From 5cd47a63c4ddd52480a993a117fde20a91ab843e Mon Sep 17 00:00:00 2001 From: JohnDoeKyrgyz Date: Wed, 19 Jun 2013 16:23:50 -0500 Subject: [PATCH 03/57] Update google.maps.d.ts Removing redundant specification of the MVCObject.setValues method. 'undefined' is incompatible with TypeScript 0.9. --- googlemaps/google.maps.d.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/googlemaps/google.maps.d.ts b/googlemaps/google.maps.d.ts index 711f25a25..677155130 100644 --- a/googlemaps/google.maps.d.ts +++ b/googlemaps/google.maps.d.ts @@ -34,7 +34,6 @@ declare module google.maps { notify(key: string): void; set(key: string, value: any): void; setValues(values: any): void; - setValues(values: undefined); unbind(key: string): void; unbindAll(): void; } @@ -1582,4 +1581,4 @@ declare module google.maps { } } -} \ No newline at end of file +} From af07ce5360c529c0bdd86a1ec40c92eb36140af7 Mon Sep 17 00:00:00 2001 From: Basarat Syed Date: Thu, 20 Jun 2013 09:31:14 +1000 Subject: [PATCH 04/57] fixing tests to work with TS0.9 --- angularjs/angular-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/angularjs/angular-tests.ts b/angularjs/angular-tests.ts index 6354e188c..3ea1371f4 100644 --- a/angularjs/angular-tests.ts +++ b/angularjs/angular-tests.ts @@ -142,7 +142,7 @@ module HttpAndRegularPromiseTests { // Test for AngularJS Syntac module My.Namespace { - + export var x; // need to export something for module to kick in } // IModule Registering Test @@ -150,7 +150,7 @@ var mod = angular.module('tests',[]); mod.controller('name', function($scope : ng.IScope) {}) mod.controller('name', ['$scope', function($scope : ng.IScope) {}]) mod.controller(My.Namespace); -mod.directive('name', function($scope : ng.IScope) {}) +mod.directive('name', function ($scope: ng.IScope) {}) mod.directive('name', ['$scope', function($scope : ng.IScope) {}]) mod.directive(My.Namespace); mod.factory('name', function($scope : ng.IScope) {}) From 04cf4f1a68d001e51bfaa8422e4561c8a9fce9d1 Mon Sep 17 00:00:00 2001 From: basarat Date: Thu, 20 Jun 2013 10:04:06 +1000 Subject: [PATCH 05/57] Update angular-resource.d.ts Declare required for TS0.9 --- angularjs/angular-resource.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angularjs/angular-resource.d.ts b/angularjs/angular-resource.d.ts index 21731a36d..37b491d74 100644 --- a/angularjs/angular-resource.d.ts +++ b/angularjs/angular-resource.d.ts @@ -73,7 +73,7 @@ declare module ng.resource { } /** extensions to base ng based on using angular-resource */ -module ng { +declare module ng { interface IModule { /** creating a resource service factory */ From 1b5d125cd6eff9559c9486b8fc6ab4897e18fac3 Mon Sep 17 00:00:00 2001 From: Theodore Brown Date: Wed, 19 Jun 2013 20:59:55 -0500 Subject: [PATCH 06/57] Added definitions and tests for pickadate.js --- README.md | 1 + jquery.pickadate/jquery.pickadate-tests.ts | 400 +++++++++++++++++++++ jquery.pickadate/jquery.pickadate.d.ts | 375 +++++++++++++++++++ 3 files changed, 776 insertions(+) create mode 100644 jquery.pickadate/jquery.pickadate-tests.ts create mode 100644 jquery.pickadate/jquery.pickadate.d.ts diff --git a/README.md b/README.md index 83e4ffbca..960c06c80 100755 --- a/README.md +++ b/README.md @@ -99,6 +99,7 @@ List of Definitions * [jQuery.Globalize](https://github.com/jquery/globalize) (by [Boris Yankov](https://github.com/borisyankov)) * [jQuery.jNotify](http://jnotify.codeplex.com) (by [James Curran](https://github.com/jamescurran/)) * [jQuery.noty](http://needim.github.io/noty/) (by [Aaron King](https://github.com/kingdango/)) +* [jQuery.pickadate](https://github.com/amsul/pickadate.js) (by [Theodore Brown](https://github.com/theodorejb)) * [jQuery.scrollTo](https://github.com/flesler/jquery.scrollTo) (by [Neil Stalker](https://github.com/nestalk/)) * [jQuery.simplePagination](https://github.com/flaviusmatis/simplePagination.js) (by [Natan Vivo](https://github.com/nvivo/)) * [jQuery.timeago](http://timeago.yarp.com/) (by [François Guillot](http://fguillot.developpez.com/)) diff --git a/jquery.pickadate/jquery.pickadate-tests.ts b/jquery.pickadate/jquery.pickadate-tests.ts new file mode 100644 index 000000000..ca68d6e91 --- /dev/null +++ b/jquery.pickadate/jquery.pickadate-tests.ts @@ -0,0 +1,400 @@ +/// + +/* +* Date picker tests +* From http://amsul.ca/pickadate.js/date.htm +*/ + +$('.datepicker').pickadate(); + +$('.datepicker').pickadate({ + weekdaysShort: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'], + showMonthsShort: true +}); + +$('.datepicker').pickadate({ + today: '', + clear: 'Clear selection' +}); + +// Extend the default picker options for all instances. +$.extend($.fn.pickadate.defaults, { + monthsFull: ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre'], + weekdaysShort: ['Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam'], + today: 'aujourd\'hui', + clear: 'effacer', + formatSubmit: 'yyyy/mm/dd' +}); + +// Or, pass the months and weekdays as an array for each invocation. +$('.datepicker').pickadate({ + monthsFull: ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre'], + weekdaysShort: ['Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam'], + today: 'aujourd\'hui', + clear: 'effacer', + formatSubmit: 'yyyy/mm/dd' +}); + +$('.datepicker').pickadate({ + // Escape any "rule" characters with an exclamation mark (!). + format: 'You selecte!d: dddd, dd mmm, yyyy', + formatSubmit: 'yyyy/mm/dd', + hiddenSuffix: '--submit' +}); + +$('.datepicker').pickadate({ + selectYears: true, + selectMonths: true +}); + +$('.datepicker').pickadate({ + // `true` defaults to 10. + selectYears: 4 +}); + +$('.datepicker').pickadate({ + firstDay: 1 +}); + +$('.datepicker').pickadate({ + min: new Date(2013, 3, 20), + max: new Date(2013, 7, 14) +}); + +$('.datepicker').pickadate({ + min: [2013, 3, 20], + max: [2013, 7, 14] +}); + +$('.datepicker').pickadate({ + // An integer (positive/negative) sets it relative to today. + min: -15, + // `true` sets it to today. `false` removes any limits. + max: true +}); + +$('.datepicker').pickadate({ + disable: [ + [2013, 3, 3], + [2013, 3, 12], + [2013, 3, 20], + [2013, 3, 29] + ] +}); + +$('.datepicker').pickadate({ + disable: [ + 1, 4, 7 + ] +}); + +$('.datepicker').pickadate({ + disable: [ + true, + 1, 4, 7, + [2013, 3, 3], + [2013, 3, 12], + [2013, 3, 20], + [2013, 3, 29] + ] +}); + +$('.datepicker').pickadate({ + onStart: function () { + console.log('Hello there :)') + }, + onRender: function () { + console.log('Whoa.. rendered anew') + }, + onOpen: function () { + console.log('Opened up') + }, + onClose: function () { + console.log('Closed now') + }, + onStop: function () { + console.log('See ya.') + }, + onSet: function (event) { + console.log('Just set stuff:', event) + } +}); + +/* +* Time picker tests +* From http://amsul.ca/pickadate.js/time.htm +*/ + +$('.timepicker').pickatime(); + +$('.timepicker').pickatime({ + clear: '' +}); + +$('.timepicker').pickatime({ + // Escape any "rule" characters with an exclamation mark (!). + format: 'T!ime selected: h:i a', + formatLabel: 'h:i a', + formatSubmit: 'HH:i', + hiddenSuffix: '--submit' +}); + +$('.timepicker').pickatime({ + formatLabel: function (time: TimePickerItemObject) { + var hours = (time.pick - this.get('now').pick) / 60, + label = hours < 0 ? ' !hours to now' : hours > 0 ? ' !hours from now' : 'now' + return 'h:i a ' + (hours ? Math.abs(hours).toString() : '') + label + '' + } +}); + +$('.datepicker').pickadate({ + interval: 150 +}); + +$('.timepicker').pickatime({ + min: [7, 30], + max: [14, 0] +}); + +$('.timepicker').pickatime({ + // An integer (positive/negative) sets it as intervals relative from now. + min: -5, + // `true` sets it to now. `false` removes any limits. + max: true +}); + +$('.timepicker').pickatime({ + disable: [ + [0, 30], + [2, 0], + [8, 30], + [9, 0] + ] +}); + +$('.timepicker').pickatime({ + disable: [ + 3, 5, 7 + ] +}); + +$('.timepicker').pickatime({ + disable: [ + true, + 3, 5, 7, + [0, 30], + [2, 0], + [8, 30], + [9, 0] + ] +}); + +$('.timepicker').pickatime({ + onStart: function () { + console.log('Hello there :)') + }, + onRender: function () { + console.log('Whoa.. rendered anew') + }, + onOpen: function () { + console.log('Opened up') + }, + onClose: function () { + console.log('Closed now') + }, + onStop: function () { + console.log('See ya.') + }, + onSet: function (event) { + console.log('Just set stuff:', event) + } +}); + +/* +* API tests +* From http://amsul.ca/pickadate.js/api.htm +*/ + +var $input = $('.datepicker').pickadate(); + +// Use the picker object directly. +var picker = $input.pickadate('picker'); + +picker.open().clear().close(); + +picker.open(); +picker.close(); +picker.close(true); + +picker.open(false) +$(document).on('click', function () { + picker.close() +}); + +picker.start(); +picker.stop(); +picker.render(); +picker.clear(); + +picker.get() // Short for `picker.get('value')` + +picker.get('select'); +picker.get('select', 'yyyy/mm/dd'); + +picker.get('highlight'); +picker.get('highlight', 'yyyy/mm/dd'); + +picker.get('view'); + +picker.get('min'); +picker.get('min', 'yyyy/mm/dd'); +picker.get('max'); +picker.get('max', 'yyyy/mm/dd'); + +picker.get('open'); +picker.get('start'); +picker.get('id'); +picker.get('disable'); + +picker.set('clear'); + +// Using arrays formatted as [YEAR,MONTH,DATE]. +picker.set('select', [2013, 3, 20]); + +// Using JavaScript Date objects. +picker.set('select', new Date(2013,03,20)); + +// Using positive integers as UNIX timestamps. +picker.set('select', 1365961912346); + +// Using arrays formatted as [HOUR,MINUTE]. +picker.set('select', [3, 0]); + +// Using positive integers as minutes. +picker.set('select', 540); + +// Using arrays formatted as [YEAR,MONTH,DATE]. +picker.set('highlight', [2013, 3, 20]); + +// Using JavaScript Date objects. +picker.set('highlight', new Date(2013,7,14)); + +// Using positive integers as UNIX timestamps. +picker.set('highlight', 1365961912346); + +// Using arrays formatted as [HOUR,MINUTE]. +picker.set('highlight', [15, 30]); + +// Using positive integers as minutes. +picker.set('highlight', 1080); + +// Using arrays formatted as [YEAR,MONTH,DATE]. +picker.set('view', [2000, 3, 20]); + +// Using JavaScript Date objects. +picker.set('view', new Date(1988,7,14)); + +// Using positive integers as UNIX timestamps. +picker.set('view', 1587355200000); + +// Using arrays formatted as [HOUR,MINUTE]. +picker.set('view', [15, 30]); + +// Using positive integers as minutes. +picker.set('view', 1080); + +// Using arrays formatted as [YEAR,MONTH,DATE]. +picker.set('min', [2013, 3, 20]); + +// Using JavaScript Date objects. +picker.set('min', new Date(2013,7,14)); + +// Using integers as days relative to today. +picker.set('min', -4); + +// Using `true` for "today". +picker.set('min', true); + +// Using `false` to remove. +picker.set('min', false); + +// Using arrays formatted as [HOUR,MINUTE]. +picker.set('min', [15, 30]); + +// Using integers as intervals relative from now. +picker.set('min', -4); + +// Using `true` for "now". +picker.set('min', true); + +// Using `false` to remove. +picker.set('min', false); + +// Using arrays formatted as [YEAR,MONTH,DATE]. +picker.set('max', [2013, 3, 20]); + +// Using JavaScript Date objects. +picker.set('max', new Date(2013,7,14)); + +// Using integers as days relative to today. +picker.set('max', 4); + +// Using `true` for "today". +picker.set('max', true); + +// Using `false` to remove. +picker.set('max', false); + +// Using arrays formatted as [HOUR,MINUTE]. +picker.set('max', [15, 30]); + +// Using integers as intervals relative from now. +picker.set('max', 4); + +// Using `true` for "now". +picker.set('max', true); + +// Using `false` to remove. +picker.set('max', false); + +picker.on('open', function () { + console.log('Opened.. and here I am!'); +}); + +picker.on({ + open: function () { + console.log('Opened.. and here I am!'); + }, + close: function () { + console.log('Closed.. and here I am!'); + } +}); + +$('.datepicker').pickadate({ + onOpen: function () { + console.log('Opened up!') + }, + onClose: function () { + console.log('Closed now') + }, + onRender: function () { + console.log('Just rendered anew') + }, + onStart: function () { + console.log('Hello there :)') + }, + onStop: function () { + console.log('See ya') + }, + onSet: function (event) { + console.log('Set stuff:', event) + } +}); + +picker.on('open', function () { + console.log('Didn't open.. yet here I am!'); +}) +picker.trigger('open'); + +picker.$node; +picker.$root; \ No newline at end of file diff --git a/jquery.pickadate/jquery.pickadate.d.ts b/jquery.pickadate/jquery.pickadate.d.ts new file mode 100644 index 000000000..0de785108 --- /dev/null +++ b/jquery.pickadate/jquery.pickadate.d.ts @@ -0,0 +1,375 @@ +// Type definitions for pickadate.js 3.0.5 +// Project: https://github.com/amsul/pickadate.js +// Definitions by: Theodore Brown +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +interface pickadateOptions { + // Strings and translations + monthsFull?: string[]; // default 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' + monthsShort?: string[]; // default 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' + weekdaysFull?: string[]; // default 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' + weekdaysShort?: string[]; // default 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' + showMonthsShort?: boolean; + showWeekdaysFull?: boolean; + + // Buttons + today?: string; // default 'Today' + clear?: string; // default 'Clear' + + // Formats + format?: string; // default 'd mmmm, yyyy' + formatSubmit?: string; // e.g. 'yyyy/mm/dd' + hiddenSuffix?: string; // default '_submit' + + // Dropdown selectors + selectYears?: any; // Specify the number of years selectable using an even integer - half before and half after the year in focus: + selectMonths?: boolean; + + // First day of the week + firstDay?: any; // The first day of the week can be set to either Sunday or Monday. Anything truth-y sets it as Monday and anything false-y as Sunday + + // Date limits + min?: any; // date object, array formatted as [YEAR,MONTH,DATE], or dates relative to today using integers or a boolean (`true` sets it to today. `false` removes any limits). + max?: any; + + // Disable dates + disable?: any[]; // arrays formatted as [YEAR,MONTH,DATE] or integers representing days of the week (from 1 to 7). Switch to whitelist by setting first item in collection to `true`. + + // Events + onStart?: (event: any) => void; + onRender?: (event: any) => void; + onOpen?: (event: any) => void; + onClose?: (event: any) => void; + onSet?: (event: any) => void; + onStop?: (event: any) => void; + + // Classes + klass?: { + + // The element states + input?: string; // default 'picker__input' + active?: string; // default 'picker__input--active' + + // The root picker and states + picker?: string; // default 'picker' + opened?: string; // default 'picker--opened' + focused?: string; // default 'picker--focused' + + // The picker holder + holder?: string; // default 'picker__holder' + + // The picker frame, wrapper, and box + frame?: string; // default 'picker__frame' + wrap?: string; // default 'picker__wrap' + box?: string; // default 'picker__box' + + // The picker header + header?: string; // default 'picker__header' + + // Month navigation + navPrev?: string; // default 'picker__nav--prev' + navNext?: string; // default 'picker__nav--next' + navDisabled?: string; // default 'picker__nav--disabled' + + // Month & year labels + month?: string; // default 'picker__month' + year?: string; // default 'picker__year' + + // Month & year dropdowns + selectMonth?: string; // default 'picker__select--month' + selectYear?: string; // default 'picker__select--year' + + // Table of dates + table?: string; // default 'picker__table' + + // Weekday labels + weekdays?: string; // default 'picker__weekday' + + // Day states + day?: string; // default 'picker__day' + disabled?: string; // default 'picker__day--disabled' + selected?: string // default 'picker__day--selected' + highlighted?: string // default 'picker__day--highlighted' + now?: string; // default 'picker__day--today' + infocus?: string; // default 'picker__day--infocus' + outfocus?: string; // default 'picker__day--outfocus' + + // The picker footer + footer?: string; // default 'picker__footer' + + // Today & clear buttons + buttonClear?: string; // default 'picker__button--clear' + buttonToday?: string; // default 'picker__button--today' + } +} + +interface pickatimeOptions { + // Translations and clear button + clear?: string; // default 'Clear' + + // Formats + format?: string; // default 'h:i A' + formatLabel?: any; + formatSubmit?: string; + hiddenSuffix?: string; // default '_submit' + + // Time intervals + interval?: number; // interval in minutes. default 30. + + // Time limits + min?: any; // array formatted as [HOUR,MINUTE], or as times relative to now using integers or a boolean (`true` sets it to now, `false` removes any limits). + max?: any; + + // Disable times + disable?: any[]; // arrays formatted as [HOUR,MINUTE] or integers representing hours (from 0 to 23). Switch to whitelist by setting true as the first item in the collection. + + // Events + onStart?: (event: any) => void; + onRender?: (event: any) => void; + onOpen?: (event: any) => void; + onClose?: (event: any) => void; + onSet?: (event: any) => void; + onStop?: (event: any) => void; + + // Classes + klass?: { + + // The element states + input?: string; // default 'picker__input' + active?: string; // default 'picker__input--active' + + // The root picker and states + picker?: string; // default 'picker picker--time' + opened?: string; // default 'picker--opened' + focused?: string; // default 'picker--focused' + + // The picker holder + holder?: string; // default 'picker__holder' + + // The picker frame, wrapper, and box + frame?: string; // default 'picker__frame' + wrap?: string; // default 'picker__wrap' + box?: string; // default 'picker__box' + + // List of times + list?: string; // default 'picker__list' + listItem?: string; // default 'picker__list-item' + + // Time states + disabled?: string; // default 'picker__list-item--disabled' + selected?: string; // default 'picker__list-item--selected' + highlighted?: string; // default 'picker__list-item--highlighted' + viewset?: string; // default 'picker__list-item--viewset' + now?: string; // default 'picker__list-item--now' + + // Clear button + buttonClear?: string; // default 'picker__button--clear' + } +} + +interface PickerItemObject { + /** The "pick" value used for comparisons. */ + pick: number; +} + +interface DatePickerItemObject extends PickerItemObject { + /** The full year. */ + year: number; + + /** The month with zero-as-index. */ + month: number; + + /** The date of the month. */ + date: number; + + /** The day of the week with zero-as-index. */ + day: number; + + /** The underlying JavaScript Date object. */ + obj: Date; +} + +interface TimePickerItemObject extends PickerItemObject { + /** Hour of the day from 0 to 23. */ + hour: number; + + /** The minutes of the hour from 0 to 59 (based on the interval). */ + mins: number; +} + +interface CallbackObject { + open?: () => void; + close?: () => void; + render?: () => void; + start?: () => void; + stop?: () => void; + set?: () => void; +} + +interface SetThings { + clear?; + select?: any; + highlight?: any; + view?: any; + min?: any; + max?: any; + disable?: any; + enable?: any; +} + +interface TimePickerSetThings extends SetThings { + interval?: any; +} + +interface PickerObject { + /** The picker's relative input element wrapped as a jQuery object. */ + $node: JQuery; + + /** The picker's relative root holder element wrapped as a jQuery object. */ + $root: JQuery; +} + +interface DatePickerObject extends PickerObject { + open(withoutFocus?: boolean): DatePickerObject; + close(withFocus?: boolean): DatePickerObject; + + /** Rebuild the picker. */ + start(): DatePickerObject; + + /** Destroy the picker. */ + stop(): DatePickerObject; + + /** Refresh the picker after adding something to the holder. */ + render(): DatePickerObject; + + /** Clear the value in the picker's input element. */ + clear(): DatePickerObject; + + /** Get the properties, objects, and states that make up the current state of the picker. */ + get(thing: string): any; + + /** Returns the string value of the picker's input element. */ + get(thing?: 'value'): string; + + /** Returns the item object that is visually selected. */ + get(thing: 'select'): DatePickerItemObject; + + /** Returns the item object that is visually highlighted. */ + get(thing: 'highlight'): DatePickerItemObject; + + /** Returns the item object that sets the current view. */ + get(thing: 'view'): DatePickerItemObject; + + /** Returns the item object that limits the picker�s lower range. */ + get(thing: 'min'): DatePickerItemObject; + + /** Returns the item object that limits the picker�s upper range. */ + get(thing: 'max'): DatePickerItemObject; + + /** Returns a boolean value of whether the picker is open or not. */ + get(thing: 'open'): boolean; + + /** Returns a boolean value of whether the picker has started or not. */ + get(thing: 'start'): boolean; + + /** Returns a unique 9-digit integer that is the ID of the picker. */ + get(thing: 'id'): number; + + /** Returns an array of items that determine which item objects to disable on the picker. */ + get(thing: 'disable'): any[]; + + /** Returns a formatted string for the item object specified by `thing` */ + get(thing: string, format: string): string; + + /** Set the properties, objects, and states to change the state of the picker. */ + set(thing: string, value?: any): DatePickerObject; + set(things: SetThings): DatePickerObject; + + /** Bind callbacks to get fired off when the relative picker method is called. */ + on(methodName, callback: () => void ): DatePickerObject; + + /** Bind multiple callbacks at once to get fired off when the relative picker method is called. */ + on(callbackObject: CallbackObject): DatePickerObject; + + /** Trigger callbacks that have been queued up using the the on method. */ + trigger(event: string): DatePickerObject; +} + +interface TimePickerObject extends PickerObject { + open(withoutFocus?: boolean): TimePickerObject; + close(withFocus?: boolean): TimePickerObject; + + /** Rebuild the picker. */ + start(): TimePickerObject; + + /** Destroy the picker. */ + stop(): TimePickerObject; + + /** Refresh the picker after adding something to the holder. */ + render(): TimePickerObject; + + /** Clear the value in the picker�s input element. */ + clear(): TimePickerObject; + + /** Get the properties, objects, and states that make up the current state of the picker. */ + get(thing: string): any; + + /** Returns the string value of the picker�s input element. */ + get(thing?: 'value'): string; + + /** Returns the item object that is visually selected. */ + get(thing: 'select'): TimePickerItemObject; + + /** Returns the item object that is visually highlighted. */ + get(thing: 'highlight'): TimePickerItemObject; + + /** Returns the item object that sets the current view. */ + get(thing: 'view'): TimePickerItemObject; + + /** Returns the item object that limits the picker�s lower range. */ + get(thing: 'min'): TimePickerItemObject; + + /** Returns the item object that limits the picker�s upper range. */ + get(thing: 'max'): TimePickerItemObject; + + /** Returns a boolean value of whether the picker is open or not. */ + get(thing: 'open'): boolean; + + /** Returns a boolean value of whether the picker has started or not. */ + get(thing: 'start'): boolean; + + /** Returns a unique 9-digit integer that is the ID of the picker. */ + get(thing: 'id'): number; + + /** Returns an array of items that determine which item objects to disable on the picker. */ + get(thing: 'disable'): any[]; + + /** Returns a formatted string for the item object specified by `thing` */ + get(thing: string, format: string): string; + + /** Set the properties, objects, and states to change the state of the picker. */ + set(thing: string, value?: any): TimePickerObject; + set(things: TimePickerSetThings): TimePickerObject; + + /** Bind callbacks to get fired off when the relative picker method is called. */ + on(methodName, callback: () => void ): TimePickerObject; + + /** Bind multiple callbacks at once to get fired off when the relative picker method is called. */ + on(callbackObject: CallbackObject): TimePickerObject; + + /** Trigger callbacks that have been queued up using the the on method. */ + trigger(event: string): TimePickerObject; +} + +interface JQuery { + pickadate(options?: pickadateOptions): HTMLInputElement; + pickatime(options?: pickatimeOptions): HTMLInputElement; +} + +interface HTMLInputElement { + pickadate(picker: string): DatePickerObject; + pickatime(picker: string): TimePickerObject; + +} \ No newline at end of file From 1aac9b34369dc37a39fab51542dfe9637ac32d5a Mon Sep 17 00:00:00 2001 From: Andrew Gaspar Date: Wed, 19 Jun 2013 23:03:20 -0700 Subject: [PATCH 07/57] Updated node definition to make assert a fundule. --- node/node.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/node/node.d.ts b/node/node.d.ts index 565263d03..e55b7f3c5 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -312,7 +312,7 @@ declare module "cluster" { } export interface Worker { id: string; - process: child_process; + process: child_process.ChildProcess; suicide: boolean; send(message: any, sendHandle?: any): void; destroy(): void; @@ -1018,8 +1018,8 @@ declare module "util" { export function inherits(constructor: any, superConstructor: any): void; } -declare module "assert" { - export function (booleanValue: boolean, message?: string); +declare function assert(booleanValue: boolean, message?: string); +declare module "assert" { export function fail(actual: any, expected: any, message: string, operator: string): void; export function assert(value: any, message: string): void; export function ok(value: any, message?: string): void; From 3d190b9b50272be69a4ac357cc111c137007c723 Mon Sep 17 00:00:00 2001 From: Andrew Gaspar Date: Wed, 19 Jun 2013 23:06:03 -0700 Subject: [PATCH 08/57] Made assert module a fundule. --- node/node.d.ts | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/node/node.d.ts b/node/node.d.ts index e55b7f3c5..2fbd81e55 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -1018,20 +1018,24 @@ declare module "util" { export function inherits(constructor: any, superConstructor: any): void; } -declare function assert(booleanValue: boolean, message?: string); -declare module "assert" { - export function fail(actual: any, expected: any, message: string, operator: string): void; - export function assert(value: any, message: string): void; - export function ok(value: any, message?: string): void; - export function equal(actual: any, expected: any, message?: string): void; - export function notEqual(actual: any, expected: any, message?: string): void; - export function deepEqual(actual: any, expected: any, message?: string): void; - export function notDeepEqual(acutal: any, expected: any, message?: string): void; - export function strictEqual(actual: any, expected: any, message?: string): void; - export function notStrictEqual(actual: any, expected: any, message?: string): void; - export function throws(block: any, error?: any, messsage?: string): void; - export function doesNotThrow(block: any, error?: any, messsage?: string): void; - export function ifError(value: any): void; +declare module "assert" { + function internal (booleanValue: boolean, message?: string): void; + module internal { + export function fail(actual: any, expected: any, message: string, operator: string): void; + export function assert(value: any, message: string): void; + export function ok(value: any, message?: string): void; + export function equal(actual: any, expected: any, message?: string): void; + export function notEqual(actual: any, expected: any, message?: string): void; + export function deepEqual(actual: any, expected: any, message?: string): void; + export function notDeepEqual(acutal: any, expected: any, message?: string): void; + export function strictEqual(actual: any, expected: any, message?: string): void; + export function notStrictEqual(actual: any, expected: any, message?: string): void; + export function throws(block: any, error?: any, messsage?: string): void; + export function doesNotThrow(block: any, error?: any, messsage?: string): void; + export function ifError(value: any): void; + } + + export = internal; } declare module "tty" { From a615315e63d0482e6ab0cfe443064f14d69cf260 Mon Sep 17 00:00:00 2001 From: Andrew Gaspar Date: Wed, 19 Jun 2013 23:18:45 -0700 Subject: [PATCH 09/57] Merged q.d.ts and q.module.d.ts using new semantics for export = . Hoozah! --- q/Q-tests.ts | 2 ++ q/Q.d.ts | 58 +++++++++++++++++++++++++-------------------- q/q.module-tests.ts | 32 +++++++++++++------------ q/q.module.d.ts | 31 ------------------------ 4 files changed, 51 insertions(+), 72 deletions(-) delete mode 100644 q/q.module.d.ts diff --git a/q/Q-tests.ts b/q/Q-tests.ts index 34cde9341..65a19d008 100644 --- a/q/Q-tests.ts +++ b/q/Q-tests.ts @@ -1,5 +1,7 @@ /// +Q(8).then(x => console.log(x)); + var delay = function (delay) { var d = Q.defer(); setTimeout(d.resolve, delay); diff --git a/q/Q.d.ts b/q/Q.d.ts index 15f3fdea7..f1835241d 100644 --- a/q/Q.d.ts +++ b/q/Q.d.ts @@ -35,30 +35,36 @@ interface Qpromise { valueOf(): any; } -interface QStatic { - when(value: any, onFulfilled?: Function, onRejected?: Function): Qpromise; - try(method: Function, ...args: any[]): Qpromise; - fbind(method: Function, ...args: any[]): Qpromise; - fcall(method: Function, ...args: any[]): Qpromise; - all(promises: Qpromise[]): Qpromise; - allResolved(promises: Qpromise[]): Qpromise; - resolve(object:any):Qpromise; - spread(onFulfilled: Function, onRejected: Function): Qpromise; - timeout(ms: number): Qpromise; - delay(ms: number): Qpromise; - delay(value: any, ms: number): Qpromise; - isFulfilled(): bool; - isRejected(): bool; - isPending(): bool; - valueOf(): any; - defer(): Qdeferred; - (value: any): Qpromise; - reject(): Qpromise; - promise(factory: { resolve: Function; reject: Function; notify: Function; }): Qpromise; - isPromise(value: any): bool; - async(generatorFunction: any): Qdeferred; - nextTick(callback: Function); - oneerror: any; - longStackJumpLimit: number; +declare function Q(value: any): Qpromise; +declare module Q { + export function when(value: any, onFulfilled: Function, onRejected?: Function): Qpromise; + //export function try(method: Function, ...args: any[]): Qpromise; <- This is broken currently - not sure how to fix. + export function fbind(method: Function, ...args: any[]): Qpromise; + export function fcall(method: Function, ...args: any[]): Qpromise; + export function nfbind(nodeFunction: Function): (...args: any[]) => Qpromise; + export function nfcall(nodeFunction: Function, ...args: any[]): Qpromise; + export function ninvoke(nodeModule: any, functionName: string, ...args: any[]): Qpromise; + export function all(promises: Qpromise[]): Qpromise; + export function allResolved(promises: Qpromise[]): Qpromise; + export function spread(onFulfilled: Function, onRejected: Function): Qpromise; + export function timeout(ms: number): Qpromise; + export function delay(ms: number): Qpromise; + export function delay(value: any, ms: number): Qpromise; + export function isFulfilled(): bool; + export function isRejected(): bool; + export function isPending(): bool; + export function valueOf(): any; + export function defer(): Qdeferred; + export function reject(): Qpromise; + export function promise(factory: { resolve: Function; reject: Function; notify: Function; }): Qpromise; + export function isPromise(value: any): bool; + export function async(generatorFunction: any): Qdeferred; + export function nextTick(callback: Function); + export var oneerror: any; + export var longStackJumpLimit: number; + export function resolve(object?: Qpromise); } -declare var Q: QStatic; + +declare module "q" { + export = Q; +} \ No newline at end of file diff --git a/q/q.module-tests.ts b/q/q.module-tests.ts index 4f9039d23..2d32febca 100644 --- a/q/q.module-tests.ts +++ b/q/q.module-tests.ts @@ -1,30 +1,32 @@ -/// +/// /// /// -import Q = module("q"); +import q = module("q"); import fs = module("fs"); +q(8).then(x => console.log(x)); + var delay = function (delay) { - var d = Q.defer(); + var d = q.defer(); setTimeout(d.resolve, delay); return d.promise; }; -Q.when(delay(1000), function () { +q.when(delay(1000), function () { console.log('Hello, World!'); }); var eventually = function (eventually) { - return Q.delay(eventually, 1000); + return q.delay(eventually, 1000); }; -var x = Q.all([1, 2, 3].map(eventually)); -Q.when(x, function (x) { +var x = q.all([1, 2, 3].map(eventually)); +q.when(x, function (x) { console.log(x); }); -Q.all([ +q.all([ eventually(10), eventually(20) ]) @@ -32,7 +34,7 @@ Q.all([ console.log(x, y); }); -Q.fcall(function () { }) +q.fcall(function () { }) .then(function () { }) .then(function () { }) .then(function () { }) @@ -42,7 +44,7 @@ Q.fcall(function () { }) // Handle any error from step1 through step4 }).done(); -Q.allResolved([]) +q.allResolved([]) .then(function (promises: Qpromise[]) { promises.forEach(function (promise) { if (promise.isFulfilled()) { @@ -55,20 +57,20 @@ Q.allResolved([]) var initialVal: any; var funcs = ['foo', 'bar', 'baz', 'qux']; -var result = Q.resolve(initialVal); +var result = q.resolve(initialVal); funcs.forEach(function (f) { result = result.then(f); }); var replaceText = (text: string) => text.replace("a", "b"); -Q.nfcall(fs.readFile, "foo.txt", "utf-8").then(replaceText); +q.nfcall(fs.readFile, "foo.txt", "utf-8").then(replaceText); -Q.ninvoke(fs, "readFile", "foo.txt", "utf-8").then(replaceText); +q.ninvoke(fs, "readFile", "foo.txt", "utf-8").then(replaceText); -var deferred = Q.defer(); +var deferred = q.defer(); fs.readFile("foo.txt", "utf-8", deferred.makeNodeResolver()); deferred.promise.then(replaceText); -var readFile = Q.nfbind(fs.readFile); +var readFile = q.nfbind(fs.readFile); readFile("foo.txt", "utf-8").then(replaceText); \ No newline at end of file diff --git a/q/q.module.d.ts b/q/q.module.d.ts deleted file mode 100644 index 98e1dd9dc..000000000 --- a/q/q.module.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -/// - -declare module "q" { - export function when(value: any, onFulfilled: Function, onRejected?: Function): Qpromise; - export function try(method: Function, ...args: any[]): Qpromise; - export function fbind(method: Function, ...args: any[]): Qpromise; - export function fcall(method: Function, ...args: any[]): Qpromise; - export function nfbind(nodeFunction: Function): (...args: any[]) => Qpromise; - export function nfcall(nodeFunction: Function, ...args: any[]): Qpromise; - export function ninvoke(nodeModule: any, functionName: string, ...args: any[]): Qpromise; - export function all(promises: Qpromise[]): Qpromise; - export function allResolved(promises: Qpromise[]): Qpromise; - export function spread(onFulfilled: Function, onRejected: Function): Qpromise; - export function timeout(ms: number): Qpromise; - export function delay(ms: number): Qpromise; - export function delay(value: any, ms: number): Qpromise; - export function isFulfilled(): bool; - export function isRejected(): bool; - export function isPending(): bool; - export function valueOf(): any; - export function defer(): Qdeferred; - export function (value: any): Qpromise; - export function reject(): Qpromise; - export function promise(factory: { resolve: Function; reject: Function; notify: Function; }): Qpromise; - export function isPromise(value: any): bool; - export function async(generatorFunction: any): Qdeferred; - export function nextTick(callback: Function); - export var oneerror: any; - export var longStackJumpLimit: number; - export function resolve(object?:Qpromise); -} \ No newline at end of file From a1223529d4a43f171861ea629c06062e19cf5bf1 Mon Sep 17 00:00:00 2001 From: Andrew Gaspar Date: Wed, 19 Jun 2013 23:30:21 -0700 Subject: [PATCH 10/57] Updated q so that the interfaces fell underneath the modules --- q/Q-tests.ts | 2 +- q/Q.d.ts | 102 ++++++++++++++++++++++---------------------- q/q.module-tests.ts | 3 +- 3 files changed, 53 insertions(+), 54 deletions(-) diff --git a/q/Q-tests.ts b/q/Q-tests.ts index 65a19d008..cd3cc653e 100644 --- a/q/Q-tests.ts +++ b/q/Q-tests.ts @@ -40,7 +40,7 @@ Q.fcall(function () { }) }).done(); Q.allResolved([]) -.then(function (promises: Qpromise[]) { +.then(function (promises: Q.Promise[]) { promises.forEach(function (promise) { if (promise.isFulfilled()) { var value = promise.valueOf(); diff --git a/q/Q.d.ts b/q/Q.d.ts index f1835241d..a0ecb75ce 100644 --- a/q/Q.d.ts +++ b/q/Q.d.ts @@ -1,68 +1,68 @@ // Type definitions for Q // Project: https://github.com/kriskowal/q -// Definitions by: Barrie Nemetchek +// Definitions by: Barrie Nemetchek, Andrew Gaspar // Definitions: https://github.com/borisyankov/DefinitelyTyped -interface Qdeferred { - promise: Qpromise; - resolve(value: any): any; - reject(reason: any); - notify(value: any); - makeNodeResolver(): () => void; -} - -interface Qpromise { - fail(errorCallback: Function): Qpromise; - fin(finallyCallback: Function): Qpromise; - then(onFulfilled?: Function, onRejected?: Function, onProgress?: Function): Qpromise; - spread(onFulfilled: Function, onRejected?: Function): Qpromise; - catch(onRejected: Function): Qpromise; - progress(onProgress: Function): Qpromise; - done(onFulfilled?: Function, onRejected?: Function, onProgress?: Function): Qpromise; - get (propertyName: String): Qpromise; - set (propertyName: String, value: any): Qpromise; - delete (propertyName: String): Qpromise; - post(methodName: String, args: any[]): Qpromise; - invoke(methodName: String, ...args: any[]): Qpromise; - keys(): Qpromise; - fapply(args: any[]): Qpromise; - fcall(method: Function, ...args: any[]): Qpromise; - timeout(ms: number): Qpromise; - delay(ms: number): Qpromise; - isFulfilled(): bool; - isRejected(): bool; - isPending(): bool; - valueOf(): any; -} - -declare function Q(value: any): Qpromise; +declare function Q(value: any): Q.Promise; declare module Q { - export function when(value: any, onFulfilled: Function, onRejected?: Function): Qpromise; + interface Deferred { + promise: Promise; + resolve(value: any): any; + reject(reason: any); + notify(value: any); + makeNodeResolver(): () => void; + } + + interface Promise { + fail(errorCallback: Function): Promise; + fin(finallyCallback: Function): Promise; + then(onFulfilled?: Function, onRejected?: Function, onProgress?: Function): Promise; + spread(onFulfilled: Function, onRejected?: Function): Promise; + catch(onRejected: Function): Promise; + progress(onProgress: Function): Promise; + done(onFulfilled?: Function, onRejected?: Function, onProgress?: Function): Promise; + get(propertyName: String): Promise; + set(propertyName: String, value: any): Promise; + delete(propertyName: String): Promise; + post(methodName: String, args: any[]): Promise; + invoke(methodName: String, ...args: any[]): Promise; + keys(): Promise; + fapply(args: any[]): Promise; + fcall(method: Function, ...args: any[]): Promise; + timeout(ms: number): Promise; + delay(ms: number): Promise; + isFulfilled(): bool; + isRejected(): bool; + isPending(): bool; + valueOf(): any; + } + + export function when(value: any, onFulfilled: Function, onRejected?: Function): Promise; //export function try(method: Function, ...args: any[]): Qpromise; <- This is broken currently - not sure how to fix. - export function fbind(method: Function, ...args: any[]): Qpromise; - export function fcall(method: Function, ...args: any[]): Qpromise; - export function nfbind(nodeFunction: Function): (...args: any[]) => Qpromise; - export function nfcall(nodeFunction: Function, ...args: any[]): Qpromise; - export function ninvoke(nodeModule: any, functionName: string, ...args: any[]): Qpromise; - export function all(promises: Qpromise[]): Qpromise; - export function allResolved(promises: Qpromise[]): Qpromise; - export function spread(onFulfilled: Function, onRejected: Function): Qpromise; - export function timeout(ms: number): Qpromise; - export function delay(ms: number): Qpromise; - export function delay(value: any, ms: number): Qpromise; + export function fbind(method: Function, ...args: any[]): Promise; + export function fcall(method: Function, ...args: any[]): Promise; + export function nfbind(nodeFunction: Function): (...args: any[]) => Promise; + export function nfcall(nodeFunction: Function, ...args: any[]): Promise; + export function ninvoke(nodeModule: any, functionName: string, ...args: any[]): Promise; + export function all(promises: Promise[]): Promise; + export function allResolved(promises: Promise[]): Promise; + export function spread(onFulfilled: Function, onRejected: Function): Promise; + export function timeout(ms: number): Promise; + export function delay(ms: number): Promise; + export function delay(value: any, ms: number): Promise; export function isFulfilled(): bool; export function isRejected(): bool; export function isPending(): bool; export function valueOf(): any; - export function defer(): Qdeferred; - export function reject(): Qpromise; - export function promise(factory: { resolve: Function; reject: Function; notify: Function; }): Qpromise; + export function defer(): Deferred; + export function reject(): Promise; + export function promise(factory: { resolve: Function; reject: Function; notify: Function; }): Promise; export function isPromise(value: any): bool; - export function async(generatorFunction: any): Qdeferred; + export function async(generatorFunction: any): Deferred; export function nextTick(callback: Function); export var oneerror: any; export var longStackJumpLimit: number; - export function resolve(object?: Qpromise); + export function resolve(object?: Promise); } declare module "q" { diff --git a/q/q.module-tests.ts b/q/q.module-tests.ts index 2d32febca..fe4764e76 100644 --- a/q/q.module-tests.ts +++ b/q/q.module-tests.ts @@ -44,8 +44,7 @@ q.fcall(function () { }) // Handle any error from step1 through step4 }).done(); -q.allResolved([]) -.then(function (promises: Qpromise[]) { +q.allResolved([]).then(function (promises) { promises.forEach(function (promise) { if (promise.isFulfilled()) { var value = promise.valueOf(); From a75e524aeb4a16835943122770f51ce2ee5c450c Mon Sep 17 00:00:00 2001 From: Basarat Syed Date: Thu, 20 Jun 2013 16:42:58 +1000 Subject: [PATCH 11/57] chai working with TS0.9 --- chai/chai-tests.ts | 1 + chai/chai.d.ts | 182 ++++++++++++++++++++++----------------------- 2 files changed, 92 insertions(+), 91 deletions(-) diff --git a/chai/chai-tests.ts b/chai/chai-tests.ts index ab26aadbc..3774e3895 100644 --- a/chai/chai-tests.ts +++ b/chai/chai-tests.ts @@ -1,5 +1,6 @@ /// +var chai: chai; var expect = chai.expect; function test_be() { diff --git a/chai/chai.d.ts b/chai/chai.d.ts index 5034b8153..806d20c3f 100644 --- a/chai/chai.d.ts +++ b/chai/chai.d.ts @@ -3,120 +3,120 @@ // Definitions by: Kazi Manzur Rashid // DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped -declare module chai { - interface Equality { - (expected: any, message?: string): bool; - } +interface Equality { + (expected: any, message?: string): bool; +} - interface Property { - (name: string, value?: any, message?: string): bool; - } +interface Property { + (name: string, value?: any, message?: string): bool; +} - interface NumberComparer { - (value: number, message?: string): bool; - } +interface NumberComparer { + (value: number, message?: string): bool; +} - interface Eql { - (value: any, message?: string): bool; - } +interface Eql { + (value: any, message?: string): bool; +} - interface Include { - (value: Object, message?: string): bool; - (value: string, message?: string): bool; - (value: number, message?: string): bool; - keys(...names: string[]): bool; - } +interface Include { + (value: Object, message?: string): bool; + (value: string, message?: string): bool; + (value: number, message?: string): bool; + keys(...names: string[]): bool; +} - interface Throw { - (constructor: Error, message?: string); - (expected: string, message?: string); - (expected: RegExp, message?: string); - } +interface Throw { + (constructor: Error, message?: string); + (expected: string, message?: string); + (expected: RegExp, message?: string); +} - interface TypeComparison { - (type: string, message?: string): bool; - instanceof(type: Object): bool; - } +interface TypeComparison { + (type: string, message?: string): bool; + instanceof(type: Object): bool; +} - interface NumericComparison { - above: NumberComparer; - gt: NumberComparer; - greaterThan: NumberComparer; +interface NumericComparison { + above: NumberComparer; + gt: NumberComparer; + greaterThan: NumberComparer; - below: NumberComparer; - lt: NumberComparer; - lessThan: NumberComparer; - } + below: NumberComparer; + lt: NumberComparer; + lessThan: NumberComparer; +} - interface Length extends NumericComparison { - (value: number, message?: string): bool; - } +interface Length extends NumericComparison { + (value: number, message?: string): bool; +} - interface Deep { - equal: Equality; - property: Property; - } +interface Deep { + equal: Equality; + property: Property; +} - interface Have { - property: Property; - deep: Deep; - length: Length; - ownProperty(name: string, message?: string): bool; - string(value: string, message?: string): bool; - keys(...values: string[]): bool; - } +interface Have { + property: Property; + deep: Deep; + length: Length; + ownProperty(name: string, message?: string): bool; + string(value: string, message?: string): bool; + keys(...values: string[]): bool; +} - interface At { - least(value: number, message?: string): bool; - gte(value: number, message?: string): bool; - most(value: number, message?: string): bool; - lte(value: number, message?: string): bool; - } +interface At { + least(value: number, message?: string): bool; + gte(value: number, message?: string): bool; + most(value: number, message?: string): bool; + lte(value: number, message?: string): bool; +} - interface Be extends NumericComparison { - ok: bool; - true: bool; - false: bool; - null: bool; - undefined: bool; - empty: bool; - arguments: bool; - an: TypeComparison; - at: At; +interface Be extends NumericComparison { + ok: bool; + true: bool; + false: bool; + null: bool; + undefined: bool; + empty: bool; + arguments: bool; + an: TypeComparison; + at: At; - a(type: string, message?: string): bool; - within(start: number, finish: number, message?: string): bool; - closeTo(expected: number, delta: number, message?: string): bool; - } + a(type: string, message?: string): bool; + within(start: number, finish: number, message?: string): bool; + closeTo(expected: number, delta: number, message?: string): bool; +} - interface To { - be: Be; - not: To; - deep: Deep; - have: Have; +interface To { + be: Be; + not: To; + deep: Deep; + have: Have; - exist: bool; + exist: bool; - equal: Equality; + equal: Equality; - include: Include; - contain: Include; - throw: Throw; + include: Include; + contain: Include; + throw: Throw; - eql: Eql; - eqls: Eql; + eql: Eql; + eqls: Eql; - match(value: RegExp, message?: string): bool; + match(value: RegExp, message?: string): bool; - respondTo(method: string, message?: string); - satisfy(matcher: Function, message?: string); - } + respondTo(method: string, message?: string); + satisfy(matcher: Function, message?: string); +} - interface ExpectMatchers { - to: To; - } +interface ExpectMatchers { + to: To; +} - var expect : { +interface chai{ + expect: { (target: any): ExpectMatchers; } } \ No newline at end of file From c37c38a984be1458edf7bec61012a2090ccb813f Mon Sep 17 00:00:00 2001 From: Andrew Gaspar Date: Thu, 20 Jun 2013 00:36:26 -0700 Subject: [PATCH 12/57] Added basic typings on q. TypeScript compiler bugs and spec limitations hinder full typing. --- q/Q-tests.ts | 8 ++--- q/Q.d.ts | 75 +++++++++++++++++++++++---------------------- q/q.module-tests.ts | 4 +-- 3 files changed, 44 insertions(+), 43 deletions(-) diff --git a/q/Q-tests.ts b/q/Q-tests.ts index cd3cc653e..b04067003 100644 --- a/q/Q-tests.ts +++ b/q/Q-tests.ts @@ -1,6 +1,6 @@ /// -Q(8).then(x => console.log(x)); +Q(8).then(x => console.log(x.toExponential())); var delay = function (delay) { var d = Q.defer(); @@ -24,11 +24,11 @@ Q.when(x, function (x) { Q.all([ eventually(10), eventually(20) -]) -.spread(function (x, y) { +]).spread(function (x, y) { console.log(x, y); }); + Q.fcall(function () { }) .then(function () { }) .then(function () { }) @@ -40,7 +40,7 @@ Q.fcall(function () { }) }).done(); Q.allResolved([]) -.then(function (promises: Q.Promise[]) { +.then(function (promises: Q.Promise[]) { promises.forEach(function (promise) { if (promise.isFulfilled()) { var value = promise.valueOf(); diff --git a/q/Q.d.ts b/q/Q.d.ts index a0ecb75ce..25ed1b8e8 100644 --- a/q/Q.d.ts +++ b/q/Q.d.ts @@ -3,66 +3,67 @@ // Definitions by: Barrie Nemetchek, Andrew Gaspar // Definitions: https://github.com/borisyankov/DefinitelyTyped -declare function Q(value: any): Q.Promise; +declare function Q(value: T): Q.Promise; +//declare function Q(value: Q.Promise): Q.Promise declare module Q { - interface Deferred { - promise: Promise; + interface Deferred { + promise: Promise; resolve(value: any): any; reject(reason: any); notify(value: any); makeNodeResolver(): () => void; } - interface Promise { - fail(errorCallback: Function): Promise; - fin(finallyCallback: Function): Promise; - then(onFulfilled?: Function, onRejected?: Function, onProgress?: Function): Promise; - spread(onFulfilled: Function, onRejected?: Function): Promise; - catch(onRejected: Function): Promise; - progress(onProgress: Function): Promise; - done(onFulfilled?: Function, onRejected?: Function, onProgress?: Function): Promise; - get(propertyName: String): Promise; - set(propertyName: String, value: any): Promise; - delete(propertyName: String): Promise; - post(methodName: String, args: any[]): Promise; - invoke(methodName: String, ...args: any[]): Promise; - keys(): Promise; - fapply(args: any[]): Promise; - fcall(method: Function, ...args: any[]): Promise; - timeout(ms: number): Promise; - delay(ms: number): Promise; + interface Promise { + fail(errorCallback: Function): Promise; + fin(finallyCallback: Function): Promise; + then(onFulfilled?: (value: T) => any, onRejected?: (reason) => any, onProgress?: Function): Promise; + spread(onFulfilled: Function, onRejected?: Function): Promise; + catch(onRejected: Function): Promise; + progress(onProgress: Function): Promise; + done(onFulfilled?: Function, onRejected?: Function, onProgress?: Function): Promise; + get(propertyName: String): Promise; + set(propertyName: String, value: any): Promise; + delete(propertyName: String): Promise; + post(methodName: String, args: any[]): Promise; + invoke(methodName: String, ...args: any[]): Promise; + keys(): Promise; + fapply(args: any[]): Promise; + fcall(method: Function, ...args: any[]): Promise; + timeout(ms: number): Promise; + delay(ms: number): Promise; isFulfilled(): bool; isRejected(): bool; isPending(): bool; valueOf(): any; } - export function when(value: any, onFulfilled: Function, onRejected?: Function): Promise; - //export function try(method: Function, ...args: any[]): Qpromise; <- This is broken currently - not sure how to fix. - export function fbind(method: Function, ...args: any[]): Promise; - export function fcall(method: Function, ...args: any[]): Promise; - export function nfbind(nodeFunction: Function): (...args: any[]) => Promise; - export function nfcall(nodeFunction: Function, ...args: any[]): Promise; - export function ninvoke(nodeModule: any, functionName: string, ...args: any[]): Promise; - export function all(promises: Promise[]): Promise; - export function allResolved(promises: Promise[]): Promise; - export function spread(onFulfilled: Function, onRejected: Function): Promise; - export function timeout(ms: number): Promise; - export function delay(ms: number): Promise; - export function delay(value: any, ms: number): Promise; + export function when(value: any, onFulfilled: Function, onRejected?: Function): Promise; + //export function try(method: Function, ...args: any[]): Promise; // <- This is broken currently - not sure how to fix. + export function fbind(method: Function, ...args: any[]): Promise; + export function fcall(method: Function, ...args: any[]): Promise; + export function nfbind(nodeFunction: Function): (...args: any[]) => Promise; + export function nfcall(nodeFunction: Function, ...args: any[]): Promise; + export function ninvoke(nodeModule: any, functionName: string, ...args: any[]): Promise; + export function all(promises: Promise[]): Promise; + export function allResolved(promises: Promise[]): Promise; + export function spread(onFulfilled: Function, onRejected: Function): Promise; + export function timeout(ms: number): Promise; + export function delay(ms: number): Promise; + export function delay(value: any, ms: number): Promise; export function isFulfilled(): bool; export function isRejected(): bool; export function isPending(): bool; export function valueOf(): any; export function defer(): Deferred; - export function reject(): Promise; - export function promise(factory: { resolve: Function; reject: Function; notify: Function; }): Promise; + export function reject(): Promise; + export function promise(factory: { resolve: Function; reject: Function; notify: Function; }): Promise; export function isPromise(value: any): bool; export function async(generatorFunction: any): Deferred; export function nextTick(callback: Function); export var oneerror: any; export var longStackJumpLimit: number; - export function resolve(object?: Promise); + export function resolve(object?: Promise); } declare module "q" { diff --git a/q/q.module-tests.ts b/q/q.module-tests.ts index fe4764e76..037dd028c 100644 --- a/q/q.module-tests.ts +++ b/q/q.module-tests.ts @@ -5,7 +5,7 @@ import q = module("q"); import fs = module("fs"); -q(8).then(x => console.log(x)); +q(8).then(x => console.log(x.toExponential())); var delay = function (delay) { var d = q.defer(); @@ -44,7 +44,7 @@ q.fcall(function () { }) // Handle any error from step1 through step4 }).done(); -q.allResolved([]).then(function (promises) { +q.allResolved([]).then(function (promises: Q.Promise[]) { promises.forEach(function (promise) { if (promise.isFulfilled()) { var value = promise.valueOf(); From 9c38124670c075a482e542dde5f2d7694872b8fe Mon Sep 17 00:00:00 2001 From: Andrew Gaspar Date: Thu, 20 Jun 2013 00:43:35 -0700 Subject: [PATCH 13/57] Added typing to Deferred and defer() --- q/Q-tests.ts | 2 +- q/Q.d.ts | 6 +++--- q/q.module-tests.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/q/Q-tests.ts b/q/Q-tests.ts index b04067003..02a409b6b 100644 --- a/q/Q-tests.ts +++ b/q/Q-tests.ts @@ -2,7 +2,7 @@ Q(8).then(x => console.log(x.toExponential())); -var delay = function (delay) { +var delay = function (delay: number) { var d = Q.defer(); setTimeout(d.resolve, delay); return d.promise; diff --git a/q/Q.d.ts b/q/Q.d.ts index 25ed1b8e8..951f615d0 100644 --- a/q/Q.d.ts +++ b/q/Q.d.ts @@ -8,10 +8,10 @@ declare function Q(value: T): Q.Promise; declare module Q { interface Deferred { promise: Promise; - resolve(value: any): any; + resolve(value: T): any; reject(reason: any); notify(value: any); - makeNodeResolver(): () => void; + makeNodeResolver(): (reason, value: T) => void; } interface Promise { @@ -55,7 +55,7 @@ declare module Q { export function isRejected(): bool; export function isPending(): bool; export function valueOf(): any; - export function defer(): Deferred; + export function defer(): Deferred; export function reject(): Promise; export function promise(factory: { resolve: Function; reject: Function; notify: Function; }): Promise; export function isPromise(value: any): bool; diff --git a/q/q.module-tests.ts b/q/q.module-tests.ts index 037dd028c..a589ca1d6 100644 --- a/q/q.module-tests.ts +++ b/q/q.module-tests.ts @@ -67,7 +67,7 @@ q.nfcall(fs.readFile, "foo.txt", "utf-8").then(replaceText); q.ninvoke(fs, "readFile", "foo.txt", "utf-8").then(replaceText); -var deferred = q.defer(); +var deferred = q.defer(); fs.readFile("foo.txt", "utf-8", deferred.makeNodeResolver()); deferred.promise.then(replaceText); From d1eef15f0dc8b31193e89f99c833d8435505f447 Mon Sep 17 00:00:00 2001 From: basarat Date: Thu, 20 Jun 2013 21:18:20 +1000 Subject: [PATCH 14/57] No longer polluting global namespace with too many interfaces --- chai/chai.d.ts | 235 +++++++++++++++++++++++++------------------------ 1 file changed, 119 insertions(+), 116 deletions(-) diff --git a/chai/chai.d.ts b/chai/chai.d.ts index 806d20c3f..f74673727 100644 --- a/chai/chai.d.ts +++ b/chai/chai.d.ts @@ -3,120 +3,123 @@ // Definitions by: Kazi Manzur Rashid // DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped -interface Equality { - (expected: any, message?: string): bool; -} - -interface Property { - (name: string, value?: any, message?: string): bool; -} - -interface NumberComparer { - (value: number, message?: string): bool; -} - -interface Eql { - (value: any, message?: string): bool; -} - -interface Include { - (value: Object, message?: string): bool; - (value: string, message?: string): bool; - (value: number, message?: string): bool; - keys(...names: string[]): bool; -} - -interface Throw { - (constructor: Error, message?: string); - (expected: string, message?: string); - (expected: RegExp, message?: string); -} - -interface TypeComparison { - (type: string, message?: string): bool; - instanceof(type: Object): bool; -} - -interface NumericComparison { - above: NumberComparer; - gt: NumberComparer; - greaterThan: NumberComparer; - - below: NumberComparer; - lt: NumberComparer; - lessThan: NumberComparer; -} - -interface Length extends NumericComparison { - (value: number, message?: string): bool; -} - -interface Deep { - equal: Equality; - property: Property; -} - -interface Have { - property: Property; - deep: Deep; - length: Length; - ownProperty(name: string, message?: string): bool; - string(value: string, message?: string): bool; - keys(...values: string[]): bool; -} - -interface At { - least(value: number, message?: string): bool; - gte(value: number, message?: string): bool; - most(value: number, message?: string): bool; - lte(value: number, message?: string): bool; -} - -interface Be extends NumericComparison { - ok: bool; - true: bool; - false: bool; - null: bool; - undefined: bool; - empty: bool; - arguments: bool; - an: TypeComparison; - at: At; - - a(type: string, message?: string): bool; - within(start: number, finish: number, message?: string): bool; - closeTo(expected: number, delta: number, message?: string): bool; -} - -interface To { - be: Be; - not: To; - deep: Deep; - have: Have; - - exist: bool; - - equal: Equality; - - include: Include; - contain: Include; - throw: Throw; - - eql: Eql; - eqls: Eql; - - match(value: RegExp, message?: string): bool; - - respondTo(method: string, message?: string); - satisfy(matcher: Function, message?: string); -} - -interface ExpectMatchers { - to: To; -} - -interface chai{ - expect: { - (target: any): ExpectMatchers; +declare module chai { + interface Equality { + (expected: any, message?: string): bool; } -} \ No newline at end of file + + interface Property { + (name: string, value?: any, message?: string): bool; + } + + interface NumberComparer { + (value: number, message?: string): bool; + } + + interface Eql { + (value: any, message?: string): bool; + } + + interface Include { + (value: Object, message?: string): bool; + (value: string, message?: string): bool; + (value: number, message?: string): bool; + keys(...names: string[]): bool; + } + + interface Throw { + (constructor: Error, message?: string); + (expected: string, message?: string); + (expected: RegExp, message?: string); + } + + interface TypeComparison { + (type: string, message?: string): bool; + instanceof(type: Object): bool; + } + + interface NumericComparison { + above: NumberComparer; + gt: NumberComparer; + greaterThan: NumberComparer; + + below: NumberComparer; + lt: NumberComparer; + lessThan: NumberComparer; + } + + interface Length extends NumericComparison { + (value: number, message?: string): bool; + } + + interface Deep { + equal: Equality; + property: Property; + } + + interface Have { + property: Property; + deep: Deep; + length: Length; + ownProperty(name: string, message?: string): bool; + string(value: string, message?: string): bool; + keys(...values: string[]): bool; + } + + interface At { + least(value: number, message?: string): bool; + gte(value: number, message?: string): bool; + most(value: number, message?: string): bool; + lte(value: number, message?: string): bool; + } + + interface Be extends NumericComparison { + ok: bool; + true: bool; + false: bool; + null: bool; + undefined: bool; + empty: bool; + arguments: bool; + an: TypeComparison; + at: At; + + a(type: string, message?: string): bool; + within(start: number, finish: number, message?: string): bool; + closeTo(expected: number, delta: number, message?: string): bool; + } + + interface To { + be: Be; + not: To; + deep: Deep; + have: Have; + + exist: bool; + + equal: Equality; + + include: Include; + contain: Include; + throw: Throw; + + eql: Eql; + eqls: Eql; + + match(value: RegExp, message?: string): bool; + + respondTo(method: string, message?: string); + satisfy(matcher: Function, message?: string); + } + + interface ExpectMatchers { + to: To; + } + +} + +interface chai { + expect: { + (target: any): chai.ExpectMatchers; + } +} From e7f58eeb94b56b6f78989eadf1eab1507721448a Mon Sep 17 00:00:00 2001 From: damianog Date: Thu, 20 Jun 2013 14:35:21 +0300 Subject: [PATCH 15/57] Update to KnockoutObservable generics Update due dependancies with knockout that now implements generics --- knockout.mapping/knockout.mapping.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/knockout.mapping/knockout.mapping.d.ts b/knockout.mapping/knockout.mapping.d.ts index 69b6ccaff..010f18801 100644 --- a/knockout.mapping/knockout.mapping.d.ts +++ b/knockout.mapping/knockout.mapping.d.ts @@ -13,7 +13,7 @@ interface KnockoutMappingCreateOptions { interface KnockoutMappingUpdateOptions { data: any; parent: any; - observable: KnockoutObservableAny; + observable: KnockoutObservable; } interface KnockoutMappingOptions { From 7da1281dd08c515f18e0144168784f695803a191 Mon Sep 17 00:00:00 2001 From: Gleb Zevkov Date: Thu, 20 Jun 2013 13:49:22 +0200 Subject: [PATCH 16/57] Removed uncompilable function definition --- raphael/raphael.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/raphael/raphael.d.ts b/raphael/raphael.d.ts index c17a8d4fa..fc8503cd3 100644 --- a/raphael/raphael.d.ts +++ b/raphael/raphael.d.ts @@ -245,7 +245,6 @@ interface RaphaelStatic { format(token: string, ...parameters: any[]): string; fullfill(token: string, json: JSON): string; getColor(value?: number): string; - getColor: { reset(); }; getPointAtLength(path: string, length: number): { x: number; y: number; alpha: number; }; getRGB(colour: string): { r: number; g: number; b: number; hex: string; error: bool; }; getSubpath(path: string, from: number, to: number): string; From 3ac5cc59b7d62216fe0e420674bb7e6084a5153b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20B=C3=A9lisle?= Date: Thu, 20 Jun 2013 12:52:19 -0400 Subject: [PATCH 17/57] Fix compilation with TypeScript 0.9 --- durandal/durandal.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/durandal/durandal.d.ts b/durandal/durandal.d.ts index 33dd732f7..6f3a72a3e 100644 --- a/durandal/durandal.d.ts +++ b/durandal/durandal.d.ts @@ -284,7 +284,7 @@ interface IViewModelDefaults { * called after deactivating a module */ afterDeactivate(): any; -}; +} interface IDurandalViewModelActiveItem { /** @@ -339,7 +339,7 @@ interface IDurandalViewModelActiveItem { * Sets up a collection representing a pool of objects which the activator will activate. See below for details. Activators without an item bool always close their values on deactivate. Activators with an items pool only deactivate, but do not close them. */ forItems(items): IDurandalViewModelActiveItem; -}; +} /** * A router plugin, currently based on SammyJS. The router abstracts away the core configuration of Sammy and re-interprets it in terms of durandal's composition and activation mechanism. To use the router, you must require it, configure it and bind it in the UI. @@ -365,7 +365,7 @@ declare module "durandal/plugins/router" { hash: string; /** only present on visible routes to track if they are active in the nav */ isActive?: KnockoutComputed; - }; + } /** * Parameters to the map function. e only required parameter is url the rest can be derived. The derivation * happens by stripping parameters from the url and casing where appropriate. You can always explicitly provide From 02aac96d094d6ab572bbf1ad3138ce264bde5559 Mon Sep 17 00:00:00 2001 From: Nick Berardi Date: Thu, 20 Jun 2013 13:47:33 -0400 Subject: [PATCH 18/57] added IScope.$apply() It was marked as '// Documentation says exp is optional, but actual implementaton counts on it' but that is not actually the case. --- angularjs/angular.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index 10fb67a3f..8e5e2a007 100644 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -173,7 +173,7 @@ declare module ng { // see http://docs.angularjs.org/api/ng.$rootScope.Scope /////////////////////////////////////////////////////////////////////////// interface IScope { - // Documentation says exp is optional, but actual implementaton counts on it + $apply(): any; $apply(exp: string): any; $apply(exp: (scope: IScope) => any): any; From f44ddc0fa4cc57fcead6111ad7f287ea0d6a5b8c Mon Sep 17 00:00:00 2001 From: Diullei Gomes Date: Thu, 20 Jun 2013 14:51:02 -0300 Subject: [PATCH 19/57] new Travis CI script. Running tests and validate typescript syntax. --- _infrastructure/runner.ts | 557 ++ _infrastructure/src/exec.ts | 77 + _infrastructure/src/io.ts | 525 ++ _infrastructure/tests/src/exec.js | 130 +- _infrastructure/tests/src/io.js | 886 +-- _infrastructure/tests/testRunner.js | 771 +-- _infrastructure/typescript/lib.d.ts | 9074 +++++++++++++++++++++++++++ _infrastructure/typescript/tsc | 2 + package.json | 2 +- 9 files changed, 10896 insertions(+), 1128 deletions(-) create mode 100644 _infrastructure/runner.ts create mode 100644 _infrastructure/src/exec.ts create mode 100644 _infrastructure/src/io.ts create mode 100644 _infrastructure/typescript/lib.d.ts create mode 100644 _infrastructure/typescript/tsc diff --git a/_infrastructure/runner.ts b/_infrastructure/runner.ts new file mode 100644 index 000000000..0afe954e9 --- /dev/null +++ b/_infrastructure/runner.ts @@ -0,0 +1,557 @@ +/// +/// + +module DefinitelyTyped { + + export module TestManager { + + var path = require('path'); + + function endsWith(str, suffix) { + return str.indexOf(suffix, str.length - suffix.length) !== -1; + } + + class Iterator { + index: number = -1; + + constructor(public list: any[]){} + + public next() { + this.index++; + return this.list[this.index]; + } + + public hasNext() { + return this.list[1 + this.index] != null; + } + } + + class Tsc { + public static run(tsfile: string, callback: Function) { + Exec.exec('node ./_infrastructure/typescript/tsc.js ', [tsfile], (ExecResult) => { + callback(ExecResult); + }); + } + } + + class Test { + constructor(public tsfile: string) {} + + public run(callback: Function) { + Tsc.run(this.tsfile , callback); + } + } + + class Typing { + public fileHandler: FileHandler; + + constructor(public name: string, baseDir: string) { + this.fileHandler = new FileHandler(baseDir + '/' + name + '/', /.\.ts/g); + } + } + + class FileHandler { + public files: string[] = []; + public typings: Typing[] = []; + + constructor(public path: string, pattern: any) { + this.files = IO.dir(path, pattern, { recursive: true }); + } + + public allTS(): string[] { + return this.files; + } + + public allTests(): string[] { + var tests = []; + + for(var i = 0; i < this.files.length; i++) { + if (endsWith(this.files[i].toUpperCase(), '-TESTS.TS')) { + tests.push(this.files[i]); + } + } + + return tests; + } + + public allTypings(): string[] { + var typings = {}; + + for(var i = 0; i < this.files.length; i++) { + var file = this.files[i]; + var firName = path.dirname(file.substr(this.path.length + 1)).replace('\\', '/'); + var dir = firName.split('/')[0]; + + if(!typings[dir]) typings[dir] = true; + } + + var list = []; + for(var attr in typings) { + list.push(attr); + } + + return list; + } + } + + class Timer { + public startTime; + public time = 0; + public asString: string; + + private static prettyDate(date1, date2): string { + var diff = ((date2 - date1) / 1000), + day_diff = Math.floor(diff / 86400); + + if ( isNaN(day_diff) || day_diff < 0 || day_diff >= 31 ) + return; + + return (day_diff == 0 && ( + diff < 60 && (diff + " secconds") || + diff < 120 && "1 minute" || + diff < 3600 && Math.floor( diff / 60 ) + " minutes" || + diff < 7200 && "1 hour" || + diff < 86400 && Math.floor( diff / 3600 ) + " hours") || + day_diff == 1 && "Yesterday" || + day_diff < 7 && day_diff + " days" || + day_diff < 31 && Math.ceil( day_diff / 7 ) + " weeks"); + } + + public start() { + this.time = 0; + this.startTime = this.now(); + } + + private now() { + return Date.now(); + } + + public end() { + this.time = (this.now() - this.startTime) / 1000; + this.asString = Timer.prettyDate(this.startTime, this.now()); + } + } + + class Print { + constructor(public version: string, public typings: number, public tsFiles: number) { } + + public out(s) { + process.stdout.write(s); + } + + public printHeader() { + this.out('=============================================================================\n'); + this.out(' \33[36m\33[1mDefinitelyTyped test runner 0.2.0\33[0m\n'); + this.out('=============================================================================\n'); + this.out(' \33[36m\33[1mTypescript version:\33[0m ' + this.version + '\n'); + this.out(' \33[36m\33[1mTypings :\33[0m ' + this.typings + '\n'); + this.out(' \33[36m\33[1mTypeScript files :\33[0m ' + this.tsFiles + '\n'); + } + + public printSyntaxCheking() { + this.out('============================ \33[34m\33[1mSyntax cheking\33[0m =================================\n'); + } + + public printTypingTests() { + this.out('============================= \33[34m\33[1mTyping tests\33[0m ==================================\n'); + } + + public printSuccess() { + this.out('\33[36m\33[1m.\33[0m'); + } + + public printFailure() { + this.out('x'); + } + + public printDiv() { + this.out('-----------------------------------------------------------------------------\n'); + } + + public printfilesWithSintaxErrorMessage() { + this.out(' \33[36m\33[1mFiles with syntax error\33[0m\n'); + } + + public printFailedTestMessage() { + this.out(' \33[36m\33[1mFailed tests\33[0m\n'); + } + + public printTypingsWithoutTestsMessage() { + this.out(' \33[36m\33[1mTyping without tests\33[0m\n'); + } + + public printTotalMessage() { + this.out(' \33[36m\33[1mTotal\33[0m\n'); + } + + public printErrorFile(file) { + this.out(' - ' + file + '\n'); + } + + public printTypingsWithoutTest(file) { + this.out(' - \33[33m\33[1m' + file + '\33[0m\n'); + } + + public breack() { + this.out('\n'); + } + + public printSuccessCount(current: number, total: number) { + this.out(' \33[36m\33[1mSuccessful :\33[0m \33[32m\33[1m' + ((current / total) * 100).toFixed(2) + '% (' + current + '/' + total + ')\33[0m\n'); + } + + public printFailedCount(current: number, total: number) { + this.out(' \33[36m\33[1mFailure :\33[0m \33[31m\33[1m' + ((current / total) * 100).toFixed(2) + '% (' + current + '/' + total + ')\33[0m\n'); + } + + public printElapsedTime(time, s) { + this.out(' \33[36m\33[1mElapsed time :\33[0m ~' + time + ' (' + s + 's)\n'); + } + + public printSyntaxErrorCount(current: number, total: number) { + this.out(' \33[36m\33[1mSyntaxe error :\33[0m \33[31m\33[1m' + ((current / total) * 100).toFixed(2) + '% (' + current + '/' + total + ')\33[0m\n'); + } + + public printTestErrorCount(current: number, total: number) { + this.out(' \33[36m\33[1mFailed tests :\33[0m \33[31m\33[1m' + ((current / total) * 100).toFixed(2) + '% (' + current + '/' + total + ')\33[0m\n'); + } + + public printWithoutTestCount(current: number, total: number) { + this.out(' \33[36m\33[1mWithout tests :\33[0m \33[33m\33[1m' + ((current / total) * 100).toFixed(2) + '% (' + current + '/' + total + ')\33[0m\n'); + } + } + + class File { + + constructor(public name: string, public hasError: boolean) {} + + public formatName(baseDir: string): string { + var dirName = path.dirname(this.name.substr(baseDir.length + 1)).replace('\\', '/'); + var dir = dirName.split('/')[0]; + var file = path.basename(this.name, '.ts'); + var ext = path.extname(this.name); + + return dir + ((dirName.split('/').length > 1) ? '/-/' : '/') + '\33[36m\33[1m' + file + '\33[0m' + ext; + } + } + + class SyntaxCheking { + + private timer: Timer; + + public files: File[] = []; + + private getFailedFiles(): File[] { + var list: File[] = []; + + for(var i = 0; i < this.files.length; i++) { + if(this.files[i].hasError) { + list.push(this.files[i]); + } + } + + return list; + } + + private getSuccessFiles(): File[] { + var list: File[] = []; + + for(var i = 0; i < this.files.length; i++) { + if(!this.files[i].hasError) { + list.push(this.files[i]); + } + } + + return list; + } + + constructor(public fielHandler: FileHandler, public out: Print) { + this.timer = new Timer(); + } + + private printStats() { + this.out.printDiv(); + this.out.printElapsedTime(this.timer.asString, this.timer.time); + this.out.printSuccessCount(this.getSuccessFiles().length, this.files.length); + this.out.printFailedCount(this.getFailedFiles().length, this.files.length); + } + + private printFailedFiles() { + if (this.getFailedFiles().length > 0) { + this.out.printDiv(); + + this.out.printfilesWithSintaxErrorMessage(); + + this.out.printDiv(); + + for(var i = 0; i < this.getFailedFiles().length; i++) { + var errorFile = this.getFailedFiles()[i]; + this.out.printErrorFile(errorFile.formatName(this.fielHandler.path)); + } + } + } + + private run(it, file, len, maxLen, callback: Function) { + if (!endsWith(file, '-tests.ts')) { + new Test(file).run((o) => { + var failed = false; + + if(o.exitCode === 1) { + this.out.printFailure(); + failed = true; + len++; + } else { + this.out.printSuccess(); + len++; + } + + this.files.push(new File(file, failed)); + + if(len > maxLen) { + len = 0; + this.out.breack(); + } + + if (it.hasNext()) { + this.run(it, it.next(), len, maxLen, callback); + } else { + this.out.breack(); + this.timer.end(); + this.printFailedFiles(); + this.printStats(); + + callback(this.getFailedFiles().length, this.files.length); + } + }); + } else if (it.hasNext()) { + this.run(it, it.next(), len, maxLen, callback); + } else { + this.out.breack(); + this.timer.end(); + this.printStats(); + this.printFailedFiles(); + + callback(this.getFailedFiles().length, this.files.length); + } + } + + public start(callback: Function) { + this.timer.start(); + + var tsFiles = this.fielHandler.allTS(); + + var it = new Iterator(tsFiles); + + var len = 0; + var maxLen = 76; + + if (it.hasNext()) { + this.run(it, it.next(), len, maxLen, callback); + } + } + } + + class TestEval { + + private timer: Timer; + + public files: File[] = []; + + private getFailedFiles(): File[] { + var list: File[] = []; + + for(var i = 0; i < this.files.length; i++) { + if(this.files[i].hasError) { + list.push(this.files[i]); + } + } + + return list; + } + + private getSuccessFiles(): File[] { + var list: File[] = []; + + for(var i = 0; i < this.files.length; i++) { + if(!this.files[i].hasError) { + list.push(this.files[i]); + } + } + + return list; + } + + constructor(public fielHandler: FileHandler, public out: Print) { + this.timer = new Timer(); + } + + private printStats() { + this.out.printDiv(); + this.out.printElapsedTime(this.timer.asString, this.timer.time); + this.out.printSuccessCount(this.getSuccessFiles().length, this.files.length); + this.out.printFailedCount(this.getFailedFiles().length, this.files.length); + } + + private printFailedFiles() { + if (this.getFailedFiles().length > 0) { + this.out.printDiv(); + + this.out.printFailedTestMessage(); + + this.out.printDiv(); + + for(var i = 0; i < this.getFailedFiles().length; i++) { + var errorFile = this.getFailedFiles()[i]; + this.out.printErrorFile(errorFile.formatName(this.fielHandler.path)); + } + } + } + + private run(it, file, len, maxLen, callback: Function) { + if (endsWith(file, '-tests.ts')) { + new Test(file).run((o) => { + var failed = false; + + if(o.exitCode === 1) { + this.out.printFailure(); + failed = true; + len++; + } else { + this.out.printSuccess(); + len++; + } + + this.files.push(new File(file, failed)); + + if(len > maxLen) { + len = 0; + this.out.breack(); + } + + if (it.hasNext()) { + this.run(it, it.next(), len, maxLen, callback); + } else { + this.out.breack(); + this.timer.end(); + this.printFailedFiles(); + this.printStats(); + + callback(this.getFailedFiles().length, this.files.length); + } + }); + } else if (it.hasNext()) { + this.run(it, it.next(), len, maxLen, callback); + } else { + this.out.breack(); + this.timer.end(); + this.printFailedFiles(); + this.printStats(); + + callback(this.getFailedFiles().length, this.files.length); + } + } + + public start(callback: Function) { + this.timer.start(); + + var tsFiles = this.fielHandler.allTS(); + + var it = new Iterator(tsFiles); + + var len = 0; + var maxLen = 76; + + if (it.hasNext()) { + this.run(it, it.next(), len, maxLen, callback); + } + } + } + + export class TestRunner { + private fh: FileHandler; + private out: Print; + private sc: SyntaxCheking; + private te: TestEval; + private typings: Typing[] = []; + + private printTypingsWithoutTest() { + var count = 0; + + if (this.typings.length > 0) { + this.out.printDiv(); + + this.out.printTypingsWithoutTestsMessage(); + + this.out.printDiv(); + + for(var i = 0; i < this.typings.length; i++) { + var typing = this.typings[i]; + if(typing.fileHandler.allTests().length == 0) { + if (typing.name != '_infrastructure' + && typing.name != '_ReSharper.DefinitelyTyped' + && typing.name != 'obj' + && typing.name != 'bin' + && typing.name != 'Properties') { + this.out.printTypingsWithoutTest(typing.name); + count++; + } + } + } + } + + return count; + } + + constructor(public dtPath: string) { + this.fh = new FileHandler(dtPath, /.\.ts/g); + this.out = new Print('0.9.0.0', this.fh.allTypings().length, this.fh.allTS().length); + this.sc = new SyntaxCheking(this.fh, this.out); + this.te = new TestEval(this.fh, this.out); + + var tpgs = this.fh.allTypings(); + for(var i = 0; i < tpgs.length; i++) { + this.typings.push(new Typing(tpgs[i], this.dtPath)); + } + } + + public run() { + var timer = new Timer(); + timer.start(); + + this.out.printHeader(); + this.out.printSyntaxCheking(); + + this.sc.start((syntaxFailedCount, syntaxTotal) => { + this.out.printTypingTests(); + this.te.start((testFailedCount, testTotal) => { + var total = this.printTypingsWithoutTest(); + + timer.end(); + + this.out.printDiv(); + this.out.printTotalMessage(); + this.out.printDiv(); + + this.out.printElapsedTime(timer.asString, timer.time); + this.out.printSyntaxErrorCount(syntaxFailedCount, syntaxTotal); + this.out.printTestErrorCount(testFailedCount, testTotal); + this.out.printWithoutTestCount(total, this.fh.allTypings().length); + + this.out.printDiv(); + + if (syntaxFailedCount > 0 || testFailedCount > 0) { + process.exit(1); + } + }); + }); + } + } + } +} + +declare var __dirname: any; + +var dtPath = __dirname + '/..'; + +var runner = new DefinitelyTyped.TestManager.TestRunner(dtPath); +runner.run(); diff --git a/_infrastructure/src/exec.ts b/_infrastructure/src/exec.ts new file mode 100644 index 000000000..f277d3942 --- /dev/null +++ b/_infrastructure/src/exec.ts @@ -0,0 +1,77 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// Allows for executing a program with command-line arguments and reading the result +interface IExec { + exec: (filename: string, cmdLineArgs: string[], handleResult: (ExecResult) => void) => void; +} + +declare var require; + +class ExecResult { + public stdout = ""; + public stderr = ""; + public exitCode: number; +} + +class WindowsScriptHostExec implements IExec { + public exec(filename: string, cmdLineArgs: string[], handleResult: (ExecResult) => void) : void { + var result = new ExecResult(); + var shell = new ActiveXObject('WScript.Shell'); + try { + var process = shell.Exec(filename + ' ' + cmdLineArgs.join(' ')); + } catch(e) { + result.stderr = e.message; + result.exitCode = 1 + handleResult(result); + return; + } + // Wait for it to finish running + while (process.Status != 0) { /* todo: sleep? */ } + + + result.exitCode = process.ExitCode; + if(!process.StdOut.AtEndOfStream) result.stdout = process.StdOut.ReadAll(); + if(!process.StdErr.AtEndOfStream) result.stderr = process.StdErr.ReadAll(); + + handleResult(result); + } +} + +class NodeExec implements IExec { + public exec(filename: string, cmdLineArgs: string[], handleResult: (ExecResult) => void) : void { + var nodeExec = require('child_process').exec; + + var result = new ExecResult(); + result.exitCode = null; + var cmdLine = filename + ' ' + cmdLineArgs.join(' '); + + var process = nodeExec(cmdLine, function (error, stdout, stderr) { + result.stdout = stdout; + result.stderr = stderr; + result.exitCode = error ? error.code : 0; + handleResult(result); + }); + } +} + +var Exec: IExec = function() : IExec { + var global = Function("return this;").call(null); + if(typeof global.ActiveXObject !== "undefined") { + return new WindowsScriptHostExec(); + } else { + return new NodeExec(); + } +}(); \ No newline at end of file diff --git a/_infrastructure/src/io.ts b/_infrastructure/src/io.ts new file mode 100644 index 000000000..9c5345136 --- /dev/null +++ b/_infrastructure/src/io.ts @@ -0,0 +1,525 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +interface IResolvedFile { + content: string; + path: string; +} + +interface IFileWatcher { + close(): void; +} + +interface IIO { + readFile(path: string): string; + writeFile(path: string, contents: string): void; + createFile(path: string, useUTF8?: bool): ITextWriter; + deleteFile(path: string): void; + dir(path: string, re?: RegExp, options?: { recursive?: bool; deep?: number; }): string[]; + fileExists(path: string): bool; + directoryExists(path: string): bool; + createDirectory(path: string): void; + resolvePath(path: string): string; + dirName(path: string): string; + findFile(rootPath: string, partialFilePath: string): IResolvedFile; + print(str: string): void; + printLine(str: string): void; + arguments: string[]; + stderr: ITextWriter; + stdout: ITextWriter; + watchFile(filename: string, callback: (string) => void ): IFileWatcher; + run(source: string, filename: string): void; + getExecutingFilePath(): string; + quit(exitCode?: number); +} + +module IOUtils { + // Creates the directory including its parent if not already present + function createDirectoryStructure(ioHost: IIO, dirName: string) { + if (ioHost.directoryExists(dirName)) { + return; + } + + var parentDirectory = ioHost.dirName(dirName); + if (parentDirectory != "") { + createDirectoryStructure(ioHost, parentDirectory); + } + ioHost.createDirectory(dirName); + } + + // Creates a file including its directory structure if not already present + export function createFileAndFolderStructure(ioHost: IIO, fileName: string, useUTF8?: bool) { + var path = ioHost.resolvePath(fileName); + var dirName = ioHost.dirName(path); + createDirectoryStructure(ioHost, dirName); + return ioHost.createFile(path, useUTF8); + } + + export function throwIOError(message: string, error: Error) { + var errorMessage = message; + if (error && error.message) { + errorMessage += (" " + error.message); + } + throw new Error(errorMessage); + } +} + +// Declare dependencies needed for all supported hosts +declare class Enumerator { + public atEnd(): bool; + public moveNext(); + public item(): any; + constructor (o: any); +} +declare function setTimeout(callback: () =>void , ms?: number); +//declare var require: any; +declare module process { + export var argv: string[]; + export var platform: string; + export function on(event: string, handler: (any) => void ): void; + export module stdout { + export function write(str: string); + } + export module stderr { + export function write(str: string); + } + export module mainModule { + export var filename: string; + } + export function exit(exitCode?: number); +} + +var IO = (function() { + + // Create an IO object for use inside WindowsScriptHost hosts + // Depends on WSCript and FileSystemObject + function getWindowsScriptHostIO(): IIO { + var fso = new ActiveXObject("Scripting.FileSystemObject"); + var streamObjectPool = []; + + function getStreamObject(): any { + if (streamObjectPool.length > 0) { + return streamObjectPool.pop(); + } else { + return new ActiveXObject("ADODB.Stream"); + } + } + + function releaseStreamObject(obj: any) { + streamObjectPool.push(obj); + } + + var args = []; + for (var i = 0; i < WScript.Arguments.length; i++) { + args[i] = WScript.Arguments.Item(i); + } + + return { + readFile: function(path) { + try { + var streamObj = getStreamObject(); + streamObj.Open(); + streamObj.Type = 2; // Text data + streamObj.Charset = 'x-ansi'; // Assume we are reading ansi text + streamObj.LoadFromFile(path); + var bomChar = streamObj.ReadText(2); // Read the BOM char + streamObj.Position = 0; // Position has to be at 0 before changing the encoding + if ((bomChar.charCodeAt(0) == 0xFE && bomChar.charCodeAt(1) == 0xFF) + || (bomChar.charCodeAt(0) == 0xFF && bomChar.charCodeAt(1) == 0xFE)) { + streamObj.Charset = 'unicode'; + } else if (bomChar.charCodeAt(0) == 0xEF && bomChar.charCodeAt(1) == 0xBB) { + streamObj.Charset = 'utf-8'; + } + + // Read the whole file + var str = streamObj.ReadText(-1 /* read from the current position to EOS */); + streamObj.Close(); + releaseStreamObject(streamObj); + return str; + } + catch (err) { + IOUtils.throwIOError("Error reading file \"" + path + "\".", err); + } + }, + + writeFile: function(path, contents) { + var file = this.createFile(path); + file.Write(contents); + file.Close(); + }, + + fileExists: function(path: string): bool { + return fso.FileExists(path); + }, + + resolvePath: function(path: string): string { + return fso.GetAbsolutePathName(path); + }, + + dirName: function(path: string): string { + return fso.GetParentFolderName(path); + }, + + findFile: function(rootPath: string, partialFilePath: string): IResolvedFile { + var path = fso.GetAbsolutePathName(rootPath) + "/" + partialFilePath; + + while (true) { + if (fso.FileExists(path)) { + try { + var content = this.readFile(path); + return { content: content, path: path }; + } + catch (err) { + //Tools.CompilerDiagnostics.debugPrint("Could not find " + path + ", trying parent"); + } + } + else { + rootPath = fso.GetParentFolderName(fso.GetAbsolutePathName(rootPath)); + + if (rootPath == "") { + return null; + } + else { + path = fso.BuildPath(rootPath, partialFilePath); + } + } + } + }, + + deleteFile: function(path: string): void { + try { + if (fso.FileExists(path)) { + fso.DeleteFile(path, true); // true: delete read-only files + } + } catch (e) { + IOUtils.throwIOError("Couldn't delete file '" + path + "'.", e); + } + }, + + createFile: function (path, useUTF8?) { + try { + var streamObj = getStreamObject(); + streamObj.Charset = useUTF8 ? 'utf-8' : 'x-ansi'; + streamObj.Open(); + return { + Write: function (str) { streamObj.WriteText(str, 0); }, + WriteLine: function (str) { streamObj.WriteText(str, 1); }, + Close: function() { + try { + streamObj.SaveToFile(path, 2); + } catch (saveError) { + IOUtils.throwIOError("Couldn't write to file '" + path + "'.", saveError); + } + finally { + if (streamObj.State != 0 /*adStateClosed*/) { + streamObj.Close(); + } + releaseStreamObject(streamObj); + } + } + }; + } catch (creationError) { + IOUtils.throwIOError("Couldn't write to file '" + path + "'.", creationError); + } + }, + + directoryExists: function(path) { + return fso.FolderExists(path); + }, + + createDirectory: function(path) { + try { + if (!this.directoryExists(path)) { + fso.CreateFolder(path); + } + } catch (e) { + IOUtils.throwIOError("Couldn't create directory '" + path + "'.", e); + } + }, + + dir: function(path, spec?, options?) { + options = options || <{ recursive?: bool; deep?: number; }>{}; + function filesInFolder(folder, root): string[]{ + var paths = []; + var fc: Enumerator; + + if (options.recursive) { + fc = new Enumerator(folder.subfolders); + + for (; !fc.atEnd() ; fc.moveNext()) { + paths = paths.concat(filesInFolder(fc.item(), root + "/" + fc.item().Name)); + } + } + + fc = new Enumerator(folder.files); + + for (; !fc.atEnd() ; fc.moveNext()) { + if (!spec || fc.item().Name.match(spec)) { + paths.push(root + "/" + fc.item().Name); + } + } + + return paths; + } + + var folder = fso.GetFolder(path); + var paths = []; + + return filesInFolder(folder, path); + }, + + print: function(str) { + WScript.StdOut.Write(str); + }, + + printLine: function(str) { + WScript.Echo(str); + }, + + arguments: args, + stderr: WScript.StdErr, + stdout: WScript.StdOut, + watchFile: null, + run: function(source, filename) { + try { + eval(source); + } catch (e) { + IOUtils.throwIOError("Error while executing file '" + filename + "'.", e); + } + }, + getExecutingFilePath: function () { + return WScript.ScriptFullName; + }, + quit: function (exitCode : number = 0) { + try { + WScript.Quit(exitCode); + } catch (e) { + } + } + } + + }; + + // Create an IO object for use inside Node.js hosts + // Depends on 'fs' and 'path' modules + function getNodeIO(): IIO { + + var _fs = require('fs'); + var _path = require('path'); + var _module = require('module'); + + return { + readFile: function(file) { + try { + var buffer = _fs.readFileSync(file); + switch (buffer[0]) { + case 0xFE: + if (buffer[1] == 0xFF) { + // utf16-be. Reading the buffer as big endian is not supported, so convert it to + // Little Endian first + var i = 0; + while ((i + 1) < buffer.length) { + var temp = buffer[i] + buffer[i] = buffer[i + 1]; + buffer[i + 1] = temp; + i += 2; + } + return buffer.toString("ucs2", 2); + } + break; + case 0xFF: + if (buffer[1] == 0xFE) { + // utf16-le + return buffer.toString("ucs2", 2); + } + break; + case 0xEF: + if (buffer[1] == 0xBB) { + // utf-8 + return buffer.toString("utf8", 3); + } + } + // Default behaviour + return buffer.toString(); + } catch (e) { + IOUtils.throwIOError("Error reading file \"" + file + "\".", e); + } + }, + writeFile: <(path: string, contents: string) => void >_fs.writeFileSync, + deleteFile: function(path) { + try { + _fs.unlinkSync(path); + } catch (e) { + IOUtils.throwIOError("Couldn't delete file '" + path + "'.", e); + } + }, + fileExists: function(path): bool { + return _fs.existsSync(path); + }, + createFile: function(path, useUTF8?) { + function mkdirRecursiveSync(path) { + var stats = _fs.statSync(path); + if (stats.isFile()) { + IOUtils.throwIOError("\"" + path + "\" exists but isn't a directory.", null); + } else if (stats.isDirectory()) { + return; + } else { + mkdirRecursiveSync(_path.dirname(path)); + _fs.mkdirSync(path, 0775); + } + } + + mkdirRecursiveSync(_path.dirname(path)); + + try { + var fd = _fs.openSync(path, 'w'); + } catch (e) { + IOUtils.throwIOError("Couldn't write to file '" + path + "'.", e); + } + return { + Write: function(str) { _fs.writeSync(fd, str); }, + WriteLine: function(str) { _fs.writeSync(fd, str + '\r\n'); }, + Close: function() { _fs.closeSync(fd); fd = null; } + }; + }, + dir: function dir(path, spec?, options?) { + options = options || <{ recursive?: bool; deep?: number; }>{}; + + function filesInFolder(folder: string, deep?: number): string[]{ + var paths = []; + + var files = _fs.readdirSync(folder); + for (var i = 0; i < files.length; i++) { + var stat = _fs.statSync(folder + "/" + files[i]); + if (options.recursive && stat.isDirectory()) { + if (deep < (options.deep || 100)) { + paths = paths.concat(filesInFolder(folder + "/" + files[i], 1)); + } + } else if (stat.isFile() && (!spec || files[i].match(spec))) { + paths.push(folder + "/" + files[i]); + } + } + + return paths; + } + + return filesInFolder(path, 0); + }, + createDirectory: function(path: string): void { + try { + if (!this.directoryExists(path)) { + _fs.mkdirSync(path); + } + } catch (e) { + IOUtils.throwIOError("Couldn't create directory '" + path + "'.", e); + } + }, + + directoryExists: function(path: string): bool { + return _fs.existsSync(path) && _fs.lstatSync(path).isDirectory(); + }, + resolvePath: function(path: string): string { + return _path.resolve(path); + }, + dirName: function(path: string): string { + return _path.dirname(path); + }, + findFile: function(rootPath: string, partialFilePath): IResolvedFile { + var path = rootPath + "/" + partialFilePath; + + while (true) { + if (_fs.existsSync(path)) { + try { + var content = this.readFile(path); + return { content: content, path: path }; + } catch (err) { + //Tools.CompilerDiagnostics.debugPrint(("Could not find " + path) + ", trying parent"); + } + } + else { + var parentPath = _path.resolve(rootPath, ".."); + + // Node will just continue to repeat the root path, rather than return null + if (rootPath === parentPath) { + return null; + } + else { + rootPath = parentPath; + path = _path.resolve(rootPath, partialFilePath); + } + } + } + }, + print: function(str) { process.stdout.write(str) }, + printLine: function(str) { process.stdout.write(str + '\n') }, + arguments: process.argv.slice(2), + stderr: { + Write: function(str) { process.stderr.write(str); }, + WriteLine: function(str) { process.stderr.write(str + '\n'); }, + Close: function() { } + }, + stdout: { + Write: function(str) { process.stdout.write(str); }, + WriteLine: function(str) { process.stdout.write(str + '\n'); }, + Close: function() { } + }, + watchFile: function(filename: string, callback: (string) => void ): IFileWatcher { + var firstRun = true; + var processingChange = false; + + var fileChanged: any = function(curr, prev) { + if (!firstRun) { + if (curr.mtime < prev.mtime) { + return; + } + + _fs.unwatchFile(filename, fileChanged); + if (!processingChange) { + processingChange = true; + callback(filename); + setTimeout(function() { processingChange = false; }, 100); + } + } + firstRun = false; + _fs.watchFile(filename, { persistent: true, interval: 500 }, fileChanged); + }; + + fileChanged(); + return { + filename: filename, + close: function() { + _fs.unwatchFile(filename, fileChanged); + } + }; + }, + run: function(source, filename) { + require.main.filename = filename; + require.main.paths = _module._nodeModulePaths(_path.dirname(_fs.realpathSync(filename))); + require.main._compile(source, filename); + }, + getExecutingFilePath: function () { + return process.mainModule.filename; + }, + quit: process.exit + } + }; + + if (typeof ActiveXObject === "function") + return getWindowsScriptHostIO(); + else if (typeof require === "function") + return getNodeIO(); + else + return null; // Unsupported host +})(); diff --git a/_infrastructure/tests/src/exec.js b/_infrastructure/tests/src/exec.js index 8c18ab42d..f6c3d257c 100644 --- a/_infrastructure/tests/src/exec.js +++ b/_infrastructure/tests/src/exec.js @@ -1,65 +1,65 @@ -var ExecResult = (function () { - function ExecResult() { - this.stdout = ""; - this.stderr = ""; - } - return ExecResult; -})(); - -var WindowsScriptHostExec = (function () { - function WindowsScriptHostExec() { - } - WindowsScriptHostExec.prototype.exec = function (filename, cmdLineArgs, handleResult) { - var result = new ExecResult(); - var shell = new ActiveXObject('WScript.Shell'); - try { - var process = shell.Exec(filename + ' ' + cmdLineArgs.join(' ')); - } catch (e) { - result.stderr = e.message; - result.exitCode = 1; - handleResult(result); - return; - } - - while (process.Status != 0) { - } - - result.exitCode = process.ExitCode; - if (!process.StdOut.AtEndOfStream) - result.stdout = process.StdOut.ReadAll(); - if (!process.StdErr.AtEndOfStream) - result.stderr = process.StdErr.ReadAll(); - - handleResult(result); - }; - return WindowsScriptHostExec; -})(); - -var NodeExec = (function () { - function NodeExec() { - } - NodeExec.prototype.exec = function (filename, cmdLineArgs, handleResult) { - var nodeExec = require('child_process').exec; - - var result = new ExecResult(); - result.exitCode = null; - var cmdLine = filename + ' ' + cmdLineArgs.join(' '); - - var process = nodeExec(cmdLine, function (error, stdout, stderr) { - result.stdout = stdout; - result.stderr = stderr; - result.exitCode = error ? error.code : 0; - handleResult(result); - }); - }; - return NodeExec; -})(); - -var Exec = (function () { - var global = Function("return this;").call(null); - if (typeof global.ActiveXObject !== "undefined") { - return new WindowsScriptHostExec(); - } else { - return new NodeExec(); - } -})(); +var ExecResult = (function () { + function ExecResult() { + this.stdout = ""; + this.stderr = ""; + } + return ExecResult; +})(); + +var WindowsScriptHostExec = (function () { + function WindowsScriptHostExec() { + } + WindowsScriptHostExec.prototype.exec = function (filename, cmdLineArgs, handleResult) { + var result = new ExecResult(); + var shell = new ActiveXObject('WScript.Shell'); + try { + var process = shell.Exec(filename + ' ' + cmdLineArgs.join(' ')); + } catch (e) { + result.stderr = e.message; + result.exitCode = 1; + handleResult(result); + return; + } + + while (process.Status != 0) { + } + + result.exitCode = process.ExitCode; + if (!process.StdOut.AtEndOfStream) + result.stdout = process.StdOut.ReadAll(); + if (!process.StdErr.AtEndOfStream) + result.stderr = process.StdErr.ReadAll(); + + handleResult(result); + }; + return WindowsScriptHostExec; +})(); + +var NodeExec = (function () { + function NodeExec() { + } + NodeExec.prototype.exec = function (filename, cmdLineArgs, handleResult) { + var nodeExec = require('child_process').exec; + + var result = new ExecResult(); + result.exitCode = null; + var cmdLine = filename + ' ' + cmdLineArgs.join(' '); + + var process = nodeExec(cmdLine, function (error, stdout, stderr) { + result.stdout = stdout; + result.stderr = stderr; + result.exitCode = error ? error.code : 0; + handleResult(result); + }); + }; + return NodeExec; +})(); + +var Exec = (function () { + var global = Function("return this;").call(null); + if (typeof global.ActiveXObject !== "undefined") { + return new WindowsScriptHostExec(); + } else { + return new NodeExec(); + } +})(); diff --git a/_infrastructure/tests/src/io.js b/_infrastructure/tests/src/io.js index 772e97c02..0a3418568 100644 --- a/_infrastructure/tests/src/io.js +++ b/_infrastructure/tests/src/io.js @@ -1,443 +1,443 @@ -var IOUtils; -(function (IOUtils) { - function createDirectoryStructure(ioHost, dirName) { - if (ioHost.directoryExists(dirName)) { - return; - } - - var parentDirectory = ioHost.dirName(dirName); - if (parentDirectory != "") { - createDirectoryStructure(ioHost, parentDirectory); - } - ioHost.createDirectory(dirName); - } - - function createFileAndFolderStructure(ioHost, fileName, useUTF8) { - var path = ioHost.resolvePath(fileName); - var dirName = ioHost.dirName(path); - createDirectoryStructure(ioHost, dirName); - return ioHost.createFile(path, useUTF8); - } - IOUtils.createFileAndFolderStructure = createFileAndFolderStructure; - - function throwIOError(message, error) { - var errorMessage = message; - if (error && error.message) { - errorMessage += (" " + error.message); - } - throw new Error(errorMessage); - } - IOUtils.throwIOError = throwIOError; -})(IOUtils || (IOUtils = {})); - -var IO = (function () { - function getWindowsScriptHostIO() { - var fso = new ActiveXObject("Scripting.FileSystemObject"); - var streamObjectPool = []; - - function getStreamObject() { - if (streamObjectPool.length > 0) { - return streamObjectPool.pop(); - } else { - return new ActiveXObject("ADODB.Stream"); - } - } - - function releaseStreamObject(obj) { - streamObjectPool.push(obj); - } - - var args = []; - for (var i = 0; i < WScript.Arguments.length; i++) { - args[i] = WScript.Arguments.Item(i); - } - - return { - readFile: function (path) { - try { - var streamObj = getStreamObject(); - streamObj.Open(); - streamObj.Type = 2; - streamObj.Charset = 'x-ansi'; - streamObj.LoadFromFile(path); - var bomChar = streamObj.ReadText(2); - streamObj.Position = 0; - if ((bomChar.charCodeAt(0) == 0xFE && bomChar.charCodeAt(1) == 0xFF) || (bomChar.charCodeAt(0) == 0xFF && bomChar.charCodeAt(1) == 0xFE)) { - streamObj.Charset = 'unicode'; - } else if (bomChar.charCodeAt(0) == 0xEF && bomChar.charCodeAt(1) == 0xBB) { - streamObj.Charset = 'utf-8'; - } - - var str = streamObj.ReadText(-1); - streamObj.Close(); - releaseStreamObject(streamObj); - return str; - } catch (err) { - IOUtils.throwIOError("Error reading file \"" + path + "\".", err); - } - }, - writeFile: function (path, contents) { - var file = this.createFile(path); - file.Write(contents); - file.Close(); - }, - fileExists: function (path) { - return fso.FileExists(path); - }, - resolvePath: function (path) { - return fso.GetAbsolutePathName(path); - }, - dirName: function (path) { - return fso.GetParentFolderName(path); - }, - findFile: function (rootPath, partialFilePath) { - var path = fso.GetAbsolutePathName(rootPath) + "/" + partialFilePath; - - while (true) { - if (fso.FileExists(path)) { - try { - var content = this.readFile(path); - return { content: content, path: path }; - } catch (err) { - } - } else { - rootPath = fso.GetParentFolderName(fso.GetAbsolutePathName(rootPath)); - - if (rootPath == "") { - return null; - } else { - path = fso.BuildPath(rootPath, partialFilePath); - } - } - } - }, - deleteFile: function (path) { - try { - if (fso.FileExists(path)) { - fso.DeleteFile(path, true); - } - } catch (e) { - IOUtils.throwIOError("Couldn't delete file '" + path + "'.", e); - } - }, - createFile: function (path, useUTF8) { - try { - var streamObj = getStreamObject(); - streamObj.Charset = useUTF8 ? 'utf-8' : 'x-ansi'; - streamObj.Open(); - return { - Write: function (str) { - streamObj.WriteText(str, 0); - }, - WriteLine: function (str) { - streamObj.WriteText(str, 1); - }, - Close: function () { - try { - streamObj.SaveToFile(path, 2); - } catch (saveError) { - IOUtils.throwIOError("Couldn't write to file '" + path + "'.", saveError); - } finally { - if (streamObj.State != 0) { - streamObj.Close(); - } - releaseStreamObject(streamObj); - } - } - }; - } catch (creationError) { - IOUtils.throwIOError("Couldn't write to file '" + path + "'.", creationError); - } - }, - directoryExists: function (path) { - return fso.FolderExists(path); - }, - createDirectory: function (path) { - try { - if (!this.directoryExists(path)) { - fso.CreateFolder(path); - } - } catch (e) { - IOUtils.throwIOError("Couldn't create directory '" + path + "'.", e); - } - }, - dir: function (path, spec, options) { - options = options || {}; - function filesInFolder(folder, root) { - var paths = []; - var fc; - - if (options.recursive) { - fc = new Enumerator(folder.subfolders); - - for (; !fc.atEnd(); fc.moveNext()) { - paths = paths.concat(filesInFolder(fc.item(), root + "/" + fc.item().Name)); - } - } - - fc = new Enumerator(folder.files); - - for (; !fc.atEnd(); fc.moveNext()) { - if (!spec || fc.item().Name.match(spec)) { - paths.push(root + "/" + fc.item().Name); - } - } - - return paths; - } - - var folder = fso.GetFolder(path); - var paths = []; - - return filesInFolder(folder, path); - }, - print: function (str) { - WScript.StdOut.Write(str); - }, - printLine: function (str) { - WScript.Echo(str); - }, - arguments: args, - stderr: WScript.StdErr, - stdout: WScript.StdOut, - watchFile: null, - run: function (source, filename) { - try { - eval(source); - } catch (e) { - IOUtils.throwIOError("Error while executing file '" + filename + "'.", e); - } - }, - getExecutingFilePath: function () { - return WScript.ScriptFullName; - }, - quit: function (exitCode) { - if (typeof exitCode === "undefined") { exitCode = 0; } - try { - WScript.Quit(exitCode); - } catch (e) { - } - } - }; - } - ; - - function getNodeIO() { - var _fs = require('fs'); - var _path = require('path'); - var _module = require('module'); - - return { - readFile: function (file) { - try { - var buffer = _fs.readFileSync(file); - switch (buffer[0]) { - case 0xFE: - if (buffer[1] == 0xFF) { - var i = 0; - while ((i + 1) < buffer.length) { - var temp = buffer[i]; - buffer[i] = buffer[i + 1]; - buffer[i + 1] = temp; - i += 2; - } - return buffer.toString("ucs2", 2); - } - break; - case 0xFF: - if (buffer[1] == 0xFE) { - return buffer.toString("ucs2", 2); - } - break; - case 0xEF: - if (buffer[1] == 0xBB) { - return buffer.toString("utf8", 3); - } - } - - return buffer.toString(); - } catch (e) { - IOUtils.throwIOError("Error reading file \"" + file + "\".", e); - } - }, - writeFile: _fs.writeFileSync, - deleteFile: function (path) { - try { - _fs.unlinkSync(path); - } catch (e) { - IOUtils.throwIOError("Couldn't delete file '" + path + "'.", e); - } - }, - fileExists: function (path) { - return _fs.existsSync(path); - }, - createFile: function (path, useUTF8) { - function mkdirRecursiveSync(path) { - var stats = _fs.statSync(path); - if (stats.isFile()) { - IOUtils.throwIOError("\"" + path + "\" exists but isn't a directory.", null); - } else if (stats.isDirectory()) { - return; - } else { - mkdirRecursiveSync(_path.dirname(path)); - _fs.mkdirSync(path, 0775); - } - } - - mkdirRecursiveSync(_path.dirname(path)); - - try { - var fd = _fs.openSync(path, 'w'); - } catch (e) { - IOUtils.throwIOError("Couldn't write to file '" + path + "'.", e); - } - return { - Write: function (str) { - _fs.writeSync(fd, str); - }, - WriteLine: function (str) { - _fs.writeSync(fd, str + '\r\n'); - }, - Close: function () { - _fs.closeSync(fd); - fd = null; - } - }; - }, - dir: function dir(path, spec, options) { - options = options || {}; - - function filesInFolder(folder) { - var paths = []; - - var files = _fs.readdirSync(folder); - for (var i = 0; i < files.length; i++) { - var stat = _fs.statSync(folder + "/" + files[i]); - if (options.recursive && stat.isDirectory()) { - paths = paths.concat(filesInFolder(folder + "/" + files[i])); - } else if (stat.isFile() && (!spec || files[i].match(spec))) { - paths.push(folder + "/" + files[i]); - } - } - - return paths; - } - - return filesInFolder(path); - }, - createDirectory: function (path) { - try { - if (!this.directoryExists(path)) { - _fs.mkdirSync(path); - } - } catch (e) { - IOUtils.throwIOError("Couldn't create directory '" + path + "'.", e); - } - }, - directoryExists: function (path) { - return _fs.existsSync(path) && _fs.lstatSync(path).isDirectory(); - }, - resolvePath: function (path) { - return _path.resolve(path); - }, - dirName: function (path) { - return _path.dirname(path); - }, - findFile: function (rootPath, partialFilePath) { - var path = rootPath + "/" + partialFilePath; - - while (true) { - if (_fs.existsSync(path)) { - try { - var content = this.readFile(path); - return { content: content, path: path }; - } catch (err) { - } - } else { - var parentPath = _path.resolve(rootPath, ".."); - - if (rootPath === parentPath) { - return null; - } else { - rootPath = parentPath; - path = _path.resolve(rootPath, partialFilePath); - } - } - } - }, - print: function (str) { - process.stdout.write(str); - }, - printLine: function (str) { - process.stdout.write(str + '\n'); - }, - arguments: process.argv.slice(2), - stderr: { - Write: function (str) { - process.stderr.write(str); - }, - WriteLine: function (str) { - process.stderr.write(str + '\n'); - }, - Close: function () { - } - }, - stdout: { - Write: function (str) { - process.stdout.write(str); - }, - WriteLine: function (str) { - process.stdout.write(str + '\n'); - }, - Close: function () { - } - }, - watchFile: function (filename, callback) { - var firstRun = true; - var processingChange = false; - - var fileChanged = function (curr, prev) { - if (!firstRun) { - if (curr.mtime < prev.mtime) { - return; - } - - _fs.unwatchFile(filename, fileChanged); - if (!processingChange) { - processingChange = true; - callback(filename); - setTimeout(function () { - processingChange = false; - }, 100); - } - } - firstRun = false; - _fs.watchFile(filename, { persistent: true, interval: 500 }, fileChanged); - }; - - fileChanged(); - return { - filename: filename, - close: function () { - _fs.unwatchFile(filename, fileChanged); - } - }; - }, - run: function (source, filename) { - require.main.filename = filename; - require.main.paths = _module._nodeModulePaths(_path.dirname(_fs.realpathSync(filename))); - require.main._compile(source, filename); - }, - getExecutingFilePath: function () { - return process.mainModule.filename; - }, - quit: process.exit - }; - } - ; - - if (typeof ActiveXObject === "function") - return getWindowsScriptHostIO(); else if (typeof require === "function") - return getNodeIO(); else - return null; -})(); +var IOUtils; +(function (IOUtils) { + function createDirectoryStructure(ioHost, dirName) { + if (ioHost.directoryExists(dirName)) { + return; + } + + var parentDirectory = ioHost.dirName(dirName); + if (parentDirectory != "") { + createDirectoryStructure(ioHost, parentDirectory); + } + ioHost.createDirectory(dirName); + } + + function createFileAndFolderStructure(ioHost, fileName, useUTF8) { + var path = ioHost.resolvePath(fileName); + var dirName = ioHost.dirName(path); + createDirectoryStructure(ioHost, dirName); + return ioHost.createFile(path, useUTF8); + } + IOUtils.createFileAndFolderStructure = createFileAndFolderStructure; + + function throwIOError(message, error) { + var errorMessage = message; + if (error && error.message) { + errorMessage += (" " + error.message); + } + throw new Error(errorMessage); + } + IOUtils.throwIOError = throwIOError; +})(IOUtils || (IOUtils = {})); + +var IO = (function () { + function getWindowsScriptHostIO() { + var fso = new ActiveXObject("Scripting.FileSystemObject"); + var streamObjectPool = []; + + function getStreamObject() { + if (streamObjectPool.length > 0) { + return streamObjectPool.pop(); + } else { + return new ActiveXObject("ADODB.Stream"); + } + } + + function releaseStreamObject(obj) { + streamObjectPool.push(obj); + } + + var args = []; + for (var i = 0; i < WScript.Arguments.length; i++) { + args[i] = WScript.Arguments.Item(i); + } + + return { + readFile: function (path) { + try { + var streamObj = getStreamObject(); + streamObj.Open(); + streamObj.Type = 2; + streamObj.Charset = 'x-ansi'; + streamObj.LoadFromFile(path); + var bomChar = streamObj.ReadText(2); + streamObj.Position = 0; + if ((bomChar.charCodeAt(0) == 0xFE && bomChar.charCodeAt(1) == 0xFF) || (bomChar.charCodeAt(0) == 0xFF && bomChar.charCodeAt(1) == 0xFE)) { + streamObj.Charset = 'unicode'; + } else if (bomChar.charCodeAt(0) == 0xEF && bomChar.charCodeAt(1) == 0xBB) { + streamObj.Charset = 'utf-8'; + } + + var str = streamObj.ReadText(-1); + streamObj.Close(); + releaseStreamObject(streamObj); + return str; + } catch (err) { + IOUtils.throwIOError("Error reading file \"" + path + "\".", err); + } + }, + writeFile: function (path, contents) { + var file = this.createFile(path); + file.Write(contents); + file.Close(); + }, + fileExists: function (path) { + return fso.FileExists(path); + }, + resolvePath: function (path) { + return fso.GetAbsolutePathName(path); + }, + dirName: function (path) { + return fso.GetParentFolderName(path); + }, + findFile: function (rootPath, partialFilePath) { + var path = fso.GetAbsolutePathName(rootPath) + "/" + partialFilePath; + + while (true) { + if (fso.FileExists(path)) { + try { + var content = this.readFile(path); + return { content: content, path: path }; + } catch (err) { + } + } else { + rootPath = fso.GetParentFolderName(fso.GetAbsolutePathName(rootPath)); + + if (rootPath == "") { + return null; + } else { + path = fso.BuildPath(rootPath, partialFilePath); + } + } + } + }, + deleteFile: function (path) { + try { + if (fso.FileExists(path)) { + fso.DeleteFile(path, true); + } + } catch (e) { + IOUtils.throwIOError("Couldn't delete file '" + path + "'.", e); + } + }, + createFile: function (path, useUTF8) { + try { + var streamObj = getStreamObject(); + streamObj.Charset = useUTF8 ? 'utf-8' : 'x-ansi'; + streamObj.Open(); + return { + Write: function (str) { + streamObj.WriteText(str, 0); + }, + WriteLine: function (str) { + streamObj.WriteText(str, 1); + }, + Close: function () { + try { + streamObj.SaveToFile(path, 2); + } catch (saveError) { + IOUtils.throwIOError("Couldn't write to file '" + path + "'.", saveError); + } finally { + if (streamObj.State != 0) { + streamObj.Close(); + } + releaseStreamObject(streamObj); + } + } + }; + } catch (creationError) { + IOUtils.throwIOError("Couldn't write to file '" + path + "'.", creationError); + } + }, + directoryExists: function (path) { + return fso.FolderExists(path); + }, + createDirectory: function (path) { + try { + if (!this.directoryExists(path)) { + fso.CreateFolder(path); + } + } catch (e) { + IOUtils.throwIOError("Couldn't create directory '" + path + "'.", e); + } + }, + dir: function (path, spec, options) { + options = options || {}; + function filesInFolder(folder, root) { + var paths = []; + var fc; + + if (options.recursive) { + fc = new Enumerator(folder.subfolders); + + for (; !fc.atEnd(); fc.moveNext()) { + paths = paths.concat(filesInFolder(fc.item(), root + "/" + fc.item().Name)); + } + } + + fc = new Enumerator(folder.files); + + for (; !fc.atEnd(); fc.moveNext()) { + if (!spec || fc.item().Name.match(spec)) { + paths.push(root + "/" + fc.item().Name); + } + } + + return paths; + } + + var folder = fso.GetFolder(path); + var paths = []; + + return filesInFolder(folder, path); + }, + print: function (str) { + WScript.StdOut.Write(str); + }, + printLine: function (str) { + WScript.Echo(str); + }, + arguments: args, + stderr: WScript.StdErr, + stdout: WScript.StdOut, + watchFile: null, + run: function (source, filename) { + try { + eval(source); + } catch (e) { + IOUtils.throwIOError("Error while executing file '" + filename + "'.", e); + } + }, + getExecutingFilePath: function () { + return WScript.ScriptFullName; + }, + quit: function (exitCode) { + if (typeof exitCode === "undefined") { exitCode = 0; } + try { + WScript.Quit(exitCode); + } catch (e) { + } + } + }; + } + ; + + function getNodeIO() { + var _fs = require('fs'); + var _path = require('path'); + var _module = require('module'); + + return { + readFile: function (file) { + try { + var buffer = _fs.readFileSync(file); + switch (buffer[0]) { + case 0xFE: + if (buffer[1] == 0xFF) { + var i = 0; + while ((i + 1) < buffer.length) { + var temp = buffer[i]; + buffer[i] = buffer[i + 1]; + buffer[i + 1] = temp; + i += 2; + } + return buffer.toString("ucs2", 2); + } + break; + case 0xFF: + if (buffer[1] == 0xFE) { + return buffer.toString("ucs2", 2); + } + break; + case 0xEF: + if (buffer[1] == 0xBB) { + return buffer.toString("utf8", 3); + } + } + + return buffer.toString(); + } catch (e) { + IOUtils.throwIOError("Error reading file \"" + file + "\".", e); + } + }, + writeFile: _fs.writeFileSync, + deleteFile: function (path) { + try { + _fs.unlinkSync(path); + } catch (e) { + IOUtils.throwIOError("Couldn't delete file '" + path + "'.", e); + } + }, + fileExists: function (path) { + return _fs.existsSync(path); + }, + createFile: function (path, useUTF8) { + function mkdirRecursiveSync(path) { + var stats = _fs.statSync(path); + if (stats.isFile()) { + IOUtils.throwIOError("\"" + path + "\" exists but isn't a directory.", null); + } else if (stats.isDirectory()) { + return; + } else { + mkdirRecursiveSync(_path.dirname(path)); + _fs.mkdirSync(path, 0775); + } + } + + mkdirRecursiveSync(_path.dirname(path)); + + try { + var fd = _fs.openSync(path, 'w'); + } catch (e) { + IOUtils.throwIOError("Couldn't write to file '" + path + "'.", e); + } + return { + Write: function (str) { + _fs.writeSync(fd, str); + }, + WriteLine: function (str) { + _fs.writeSync(fd, str + '\r\n'); + }, + Close: function () { + _fs.closeSync(fd); + fd = null; + } + }; + }, + dir: function dir(path, spec, options) { + options = options || {}; + + function filesInFolder(folder) { + var paths = []; + + var files = _fs.readdirSync(folder); + for (var i = 0; i < files.length; i++) { + var stat = _fs.statSync(folder + "/" + files[i]); + if (options.recursive && stat.isDirectory()) { + paths = paths.concat(filesInFolder(folder + "/" + files[i])); + } else if (stat.isFile() && (!spec || files[i].match(spec))) { + paths.push(folder + "/" + files[i]); + } + } + + return paths; + } + + return filesInFolder(path); + }, + createDirectory: function (path) { + try { + if (!this.directoryExists(path)) { + _fs.mkdirSync(path); + } + } catch (e) { + IOUtils.throwIOError("Couldn't create directory '" + path + "'.", e); + } + }, + directoryExists: function (path) { + return _fs.existsSync(path) && _fs.lstatSync(path).isDirectory(); + }, + resolvePath: function (path) { + return _path.resolve(path); + }, + dirName: function (path) { + return _path.dirname(path); + }, + findFile: function (rootPath, partialFilePath) { + var path = rootPath + "/" + partialFilePath; + + while (true) { + if (_fs.existsSync(path)) { + try { + var content = this.readFile(path); + return { content: content, path: path }; + } catch (err) { + } + } else { + var parentPath = _path.resolve(rootPath, ".."); + + if (rootPath === parentPath) { + return null; + } else { + rootPath = parentPath; + path = _path.resolve(rootPath, partialFilePath); + } + } + } + }, + print: function (str) { + process.stdout.write(str); + }, + printLine: function (str) { + process.stdout.write(str + '\n'); + }, + arguments: process.argv.slice(2), + stderr: { + Write: function (str) { + process.stderr.write(str); + }, + WriteLine: function (str) { + process.stderr.write(str + '\n'); + }, + Close: function () { + } + }, + stdout: { + Write: function (str) { + process.stdout.write(str); + }, + WriteLine: function (str) { + process.stdout.write(str + '\n'); + }, + Close: function () { + } + }, + watchFile: function (filename, callback) { + var firstRun = true; + var processingChange = false; + + var fileChanged = function (curr, prev) { + if (!firstRun) { + if (curr.mtime < prev.mtime) { + return; + } + + _fs.unwatchFile(filename, fileChanged); + if (!processingChange) { + processingChange = true; + callback(filename); + setTimeout(function () { + processingChange = false; + }, 100); + } + } + firstRun = false; + _fs.watchFile(filename, { persistent: true, interval: 500 }, fileChanged); + }; + + fileChanged(); + return { + filename: filename, + close: function () { + _fs.unwatchFile(filename, fileChanged); + } + }; + }, + run: function (source, filename) { + require.main.filename = filename; + require.main.paths = _module._nodeModulePaths(_path.dirname(_fs.realpathSync(filename))); + require.main._compile(source, filename); + }, + getExecutingFilePath: function () { + return process.mainModule.filename; + }, + quit: process.exit + }; + } + ; + + if (typeof ActiveXObject === "function") + return getWindowsScriptHostIO(); else if (typeof require === "function") + return getNodeIO(); else + return null; +})(); diff --git a/_infrastructure/tests/testRunner.js b/_infrastructure/tests/testRunner.js index a2f54dd5f..53a36dcd3 100644 --- a/_infrastructure/tests/testRunner.js +++ b/_infrastructure/tests/testRunner.js @@ -1,619 +1,152 @@ -var ExecResult = (function () { - function ExecResult() { - this.stdout = ""; - this.stderr = ""; - } - return ExecResult; -})(); -var WindowsScriptHostExec = (function () { - function WindowsScriptHostExec() { } - WindowsScriptHostExec.prototype.exec = function (filename, cmdLineArgs, handleResult) { - var result = new ExecResult(); - var shell = new ActiveXObject('WScript.Shell'); - try { - var process = shell.Exec(filename + ' ' + cmdLineArgs.join(' ')); - } catch (e) { - result.stderr = e.message; - result.exitCode = 1; - handleResult(result); - return; - } - while(process.Status != 0) { - } - result.exitCode = process.ExitCode; - if(!process.StdOut.AtEndOfStream) { - result.stdout = process.StdOut.ReadAll(); - } - if(!process.StdErr.AtEndOfStream) { - result.stderr = process.StdErr.ReadAll(); - } - handleResult(result); - }; - return WindowsScriptHostExec; -})(); -var NodeExec = (function () { - function NodeExec() { } - NodeExec.prototype.exec = function (filename, cmdLineArgs, handleResult) { - var nodeExec = require('child_process').exec; - var result = new ExecResult(); - result.exitCode = null; - var cmdLine = filename + ' ' + cmdLineArgs.join(' '); - var process = nodeExec(cmdLine, function (error, stdout, stderr) { - result.stdout = stdout; - result.stderr = stderr; - result.exitCode = error ? error.code : 0; - handleResult(result); - }); - }; - return NodeExec; -})(); -var Exec = (function () { - var global = Function("return this;").call(null); - if(typeof global.ActiveXObject !== "undefined") { - return new WindowsScriptHostExec(); - } else { - return new NodeExec(); - } -})(); -var IOUtils; -(function (IOUtils) { - function createDirectoryStructure(ioHost, dirName) { - if(ioHost.directoryExists(dirName)) { - return; - } - var parentDirectory = ioHost.dirName(dirName); - if(parentDirectory != "") { - createDirectoryStructure(ioHost, parentDirectory); - } - ioHost.createDirectory(dirName); - } - function createFileAndFolderStructure(ioHost, fileName, useUTF8) { - var path = ioHost.resolvePath(fileName); - var dirName = ioHost.dirName(path); - createDirectoryStructure(ioHost, dirName); - return ioHost.createFile(path, useUTF8); - } - IOUtils.createFileAndFolderStructure = createFileAndFolderStructure; - function throwIOError(message, error) { - var errorMessage = message; - if(error && error.message) { - errorMessage += (" " + error.message); - } - throw new Error(errorMessage); - } - IOUtils.throwIOError = throwIOError; -})(IOUtils || (IOUtils = {})); - -var IO = (function () { - function getWindowsScriptHostIO() { - var fso = new ActiveXObject("Scripting.FileSystemObject"); - var streamObjectPool = []; - function getStreamObject() { - if(streamObjectPool.length > 0) { - return streamObjectPool.pop(); - } else { - return new ActiveXObject("ADODB.Stream"); - } - } - function releaseStreamObject(obj) { - streamObjectPool.push(obj); - } - var args = []; - for(var i = 0; i < WScript.Arguments.length; i++) { - args[i] = WScript.Arguments.Item(i); - } - return { - readFile: function (path) { - try { - var streamObj = getStreamObject(); - streamObj.Open(); - streamObj.Type = 2; - streamObj.Charset = 'x-ansi'; - streamObj.LoadFromFile(path); - var bomChar = streamObj.ReadText(2); - streamObj.Position = 0; - if((bomChar.charCodeAt(0) == 254 && bomChar.charCodeAt(1) == 255) || (bomChar.charCodeAt(0) == 255 && bomChar.charCodeAt(1) == 254)) { - streamObj.Charset = 'unicode'; - } else if(bomChar.charCodeAt(0) == 239 && bomChar.charCodeAt(1) == 187) { - streamObj.Charset = 'utf-8'; - } - var str = streamObj.ReadText(-1); - streamObj.Close(); - releaseStreamObject(streamObj); - return str; - } catch (err) { - IOUtils.throwIOError("Error reading file \"" + path + "\".", err); - } - }, - writeFile: function (path, contents) { - var file = this.createFile(path); - file.Write(contents); - file.Close(); - }, - fileExists: function (path) { - return fso.FileExists(path); - }, - resolvePath: function (path) { - return fso.GetAbsolutePathName(path); - }, - dirName: function (path) { - return fso.GetParentFolderName(path); - }, - findFile: function (rootPath, partialFilePath) { - var path = fso.GetAbsolutePathName(rootPath) + "/" + partialFilePath; - while(true) { - if(fso.FileExists(path)) { - try { - var content = this.readFile(path); - return { - content: content, - path: path - }; - } catch (err) { - } - } else { - rootPath = fso.GetParentFolderName(fso.GetAbsolutePathName(rootPath)); - if(rootPath == "") { - return null; - } else { - path = fso.BuildPath(rootPath, partialFilePath); - } - } - } - }, - deleteFile: function (path) { - try { - if(fso.FileExists(path)) { - fso.DeleteFile(path, true); - } - } catch (e) { - IOUtils.throwIOError("Couldn't delete file '" + path + "'.", e); - } - }, - createFile: function (path, useUTF8) { - try { - var streamObj = getStreamObject(); - streamObj.Charset = useUTF8 ? 'utf-8' : 'x-ansi'; - streamObj.Open(); - return { - Write: function (str) { - streamObj.WriteText(str, 0); - }, - WriteLine: function (str) { - streamObj.WriteText(str, 1); - }, - Close: function () { - try { - streamObj.SaveToFile(path, 2); - } catch (saveError) { - IOUtils.throwIOError("Couldn't write to file '" + path + "'.", saveError); - }finally { - if(streamObj.State != 0) { - streamObj.Close(); - } - releaseStreamObject(streamObj); - } - } - }; - } catch (creationError) { - IOUtils.throwIOError("Couldn't write to file '" + path + "'.", creationError); - } - }, - directoryExists: function (path) { - return fso.FolderExists(path); - }, - createDirectory: function (path) { - try { - if(!this.directoryExists(path)) { - fso.CreateFolder(path); - } - } catch (e) { - IOUtils.throwIOError("Couldn't create directory '" + path + "'.", e); - } - }, - dir: function (path, spec, options) { - options = options || { - }; - function filesInFolder(folder, root) { - var paths = []; - var fc; - if(options.recursive) { - fc = new Enumerator(folder.subfolders); - for(; !fc.atEnd(); fc.moveNext()) { - paths = paths.concat(filesInFolder(fc.item(), root + "/" + fc.item().Name)); - } - } - fc = new Enumerator(folder.files); - for(; !fc.atEnd(); fc.moveNext()) { - if(!spec || fc.item().Name.match(spec)) { - paths.push(root + "/" + fc.item().Name); - } - } - return paths; - } - var folder = fso.GetFolder(path); - var paths = []; - return filesInFolder(folder, path); - }, - print: function (str) { - WScript.StdOut.Write(str); - }, - printLine: function (str) { - WScript.Echo(str); - }, - arguments: args, - stderr: WScript.StdErr, - stdout: WScript.StdOut, - watchFile: null, - run: function (source, filename) { - try { - eval(source); - } catch (e) { - IOUtils.throwIOError("Error while executing file '" + filename + "'.", e); - } - }, - getExecutingFilePath: function () { - return WScript.ScriptFullName; - }, - quit: function (exitCode) { - if (typeof exitCode === "undefined") { exitCode = 0; } - try { - WScript.Quit(exitCode); - } catch (e) { - } - } - }; - } - ; - function getNodeIO() { - var _fs = require('fs'); - var _path = require('path'); - var _module = require('module'); - return { - readFile: function (file) { - try { - var buffer = _fs.readFileSync(file); - switch(buffer[0]) { - case 254: - if(buffer[1] == 255) { - var i = 0; - while((i + 1) < buffer.length) { - var temp = buffer[i]; - buffer[i] = buffer[i + 1]; - buffer[i + 1] = temp; - i += 2; - } - return buffer.toString("ucs2", 2); - } - break; - case 255: - if(buffer[1] == 254) { - return buffer.toString("ucs2", 2); - } - break; - case 239: - if(buffer[1] == 187) { - return buffer.toString("utf8", 3); - } - } - return buffer.toString(); - } catch (e) { - IOUtils.throwIOError("Error reading file \"" + file + "\".", e); - } - }, - writeFile: _fs.writeFileSync, - deleteFile: function (path) { - try { - _fs.unlinkSync(path); - } catch (e) { - IOUtils.throwIOError("Couldn't delete file '" + path + "'.", e); - } - }, - fileExists: function (path) { - return _fs.existsSync(path); - }, - createFile: function (path, useUTF8) { - function mkdirRecursiveSync(path) { - var stats = _fs.statSync(path); - if(stats.isFile()) { - IOUtils.throwIOError("\"" + path + "\" exists but isn't a directory.", null); - } else if(stats.isDirectory()) { - return; - } else { - mkdirRecursiveSync(_path.dirname(path)); - _fs.mkdirSync(path, 775); - } - } - mkdirRecursiveSync(_path.dirname(path)); - try { - var fd = _fs.openSync(path, 'w'); - } catch (e) { - IOUtils.throwIOError("Couldn't write to file '" + path + "'.", e); - } - return { - Write: function (str) { - _fs.writeSync(fd, str); - }, - WriteLine: function (str) { - _fs.writeSync(fd, str + '\r\n'); - }, - Close: function () { - _fs.closeSync(fd); - fd = null; - } - }; - }, - dir: function dir(path, spec, options) { - options = options || { - }; - function filesInFolder(folder, deep) { - var paths = []; - var files = _fs.readdirSync(folder); - for(var i = 0; i < files.length; i++) { - var stat = _fs.statSync(folder + "/" + files[i]); - if(options.recursive && stat.isDirectory()) { - if(deep < (options.deep || 100)) { - paths = paths.concat(filesInFolder(folder + "/" + files[i], 1)); - } - } else if(stat.isFile() && (!spec || files[i].match(spec))) { - paths.push(folder + "/" + files[i]); - } - } - return paths; - } - return filesInFolder(path, 0); - }, - createDirectory: function (path) { - try { - if(!this.directoryExists(path)) { - _fs.mkdirSync(path); - } - } catch (e) { - IOUtils.throwIOError("Couldn't create directory '" + path + "'.", e); - } - }, - directoryExists: function (path) { - return _fs.existsSync(path) && _fs.lstatSync(path).isDirectory(); - }, - resolvePath: function (path) { - return _path.resolve(path); - }, - dirName: function (path) { - return _path.dirname(path); - }, - findFile: function (rootPath, partialFilePath) { - var path = rootPath + "/" + partialFilePath; - while(true) { - if(_fs.existsSync(path)) { - try { - var content = this.readFile(path); - return { - content: content, - path: path - }; - } catch (err) { - } - } else { - var parentPath = _path.resolve(rootPath, ".."); - if(rootPath === parentPath) { - return null; - } else { - rootPath = parentPath; - path = _path.resolve(rootPath, partialFilePath); - } - } - } - }, - print: function (str) { - process.stdout.write(str); - }, - printLine: function (str) { - process.stdout.write(str + '\n'); - }, - arguments: process.argv.slice(2), - stderr: { - Write: function (str) { - process.stderr.write(str); - }, - WriteLine: function (str) { - process.stderr.write(str + '\n'); - }, - Close: function () { - } - }, - stdout: { - Write: function (str) { - process.stdout.write(str); - }, - WriteLine: function (str) { - process.stdout.write(str + '\n'); - }, - Close: function () { - } - }, - watchFile: function (filename, callback) { - var firstRun = true; - var processingChange = false; - var fileChanged = function (curr, prev) { - if(!firstRun) { - if(curr.mtime < prev.mtime) { - return; - } - _fs.unwatchFile(filename, fileChanged); - if(!processingChange) { - processingChange = true; - callback(filename); - setTimeout(function () { - processingChange = false; - }, 100); - } - } - firstRun = false; - _fs.watchFile(filename, { - persistent: true, - interval: 500 - }, fileChanged); - }; - fileChanged(); - return { - filename: filename, - close: function () { - _fs.unwatchFile(filename, fileChanged); - } - }; - }, - run: function (source, filename) { - require.main.filename = filename; - require.main.paths = _module._nodeModulePaths(_path.dirname(_fs.realpathSync(filename))); - require.main._compile(source, filename); - }, - getExecutingFilePath: function () { - return process.mainModule.filename; - }, - quit: process.exit - }; - } - ; - if(typeof ActiveXObject === "function") { - return getWindowsScriptHostIO(); - } else if(typeof require === "function") { - return getNodeIO(); - } else { - return null; - } -})(); -var cfg = { - root: '.', - pattern: /.\-tests\.ts/g, - tsc: 'node ./_infrastructure/tests/typescript/tsc.js ', - exclude: { - '.git': true, - '.gitignore': true, - 'package.json': true, - '_infrastructure': true, - '.travis.yml': true, - 'LICENSE': true, - 'README.md': true, - '_ReSharper.DefinitelyTyped': true, - 'obj': true, - 'bin': true, - 'Properties': true, - 'DefinitelyTyped.csproj': true, - 'DefinitelyTyped.csproj.user': true, - 'DefinitelyTyped.sln': true, - 'DefinitelyTyped.v11.suo': true - } -}; -if(process.argv.length > 2) { - cfg.root = process.argv[2]; -} -var TestFile = (function () { - function TestFile() { - this.errors = []; - } - return TestFile; -})(); -var Test = (function () { - function Test(lib) { - this.lib = lib; - this.files = []; - } - return Test; -})(); -var Tests = (function () { - function Tests() { - this.tests = []; - } - return Tests; -})(); -function getLibDirectory(file) { - return file.substr(cfg.root.length).split('/')[1]; -} -function getErrorList(out) { - var splitContentByNewlines = function (content) { - var lines = content.split('\r\n'); - if(lines.length === 1) { - lines = content.split('\n'); - } - return lines; - }; - var result = []; - var lines = splitContentByNewlines(out); - for(var i = 0; i < lines.length; i++) { - if(lines[i]) { - result.push(lines[i]); - } - } - return result; -} -function runTests(testFiles) { - var tests = new Tests(); - Exec.exec(cfg.tsc, [ - testFiles[testIndex] - ], function (ExecResult) { - var lib = getLibDirectory(testFiles[testIndex]); - cache_visited_libs[lib] = true; - var testFile = new TestFile(); - testFile.name = testFiles[testIndex]; - testFile.errors = getErrorList(ExecResult.stderr); - if(testFile.errors.length == 0) { - total_success++; - } else { - total_failure++; - } - console.log(' [\033[36m' + lib + '\033[0m] ' + testFiles[testIndex].substr(cfg.root.length) + ' - ' + (testFile.errors.length == 0 ? '\033[32msuccess\033[0m' : '\033[31mfailure\033[0m')); - var test = new Test(lib); - test.files.push(testFile); - tests.tests.push(test); - testIndex++; - if(testIndex < totalTest) { - Exec.exec(cfg.tsc, [ - testFiles[testIndex] - ], arguments.callee); - } else { - var withoutTests = { - }; - for(var k = 0; k < allFiles.length; k++) { - var rootFolder = allFiles[k].substr(cfg.root.length).split('/')[1]; - if(!(rootFolder in cfg.exclude)) { - if(!(rootFolder in cache_visited_libs)) { - withoutTests[rootFolder] = true; - } - } - } - var withoutTestsCount = 0; - for(var attr in withoutTests) { - var test = new Test(attr); - tests.tests.push(test); - console.log(' [\033[36m' + attr + '\033[0m] without tests'); - withoutTestsCount++; - } - console.log('\n> ' + (total_failure + total_success + withoutTestsCount) + ' tests. ' + '\033[32m' + total_success + ' tests success\033[0m, ' + '\033[31m' + total_failure + ' tests failed\033[0m and ' + withoutTestsCount + ' definitions without tests.\n'); - if(total_failure > 0) { - process.exit(1); - } - } - }); -} -var testFiles = IO.dir(cfg.root, cfg.pattern, { - recursive: true, - deep: 1 -}); -var allFiles = IO.dir(cfg.root, null, { - recursive: true -}); -var totalTest = testFiles.length; -var testIndex = 0; -var cache_visited_libs = { -}; -var total_failure = 0; -var total_success = 0; -var tscVersion = '?.?.?'; -Exec.exec(cfg.tsc, [ - '-version' -], function (ExecResult) { - tscVersion = ExecResult.stdout; - console.log('$ tsc -version'); - console.log(tscVersion); - runTests(testFiles); -}); +var cfg = { + root: '.', + pattern: /.\-tests\.ts/g, + tsc: 'node ./_infrastructure/tests/typescript/tsc.js ', + exclude: { + '.git': true, + '.gitignore': true, + 'package.json': true, + '_infrastructure': true, + '.travis.yml': true, + 'LICENSE': true, + 'README.md': true, + '_ReSharper.DefinitelyTyped': true, + 'obj': true, + 'bin': true, + 'Properties': true, + 'DefinitelyTyped.csproj': true, + 'DefinitelyTyped.csproj.user': true, + 'DefinitelyTyped.sln': true, + 'DefinitelyTyped.v11.suo': true + } +}; + +if (process.argv.length > 2) { + cfg.root = process.argv[2]; +} + +var TestFile = (function () { + function TestFile() { + this.errors = []; + } + return TestFile; +})(); + +var Test = (function () { + function Test(lib) { + this.lib = lib; + this.files = []; + } + return Test; +})(); + +var Tests = (function () { + function Tests() { + this.tests = []; + } + return Tests; +})(); + +function getLibDirectory(file) { + return file.substr(cfg.root.length).split('/')[1]; +} + +function getErrorList(out) { + var splitContentByNewlines = function (content) { + var lines = content.split('\r\n'); + if (lines.length === 1) { + lines = content.split('\n'); + } + return lines; + }; + + var result = []; + + var lines = splitContentByNewlines(out); + + for (var i = 0; i < lines.length; i++) { + if (lines[i]) { + result.push(lines[i]); + } + } + + return result; +} + +function runTests(testFiles) { + var tests = new Tests(); + + Exec.exec(cfg.tsc, [testFiles[testIndex]], function (ExecResult) { + var lib = getLibDirectory(testFiles[testIndex]); + + cache_visited_libs[lib] = true; + + var testFile = new TestFile(); + testFile.name = testFiles[testIndex]; + testFile.errors = getErrorList(ExecResult.stderr); + + if (testFile.errors.length == 0) { + total_success++; + } else { + total_failure++; + } + + console.log(' [\033[36m' + lib + '\033[0m] ' + testFiles[testIndex].substr(cfg.root.length) + ' - ' + (testFile.errors.length == 0 ? '\033[32msuccess\033[0m' : '\033[31mfailure\033[0m')); + + var test = new Test(lib); + test.files.push(testFile); + tests.tests.push(test); + + testIndex++; + if (testIndex < totalTest) { + Exec.exec(cfg.tsc, [testFiles[testIndex]], arguments.callee); + } else { + var withoutTests = {}; + for (var k = 0; k < allFiles.length; k++) { + var rootFolder = allFiles[k].substr(cfg.root.length).split('/')[1]; + if (!(rootFolder in cfg.exclude)) { + if (!(rootFolder in cache_visited_libs)) { + withoutTests[rootFolder] = true; + } + } + } + + var withoutTestsCount = 0; + for (var attr in withoutTests) { + var test = new Test(attr); + tests.tests.push(test); + + console.log(' [\033[36m' + attr + '\033[0m] without tests'); + withoutTestsCount++; + } + + console.log('\n> ' + (total_failure + total_success + withoutTestsCount) + ' tests. ' + '\033[32m' + total_success + ' tests success\033[0m, ' + '\033[31m' + total_failure + ' tests failed\033[0m and ' + withoutTestsCount + ' definitions without tests.\n'); + + if (total_failure > 0) { + process.exit(1); + } + } + }); +} + +var testFiles = IO.dir(cfg.root, cfg.pattern, { recursive: true, deep: 1 }); + +var allFiles = IO.dir(cfg.root, null, { recursive: true }); + +var totalTest = testFiles.length; +var testIndex = 0; +var cache_visited_libs = {}; + +var total_failure = 0; +var total_success = 0; + +var tscVersion = '?.?.?'; + +Exec.exec(cfg.tsc, ['-version'], function (ExecResult) { + tscVersion = ExecResult.stdout; + + console.log('$ tsc -version'); + console.log(tscVersion); + + runTests(testFiles); +}); diff --git a/_infrastructure/typescript/lib.d.ts b/_infrastructure/typescript/lib.d.ts new file mode 100644 index 000000000..95d15c1a2 --- /dev/null +++ b/_infrastructure/typescript/lib.d.ts @@ -0,0 +1,9074 @@ +/* ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + +/// + +//////////////// +/// ECMAScript APIs +//////////////// + +declare var NaN: number; +declare var Infinity: number; + +/** + * Evaluates JavaScript code and executes it. + * @param x A String value that contains valid JavaScript code. + */ +declare function eval(x: string): any; + +/** + * Converts A string to an integer. + * @param s A string to convert into a number. + * @param radix A value between 2 and 36 that specifies the base of the number in numString. + * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. + * All other strings are considered decimal. + */ +declare function parseInt(s: string, radix?: number): number; + +/** + * Converts a string to a floating-point number. + * @param string A string that contains a floating-point number. + */ +declare function parseFloat(string: string): number; + +/** + * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number). + * @param number A numeric value. + */ +declare function isNaN(number: number): boolean; + +/** + * Determines whether a supplied number is finite. + * @param number Any numeric value. + */ +declare function isFinite(number: number): boolean; + +/** + * Gets the unencoded version of an encoded Uniform Resource Identifier (URI). + * @param encodedURI A value representing an encoded URI. + */ +declare function decodeURI(encodedURI: string): string; + +/** + * Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI). + * @param encodedURIComponent A value representing an encoded URI component. + */ +declare function decodeURIComponent(encodedURIComponent: string): string; + +/** + * Encodes a text string as a valid Uniform Resource Identifier (URI) + * @param uri A value representing an encoded URI. + */ +declare function encodeURI(uri: string): string; + +/** + * Encodes a text string as a valid component of a Uniform Resource Identifier (URI). + * @param uriComponent A value representing an encoded URI component. + */ +declare function encodeURIComponent(uriComponent: string): string; + +interface PropertyDescriptor { + configurable?: boolean; + enumerable?: boolean; + value?: any; + writable?: boolean; + get?(): any; + set?(v: any): void; +} + +interface PropertyDescriptorMap { + [s: string]: PropertyDescriptor; +} + +interface Object { + /** Returns a string representation of an object. */ + toString(): string; + + /** Returns a date converted to a string using the current locale. */ + toLocaleString(): string; + + /** Returns the primitive value of the specified object. */ + valueOf(): Object; + + /** + * Determines whether an object has a property with the specified name. + * @param v A property name. + */ + hasOwnProperty(v: string): boolean; + + /** + * Determines whether an object exists in another object's prototype chain. + * @param v Another object whose prototype chain is to be checked. + */ + isPrototypeOf(v: Object): boolean; + + /** + * Determines whether a specified property is enumerable. + * @param v A property name. + */ + propertyIsEnumerable(v: string): boolean; + + [s: string]: any; +} + +/** + * Provides functionality common to all JavaScript objects. + */ +declare var Object: { + new (value?: any): Object; + (): any; + (value: any): any; + + /** A reference to the prototype for a class of objects. */ + prototype: Object; + + /** + * Returns the prototype of an object. + * @param o The object that references the prototype. + */ + getPrototypeOf(o: any): any; + + /** + * Gets the own property descriptor of the specified object. + * An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype. + * @param o Object that contains the property. + * @param p Name of the property. + */ + getOwnPropertyDescriptor(o: any, p: string): PropertyDescriptor; + + /** + * Returns the names of the own properties of an object. The own properties of an object are those that are defined directly + * on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions. + * @param o Object that contains the own properties. + */ + getOwnPropertyNames(o: any): string[]; + + /** + * Creates an object that has the specified prototype, and that optionally contains specified properties. + * @param o Object to use as a prototype. May be null + * @param properties JavaScript object that contains one or more property descriptors. + */ + create(o: any, properties?: PropertyDescriptorMap): any; + + /** + * Adds a property to an object, or modifies attributes of an existing property. + * @param o Object on which to add or modify the property. This can be a native JavaScript object (that is, a user-defined object or a built in object) or a DOM object. + * @param p The property name. + * @param attributes Descriptor for the property. It can be for a data property or an accessor property. + */ + defineProperty(o: any, p: string, attributes: PropertyDescriptor): any; + + /** + * Adds one or more properties to an object, and/or modifies attributes of existing properties. + * @param o Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object. + * @param properties JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property. + */ + defineProperties(o: any, properties: PropertyDescriptorMap): any; + + /** + * Prevents the modification of attributes of existing properties, and prevents the addition of new properties. + * @param o Object on which to lock the attributes. + */ + seal(o: any): any; + + /** + * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. + * @param o Object on which to lock the attributes. + */ + freeze(o: any): any; + + /** + * Prevents the addition of new properties to an object. + * @param o Object to make non-extensible. + */ + preventExtensions(o: any): any; + + /** + * Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object. + * @param o Object to test. + */ + isSealed(o: any): boolean; + + /** + * Returns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object. + * @param o Object to test. + */ + isFrozen(o: any): boolean; + + /** + * Returns a value that indicates whether new properties can be added to an object. + * @param o Object to test. + */ + isExtensible(o: any): boolean; + + /** + * Returns the names of the enumerable properties and methods of an object. + * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. + */ + keys(o: any): string[]; +} + +/** + * Creates a new function. + */ +interface Function { + /** + * Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function. + * @param thisArg The object to be used as the this object. + * @param argArray A set of arguments to be passed to the function. + */ + apply(thisArg: any, argArray?: any): any; + + /** + * Calls a method of an object, substituting another object for the current object. + * @param thisArg The object to be used as the current object. + * @param argArray A list of arguments to be passed to the method. + */ + call(thisArg: any, ...argArray: any[]): any; + + /** + * For a given function, creates a bound function that has the same body as the original function. + * The this object of the bound function is associated with the specified object, and has the specified initial parameters. + * @param thisArg An object to which the this keyword can refer inside the new function. + * @param argArray A list of arguments to be passed to the new function. + */ + bind(thisArg: any, ...argArray: any[]): any; + + prototype: any; + length: number; + + // Non-standard extensions + arguments: any; + caller: Function; +} + +declare var Function: { + /** + * Creates a new function. + * @param args A list of arguments the function accepts. + */ + new (...args: string[]): Function; + (...args: string[]): Function; + prototype: Function; +} + +interface IArguments { + [index: number]: any; + length: number; + callee: Function; +} + +interface String { + /** Returns a string representation of a string. */ + toString(): string; + + /** + * Returns the character at the specified index. + * @param pos The zero-based index of the desired character. + */ + charAt(pos: number): string; + + /** + * Returns the Unicode value of the character at the specified location. + * @param index The zero-based index of the desired character. If there is no character at the specified index, NaN is returned. + */ + charCodeAt(index: number): number; + + /** + * Returns a string that contains the concatenation of two or more strings. + * @param strings The strings to append to the end of the string. + */ + concat(...strings: string[]): string; + + /** + * Returns the position of the first occurrence of a substring. + * @param searchString The substring to search for in the string + * @param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string. + */ + indexOf(searchString: string, position?: number): number; + + /** + * Returns the last occurrence of a substring in the string. + * @param searchString The substring to search for. + * @param position The index at which to begin searching. If omitted, the search begins at the end of the string. + */ + lastIndexOf(searchString: string, position?: number): number; + + /** + * Determines whether two strings are equivalent in the current locale. + * @param that String to compare to target string + */ + localeCompare(that: string): number; + + /** + * Matches a string with a regular expression, and returns an array containing the results of that search. + * @param regexp A variable name or string literal containing the regular expression pattern and flags. + */ + match(regexp: string): string[]; + /** + * Matches a string with a regular expression, and returns an array containing the results of that search. + * @param regexp A regular expression object that contains the regular expression pattern and applicable flags. + */ + match(regexp: RegExp): string[]; + + /** + * Replaces text in a string, using a regular expression or search string. + * @param searchValue A String object or string literal that represents the regular expression + * @param replaceValue A String object or string literal containing the text to replace for every successful match of rgExp in stringObj. + */ + replace(searchValue: string, replaceValue: string): string; + /** + * Replaces text in a string, using a regular expression or search string. + * @param searchValue A String object or string literal that represents the regular expression + * @param replaceValue A function that returns the replacement text. + */ + replace(searchValue: string, replaceValue: (substring: string, ...args: any[]) => string): string; + /** + * Replaces text in a string, using a regular expression or search string. + * @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags + * @param replaceValue A String object or string literal containing the text to replace for every successful match of rgExp in stringObj. + */ + replace(searchValue: RegExp, replaceValue: string): string; + /** + * Replaces text in a string, using a regular expression or search string. + * @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags + * @param replaceValue A function that returns the replacement text. + */ + replace(searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; + + /** + * Finds the first substring match in a regular expression search. + * @param regexp The regular expression pattern and applicable flags. + */ + search(regexp: string): number; + /** + * Finds the first substring match in a regular expression search. + * @param regexp The regular expression pattern and applicable flags. + */ + search(regexp: RegExp): number; + + /** + * Returns a section of a string. + * @param start The index to the beginning of the specified portion of stringObj. + * @param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end. + * If this value is not specified, the substring continues to the end of stringObj. + */ + slice(start: number, end?: number): string; + + /** + * Split a string into substrings using the specified separator and return them as an array. + * @param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned. + * @param limit A value used to limit the number of elements returned in the array. + */ + split(separator: string, limit?: number): string[]; + /** + * Split a string into substrings using the specified separator and return them as an array. + * @param separator A Regular Express that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned. + * @param limit A value used to limit the number of elements returned in the array. + */ + split(separator: RegExp, limit?: number): string[]; + + /** + * Returns the substring at the specified location within a String object. + * @param start The zero-based index integer indicating the beginning of the substring. + * @param end Zero-based index integer indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end. + * If end is omitted, the characters from start through the end of the original string are returned. + */ + substring(start: number, end?: number): string; + + /** Converts all the alphabetic characters in a string to lowercase. */ + toLowerCase(): string; + + /** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */ + toLocaleLowerCase(): string; + + /** Converts all the alphabetic characters in a string to uppercase. */ + toUpperCase(): string; + + /** Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. */ + toLocaleUpperCase(): string; + + /** Removes the leading and trailing white space and line terminator characters from a string. */ + trim(): string; + + /** Returns the length of a String object. */ + length: number; + + // IE extensions + /** + * Gets a substring beginning at the specified location and having the specified length. + * @param from The starting position of the desired substring. The index of the first character in the string is zero. + * @param length The number of characters to include in the returned substring. + */ + substr(from: number, length?: number): string; +} + +/** + * Allows manipulation and formatting of text strings and determination and location of substrings within strings. + */ +declare var String: { + new (value?: any): String; + (value?: any): string; + prototype: String; + fromCharCode(...codes: number[]): string; +} + +interface Boolean { +} +declare var Boolean: { + new (value?: any): Boolean; + (value?: any): boolean; + prototype: Boolean; +} + +interface Number { + toString(radix?: number): string; + toFixed(fractionDigits?: number): string; + toExponential(fractionDigits?: number): string; + toPrecision(precision: number): string; +} +/** An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers. */ +declare var Number: { + new (value?: any): Number; + (value?: any): number; + prototype: Number; + /** The largest number that can be represented in JavaScript. Equal to approximately 1.79E+308. */ + MAX_VALUE: number; + /** The closest number to zero that can be represented in JavaScript. Equal to approximately 5.00E-324. */ + MIN_VALUE: number; + /** + * A value that is not a number. + * In equality comparisons, NaN does not equal any value, including itself. To test whether a value is equivalent to NaN, use the isNaN function. + */ + NaN: number; + /** + * A value that is less than the largest negative number that can be represented in JavaScript. + * JavaScript displays NEGATIVE_INFINITY values as -infinity. + */ + NEGATIVE_INFINITY: number; + /** + * A value greater than the largest number that can be represented in JavaScript. + * JavaScript displays POSITIVE_INFINITY values as infinity. + */ + POSITIVE_INFINITY: number; +} + +interface Math { + /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */ + E: number; + /** The natural logarithm of 10. */ + LN10: number; + /** The natural logarithm of 2. */ + LN2: number; + /** The base-2 logarithm of e. */ + LOG2E: number; + /** The base-10 logarithm of e. */ + LOG10E: number; + /** Pi. This is the ratio of the circumference of a circle to its diameter. */ + PI: number; + /** The square root of 0.5, or, equivalently, one divided by the square root of 2. */ + SQRT1_2: number; + /** The square root of 2. */ + SQRT2: number; + /** + * Returns the absolute value of a number (the value without regard to whether it is positive or negative). + * For example, the absolute value of -5 is the same as the absolute value of 5. + * @param x A numeric expression for which the absolute value is needed. + */ + abs(x: number): number; + /** + * Returns the arc cosine (or inverse cosine) of a number. + * @param x A numeric expression. + */ + acos(x: number): number; + /** + * Returns the arcsine of a number. + * @param x A numeric expression. + */ + asin(x: number): number; + /** + * Returns the arctangent of a number. + * @param x A numeric expression for which the arctangent is needed. + */ + atan(x: number): number; + /** + * Returns the angle (in radians) from the X axis to a point (y,x). + * @param y A numeric expression representing the cartesian y-coordinate. + * @param x A numeric expression representing the cartesian x-coordinate. + */ + atan2(y: number, x: number): number; + /** + * Returns the smallest integer greater than or equal to its numeric argument. + * @param x A numeric expression. + */ + ceil(x: number): number; + /** + * Returns the cosine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + cos(x: number): number; + /** + * Returns e (the base of natural logarithms) raised to a power. + * @param x A numeric expression representing the power of e. + */ + exp(x: number): number; + /** + * Returns the greatest integer less than or equal to its numeric argument. + * @param x A numeric expression. + */ + floor(x: number): number; + /** + * Returns the natural logarithm (base e) of a number. + * @param x A numeric expression. + */ + log(x: number): number; + /** + * Returns the larger of a set of supplied numeric expressions. + * @param values Numeric expressions to be evaluated. + */ + max(...values: number[]): number; + /** + * Returns the smaller of a set of supplied numeric expressions. + * @param values Numeric expressions to be evaluated. + */ + min(...values: number[]): number; + /** + * Returns the value of a base expression taken to a specified power. + * @param x The base value of the expression. + * @param y The exponent value of the expression. + */ + pow(x: number, y: number): number; + /** Returns a pseudorandom number between 0 and 1. */ + random(): number; + /** + * Returns a supplied numeric expression rounded to the nearest integer. + * @param x The value to be rounded to the nearest integer. + */ + round(x: number): number; + /** + * Returns the sine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + sin(x: number): number; + /** + * Returns the square root of a number. + * @param x A numeric expression. + */ + sqrt(x: number): number; + /** + * Returns the tangent of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + tan(x: number): number; +} +/** An intrinsic object that provides basic mathematics functionality and constants. */ +declare var Math: Math; + +/** Enables basic storage and retrieval of dates and times. */ +interface Date { + /** Returns a string representation of a date. The format of the string depends on the locale. */ + toString(): string; + /** Returns a date as a string value. */ + toDateString(): string; + /** Returns a time as a string value. */ + toTimeString(): string; + toLocaleString(): string; + /** Returns a date as a string value appropriate to the host environment's current locale. */ + toLocaleDateString(): string; + /** Returns a time as a string value appropriate to the host environment's current locale. */ + toLocaleTimeString(): string; + /** Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC. */ + valueOf(): number; + /** Gets the time value in milliseconds. */ + getTime(): number; + /** Gets the year, using local time. */ + getFullYear(): number; + /** Gets the year using Universal Coordinated Time (UTC). */ + getUTCFullYear(): number; + /** Gets the month, using local time. */ + getMonth(): number; + /** Gets the month of a Date object using Universal Coordinated Time (UTC). */ + getUTCMonth(): number; + /** Gets the day-of-the-month, using local time. */ + getDate(): number; + /** Gets the day-of-the-month, using Universal Coordinated Time (UTC). */ + getUTCDate(): number; + /** Gets the day of the week, using local time. */ + getDay(): number; + /** Gets the day of the week using Universal Coordinated Time (UTC). */ + getUTCDay(): number; + /** Gets the hours in a date, using local time. */ + getHours(): number; + /** Gets the hours value in a Date object using Universal Coordinated Time (UTC). */ + getUTCHours(): number; + /** Gets the minutes of a Date object, using local time. */ + getMinutes(): number; + /** Gets the minutes of a Date object using Universal Coordinated Time (UTC). */ + getUTCMinutes(): number; + /** Gets the seconds of a Date object, using local time. */ + getSeconds(): number; + /** Gets the seconds of a Date object using Universal Coordinated Time (UTC). */ + getUTCSeconds(): number; + /** Gets the milliseconds of a Date, using local time. */ + getMilliseconds(): number; + /** Gets the milliseconds of a Date object using Universal Coordinated Time (UTC). */ + getUTCMilliseconds(): number; + /** Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC). */ + getTimezoneOffset(): number; + /** + * Sets the date and time value in the Date object. + * @param time A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT. + */ + setTime(time: number): void; + /** + * Sets the milliseconds value in the Date object using local time. + * @param ms A numeric value equal to the millisecond value. + */ + setMilliseconds(ms: number): void; + /** + * Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC). + * @param ms A numeric value equal to the millisecond value. + */ + setUTCMilliseconds(ms: number): void; + + /** + * Sets the seconds value in the Date object using local time. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setSeconds(sec: number, ms?: number): void; + /** + * Sets the seconds value in the Date object using Universal Coordinated Time (UTC). + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setUTCSeconds(sec: number, ms?: number): void; + /** + * Sets the minutes value in the Date object using local time. + * @param min A numeric value equal to the minutes value. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setMinutes(min: number, sec?: number, ms?: number): void; + /** + * Sets the minutes value in the Date object using Universal Coordinated Time (UTC). + * @param min A numeric value equal to the minutes value. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setUTCMinutes(min: number, sec?: number, ms?: number): void; + /** + * Sets the hour value in the Date object using local time. + * @param hours A numeric value equal to the hours value. + * @param min A numeric value equal to the minutes value. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setHours(hours: number, min?: number, sec?: number, ms?: number): void; + /** + * Sets the hours value in the Date object using Universal Coordinated Time (UTC). + * @param hours A numeric value equal to the hours value. + * @param min A numeric value equal to the minutes value. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setUTCHours(hours: number, min?: number, sec?: number, ms?: number): void; + /** + * Sets the numeric day-of-the-month value of the Date object using local time. + * @param date A numeric value equal to the day of the month. + */ + setDate(date: number): void; + /** + * Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC). + * @param date A numeric value equal to the day of the month. + */ + setUTCDate(date: number): void; + /** + * Sets the month value in the Date object using local time. + * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. + * @param date A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used. + */ + setMonth(month: number, date?: number): void; + /** + * Sets the month value in the Date object using Universal Coordinated Time (UTC). + * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. + * @param date A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used. + */ + setUTCMonth(month: number, date?: number): void; + /** + * Sets the year of the Date object using local time. + * @param year A numeric value for the year. + * @param month A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified. + * @param date A numeric value equal for the day of the month. + */ + setFullYear(year: number, month?: number, date?: number): void; + /** + * Sets the year value in the Date object using Universal Coordinated Time (UTC). + * @param year A numeric value equal to the year. + * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied. + * @param date A numeric value equal to the day of the month. + */ + setUTCFullYear(year: number, month?: number, date?: number): void; + /** Returns a date converted to a string using Universal Coordinated Time (UTC). */ + toUTCString(): string; + /** Returns a date as a string value in ISO format. */ + toISOString(): string; + /** Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization. */ + toJSON(key?: any): string; +} +/** + * Enables basic storage and retrieval of dates and times. + */ +declare var Date: { + new (): Date; + new (value: number): Date; + new (value: string): Date; + new (year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date; + (): string; + prototype: Date; + /** + * Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970. + * @param s A date string + */ + parse(s: string): number; + /** + * Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date. + * @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year. + * @param month The month as an integer between 0 and 11 (January to December). + * @param date The date as an integer between 1 and 31. + * @param hours Must be supplied if minutes is supplied. An integer from 0 to 23 (midnight to 11pm) that specifies the hour. + * @param minutes Must be supplied if seconds is supplied. An integer from 0 to 59 that specifies the minutes. + * @param seconds Must be supplied if milliseconds is supplied. An integer from 0 to 59 that specifies the seconds. + * @param ms An integer from 0 to 999 that specifies the milliseconds. + */ + UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number; + now(): number; +} + +interface RegExpExecArray { + [index: number]: string; + length: number; + + index: number; + input: string; + + toString(): string; + toLocaleString(): string; + concat(...items: string[][]): string[]; + join(separator?: string): string; + pop(): string; + push(...items: string[]): number; + reverse(): string[]; + shift(): string; + slice(start: number, end?: number): string[]; + sort(compareFn?: (a: string, b: string) => number): string[]; + splice(start: number): string[]; + splice(start: number, deleteCount: number, ...items: string[]): string[]; + unshift(...items: string[]): number; + + indexOf(searchElement: string, fromIndex?: number): number; + lastIndexOf(searchElement: string, fromIndex?: number): number; + every(callbackfn: (value: string, index: number, array: string[]) => boolean, thisArg?: any): boolean; + some(callbackfn: (value: string, index: number, array: string[]) => boolean, thisArg?: any): boolean; + forEach(callbackfn: (value: string, index: number, array: string[]) => void , thisArg?: any): void; + map(callbackfn: (value: string, index: number, array: string[]) => any, thisArg?: any): any[]; + filter(callbackfn: (value: string, index: number, array: string[]) => boolean, thisArg?: any): string[]; + reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: string[]) => any, initialValue?: any): any; + reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: string[]) => any, initialValue?: any): any; +} + + +interface RegExp { + /** + * Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search. + * @param string The String object or string literal on which to perform the search. + */ + exec(string: string): RegExpExecArray; + /** + * Returns a Boolean value that indicates whether or not a pattern exists in a searched string. + * @param string String on which to perform the search. + */ + test(string: string): boolean; + /** Returns a copy of the text of the regular expression pattern. Read-only. The rgExp argument is a Regular expression object. It can be a variable name or a literal. */ + source: string; + /** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */ + global: boolean; + /** Returns a Boolean value indicating the state of the ignoreCase flag (i) used with a regular expression. Default is false. Read-only. */ + ignoreCase: boolean; + /** Returns a Boolean value indicating the state of the multiline flag (m) used with a regular expression. Default is false. Read-only. */ + multiline: boolean; + + lastIndex: number; + + // Non-standard extensions + compile(): RegExp; +} +declare var RegExp: { + new (pattern: string, flags?: string): RegExp; + (pattern: string, flags?: string): RegExp; + + // Non-standard extensions + $1: string; + $2: string; + $3: string; + $4: string; + $5: string; + $6: string; + $7: string; + $8: string; + $9: string; + lastMatch: string; +} + +interface Error { + name: string; + message: string; +} +declare var Error: { + new (message?: string): Error; + (message?: string): Error; + prototype: Error; +} + +interface EvalError extends Error { +} +declare var EvalError: { + new (message?: string): EvalError; + (message?: string): EvalError; + prototype: EvalError; +} + +interface RangeError extends Error { +} +declare var RangeError: { + new (message?: string): RangeError; + (message?: string): RangeError; + prototype: RangeError; +} + +interface ReferenceError extends Error { +} +declare var ReferenceError: { + new (message?: string): ReferenceError; + (message?: string): ReferenceError; + prototype: ReferenceError; +} + +interface SyntaxError extends Error { +} +declare var SyntaxError: { + new (message?: string): SyntaxError; + (message?: string): SyntaxError; + prototype: SyntaxError; +} + +interface TypeError extends Error { +} +declare var TypeError: { + new (message?: string): TypeError; + (message?: string): TypeError; + prototype: TypeError; +} + +interface URIError extends Error { +} +declare var URIError: { + new (message?: string): URIError; + (message?: string): URIError; + prototype: URIError; +} + +interface JSON { + /** + * Converts a JavaScript Object Notation (JSON) string into an object. + * @param text A valid JSON string. + * @param reviver A function that transforms the results. This function is called for each member of the object. + * If a member contains nested objects, the nested objects are transformed before the parent object is. + */ + parse(text: string, reviver?: (key: any, value: any) => any): any; + /** + * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. + * @param value A JavaScript value, usually an object or array, to be converted. + */ + stringify(value: any): string; + /** + * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. + * @param value A JavaScript value, usually an object or array, to be converted. + * @param replacer A function that transforms the results. + */ + stringify(value: any, replacer: (key: string, value: any) => any): string; + /** + * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. + * @param value A JavaScript value, usually an object or array, to be converted. + * @param replacer Array that transforms the results. + */ + stringify(value: any, replacer: any[]): string; + /** + * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. + * @param value A JavaScript value, usually an object or array, to be converted. + * @param replacer A function that transforms the results. + * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + */ + stringify(value: any, replacer: (key: string, value: any) => any, space: any): string; + /** + * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. + * @param value A JavaScript value, usually an object or array, to be converted. + * @param replacer Array that transforms the results. + * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + */ + stringify(value: any, replacer: any[], space: any): string; +} +/** + * An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format. + */ +declare var JSON: JSON; + +//////////////// +/// ECMAScript Array API (specially handled by compiler) +//////////////// + +interface Array { + toString(): string; + toLocaleString(): string; + concat(...items: U[]): T[]; + concat(...items: T[]): T[]; + join(separator?: string): string; + pop(): T; + push(...items: T[]): number; + reverse(): T[]; + shift(): T; + slice(start: number, end?: number): T[]; + sort(compareFn?: (a: T, b: T) => number): T[]; + splice(start: number): T[]; + splice(start: number, deleteCount: number, ...items: T[]): T[]; + unshift(...items: T[]): number; + + indexOf(searchElement: T, fromIndex?: number): number; + lastIndexOf(searchElement: T, fromIndex?: number): number; + every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; + some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; + forEach(callbackfn: (value: T, index: number, array: T[]) => void , thisArg?: any): void; + map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; + filter(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): T[]; + reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; + reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; + reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; + reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; + + length: number; + +} +declare var Array: { + new (arrayLength: number): T[]; + new (...items: T[]): T[]; + (arrayLength: number): T[]; + (...items: T[]): T[]; + isArray(arg: any): boolean; + prototype: Array; +} + + +//////////////// +/// IE10 ECMAScript Extensions +//////////////// + +interface ArrayBuffer { + byteLength: number; +} +declare var ArrayBuffer: { + prototype: ArrayBuffer; + new (byteLength: number); +} + +interface ArrayBufferView { + buffer: ArrayBuffer; + byteOffset: number; + byteLength: number; +} + +interface Int8Array extends ArrayBufferView { + BYTES_PER_ELEMENT: number; + length: number; + [index: number]: number; + get(index: number): number; + set(index: number, value: number): void; + set(array: Int8Array, offset?: number): void; + set(array: number[], offset?: number): void; + subarray(begin: number, end?: number): Int8Array; +} +declare var Int8Array: { + prototype: Int8Array; + new (length: number): Int8Array; + new (array: Int8Array): Int8Array; + new (array: number[]): Int8Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int8Array; + BYTES_PER_ELEMENT: number; +} + +interface Uint8Array extends ArrayBufferView { + BYTES_PER_ELEMENT: number; + length: number; + [index: number]: number; + get(index: number): number; + set(index: number, value: number): void; + set(array: Uint8Array, offset?: number): void; + set(array: number[], offset?: number): void; + subarray(begin: number, end?: number): Uint8Array; +} +declare var Uint8Array: { + prototype: Uint8Array; + new (length: number): Uint8Array; + new (array: Uint8Array): Uint8Array; + new (array: number[]): Uint8Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8Array; + BYTES_PER_ELEMENT: number; +} + +interface Int16Array extends ArrayBufferView { + BYTES_PER_ELEMENT: number; + length: number; + [index: number]: number; + get(index: number): number; + set(index: number, value: number): void; + set(array: Int16Array, offset?: number): void; + set(array: number[], offset?: number): void; + subarray(begin: number, end?: number): Int16Array; +} +declare var Int16Array: { + prototype: Int16Array; + new (length: number): Int16Array; + new (array: Int16Array): Int16Array; + new (array: number[]): Int16Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int16Array; + BYTES_PER_ELEMENT: number; +} + +interface Uint16Array extends ArrayBufferView { + BYTES_PER_ELEMENT: number; + length: number; + [index: number]: number; + get(index: number): number; + set(index: number, value: number): void; + set(array: Uint16Array, offset?: number): void; + set(array: number[], offset?: number): void; + subarray(begin: number, end?: number): Uint16Array; +} +declare var Uint16Array: { + prototype: Uint16Array; + new (length: number): Uint16Array; + new (array: Uint16Array): Uint16Array; + new (array: number[]): Uint16Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint16Array; + BYTES_PER_ELEMENT: number; +} + +interface Int32Array extends ArrayBufferView { + BYTES_PER_ELEMENT: number; + length: number; + [index: number]: number; + get(index: number): number; + set(index: number, value: number): void; + set(array: Int32Array, offset?: number): void; + set(array: number[], offset?: number): void; + subarray(begin: number, end?: number): Int32Array; +} +declare var Int32Array: { + prototype: Int32Array; + new (length: number): Int32Array; + new (array: Int32Array): Int32Array; + new (array: number[]): Int32Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int32Array; + BYTES_PER_ELEMENT: number; +} + +interface Uint32Array extends ArrayBufferView { + BYTES_PER_ELEMENT: number; + length: number; + [index: number]: number; + get(index: number): number; + set(index: number, value: number): void; + set(array: Uint32Array, offset?: number): void; + set(array: number[], offset?: number): void; + subarray(begin: number, end?: number): Uint32Array; +} +declare var Uint32Array: { + prototype: Uint32Array; + new (length: number): Uint32Array; + new (array: Uint32Array): Uint32Array; + new (array: number[]): Uint32Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint32Array; + BYTES_PER_ELEMENT: number; +} + +interface Float32Array extends ArrayBufferView { + BYTES_PER_ELEMENT: number; + length: number; + [index: number]: number; + get(index: number): number; + set(index: number, value: number): void; + set(array: Float32Array, offset?: number): void; + set(array: number[], offset?: number): void; + subarray(begin: number, end?: number): Float32Array; +} +declare var Float32Array: { + prototype: Float32Array; + new (length: number): Float32Array; + new (array: Float32Array): Float32Array; + new (array: number[]): Float32Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float32Array; + BYTES_PER_ELEMENT: number; +} + +interface Float64Array extends ArrayBufferView { + BYTES_PER_ELEMENT: number; + length: number; + [index: number]: number; + get(index: number): number; + set(index: number, value: number): void; + set(array: Float64Array, offset?: number): void; + set(array: number[], offset?: number): void; + subarray(begin: number, end?: number): Float64Array; +} +declare var Float64Array: { + prototype: Float64Array; + new (length: number): Float64Array; + new (array: Float64Array): Float64Array; + new (array: number[]): Float64Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float64Array; + BYTES_PER_ELEMENT: number; +} + +interface DataView extends ArrayBufferView { + getInt8(byteOffset: number): number; + getUint8(byteOffset: number): number; + getInt16(byteOffset: number, littleEndian?: boolean): number; + getUint16(byteOffset: number, littleEndian?: boolean): number; + getInt32(byteOffset: number, littleEndian?: boolean): number; + getUint32(byteOffset: number, littleEndian?: boolean): number; + getFloat32(byteOffset: number, littleEndian?: boolean): number; + getFloat64(byteOffset: number, littleEndian?: boolean): number; + + setInt8(byteOffset: number, value: number): void; + setUint8(byteOffset: number, value: number): void; + setInt16(byteOffset: number, value: number, littleEndian?: boolean): void; + setUint16(byteOffset: number, value: number, littleEndian?: boolean): void; + setInt32(byteOffset: number, value: number, littleEndian?: boolean): void; + setUint32(byteOffset: number, value: number, littleEndian?: boolean): void; + setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void; + setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void; +} +declare var DataView: { + prototype: DataView; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): DataView; +} + +//////////////// +/// IE9 DOM APIs (note that +//////////////// + +interface NavigatorID { + appVersion: string; + appName: string; + userAgent: string; + platform: string; +} + +interface HTMLTableElement extends HTMLElement, DOML2DeprecatedBorderStyle_HTMLTableElement, DOML2DeprecatedAlignmentStyle_HTMLTableElement, MSBorderColorStyle, MSDataBindingExtensions, MSHTMLTableElementExtensions, DOML2DeprecatedBackgroundStyle, MSBorderColorHighlightStyle, MSDataBindingTableExtensions, DOML2DeprecatedBackgroundColorStyle { + tBodies: HTMLCollection; + width: string; + tHead: HTMLTableSectionElement; + cellSpacing: string; + tFoot: HTMLTableSectionElement; + frame: string; + rows: HTMLCollection; + rules: string; + cellPadding: string; + summary: string; + caption: HTMLTableCaptionElement; + deleteRow(index?: number): void; + createTBody(): HTMLElement; + deleteCaption(): void; + insertRow(index?: number): HTMLElement; + deleteTFoot(): void; + createTHead(): HTMLElement; + deleteTHead(): void; + createCaption(): HTMLElement; + createTFoot(): HTMLElement; +} +declare var HTMLTableElement: { + prototype: HTMLTableElement; + new(): HTMLTableElement; +} + +interface TreeWalker { + whatToShow: number; + filter: NodeFilterCallback; + root: Node; + currentNode: Node; + expandEntityReferences: boolean; + previousSibling(): Node; + lastChild(): Node; + nextSibling(): Node; + nextNode(): Node; + parentNode(): Node; + firstChild(): Node; + previousNode(): Node; +} +declare var TreeWalker: { + prototype: TreeWalker; + new(): TreeWalker; +} + +interface GetSVGDocument { + getSVGDocument(): SVGDocument; +} + +interface HTMLHtmlElementDOML2Deprecated { + version: string; +} + +interface SVGPathSegCurvetoQuadraticRel extends SVGPathSeg { + y: number; + y1: number; + x: number; + x1: number; +} +declare var SVGPathSegCurvetoQuadraticRel: { + prototype: SVGPathSegCurvetoQuadraticRel; + new(): SVGPathSegCurvetoQuadraticRel; +} + +interface Performance { + navigation: PerformanceNavigation; + timing: PerformanceTiming; + toJSON(): any; +} +declare var Performance: { + prototype: Performance; + new(): Performance; +} + +interface SVGSVGElementEventHandlers { + onresize: (ev: UIEvent) => any; + addEventListener(type: "resize", listener: (ev: UIEvent) => void, useCapture?: boolean): void; + onunload: (ev: Event) => any; + addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; + onscroll: (ev: UIEvent) => any; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + onerror: (ev: Event) => any; + addEventListener(type: "error", listener: (ev: Event) => any, useCapture?: boolean): void; + onzoom: (ev: any) => any; + addEventListener(type: "zoom", listener: (ev: any) => any, useCapture?: boolean): void; + onabort: (ev: UIEvent) => any; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} + +interface MSDataBindingTableExtensions { + dataPageSize: number; + nextPage(): void; + firstPage(): void; + refresh(): void; + previousPage(): void; + lastPage(): void; +} + +interface DOML2DeprecatedAlignmentStyle_HTMLParagraphElement { + align: string; +} + +interface CompositionEvent extends UIEvent { + data: string; + locale: string; + initCompositionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: AbstractView, dataArg: string, locale: string): void; +} +declare var CompositionEvent: { + prototype: CompositionEvent; + new(): CompositionEvent; +} + +interface SVGMarkerElement extends SVGElement, SVGStylable, SVGLangSpace, SVGFitToViewBox { + orientType: SVGAnimatedEnumeration; + markerUnits: SVGAnimatedEnumeration; + markerWidth: SVGAnimatedLength; + markerHeight: SVGAnimatedLength; + orientAngle: SVGAnimatedAngle; + refY: SVGAnimatedLength; + refX: SVGAnimatedLength; + setOrientToAngle(angle: SVGAngle): void; + setOrientToAuto(): void; + SVG_MARKER_ORIENT_UNKNOWN: number; + SVG_MARKER_ORIENT_ANGLE: number; + SVG_MARKERUNITS_UNKNOWN: number; + SVG_MARKERUNITS_STROKEWIDTH: number; + SVG_MARKER_ORIENT_AUTO: number; + SVG_MARKERUNITS_USERSPACEONUSE: number; +} +declare var SVGMarkerElement: { + prototype: SVGMarkerElement; + new(): SVGMarkerElement; + SVG_MARKER_ORIENT_UNKNOWN: number; + SVG_MARKER_ORIENT_ANGLE: number; + SVG_MARKERUNITS_UNKNOWN: number; + SVG_MARKERUNITS_STROKEWIDTH: number; + SVG_MARKER_ORIENT_AUTO: number; + SVG_MARKERUNITS_USERSPACEONUSE: number; +} + +interface WindowTimers { + clearTimeout(handle: number): void; + setTimeout(expression: any, msec?: number, language?: any): number; + clearInterval(handle: number): void; + setInterval(expression: any, msec?: number, language?: any): number; +} + +interface CSSStyleDeclaration extends CSS3Properties, SVG1_1Properties, CSS2Properties { + cssText: string; + length: number; + parentRule: CSSRule; + getPropertyPriority(propertyName: string): string; + getPropertyValue(propertyName: string): string; + removeProperty(propertyName: string): string; + item(index: number): string; + [index: number]: string; + setProperty(propertyName: string, value: string, priority?: string): void; +} +declare var CSSStyleDeclaration: { + prototype: CSSStyleDeclaration; + new(): CSSStyleDeclaration; +} + +interface SVGGElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests { +} +declare var SVGGElement: { + prototype: SVGGElement; + new(): SVGGElement; +} + +interface MSStyleCSSProperties extends MSCSSProperties { + pixelWidth: number; + posHeight: number; + posLeft: number; + pixelTop: number; + pixelBottom: number; + textDecorationNone: boolean; + pixelLeft: number; + posTop: number; + posBottom: number; + textDecorationOverline: boolean; + posWidth: number; + textDecorationLineThrough: boolean; + pixelHeight: number; + textDecorationBlink: boolean; + posRight: number; + pixelRight: number; + textDecorationUnderline: boolean; +} +declare var MSStyleCSSProperties: { + prototype: MSStyleCSSProperties; + new(): MSStyleCSSProperties; +} + +interface MSCSSStyleSheetExtensions { + owningElement: Element; + imports: StyleSheetList; + isAlternate: boolean; + rules: MSCSSRuleList; + isPrefAlternate: boolean; + readOnly: boolean; + cssText: string; + href: string; + id: string; + pages: StyleSheetPageList; + addImport(bstrURL: string, lIndex?: number): number; + addPageRule(bstrSelector: string, bstrStyle: string, lIndex?: number): number; + removeRule(lIndex: number): void; + addRule(bstrSelector: string, bstrStyle?: string, lIndex?: number): number; + removeImport(lIndex: number): void; +} + +interface Navigator extends NavigatorID, NavigatorOnLine, NavigatorDoNotTrack, NavigatorAbilities, NavigatorGeolocation, MSNavigatorAbilities { +} +declare var Navigator: { + prototype: Navigator; + new(): Navigator; +} + +interface SVGPathSegCurvetoCubicSmoothAbs extends SVGPathSeg { + y: number; + x2: number; + x: number; + y2: number; +} +declare var SVGPathSegCurvetoCubicSmoothAbs: { + prototype: SVGPathSegCurvetoCubicSmoothAbs; + new(): SVGPathSegCurvetoCubicSmoothAbs; +} + +interface MSBorderColorStyle_HTMLFrameSetElement { + borderColor: any; +} + +interface SVGZoomEvent extends UIEvent { + zoomRectScreen: SVGRect; + previousScale: number; + newScale: number; + previousTranslate: SVGPoint; + newTranslate: SVGPoint; +} +declare var SVGZoomEvent: { + prototype: SVGZoomEvent; + new(): SVGZoomEvent; +} + +interface NodeSelector { + querySelectorAll(selectors: string): NodeList; + querySelector(selectors: string): Element; +} + +interface HTMLTableDataCellElement extends HTMLTableCellElement, MSHTMLTableDataCellElementExtensions { +} +declare var HTMLTableDataCellElement: { + prototype: HTMLTableDataCellElement; + new(): HTMLTableDataCellElement; +} + +interface MSHTMLDirectoryElementExtensions extends DOML2DeprecatedListNumberingAndBulletStyle { +} + +interface HTMLBaseElement extends HTMLElement { + target: string; + href: string; +} +declare var HTMLBaseElement: { + prototype: HTMLBaseElement; + new(): HTMLBaseElement; +} + +interface ClientRect { + left: number; + width: number; + right: number; + top: number; + bottom: number; + height: number; +} +declare var ClientRect: { + prototype: ClientRect; + new(): ClientRect; +} + +interface PositionErrorCallback { + (error: PositionError): void; +} + +interface DOMImplementation extends DOMHTMLImplementation { + createDocumentType(qualifiedName: string, publicId: string, systemId: string): DocumentType; + createDocument(namespaceURI: string, qualifiedName: string, doctype: DocumentType): Document; + hasFeature(feature: string, version?: string): boolean; +} +declare var DOMImplementation: { + prototype: DOMImplementation; + new(): DOMImplementation; +} + +interface DOML2DeprecatedWidthStyle_HTMLBlockElement { + width: number; +} + +interface SVGUnitTypes { + SVG_UNIT_TYPE_UNKNOWN: number; + SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number; + SVG_UNIT_TYPE_USERSPACEONUSE: number; +} +declare var SVGUnitTypes: { + prototype: SVGUnitTypes; + new(): SVGUnitTypes; + SVG_UNIT_TYPE_UNKNOWN: number; + SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number; + SVG_UNIT_TYPE_USERSPACEONUSE: number; +} + +interface DocumentRange { + createRange(): Range; +} + +interface MSHTMLDocumentExtensions { + onrowexit: (ev: MSEventObj) => any; + addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + compatible: MSCompatibleInfoCollection; + oncontrolselect: (ev: MSEventObj) => any; + addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + onrowsinserted: (ev: MSEventObj) => any; + addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + onpropertychange: (ev: MSEventObj) => any; + addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + media: string; + onafterupdate: (ev: MSEventObj) => any; + addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + onhelp: (ev: Event) => any; + addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; + uniqueID: string; + onbeforeactivate: (ev: UIEvent) => any; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + onstoragecommit: (ev: StorageEvent) => any; + addEventListener(type: "storagecommit", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; + onselectionchange: (ev: Event) => any; + addEventListener(type: "selectionchange", listener: (ev: Event) => any, useCapture?: boolean): void; + documentMode: number; + onfocusout: (ev: FocusEvent) => any; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + ondataavailable: (ev: MSEventObj) => any; + addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + onbeforeupdate: (ev: MSEventObj) => any; + addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + onfocusin: (ev: FocusEvent) => any; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + security: string; + namespaces: MSNamespaceInfoCollection; + ondatasetcomplete: (ev: MSEventObj) => any; + addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + onbeforedeactivate: (ev: UIEvent) => any; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + onstop: (ev: Event) => any; + addEventListener(type: "stop", listener: (ev: Event) => any, useCapture?: boolean): void; + onactivate: (ev: UIEvent) => any; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + onmssitemodejumplistitemremoved: (ev: MSSiteModeEvent) => any; + addEventListener(type: "mssitemodejumplistitemremoved", listener: (ev: MSSiteModeEvent) => any, useCapture?: boolean): void; + frames: Window; + onselectstart: (ev: Event) => any; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + onerrorupdate: (ev: MSEventObj) => any; + addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + parentWindow: Window; + ondeactivate: (ev: UIEvent) => any; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + ondatasetchanged: (ev: MSEventObj) => any; + addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + onrowsdelete: (ev: MSEventObj) => any; + addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + onmsthumbnailclick: (ev: MSSiteModeEvent) => any; + addEventListener(type: "msthumbnailclick", listener: (ev: MSSiteModeEvent) => any, useCapture?: boolean): void; + onrowenter: (ev: MSEventObj) => any; + addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + onbeforeeditfocus: (ev: MSEventObj) => any; + addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + Script: MSScriptHost; + oncellchange: (ev: MSEventObj) => any; + addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + URLUnencoded: string; + updateSettings(): void; + execCommandShowHelp(commandId: string): boolean; + releaseCapture(): void; + focus(): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} + +interface CSS2Properties { + backgroundAttachment: string; + visibility: string; + fontFamily: string; + borderRightStyle: string; + clear: string; + content: string; + counterIncrement: string; + orphans: string; + marginBottom: string; + borderStyle: string; + counterReset: string; + outlineWidth: string; + marginRight: string; + paddingLeft: string; + borderBottom: string; + marginTop: string; + borderTopColor: string; + top: string; + fontWeight: string; + textIndent: string; + borderRight: string; + width: string; + listStyleImage: string; + cursor: string; + listStylePosition: string; + borderTopStyle: string; + direction: string; + maxWidth: string; + color: string; + clip: string; + borderRightWidth: string; + verticalAlign: string; + pageBreakAfter: string; + overflow: string; + borderBottomStyle: string; + borderLeftStyle: string; + fontStretch: string; + emptyCells: string; + padding: string; + paddingRight: string; + background: string; + bottom: string; + height: string; + paddingTop: string; + right: string; + borderLeftWidth: string; + borderLeft: string; + backgroundPosition: string; + backgroundColor: string; + widows: string; + lineHeight: string; + pageBreakInside: string; + borderTopWidth: string; + left: string; + outlineStyle: string; + borderTop: string; + paddingBottom: string; + outlineColor: string; + wordSpacing: string; + outline: string; + font: string; + marginLeft: string; + display: string; + maxHeight: string; + cssFloat: string; + letterSpacing: string; + borderSpacing: string; + backgroundRepeat: string; + fontSizeAdjust: string; + borderLeftColor: string; + borderWidth: string; + backgroundImage: string; + listStyleType: string; + whiteSpace: string; + fontStyle: string; + borderBottomColor: string; + minWidth: string; + position: string; + zIndex: string; + borderColor: string; + listStyle: string; + captionSide: string; + borderCollapse: string; + fontVariant: string; + quotes: string; + tableLayout: string; + unicodeBidi: string; + borderBottomWidth: string; + minHeight: string; + textDecoration: string; + fontSize: string; + border: string; + pageBreakBefore: string; + textAlign: string; + textTransform: string; + margin: string; + borderRightColor: string; +} + +interface MSImageResourceExtensions_HTMLInputElement { + dynsrc: string; + vrml: string; + lowsrc: string; + start: string; + loop: number; +} + +interface MSHTMLEmbedElementExtensions { + palette: string; + hidden: string; + pluginspage: string; + units: string; +} + +interface MSHTMLModElementExtensions { +} + +interface Element extends Node, NodeSelector, ElementTraversal, MSElementExtensions { + scrollTop: number; + clientLeft: number; + scrollLeft: number; + tagName: string; + clientWidth: number; + scrollWidth: number; + clientHeight: number; + clientTop: number; + scrollHeight: number; + getAttribute(name?: string): string; + getElementsByTagNameNS(namespaceURI: string, localName: string): NodeList; + hasAttributeNS(namespaceURI: string, localName: string): boolean; + getBoundingClientRect(): ClientRect; + getAttributeNS(namespaceURI: string, localName: string): string; + getAttributeNodeNS(namespaceURI: string, localName: string): Attr; + setAttributeNodeNS(newAttr: Attr): Attr; + hasAttribute(name: string): boolean; + removeAttribute(name?: string): void; + setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void; + getAttributeNode(name: string): Attr; + getElementsByTagName(name: string): NodeList; + getElementsByTagName(name: "a"): NodeListOf; + getElementsByTagName(name: "abbr"): NodeListOf; + getElementsByTagName(name: "address"): NodeListOf; + getElementsByTagName(name: "area"): NodeListOf; + getElementsByTagName(name: "article"): NodeListOf; + getElementsByTagName(name: "aside"): NodeListOf; + getElementsByTagName(name: "audio"): NodeListOf; + getElementsByTagName(name: "b"): NodeListOf; + getElementsByTagName(name: "base"): NodeListOf; + getElementsByTagName(name: "bdi"): NodeListOf; + getElementsByTagName(name: "bdo"): NodeListOf; + getElementsByTagName(name: "blockquote"): NodeListOf; + getElementsByTagName(name: "body"): NodeListOf; + getElementsByTagName(name: "br"): NodeListOf; + getElementsByTagName(name: "button"): NodeListOf; + getElementsByTagName(name: "canvas"): NodeListOf; + getElementsByTagName(name: "caption"): NodeListOf; + getElementsByTagName(name: "cite"): NodeListOf; + getElementsByTagName(name: "code"): NodeListOf; + getElementsByTagName(name: "col"): NodeListOf; + getElementsByTagName(name: "colgroup"): NodeListOf; + getElementsByTagName(name: "datalist"): NodeListOf; + getElementsByTagName(name: "dd"): NodeListOf; + getElementsByTagName(name: "del"): NodeListOf; + getElementsByTagName(name: "dfn"): NodeListOf; + getElementsByTagName(name: "div"): NodeListOf; + getElementsByTagName(name: "dl"): NodeListOf; + getElementsByTagName(name: "dt"): NodeListOf; + getElementsByTagName(name: "em"): NodeListOf; + getElementsByTagName(name: "embed"): NodeListOf; + getElementsByTagName(name: "fieldset"): NodeListOf; + getElementsByTagName(name: "figcaption"): NodeListOf; + getElementsByTagName(name: "figure"): NodeListOf; + getElementsByTagName(name: "footer"): NodeListOf; + getElementsByTagName(name: "form"): NodeListOf; + getElementsByTagName(name: "h1"): NodeListOf; + getElementsByTagName(name: "h2"): NodeListOf; + getElementsByTagName(name: "h3"): NodeListOf; + getElementsByTagName(name: "h4"): NodeListOf; + getElementsByTagName(name: "h5"): NodeListOf; + getElementsByTagName(name: "h6"): NodeListOf; + getElementsByTagName(name: "head"): NodeListOf; + getElementsByTagName(name: "header"): NodeListOf; + getElementsByTagName(name: "hgroup"): NodeListOf; + getElementsByTagName(name: "hr"): NodeListOf; + getElementsByTagName(name: "html"): NodeListOf; + getElementsByTagName(name: "i"): NodeListOf; + getElementsByTagName(name: "iframe"): NodeListOf; + getElementsByTagName(name: "img"): NodeListOf; + getElementsByTagName(name: "input"): NodeListOf; + getElementsByTagName(name: "ins"): NodeListOf; + getElementsByTagName(name: "kbd"): NodeListOf; + getElementsByTagName(name: "label"): NodeListOf; + getElementsByTagName(name: "legend"): NodeListOf; + getElementsByTagName(name: "li"): NodeListOf; + getElementsByTagName(name: "link"): NodeListOf; + getElementsByTagName(name: "main"): NodeListOf; + getElementsByTagName(name: "map"): NodeListOf; + getElementsByTagName(name: "mark"): NodeListOf; + getElementsByTagName(name: "menu"): NodeListOf; + getElementsByTagName(name: "meta"): NodeListOf; + getElementsByTagName(name: "nav"): NodeListOf; + getElementsByTagName(name: "noscript"): NodeListOf; + getElementsByTagName(name: "object"): NodeListOf; + getElementsByTagName(name: "ol"): NodeListOf; + getElementsByTagName(name: "optgroup"): NodeListOf; + getElementsByTagName(name: "option"): NodeListOf; + getElementsByTagName(name: "p"): NodeListOf; + getElementsByTagName(name: "param"): NodeListOf; + getElementsByTagName(name: "pre"): NodeListOf; + getElementsByTagName(name: "progress"): NodeListOf; + getElementsByTagName(name: "q"): NodeListOf; + getElementsByTagName(name: "rp"): NodeListOf; + getElementsByTagName(name: "rt"): NodeListOf; + getElementsByTagName(name: "ruby"): NodeListOf; + getElementsByTagName(name: "s"): NodeListOf; + getElementsByTagName(name: "samp"): NodeListOf; + getElementsByTagName(name: "script"): NodeListOf; + getElementsByTagName(name: "section"): NodeListOf; + getElementsByTagName(name: "select"): NodeListOf; + getElementsByTagName(name: "small"): NodeListOf; + getElementsByTagName(name: "source"): NodeListOf; + getElementsByTagName(name: "span"): NodeListOf; + getElementsByTagName(name: "strong"): NodeListOf; + getElementsByTagName(name: "style"): NodeListOf; + getElementsByTagName(name: "sub"): NodeListOf; + getElementsByTagName(name: "summary"): NodeListOf; + getElementsByTagName(name: "sup"): NodeListOf; + getElementsByTagName(name: "table"): NodeListOf; + getElementsByTagName(name: "tbody"): NodeListOf; + getElementsByTagName(name: "td"): NodeListOf; + getElementsByTagName(name: "textarea"): NodeListOf; + getElementsByTagName(name: "tfoot"): NodeListOf; + getElementsByTagName(name: "th"): NodeListOf; + getElementsByTagName(name: "thead"): NodeListOf; + getElementsByTagName(name: "title"): NodeListOf; + getElementsByTagName(name: "tr"): NodeListOf; + getElementsByTagName(name: "track"): NodeListOf; + getElementsByTagName(name: "u"): NodeListOf; + getElementsByTagName(name: "ul"): NodeListOf; + getElementsByTagName(name: "var"): NodeListOf; + getElementsByTagName(name: "video"): NodeListOf; + getElementsByTagName(name: "wbr"): NodeListOf; + setAttributeNode(newAttr: Attr): Attr; + getClientRects(): ClientRectList; + removeAttributeNode(oldAttr: Attr): Attr; + setAttribute(name?: string, value?: string): void; + removeAttributeNS(namespaceURI: string, localName: string): void; +} +declare var Element: { + prototype: Element; + new(): Element; +} + +interface SVGDocument { + rootElement: SVGSVGElement; +} + +interface HTMLNextIdElement extends HTMLElement { + n: string; +} +declare var HTMLNextIdElement: { + prototype: HTMLNextIdElement; + new(): HTMLNextIdElement; +} + +interface SVGPathSegMovetoRel extends SVGPathSeg { + y: number; + x: number; +} +declare var SVGPathSegMovetoRel: { + prototype: SVGPathSegMovetoRel; + new(): SVGPathSegMovetoRel; +} + +interface SVGLineElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests { + y1: SVGAnimatedLength; + x2: SVGAnimatedLength; + x1: SVGAnimatedLength; + y2: SVGAnimatedLength; +} +declare var SVGLineElement: { + prototype: SVGLineElement; + new(): SVGLineElement; +} + +interface HTMLParagraphElement extends HTMLElement, DOML2DeprecatedAlignmentStyle_HTMLParagraphElement, MSHTMLParagraphElementExtensions { +} +declare var HTMLParagraphElement: { + prototype: HTMLParagraphElement; + new(): HTMLParagraphElement; +} + +interface MSHTMLTextAreaElementExtensions { + status: any; + createTextRange(): TextRange; +} + +interface ErrorFunction { + (eventOrMessage: any, source: string, fileno: number): any; +} + +interface HTMLAreasCollection extends HTMLCollection { + remove(index?: number): void; + add(element: HTMLElement, before?: any): void; +} +declare var HTMLAreasCollection: { + prototype: HTMLAreasCollection; + new(): HTMLAreasCollection; +} + +interface SVGDescElement extends SVGElement, SVGStylable, SVGLangSpace { +} +declare var SVGDescElement: { + prototype: SVGDescElement; + new(): SVGDescElement; +} + +interface Node extends EventTarget { + nodeType: number; + previousSibling: Node; + localName: string; + namespaceURI: string; + textContent: string; + parentNode: Node; + nextSibling: Node; + nodeValue: string; + lastChild: Node; + childNodes: NodeList; + nodeName: string; + ownerDocument: Document; + attributes: Attr[]; + firstChild: Node; + prefix: string; + removeChild(oldChild: Node): Node; + appendChild(newChild: Node): Node; + isSupported(feature: string, version: string): boolean; + isEqualNode(arg: Node): boolean; + lookupPrefix(namespaceURI: string): string; + isDefaultNamespace(namespaceURI: string): boolean; + compareDocumentPosition(other: Node): number; + normalize(): void; + isSameNode(other: Node): boolean; + hasAttributes(): boolean; + lookupNamespaceURI(prefix: string): string; + cloneNode(deep?: boolean): Node; + hasChildNodes(): boolean; + replaceChild(newChild: Node, oldChild: Node): Node; + insertBefore(newChild: Node, refChild?: Node): Node; + ENTITY_REFERENCE_NODE: number; + ATTRIBUTE_NODE: number; + DOCUMENT_FRAGMENT_NODE: number; + TEXT_NODE: number; + ELEMENT_NODE: number; + COMMENT_NODE: number; + DOCUMENT_POSITION_DISCONNECTED: number; + DOCUMENT_POSITION_CONTAINED_BY: number; + DOCUMENT_POSITION_CONTAINS: number; + DOCUMENT_TYPE_NODE: number; + DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; + DOCUMENT_NODE: number; + ENTITY_NODE: number; + PROCESSING_INSTRUCTION_NODE: number; + CDATA_SECTION_NODE: number; + NOTATION_NODE: number; + DOCUMENT_POSITION_FOLLOWING: number; + DOCUMENT_POSITION_PRECEDING: number; +} +declare var Node: { + prototype: Node; + new(): Node; + ENTITY_REFERENCE_NODE: number; + ATTRIBUTE_NODE: number; + DOCUMENT_FRAGMENT_NODE: number; + TEXT_NODE: number; + ELEMENT_NODE: number; + COMMENT_NODE: number; + DOCUMENT_POSITION_DISCONNECTED: number; + DOCUMENT_POSITION_CONTAINED_BY: number; + DOCUMENT_POSITION_CONTAINS: number; + DOCUMENT_TYPE_NODE: number; + DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; + DOCUMENT_NODE: number; + ENTITY_NODE: number; + PROCESSING_INSTRUCTION_NODE: number; + CDATA_SECTION_NODE: number; + NOTATION_NODE: number; + DOCUMENT_POSITION_FOLLOWING: number; + DOCUMENT_POSITION_PRECEDING: number; +} + +interface MSHTMLLegendElementExtensions { +} + +interface MSCSSStyleDeclarationExtensions { + getAttribute(attributeName: string, flags?: number): any; + setAttribute(attributeName: string, AttributeValue: any, flags?: number): void; + removeAttribute(attributeName: string, flags?: number): boolean; +} + +interface SVGPathSegCurvetoQuadraticSmoothRel extends SVGPathSeg { + y: number; + x: number; +} +declare var SVGPathSegCurvetoQuadraticSmoothRel: { + prototype: SVGPathSegCurvetoQuadraticSmoothRel; + new(): SVGPathSegCurvetoQuadraticSmoothRel; +} + +interface DOML2DeprecatedAlignmentStyle_HTMLTableRowElement { + align: string; +} + +interface DOML2DeprecatedBorderStyle_HTMLObjectElement { + border: string; +} + +interface MSHTMLSpanElementExtensions { +} + +interface MSHTMLObjectElementExtensions { + object: Object; + alt: string; + classid: string; + altHtml: string; + BaseHref: string; +} + +interface DOML2DeprecatedListSpaceReduction { + compact: boolean; +} + +interface CSS3Properties { + textAlignLast: string; + textUnderlinePosition: string; + wordWrap: string; + borderTopLeftRadius: string; + backgroundClip: string; + msTransformOrigin: string; + opacity: string; + overflowY: string; + boxShadow: string; + backgroundSize: string; + wordBreak: string; + boxSizing: string; + rubyOverhang: string; + rubyAlign: string; + textJustify: string; + borderRadius: string; + overflowX: string; + borderTopRightRadius: string; + msTransform: string; + borderBottomLeftRadius: string; + rubyPosition: string; + borderBottomRightRadius: string; + backgroundOrigin: string; + textOverflow: string; +} + +interface MSScriptHost { +} +declare var MSScriptHost: { + prototype: MSScriptHost; + new(): MSScriptHost; +} + +interface SVGClipPathElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests { + clipPathUnits: SVGAnimatedEnumeration; +} +declare var SVGClipPathElement: { + prototype: SVGClipPathElement; + new(): SVGClipPathElement; +} + +interface MouseEvent extends UIEvent, MSMouseEventExtensions { + pageX: number; + offsetY: number; + x: number; + y: number; + altKey: boolean; + metaKey: boolean; + ctrlKey: boolean; + offsetX: number; + screenX: number; + clientY: number; + shiftKey: boolean; + screenY: number; + relatedTarget: EventTarget; + button: number; + pageY: number; + buttons: number; + clientX: number; + initMouseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: AbstractView, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget): void; + getModifierState(keyArg: string): boolean; +} +declare var MouseEvent: { + prototype: MouseEvent; + new(): MouseEvent; +} + +interface DOML2DeprecatedAlignmentStyle_HTMLTableElement { + align: string; +} + +interface RangeException { + code: number; + message: string; + toString(): string; + INVALID_NODE_TYPE_ERR: number; + BAD_BOUNDARYPOINTS_ERR: number; +} +declare var RangeException: { + prototype: RangeException; + new(): RangeException; + INVALID_NODE_TYPE_ERR: number; + BAD_BOUNDARYPOINTS_ERR: number; +} + +interface DOML2DeprecatedAlignmentStyle_HTMLHRElement { + align: string; +} + +interface SVGTextPositioningElement extends SVGTextContentElement { + y: SVGAnimatedLengthList; + rotate: SVGAnimatedNumberList; + dy: SVGAnimatedLengthList; + x: SVGAnimatedLengthList; + dx: SVGAnimatedLengthList; +} +declare var SVGTextPositioningElement: { + prototype: SVGTextPositioningElement; + new(): SVGTextPositioningElement; +} + +interface HTMLAppletElement extends HTMLElement, DOML2DeprecatedWidthStyle_HTMLAppletElement, DOML2DeprecatedMarginStyle_HTMLObjectElement, MSHTMLAppletElementExtensions, MSDataBindingExtensions, MSDataBindingRecordSetExtensions, DOML2DeprecatedAlignmentStyle_HTMLObjectElement { + object: string; + archive: string; + codeBase: string; + alt: string; + name: string; + height: string; + code: string; +} +declare var HTMLAppletElement: { + prototype: HTMLAppletElement; + new(): HTMLAppletElement; +} + +interface MSHTMLFieldSetElementExtensions extends DOML2DeprecatedAlignmentStyle_HTMLFieldSetElement { +} + +interface DocumentEvent { + createEvent(eventInterface: string): Event; +} + +interface MSHTMLUnknownElementExtensions { +} + +interface TextMetrics { + width: number; +} +declare var TextMetrics: { + prototype: TextMetrics; + new(): TextMetrics; +} + +interface DOML2DeprecatedWordWrapSuppression_HTMLBodyElement { + noWrap: boolean; +} + +interface HTMLOListElement extends HTMLElement, DOML2DeprecatedListNumberingAndBulletStyle, DOML2DeprecatedListSpaceReduction, MSHTMLOListElementExtensions { + start: number; +} +declare var HTMLOListElement: { + prototype: HTMLOListElement; + new(): HTMLOListElement; +} + +interface MSHTMLTableCaptionElementExtensions { + vAlign: string; +} + +interface SVGAnimatedString { + animVal: string; + baseVal: string; +} +declare var SVGAnimatedString: { + prototype: SVGAnimatedString; + new(): SVGAnimatedString; +} + +interface SVGPathSegLinetoVerticalRel extends SVGPathSeg { + y: number; +} +declare var SVGPathSegLinetoVerticalRel: { + prototype: SVGPathSegLinetoVerticalRel; + new(): SVGPathSegLinetoVerticalRel; +} + +interface CDATASection extends Text { +} +declare var CDATASection: { + prototype: CDATASection; + new(): CDATASection; +} + +interface StyleMedia { + type: string; + matchMedium(mediaquery: string): boolean; +} +declare var StyleMedia: { + prototype: StyleMedia; + new(): StyleMedia; +} + +interface TextRange { + boundingLeft: number; + htmlText: string; + offsetLeft: number; + boundingWidth: number; + boundingHeight: number; + boundingTop: number; + text: string; + offsetTop: number; + moveToPoint(x: number, y: number): void; + queryCommandValue(cmdID: string): any; + getBookmark(): string; + move(Unit: string, Count?: number): number; + queryCommandIndeterm(cmdID: string): boolean; + scrollIntoView(fStart?: boolean): void; + findText(string: string, count?: number, flags?: number): boolean; + execCommand(cmdID: string, showUI?: boolean, value?: any): boolean; + getBoundingClientRect(): ClientRect; + moveToBookmark(Bookmark: string): boolean; + isEqual(range: TextRange): boolean; + duplicate(): TextRange; + collapse(Start?: boolean): void; + queryCommandText(cmdID: string): string; + select(): void; + pasteHTML(html: string): void; + inRange(range: TextRange): boolean; + moveEnd(Unit: string, Count?: number): number; + getClientRects(): ClientRectList; + moveStart(Unit: string, Count?: number): number; + parentElement(): Element; + queryCommandState(cmdID: string): boolean; + compareEndPoints(how: string, sourceRange: TextRange): number; + execCommandShowHelp(cmdID: string): boolean; + moveToElementText(element: Element): void; + expand(Unit: string): boolean; + queryCommandSupported(cmdID: string): boolean; + setEndPoint(how: string, SourceRange: TextRange): void; + queryCommandEnabled(cmdID: string): boolean; +} +declare var TextRange: { + prototype: TextRange; + new(): TextRange; +} + +interface HTMLSelectElement extends HTMLElement, MSHTMLCollectionExtensions, MSDataBindingExtensions, MSHTMLSelectElementExtensions { + options: HTMLSelectElement; + value: string; + form: HTMLFormElement; + name: string; + size: number; + length: number; + selectedIndex: number; + multiple: boolean; + type: string; + remove(index?: number): void; + add(element: HTMLElement, before?: any): void; + item(name?: any, index?: any): any; + (name: any, index: any): any; + namedItem(name: string): any; + [name: string]: any; + (name: string): any; +} +declare var HTMLSelectElement: { + prototype: HTMLSelectElement; + new(): HTMLSelectElement; +} + +interface CSSStyleSheet extends StyleSheet, MSCSSStyleSheetExtensions { + ownerRule: CSSRule; + cssRules: CSSRuleList; + insertRule(rule: string, index?: number): number; + deleteRule(index?: number): void; +} +declare var CSSStyleSheet: { + prototype: CSSStyleSheet; + new(): CSSStyleSheet; +} + +interface HTMLBlockElement extends HTMLElement, DOML2DeprecatedTextFlowControl_HTMLBlockElement, DOML2DeprecatedWidthStyle_HTMLBlockElement { + cite: string; +} +declare var HTMLBlockElement: { + prototype: HTMLBlockElement; + new(): HTMLBlockElement; +} + +interface SVGTests { + requiredFeatures: SVGStringList; + requiredExtensions: SVGStringList; + systemLanguage: SVGStringList; + hasExtension(extension: string): boolean; +} + +interface MSSelection { + type: string; + typeDetail: string; + createRange(): TextRange; + clear(): void; + createRangeCollection(): TextRangeCollection; + empty(): void; +} +declare var MSSelection: { + prototype: MSSelection; + new(): MSSelection; +} + +interface MSHTMLDListElementExtensions { +} + +interface HTMLMetaElement extends HTMLElement, MSHTMLMetaElementExtensions { + httpEquiv: string; + name: string; + content: string; + scheme: string; +} +declare var HTMLMetaElement: { + prototype: HTMLMetaElement; + new(): HTMLMetaElement; +} + +interface Selection { + isCollapsed: boolean; + anchorNode: Node; + focusNode: Node; + anchorOffset: number; + focusOffset: number; + rangeCount: number; + addRange(range: Range): void; + collapseToEnd(): void; + toString(): string; + selectAllChildren(parentNode: Node): void; + getRangeAt(index: number): Range; + collapse(parentNode: Node, offset: number): void; + removeAllRanges(): void; + collapseToStart(): void; + deleteFromDocument(): void; + removeRange(range: Range): void; +} +declare var Selection: { + prototype: Selection; + new(): Selection; +} + +interface SVGAnimatedAngle { + animVal: SVGAngle; + baseVal: SVGAngle; +} +declare var SVGAnimatedAngle: { + prototype: SVGAnimatedAngle; + new(): SVGAnimatedAngle; +} + +interface SVGPatternElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGTests, SVGFitToViewBox, SVGURIReference { + patternUnits: SVGAnimatedEnumeration; + y: SVGAnimatedLength; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + patternContentUnits: SVGAnimatedEnumeration; + patternTransform: SVGAnimatedTransformList; + height: SVGAnimatedLength; +} +declare var SVGPatternElement: { + prototype: SVGPatternElement; + new(): SVGPatternElement; +} + +interface SVGScriptElement extends SVGElement, SVGURIReference { + type: string; +} +declare var SVGScriptElement: { + prototype: SVGScriptElement; + new(): SVGScriptElement; +} + +interface HTMLDDElement extends HTMLElement, DOML2DeprecatedWordWrapSuppression_HTMLDDElement { +} +declare var HTMLDDElement: { + prototype: HTMLDDElement; + new(): HTMLDDElement; +} + +interface NodeIterator { + whatToShow: number; + filter: NodeFilterCallback; + root: Node; + expandEntityReferences: boolean; + nextNode(): Node; + detach(): void; + previousNode(): Node; +} +declare var NodeIterator: { + prototype: NodeIterator; + new(): NodeIterator; +} + +interface CSSStyleRule extends CSSRule, MSCSSStyleRuleExtensions { + selectorText: string; + style: MSStyleCSSProperties; +} +declare var CSSStyleRule: { + prototype: CSSStyleRule; + new(): CSSStyleRule; +} + +interface MSDataBindingRecordSetReadonlyExtensions { + recordset: Object; + namedRecordset(dataMember: string, hierarchy?: any): Object; +} + +interface HTMLLinkElement extends HTMLElement, MSLinkStyleExtensions, LinkStyle { + rel: string; + target: string; + href: string; + media: string; + rev: string; + type: string; + charset: string; + hreflang: string; +} +declare var HTMLLinkElement: { + prototype: HTMLLinkElement; + new(): HTMLLinkElement; +} + +interface SVGViewElement extends SVGElement, SVGZoomAndPan, SVGFitToViewBox { + viewTarget: SVGStringList; +} +declare var SVGViewElement: { + prototype: SVGViewElement; + new(): SVGViewElement; +} + +interface MSHTMLAppletElementExtensions extends DOML2DeprecatedBorderStyle_HTMLObjectElement { + codeType: string; + standby: string; + classid: string; + useMap: string; + form: HTMLFormElement; + data: string; + contentDocument: Document; + altHtml: string; + declare: boolean; + type: string; + BaseHref: string; +} + +interface SVGLocatable { + farthestViewportElement: SVGElement; + nearestViewportElement: SVGElement; + getBBox(): SVGRect; + getTransformToElement(element: SVGElement): SVGMatrix; + getCTM(): SVGMatrix; + getScreenCTM(): SVGMatrix; +} + +interface HTMLFontElement extends HTMLElement, DOML2DeprecatedColorProperty, MSHTMLFontElementExtensions, DOML2DeprecatedSizeProperty { + face: string; +} +declare var HTMLFontElement: { + prototype: HTMLFontElement; + new(): HTMLFontElement; +} + +interface MSHTMLTableElementExtensions { + cells: HTMLCollection; + height: any; + cols: number; + moveRow(indexFrom?: number, indexTo?: number): Object; +} + +interface SVGTitleElement extends SVGElement, SVGStylable, SVGLangSpace { +} +declare var SVGTitleElement: { + prototype: SVGTitleElement; + new(): SVGTitleElement; +} + +interface ControlRangeCollection { + length: number; + queryCommandValue(cmdID: string): any; + remove(index: number): void; + add(item: Element): void; + queryCommandIndeterm(cmdID: string): boolean; + scrollIntoView(varargStart?: any): void; + item(index: number): Element; + [index: number]: Element; + execCommand(cmdID: string, showUI?: boolean, value?: any): boolean; + addElement(item: Element): void; + queryCommandState(cmdID: string): boolean; + queryCommandSupported(cmdID: string): boolean; + queryCommandEnabled(cmdID: string): boolean; + queryCommandText(cmdID: string): string; + select(): void; +} +declare var ControlRangeCollection: { + prototype: ControlRangeCollection; + new(): ControlRangeCollection; +} + +interface DOML2DeprecatedAlignmentStyle_HTMLImageElement { + align: string; +} + +interface MSHTMLFrameElementExtensions { + width: any; + contentWindow: Window; + onload: (ev: Event) => any; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + frameBorder: string; + height: any; + border: string; + frameSpacing: any; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} + +interface MSNamespaceInfo extends MSEventAttachmentTarget { + urn: string; + onreadystatechange: (ev: Event) => any; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + name: string; + readyState: string; + doImport(implementationUrl: string): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var MSNamespaceInfo: { + prototype: MSNamespaceInfo; + new(): MSNamespaceInfo; +} + +interface WindowSessionStorage { + sessionStorage: Storage; +} + +interface SVGAnimatedTransformList { + animVal: SVGTransformList; + baseVal: SVGTransformList; +} +declare var SVGAnimatedTransformList: { + prototype: SVGAnimatedTransformList; + new(): SVGAnimatedTransformList; +} + +interface HTMLTableCaptionElement extends HTMLElement, MSHTMLTableCaptionElementExtensions, DOML2DeprecatedAlignmentStyle_HTMLTableCaptionElement { +} +declare var HTMLTableCaptionElement: { + prototype: HTMLTableCaptionElement; + new(): HTMLTableCaptionElement; +} + +interface HTMLOptionElement extends HTMLElement, MSDataBindingExtensions { + index: number; + defaultSelected: boolean; + value: string; + text: string; + form: HTMLFormElement; + label: string; + selected: boolean; +} +declare var HTMLOptionElement: { + prototype: HTMLOptionElement; + new(): HTMLOptionElement; +} + +interface HTMLMapElement extends HTMLElement { + name: string; + areas: HTMLAreasCollection; +} +declare var HTMLMapElement: { + prototype: HTMLMapElement; + new(): HTMLMapElement; +} + +interface HTMLMenuElement extends HTMLElement, DOML2DeprecatedListSpaceReduction, MSHTMLMenuElementExtensions { + type: string; +} +declare var HTMLMenuElement: { + prototype: HTMLMenuElement; + new(): HTMLMenuElement; +} + +interface MouseWheelEvent extends MouseEvent { + wheelDelta: number; + initMouseWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: AbstractView, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, wheelDeltaArg: number): void; +} +declare var MouseWheelEvent: { + prototype: MouseWheelEvent; + new(): MouseWheelEvent; +} + +interface SVGFitToViewBox { + viewBox: SVGAnimatedRect; + preserveAspectRatio: SVGAnimatedPreserveAspectRatio; +} + +interface MSHTMLAnchorElementExtensions { + nameProp: string; + protocolLong: string; + urn: string; + mimeType: string; + Methods: string; +} + +interface SVGPointList { + numberOfItems: number; + replaceItem(newItem: SVGPoint, index: number): SVGPoint; + getItem(index: number): SVGPoint; + clear(): void; + appendItem(newItem: SVGPoint): SVGPoint; + initialize(newItem: SVGPoint): SVGPoint; + removeItem(index: number): SVGPoint; + insertItemBefore(newItem: SVGPoint, index: number): SVGPoint; +} +declare var SVGPointList: { + prototype: SVGPointList; + new(): SVGPointList; +} + +interface MSElementCSSInlineStyleExtensions { + doScroll(component?: any): void; + componentFromPoint(x: number, y: number): string; +} + +interface SVGAnimatedLengthList { + animVal: SVGLengthList; + baseVal: SVGLengthList; +} +declare var SVGAnimatedLengthList: { + prototype: SVGAnimatedLengthList; + new(): SVGAnimatedLengthList; +} + +interface MSHTMLTableDataCellElementExtensions { +} + +interface Window extends ViewCSS, MSEventAttachmentTarget, MSWindowExtensions, WindowPerformance, ScreenView, EventTarget, WindowLocalStorage, WindowSessionStorage, WindowTimers { + ondragend: (ev: DragEvent) => any; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + onkeydown: (ev: KeyboardEvent) => any; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + ondragover: (ev: DragEvent) => any; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + onkeyup: (ev: KeyboardEvent) => any; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + onreset: (ev: Event) => any; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + onmouseup: (ev: MouseEvent) => any; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + ondragstart: (ev: DragEvent) => any; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + ondrag: (ev: DragEvent) => any; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + onmouseover: (ev: MouseEvent) => any; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + ondragleave: (ev: DragEvent) => any; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + history: History; + name: string; + onafterprint: (ev: Event) => any; + addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; + onpause: (ev: Event) => any; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + onbeforeprint: (ev: Event) => any; + addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; + top: Window; + onmousedown: (ev: MouseEvent) => any; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + onseeked: (ev: Event) => any; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + opener: Window; + onclick: (ev: MouseEvent) => any; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + onwaiting: (ev: Event) => any; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + ononline: (ev: Event) => any; + addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; + ondurationchange: (ev: Event) => any; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + frames: Window; + onblur: (ev: FocusEvent) => any; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + onemptied: (ev: Event) => any; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + onseeking: (ev: Event) => any; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + oncanplay: (ev: Event) => any; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + onstalled: (ev: Event) => any; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + onmousemove: (ev: MouseEvent) => any; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + onoffline: (ev: Event) => any; + addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; + length: number; + onbeforeunload: (ev: BeforeUnloadEvent) => any; + addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; + onratechange: (ev: Event) => any; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + onstorage: (ev: StorageEvent) => any; + addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; + onloadstart: (ev: Event) => any; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + ondragenter: (ev: DragEvent) => any; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + onsubmit: (ev: Event) => any; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + self: Window; + onprogress: (ev: any) => any; + addEventListener(type: "progress", listener: (ev: any) => any, useCapture?: boolean): void; + ondblclick: (ev: MouseEvent) => any; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + oncontextmenu: (ev: MouseEvent) => any; + addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + onchange: (ev: Event) => any; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + onloadedmetadata: (ev: Event) => any; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + onplay: (ev: Event) => any; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + onerror: ErrorFunction; + onplaying: (ev: Event) => any; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + parent: Window; + location: Location; + oncanplaythrough: (ev: Event) => any; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + onabort: (ev: UIEvent) => any; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + onreadystatechange: (ev: Event) => any; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + onkeypress: (ev: KeyboardEvent) => any; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + frameElement: Element; + onloadeddata: (ev: Event) => any; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + onsuspend: (ev: Event) => any; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + window: Window; + onfocus: (ev: FocusEvent) => any; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + onmessage: (ev: MessageEvent) => any; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + ontimeupdate: (ev: Event) => any; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + onresize: (ev: UIEvent) => any; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + navigator: Navigator; + onselect: (ev: UIEvent) => any; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + ondrop: (ev: DragEvent) => any; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + onmouseout: (ev: MouseEvent) => any; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + onended: (ev: Event) => any; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + onhashchange: (ev: Event) => any; + addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; + onunload: (ev: Event) => any; + addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; + onscroll: (ev: UIEvent) => any; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + onmousewheel: (ev: MouseWheelEvent) => any; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + onload: (ev: Event) => any; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + onvolumechange: (ev: Event) => any; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + oninput: (ev: Event) => any; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + alert(message?: string): void; + focus(): void; + print(): void; + prompt(message?: string, defaul?: string): string; + toString(): string; + open(url?: string, target?: string, features?: string, replace?: boolean): Window; + close(): void; + confirm(message?: string): boolean; + postMessage(message: any, targetOrigin: string, ports?: any): void; + showModalDialog(url?: string, argument?: any, options?: any): any; + blur(): void; + getSelection(): Selection; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var Window: { + prototype: Window; + new(): Window; +} + +interface SVGAnimatedPreserveAspectRatio { + animVal: SVGPreserveAspectRatio; + baseVal: SVGPreserveAspectRatio; +} +declare var SVGAnimatedPreserveAspectRatio: { + prototype: SVGAnimatedPreserveAspectRatio; + new(): SVGAnimatedPreserveAspectRatio; +} + +interface MSSiteModeEvent extends Event { + buttonID: number; + actionURL: string; +} +declare var MSSiteModeEvent: { + prototype: MSSiteModeEvent; + new(): MSSiteModeEvent; +} + +interface MSCSSStyleRuleExtensions { + readOnly: boolean; +} + +interface StyleSheetPageList { + length: number; + item(index: number): StyleSheetPage; + [index: number]: StyleSheetPage; +} +declare var StyleSheetPageList: { + prototype: StyleSheetPageList; + new(): StyleSheetPageList; +} + +interface HTMLCollection extends MSHTMLCollectionExtensions { + length: number; + item(nameOrIndex?: any, optionalIndex?: any): Element; + (nameOrIndex: any, optionalIndex: any): Element; + namedItem(name: string): Element; + [index: number]: Element; + (name: string): Element; +} +declare var HTMLCollection: { + prototype: HTMLCollection; + new(): HTMLCollection; +} + +interface MSCSSProperties extends CSSStyleDeclaration, MSCSSStyleDeclarationExtensions { + scrollbarShadowColor: string; + scrollbarHighlightColor: string; + layoutGridChar: string; + layoutGridType: string; + textAutospace: string; + textKashidaSpace: string; + writingMode: string; + scrollbarFaceColor: string; + backgroundPositionY: string; + lineBreak: string; + imeMode: string; + msBlockProgression: string; + layoutGridLine: string; + scrollbarBaseColor: string; + layoutGrid: string; + layoutFlow: string; + textKashida: string; + filter: string; + zoom: string; + scrollbarArrowColor: string; + behavior: string; + backgroundPositionX: string; + accelerator: string; + layoutGridMode: string; + textJustifyTrim: string; + scrollbar3dLightColor: string; + msInterpolationMode: string; + scrollbarTrackColor: string; + scrollbarDarkShadowColor: string; + styleFloat: string; +} +declare var MSCSSProperties: { + prototype: MSCSSProperties; + new(): MSCSSProperties; +} + +interface HTMLImageElement extends HTMLElement, DOML2DeprecatedMarginStyle, DOML2DeprecatedBorderStyle, DOML2DeprecatedAlignmentStyle_HTMLImageElement, MSImageResourceExtensions, MSHTMLImageElementExtensions, MSDataBindingExtensions, MSResourceMetadata { + width: number; + naturalHeight: number; + alt: string; + src: string; + useMap: string; + naturalWidth: number; + name: string; + height: number; + longDesc: string; + isMap: boolean; + complete: boolean; +} +declare var HTMLImageElement: { + prototype: HTMLImageElement; + new(): HTMLImageElement; +} + +interface HTMLAreaElement extends HTMLElement, MSHTMLAreaElementExtensions { + protocol: string; + search: string; + alt: string; + coords: string; + hostname: string; + port: string; + pathname: string; + host: string; + hash: string; + target: string; + href: string; + noHref: boolean; + shape: string; + toString(): string; +} +declare var HTMLAreaElement: { + prototype: HTMLAreaElement; + new(): HTMLAreaElement; +} + +interface EventTarget { + removeEventListener(type: string, listener: EventListener, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; + dispatchEvent(evt: Event): boolean; +} + +interface SVGAngle { + valueAsString: string; + valueInSpecifiedUnits: number; + value: number; + unitType: number; + newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; + convertToSpecifiedUnits(unitType: number): void; + SVG_ANGLETYPE_RAD: number; + SVG_ANGLETYPE_UNKNOWN: number; + SVG_ANGLETYPE_UNSPECIFIED: number; + SVG_ANGLETYPE_DEG: number; + SVG_ANGLETYPE_GRAD: number; +} +declare var SVGAngle: { + prototype: SVGAngle; + new(): SVGAngle; + SVG_ANGLETYPE_RAD: number; + SVG_ANGLETYPE_UNKNOWN: number; + SVG_ANGLETYPE_UNSPECIFIED: number; + SVG_ANGLETYPE_DEG: number; + SVG_ANGLETYPE_GRAD: number; +} + +interface HTMLButtonElement extends HTMLElement, MSHTMLButtonElementExtensions, MSDataBindingExtensions { + value: string; + form: HTMLFormElement; + name: string; + type: string; +} +declare var HTMLButtonElement: { + prototype: HTMLButtonElement; + new(): HTMLButtonElement; +} + +interface MSHTMLLabelElementExtensions { +} + +interface HTMLSourceElement extends HTMLElement { + src: string; + media: string; + type: string; +} +declare var HTMLSourceElement: { + prototype: HTMLSourceElement; + new(): HTMLSourceElement; +} + +interface CanvasGradient { + addColorStop(offset: number, color: string): void; +} +declare var CanvasGradient: { + prototype: CanvasGradient; + new(): CanvasGradient; +} + +interface KeyboardEvent extends UIEvent, KeyboardEventExtensions { + location: number; + shiftKey: boolean; + locale: string; + key: string; + altKey: boolean; + metaKey: boolean; + char: string; + ctrlKey: boolean; + repeat: boolean; + getModifierState(keyArg: string): boolean; + initKeyboardEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: AbstractView, keyArg: string, locationArg: number, modifiersListArg: string, repeat: boolean, locale: string): void; + DOM_KEY_LOCATION_RIGHT: number; + DOM_KEY_LOCATION_STANDARD: number; + DOM_KEY_LOCATION_LEFT: number; + DOM_KEY_LOCATION_NUMPAD: number; + DOM_KEY_LOCATION_JOYSTICK: number; + DOM_KEY_LOCATION_MOBILE: number; +} +declare var KeyboardEvent: { + prototype: KeyboardEvent; + new(): KeyboardEvent; + DOM_KEY_LOCATION_RIGHT: number; + DOM_KEY_LOCATION_STANDARD: number; + DOM_KEY_LOCATION_LEFT: number; + DOM_KEY_LOCATION_NUMPAD: number; + DOM_KEY_LOCATION_JOYSTICK: number; + DOM_KEY_LOCATION_MOBILE: number; +} + +interface Document extends Node, DocumentStyle, DocumentRange, HTMLDocument, NodeSelector, DocumentEvent, DocumentTraversal, DocumentView, SVGDocument { + doctype: DocumentType; + xmlVersion: string; + implementation: DOMImplementation; + xmlEncoding: string; + xmlStandalone: boolean; + documentElement: HTMLElement; + inputEncoding: string; + createElement(tagName: string): HTMLElement; + createElement(tagName: "a"): HTMLAnchorElement; + createElement(tagName: "abbr"): HTMLElement; + createElement(tagName: "address"): HTMLElement; + createElement(tagName: "area"): HTMLAreaElement; + createElement(tagName: "article"): HTMLElement; + createElement(tagName: "aside"): HTMLElement; + createElement(tagName: "audio"): HTMLAudioElement; + createElement(tagName: "b"): HTMLElement; + createElement(tagName: "base"): HTMLBaseElement; + createElement(tagName: "bdi"): HTMLElement; + createElement(tagName: "bdo"): HTMLElement; + createElement(tagName: "blockquote"): HTMLQuoteElement; + createElement(tagName: "body"): HTMLBodyElement; + createElement(tagName: "br"): HTMLBRElement; + createElement(tagName: "button"): HTMLButtonElement; + createElement(tagName: "canvas"): HTMLCanvasElement; + createElement(tagName: "caption"): HTMLTableCaptionElement; + createElement(tagName: "cite"): HTMLElement; + createElement(tagName: "code"): HTMLElement; + createElement(tagName: "col"): HTMLTableColElement; + createElement(tagName: "colgroup"): HTMLTableColElement; + createElement(tagName: "datalist"): HTMLDataListElement; + createElement(tagName: "dd"): HTMLElement; + createElement(tagName: "del"): HTMLModElement; + createElement(tagName: "dfn"): HTMLElement; + createElement(tagName: "div"): HTMLDivElement; + createElement(tagName: "dl"): HTMLDListElement; + createElement(tagName: "dt"): HTMLElement; + createElement(tagName: "em"): HTMLElement; + createElement(tagName: "embed"): HTMLEmbedElement; + createElement(tagName: "fieldset"): HTMLFieldSetElement; + createElement(tagName: "figcaption"): HTMLElement; + createElement(tagName: "figure"): HTMLElement; + createElement(tagName: "footer"): HTMLElement; + createElement(tagName: "form"): HTMLFormElement; + createElement(tagName: "h1"): HTMLHeadingElement; + createElement(tagName: "h2"): HTMLHeadingElement; + createElement(tagName: "h3"): HTMLHeadingElement; + createElement(tagName: "h4"): HTMLHeadingElement; + createElement(tagName: "h5"): HTMLHeadingElement; + createElement(tagName: "h6"): HTMLHeadingElement; + createElement(tagName: "head"): HTMLHeadElement; + createElement(tagName: "header"): HTMLElement; + createElement(tagName: "hgroup"): HTMLElement; + createElement(tagName: "hr"): HTMLHRElement; + createElement(tagName: "html"): HTMLHtmlElement; + createElement(tagName: "i"): HTMLElement; + createElement(tagName: "iframe"): HTMLIFrameElement; + createElement(tagName: "img"): HTMLImageElement; + createElement(tagName: "input"): HTMLInputElement; + createElement(tagName: "ins"): HTMLModElement; + createElement(tagName: "kbd"): HTMLElement; + createElement(tagName: "label"): HTMLLabelElement; + createElement(tagName: "legend"): HTMLLegendElement; + createElement(tagName: "li"): HTMLLIElement; + createElement(tagName: "link"): HTMLLinkElement; + createElement(tagName: "main"): HTMLElement; + createElement(tagName: "map"): HTMLMapElement; + createElement(tagName: "mark"): HTMLElement; + createElement(tagName: "menu"): HTMLMenuElement; + createElement(tagName: "meta"): HTMLMetaElement; + createElement(tagName: "nav"): HTMLElement; + createElement(tagName: "noscript"): HTMLElement; + createElement(tagName: "object"): HTMLObjectElement; + createElement(tagName: "ol"): HTMLOListElement; + createElement(tagName: "optgroup"): HTMLOptGroupElement; + createElement(tagName: "option"): HTMLOptionElement; + createElement(tagName: "p"): HTMLParagraphElement; + createElement(tagName: "param"): HTMLParamElement; + createElement(tagName: "pre"): HTMLPreElement; + createElement(tagName: "progress"): HTMLProgressElement; + createElement(tagName: "q"): HTMLQuoteElement; + createElement(tagName: "rp"): HTMLElement; + createElement(tagName: "rt"): HTMLElement; + createElement(tagName: "ruby"): HTMLElement; + createElement(tagName: "s"): HTMLElement; + createElement(tagName: "samp"): HTMLElement; + createElement(tagName: "script"): HTMLScriptElement; + createElement(tagName: "section"): HTMLElement; + createElement(tagName: "select"): HTMLSelectElement; + createElement(tagName: "small"): HTMLElement; + createElement(tagName: "source"): HTMLSourceElement; + createElement(tagName: "span"): HTMLSpanElement; + createElement(tagName: "strong"): HTMLElement; + createElement(tagName: "style"): HTMLStyleElement; + createElement(tagName: "sub"): HTMLElement; + createElement(tagName: "summary"): HTMLElement; + createElement(tagName: "sup"): HTMLElement; + createElement(tagName: "table"): HTMLTableElement; + createElement(tagName: "tbody"): HTMLTableSectionElement; + createElement(tagName: "td"): HTMLTableDataCellElement; + createElement(tagName: "textarea"): HTMLTextAreaElement; + createElement(tagName: "tfoot"): HTMLTableSectionElement; + createElement(tagName: "th"): HTMLTableHeaderCellElement; + createElement(tagName: "thead"): HTMLTableSectionElement; + createElement(tagName: "title"): HTMLTitleElement; + createElement(tagName: "tr"): HTMLTableRowElement; + createElement(tagName: "track"): HTMLTrackElement; + createElement(tagName: "u"): HTMLElement; + createElement(tagName: "ul"): HTMLUListElement; + createElement(tagName: "var"): HTMLElement; + createElement(tagName: "video"): HTMLVideoElement; + createElement(tagName: "wbr"): HTMLElement; + adoptNode(source: Node): Node; + createComment(data: string): Comment; + createDocumentFragment(): DocumentFragment; + getElementsByTagName(tagname: string): NodeList; + getElementsByTagName(name: "a"): NodeListOf; + getElementsByTagName(name: "abbr"): NodeListOf; + getElementsByTagName(name: "address"): NodeListOf; + getElementsByTagName(name: "area"): NodeListOf; + getElementsByTagName(name: "article"): NodeListOf; + getElementsByTagName(name: "aside"): NodeListOf; + getElementsByTagName(name: "audio"): NodeListOf; + getElementsByTagName(name: "b"): NodeListOf; + getElementsByTagName(name: "base"): NodeListOf; + getElementsByTagName(name: "bdi"): NodeListOf; + getElementsByTagName(name: "bdo"): NodeListOf; + getElementsByTagName(name: "blockquote"): NodeListOf; + getElementsByTagName(name: "body"): NodeListOf; + getElementsByTagName(name: "br"): NodeListOf; + getElementsByTagName(name: "button"): NodeListOf; + getElementsByTagName(name: "canvas"): NodeListOf; + getElementsByTagName(name: "caption"): NodeListOf; + getElementsByTagName(name: "cite"): NodeListOf; + getElementsByTagName(name: "code"): NodeListOf; + getElementsByTagName(name: "col"): NodeListOf; + getElementsByTagName(name: "colgroup"): NodeListOf; + getElementsByTagName(name: "datalist"): NodeListOf; + getElementsByTagName(name: "dd"): NodeListOf; + getElementsByTagName(name: "del"): NodeListOf; + getElementsByTagName(name: "dfn"): NodeListOf; + getElementsByTagName(name: "div"): NodeListOf; + getElementsByTagName(name: "dl"): NodeListOf; + getElementsByTagName(name: "dt"): NodeListOf; + getElementsByTagName(name: "em"): NodeListOf; + getElementsByTagName(name: "embed"): NodeListOf; + getElementsByTagName(name: "fieldset"): NodeListOf; + getElementsByTagName(name: "figcaption"): NodeListOf; + getElementsByTagName(name: "figure"): NodeListOf; + getElementsByTagName(name: "footer"): NodeListOf; + getElementsByTagName(name: "form"): NodeListOf; + getElementsByTagName(name: "h1"): NodeListOf; + getElementsByTagName(name: "h2"): NodeListOf; + getElementsByTagName(name: "h3"): NodeListOf; + getElementsByTagName(name: "h4"): NodeListOf; + getElementsByTagName(name: "h5"): NodeListOf; + getElementsByTagName(name: "h6"): NodeListOf; + getElementsByTagName(name: "head"): NodeListOf; + getElementsByTagName(name: "header"): NodeListOf; + getElementsByTagName(name: "hgroup"): NodeListOf; + getElementsByTagName(name: "hr"): NodeListOf; + getElementsByTagName(name: "html"): NodeListOf; + getElementsByTagName(name: "i"): NodeListOf; + getElementsByTagName(name: "iframe"): NodeListOf; + getElementsByTagName(name: "img"): NodeListOf; + getElementsByTagName(name: "input"): NodeListOf; + getElementsByTagName(name: "ins"): NodeListOf; + getElementsByTagName(name: "kbd"): NodeListOf; + getElementsByTagName(name: "label"): NodeListOf; + getElementsByTagName(name: "legend"): NodeListOf; + getElementsByTagName(name: "li"): NodeListOf; + getElementsByTagName(name: "link"): NodeListOf; + getElementsByTagName(name: "main"): NodeListOf; + getElementsByTagName(name: "map"): NodeListOf; + getElementsByTagName(name: "mark"): NodeListOf; + getElementsByTagName(name: "menu"): NodeListOf; + getElementsByTagName(name: "meta"): NodeListOf; + getElementsByTagName(name: "nav"): NodeListOf; + getElementsByTagName(name: "noscript"): NodeListOf; + getElementsByTagName(name: "object"): NodeListOf; + getElementsByTagName(name: "ol"): NodeListOf; + getElementsByTagName(name: "optgroup"): NodeListOf; + getElementsByTagName(name: "option"): NodeListOf; + getElementsByTagName(name: "p"): NodeListOf; + getElementsByTagName(name: "param"): NodeListOf; + getElementsByTagName(name: "pre"): NodeListOf; + getElementsByTagName(name: "progress"): NodeListOf; + getElementsByTagName(name: "q"): NodeListOf; + getElementsByTagName(name: "rp"): NodeListOf; + getElementsByTagName(name: "rt"): NodeListOf; + getElementsByTagName(name: "ruby"): NodeListOf; + getElementsByTagName(name: "s"): NodeListOf; + getElementsByTagName(name: "samp"): NodeListOf; + getElementsByTagName(name: "script"): NodeListOf; + getElementsByTagName(name: "section"): NodeListOf; + getElementsByTagName(name: "select"): NodeListOf; + getElementsByTagName(name: "small"): NodeListOf; + getElementsByTagName(name: "source"): NodeListOf; + getElementsByTagName(name: "span"): NodeListOf; + getElementsByTagName(name: "strong"): NodeListOf; + getElementsByTagName(name: "style"): NodeListOf; + getElementsByTagName(name: "sub"): NodeListOf; + getElementsByTagName(name: "summary"): NodeListOf; + getElementsByTagName(name: "sup"): NodeListOf; + getElementsByTagName(name: "table"): NodeListOf; + getElementsByTagName(name: "tbody"): NodeListOf; + getElementsByTagName(name: "td"): NodeListOf; + getElementsByTagName(name: "textarea"): NodeListOf; + getElementsByTagName(name: "tfoot"): NodeListOf; + getElementsByTagName(name: "th"): NodeListOf; + getElementsByTagName(name: "thead"): NodeListOf; + getElementsByTagName(name: "title"): NodeListOf; + getElementsByTagName(name: "tr"): NodeListOf; + getElementsByTagName(name: "track"): NodeListOf; + getElementsByTagName(name: "u"): NodeListOf; + getElementsByTagName(name: "ul"): NodeListOf; + getElementsByTagName(name: "var"): NodeListOf; + getElementsByTagName(name: "video"): NodeListOf; + getElementsByTagName(name: "wbr"): NodeListOf; + getElementsByTagNameNS(namespaceURI: string, localName: string): NodeList; + createProcessingInstruction(target: string, data: string): ProcessingInstruction; + createElementNS(namespaceURI: string, qualifiedName: string): Element; + createAttribute(name: string): Attr; + createTextNode(data: string): Text; + importNode(importedNode: Node, deep: boolean): Node; + createCDATASection(data: string): CDATASection; + createAttributeNS(namespaceURI: string, qualifiedName: string): Attr; + getElementById(elementId: string): HTMLElement; +} +declare var Document: { + prototype: Document; + new(): Document; +} + +interface MessageEvent extends Event { + source: Window; + origin: string; + data: any; + initMessageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, dataArg: any, originArg: string, lastEventIdArg: string, sourceArg: Window): void; +} +declare var MessageEvent: { + prototype: MessageEvent; + new(): MessageEvent; +} + +interface SVGElement extends Element, SVGElementEventHandlers { + xmlbase: string; + viewportElement: SVGElement; + id: string; + ownerSVGElement: SVGSVGElement; +} +declare var SVGElement: { + prototype: SVGElement; + new(): SVGElement; +} + +interface HTMLScriptElement extends HTMLElement { + defer: boolean; + text: string; + src: string; + htmlFor: string; + charset: string; + type: string; + event: string; +} +declare var HTMLScriptElement: { + prototype: HTMLScriptElement; + new(): HTMLScriptElement; +} + +interface MSHTMLBodyElementExtensions extends DOML2DeprecatedWordWrapSuppression_HTMLBodyElement { + scroll: string; + bottomMargin: any; + topMargin: any; + rightMargin: any; + bgProperties: string; + leftMargin: any; + createTextRange(): TextRange; +} + +interface HTMLTableRowElement extends HTMLElement, MSBorderColorHighlightStyle_HTMLTableRowElement, HTMLTableAlignment, MSBorderColorStyle_HTMLTableRowElement, DOML2DeprecatedAlignmentStyle_HTMLTableRowElement, DOML2DeprecatedBackgroundColorStyle, MSHTMLTableRowElementExtensions { + rowIndex: number; + cells: HTMLCollection; + sectionRowIndex: number; + deleteCell(index?: number): void; + insertCell(index?: number): HTMLElement; +} +declare var HTMLTableRowElement: { + prototype: HTMLTableRowElement; + new(): HTMLTableRowElement; +} + +interface MSCommentExtensions { + text: string; +} + +interface DOML2DeprecatedMarginStyle_HTMLMarqueeElement { + vspace: number; + hspace: number; +} + +interface MSCSSRuleList { + length: number; + item(index?: number): CSSStyleRule; + [index: number]: CSSStyleRule; +} +declare var MSCSSRuleList: { + prototype: MSCSSRuleList; + new(): MSCSSRuleList; +} + +interface CanvasRenderingContext2D { + shadowOffsetX: number; + lineWidth: number; + miterLimit: number; + canvas: HTMLCanvasElement; + strokeStyle: any; + font: string; + globalAlpha: number; + globalCompositeOperation: string; + shadowOffsetY: number; + fillStyle: any; + lineCap: string; + shadowBlur: number; + textAlign: string; + textBaseline: string; + shadowColor: string; + lineJoin: string; + restore(): void; + setTransform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; + save(): void; + arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; + measureText(text: string): TextMetrics; + isPointInPath(x: number, y: number): boolean; + quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; + putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX?: number, dirtyY?: number, dirtyWidth?: number, dirtyHeight?: number): void; + rotate(angle: number): void; + fillText(text: string, x: number, y: number, maxWidth?: number): void; + translate(x: number, y: number): void; + scale(x: number, y: number): void; + createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; + lineTo(x: number, y: number): void; + fill(): void; + createPattern(image: HTMLElement, repetition: string): CanvasPattern; + closePath(): void; + rect(x: number, y: number, w: number, h: number): void; + clip(): void; + createImageData(imageDataOrSw: any, sh?: number): ImageData; + clearRect(x: number, y: number, w: number, h: number): void; + moveTo(x: number, y: number): void; + getImageData(sx: number, sy: number, sw: number, sh: number): ImageData; + fillRect(x: number, y: number, w: number, h: number): void; + bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; + drawImage(image: HTMLElement, offsetX: number, offsetY: number, width?: number, height?: number, canvasOffsetX?: number, canvasOffsetY?: number, canvasImageWidth?: number, canvasImageHeight?: number): void; + transform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; + stroke(): void; + strokeRect(x: number, y: number, w: number, h: number): void; + strokeText(text: string, x: number, y: number, maxWidth?: number): void; + beginPath(): void; + arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; + createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient; +} +declare var CanvasRenderingContext2D: { + prototype: CanvasRenderingContext2D; + new(): CanvasRenderingContext2D; +} + +interface SVGPathSegLinetoHorizontalAbs extends SVGPathSeg { + x: number; +} +declare var SVGPathSegLinetoHorizontalAbs: { + prototype: SVGPathSegLinetoHorizontalAbs; + new(): SVGPathSegLinetoHorizontalAbs; +} + +interface DOML2DeprecatedAlignmentStyle_HTMLObjectElement { + align: string; +} + +interface DOML2DeprecatedBorderStyle_MSHTMLIFrameElementExtensions { + border: string; +} + +interface MSHTMLElementRangeExtensions { + createControlRange(): ControlRangeCollection; +} + +interface SVGPathSegArcAbs extends SVGPathSeg { + y: number; + sweepFlag: boolean; + r2: number; + x: number; + angle: number; + r1: number; + largeArcFlag: boolean; +} +declare var SVGPathSegArcAbs: { + prototype: SVGPathSegArcAbs; + new(): SVGPathSegArcAbs; +} + +interface MSScreenExtensions { + deviceXDPI: number; + fontSmoothingEnabled: boolean; + bufferDepth: number; + logicalXDPI: number; + systemXDPI: number; + logicalYDPI: number; + systemYDPI: number; + updateInterval: number; + deviceYDPI: number; +} + +interface HTMLHtmlElement extends HTMLElement, HTMLHtmlElementDOML2Deprecated { +} +declare var HTMLHtmlElement: { + prototype: HTMLHtmlElement; + new(): HTMLHtmlElement; +} + +interface MSBorderColorStyle { + borderColor: any; +} + +interface SVGTransformList { + numberOfItems: number; + getItem(index: number): SVGTransform; + consolidate(): SVGTransform; + clear(): void; + appendItem(newItem: SVGTransform): SVGTransform; + initialize(newItem: SVGTransform): SVGTransform; + removeItem(index: number): SVGTransform; + insertItemBefore(newItem: SVGTransform, index: number): SVGTransform; + replaceItem(newItem: SVGTransform, index: number): SVGTransform; + createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; +} +declare var SVGTransformList: { + prototype: SVGTransformList; + new(): SVGTransformList; +} + +interface SVGPathSegClosePath extends SVGPathSeg { +} +declare var SVGPathSegClosePath: { + prototype: SVGPathSegClosePath; + new(): SVGPathSegClosePath; +} + +interface DOML2DeprecatedMarginStyle_MSHTMLIFrameElementExtensions { + vspace: number; + hspace: number; +} + +interface HTMLFrameElement extends HTMLElement, GetSVGDocument, MSHTMLFrameElementExtensions, MSDataBindingExtensions, MSBorderColorStyle_HTMLFrameElement { + scrolling: string; + marginHeight: string; + src: string; + name: string; + marginWidth: string; + contentDocument: Document; + longDesc: string; + noResize: boolean; +} +declare var HTMLFrameElement: { + prototype: HTMLFrameElement; + new(): HTMLFrameElement; +} + +interface SVGAnimatedLength { + animVal: SVGLength; + baseVal: SVGLength; +} +declare var SVGAnimatedLength: { + prototype: SVGAnimatedLength; + new(): SVGAnimatedLength; +} + +interface CSSMediaRule extends CSSRule { + media: MediaList; + cssRules: CSSRuleList; + insertRule(rule: string, index?: number): number; + deleteRule(index?: number): void; +} +declare var CSSMediaRule: { + prototype: CSSMediaRule; + new(): CSSMediaRule; +} + +interface HTMLQuoteElement extends HTMLElement, MSHTMLQuoteElementExtensions { + cite: string; +} +declare var HTMLQuoteElement: { + prototype: HTMLQuoteElement; + new(): HTMLQuoteElement; +} + +interface SVGDefsElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests { +} +declare var SVGDefsElement: { + prototype: SVGDefsElement; + new(): SVGDefsElement; +} + +interface SVGAnimatedPoints { + points: SVGPointList; + animatedPoints: SVGPointList; +} + +interface WindowModal { + dialogArguments: any; + returnValue: any; +} + +interface MSHTMLButtonElementExtensions { + status: any; + createTextRange(): TextRange; +} + +interface XMLHttpRequest extends EventTarget, MSXMLHttpRequestExtensions { + onreadystatechange: (ev: Event) => any; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + status: number; + onload: (ev: Event) => any; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + readyState: number; + responseText: string; + responseXML: Document; + statusText: string; + open(method: string, url: string, async?: boolean, user?: string, password?: string): void; + send(data?: any): void; + abort(): void; + getAllResponseHeaders(): string; + setRequestHeader(header: string, value: string): void; + getResponseHeader(header: string): string; + LOADING: number; + DONE: number; + UNSENT: number; + OPENED: number; + HEADERS_RECEIVED: number; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var XMLHttpRequest: { + prototype: XMLHttpRequest; + new (): XMLHttpRequest; + LOADING: number; + DONE: number; + UNSENT: number; + OPENED: number; + HEADERS_RECEIVED: number; +} + +interface HTMLTableHeaderCellElement extends HTMLTableCellElement, HTMLTableHeaderCellScope { +} +declare var HTMLTableHeaderCellElement: { + prototype: HTMLTableHeaderCellElement; + new(): HTMLTableHeaderCellElement; +} + +interface HTMLDListElement extends HTMLElement, DOML2DeprecatedListSpaceReduction, MSHTMLDListElementExtensions { +} +declare var HTMLDListElement: { + prototype: HTMLDListElement; + new(): HTMLDListElement; +} + +interface MSDataBindingExtensions { + dataSrc: string; + dataFormatAs: string; + dataFld: string; +} + +interface SVGEllipseElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests { + ry: SVGAnimatedLength; + cx: SVGAnimatedLength; + rx: SVGAnimatedLength; + cy: SVGAnimatedLength; +} +declare var SVGEllipseElement: { + prototype: SVGEllipseElement; + new(): SVGEllipseElement; +} + +interface SVGPathSegLinetoHorizontalRel extends SVGPathSeg { + x: number; +} +declare var SVGPathSegLinetoHorizontalRel: { + prototype: SVGPathSegLinetoHorizontalRel; + new(): SVGPathSegLinetoHorizontalRel; +} + +interface SVGAElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGURIReference { + target: SVGAnimatedString; +} +declare var SVGAElement: { + prototype: SVGAElement; + new(): SVGAElement; +} + +interface MSHTMLMetaElementExtensions { + url: string; + charset: string; +} + +interface SVGStylable { + className: SVGAnimatedString; + style: CSSStyleDeclaration; +} + +interface MSHTMLTableCellElementExtensions { +} + +interface HTMLFrameSetElement extends HTMLElement, MSHTMLFrameSetElementExtensions, MSBorderColorStyle_HTMLFrameSetElement { + onresize: (ev: UIEvent) => any; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + ononline: (ev: Event) => any; + addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; + onafterprint: (ev: Event) => any; + addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; + onbeforeprint: (ev: Event) => any; + addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; + onoffline: (ev: Event) => any; + addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; + rows: string; + cols: string; + onblur: (ev: FocusEvent) => any; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + onunload: (ev: Event) => any; + addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; + onhashchange: (ev: Event) => any; + addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; + onfocus: (ev: FocusEvent) => any; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + onmessage: (ev: MessageEvent) => any; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + onload: (ev: Event) => any; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + onerror: (ev: Event) => any; + addEventListener(type: "error", listener: (ev: Event) => any, useCapture?: boolean): void; + onbeforeunload: (ev: BeforeUnloadEvent) => any; + addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; + onstorage: (ev: StorageEvent) => any; + addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var HTMLFrameSetElement: { + prototype: HTMLFrameSetElement; + new(): HTMLFrameSetElement; +} + +interface SVGTransformable extends SVGLocatable { + transform: SVGAnimatedTransformList; +} + +interface Screen extends MSScreenExtensions { + width: number; + colorDepth: number; + availWidth: number; + pixelDepth: number; + availHeight: number; + height: number; +} +declare var Screen: { + prototype: Screen; + new(): Screen; +} + +interface NavigatorGeolocation { + geolocation: Geolocation; +} + +interface Coordinates { + altitudeAccuracy: number; + longitude: number; + latitude: number; + speed: number; + heading: number; + altitude: number; + accuracy: number; +} +declare var Coordinates: { + prototype: Coordinates; + new(): Coordinates; +} + +interface DOML2DeprecatedAlignmentStyle_HTMLTableColElement { + align: string; +} + +interface EventListener { + (evt: Event): void; +} + +interface SVGLangSpace { + xmllang: string; + xmlspace: string; +} + +interface DataTransfer { + effectAllowed: string; + dropEffect: string; + clearData(format?: string): boolean; + setData(format: string, data: string): boolean; + getData(format: string): string; +} +declare var DataTransfer: { + prototype: DataTransfer; + new(): DataTransfer; +} + +interface FocusEvent extends UIEvent { + relatedTarget: EventTarget; + initFocusEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: AbstractView, detailArg: number, relatedTargetArg: EventTarget): void; +} +declare var FocusEvent: { + prototype: FocusEvent; + new(): FocusEvent; +} + +interface Range { + startOffset: number; + collapsed: boolean; + endOffset: number; + startContainer: Node; + endContainer: Node; + commonAncestorContainer: Node; + setStart(refNode: Node, offset: number): void; + setEndBefore(refNode: Node): void; + setStartBefore(refNode: Node): void; + selectNode(refNode: Node): void; + detach(): void; + getBoundingClientRect(): ClientRect; + toString(): string; + compareBoundaryPoints(how: number, sourceRange: Range): number; + insertNode(newNode: Node): void; + collapse(toStart: boolean): void; + selectNodeContents(refNode: Node): void; + cloneContents(): DocumentFragment; + setEnd(refNode: Node, offset: number): void; + cloneRange(): Range; + getClientRects(): ClientRectList; + surroundContents(newParent: Node): void; + deleteContents(): void; + setStartAfter(refNode: Node): void; + extractContents(): DocumentFragment; + setEndAfter(refNode: Node): void; + END_TO_END: number; + START_TO_START: number; + START_TO_END: number; + END_TO_START: number; +} +declare var Range: { + prototype: Range; + new(): Range; + END_TO_END: number; + START_TO_START: number; + START_TO_END: number; + END_TO_START: number; +} + +interface MSHTMLPreElementExtensions extends DOML2DeprecatedTextFlowControl_HTMLBlockElement { + cite: string; +} + +interface SVGPoint { + y: number; + x: number; + matrixTransform(matrix: SVGMatrix): SVGPoint; +} +declare var SVGPoint: { + prototype: SVGPoint; + new(): SVGPoint; +} + +interface MSPluginsCollection { + length: number; + refresh(reload?: boolean): void; +} +declare var MSPluginsCollection: { + prototype: MSPluginsCollection; + new(): MSPluginsCollection; +} + +interface MSHTMLFontElementExtensions { +} + +interface SVGAnimatedNumberList { + animVal: SVGNumberList; + baseVal: SVGNumberList; +} +declare var SVGAnimatedNumberList: { + prototype: SVGAnimatedNumberList; + new(): SVGAnimatedNumberList; +} + +interface SVGSVGElement extends SVGElement, SVGZoomAndPan, SVGLangSpace, SVGLocatable, SVGTests, SVGFitToViewBox, SVGSVGElementEventHandlers, SVGStylable, DocumentEvent, ViewCSS_SVGSVGElement { + width: SVGAnimatedLength; + x: SVGAnimatedLength; + contentStyleType: string; + screenPixelToMillimeterY: number; + height: SVGAnimatedLength; + contentScriptType: string; + pixelUnitToMillimeterX: number; + currentTranslate: SVGPoint; + y: SVGAnimatedLength; + viewport: SVGRect; + currentScale: number; + screenPixelToMillimeterX: number; + pixelUnitToMillimeterY: number; + setCurrentTime(seconds: number): void; + createSVGLength(): SVGLength; + getIntersectionList(rect: SVGRect, referenceElement: SVGElement): NodeList; + unpauseAnimations(): void; + createSVGRect(): SVGRect; + checkIntersection(element: SVGElement, rect: SVGRect): boolean; + unsuspendRedrawAll(): void; + pauseAnimations(): void; + suspendRedraw(maxWaitMilliseconds: number): number; + deselectAll(): void; + createSVGAngle(): SVGAngle; + getEnclosureList(rect: SVGRect, referenceElement: SVGElement): NodeList; + createSVGTransform(): SVGTransform; + unsuspendRedraw(suspendHandleID: number): void; + forceRedraw(): void; + getCurrentTime(): number; + checkEnclosure(element: SVGElement, rect: SVGRect): boolean; + createSVGMatrix(): SVGMatrix; + createSVGPoint(): SVGPoint; + createSVGNumber(): SVGNumber; + createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; + getElementById(elementId: string): Element; +} +declare var SVGSVGElement: { + prototype: SVGSVGElement; + new(): SVGSVGElement; +} + +interface HTMLLabelElement extends HTMLElement, MSDataBindingExtensions, MSHTMLLabelElementExtensions { + htmlFor: string; + form: HTMLFormElement; +} +declare var HTMLLabelElement: { + prototype: HTMLLabelElement; + new(): HTMLLabelElement; +} + +interface MSResourceMetadata { + protocol: string; + fileSize: string; + fileUpdatedDate: string; + nameProp: string; + fileCreatedDate: string; + fileModifiedDate: string; + mimeType: string; +} + +interface MSHTMLQuoteElementExtensions { + dateTime: string; +} + +interface DOML2DeprecatedAlignmentStyle_HTMLIFrameElement { + align: string; +} + +interface HTMLLegendElement extends HTMLElement, DOML2DeprecatedAlignmentStyle_HTMLLegendElement, MSDataBindingExtensions, MSHTMLLegendElementExtensions { + form: HTMLFormElement; +} +declare var HTMLLegendElement: { + prototype: HTMLLegendElement; + new(): HTMLLegendElement; +} + +interface HTMLDirectoryElement extends HTMLElement, DOML2DeprecatedListSpaceReduction, MSHTMLDirectoryElementExtensions { +} +declare var HTMLDirectoryElement: { + prototype: HTMLDirectoryElement; + new(): HTMLDirectoryElement; +} + +interface NavigatorAbilities { +} + +interface MSHTMLImageElementExtensions { + href: string; +} + +interface SVGAnimatedInteger { + animVal: number; + baseVal: number; +} +declare var SVGAnimatedInteger: { + prototype: SVGAnimatedInteger; + new(): SVGAnimatedInteger; +} + +interface SVGTextElement extends SVGTextPositioningElement, SVGTransformable { +} +declare var SVGTextElement: { + prototype: SVGTextElement; + new(): SVGTextElement; +} + +interface SVGTSpanElement extends SVGTextPositioningElement { +} +declare var SVGTSpanElement: { + prototype: SVGTSpanElement; + new(): SVGTSpanElement; +} + +interface HTMLLIElement extends HTMLElement, DOML2DeprecatedListNumberingAndBulletStyle, MSHTMLLIElementExtensions { + value: number; +} +declare var HTMLLIElement: { + prototype: HTMLLIElement; + new(): HTMLLIElement; +} + +interface SVGPathSegLinetoVerticalAbs extends SVGPathSeg { + y: number; +} +declare var SVGPathSegLinetoVerticalAbs: { + prototype: SVGPathSegLinetoVerticalAbs; + new(): SVGPathSegLinetoVerticalAbs; +} + +interface ViewCSS { + getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; +} + +interface MSAttrExtensions { + expando: boolean; +} + +interface MSStorageExtensions { + remainingSpace: number; +} + +interface SVGStyleElement extends SVGElement, SVGLangSpace { + media: string; + type: string; + title: string; +} +declare var SVGStyleElement: { + prototype: SVGStyleElement; + new(): SVGStyleElement; +} + +interface MSCurrentStyleCSSProperties extends MSCSSProperties { + blockDirection: string; + clipBottom: string; + clipLeft: string; + clipRight: string; + clipTop: string; + hasLayout: string; +} +declare var MSCurrentStyleCSSProperties: { + prototype: MSCurrentStyleCSSProperties; + new(): MSCurrentStyleCSSProperties; +} + +interface MSLinkStyleExtensions { + styleSheet: StyleSheet; +} + +interface MSHTMLCollectionExtensions { + urns(urn: any): Object; + tags(tagName: any): Object; +} + +interface DOML2DeprecatedWordWrapSuppression_HTMLDivElement { + noWrap: boolean; +} + +interface DocumentTraversal { + createNodeIterator(root: Node, whatToShow: number, filter: NodeFilterCallback, entityReferenceExpansion: boolean): NodeIterator; + createTreeWalker(root: Node, whatToShow: number, filter: NodeFilterCallback, entityReferenceExpansion: boolean): TreeWalker; +} + +interface Storage extends MSStorageExtensions { + length: number; + getItem(key: string): any; + [key: string]: any; + setItem(key: string, data: string): void; + clear(): void; + removeItem(key: string): void; + key(index: number): string; + [index: number]: any; +} +declare var Storage: { + prototype: Storage; + new(): Storage; +} + +interface HTMLTableHeaderCellScope { + scope: string; +} + +interface HTMLIFrameElement extends HTMLElement, GetSVGDocument, MSHTMLIFrameElementExtensions, MSDataBindingExtensions, DOML2DeprecatedAlignmentStyle_HTMLIFrameElement { + width: string; + contentWindow: Window; + scrolling: string; + src: string; + marginHeight: string; + name: string; + marginWidth: string; + height: string; + contentDocument: Document; + longDesc: string; + frameBorder: string; +} +declare var HTMLIFrameElement: { + prototype: HTMLIFrameElement; + new(): HTMLIFrameElement; +} + +interface MSNavigatorAbilities { + userLanguage: string; + plugins: MSPluginsCollection; + cookieEnabled: boolean; + appCodeName: string; + cpuClass: string; + appMinorVersion: string; + connectionSpeed: number; + browserLanguage: string; + mimeTypes: MSMimeTypesCollection; + product: string; + systemLanguage: string; + javaEnabled(): boolean; + taintEnabled(): boolean; +} + +interface TextRangeCollection { + length: number; + item(index: number): TextRange; + [index: number]: TextRange; +} +declare var TextRangeCollection: { + prototype: TextRangeCollection; + new(): TextRangeCollection; +} + +interface HTMLBodyElement extends HTMLElement, HTMLBodyElementDOML2Deprecated, MSHTMLBodyElementExtensions, DOML2DeprecatedBackgroundStyle, DOML2DeprecatedBackgroundColorStyle { + onresize: (ev: UIEvent) => any; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + ononline: (ev: Event) => any; + addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; + onafterprint: (ev: Event) => any; + addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; + onbeforeprint: (ev: Event) => any; + addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; + onoffline: (ev: Event) => any; + addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; + onblur: (ev: FocusEvent) => any; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + onhashchange: (ev: Event) => any; + addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; + onunload: (ev: Event) => any; + addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; + onfocus: (ev: FocusEvent) => any; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + onmessage: (ev: MessageEvent) => any; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + onload: (ev: Event) => any; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + onerror: (ev: Event) => any; + addEventListener(type: "error", listener: (ev: Event) => any, useCapture?: boolean): void; + onbeforeunload: (ev: BeforeUnloadEvent) => any; + addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; + onstorage: (ev: StorageEvent) => any; + addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var HTMLBodyElement: { + prototype: HTMLBodyElement; + new(): HTMLBodyElement; +} + +interface DocumentType extends Node { + name: string; + notations: NamedNodeMap; + systemId: string; + internalSubset: string; + entities: NamedNodeMap; + publicId: string; +} +declare var DocumentType: { + prototype: DocumentType; + new(): DocumentType; +} + +interface MSHTMLInputElementExtensions extends DOML2DeprecatedMarginStyle_HTMLInputElement, DOML2DeprecatedBorderStyle_HTMLInputElement { + status: boolean; + complete: boolean; + createTextRange(): TextRange; +} + +interface DOML2DeprecatedAlignmentStyle_HTMLLegendElement { + align: string; +} + +interface SVGRadialGradientElement extends SVGGradientElement { + cx: SVGAnimatedLength; + r: SVGAnimatedLength; + cy: SVGAnimatedLength; + fx: SVGAnimatedLength; + fy: SVGAnimatedLength; +} +declare var SVGRadialGradientElement: { + prototype: SVGRadialGradientElement; + new(): SVGRadialGradientElement; +} + +interface MutationEvent extends Event { + newValue: string; + attrChange: number; + attrName: string; + prevValue: string; + relatedNode: Node; + initMutationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, relatedNodeArg: Node, prevValueArg: string, newValueArg: string, attrNameArg: string, attrChangeArg: number): void; + MODIFICATION: number; + REMOVAL: number; + ADDITION: number; +} +declare var MutationEvent: { + prototype: MutationEvent; + new(): MutationEvent; + MODIFICATION: number; + REMOVAL: number; + ADDITION: number; +} + +interface DragEvent extends MouseEvent { + dataTransfer: DataTransfer; + initDragEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: AbstractView, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, dataTransferArg: DataTransfer): void; +} +declare var DragEvent: { + prototype: DragEvent; + new(): DragEvent; +} + +interface DOML2DeprecatedWidthStyle_HTMLTableCellElement { + width: number; +} + +interface HTMLTableSectionElement extends HTMLElement, MSHTMLTableSectionElementExtensions, DOML2DeprecatedAlignmentStyle_HTMLTableSectionElement, HTMLTableAlignment { + rows: HTMLCollection; + deleteRow(index?: number): void; + insertRow(index?: number): HTMLElement; +} +declare var HTMLTableSectionElement: { + prototype: HTMLTableSectionElement; + new(): HTMLTableSectionElement; +} + +interface DOML2DeprecatedListNumberingAndBulletStyle { + type: string; +} + +interface HTMLInputElement extends HTMLElement, DOML2DeprecatedAlignmentStyle_HTMLInputElement, MSImageResourceExtensions_HTMLInputElement, MSHTMLInputElementExtensions, MSDataBindingExtensions { + width: string; + defaultChecked: boolean; + alt: string; + accept: string; + value: string; + src: string; + useMap: string; + name: string; + form: HTMLFormElement; + selectionStart: number; + height: string; + indeterminate: boolean; + readOnly: boolean; + size: number; + checked: boolean; + maxLength: number; + selectionEnd: number; + type: string; + defaultValue: string; + setSelectionRange(start: number, end: number): void; + select(): void; +} +declare var HTMLInputElement: { + prototype: HTMLInputElement; + new(): HTMLInputElement; +} + +interface HTMLAnchorElement extends HTMLElement, MSHTMLAnchorElementExtensions, MSDataBindingExtensions { + rel: string; + protocol: string; + search: string; + coords: string; + hostname: string; + pathname: string; + target: string; + href: string; + name: string; + charset: string; + hreflang: string; + port: string; + host: string; + hash: string; + rev: string; + type: string; + shape: string; + toString(): string; +} +declare var HTMLAnchorElement: { + prototype: HTMLAnchorElement; + new(): HTMLAnchorElement; +} + +interface SVGImageElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGURIReference { + y: SVGAnimatedLength; + width: SVGAnimatedLength; + preserveAspectRatio: SVGAnimatedPreserveAspectRatio; + x: SVGAnimatedLength; + height: SVGAnimatedLength; +} +declare var SVGImageElement: { + prototype: SVGImageElement; + new(): SVGImageElement; +} + +interface MSElementExtensions { + msMatchesSelector(selectors: string): boolean; + fireEvent(eventName: string, eventObj?: any): boolean; +} + +interface HTMLParamElement extends HTMLElement { + value: string; + name: string; + type: string; + valueType: string; +} +declare var HTMLParamElement: { + prototype: HTMLParamElement; + new(): HTMLParamElement; +} + +interface MSHTMLDocumentViewExtensions { + createStyleSheet(href?: string, index?: number): CSSStyleSheet; +} + +interface SVGAnimatedNumber { + animVal: number; + baseVal: number; +} +declare var SVGAnimatedNumber: { + prototype: SVGAnimatedNumber; + new(): SVGAnimatedNumber; +} + +interface PerformanceTiming { + redirectStart: number; + domainLookupEnd: number; + responseStart: number; + domComplete: number; + domainLookupStart: number; + loadEventStart: number; + msFirstPaint: number; + unloadEventEnd: number; + fetchStart: number; + requestStart: number; + domInteractive: number; + navigationStart: number; + connectEnd: number; + loadEventEnd: number; + connectStart: number; + responseEnd: number; + domLoading: number; + redirectEnd: number; + unloadEventStart: number; + domContentLoadedEventStart: number; + domContentLoadedEventEnd: number; + toJSON(): any; +} +declare var PerformanceTiming: { + prototype: PerformanceTiming; + new(): PerformanceTiming; +} + +interface DOML2DeprecatedAlignmentStyle_HTMLInputElement { + align: string; +} + +interface HTMLPreElement extends HTMLElement, DOML2DeprecatedWidthStyle, MSHTMLPreElementExtensions { +} +declare var HTMLPreElement: { + prototype: HTMLPreElement; + new(): HTMLPreElement; +} + +interface EventException { + code: number; + message: string; + toString(): string; + DISPATCH_REQUEST_ERR: number; + UNSPECIFIED_EVENT_TYPE_ERR: number; +} +declare var EventException: { + prototype: EventException; + new(): EventException; + DISPATCH_REQUEST_ERR: number; + UNSPECIFIED_EVENT_TYPE_ERR: number; +} + +interface MSBorderColorHighlightStyle_HTMLTableCellElement { + borderColorLight: any; + borderColorDark: any; +} + +interface DOMHTMLImplementation { + createHTMLDocument(title: string): Document; +} + +interface NavigatorOnLine { + onLine: boolean; +} + +interface SVGElementEventHandlers { + onmouseover: (ev: MouseEvent) => any; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + onmousemove: (ev: MouseEvent) => any; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + onmouseout: (ev: MouseEvent) => any; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + ondblclick: (ev: MouseEvent) => any; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + onfocusout: (ev: FocusEvent) => any; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + onfocusin: (ev: FocusEvent) => any; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + onmousedown: (ev: MouseEvent) => any; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + onmouseup: (ev: MouseEvent) => any; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + onload: (ev: Event) => any; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + onclick: (ev: MouseEvent) => any; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} + +interface WindowLocalStorage { + localStorage: Storage; +} + +interface SVGMetadataElement extends SVGElement { +} +declare var SVGMetadataElement: { + prototype: SVGMetadataElement; + new(): SVGMetadataElement; +} + +interface SVGPathSegArcRel extends SVGPathSeg { + y: number; + sweepFlag: boolean; + r2: number; + x: number; + angle: number; + r1: number; + largeArcFlag: boolean; +} +declare var SVGPathSegArcRel: { + prototype: SVGPathSegArcRel; + new(): SVGPathSegArcRel; +} + +interface SVGPathSegMovetoAbs extends SVGPathSeg { + y: number; + x: number; +} +declare var SVGPathSegMovetoAbs: { + prototype: SVGPathSegMovetoAbs; + new(): SVGPathSegMovetoAbs; +} + +interface SVGStringList { + numberOfItems: number; + replaceItem(newItem: string, index: number): string; + getItem(index: number): string; + clear(): void; + appendItem(newItem: string): string; + initialize(newItem: string): string; + removeItem(index: number): string; + insertItemBefore(newItem: string, index: number): string; +} +declare var SVGStringList: { + prototype: SVGStringList; + new(): SVGStringList; +} + +interface XDomainRequest { + timeout: number; + onerror: (ev: Event) => any; + addEventListener(type: "error", listener: (ev: Event) => any, useCapture?: boolean): void; + onload: (ev: Event) => any; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + onprogress: (ev: any) => any; + addEventListener(type: "progress", listener: (ev: any) => any, useCapture?: boolean): void; + ontimeout: (ev: Event) => any; + addEventListener(type: "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; + responseText: string; + contentType: string; + open(method: string, url: string): void; + abort(): void; + send(data?: any): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var XDomainRequest: { + prototype: XDomainRequest; + new (): XDomainRequest; +} + +interface DOML2DeprecatedBackgroundColorStyle { + bgColor: any; +} + +interface ElementTraversal { + childElementCount: number; + previousElementSibling: Element; + lastElementChild: Element; + nextElementSibling: Element; + firstElementChild: Element; +} + +interface SVGLength { + valueAsString: string; + valueInSpecifiedUnits: number; + value: number; + unitType: number; + newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; + convertToSpecifiedUnits(unitType: number): void; + SVG_LENGTHTYPE_NUMBER: number; + SVG_LENGTHTYPE_CM: number; + SVG_LENGTHTYPE_PC: number; + SVG_LENGTHTYPE_PERCENTAGE: number; + SVG_LENGTHTYPE_MM: number; + SVG_LENGTHTYPE_PT: number; + SVG_LENGTHTYPE_IN: number; + SVG_LENGTHTYPE_EMS: number; + SVG_LENGTHTYPE_PX: number; + SVG_LENGTHTYPE_UNKNOWN: number; + SVG_LENGTHTYPE_EXS: number; +} +declare var SVGLength: { + prototype: SVGLength; + new(): SVGLength; + SVG_LENGTHTYPE_NUMBER: number; + SVG_LENGTHTYPE_CM: number; + SVG_LENGTHTYPE_PC: number; + SVG_LENGTHTYPE_PERCENTAGE: number; + SVG_LENGTHTYPE_MM: number; + SVG_LENGTHTYPE_PT: number; + SVG_LENGTHTYPE_IN: number; + SVG_LENGTHTYPE_EMS: number; + SVG_LENGTHTYPE_PX: number; + SVG_LENGTHTYPE_UNKNOWN: number; + SVG_LENGTHTYPE_EXS: number; +} + +interface SVGPolygonElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGAnimatedPoints, SVGTests { +} +declare var SVGPolygonElement: { + prototype: SVGPolygonElement; + new(): SVGPolygonElement; +} + +interface HTMLPhraseElement extends HTMLElement { + dateTime: string; + cite: string; +} +declare var HTMLPhraseElement: { + prototype: HTMLPhraseElement; + new(): HTMLPhraseElement; +} + +interface MSHTMLAreaElementExtensions { +} + +interface SVGPathSegCurvetoCubicRel extends SVGPathSeg { + y: number; + y1: number; + x2: number; + x: number; + x1: number; + y2: number; +} +declare var SVGPathSegCurvetoCubicRel: { + prototype: SVGPathSegCurvetoCubicRel; + new(): SVGPathSegCurvetoCubicRel; +} + +interface MSEventObj extends Event { + nextPage: string; + keyCode: number; + toElement: Element; + returnValue: any; + dataFld: string; + y: number; + dataTransfer: DataTransfer; + propertyName: string; + url: string; + offsetX: number; + recordset: Object; + screenX: number; + buttonID: number; + wheelDelta: number; + reason: number; + origin: string; + data: string; + srcFilter: Object; + boundElements: HTMLCollection; + cancelBubble: boolean; + altLeft: boolean; + behaviorCookie: number; + bookmarks: BookmarkCollection; + type: string; + repeat: boolean; + srcElement: Element; + source: Window; + fromElement: Element; + offsetY: number; + x: number; + behaviorPart: number; + qualifier: string; + altKey: boolean; + ctrlKey: boolean; + clientY: number; + shiftKey: boolean; + shiftLeft: boolean; + contentOverflow: boolean; + screenY: number; + ctrlLeft: boolean; + button: number; + srcUrn: string; + clientX: number; + actionURL: string; + getAttribute(strAttributeName: string, lFlags?: number): any; + setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; + removeAttribute(strAttributeName: string, lFlags?: number): boolean; +} +declare var MSEventObj: { + prototype: MSEventObj; + new(): MSEventObj; +} + +interface SVGTextContentElement extends SVGElement, SVGStylable, SVGLangSpace, SVGTests { + textLength: SVGAnimatedLength; + lengthAdjust: SVGAnimatedEnumeration; + getCharNumAtPosition(point: SVGPoint): number; + getStartPositionOfChar(charnum: number): SVGPoint; + getExtentOfChar(charnum: number): SVGRect; + getComputedTextLength(): number; + getSubStringLength(charnum: number, nchars: number): number; + selectSubString(charnum: number, nchars: number): void; + getNumberOfChars(): number; + getRotationOfChar(charnum: number): number; + getEndPositionOfChar(charnum: number): SVGPoint; + LENGTHADJUST_SPACING: number; + LENGTHADJUST_SPACINGANDGLYPHS: number; + LENGTHADJUST_UNKNOWN: number; +} +declare var SVGTextContentElement: { + prototype: SVGTextContentElement; + new(): SVGTextContentElement; + LENGTHADJUST_SPACING: number; + LENGTHADJUST_SPACINGANDGLYPHS: number; + LENGTHADJUST_UNKNOWN: number; +} + +interface DOML2DeprecatedColorProperty { + color: string; +} + +interface MSHTMLLIElementExtensions { +} + +interface HTMLCanvasElement extends HTMLElement { + width: number; + height: number; + toDataURL(): string; + toDataURL(type: string, ...args: any[]): string; + getContext(contextId: string): any; + getContext(contextId: "2d"): CanvasRenderingContext2D; +} +declare var HTMLCanvasElement: { + prototype: HTMLCanvasElement; + new(): HTMLCanvasElement; +} + +interface HTMLTitleElement extends HTMLElement { + text: string; +} +declare var HTMLTitleElement: { + prototype: HTMLTitleElement; + new(): HTMLTitleElement; +} + +interface Location { + hash: string; + protocol: string; + search: string; + href: string; + hostname: string; + port: string; + pathname: string; + host: string; + reload(flag?: boolean): void; + replace(url: string): void; + assign(url: string): void; + toString(): string; +} +declare var Location: { + prototype: Location; + new(): Location; +} + +interface HTMLStyleElement extends HTMLElement, MSLinkStyleExtensions, LinkStyle { + media: string; + type: string; +} +declare var HTMLStyleElement: { + prototype: HTMLStyleElement; + new(): HTMLStyleElement; +} + +interface MSHTMLOptGroupElementExtensions { + index: number; + defaultSelected: boolean; + text: string; + value: string; + form: HTMLFormElement; + selected: boolean; +} + +interface MSBorderColorHighlightStyle { + borderColorLight: any; + borderColorDark: any; +} + +interface DOML2DeprecatedSizeProperty_HTMLBaseFontElement { + size: number; +} + +interface SVGTransform { + type: number; + angle: number; + matrix: SVGMatrix; + setTranslate(tx: number, ty: number): void; + setScale(sx: number, sy: number): void; + setMatrix(matrix: SVGMatrix): void; + setSkewY(angle: number): void; + setRotate(angle: number, cx: number, cy: number): void; + setSkewX(angle: number): void; + SVG_TRANSFORM_SKEWX: number; + SVG_TRANSFORM_UNKNOWN: number; + SVG_TRANSFORM_SCALE: number; + SVG_TRANSFORM_TRANSLATE: number; + SVG_TRANSFORM_MATRIX: number; + SVG_TRANSFORM_ROTATE: number; + SVG_TRANSFORM_SKEWY: number; +} +declare var SVGTransform: { + prototype: SVGTransform; + new(): SVGTransform; + SVG_TRANSFORM_SKEWX: number; + SVG_TRANSFORM_UNKNOWN: number; + SVG_TRANSFORM_SCALE: number; + SVG_TRANSFORM_TRANSLATE: number; + SVG_TRANSFORM_MATRIX: number; + SVG_TRANSFORM_ROTATE: number; + SVG_TRANSFORM_SKEWY: number; +} + +interface MSCSSFilter { + Percent: number; + Enabled: boolean; + Duration: number; + Play(Duration: number): void; + Apply(): void; + Stop(): void; +} +declare var MSCSSFilter: { + prototype: MSCSSFilter; + new(): MSCSSFilter; +} + +interface UIEvent extends Event { + detail: number; + view: AbstractView; + initUIEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: AbstractView, detailArg: number): void; +} +declare var UIEvent: { + prototype: UIEvent; + new(): UIEvent; +} + +interface ViewCSS_SVGSVGElement { + getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; +} + +interface SVGURIReference { + href: SVGAnimatedString; +} + +interface SVGPathSeg { + pathSegType: number; + pathSegTypeAsLetter: string; + PATHSEG_MOVETO_REL: number; + PATHSEG_LINETO_VERTICAL_REL: number; + PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; + PATHSEG_CURVETO_QUADRATIC_REL: number; + PATHSEG_CURVETO_CUBIC_ABS: number; + PATHSEG_LINETO_HORIZONTAL_ABS: number; + PATHSEG_CURVETO_QUADRATIC_ABS: number; + PATHSEG_LINETO_ABS: number; + PATHSEG_CLOSEPATH: number; + PATHSEG_LINETO_HORIZONTAL_REL: number; + PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; + PATHSEG_LINETO_REL: number; + PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; + PATHSEG_ARC_REL: number; + PATHSEG_CURVETO_CUBIC_REL: number; + PATHSEG_UNKNOWN: number; + PATHSEG_LINETO_VERTICAL_ABS: number; + PATHSEG_ARC_ABS: number; + PATHSEG_MOVETO_ABS: number; + PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; +} +declare var SVGPathSeg: { + PATHSEG_MOVETO_REL: number; + PATHSEG_LINETO_VERTICAL_REL: number; + PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; + PATHSEG_CURVETO_QUADRATIC_REL: number; + PATHSEG_CURVETO_CUBIC_ABS: number; + PATHSEG_LINETO_HORIZONTAL_ABS: number; + PATHSEG_CURVETO_QUADRATIC_ABS: number; + PATHSEG_LINETO_ABS: number; + PATHSEG_CLOSEPATH: number; + PATHSEG_LINETO_HORIZONTAL_REL: number; + PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; + PATHSEG_LINETO_REL: number; + PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; + PATHSEG_ARC_REL: number; + PATHSEG_CURVETO_CUBIC_REL: number; + PATHSEG_UNKNOWN: number; + PATHSEG_LINETO_VERTICAL_ABS: number; + PATHSEG_ARC_ABS: number; + PATHSEG_MOVETO_ABS: number; + PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; +} + +interface WheelEvent extends MouseEvent { + deltaZ: number; + deltaX: number; + deltaMode: number; + deltaY: number; + initWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: AbstractView, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, deltaXArg: number, deltaYArg: number, deltaZArg: number, deltaMode: number): void; + DOM_DELTA_PIXEL: number; + DOM_DELTA_LINE: number; + DOM_DELTA_PAGE: number; +} +declare var WheelEvent: { + prototype: WheelEvent; + new(): WheelEvent; + DOM_DELTA_PIXEL: number; + DOM_DELTA_LINE: number; + DOM_DELTA_PAGE: number; +} + +interface DOML2DeprecatedAlignmentStyle_HTMLDivElement { + align: string; +} + +interface MSEventAttachmentTarget { + attachEvent(event: string, listener: EventListener): boolean; + detachEvent(event: string, listener: EventListener): void; +} + +interface SVGNumber { + value: number; +} +declare var SVGNumber: { + prototype: SVGNumber; + new(): SVGNumber; +} + +interface SVGPathElement extends SVGElement, SVGStylable, SVGAnimatedPathData, SVGTransformable, SVGLangSpace, SVGTests { + getPathSegAtLength(distance: number): number; + getPointAtLength(distance: number): SVGPoint; + createSVGPathSegCurvetoQuadraticAbs(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticAbs; + createSVGPathSegLinetoRel(x: number, y: number): SVGPathSegLinetoRel; + createSVGPathSegCurvetoQuadraticRel(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticRel; + createSVGPathSegCurvetoCubicAbs(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicAbs; + createSVGPathSegLinetoAbs(x: number, y: number): SVGPathSegLinetoAbs; + createSVGPathSegClosePath(): SVGPathSegClosePath; + createSVGPathSegCurvetoCubicRel(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicRel; + createSVGPathSegCurvetoQuadraticSmoothRel(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothRel; + createSVGPathSegMovetoRel(x: number, y: number): SVGPathSegMovetoRel; + createSVGPathSegCurvetoCubicSmoothAbs(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothAbs; + createSVGPathSegMovetoAbs(x: number, y: number): SVGPathSegMovetoAbs; + createSVGPathSegLinetoVerticalRel(y: number): SVGPathSegLinetoVerticalRel; + createSVGPathSegArcRel(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcRel; + createSVGPathSegCurvetoQuadraticSmoothAbs(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothAbs; + createSVGPathSegLinetoHorizontalRel(x: number): SVGPathSegLinetoHorizontalRel; + getTotalLength(): number; + createSVGPathSegCurvetoCubicSmoothRel(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothRel; + createSVGPathSegLinetoHorizontalAbs(x: number): SVGPathSegLinetoHorizontalAbs; + createSVGPathSegLinetoVerticalAbs(y: number): SVGPathSegLinetoVerticalAbs; + createSVGPathSegArcAbs(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcAbs; +} +declare var SVGPathElement: { + prototype: SVGPathElement; + new(): SVGPathElement; +} + +interface MSCompatibleInfo { + version: string; + userAgent: string; +} +declare var MSCompatibleInfo: { + prototype: MSCompatibleInfo; + new(): MSCompatibleInfo; +} + +interface MSHTMLDocumentEventExtensions { + createEventObject(eventObj?: any): MSEventObj; + fireEvent(eventName: string, eventObj?: any): boolean; +} + +interface Text extends CharacterData, MSNodeExtensions { + wholeText: string; + splitText(offset: number): Text; + replaceWholeText(content: string): Text; +} +declare var Text: { + prototype: Text; + new(): Text; +} + +interface SVGAnimatedRect { + animVal: SVGRect; + baseVal: SVGRect; +} +declare var SVGAnimatedRect: { + prototype: SVGAnimatedRect; + new(): SVGAnimatedRect; +} + +interface CSSNamespaceRule extends CSSRule { + namespaceURI: string; + prefix: string; +} +declare var CSSNamespaceRule: { + prototype: CSSNamespaceRule; + new(): CSSNamespaceRule; +} + +interface HTMLUnknownElement extends HTMLElement, MSDataBindingRecordSetReadonlyExtensions, MSHTMLUnknownElementExtensions { +} +declare var HTMLUnknownElement: { + prototype: HTMLUnknownElement; + new(): HTMLUnknownElement; +} + +interface SVGPathSegList { + numberOfItems: number; + replaceItem(newItem: SVGPathSeg, index: number): SVGPathSeg; + getItem(index: number): SVGPathSeg; + clear(): void; + appendItem(newItem: SVGPathSeg): SVGPathSeg; + initialize(newItem: SVGPathSeg): SVGPathSeg; + removeItem(index: number): SVGPathSeg; + insertItemBefore(newItem: SVGPathSeg, index: number): SVGPathSeg; +} +declare var SVGPathSegList: { + prototype: SVGPathSegList; + new(): SVGPathSegList; +} + +interface HTMLAudioElement extends HTMLMediaElement { +} +declare var HTMLAudioElement: { + prototype: HTMLAudioElement; + new(): HTMLAudioElement; +} + +interface MSImageResourceExtensions { + dynsrc: string; + vrml: string; + lowsrc: string; + start: string; + loop: number; +} + +interface MSBorderColorHighlightStyle_HTMLTableRowElement { + borderColorLight: any; + borderColorDark: any; +} + +interface PositionError { + code: number; + message: string; + toString(): string; + POSITION_UNAVAILABLE: number; + PERMISSION_DENIED: number; + TIMEOUT: number; +} +declare var PositionError: { + POSITION_UNAVAILABLE: number; + PERMISSION_DENIED: number; + TIMEOUT: number; +} + +interface BrowserPublic { +} +declare var BrowserPublic: { + prototype: BrowserPublic; + new(): BrowserPublic; +} + +interface HTMLTableCellElement extends HTMLElement, DOML2DeprecatedTableCellHeight, HTMLTableAlignment, MSBorderColorHighlightStyle_HTMLTableCellElement, DOML2DeprecatedWidthStyle_HTMLTableCellElement, DOML2DeprecatedBackgroundStyle, MSBorderColorStyle_HTMLTableCellElement, MSHTMLTableCellElementExtensions, DOML2DeprecatedAlignmentStyle_HTMLTableCellElement, HTMLTableHeaderCellScope, DOML2DeprecatedWordWrapSuppression, DOML2DeprecatedBackgroundColorStyle { + headers: string; + abbr: string; + rowSpan: number; + cellIndex: number; + colSpan: number; + axis: string; +} +declare var HTMLTableCellElement: { + prototype: HTMLTableCellElement; + new(): HTMLTableCellElement; +} + +interface MSNamespaceInfoCollection { + length: number; + add(namespace?: string, urn?: string, implementationUrl?: any): Object; + item(index: any): Object; + [index: string]: Object; + (index: any): Object; +} +declare var MSNamespaceInfoCollection: { + prototype: MSNamespaceInfoCollection; + new(): MSNamespaceInfoCollection; +} + +interface SVGElementInstance extends EventTarget { + previousSibling: SVGElementInstance; + parentNode: SVGElementInstance; + lastChild: SVGElementInstance; + nextSibling: SVGElementInstance; + childNodes: SVGElementInstanceList; + correspondingUseElement: SVGUseElement; + correspondingElement: SVGElement; + firstChild: SVGElementInstance; +} +declare var SVGElementInstance: { + prototype: SVGElementInstance; + new(): SVGElementInstance; +} + +interface MSHTMLUListElementExtensions { +} + +interface SVGCircleElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests { + cx: SVGAnimatedLength; + r: SVGAnimatedLength; + cy: SVGAnimatedLength; +} +declare var SVGCircleElement: { + prototype: SVGCircleElement; + new(): SVGCircleElement; +} + +interface HTMLBaseFontElement extends HTMLElement, DOML2DeprecatedSizeProperty_HTMLBaseFontElement, DOML2DeprecatedColorProperty { + face: string; +} +declare var HTMLBaseFontElement: { + prototype: HTMLBaseFontElement; + new(): HTMLBaseFontElement; +} + +interface CustomEvent extends Event { + detail: Object; + initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: Object): void; +} +declare var CustomEvent: { + prototype: CustomEvent; + new(): CustomEvent; +} + +interface CSSImportRule extends CSSRule { + styleSheet: CSSStyleSheet; + href: string; + media: MediaList; +} +declare var CSSImportRule: { + prototype: CSSImportRule; + new(): CSSImportRule; +} + +interface StyleSheetList { + length: number; + item(index?: number): StyleSheet; + [index: number]: StyleSheet; +} +declare var StyleSheetList: { + prototype: StyleSheetList; + new(): StyleSheetList; +} + +interface HTMLTextAreaElement extends HTMLElement, MSDataBindingExtensions, MSHTMLTextAreaElementExtensions { + value: string; + form: HTMLFormElement; + name: string; + selectionStart: number; + rows: number; + cols: number; + readOnly: boolean; + wrap: string; + selectionEnd: number; + type: string; + defaultValue: string; + setSelectionRange(start: number, end: number): void; + select(): void; +} +declare var HTMLTextAreaElement: { + prototype: HTMLTextAreaElement; + new(): HTMLTextAreaElement; +} + +interface MSHTMLFormElementExtensions { + encoding: string; +} + +interface DOML2DeprecatedMarginStyle { + vspace: number; + hspace: number; +} + +interface Geolocation { + clearWatch(watchId: number): void; + getCurrentPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): void; + watchPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): number; +} +declare var Geolocation: { + prototype: Geolocation; + new(): Geolocation; +} + +interface MSWindowModeless { + dialogTop: any; + dialogLeft: any; + dialogWidth: any; + dialogHeight: any; + menuArguments: any; +} + +interface HTMLMarqueeElement extends HTMLElement, DOML2DeprecatedMarginStyle_HTMLMarqueeElement, MSDataBindingExtensions, MSHTMLMarqueeElementExtensions, DOML2DeprecatedBackgroundColorStyle { + width: string; + onbounce: (ev: Event) => any; + addEventListener(type: "bounce", listener: (ev: Event) => any, useCapture?: boolean): void; + trueSpeed: boolean; + scrollAmount: number; + scrollDelay: number; + behavior: string; + height: string; + loop: number; + direction: string; + onstart: (ev: Event) => any; + addEventListener(type: "start", listener: (ev: Event) => any, useCapture?: boolean): void; + onfinish: (ev: Event) => any; + addEventListener(type: "finish", listener: (ev: Event) => any, useCapture?: boolean): void; + stop(): void; + start(): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var HTMLMarqueeElement: { + prototype: HTMLMarqueeElement; + new(): HTMLMarqueeElement; +} + +interface SVGRect { + y: number; + width: number; + x: number; + height: number; +} +declare var SVGRect: { + prototype: SVGRect; + new(): SVGRect; +} + +interface MSNodeExtensions { + swapNode(otherNode: Node): Node; + removeNode(deep?: boolean): Node; + replaceNode(replacement: Node): Node; +} + +interface KeyboardEventExtensions { + keyCode: number; + which: number; + charCode: number; +} + +interface History { + length: number; + back(distance?: any): void; + forward(distance?: any): void; + go(delta?: any): void; +} +declare var History: { + prototype: History; + new(): History; +} + +interface DocumentStyle { + styleSheets: StyleSheetList; +} + +interface SVGPathSegCurvetoCubicAbs extends SVGPathSeg { + y: number; + y1: number; + x2: number; + x: number; + x1: number; + y2: number; +} +declare var SVGPathSegCurvetoCubicAbs: { + prototype: SVGPathSegCurvetoCubicAbs; + new(): SVGPathSegCurvetoCubicAbs; +} + +interface TimeRanges { + length: number; + start(index: number): number; + end(index: number): number; +} +declare var TimeRanges: { + prototype: TimeRanges; + new(): TimeRanges; +} + +interface SVGPathSegCurvetoQuadraticAbs extends SVGPathSeg { + y: number; + y1: number; + x: number; + x1: number; +} +declare var SVGPathSegCurvetoQuadraticAbs: { + prototype: SVGPathSegCurvetoQuadraticAbs; + new(): SVGPathSegCurvetoQuadraticAbs; +} + +interface MSHTMLSelectElementExtensions { +} + +interface CSSRule { + cssText: string; + parentStyleSheet: CSSStyleSheet; + parentRule: CSSRule; + type: number; + IMPORT_RULE: number; + MEDIA_RULE: number; + STYLE_RULE: number; + NAMESPACE_RULE: number; + PAGE_RULE: number; + UNKNOWN_RULE: number; + FONT_FACE_RULE: number; + CHARSET_RULE: number; +} +declare var CSSRule: { + prototype: CSSRule; + new(): CSSRule; + IMPORT_RULE: number; + MEDIA_RULE: number; + STYLE_RULE: number; + NAMESPACE_RULE: number; + PAGE_RULE: number; + UNKNOWN_RULE: number; + FONT_FACE_RULE: number; + CHARSET_RULE: number; +} + +interface SVGPathSegLinetoAbs extends SVGPathSeg { + y: number; + x: number; +} +declare var SVGPathSegLinetoAbs: { + prototype: SVGPathSegLinetoAbs; + new(): SVGPathSegLinetoAbs; +} + +interface MSMouseEventExtensions { + toElement: Element; + layerY: number; + fromElement: Element; + which: number; + layerX: number; +} + +interface HTMLModElement extends HTMLElement, MSHTMLModElementExtensions { + dateTime: string; + cite: string; +} +declare var HTMLModElement: { + prototype: HTMLModElement; + new(): HTMLModElement; +} + +interface DOML2DeprecatedWordWrapSuppression { + noWrap: boolean; +} + +interface BeforeUnloadEvent extends Event { + returnValue: string; +} +declare var BeforeUnloadEvent: { + prototype: BeforeUnloadEvent; + new(): BeforeUnloadEvent; +} + +interface MSPopupWindow { + document: HTMLDocument; + isOpen: boolean; + show(x: number, y: number, w: number, h: number, element?: any): void; + hide(): void; +} +declare var MSPopupWindow: { + prototype: MSPopupWindow; + new(): MSPopupWindow; +} + +interface SVGMatrix { + e: number; + c: number; + a: number; + b: number; + d: number; + f: number; + multiply(secondMatrix: SVGMatrix): SVGMatrix; + flipY(): SVGMatrix; + skewY(angle: number): SVGMatrix; + inverse(): SVGMatrix; + scaleNonUniform(scaleFactorX: number, scaleFactorY: number): SVGMatrix; + rotate(angle: number): SVGMatrix; + flipX(): SVGMatrix; + translate(x: number, y: number): SVGMatrix; + scale(scaleFactor: number): SVGMatrix; + rotateFromVector(x: number, y: number): SVGMatrix; + skewX(angle: number): SVGMatrix; +} +declare var SVGMatrix: { + prototype: SVGMatrix; + new(): SVGMatrix; +} + +interface SVGUseElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGURIReference { + y: SVGAnimatedLength; + width: SVGAnimatedLength; + animatedInstanceRoot: SVGElementInstance; + instanceRoot: SVGElementInstance; + x: SVGAnimatedLength; + height: SVGAnimatedLength; +} +declare var SVGUseElement: { + prototype: SVGUseElement; + new(): SVGUseElement; +} + +interface Event extends MSEventExtensions { + timeStamp: number; + defaultPrevented: boolean; + isTrusted: boolean; + currentTarget: EventTarget; + target: EventTarget; + eventPhase: number; + type: string; + cancelable: boolean; + bubbles: boolean; + initEvent(eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean): void; + stopPropagation(): void; + stopImmediatePropagation(): void; + preventDefault(): void; + CAPTURING_PHASE: number; + AT_TARGET: number; + BUBBLING_PHASE: number; +} +declare var Event: { + prototype: Event; + new(): Event; + CAPTURING_PHASE: number; + AT_TARGET: number; + BUBBLING_PHASE: number; +} + +interface ImageData { + width: number; + data: number[]; + height: number; +} +declare var ImageData: { + prototype: ImageData; + new(): ImageData; +} + +interface MSHTMLElementExtensions { + onlosecapture: (ev: MSEventObj) => any; + addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + onrowexit: (ev: MSEventObj) => any; + addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + oncontrolselect: (ev: MSEventObj) => any; + addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + onrowsinserted: (ev: MSEventObj) => any; + addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + onmouseleave: (ev: MouseEvent) => any; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + document: HTMLDocument; + behaviorUrns: MSBehaviorUrnsCollection; + onpropertychange: (ev: MSEventObj) => any; + addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + children: HTMLCollection; + filters: Object; + onbeforecut: (ev: DragEvent) => any; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + scopeName: string; + onbeforepaste: (ev: DragEvent) => any; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + onmove: (ev: MSEventObj) => any; + addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + onafterupdate: (ev: MSEventObj) => any; + addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + onbeforecopy: (ev: DragEvent) => any; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + onlayoutcomplete: (ev: MSEventObj) => any; + addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + onresizeend: (ev: MSEventObj) => any; + addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + uniqueID: string; + onhelp: (ev: Event) => any; + addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; + onbeforeactivate: (ev: UIEvent) => any; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + isMultiLine: boolean; + uniqueNumber: number; + tagUrn: string; + onfocusout: (ev: FocusEvent) => any; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + ondataavailable: (ev: MSEventObj) => any; + addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + hideFocus: boolean; + onbeforeupdate: (ev: MSEventObj) => any; + addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + onfilterchange: (ev: MSEventObj) => any; + addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + onfocusin: (ev: FocusEvent) => any; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + recordNumber: any; + parentTextEdit: Element; + ondatasetcomplete: (ev: MSEventObj) => any; + addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + onbeforedeactivate: (ev: UIEvent) => any; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + outerText: string; + onresizestart: (ev: MSEventObj) => any; + addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + onactivate: (ev: UIEvent) => any; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + isTextEdit: boolean; + isDisabled: boolean; + readyState: string; + all: HTMLCollection; + onmouseenter: (ev: MouseEvent) => any; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + onmovestart: (ev: MSEventObj) => any; + addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + onselectstart: (ev: Event) => any; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + onpaste: (ev: DragEvent) => any; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + canHaveHTML: boolean; + innerText: string; + onerrorupdate: (ev: MSEventObj) => any; + addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + ondeactivate: (ev: UIEvent) => any; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + oncut: (ev: DragEvent) => any; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + onmoveend: (ev: MSEventObj) => any; + addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + onresize: (ev: UIEvent) => any; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + language: string; + ondatasetchanged: (ev: MSEventObj) => any; + addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + oncopy: (ev: DragEvent) => any; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + onrowsdelete: (ev: MSEventObj) => any; + addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + parentElement: HTMLElement; + onrowenter: (ev: MSEventObj) => any; + addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + onbeforeeditfocus: (ev: MSEventObj) => any; + addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + canHaveChildren: boolean; + sourceIndex: number; + oncellchange: (ev: MSEventObj) => any; + addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + dragDrop(): boolean; + releaseCapture(): void; + addFilter(filter: Object): void; + setCapture(containerCapture?: boolean): void; + removeBehavior(cookie: number): boolean; + contains(child: HTMLElement): boolean; + applyElement(apply: Element, where?: string): Element; + replaceAdjacentText(where: string, newText: string): string; + mergeAttributes(source: HTMLElement, preserveIdentity?: boolean): void; + insertAdjacentElement(position: string, insertedElement: Element): Element; + insertAdjacentText(where: string, text: string): void; + getAdjacentText(where: string): string; + removeFilter(filter: Object): void; + setActive(): void; + addBehavior(bstrUrl: string, factory?: any): number; + clearAttributes(): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} + +interface HTMLTableColElement extends HTMLElement, MSHTMLTableColElementExtensions, HTMLTableAlignment, DOML2DeprecatedAlignmentStyle_HTMLTableColElement { + width: any; + span: number; +} +declare var HTMLTableColElement: { + prototype: HTMLTableColElement; + new(): HTMLTableColElement; +} + +interface HTMLDocument extends MSEventAttachmentTarget, MSHTMLDocumentSelection, MSHTMLDocumentExtensions, MSNodeExtensions, MSResourceMetadata, MSHTMLDocumentEventExtensions, MSHTMLDocumentViewExtensions { + ondragend: (ev: DragEvent) => any; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + ondragover: (ev: DragEvent) => any; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + onkeydown: (ev: KeyboardEvent) => any; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + bgColor: string; + onkeyup: (ev: KeyboardEvent) => any; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + onreset: (ev: Event) => any; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + onmouseup: (ev: MouseEvent) => any; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + ondragstart: (ev: DragEvent) => any; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + scripts: HTMLCollection; + ondrag: (ev: DragEvent) => any; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + linkColor: string; + ondragleave: (ev: DragEvent) => any; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + onmouseover: (ev: MouseEvent) => any; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + onpause: (ev: Event) => any; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + charset: string; + vlinkColor: string; + onmousedown: (ev: MouseEvent) => any; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + onseeked: (ev: Event) => any; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + title: string; + onclick: (ev: MouseEvent) => any; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + onwaiting: (ev: Event) => any; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + defaultCharset: string; + embeds: HTMLCollection; + ondurationchange: (ev: Event) => any; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + all: HTMLCollection; + applets: HTMLCollection; + forms: HTMLCollection; + onblur: (ev: FocusEvent) => any; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + dir: string; + body: HTMLElement; + designMode: string; + onemptied: (ev: Event) => any; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + domain: string; + onseeking: (ev: Event) => any; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + oncanplay: (ev: Event) => any; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + onstalled: (ev: Event) => any; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + onmousemove: (ev: MouseEvent) => any; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + onratechange: (ev: Event) => any; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + onloadstart: (ev: Event) => any; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + ondragenter: (ev: DragEvent) => any; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + onsubmit: (ev: Event) => any; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + onprogress: (ev: any) => any; + addEventListener(type: "progress", listener: (ev: any) => any, useCapture?: boolean): void; + ondblclick: (ev: MouseEvent) => any; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + oncontextmenu: (ev: MouseEvent) => any; + addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + activeElement: Element; + onchange: (ev: Event) => any; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + onloadedmetadata: (ev: Event) => any; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + onerror: (ev: Event) => any; + addEventListener(type: "error", listener: (ev: Event) => any, useCapture?: boolean): void; + onplay: (ev: Event) => any; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + links: HTMLCollection; + onplaying: (ev: Event) => any; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + URL: string; + images: HTMLCollection; + head: HTMLHeadElement; + location: Location; + cookie: string; + oncanplaythrough: (ev: Event) => any; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + onabort: (ev: UIEvent) => any; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + characterSet: string; + anchors: HTMLCollection; + lastModified: string; + onreadystatechange: (ev: Event) => any; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + onkeypress: (ev: KeyboardEvent) => any; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + onloadeddata: (ev: Event) => any; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + plugins: HTMLCollection; + onsuspend: (ev: Event) => any; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + referrer: string; + readyState: string; + alinkColor: string; + onfocus: (ev: FocusEvent) => any; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + fgColor: string; + ontimeupdate: (ev: Event) => any; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + onselect: (ev: UIEvent) => any; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + ondrop: (ev: DragEvent) => any; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + onmouseout: (ev: MouseEvent) => any; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + onended: (ev: Event) => any; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + compatMode: string; + onscroll: (ev: UIEvent) => any; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + onmousewheel: (ev: MouseWheelEvent) => any; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + onload: (ev: Event) => any; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + onvolumechange: (ev: Event) => any; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + oninput: (ev: Event) => any; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + queryCommandValue(commandId: string): string; + queryCommandIndeterm(commandId: string): boolean; + execCommand(commandId: string, showUI?: boolean, value?: any): boolean; + getElementsByName(elementName: string): NodeList; + writeln(...content: string[]): void; + open(url?: string, name?: string, features?: string, replace?: boolean): any; + queryCommandState(commandId: string): boolean; + close(): void; + hasFocus(): boolean; + getElementsByClassName(classNames: string): NodeList; + queryCommandSupported(commandId: string): boolean; + getSelection(): Selection; + queryCommandEnabled(commandId: string): boolean; + write(...content: string[]): void; + queryCommandText(commandId: string): string; + addEventListener(type: "DOMContentLoaded", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} + +interface SVGException { + code: number; + message: string; + toString(): string; + SVG_MATRIX_NOT_INVERTABLE: number; + SVG_WRONG_TYPE_ERR: number; + SVG_INVALID_VALUE_ERR: number; +} +declare var SVGException: { + prototype: SVGException; + new(): SVGException; + SVG_MATRIX_NOT_INVERTABLE: number; + SVG_WRONG_TYPE_ERR: number; + SVG_INVALID_VALUE_ERR: number; +} + +interface DOML2DeprecatedTableCellHeight { + height: any; +} + +interface HTMLTableAlignment { + ch: string; + vAlign: string; + chOff: string; +} + +interface SVGAnimatedEnumeration { + animVal: number; + baseVal: number; +} +declare var SVGAnimatedEnumeration: { + prototype: SVGAnimatedEnumeration; + new(): SVGAnimatedEnumeration; +} + +interface SVGLinearGradientElement extends SVGGradientElement { + y1: SVGAnimatedLength; + x2: SVGAnimatedLength; + x1: SVGAnimatedLength; + y2: SVGAnimatedLength; +} +declare var SVGLinearGradientElement: { + prototype: SVGLinearGradientElement; + new(): SVGLinearGradientElement; +} + +interface DOML2DeprecatedSizeProperty { + size: number; +} + +interface MSHTMLHeadingElementExtensions extends DOML2DeprecatedTextFlowControl_HTMLBlockElement { +} + +interface MSBorderColorStyle_HTMLTableCellElement { + borderColor: any; +} + +interface DOML2DeprecatedWidthStyle_HTMLHRElement { + width: number; +} + +interface HTMLUListElement extends HTMLElement, DOML2DeprecatedListSpaceReduction, DOML2DeprecatedListNumberingAndBulletStyle, MSHTMLUListElementExtensions { +} +declare var HTMLUListElement: { + prototype: HTMLUListElement; + new(): HTMLUListElement; +} + +interface SVGRectElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests { + y: SVGAnimatedLength; + width: SVGAnimatedLength; + ry: SVGAnimatedLength; + rx: SVGAnimatedLength; + x: SVGAnimatedLength; + height: SVGAnimatedLength; +} +declare var SVGRectElement: { + prototype: SVGRectElement; + new(): SVGRectElement; +} + +interface DOML2DeprecatedBorderStyle { + border: string; +} + +interface HTMLDivElement extends HTMLElement, DOML2DeprecatedAlignmentStyle_HTMLDivElement, MSHTMLDivElementExtensions, MSDataBindingExtensions { +} +declare var HTMLDivElement: { + prototype: HTMLDivElement; + new(): HTMLDivElement; +} + +interface NavigatorDoNotTrack { + msDoNotTrack: string; +} + +interface SVG1_1Properties { + fillRule: string; + strokeLinecap: string; + stopColor: string; + glyphOrientationHorizontal: string; + kerning: string; + alignmentBaseline: string; + dominantBaseline: string; + fill: string; + strokeMiterlimit: string; + marker: string; + glyphOrientationVertical: string; + markerMid: string; + textAnchor: string; + fillOpacity: string; + strokeDasharray: string; + mask: string; + stopOpacity: string; + stroke: string; + strokeDashoffset: string; + strokeOpacity: string; + markerStart: string; + pointerEvents: string; + baselineShift: string; + markerEnd: string; + clipRule: string; + strokeLinejoin: string; + clipPath: string; + strokeWidth: string; +} + +interface NamedNodeMap { + length: number; + removeNamedItemNS(namespaceURI: string, localName: string): Node; + item(index: number): Node; + [index: number]: Node; + removeNamedItem(name: string): Node; + getNamedItem(name: string): Node; + setNamedItem(arg: Node): Node; + getNamedItemNS(namespaceURI: string, localName: string): Node; + setNamedItemNS(arg: Node): Node; +} +declare var NamedNodeMap: { + prototype: NamedNodeMap; + new(): NamedNodeMap; +} + +interface MediaList { + length: number; + mediaText: string; + deleteMedium(oldMedium: string): void; + appendMedium(newMedium: string): void; + item(index: number): string; + [index: number]: string; + toString(): string; +} +declare var MediaList: { + prototype: MediaList; + new(): MediaList; +} + +interface SVGPathSegCurvetoQuadraticSmoothAbs extends SVGPathSeg { + y: number; + x: number; +} +declare var SVGPathSegCurvetoQuadraticSmoothAbs: { + prototype: SVGPathSegCurvetoQuadraticSmoothAbs; + new(): SVGPathSegCurvetoQuadraticSmoothAbs; +} + +interface SVGLengthList { + numberOfItems: number; + replaceItem(newItem: SVGLength, index: number): SVGLength; + getItem(index: number): SVGLength; + clear(): void; + appendItem(newItem: SVGLength): SVGLength; + initialize(newItem: SVGLength): SVGLength; + removeItem(index: number): SVGLength; + insertItemBefore(newItem: SVGLength, index: number): SVGLength; +} +declare var SVGLengthList: { + prototype: SVGLengthList; + new(): SVGLengthList; +} + +interface SVGPathSegCurvetoCubicSmoothRel extends SVGPathSeg { + y: number; + x2: number; + x: number; + y2: number; +} +declare var SVGPathSegCurvetoCubicSmoothRel: { + prototype: SVGPathSegCurvetoCubicSmoothRel; + new(): SVGPathSegCurvetoCubicSmoothRel; +} + +interface MSWindowExtensions { + status: string; + onmouseleave: (ev: MouseEvent) => any; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + screenLeft: number; + offscreenBuffering: any; + maxConnectionsPerServer: number; + onmouseenter: (ev: MouseEvent) => any; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + clipboardData: DataTransfer; + defaultStatus: string; + clientInformation: Navigator; + closed: boolean; + onhelp: (ev: Event) => any; + addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; + external: BrowserPublic; + event: MSEventObj; + onfocusout: (ev: FocusEvent) => any; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + screenTop: number; + onfocusin: (ev: FocusEvent) => any; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + showModelessDialog(url?: string, argument?: any, options?: any): Window; + navigate(url: string): void; + resizeBy(x?: number, y?: number): void; + item(index: any): any; + resizeTo(x?: number, y?: number): void; + createPopup(arguments?: any): MSPopupWindow; + toStaticHTML(html: string): string; + execScript(code: string, language?: string): any; + msWriteProfilerMark(profilerMarkName: string): void; + moveTo(x?: number, y?: number): void; + moveBy(x?: number, y?: number): void; + showHelp(url: string, helpArg?: any, features?: string): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} + +interface ProcessingInstruction extends Node { + target: string; + data: string; +} +declare var ProcessingInstruction: { + prototype: ProcessingInstruction; + new(): ProcessingInstruction; +} + +interface MSBehaviorUrnsCollection { + length: number; + item(index: number): string; +} +declare var MSBehaviorUrnsCollection: { + prototype: MSBehaviorUrnsCollection; + new(): MSBehaviorUrnsCollection; +} + +interface CSSFontFaceRule extends CSSRule { + style: CSSStyleDeclaration; +} +declare var CSSFontFaceRule: { + prototype: CSSFontFaceRule; + new(): CSSFontFaceRule; +} + +interface DOML2DeprecatedBackgroundStyle { + background: string; +} + +interface TextEvent extends UIEvent { + inputMethod: number; + data: string; + locale: string; + initTextEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: AbstractView, dataArg: string, inputMethod: number, locale: string): void; + DOM_INPUT_METHOD_KEYBOARD: number; + DOM_INPUT_METHOD_DROP: number; + DOM_INPUT_METHOD_IME: number; + DOM_INPUT_METHOD_SCRIPT: number; + DOM_INPUT_METHOD_VOICE: number; + DOM_INPUT_METHOD_UNKNOWN: number; + DOM_INPUT_METHOD_PASTE: number; + DOM_INPUT_METHOD_HANDWRITING: number; + DOM_INPUT_METHOD_OPTION: number; + DOM_INPUT_METHOD_MULTIMODAL: number; +} +declare var TextEvent: { + prototype: TextEvent; + new(): TextEvent; + DOM_INPUT_METHOD_KEYBOARD: number; + DOM_INPUT_METHOD_DROP: number; + DOM_INPUT_METHOD_IME: number; + DOM_INPUT_METHOD_SCRIPT: number; + DOM_INPUT_METHOD_VOICE: number; + DOM_INPUT_METHOD_UNKNOWN: number; + DOM_INPUT_METHOD_PASTE: number; + DOM_INPUT_METHOD_HANDWRITING: number; + DOM_INPUT_METHOD_OPTION: number; + DOM_INPUT_METHOD_MULTIMODAL: number; +} + +interface MSHTMLHRElementExtensions extends DOML2DeprecatedColorProperty { +} + +interface AbstractView { + styleMedia: StyleMedia; + document: Document; +} + +interface DocumentFragment extends Node, NodeSelector, MSEventAttachmentTarget, MSNodeExtensions { +} +declare var DocumentFragment: { + prototype: DocumentFragment; + new(): DocumentFragment; +} + +interface DOML2DeprecatedAlignmentStyle_HTMLFieldSetElement { + align: string; +} + +interface SVGPolylineElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGAnimatedPoints, SVGTests { +} +declare var SVGPolylineElement: { + prototype: SVGPolylineElement; + new(): SVGPolylineElement; +} + +interface DOML2DeprecatedWidthStyle { + width: number; +} + +interface DOML2DeprecatedAlignmentStyle_HTMLHeadingElement { + align: string; +} + +interface SVGAnimatedPathData { + pathSegList: SVGPathSegList; +} + +interface Position { + timestamp: number; + coords: Coordinates; +} +declare var Position: { + prototype: Position; + new(): Position; +} + +interface BookmarkCollection { + length: number; + item(index: number): any; + [index: number]: any; +} +declare var BookmarkCollection: { + prototype: BookmarkCollection; + new(): BookmarkCollection; +} + +interface CSSPageRule extends CSSRule, StyleSheetPage { + selectorText: string; + style: CSSStyleDeclaration; +} +declare var CSSPageRule: { + prototype: CSSPageRule; + new(): CSSPageRule; +} + +interface WindowPerformance { + performance: any; +} + +interface HTMLBRElement extends HTMLElement, DOML2DeprecatedTextFlowControl_HTMLBRElement { +} +declare var HTMLBRElement: { + prototype: HTMLBRElement; + new(): HTMLBRElement; +} + +interface MSHTMLDivElementExtensions extends DOML2DeprecatedWordWrapSuppression_HTMLDivElement { +} + +interface DOML2DeprecatedBorderStyle_HTMLInputElement { + border: string; +} + +interface HTMLSpanElement extends HTMLElement, MSHTMLSpanElementExtensions, MSDataBindingExtensions { +} +declare var HTMLSpanElement: { + prototype: HTMLSpanElement; + new(): HTMLSpanElement; +} + +interface HTMLHRElementDOML2Deprecated { + noShade: boolean; +} + +interface HTMLHeadElement extends HTMLElement { + profile: string; +} +declare var HTMLHeadElement: { + prototype: HTMLHeadElement; + new(): HTMLHeadElement; +} + +interface NodeFilterCallback { + (...args: any[]): any; +} + +interface HTMLHeadingElement extends HTMLElement, DOML2DeprecatedAlignmentStyle_HTMLHeadingElement, MSHTMLHeadingElementExtensions { +} +declare var HTMLHeadingElement: { + prototype: HTMLHeadingElement; + new(): HTMLHeadingElement; +} + +interface HTMLFormElement extends HTMLElement, MSHTMLFormElementExtensions, MSHTMLCollectionExtensions { + length: number; + target: string; + acceptCharset: string; + enctype: string; + elements: HTMLCollection; + action: string; + name: string; + method: string; + reset(): void; + item(name?: any, index?: any): any; + (name: any, index: any): any; + submit(): void; + namedItem(name: string): any; + [name: string]: any; + (name: string): any; +} +declare var HTMLFormElement: { + prototype: HTMLFormElement; + new(): HTMLFormElement; +} + +interface SVGZoomAndPan { + zoomAndPan: number; + SVG_ZOOMANDPAN_MAGNIFY: number; + SVG_ZOOMANDPAN_UNKNOWN: number; + SVG_ZOOMANDPAN_DISABLE: number; +} +declare var SVGZoomAndPan: { + prototype: SVGZoomAndPan; + new(): SVGZoomAndPan; + SVG_ZOOMANDPAN_MAGNIFY: number; + SVG_ZOOMANDPAN_UNKNOWN: number; + SVG_ZOOMANDPAN_DISABLE: number; +} + +interface MSEventExtensions { + cancelBubble: boolean; + srcElement: Element; +} + +interface HTMLMediaElement extends HTMLElement { + initialTime: number; + played: TimeRanges; + currentSrc: string; + readyState: string; + autobuffer: boolean; + loop: boolean; + ended: boolean; + buffered: TimeRanges; + error: MediaError; + seekable: TimeRanges; + autoplay: boolean; + controls: boolean; + volume: number; + src: string; + playbackRate: number; + duration: number; + muted: boolean; + defaultPlaybackRate: number; + paused: boolean; + seeking: boolean; + currentTime: number; + preload: string; + networkState: number; + pause(): void; + play(): void; + load(): void; + canPlayType(type: string): string; + HAVE_METADATA: number; + HAVE_CURRENT_DATA: number; + HAVE_NOTHING: number; + NETWORK_NO_SOURCE: number; + HAVE_ENOUGH_DATA: number; + NETWORK_EMPTY: number; + NETWORK_LOADING: number; + NETWORK_IDLE: number; + HAVE_FUTURE_DATA: number; +} +declare var HTMLMediaElement: { + prototype: HTMLMediaElement; + new(): HTMLMediaElement; + HAVE_METADATA: number; + HAVE_CURRENT_DATA: number; + HAVE_NOTHING: number; + NETWORK_NO_SOURCE: number; + HAVE_ENOUGH_DATA: number; + NETWORK_EMPTY: number; + NETWORK_LOADING: number; + NETWORK_IDLE: number; + HAVE_FUTURE_DATA: number; +} + +interface ElementCSSInlineStyle extends MSElementCSSInlineStyleExtensions { + runtimeStyle: MSStyleCSSProperties; + currentStyle: MSCurrentStyleCSSProperties; +} + +interface DOMParser { + parseFromString(source: string, mimeType: string): Document; +} +declare var DOMParser: { + prototype: DOMParser; + new (): DOMParser; +} + +interface MSMimeTypesCollection { + length: number; +} +declare var MSMimeTypesCollection: { + prototype: MSMimeTypesCollection; + new(): MSMimeTypesCollection; +} + +interface StyleSheet { + disabled: boolean; + ownerNode: Node; + parentStyleSheet: StyleSheet; + href: string; + media: MediaList; + type: string; + title: string; +} +declare var StyleSheet: { + prototype: StyleSheet; + new(): StyleSheet; +} + +interface DOML2DeprecatedBorderStyle_HTMLTableElement { + border: string; +} + +interface DOML2DeprecatedWidthStyle_HTMLAppletElement { + width: number; +} + +interface SVGTextPathElement extends SVGTextContentElement, SVGURIReference { + startOffset: SVGAnimatedLength; + method: SVGAnimatedEnumeration; + spacing: SVGAnimatedEnumeration; + TEXTPATH_SPACINGTYPE_EXACT: number; + TEXTPATH_METHODTYPE_STRETCH: number; + TEXTPATH_SPACINGTYPE_AUTO: number; + TEXTPATH_SPACINGTYPE_UNKNOWN: number; + TEXTPATH_METHODTYPE_UNKNOWN: number; + TEXTPATH_METHODTYPE_ALIGN: number; +} +declare var SVGTextPathElement: { + prototype: SVGTextPathElement; + new(): SVGTextPathElement; + TEXTPATH_SPACINGTYPE_EXACT: number; + TEXTPATH_METHODTYPE_STRETCH: number; + TEXTPATH_SPACINGTYPE_AUTO: number; + TEXTPATH_SPACINGTYPE_UNKNOWN: number; + TEXTPATH_METHODTYPE_UNKNOWN: number; + TEXTPATH_METHODTYPE_ALIGN: number; +} + +interface NodeList { + length: number; + item(index: number): Node; + [index: number]: Node; +} +declare var NodeList: { + prototype: NodeList; + new(): NodeList; +} + +interface NodeListOf { + length: number; + item(index: number): TNode; + [index: number]: TNode; +} + +interface HTMLDTElement extends HTMLElement, DOML2DeprecatedWordWrapSuppression_HTMLDTElement { +} +declare var HTMLDTElement: { + prototype: HTMLDTElement; + new(): HTMLDTElement; +} + +interface XMLSerializer { + serializeToString(target: Node): string; +} +declare var XMLSerializer: { + prototype: XMLSerializer; + new (): XMLSerializer; +} + +interface StyleSheetPage { + pseudoClass: string; + selector: string; +} + +interface DOML2DeprecatedWordWrapSuppression_HTMLDDElement { + noWrap: boolean; +} + +interface MSHTMLTableRowElementExtensions { + height: any; +} + +interface SVGGradientElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGURIReference { + spreadMethod: SVGAnimatedEnumeration; + gradientTransform: SVGAnimatedTransformList; + gradientUnits: SVGAnimatedEnumeration; + SVG_SPREADMETHOD_REFLECT: number; + SVG_SPREADMETHOD_PAD: number; + SVG_SPREADMETHOD_UNKNOWN: number; + SVG_SPREADMETHOD_REPEAT: number; +} +declare var SVGGradientElement: { + prototype: SVGGradientElement; + new(): SVGGradientElement; + SVG_SPREADMETHOD_REFLECT: number; + SVG_SPREADMETHOD_PAD: number; + SVG_SPREADMETHOD_UNKNOWN: number; + SVG_SPREADMETHOD_REPEAT: number; +} + +interface DOML2DeprecatedTextFlowControl_HTMLBRElement { + clear: string; +} + +interface MSHTMLParagraphElementExtensions extends DOML2DeprecatedTextFlowControl_HTMLBlockElement { +} + +interface NodeFilter { + acceptNode(n: Node): number; + SHOW_ENTITY_REFERENCE: number; + SHOW_NOTATION: number; + SHOW_ENTITY: number; + SHOW_DOCUMENT: number; + SHOW_PROCESSING_INSTRUCTION: number; + FILTER_REJECT: number; + SHOW_CDATA_SECTION: number; + FILTER_ACCEPT: number; + SHOW_ALL: number; + SHOW_DOCUMENT_TYPE: number; + SHOW_TEXT: number; + SHOW_ELEMENT: number; + SHOW_COMMENT: number; + FILTER_SKIP: number; + SHOW_ATTRIBUTE: number; + SHOW_DOCUMENT_FRAGMENT: number; +} +declare var NodeFilter: { + prototype: NodeFilter; + new(): NodeFilter; + SHOW_ENTITY_REFERENCE: number; + SHOW_NOTATION: number; + SHOW_ENTITY: number; + SHOW_DOCUMENT: number; + SHOW_PROCESSING_INSTRUCTION: number; + FILTER_REJECT: number; + SHOW_CDATA_SECTION: number; + FILTER_ACCEPT: number; + SHOW_ALL: number; + SHOW_DOCUMENT_TYPE: number; + SHOW_TEXT: number; + SHOW_ELEMENT: number; + SHOW_COMMENT: number; + FILTER_SKIP: number; + SHOW_ATTRIBUTE: number; + SHOW_DOCUMENT_FRAGMENT: number; +} + +interface MSBorderColorStyle_HTMLFrameElement { + borderColor: any; +} + +interface MSHTMLOListElementExtensions { +} + +interface DOML2DeprecatedWordWrapSuppression_HTMLDTElement { + noWrap: boolean; +} + +interface ScreenView extends AbstractView { + outerWidth: number; + pageXOffset: number; + innerWidth: number; + pageYOffset: number; + screenY: number; + outerHeight: number; + screen: Screen; + innerHeight: number; + screenX: number; + scroll(x?: number, y?: number): void; + scrollBy(x?: number, y?: number): void; + scrollTo(x?: number, y?: number): void; +} + +interface DOML2DeprecatedMarginStyle_HTMLObjectElement { + vspace: number; + hspace: number; +} + +interface DOML2DeprecatedMarginStyle_HTMLInputElement { + vspace: number; + hspace: number; +} + +interface MSHTMLTableSectionElementExtensions extends DOML2DeprecatedBackgroundColorStyle { + moveRow(indexFrom?: number, indexTo?: number): Object; +} + +interface HTMLFieldSetElement extends HTMLElement, MSHTMLFieldSetElementExtensions { + form: HTMLFormElement; +} +declare var HTMLFieldSetElement: { + prototype: HTMLFieldSetElement; + new(): HTMLFieldSetElement; +} + +interface MediaError { + code: number; + MEDIA_ERR_ABORTED: number; + MEDIA_ERR_NETWORK: number; + MEDIA_ERR_SRC_NOT_SUPPORTED: number; + MEDIA_ERR_DECODE: number; +} +declare var MediaError: { + prototype: MediaError; + new(): MediaError; + MEDIA_ERR_ABORTED: number; + MEDIA_ERR_NETWORK: number; + MEDIA_ERR_SRC_NOT_SUPPORTED: number; + MEDIA_ERR_DECODE: number; +} + +interface SVGNumberList { + numberOfItems: number; + replaceItem(newItem: SVGNumber, index: number): SVGNumber; + getItem(index: number): SVGNumber; + clear(): void; + appendItem(newItem: SVGNumber): SVGNumber; + initialize(newItem: SVGNumber): SVGNumber; + removeItem(index: number): SVGNumber; + insertItemBefore(newItem: SVGNumber, index: number): SVGNumber; +} +declare var SVGNumberList: { + prototype: SVGNumberList; + new(): SVGNumberList; +} + +interface HTMLBGSoundElement extends HTMLElement { + balance: any; + volume: any; + src: string; + loop: number; +} +declare var HTMLBGSoundElement: { + prototype: HTMLBGSoundElement; + new(): HTMLBGSoundElement; +} + +interface HTMLElement extends Element, MSHTMLElementRangeExtensions, ElementCSSInlineStyle, MSEventAttachmentTarget, MSHTMLElementExtensions, MSNodeExtensions { + ondragend: (ev: DragEvent) => any; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + onkeydown: (ev: KeyboardEvent) => any; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + ondragover: (ev: DragEvent) => any; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + onkeyup: (ev: KeyboardEvent) => any; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + offsetTop: number; + onreset: (ev: Event) => any; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + onmouseup: (ev: MouseEvent) => any; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + ondragstart: (ev: DragEvent) => any; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + ondrag: (ev: DragEvent) => any; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + innerHTML: string; + onmouseover: (ev: MouseEvent) => any; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + ondragleave: (ev: DragEvent) => any; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + lang: string; + onpause: (ev: Event) => any; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + className: string; + onseeked: (ev: Event) => any; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + onmousedown: (ev: MouseEvent) => any; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + title: string; + onclick: (ev: MouseEvent) => any; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + onwaiting: (ev: Event) => any; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + outerHTML: string; + offsetLeft: number; + ondurationchange: (ev: Event) => any; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + offsetHeight: number; + dir: string; + onblur: (ev: FocusEvent) => any; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + onemptied: (ev: Event) => any; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + onseeking: (ev: Event) => any; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + oncanplay: (ev: Event) => any; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + onstalled: (ev: Event) => any; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + onmousemove: (ev: MouseEvent) => any; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + style: MSStyleCSSProperties; + isContentEditable: boolean; + onratechange: (ev: Event) => any; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + onloadstart: (ev: Event) => any; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + ondragenter: (ev: DragEvent) => any; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + contentEditable: string; + onsubmit: (ev: Event) => any; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + tabIndex: number; + onprogress: (ev: any) => any; + addEventListener(type: "progress", listener: (ev: any) => any, useCapture?: boolean): void; + ondblclick: (ev: MouseEvent) => any; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + oncontextmenu: (ev: MouseEvent) => any; + addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + onchange: (ev: Event) => any; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + onloadedmetadata: (ev: Event) => any; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + onerror: (ev: Event) => any; + addEventListener(type: "error", listener: (ev: Event) => any, useCapture?: boolean): void; + onplay: (ev: Event) => any; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + id: string; + onplaying: (ev: Event) => any; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + oncanplaythrough: (ev: Event) => any; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + onabort: (ev: UIEvent) => any; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + onreadystatechange: (ev: Event) => any; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + onkeypress: (ev: KeyboardEvent) => any; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + offsetParent: Element; + onloadeddata: (ev: Event) => any; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + disabled: boolean; + onsuspend: (ev: Event) => any; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + accessKey: string; + onfocus: (ev: FocusEvent) => any; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + ontimeupdate: (ev: Event) => any; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + onselect: (ev: UIEvent) => any; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + ondrop: (ev: DragEvent) => any; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + offsetWidth: number; + onmouseout: (ev: MouseEvent) => any; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + onended: (ev: Event) => any; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + onscroll: (ev: UIEvent) => any; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + onmousewheel: (ev: MouseWheelEvent) => any; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + onvolumechange: (ev: Event) => any; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + onload: (ev: Event) => any; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + oninput: (ev: Event) => any; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + click(): void; + getElementsByClassName(classNames: string): NodeList; + scrollIntoView(top?: boolean): void; + focus(): void; + blur(): void; + insertAdjacentHTML(where: string, html: string): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var HTMLElement: { + prototype: HTMLElement; + new(): HTMLElement; +} + +interface Comment extends CharacterData, MSCommentExtensions { +} +declare var Comment: { + prototype: Comment; + new(): Comment; +} + +interface CanvasPattern { +} +declare var CanvasPattern: { + prototype: CanvasPattern; + new(): CanvasPattern; +} + +interface HTMLHRElement extends HTMLElement, DOML2DeprecatedWidthStyle_HTMLHRElement, MSHTMLHRElementExtensions, HTMLHRElementDOML2Deprecated, DOML2DeprecatedAlignmentStyle_HTMLHRElement, DOML2DeprecatedSizeProperty { +} +declare var HTMLHRElement: { + prototype: HTMLHRElement; + new(): HTMLHRElement; +} + +interface MSHTMLFrameSetElementExtensions { + name: string; + frameBorder: string; + border: string; + frameSpacing: any; +} + +interface DOML2DeprecatedTextFlowControl_HTMLBlockElement { + clear: string; +} + +interface PositionOptions { + enableHighAccuracy?: boolean; + timeout?: number; + maximumAge?: number; +} + +interface HTMLObjectElement extends HTMLElement, MSHTMLObjectElementExtensions, GetSVGDocument, DOML2DeprecatedMarginStyle_HTMLObjectElement, MSDataBindingExtensions, MSDataBindingRecordSetExtensions, DOML2DeprecatedAlignmentStyle_HTMLObjectElement, DOML2DeprecatedBorderStyle_HTMLObjectElement { + width: string; + codeType: string; + archive: string; + standby: string; + name: string; + useMap: string; + form: HTMLFormElement; + data: string; + height: string; + contentDocument: Document; + codeBase: string; + declare: boolean; + type: string; + code: string; +} +declare var HTMLObjectElement: { + prototype: HTMLObjectElement; + new(): HTMLObjectElement; +} + +interface MSHTMLMenuElementExtensions { +} + +interface DocumentView { + defaultView: AbstractView; + elementFromPoint(x: number, y: number): Element; +} + +interface StorageEvent extends Event { + oldValue: any; + newValue: any; + url: string; + storageArea: Storage; + key: string; + initStorageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, keyArg: string, oldValueArg: any, newValueArg: any, urlArg: string, storageAreaArg: Storage): void; +} +declare var StorageEvent: { + prototype: StorageEvent; + new(): StorageEvent; +} + +interface HTMLEmbedElement extends HTMLElement, GetSVGDocument, MSHTMLEmbedElementExtensions { + width: string; + src: string; + name: string; + height: string; +} +declare var HTMLEmbedElement: { + prototype: HTMLEmbedElement; + new(): HTMLEmbedElement; +} + +interface CharacterData extends Node { + length: number; + data: string; + deleteData(offset: number, count: number): void; + replaceData(offset: number, count: number, arg: string): void; + appendData(arg: string): void; + insertData(offset: number, arg: string): void; + substringData(offset: number, count: number): string; +} +declare var CharacterData: { + prototype: CharacterData; + new(): CharacterData; +} + +interface DOML2DeprecatedAlignmentStyle_HTMLTableSectionElement { + align: string; +} + +interface HTMLOptGroupElement extends HTMLElement, MSDataBindingExtensions, MSHTMLOptGroupElementExtensions { + label: string; +} +declare var HTMLOptGroupElement: { + prototype: HTMLOptGroupElement; + new(): HTMLOptGroupElement; +} + +interface HTMLIsIndexElement extends HTMLElement, MSHTMLIsIndexElementExtensions { + form: HTMLFormElement; + prompt: string; +} +declare var HTMLIsIndexElement: { + prototype: HTMLIsIndexElement; + new(): HTMLIsIndexElement; +} + +interface SVGPathSegLinetoRel extends SVGPathSeg { + y: number; + x: number; +} +declare var SVGPathSegLinetoRel: { + prototype: SVGPathSegLinetoRel; + new(): SVGPathSegLinetoRel; +} + +interface MSHTMLDocumentSelection { + selection: MSSelection; +} + +interface DOMException { + code: number; + message: string; + toString(): string; + HIERARCHY_REQUEST_ERR: number; + NO_MODIFICATION_ALLOWED_ERR: number; + INVALID_MODIFICATION_ERR: number; + NAMESPACE_ERR: number; + INVALID_CHARACTER_ERR: number; + TYPE_MISMATCH_ERR: number; + ABORT_ERR: number; + INVALID_STATE_ERR: number; + SECURITY_ERR: number; + NETWORK_ERR: number; + WRONG_DOCUMENT_ERR: number; + QUOTA_EXCEEDED_ERR: number; + INDEX_SIZE_ERR: number; + DOMSTRING_SIZE_ERR: number; + SYNTAX_ERR: number; + SERIALIZE_ERR: number; + VALIDATION_ERR: number; + NOT_FOUND_ERR: number; + URL_MISMATCH_ERR: number; + PARSE_ERR: number; + NO_DATA_ALLOWED_ERR: number; + NOT_SUPPORTED_ERR: number; + INVALID_ACCESS_ERR: number; + INUSE_ATTRIBUTE_ERR: number; +} +declare var DOMException: { + prototype: DOMException; + new(): DOMException; + HIERARCHY_REQUEST_ERR: number; + NO_MODIFICATION_ALLOWED_ERR: number; + INVALID_MODIFICATION_ERR: number; + NAMESPACE_ERR: number; + INVALID_CHARACTER_ERR: number; + TYPE_MISMATCH_ERR: number; + ABORT_ERR: number; + INVALID_STATE_ERR: number; + SECURITY_ERR: number; + NETWORK_ERR: number; + WRONG_DOCUMENT_ERR: number; + QUOTA_EXCEEDED_ERR: number; + INDEX_SIZE_ERR: number; + DOMSTRING_SIZE_ERR: number; + SYNTAX_ERR: number; + SERIALIZE_ERR: number; + VALIDATION_ERR: number; + NOT_FOUND_ERR: number; + URL_MISMATCH_ERR: number; + PARSE_ERR: number; + NO_DATA_ALLOWED_ERR: number; + NOT_SUPPORTED_ERR: number; + INVALID_ACCESS_ERR: number; + INUSE_ATTRIBUTE_ERR: number; +} + +interface MSCompatibleInfoCollection { + length: number; + item(index: number): MSCompatibleInfo; +} +declare var MSCompatibleInfoCollection: { + prototype: MSCompatibleInfoCollection; + new(): MSCompatibleInfoCollection; +} + +interface MSHTMLIsIndexElementExtensions { + action: string; +} + +interface SVGAnimatedBoolean { + animVal: boolean; + baseVal: boolean; +} +declare var SVGAnimatedBoolean: { + prototype: SVGAnimatedBoolean; + new(): SVGAnimatedBoolean; +} + +interface SVGSwitchElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests { +} +declare var SVGSwitchElement: { + prototype: SVGSwitchElement; + new(): SVGSwitchElement; +} + +interface MSHTMLIFrameElementExtensions extends DOML2DeprecatedMarginStyle_MSHTMLIFrameElementExtensions, DOML2DeprecatedBorderStyle_MSHTMLIFrameElementExtensions { + onload: (ev: Event) => any; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + frameSpacing: any; + noResize: boolean; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} + +interface SVGPreserveAspectRatio { + align: number; + meetOrSlice: number; + SVG_PRESERVEASPECTRATIO_NONE: number; + SVG_PRESERVEASPECTRATIO_XMINYMID: number; + SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; + SVG_PRESERVEASPECTRATIO_XMINYMAX: number; + SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; + SVG_MEETORSLICE_UNKNOWN: number; + SVG_PRESERVEASPECTRATIO_XMAXYMID: number; + SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; + SVG_PRESERVEASPECTRATIO_XMINYMIN: number; + SVG_MEETORSLICE_MEET: number; + SVG_PRESERVEASPECTRATIO_XMIDYMID: number; + SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; + SVG_MEETORSLICE_SLICE: number; + SVG_PRESERVEASPECTRATIO_UNKNOWN: number; +} +declare var SVGPreserveAspectRatio: { + prototype: SVGPreserveAspectRatio; + new(): SVGPreserveAspectRatio; + SVG_PRESERVEASPECTRATIO_NONE: number; + SVG_PRESERVEASPECTRATIO_XMINYMID: number; + SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; + SVG_PRESERVEASPECTRATIO_XMINYMAX: number; + SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; + SVG_MEETORSLICE_UNKNOWN: number; + SVG_PRESERVEASPECTRATIO_XMAXYMID: number; + SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; + SVG_PRESERVEASPECTRATIO_XMINYMIN: number; + SVG_MEETORSLICE_MEET: number; + SVG_PRESERVEASPECTRATIO_XMIDYMID: number; + SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; + SVG_MEETORSLICE_SLICE: number; + SVG_PRESERVEASPECTRATIO_UNKNOWN: number; +} + +interface Attr extends Node, MSAttrExtensions { + specified: boolean; + ownerElement: Element; + value: string; + name: string; +} +declare var Attr: { + prototype: Attr; + new(): Attr; +} + +interface MSBorderColorStyle_HTMLTableRowElement { + borderColor: any; +} + +interface DOML2DeprecatedAlignmentStyle_HTMLTableCaptionElement { + align: string; +} + +interface PerformanceNavigation { + redirectCount: number; + type: number; + toJSON(): any; + TYPE_RELOAD: number; + TYPE_RESERVED: number; + TYPE_BACK_FORWARD: number; + TYPE_NAVIGATE: number; +} +declare var PerformanceNavigation: { + prototype: PerformanceNavigation; + new(): PerformanceNavigation; + TYPE_RELOAD: number; + TYPE_RESERVED: number; + TYPE_BACK_FORWARD: number; + TYPE_NAVIGATE: number; +} + +interface HTMLBodyElementDOML2Deprecated { + link: any; + aLink: any; + text: any; + vLink: any; +} + +interface SVGStopElement extends SVGElement, SVGStylable { + offset: SVGAnimatedNumber; +} +declare var SVGStopElement: { + prototype: SVGStopElement; + new(): SVGStopElement; +} + +interface PositionCallback { + (position: Position): void; +} + +interface SVGSymbolElement extends SVGElement, SVGStylable, SVGLangSpace, SVGFitToViewBox { +} +declare var SVGSymbolElement: { + prototype: SVGSymbolElement; + new(): SVGSymbolElement; +} + +interface SVGElementInstanceList { + length: number; + item(index: number): SVGElementInstance; +} +declare var SVGElementInstanceList: { + prototype: SVGElementInstanceList; + new(): SVGElementInstanceList; +} + +interface MSDataBindingRecordSetExtensions { + recordset: Object; + namedRecordset(dataMember: string, hierarchy?: any): Object; +} + +interface CSSRuleList { + length: number; + item(index: number): CSSRule; + [index: number]: CSSRule; +} +declare var CSSRuleList: { + prototype: CSSRuleList; + new(): CSSRuleList; +} + +interface MSHTMLTableColElementExtensions { +} + +interface LinkStyle { + sheet: StyleSheet; +} + +interface MSHTMLMarqueeElementExtensions { +} + +interface HTMLVideoElement extends HTMLMediaElement { + width: number; + videoWidth: number; + videoHeight: number; + height: number; + poster: string; +} +declare var HTMLVideoElement: { + prototype: HTMLVideoElement; + new(): HTMLVideoElement; +} + +interface MSXMLHttpRequestExtensions { + responseBody: any; + timeout: number; + ontimeout: (ev: Event) => any; +} + +interface ClientRectList { + length: number; + item(index: number): ClientRect; + [index: number]: ClientRect; +} +declare var ClientRectList: { + prototype: ClientRectList; + new(): ClientRectList; +} + +interface DOML2DeprecatedAlignmentStyle_HTMLTableCellElement { + align: string; +} + +interface SVGMaskElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGTests { + y: SVGAnimatedLength; + width: SVGAnimatedLength; + maskUnits: SVGAnimatedEnumeration; + maskContentUnits: SVGAnimatedEnumeration; + x: SVGAnimatedLength; + height: SVGAnimatedLength; +} +declare var SVGMaskElement: { + prototype: SVGMaskElement; + new(): SVGMaskElement; +} + +declare var Audio: { new (src?: string): HTMLAudioElement; }; +declare var Option: { new (text?: string, value?: string, defaultSelected?: boolean, selected?: boolean): HTMLOptionElement; }; +declare var Image: { new (width?: number, height?: number): HTMLImageElement; }; + +declare var ondragend: (ev: DragEvent) => any; +declare function addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare var onkeydown: (ev: KeyboardEvent) => any; +declare function addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; +declare var ondragover: (ev: DragEvent) => any; +declare function addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare var onkeyup: (ev: KeyboardEvent) => any; +declare function addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; +declare var onreset: (ev: Event) => any; +declare function addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; +declare var onmouseup: (ev: MouseEvent) => any; +declare function addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare var ondragstart: (ev: DragEvent) => any; +declare function addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare var ondrag: (ev: DragEvent) => any; +declare function addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare var onmouseover: (ev: MouseEvent) => any; +declare function addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare var ondragleave: (ev: DragEvent) => any; +declare function addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare var history: History; +declare var name: string; +declare var onafterprint: (ev: Event) => any; +declare function addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; +declare var onpause: (ev: Event) => any; +declare function addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; +declare var onbeforeprint: (ev: Event) => any; +declare function addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; +declare var top: Window; +declare var onmousedown: (ev: MouseEvent) => any; +declare function addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare var onseeked: (ev: Event) => any; +declare function addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; +declare var opener: Window; +declare var onclick: (ev: MouseEvent) => any; +declare function addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare var onwaiting: (ev: Event) => any; +declare function addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; +declare var ononline: (ev: Event) => any; +declare function addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; +declare var ondurationchange: (ev: Event) => any; +declare function addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; +declare var frames: Window; +declare var onblur: (ev: FocusEvent) => any; +declare function addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; +declare var onemptied: (ev: Event) => any; +declare function addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; +declare var onseeking: (ev: Event) => any; +declare function addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; +declare var oncanplay: (ev: Event) => any; +declare function addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; +declare var onstalled: (ev: Event) => any; +declare function addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; +declare var onmousemove: (ev: MouseEvent) => any; +declare function addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare var onoffline: (ev: Event) => any; +declare function addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; +declare var length: number; +declare var onbeforeunload: (ev: BeforeUnloadEvent) => any; +declare function addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; +declare var onratechange: (ev: Event) => any; +declare function addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; +declare var onstorage: (ev: StorageEvent) => any; +declare function addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; +declare var onloadstart: (ev: Event) => any; +declare function addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; +declare var ondragenter: (ev: DragEvent) => any; +declare function addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare var onsubmit: (ev: Event) => any; +declare function addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; +declare var self: Window; +declare var onprogress: (ev: any) => any; +declare function addEventListener(type: "progress", listener: (ev: any) => any, useCapture?: boolean): void; +declare var ondblclick: (ev: MouseEvent) => any; +declare function addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare var oncontextmenu: (ev: MouseEvent) => any; +declare function addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare var onchange: (ev: Event) => any; +declare function addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; +declare var onloadedmetadata: (ev: Event) => any; +declare function addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; +declare var onplay: (ev: Event) => any; +declare function addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; +declare var onerror: ErrorFunction; +declare var onplaying: (ev: Event) => any; +declare function addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; +declare var parent: Window; +declare var location: Location; +declare var oncanplaythrough: (ev: Event) => any; +declare function addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; +declare var onabort: (ev: UIEvent) => any; +declare function addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; +declare var onreadystatechange: (ev: Event) => any; +declare function addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; +declare var onkeypress: (ev: KeyboardEvent) => any; +declare function addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; +declare var frameElement: Element; +declare var onloadeddata: (ev: Event) => any; +declare function addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; +declare var onsuspend: (ev: Event) => any; +declare function addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; +declare var window: Window; +declare var onfocus: (ev: FocusEvent) => any; +declare function addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; +declare var onmessage: (ev: MessageEvent) => any; +declare function addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; +declare var ontimeupdate: (ev: Event) => any; +declare function addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; +declare var onresize: (ev: UIEvent) => any; +declare function addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; +declare var navigator: Navigator; +declare var onselect: (ev: UIEvent) => any; +declare function addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; +declare var ondrop: (ev: DragEvent) => any; +declare function addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare var onmouseout: (ev: MouseEvent) => any; +declare function addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare var onended: (ev: Event) => any; +declare function addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; +declare var onhashchange: (ev: Event) => any; +declare function addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; +declare var onunload: (ev: Event) => any; +declare function addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; +declare var onscroll: (ev: UIEvent) => any; +declare function addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; +declare var onmousewheel: (ev: MouseWheelEvent) => any; +declare function addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; +declare var onload: (ev: Event) => any; +declare function addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; +declare var onvolumechange: (ev: Event) => any; +declare function addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; +declare var oninput: (ev: Event) => any; +declare function addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function alert(message?: string): void; +declare function focus(): void; +declare function print(): void; +declare function prompt(message?: string, defaul?: string): string; +declare function toString(): string; +declare function open(url?: string, target?: string, features?: string, replace?: boolean): Window; +declare function close(): void; +declare function confirm(message?: string): boolean; +declare function postMessage(message: any, targetOrigin: string, ports?: any): void; +declare function showModalDialog(url?: string, argument?: any, options?: any): any; +declare function blur(): void; +declare function getSelection(): Selection; +declare function getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; +declare function attachEvent(event: string, listener: EventListener): boolean; +declare function detachEvent(event: string, listener: EventListener): void; +declare var status: string; +declare var onmouseleave: (ev: MouseEvent) => any; +declare function addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare var screenLeft: number; +declare var offscreenBuffering: any; +declare var maxConnectionsPerServer: number; +declare var onmouseenter: (ev: MouseEvent) => any; +declare function addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare var clipboardData: DataTransfer; +declare var defaultStatus: string; +declare var clientInformation: Navigator; +declare var closed: boolean; +declare var onhelp: (ev: Event) => any; +declare function addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; +declare var external: BrowserPublic; +declare var event: MSEventObj; +declare var onfocusout: (ev: FocusEvent) => any; +declare function addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; +declare var screenTop: number; +declare var onfocusin: (ev: FocusEvent) => any; +declare function addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; +declare function showModelessDialog(url?: string, argument?: any, options?: any): Window; +declare function navigate(url: string): void; +declare function resizeBy(x?: number, y?: number): void; +declare function item(index: any): any; +declare function resizeTo(x?: number, y?: number): void; +declare function createPopup(arguments?: any): MSPopupWindow; +declare function toStaticHTML(html: string): string; +declare function execScript(code: string, language?: string): any; +declare function msWriteProfilerMark(profilerMarkName: string): void; +declare function moveTo(x?: number, y?: number): void; +declare function moveBy(x?: number, y?: number): void; +declare function showHelp(url: string, helpArg?: any, features?: string): void; +declare var performance: any; +declare var outerWidth: number; +declare var pageXOffset: number; +declare var innerWidth: number; +declare var pageYOffset: number; +declare var screenY: number; +declare var outerHeight: number; +declare var screen: Screen; +declare var innerHeight: number; +declare var screenX: number; +declare function scroll(x?: number, y?: number): void; +declare function scrollBy(x?: number, y?: number): void; +declare function scrollTo(x?: number, y?: number): void; +declare var styleMedia: StyleMedia; +declare var document: Document; +declare function removeEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +declare function addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +declare function dispatchEvent(evt: Event): boolean; +declare var localStorage: Storage; +declare var sessionStorage: Storage; +declare function clearTimeout(handle: number): void; +declare function setTimeout(expression: any, msec?: number, language?: any): number; +declare function clearInterval(handle: number): void; +declare function setInterval(expression: any, msec?: number, language?: any): number; + + +///////////////////////////// +/// IE10 DOM APIs +///////////////////////////// + +interface HTMLBodyElement { + onpopstate: (ev: PopStateEvent) => any; + addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; +} + +interface MSGestureEvent extends UIEvent { + offsetY: number; + translationY: number; + velocityExpansion: number; + velocityY: number; + velocityAngular: number; + translationX: number; + velocityX: number; + hwTimestamp: number; + offsetX: number; + screenX: number; + rotation: number; + expansion: number; + clientY: number; + screenY: number; + scale: number; + gestureObject: any; + clientX: number; + initGestureEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: AbstractView, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, offsetXArg: number, offsetYArg: number, translationXArg: number, translationYArg: number, scaleArg: number, expansionArg: number, rotationArg: number, velocityXArg: number, velocityYArg: number, velocityExpansionArg: number, velocityAngularArg: number, hwTimestampArg: number): void; + MSGESTURE_FLAG_BEGIN: number; + MSGESTURE_FLAG_END: number; + MSGESTURE_FLAG_CANCEL: number; + MSGESTURE_FLAG_INERTIA: number; + MSGESTURE_FLAG_NONE: number; +} +declare var MSGestureEvent: { + prototype: MSGestureEvent; + new(): MSGestureEvent; + MSGESTURE_FLAG_BEGIN: number; + MSGESTURE_FLAG_END: number; + MSGESTURE_FLAG_CANCEL: number; + MSGESTURE_FLAG_INERTIA: number; + MSGESTURE_FLAG_NONE: number; +} + +interface HTMLAnchorElement { + text: string; +} + +interface HTMLInputElement { + validationMessage: string; + files: FileList; + max: string; + formTarget: string; + willValidate: boolean; + step: string; + autofocus: boolean; + required: boolean; + formEnctype: string; + valueAsNumber: number; + placeholder: string; + formMethod: string; + list: HTMLElement; + autocomplete: string; + min: string; + formAction: string; + pattern: string; + validity: ValidityState; + formNoValidate: string; + multiple: boolean; + checkValidity(): boolean; + stepDown(n?: number): void; + stepUp(n?: number): void; + setCustomValidity(error: string): void; +} + +interface ErrorEvent extends Event { + colno: number; + filename: string; + lineno: number; + message: string; + initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void; +} +declare var ErrorEvent: { + prototype: ErrorEvent; + new(): ErrorEvent; +} + +interface SVGFilterElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGURIReference { + y: SVGAnimatedLength; + width: SVGAnimatedLength; + filterResX: SVGAnimatedInteger; + filterUnits: SVGAnimatedEnumeration; + primitiveUnits: SVGAnimatedEnumeration; + x: SVGAnimatedLength; + height: SVGAnimatedLength; + filterResY: SVGAnimatedInteger; + setFilterRes(filterResX: number, filterResY: number): void; +} +declare var SVGFilterElement: { + prototype: SVGFilterElement; + new(): SVGFilterElement; +} + +interface TrackEvent extends Event { + track: any; +} +declare var TrackEvent: { + prototype: TrackEvent; + new(): TrackEvent; +} + +interface SVGFEMergeNodeElement extends SVGElement { + in1: SVGAnimatedString; +} +declare var SVGFEMergeNodeElement: { + prototype: SVGFEMergeNodeElement; + new(): SVGFEMergeNodeElement; +} + +interface SVGFEFloodElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { +} +declare var SVGFEFloodElement: { + prototype: SVGFEFloodElement; + new(): SVGFEFloodElement; +} + +interface MSElementExtensions { + msRegionOverflow: string; + onmspointerdown: (ev: any) => any; + addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; + onmsgotpointercapture: (ev: any) => any; + addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + onmsgesturedoubletap: (ev: any) => any; + addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; + onmspointerhover: (ev: any) => any; + addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; + onmsgesturehold: (ev: any) => any; + addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; + onmspointermove: (ev: any) => any; + addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; + onmsgesturechange: (ev: any) => any; + addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; + onmsgesturestart: (ev: any) => any; + addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; + onmspointercancel: (ev: any) => any; + addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; + onmsgestureend: (ev: any) => any; + addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; + onmsgesturetap: (ev: any) => any; + addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; + onmspointerout: (ev: any) => any; + addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; + onmsinertiastart: (ev: any) => any; + addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; + onmslostpointercapture: (ev: any) => any; + addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + onmspointerover: (ev: any) => any; + addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; + msContentZoomFactor: number; + onmspointerup: (ev: any) => any; + addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; + msGetRegionContent(): MSRangeCollection; + msReleasePointerCapture(pointerId: number): void; + msSetPointerCapture(pointerId: number): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var MSElementExtensions: { + prototype: MSElementExtensions; + new(): MSElementExtensions; +} + +interface MSCSSScrollTranslationProperties { + msScrollTranslation: string; +} + +interface MSGesture { + target: Element; + addPointer(pointerId: number): void; + stop(): void; +} +declare var MSGesture: { + prototype: MSGesture; + new (): MSGesture; +} + +interface TextTrackCue extends EventTarget { + onenter: (ev: Event) => any; + addEventListener(type: "enter", listener: (ev: Event) => any, useCapture?: boolean): void; + track: TextTrack; + endTime: number; + text: string; + pauseOnExit: boolean; + id: string; + startTime: number; + onexit: (ev: Event) => any; + addEventListener(type: "exit", listener: (ev: Event) => any, useCapture?: boolean): void; + getCueAsHTML(): DocumentFragment; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var TextTrackCue: { + prototype: TextTrackCue; + new(): TextTrackCue; +} + +interface MSHTMLDocumentViewExtensions { + msCSSOMElementFloatMetrics: boolean; + msElementsFromPoint(x: number, y: number): NodeList; + msElementsFromRect(left: number, top: number, width: number, height: number): NodeList; +} +declare var MSHTMLDocumentViewExtensions: { + prototype: MSHTMLDocumentViewExtensions; + new(): MSHTMLDocumentViewExtensions; +} + +interface MSStreamReader extends MSBaseReader { + error: DOMError; + readAsArrayBuffer(stream: MSStream, size?: number): void; + readAsBlob(stream: MSStream, size?: number): void; + readAsDataURL(stream: MSStream, size?: number): void; + readAsText(stream: MSStream, encoding?: string, size?: number): void; +} +declare var MSStreamReader: { + prototype: MSStreamReader; + new (): MSStreamReader; +} + +interface CSSFlexibleBoxProperties { + msFlex: string; + msFlexDirection: string; + msFlexNegative: string; + msFlexPack: string; + msFlexWrap: string; + msFlexItemAlign: string; + msFlexOrder: string; + msFlexPositive: string; + msFlexAlign: string; + msFlexFlow: string; + msFlexPreferredSize: string; + msFlexLinePack: string; +} + +interface DOMTokenList { + length: number; + contains(token: string): boolean; + remove(token: string): void; + toggle(token: string): boolean; + add(token: string): void; + item(index: number): string; + [index: number]: string; + toString(): string; +} +declare var DOMTokenList: { + prototype: DOMTokenList; + new(): DOMTokenList; +} + +interface EventException { + name: string; +} + +interface SVGFEFuncAElement extends SVGComponentTransferFunctionElement { +} +declare var SVGFEFuncAElement: { + prototype: SVGFEFuncAElement; + new(): SVGFEFuncAElement; +} + +interface Performance { + now(): number; +} + +interface SVGFETileElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; +} +declare var SVGFETileElement: { + prototype: SVGFETileElement; + new(): SVGFETileElement; +} + +interface SVGFEBlendElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in2: SVGAnimatedString; + mode: SVGAnimatedEnumeration; + in1: SVGAnimatedString; + SVG_FEBLEND_MODE_DARKEN: number; + SVG_FEBLEND_MODE_UNKNOWN: number; + SVG_FEBLEND_MODE_MULTIPLY: number; + SVG_FEBLEND_MODE_NORMAL: number; + SVG_FEBLEND_MODE_SCREEN: number; + SVG_FEBLEND_MODE_LIGHTEN: number; +} +declare var SVGFEBlendElement: { + prototype: SVGFEBlendElement; + new(): SVGFEBlendElement; + SVG_FEBLEND_MODE_DARKEN: number; + SVG_FEBLEND_MODE_UNKNOWN: number; + SVG_FEBLEND_MODE_MULTIPLY: number; + SVG_FEBLEND_MODE_NORMAL: number; + SVG_FEBLEND_MODE_SCREEN: number; + SVG_FEBLEND_MODE_LIGHTEN: number; +} + +interface WindowTimers extends WindowTimersExtension { +} +declare var WindowTimers: { + prototype: WindowTimers; + new(): WindowTimers; +} + +interface CSSStyleDeclaration extends CSS2DTransformsProperties, CSSTransitionsProperties, CSSFontsProperties, MSCSSHighContrastProperties, CSSGridProperties, CSSAnimationsProperties, MSCSSContentZoomProperties, MSCSSScrollTranslationProperties, MSCSSTouchManipulationProperties, CSSFlexibleBoxProperties, MSCSSPositionedFloatsProperties, MSCSSRegionProperties, MSCSSSelectionBoundaryProperties, CSSMultiColumnProperties, CSSTextProperties, CSS3DTransformsProperties { +} + +interface MessageChannel { + port2: MessagePort; + port1: MessagePort; +} +declare var MessageChannel: { + prototype: MessageChannel; + new (): MessageChannel; +} + +interface SVGFEMergeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { +} +declare var SVGFEMergeElement: { + prototype: SVGFEMergeElement; + new(): SVGFEMergeElement; +} + +interface Navigator extends MSFileSaver { +} + +interface TransitionEvent extends Event { + propertyName: string; + elapsedTime: number; + initTransitionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, propertyNameArg: string, elapsedTimeArg: number): void; +} +declare var TransitionEvent: { + prototype: TransitionEvent; + new(): TransitionEvent; +} + +interface MediaQueryList { + matches: boolean; + media: string; + addListener(listener: MediaQueryListListener): void; + removeListener(listener: MediaQueryListListener): void; +} +declare var MediaQueryList: { + prototype: MediaQueryList; + new(): MediaQueryList; +} + +interface DOMError { + name: string; + toString(): string; +} +declare var DOMError: { + prototype: DOMError; + new(): DOMError; +} + +interface SVGFEPointLightElement extends SVGElement { + y: SVGAnimatedNumber; + x: SVGAnimatedNumber; + z: SVGAnimatedNumber; +} +declare var SVGFEPointLightElement: { + prototype: SVGFEPointLightElement; + new(): SVGFEPointLightElement; +} + +interface CSSFontsProperties { + msFontFeatureSettings: string; + fontFeatureSettings: string; +} + +interface CloseEvent extends Event { + wasClean: boolean; + reason: string; + code: number; + initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void; +} +declare var CloseEvent: { + prototype: CloseEvent; + new(): CloseEvent; +} + +interface WebSocket extends EventTarget { + protocol: string; + readyState: number; + bufferedAmount: number; + onopen: (ev: Event) => any; + addEventListener(type: "open", listener: (ev: Event) => any, useCapture?: boolean): void; + extensions: string; + onmessage: (ev: any) => any; + addEventListener(type: "message", listener: (ev: any) => any, useCapture?: boolean): void; + onclose: (ev: CloseEvent) => any; + addEventListener(type: "close", listener: (ev: CloseEvent) => any, useCapture?: boolean): void; + onerror: (ev: ErrorEvent) => any; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + binaryType: string; + url: string; + close(code?: number, reason?: string): void; + send(data: any): void; + OPEN: number; + CLOSING: number; + CONNECTING: number; + CLOSED: number; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var WebSocket: { + prototype: WebSocket; + new (url: string): WebSocket; + new (url: string, prototcol: string): WebSocket; + new (url: string, prototcol: string[]): WebSocket; + OPEN: number; + CLOSING: number; + CONNECTING: number; + CLOSED: number; +} + +interface ProgressEvent extends Event { + loaded: number; + lengthComputable: boolean; + total: number; + initProgressEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, lengthComputableArg: boolean, loadedArg: number, totalArg: number): void; +} +declare var ProgressEvent: { + prototype: ProgressEvent; + new(): ProgressEvent; +} + +interface HTMLCanvasElement { + msToBlob(): Blob; +} + +interface IDBObjectStore { + indexNames: DOMStringList; + name: string; + transaction: IDBTransaction; + keyPath: string; + count(key?: any): IDBRequest; + add(value: any, key?: any): IDBRequest; + clear(): IDBRequest; + createIndex(name: string, keyPath: string, optionalParameters?: any): IDBIndex; + put(value: any, key?: any): IDBRequest; + openCursor(range?: any, direction?: string): IDBRequest; + deleteIndex(indexName: string): void; + index(name: string): IDBIndex; + get(key: any): IDBRequest; + delete(key: any): IDBRequest; +} +declare var IDBObjectStore: { + prototype: IDBObjectStore; + new(): IDBObjectStore; +} + +interface ObjectURLOptions { + oneTimeOnly?: boolean; +} + +interface SVGFEGaussianBlurElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + stdDeviationX: SVGAnimatedNumber; + in1: SVGAnimatedString; + stdDeviationY: SVGAnimatedNumber; + setStdDeviation(stdDeviationX: number, stdDeviationY: number): void; +} +declare var SVGFEGaussianBlurElement: { + prototype: SVGFEGaussianBlurElement; + new(): SVGFEGaussianBlurElement; +} + +interface MSHTMLDocumentExtensions { + onmspointerdown: (ev: any) => any; + addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; + onmspointercancel: (ev: any) => any; + addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; + onmsgesturedoubletap: (ev: any) => any; + addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; + onmsgesturetap: (ev: any) => any; + addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; + onmsgestureend: (ev: any) => any; + addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; + onmspointerout: (ev: any) => any; + addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; + onmsmanipulationstatechanged: (ev: any) => any; + addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; + onmsinertiastart: (ev: any) => any; + addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; + onmspointerhover: (ev: any) => any; + addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; + onmscontentzoom: (ev: any) => any; + addEventListener(type: "mscontentzoom", listener: (ev: any) => any, useCapture?: boolean): void; + onmsgesturehold: (ev: any) => any; + addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; + onmspointermove: (ev: any) => any; + addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; + onmspointerover: (ev: any) => any; + addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; + onmsgesturechange: (ev: any) => any; + addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; + onmsgesturestart: (ev: any) => any; + addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; + onmspointerup: (ev: any) => any; + addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; +} +declare var MSHTMLDocumentExtensions: { + prototype: MSHTMLDocumentExtensions; + new(): MSHTMLDocumentExtensions; +} + +interface MSCSSSelectionBoundaryProperties { + msUserSelect: string; +} + +interface SVGFilterPrimitiveStandardAttributes extends SVGStylable { + y: SVGAnimatedLength; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + height: SVGAnimatedLength; + result: SVGAnimatedString; +} + +interface IDBVersionChangeEvent extends Event { + newVersion: number; + oldVersion: number; +} +declare var IDBVersionChangeEvent: { + prototype: IDBVersionChangeEvent; + new(): IDBVersionChangeEvent; +} + +interface IDBIndex { + unique: boolean; + name: string; + keyPath: string; + objectStore: IDBObjectStore; + count(key?: any): IDBRequest; + getKey(key: any): IDBRequest; + openKeyCursor(range?: IDBKeyRange, direction?: string): IDBRequest; + get(key: any): IDBRequest; + openCursor(range?: IDBKeyRange, direction?: string): IDBRequest; +} +declare var IDBIndex: { + prototype: IDBIndex; + new(): IDBIndex; +} + +interface FileList { + length: number; + item(index: number): File; + [index: number]: File; +} +declare var FileList: { + prototype: FileList; + new(): FileList; +} + +interface IDBCursor { + source: any; + direction: string; + key: any; + primaryKey: any; + advance(count: number): void; + delete(): IDBRequest; + continue(key?: any): void; + update(value: any): IDBRequest; +} +declare var IDBCursor: { + prototype: IDBCursor; + new(): IDBCursor; +} + +interface CSSAnimationsProperties { + animationFillMode: string; + msAnimationDirection: string; + msAnimationDelay: string; + msAnimationFillMode: string; + animationIterationCount: string; + msAnimationPlayState: string; + msAnimationIterationCount: string; + animationDelay: string; + animationTimingFunction: string; + msAnimation: string; + animation: string; + animationDirection: string; + animationDuration: string; + animationName: string; + animationPlayState: string; + msAnimationTimingFunction: string; + msAnimationName: string; + msAnimationDuration: string; +} + +interface SVGFESpecularLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + kernelUnitLengthY: SVGAnimatedNumber; + surfaceScale: SVGAnimatedNumber; + specularExponent: SVGAnimatedNumber; + in1: SVGAnimatedString; + kernelUnitLengthX: SVGAnimatedNumber; + specularConstant: SVGAnimatedNumber; +} +declare var SVGFESpecularLightingElement: { + prototype: SVGFESpecularLightingElement; + new(): SVGFESpecularLightingElement; +} + +interface File extends Blob { + lastModifiedDate: any; + name: string; +} +declare var File: { + prototype: File; + new(): File; +} + +interface URL { + revokeObjectURL(url: string): void; + createObjectURL(object: any, options?: ObjectURLOptions): string; +} +declare var URL: URL; + +interface RangeException { + name: string; +} + +interface IDBCursorWithValue extends IDBCursor { + value: any; +} +declare var IDBCursorWithValue: { + prototype: IDBCursorWithValue; + new(): IDBCursorWithValue; +} + +interface HTMLTextAreaElement { + validationMessage: string; + autofocus: boolean; + validity: ValidityState; + required: boolean; + maxLength: number; + willValidate: boolean; + placeholder: string; + checkValidity(): boolean; + setCustomValidity(error: string): void; +} + +interface XMLHttpRequestEventTarget extends EventTarget { + onprogress: (ev: ProgressEvent) => any; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + onerror: (ev: ErrorEvent) => any; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + onload: (ev: any) => any; + addEventListener(type: "load", listener: (ev: any) => any, useCapture?: boolean): void; + ontimeout: (ev: any) => any; + addEventListener(type: "timeout", listener: (ev: any) => any, useCapture?: boolean): void; + onabort: (ev: any) => any; + addEventListener(type: "abort", listener: (ev: any) => any, useCapture?: boolean): void; + onloadstart: (ev: any) => any; + addEventListener(type: "loadstart", listener: (ev: any) => any, useCapture?: boolean): void; + onloadend: (ev: ProgressEvent) => any; + addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var XMLHttpRequestEventTarget: { + prototype: XMLHttpRequestEventTarget; + new(): XMLHttpRequestEventTarget; +} + +interface IDBEnvironment { + msIndexedDB: IDBFactory; + indexedDB: IDBFactory; +} + +interface AudioTrackList extends EventTarget { + length: number; + onchange: (ev: any) => any; + addEventListener(type: "change", listener: (ev: any) => any, useCapture?: boolean): void; + onaddtrack: (ev: TrackEvent) => any; + addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; + getTrackById(id: string): AudioTrack; + item(index: number): AudioTrack; + [index: number]: AudioTrack; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var AudioTrackList: { + prototype: AudioTrackList; + new(): AudioTrackList; +} + +interface MSBaseReader extends EventTarget { + onprogress: (ev: ProgressEvent) => any; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + readyState: number; + onabort: (ev: any) => any; + addEventListener(type: "abort", listener: (ev: any) => any, useCapture?: boolean): void; + onloadend: (ev: ProgressEvent) => any; + addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + onerror: (ev: ErrorEvent) => any; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + onload: (ev: any) => any; + addEventListener(type: "load", listener: (ev: any) => any, useCapture?: boolean): void; + onloadstart: (ev: any) => any; + addEventListener(type: "loadstart", listener: (ev: any) => any, useCapture?: boolean): void; + result: any; + abort(): void; + LOADING: number; + EMPTY: number; + DONE: number; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} + +interface History { + state: any; + replaceState(statedata: any, title: string, url?: string): void; + pushState(statedata: any, title: string, url?: string): void; +} + +interface MSProtocol { + protocol: string; +} +declare var MSProtocol: { + prototype: MSProtocol; + new(): MSProtocol; +} + +interface SVGFEMorphologyElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + operator: SVGAnimatedEnumeration; + radiusX: SVGAnimatedNumber; + radiusY: SVGAnimatedNumber; + in1: SVGAnimatedString; + SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; + SVG_MORPHOLOGY_OPERATOR_ERODE: number; + SVG_MORPHOLOGY_OPERATOR_DILATE: number; +} +declare var SVGFEMorphologyElement: { + prototype: SVGFEMorphologyElement; + new(): SVGFEMorphologyElement; + SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; + SVG_MORPHOLOGY_OPERATOR_ERODE: number; + SVG_MORPHOLOGY_OPERATOR_DILATE: number; +} + +interface HTMLSelectElement { + validationMessage: string; + autofocus: boolean; + validity: ValidityState; + required: boolean; + willValidate: boolean; + checkValidity(): boolean; + setCustomValidity(error: string): void; +} + +interface CSSTransitionsProperties { + transition: string; + transitionDelay: string; + transitionDuration: string; + msTransitionTimingFunction: string; + msTransition: string; + msTransitionDuration: string; + transitionTimingFunction: string; + msTransitionDelay: string; + transitionProperty: string; + msTransitionProperty: string; +} + +interface SVGFEFuncRElement extends SVGComponentTransferFunctionElement { +} +declare var SVGFEFuncRElement: { + prototype: SVGFEFuncRElement; + new(): SVGFEFuncRElement; +} + +interface CSSRule { + KEYFRAMES_RULE: number; + KEYFRAME_RULE: number; + VIEWPORT_RULE: number; +} +//declare var CSSRule: { +// KEYFRAMES_RULE: number; +// KEYFRAME_RULE: number; +// VIEWPORT_RULE: number; +//} + +interface WindowTimersExtension { + msSetImmediate(expression: any, ...args: any[]): number; + clearImmediate(handle: number): void; + msClearImmediate(handle: number): void; + setImmediate(expression: any, ...args: any[]): number; +} + +interface SVGFEDisplacementMapElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in2: SVGAnimatedString; + xChannelSelector: SVGAnimatedEnumeration; + yChannelSelector: SVGAnimatedEnumeration; + scale: SVGAnimatedNumber; + in1: SVGAnimatedString; + SVG_CHANNEL_B: number; + SVG_CHANNEL_R: number; + SVG_CHANNEL_G: number; + SVG_CHANNEL_UNKNOWN: number; + SVG_CHANNEL_A: number; +} +declare var SVGFEDisplacementMapElement: { + prototype: SVGFEDisplacementMapElement; + new(): SVGFEDisplacementMapElement; + SVG_CHANNEL_B: number; + SVG_CHANNEL_R: number; + SVG_CHANNEL_G: number; + SVG_CHANNEL_UNKNOWN: number; + SVG_CHANNEL_A: number; +} + +interface MSCSSContentZoomProperties { + msContentZoomLimit: string; + msContentZooming: string; + msContentZoomSnapType: string; + msContentZoomLimitMax: any; + msContentZoomSnapPoints: string; + msContentZoomSnap: string; + msContentZoomLimitMin: any; + msContentZoomChaining: string; +} + +interface AnimationEvent extends Event { + animationName: string; + elapsedTime: number; + initAnimationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, animationNameArg: string, elapsedTimeArg: number): void; +} +declare var AnimationEvent: { + prototype: AnimationEvent; + new(): AnimationEvent; +} + +interface SVGComponentTransferFunctionElement extends SVGElement { + tableValues: SVGAnimatedNumberList; + slope: SVGAnimatedNumber; + type: SVGAnimatedEnumeration; + exponent: SVGAnimatedNumber; + amplitude: SVGAnimatedNumber; + intercept: SVGAnimatedNumber; + offset: SVGAnimatedNumber; + SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; + SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; + SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; + SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; + SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; + SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; +} +declare var SVGComponentTransferFunctionElement: { + prototype: SVGComponentTransferFunctionElement; + new(): SVGComponentTransferFunctionElement; + SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; + SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; + SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; + SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; + SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; + SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; +} + +interface MSRangeCollection { + length: number; + item(index: number): Range; + [index: number]: Range; +} +declare var MSRangeCollection: { + prototype: MSRangeCollection; + new(): MSRangeCollection; +} + +interface MSHTMLElementExtensions { + onmscontentzoom: (ev: any) => any; + addEventListener(type: "mscontentzoom", listener: (ev: any) => any, useCapture?: boolean): void; + onmsmanipulationstatechanged: (ev: any) => any; + addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; +} +declare var MSHTMLElementExtensions: { + prototype: MSHTMLElementExtensions; + new(): MSHTMLElementExtensions; +} + +interface MSCSSPositionedFloatsProperties { + msWrapMargin: any; + msWrapFlow: string; +} + +interface SVGException { + name: string; +} + +interface SVGFEDistantLightElement extends SVGElement { + azimuth: SVGAnimatedNumber; + elevation: SVGAnimatedNumber; +} +declare var SVGFEDistantLightElement: { + prototype: SVGFEDistantLightElement; + new(): SVGFEDistantLightElement; +} + +interface MSCSSRegionProperties { + msFlowFrom: string; + msFlowInto: string; + msWrapThrough: string; +} + +interface SVGFEFuncBElement extends SVGComponentTransferFunctionElement { +} +declare var SVGFEFuncBElement: { + prototype: SVGFEFuncBElement; + new(): SVGFEFuncBElement; +} + +interface IDBKeyRange { + upper: any; + upperOpen: boolean; + lower: any; + lowerOpen: boolean; + bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange; + only(value: any): IDBKeyRange; + lowerBound(bound: any, open?: boolean): IDBKeyRange; + upperBound(bound: any, open?: boolean): IDBKeyRange; +} +declare var IDBKeyRange: { + prototype: IDBKeyRange; + new (): IDBKeyRange; +} + +interface WindowConsole { + console: Console; +} + +interface SVG1_1Properties { + floodOpacity: string; + floodColor: string; + filter: string; + lightingColor: string; + enableBackground: string; + colorInterpolationFilters: string; +} +declare var SVG1_1Properties: { + prototype: SVG1_1Properties; + new(): SVG1_1Properties; +} + +interface IDBTransaction extends EventTarget { + oncomplete: (ev: Event) => any; + addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; + db: IDBDatabase; + mode: string; + error: DOMError; + onerror: (ev: ErrorEvent) => any; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + onabort: (ev: any) => any; + addEventListener(type: "abort", listener: (ev: any) => any, useCapture?: boolean): void; + abort(): void; + objectStore(name: string): IDBObjectStore; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var IDBTransaction: { + prototype: IDBTransaction; + new(): IDBTransaction; +} + +interface MSWindowExtensions { + onmspointerdown: (ev: any) => any; + addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; + onmspointercancel: (ev: any) => any; + addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; + onmsgesturedoubletap: (ev: any) => any; + addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; + onmsgestureend: (ev: any) => any; + addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; + onmsgesturetap: (ev: any) => any; + addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; + onmspointerout: (ev: any) => any; + addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; + onmspointerhover: (ev: any) => any; + addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; + onmsinertiastart: (ev: any) => any; + addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; + onmspointermove: (ev: any) => any; + addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; + onmsgesturehold: (ev: any) => any; + addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; + onmspointerover: (ev: any) => any; + addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; + onmsgesturechange: (ev: any) => any; + addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; + onmsgesturestart: (ev: any) => any; + addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; + onmspointerup: (ev: any) => any; + addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; + msIsStaticHTML(html: string): boolean; +} +declare var MSWindowExtensions: { + prototype: MSWindowExtensions; + new(): MSWindowExtensions; +} + +interface AudioTrack { + kind: string; + language: string; + id: string; + label: string; + enabled: boolean; +} +declare var AudioTrack: { + prototype: AudioTrack; + new(): AudioTrack; +} + +interface SVGFEConvolveMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + orderY: SVGAnimatedInteger; + kernelUnitLengthY: SVGAnimatedNumber; + orderX: SVGAnimatedInteger; + preserveAlpha: SVGAnimatedBoolean; + kernelMatrix: SVGAnimatedNumberList; + edgeMode: SVGAnimatedEnumeration; + kernelUnitLengthX: SVGAnimatedNumber; + bias: SVGAnimatedNumber; + targetX: SVGAnimatedInteger; + targetY: SVGAnimatedInteger; + divisor: SVGAnimatedNumber; + in1: SVGAnimatedString; + SVG_EDGEMODE_WRAP: number; + SVG_EDGEMODE_DUPLICATE: number; + SVG_EDGEMODE_UNKNOWN: number; + SVG_EDGEMODE_NONE: number; +} +declare var SVGFEConvolveMatrixElement: { + prototype: SVGFEConvolveMatrixElement; + new(): SVGFEConvolveMatrixElement; + SVG_EDGEMODE_WRAP: number; + SVG_EDGEMODE_DUPLICATE: number; + SVG_EDGEMODE_UNKNOWN: number; + SVG_EDGEMODE_NONE: number; +} + +interface TextTrackCueList { + length: number; + item(index: number): TextTrackCue; + [index: number]: TextTrackCue; + getCueById(id: string): TextTrackCue; +} +declare var TextTrackCueList: { + prototype: TextTrackCueList; + new(): TextTrackCueList; +} + +interface CSSKeyframesRule extends CSSRule { + name: string; + cssRules: CSSRuleList; + findRule(rule: string): CSSKeyframeRule; + deleteRule(rule: string): void; + appendRule(rule: string): void; +} +declare var CSSKeyframesRule: { + prototype: CSSKeyframesRule; + new(): CSSKeyframesRule; +} + +interface MSCSSTouchManipulationProperties { + msScrollSnapPointsY: string; + msOverflowStyle: string; + msScrollLimitXMax: any; + msScrollSnapType: string; + msScrollSnapPointsX: string; + msScrollLimitYMax: any; + msScrollSnapY: string; + msScrollLimitXMin: any; + msScrollLimitYMin: any; + msScrollChaining: string; + msTouchAction: string; + msScrollSnapX: string; + msScrollLimit: string; + msScrollRails: string; + msTouchSelect: string; +} + +interface Window extends WindowAnimationTiming, WindowBase64, IDBEnvironment, WindowConsole { + onpopstate: (ev: PopStateEvent) => any; + addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; + applicationCache: ApplicationCache; + matchMedia(mediaQuery: string): MediaQueryList; + msMatchMedia(mediaQuery: string): MediaQueryList; +} + +interface SVGFETurbulenceElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + baseFrequencyX: SVGAnimatedNumber; + numOctaves: SVGAnimatedInteger; + type: SVGAnimatedEnumeration; + baseFrequencyY: SVGAnimatedNumber; + stitchTiles: SVGAnimatedEnumeration; + seed: SVGAnimatedNumber; + SVG_STITCHTYPE_UNKNOWN: number; + SVG_STITCHTYPE_NOSTITCH: number; + SVG_TURBULENCE_TYPE_UNKNOWN: number; + SVG_TURBULENCE_TYPE_TURBULENCE: number; + SVG_TURBULENCE_TYPE_FRACTALNOISE: number; + SVG_STITCHTYPE_STITCH: number; +} +declare var SVGFETurbulenceElement: { + prototype: SVGFETurbulenceElement; + new(): SVGFETurbulenceElement; + SVG_STITCHTYPE_UNKNOWN: number; + SVG_STITCHTYPE_NOSTITCH: number; + SVG_TURBULENCE_TYPE_UNKNOWN: number; + SVG_TURBULENCE_TYPE_TURBULENCE: number; + SVG_TURBULENCE_TYPE_FRACTALNOISE: number; + SVG_STITCHTYPE_STITCH: number; +} + +interface TextTrackList { + length: number; + item(index: number): TextTrack; + [index: number]: TextTrack; +} +declare var TextTrackList: { + prototype: TextTrackList; + new(): TextTrackList; +} + +interface WindowAnimationTiming { + animationStartTime: number; + msAnimationStartTime: number; + msCancelRequestAnimationFrame(handle: number): void; + cancelAnimationFrame(handle: number): void; + requestAnimationFrame(callback: FrameRequestCallback): number; + msRequestAnimationFrame(callback: FrameRequestCallback): number; +} + +interface SVGFEFuncGElement extends SVGComponentTransferFunctionElement { +} +declare var SVGFEFuncGElement: { + prototype: SVGFEFuncGElement; + new(): SVGFEFuncGElement; +} + +interface SVGFEColorMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; + type: SVGAnimatedEnumeration; + values: SVGAnimatedNumberList; + SVG_FECOLORMATRIX_TYPE_SATURATE: number; + SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; + SVG_FECOLORMATRIX_TYPE_MATRIX: number; + SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; + SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; +} +declare var SVGFEColorMatrixElement: { + prototype: SVGFEColorMatrixElement; + new(): SVGFEColorMatrixElement; + SVG_FECOLORMATRIX_TYPE_SATURATE: number; + SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; + SVG_FECOLORMATRIX_TYPE_MATRIX: number; + SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; + SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; +} + +interface Console { + info(): void; + info(message: any, ...optionalParams: any[]): void; + profile(reportName?: string): boolean; + assert(): void; + assert(test: boolean): void; + assert(test: boolean, message: any, ...optionalParams: any[]): void; + msIsIndependentlyComposed(element: Element): boolean; + clear(): boolean; + dir(): boolean; + dir(value: any, ...optionalParams: any[]): boolean; + warn(): void; + warn(message: any, ...optionalParams: any[]): void; + error(): void; + error(message: any, ...optionalParams: any[]): void; + log(): void; + log(message: any, ...optionalParams: any[]): void; + profileEnd(): boolean; +} +declare var Console: { + prototype: Console; + new(): Console; +} + +interface SVGFESpotLightElement extends SVGElement { + pointsAtY: SVGAnimatedNumber; + y: SVGAnimatedNumber; + limitingConeAngle: SVGAnimatedNumber; + specularExponent: SVGAnimatedNumber; + x: SVGAnimatedNumber; + pointsAtZ: SVGAnimatedNumber; + z: SVGAnimatedNumber; + pointsAtX: SVGAnimatedNumber; +} +declare var SVGFESpotLightElement: { + prototype: SVGFESpotLightElement; + new(): SVGFESpotLightElement; +} + +interface DocumentVisibility { + msHidden: boolean; + msVisibilityState: string; + visibilityState: string; + hidden: boolean; +} + +interface WindowBase64 { + btoa(rawString: string): string; + atob(encodedString: string): string; +} + +interface IDBDatabase extends EventTarget { + version: string; + name: string; + objectStoreNames: DOMStringList; + onerror: (ev: ErrorEvent) => any; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + onabort: (ev: any) => any; + addEventListener(type: "abort", listener: (ev: any) => any, useCapture?: boolean): void; + createObjectStore(name: string, optionalParameters?: any): IDBObjectStore; + close(): void; + transaction(storeNames: any, mode?: string): IDBTransaction; + deleteObjectStore(name: string): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var IDBDatabase: { + prototype: IDBDatabase; + new(): IDBDatabase; +} + +interface MSProtocolsCollection { +} +declare var MSProtocolsCollection: { + prototype: MSProtocolsCollection; + new(): MSProtocolsCollection; +} + +interface DOMStringList { + length: number; + contains(str: string): boolean; + item(index: number): string; + [index: number]: string; +} +declare var DOMStringList: { + prototype: DOMStringList; + new(): DOMStringList; +} + +interface CSSMultiColumnProperties { + breakAfter: string; + columnSpan: string; + columnRule: string; + columnFill: string; + columnRuleStyle: string; + breakBefore: string; + columnCount: any; + breakInside: string; + columnWidth: any; + columns: string; + columnRuleColor: any; + columnGap: any; + columnRuleWidth: any; +} + +interface IDBOpenDBRequest extends IDBRequest { + onupgradeneeded: (ev: IDBVersionChangeEvent) => any; + addEventListener(type: "upgradeneeded", listener: (ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void; + onblocked: (ev: Event) => any; + addEventListener(type: "blocked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var IDBOpenDBRequest: { + prototype: IDBOpenDBRequest; + new(): IDBOpenDBRequest; +} + +interface HTMLButtonElement { + validationMessage: string; + formTarget: string; + willValidate: boolean; + formAction: string; + autofocus: boolean; + validity: ValidityState; + formNoValidate: string; + formEnctype: string; + formMethod: string; + checkValidity(): boolean; + setCustomValidity(error: string): void; +} + +interface HTMLProgressElement extends HTMLElement { + value: number; + max: number; + position: number; + form: HTMLFormElement; +} +declare var HTMLProgressElement: { + prototype: HTMLProgressElement; + new(): HTMLProgressElement; +} + +interface SVGFEOffsetElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + dy: SVGAnimatedNumber; + in1: SVGAnimatedString; + dx: SVGAnimatedNumber; +} +declare var SVGFEOffsetElement: { + prototype: SVGFEOffsetElement; + new(): SVGFEOffsetElement; +} + +interface HTMLFormElement { + autocomplete: string; + noValidate: boolean; + checkValidity(): boolean; +} + +interface MSUnsafeFunctionCallback { + (): any; +} + +interface Document extends DocumentVisibility { +} + +interface MessageEvent extends Event { + ports: any; +} + +interface HTMLScriptElement { + async: boolean; +} + +interface HTMLMediaElement extends MSHTMLMediaElementExtensions { + textTracks: TextTrackList; + audioTracks: AudioTrackList; +} + +interface TextTrack extends EventTarget { + language: string; + mode: number; + readyState: string; + activeCues: TextTrackCueList; + cues: TextTrackCueList; + oncuechange: (ev: Event) => any; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + kind: string; + onload: (ev: any) => any; + addEventListener(type: "load", listener: (ev: any) => any, useCapture?: boolean): void; + onerror: (ev: ErrorEvent) => any; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + label: string; + ERROR: number; + SHOWING: number; + LOADING: number; + LOADED: number; + NONE: number; + HIDDEN: number; + DISABLED: number; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var TextTrack: { + prototype: TextTrack; + new(): TextTrack; + ERROR: number; + SHOWING: number; + LOADING: number; + LOADED: number; + NONE: number; + HIDDEN: number; + DISABLED: number; +} + +interface MediaQueryListListener { + (mql: MediaQueryList): void; +} + +interface IDBRequest extends EventTarget { + source: any; + onsuccess: (ev: Event) => any; + addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; + error: DOMError; + transaction: IDBTransaction; + onerror: (ev: ErrorEvent) => any; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + readyState: string; + result: any; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var IDBRequest: { + prototype: IDBRequest; + new(): IDBRequest; +} + +interface MessagePort extends EventTarget { + onmessage: (ev: any) => any; + addEventListener(type: "message", listener: (ev: any) => any, useCapture?: boolean): void; + close(): void; + postMessage(message: any, ports?: any): void; + start(): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var MessagePort: { + prototype: MessagePort; + new(): MessagePort; +} + +interface FileReader extends MSBaseReader { + error: DOMError; + readAsArrayBuffer(blob: Blob): void; + readAsDataURL(blob: Blob): void; + readAsText(blob: Blob, encoding?: string): void; +} +declare var FileReader: { + prototype: FileReader; + new (): FileReader; +} + +interface Blob { + type: string; + size: number; + msDetachStream(): any; + slice(start?: number, end?: number, contentType?: string): Blob; + close(): void; + msClose(): void; +} +interface BlobPropertyBag { + /** Corresponds to the 'type' property of the Blob object */ + type?: string; + /** Either 'transparent' or 'native' */ + endings?: string; +} +declare var Blob: { + prototype: Blob; + new (blobParts?: any[], options?: BlobPropertyBag): Blob; +} + +interface ApplicationCache extends EventTarget { + status: number; + ondownloading: (ev: Event) => any; + addEventListener(type: "downloading", listener: (ev: Event) => any, useCapture?: boolean): void; + onprogress: (ev: ProgressEvent) => any; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + onupdateready: (ev: Event) => any; + addEventListener(type: "updateready", listener: (ev: Event) => any, useCapture?: boolean): void; + oncached: (ev: Event) => any; + addEventListener(type: "cached", listener: (ev: Event) => any, useCapture?: boolean): void; + onobsolete: (ev: Event) => any; + addEventListener(type: "obsolete", listener: (ev: Event) => any, useCapture?: boolean): void; + onerror: (ev: ErrorEvent) => any; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + onchecking: (ev: Event) => any; + addEventListener(type: "checking", listener: (ev: Event) => any, useCapture?: boolean): void; + onnoupdate: (ev: Event) => any; + addEventListener(type: "noupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + swapCache(): void; + abort(): void; + update(): void; + CHECKING: number; + UNCACHED: number; + UPDATEREADY: number; + DOWNLOADING: number; + IDLE: number; + OBSOLETE: number; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var ApplicationCache: { + prototype: ApplicationCache; + new(): ApplicationCache; + CHECKING: number; + UNCACHED: number; + UPDATEREADY: number; + DOWNLOADING: number; + IDLE: number; + OBSOLETE: number; +} + +interface MSHTMLVideoElementExtensions { + msIsStereo3D: boolean; + msStereo3DPackingMode: string; + onMSVideoOptimalLayoutChanged: (ev: any) => any; + addEventListener(type: "MSVideoOptimalLayoutChanged", listener: (ev: any) => any, useCapture?: boolean): void; + onMSVideoFrameStepCompleted: (ev: any) => any; + addEventListener(type: "MSVideoFrameStepCompleted", listener: (ev: any) => any, useCapture?: boolean): void; + msStereo3DRenderMode: string; + msIsLayoutOptimalForPlayback: boolean; + msHorizontalMirror: boolean; + onMSVideoFormatChanged: (ev: any) => any; + addEventListener(type: "MSVideoFormatChanged", listener: (ev: any) => any, useCapture?: boolean): void; + msZoom: boolean; + msInsertVideoEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; + msSetVideoRectangle(left: number, top: number, right: number, bottom: number): void; + msFrameStep(forward: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} + +interface FrameRequestCallback { + (time: number): void; +} + +interface CSS3DTransformsProperties { + perspective: string; + msBackfaceVisibility: string; + perspectiveOrigin: string; + transformStyle: string; + backfaceVisibility: string; + msPerspectiveOrigin: string; + msTransformStyle: string; + msPerspective: string; +} + +interface XMLHttpRequest { + withCredentials: boolean; +} + +interface PopStateEvent extends Event { + state: any; + initPopStateEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, stateArg: any): void; +} +declare var PopStateEvent: { + prototype: PopStateEvent; + new(): PopStateEvent; +} + +interface CSSKeyframeRule extends CSSRule { + keyText: string; + style: CSSStyleDeclaration; +} +declare var CSSKeyframeRule: { + prototype: CSSKeyframeRule; + new(): CSSKeyframeRule; +} + +interface CSSGridProperties { + msGridRows: string; + msGridColumnSpan: any; + msGridRow: any; + msGridRowSpan: any; + msGridColumns: string; + msGridColumnAlign: string; + msGridRowAlign: string; + msGridColumn: any; +} + +interface MSFileSaver { + msSaveBlob(blob: any, defaultName?: string): boolean; + msSaveOrOpenBlob(blob: any, defaultName?: string): boolean; +} + +interface MSStream { + type: string; + msDetachStream(): any; + msClose(): void; +} +declare var MSStream: { + prototype: MSStream; + new(): MSStream; +} + +interface MediaError extends MSMediaErrorExtensions { +} + +interface HTMLFieldSetElement { + validationMessage: string; + validity: ValidityState; + willValidate: boolean; + checkValidity(): boolean; + setCustomValidity(error: string): void; +} + +interface MSBlobBuilder { + append(data: any, endings?: string): void; + getBlob(contentType?: string): Blob; +} +declare var MSBlobBuilder: { + prototype: MSBlobBuilder; + new (): MSBlobBuilder; +} + +interface MSRangeExtensions { + createContextualFragment(fragment: string): DocumentFragment; +} + +interface HTMLElement { + oncuechange: (ev: Event) => any; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + spellcheck: boolean; + classList: DOMTokenList; + draggable: boolean; +} + +interface DataTransfer { + types: DOMStringList; + files: FileList; +} + +interface DOMSettableTokenList extends DOMTokenList { + value: string; +} +declare var DOMSettableTokenList: { + prototype: DOMSettableTokenList; + new(): DOMSettableTokenList; +} + +interface IDBFactory { + open(name: string, version?: number): IDBOpenDBRequest; + cmp(first: any, second: any): number; + deleteDatabase(name: string): IDBOpenDBRequest; +} +declare var IDBFactory: { + prototype: IDBFactory; + new(): IDBFactory; +} + +interface Range extends MSRangeExtensions { +} + +interface HTMLObjectElement { + validationMessage: string; + validity: ValidityState; + willValidate: boolean; + checkValidity(): boolean; + setCustomValidity(error: string): void; +} + +interface MSPointerEvent extends MouseEvent { + width: number; + rotation: number; + pressure: number; + pointerType: number; + isPrimary: boolean; + tiltY: number; + height: number; + intermediatePoints: any; + currentPoint: any; + tiltX: number; + hwTimestamp: number; + pointerId: number; + initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: AbstractView, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: number, hwTimestampArg: number, isPrimary: boolean): void; + getCurrentPoint(element: Element): void; + getIntermediatePoints(element: Element): void; + MSPOINTER_TYPE_PEN: number; + MSPOINTER_TYPE_MOUSE: number; + MSPOINTER_TYPE_TOUCH: number; +} +declare var MSPointerEvent: { + prototype: MSPointerEvent; + new(): MSPointerEvent; + MSPOINTER_TYPE_PEN: number; + MSPOINTER_TYPE_MOUSE: number; + MSPOINTER_TYPE_TOUCH: number; +} + +interface CSSTextProperties { + textShadow: string; + msHyphenateLimitLines: any; + msHyphens: string; + msHyphenateLimitChars: string; + msHyphenateLimitZone: any; +} + +interface CSS2DTransformsProperties { + transform: string; + transformOrigin: string; +} + +interface DOMException { + name: string; + INVALID_NODE_TYPE_ERR: number; + DATA_CLONE_ERR: number; + TIMEOUT_ERR: number; +} +//declare var DOMException: { +// INVALID_NODE_TYPE_ERR: number; +// DATA_CLONE_ERR: number; +// TIMEOUT_ERR: number; +//} + +interface MSCSSHighContrastProperties { + msHighContrastAdjust: string; +} + +interface MSManipulationEvent extends UIEvent { + lastState: number; + currentState: number; + initMSManipulationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: AbstractView, detailArg: number, lastState: number, currentState: number): void; + MS_MANIPULATION_STATE_STOPPED: number; + MS_MANIPULATION_STATE_ACTIVE: number; + MS_MANIPULATION_STATE_INERTIA: number; +} +declare var MSManipulationEvent: { + prototype: MSManipulationEvent; + new(): MSManipulationEvent; + MS_MANIPULATION_STATE_STOPPED: number; + MS_MANIPULATION_STATE_ACTIVE: number; + MS_MANIPULATION_STATE_INERTIA: number; +} + +interface FormData { + append(name: any, value: any, blobName?: string): void; +} +declare var FormData: { + prototype: FormData; + new (form?: HTMLFormElement): FormData; +} + +interface MSHTMLImageElementExtensions { + msPlayToPrimary: boolean; + msPlayToDisabled: boolean; + msPlayToSource: any; +} +declare var MSHTMLImageElementExtensions: { + prototype: MSHTMLImageElementExtensions; + new(): MSHTMLImageElementExtensions; +} + +interface MSHTMLMediaElementExtensions { + msAudioCategory: string; + msRealTime: boolean; + msPlayToPrimary: boolean; + msPlayToDisabled: boolean; + msPlayToSource: any; + msAudioDeviceType: string; + msClearEffects(): void; + msSetMediaProtectionManager(mediaProtectionManager?: any): void; + msInsertAudioEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; +} + +interface SVGFEImageElement extends SVGElement, SVGLangSpace, SVGFilterPrimitiveStandardAttributes, SVGURIReference { + preserveAspectRatio: SVGAnimatedPreserveAspectRatio; +} +declare var SVGFEImageElement: { + prototype: SVGFEImageElement; + new(): SVGFEImageElement; +} + +interface HTMLDataListElement extends HTMLElement { + options: HTMLCollection; +} +declare var HTMLDataListElement: { + prototype: HTMLDataListElement; + new(): HTMLDataListElement; +} + +interface AbstractWorker extends EventTarget { + onerror: (ev: ErrorEvent) => any; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} + +interface SVGFECompositeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + operator: SVGAnimatedEnumeration; + in2: SVGAnimatedString; + k2: SVGAnimatedNumber; + k1: SVGAnimatedNumber; + k3: SVGAnimatedNumber; + in1: SVGAnimatedString; + k4: SVGAnimatedNumber; + SVG_FECOMPOSITE_OPERATOR_OUT: number; + SVG_FECOMPOSITE_OPERATOR_OVER: number; + SVG_FECOMPOSITE_OPERATOR_XOR: number; + SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; + SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; + SVG_FECOMPOSITE_OPERATOR_IN: number; + SVG_FECOMPOSITE_OPERATOR_ATOP: number; +} +declare var SVGFECompositeElement: { + prototype: SVGFECompositeElement; + new(): SVGFECompositeElement; + SVG_FECOMPOSITE_OPERATOR_OUT: number; + SVG_FECOMPOSITE_OPERATOR_OVER: number; + SVG_FECOMPOSITE_OPERATOR_XOR: number; + SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; + SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; + SVG_FECOMPOSITE_OPERATOR_IN: number; + SVG_FECOMPOSITE_OPERATOR_ATOP: number; +} + +interface ValidityState { + customError: boolean; + valueMissing: boolean; + stepMismatch: boolean; + rangeUnderflow: boolean; + rangeOverflow: boolean; + typeMismatch: boolean; + patternMismatch: boolean; + tooLong: boolean; + valid: boolean; +} +declare var ValidityState: { + prototype: ValidityState; + new(): ValidityState; +} + +interface HTMLVideoElement extends MSHTMLVideoElementExtensions { +} + +interface HTMLTrackElement extends HTMLElement { + kind: string; + src: string; + srclang: string; + track: TextTrack; + label: string; + defaul: boolean; +} +declare var HTMLTrackElement: { + prototype: HTMLTrackElement; + new(): HTMLTrackElement; +} + +interface MSApp { + createFileFromStorageFile(storageFile: any): File; + createBlobFromRandomAccessStream(type: string, seeker: any): Blob; + createStreamFromInputStream(type: string, inputStream: any): MSStream; + terminateApp(exceptionObject: any): void; + createDataPackage(object: any): any; + execUnsafeLocalFunction(unsafeFunction: MSUnsafeFunctionCallback): any; + getHtmlPrintDocumentSource(htmlDoc: any, printTemplate?: string): any; + addPublicLocalApplicationUri(uri: string): void; + createDataPackageFromSelection(): any; +} +declare var MSApp: MSApp; + +interface MSXMLHttpRequestExtensions { + response: any; + onprogress: (ev: ProgressEvent) => any; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + onabort: (ev: any) => any; + addEventListener(type: "abort", listener: (ev: any) => any, useCapture?: boolean): void; + responseType: string; + onloadend: (ev: ProgressEvent) => any; + addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + upload: XMLHttpRequestEventTarget; + onerror: (ev: ErrorEvent) => any; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + onloadstart: (ev: any) => any; + addEventListener(type: "loadstart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var MSXMLHttpRequestExtensions: { + prototype: MSXMLHttpRequestExtensions; + new(): MSXMLHttpRequestExtensions; +} + +interface SVGFEDiffuseLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + kernelUnitLengthY: SVGAnimatedNumber; + surfaceScale: SVGAnimatedNumber; + in1: SVGAnimatedString; + kernelUnitLengthX: SVGAnimatedNumber; + diffuseConstant: SVGAnimatedNumber; +} +declare var SVGFEDiffuseLightingElement: { + prototype: SVGFEDiffuseLightingElement; + new(): SVGFEDiffuseLightingElement; +} + +interface SVGFEComponentTransferElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; +} +declare var SVGFEComponentTransferElement: { + prototype: SVGFEComponentTransferElement; + new(): SVGFEComponentTransferElement; +} + +interface MSCSSMatrix { + m24: number; + m34: number; + a: number; + d: number; + m32: number; + m41: number; + m11: number; + f: number; + e: number; + m23: number; + m14: number; + m33: number; + m22: number; + m21: number; + c: number; + m12: number; + b: number; + m42: number; + m31: number; + m43: number; + m13: number; + m44: number; + multiply(secondMatrix: MSCSSMatrix): MSCSSMatrix; + skewY(angle: number): MSCSSMatrix; + setMatrixValue(value: string): void; + inverse(): MSCSSMatrix; + rotateAxisAngle(x: number, y: number, z: number, angle: number): MSCSSMatrix; + toString(): string; + rotate(angleX: number, angleY?: number, angleZ?: number): MSCSSMatrix; + translate(x: number, y: number, z?: number): MSCSSMatrix; + scale(scaleX: number, scaleY?: number, scaleZ?: number): MSCSSMatrix; + skewX(angle: number): MSCSSMatrix; +} +declare var MSCSSMatrix: { + prototype: MSCSSMatrix; + new (text?: string): MSCSSMatrix; +} + +interface Worker extends AbstractWorker { + onmessage: (ev: any) => any; + addEventListener(type: "message", listener: (ev: any) => any, useCapture?: boolean): void; + postMessage(message: any, ports?: any): void; + terminate(): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var Worker: { + prototype: Worker; + new (stringUrl: string): Worker; +} + +interface HTMLIFrameElement { + sandbox: DOMSettableTokenList; +} + +interface MSMediaErrorExtensions { + msExtendedCode: number; +} + +interface MSNavigatorAbilities { + msProtocols: MSProtocolsCollection; + msMaxTouchPoints: number; + msPointerEnabled: boolean; + msManipulationViewsEnabled: boolean; +} +declare var MSNavigatorAbilities: { + prototype: MSNavigatorAbilities; + new(): MSNavigatorAbilities; +} + +declare var onpopstate: (ev: PopStateEvent) => any; +declare function addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; +declare var applicationCache: ApplicationCache; +declare function matchMedia(mediaQuery: string): MediaQueryList; +declare function msMatchMedia(mediaQuery: string): MediaQueryList; +declare var animationStartTime: number; +declare var msAnimationStartTime: number; +declare function msCancelRequestAnimationFrame(handle: number): void; +declare function cancelAnimationFrame(handle: number): void; +declare function requestAnimationFrame(callback: FrameRequestCallback): number; +declare function msRequestAnimationFrame(callback: FrameRequestCallback): number; +declare function btoa(rawString: string): string; +declare function atob(encodedString: string): string; +declare var msIndexedDB: IDBFactory; +declare var indexedDB: IDBFactory; +declare var console: Console; + + +///////////////////////////// +/// WorkerGlobalScope APIs +///////////////////////////// +// TODO: These are only available in a Web Worker - should be in a separate lib file +declare function importScripts(...urls: string[]): void; + + +///////////////////////////// +/// Windows Script Host APIS +///////////////////////////// +declare var ActiveXObject: { new (s: string): any; }; + +interface ITextWriter { + Write(s: string): void; + WriteLine(s: string): void; + Close(): void; +} + +declare var WScript : { + Echo(s: any); + StdErr: ITextWriter; + StdOut: ITextWriter; + Arguments: { length: number; Item(n: number): string; }; + ScriptFullName: string; + Quit(exitCode?: number); +} diff --git a/_infrastructure/typescript/tsc b/_infrastructure/typescript/tsc new file mode 100644 index 000000000..3c0dab574 --- /dev/null +++ b/_infrastructure/typescript/tsc @@ -0,0 +1,2 @@ +#!/usr/bin/env node +require('./tsc.js') diff --git a/package.json b/package.json index e2b00d192..eaed7a066 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,6 @@ "name": "DefinitelyTyped", "version": "0.0.0", "scripts": { - "test": "node ./_infrastructure/tests/testRunner.js" + "test": "node ./_infrastructure/runner.js" } } From aca02e566adee4a0ffdf524edee6e0ec644d6900 Mon Sep 17 00:00:00 2001 From: Diullei Gomes Date: Thu, 20 Jun 2013 14:59:56 -0300 Subject: [PATCH 20/57] Travis CI script adjusted. Runner.js file added to .gitignore --- .gitignore | 1 + _infrastructure/runner.js | 1058 +++++++++++++++++++++++++++++++++++++ 2 files changed, 1059 insertions(+) create mode 100644 _infrastructure/runner.js diff --git a/.gitignore b/.gitignore index 656f1cda5..a111d5647 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ Properties *~ # test folder +!_infrastructure/*.js !_infrastructure/tests/* !_infrastructure/tests/*.js !_infrastructure/tests/*/*.js diff --git a/_infrastructure/runner.js b/_infrastructure/runner.js new file mode 100644 index 000000000..21be7da7b --- /dev/null +++ b/_infrastructure/runner.js @@ -0,0 +1,1058 @@ +var ExecResult = (function () { + function ExecResult() { + this.stdout = ""; + this.stderr = ""; + } + return ExecResult; +})(); + +var WindowsScriptHostExec = (function () { + function WindowsScriptHostExec() { + } + WindowsScriptHostExec.prototype.exec = function (filename, cmdLineArgs, handleResult) { + var result = new ExecResult(); + var shell = new ActiveXObject('WScript.Shell'); + try { + var process = shell.Exec(filename + ' ' + cmdLineArgs.join(' ')); + } catch (e) { + result.stderr = e.message; + result.exitCode = 1; + handleResult(result); + return; + } + + while (process.Status != 0) { + } + + result.exitCode = process.ExitCode; + if (!process.StdOut.AtEndOfStream) + result.stdout = process.StdOut.ReadAll(); + if (!process.StdErr.AtEndOfStream) + result.stderr = process.StdErr.ReadAll(); + + handleResult(result); + }; + return WindowsScriptHostExec; +})(); + +var NodeExec = (function () { + function NodeExec() { + } + NodeExec.prototype.exec = function (filename, cmdLineArgs, handleResult) { + var nodeExec = require('child_process').exec; + + var result = new ExecResult(); + result.exitCode = null; + var cmdLine = filename + ' ' + cmdLineArgs.join(' '); + + var process = nodeExec(cmdLine, function (error, stdout, stderr) { + result.stdout = stdout; + result.stderr = stderr; + result.exitCode = error ? error.code : 0; + handleResult(result); + }); + }; + return NodeExec; +})(); + +var Exec = (function () { + var global = Function("return this;").call(null); + if (typeof global.ActiveXObject !== "undefined") { + return new WindowsScriptHostExec(); + } else { + return new NodeExec(); + } +})(); +var IOUtils; +(function (IOUtils) { + function createDirectoryStructure(ioHost, dirName) { + if (ioHost.directoryExists(dirName)) { + return; + } + + var parentDirectory = ioHost.dirName(dirName); + if (parentDirectory != "") { + createDirectoryStructure(ioHost, parentDirectory); + } + ioHost.createDirectory(dirName); + } + + function createFileAndFolderStructure(ioHost, fileName, useUTF8) { + var path = ioHost.resolvePath(fileName); + var dirName = ioHost.dirName(path); + createDirectoryStructure(ioHost, dirName); + return ioHost.createFile(path, useUTF8); + } + IOUtils.createFileAndFolderStructure = createFileAndFolderStructure; + + function throwIOError(message, error) { + var errorMessage = message; + if (error && error.message) { + errorMessage += (" " + error.message); + } + throw new Error(errorMessage); + } + IOUtils.throwIOError = throwIOError; +})(IOUtils || (IOUtils = {})); + +var IO = (function () { + function getWindowsScriptHostIO() { + var fso = new ActiveXObject("Scripting.FileSystemObject"); + var streamObjectPool = []; + + function getStreamObject() { + if (streamObjectPool.length > 0) { + return streamObjectPool.pop(); + } else { + return new ActiveXObject("ADODB.Stream"); + } + } + + function releaseStreamObject(obj) { + streamObjectPool.push(obj); + } + + var args = []; + for (var i = 0; i < WScript.Arguments.length; i++) { + args[i] = WScript.Arguments.Item(i); + } + + return { + readFile: function (path) { + try { + var streamObj = getStreamObject(); + streamObj.Open(); + streamObj.Type = 2; + streamObj.Charset = 'x-ansi'; + streamObj.LoadFromFile(path); + var bomChar = streamObj.ReadText(2); + streamObj.Position = 0; + if ((bomChar.charCodeAt(0) == 0xFE && bomChar.charCodeAt(1) == 0xFF) || (bomChar.charCodeAt(0) == 0xFF && bomChar.charCodeAt(1) == 0xFE)) { + streamObj.Charset = 'unicode'; + } else if (bomChar.charCodeAt(0) == 0xEF && bomChar.charCodeAt(1) == 0xBB) { + streamObj.Charset = 'utf-8'; + } + + var str = streamObj.ReadText(-1); + streamObj.Close(); + releaseStreamObject(streamObj); + return str; + } catch (err) { + IOUtils.throwIOError("Error reading file \"" + path + "\".", err); + } + }, + writeFile: function (path, contents) { + var file = this.createFile(path); + file.Write(contents); + file.Close(); + }, + fileExists: function (path) { + return fso.FileExists(path); + }, + resolvePath: function (path) { + return fso.GetAbsolutePathName(path); + }, + dirName: function (path) { + return fso.GetParentFolderName(path); + }, + findFile: function (rootPath, partialFilePath) { + var path = fso.GetAbsolutePathName(rootPath) + "/" + partialFilePath; + + while (true) { + if (fso.FileExists(path)) { + try { + var content = this.readFile(path); + return { content: content, path: path }; + } catch (err) { + } + } else { + rootPath = fso.GetParentFolderName(fso.GetAbsolutePathName(rootPath)); + + if (rootPath == "") { + return null; + } else { + path = fso.BuildPath(rootPath, partialFilePath); + } + } + } + }, + deleteFile: function (path) { + try { + if (fso.FileExists(path)) { + fso.DeleteFile(path, true); + } + } catch (e) { + IOUtils.throwIOError("Couldn't delete file '" + path + "'.", e); + } + }, + createFile: function (path, useUTF8) { + try { + var streamObj = getStreamObject(); + streamObj.Charset = useUTF8 ? 'utf-8' : 'x-ansi'; + streamObj.Open(); + return { + Write: function (str) { + streamObj.WriteText(str, 0); + }, + WriteLine: function (str) { + streamObj.WriteText(str, 1); + }, + Close: function () { + try { + streamObj.SaveToFile(path, 2); + } catch (saveError) { + IOUtils.throwIOError("Couldn't write to file '" + path + "'.", saveError); + } finally { + if (streamObj.State != 0) { + streamObj.Close(); + } + releaseStreamObject(streamObj); + } + } + }; + } catch (creationError) { + IOUtils.throwIOError("Couldn't write to file '" + path + "'.", creationError); + } + }, + directoryExists: function (path) { + return fso.FolderExists(path); + }, + createDirectory: function (path) { + try { + if (!this.directoryExists(path)) { + fso.CreateFolder(path); + } + } catch (e) { + IOUtils.throwIOError("Couldn't create directory '" + path + "'.", e); + } + }, + dir: function (path, spec, options) { + options = options || {}; + function filesInFolder(folder, root) { + var paths = []; + var fc; + + if (options.recursive) { + fc = new Enumerator(folder.subfolders); + + for (; !fc.atEnd(); fc.moveNext()) { + paths = paths.concat(filesInFolder(fc.item(), root + "/" + fc.item().Name)); + } + } + + fc = new Enumerator(folder.files); + + for (; !fc.atEnd(); fc.moveNext()) { + if (!spec || fc.item().Name.match(spec)) { + paths.push(root + "/" + fc.item().Name); + } + } + + return paths; + } + + var folder = fso.GetFolder(path); + var paths = []; + + return filesInFolder(folder, path); + }, + print: function (str) { + WScript.StdOut.Write(str); + }, + printLine: function (str) { + WScript.Echo(str); + }, + arguments: args, + stderr: WScript.StdErr, + stdout: WScript.StdOut, + watchFile: null, + run: function (source, filename) { + try { + eval(source); + } catch (e) { + IOUtils.throwIOError("Error while executing file '" + filename + "'.", e); + } + }, + getExecutingFilePath: function () { + return WScript.ScriptFullName; + }, + quit: function (exitCode) { + if (typeof exitCode === "undefined") { exitCode = 0; } + try { + WScript.Quit(exitCode); + } catch (e) { + } + } + }; + } + ; + + function getNodeIO() { + var _fs = require('fs'); + var _path = require('path'); + var _module = require('module'); + + return { + readFile: function (file) { + try { + var buffer = _fs.readFileSync(file); + switch (buffer[0]) { + case 0xFE: + if (buffer[1] == 0xFF) { + var i = 0; + while ((i + 1) < buffer.length) { + var temp = buffer[i]; + buffer[i] = buffer[i + 1]; + buffer[i + 1] = temp; + i += 2; + } + return buffer.toString("ucs2", 2); + } + break; + case 0xFF: + if (buffer[1] == 0xFE) { + return buffer.toString("ucs2", 2); + } + break; + case 0xEF: + if (buffer[1] == 0xBB) { + return buffer.toString("utf8", 3); + } + } + + return buffer.toString(); + } catch (e) { + IOUtils.throwIOError("Error reading file \"" + file + "\".", e); + } + }, + writeFile: _fs.writeFileSync, + deleteFile: function (path) { + try { + _fs.unlinkSync(path); + } catch (e) { + IOUtils.throwIOError("Couldn't delete file '" + path + "'.", e); + } + }, + fileExists: function (path) { + return _fs.existsSync(path); + }, + createFile: function (path, useUTF8) { + function mkdirRecursiveSync(path) { + var stats = _fs.statSync(path); + if (stats.isFile()) { + IOUtils.throwIOError("\"" + path + "\" exists but isn't a directory.", null); + } else if (stats.isDirectory()) { + return; + } else { + mkdirRecursiveSync(_path.dirname(path)); + _fs.mkdirSync(path, 0775); + } + } + + mkdirRecursiveSync(_path.dirname(path)); + + try { + var fd = _fs.openSync(path, 'w'); + } catch (e) { + IOUtils.throwIOError("Couldn't write to file '" + path + "'.", e); + } + return { + Write: function (str) { + _fs.writeSync(fd, str); + }, + WriteLine: function (str) { + _fs.writeSync(fd, str + '\r\n'); + }, + Close: function () { + _fs.closeSync(fd); + fd = null; + } + }; + }, + dir: function dir(path, spec, options) { + options = options || {}; + + function filesInFolder(folder, deep) { + var paths = []; + + var files = _fs.readdirSync(folder); + for (var i = 0; i < files.length; i++) { + var stat = _fs.statSync(folder + "/" + files[i]); + if (options.recursive && stat.isDirectory()) { + if (deep < (options.deep || 100)) { + paths = paths.concat(filesInFolder(folder + "/" + files[i], 1)); + } + } else if (stat.isFile() && (!spec || files[i].match(spec))) { + paths.push(folder + "/" + files[i]); + } + } + + return paths; + } + + return filesInFolder(path, 0); + }, + createDirectory: function (path) { + try { + if (!this.directoryExists(path)) { + _fs.mkdirSync(path); + } + } catch (e) { + IOUtils.throwIOError("Couldn't create directory '" + path + "'.", e); + } + }, + directoryExists: function (path) { + return _fs.existsSync(path) && _fs.lstatSync(path).isDirectory(); + }, + resolvePath: function (path) { + return _path.resolve(path); + }, + dirName: function (path) { + return _path.dirname(path); + }, + findFile: function (rootPath, partialFilePath) { + var path = rootPath + "/" + partialFilePath; + + while (true) { + if (_fs.existsSync(path)) { + try { + var content = this.readFile(path); + return { content: content, path: path }; + } catch (err) { + } + } else { + var parentPath = _path.resolve(rootPath, ".."); + + if (rootPath === parentPath) { + return null; + } else { + rootPath = parentPath; + path = _path.resolve(rootPath, partialFilePath); + } + } + } + }, + print: function (str) { + process.stdout.write(str); + }, + printLine: function (str) { + process.stdout.write(str + '\n'); + }, + arguments: process.argv.slice(2), + stderr: { + Write: function (str) { + process.stderr.write(str); + }, + WriteLine: function (str) { + process.stderr.write(str + '\n'); + }, + Close: function () { + } + }, + stdout: { + Write: function (str) { + process.stdout.write(str); + }, + WriteLine: function (str) { + process.stdout.write(str + '\n'); + }, + Close: function () { + } + }, + watchFile: function (filename, callback) { + var firstRun = true; + var processingChange = false; + + var fileChanged = function (curr, prev) { + if (!firstRun) { + if (curr.mtime < prev.mtime) { + return; + } + + _fs.unwatchFile(filename, fileChanged); + if (!processingChange) { + processingChange = true; + callback(filename); + setTimeout(function () { + processingChange = false; + }, 100); + } + } + firstRun = false; + _fs.watchFile(filename, { persistent: true, interval: 500 }, fileChanged); + }; + + fileChanged(); + return { + filename: filename, + close: function () { + _fs.unwatchFile(filename, fileChanged); + } + }; + }, + run: function (source, filename) { + require.main.filename = filename; + require.main.paths = _module._nodeModulePaths(_path.dirname(_fs.realpathSync(filename))); + require.main._compile(source, filename); + }, + getExecutingFilePath: function () { + return process.mainModule.filename; + }, + quit: process.exit + }; + } + ; + + if (typeof ActiveXObject === "function") + return getWindowsScriptHostIO(); else if (typeof require === "function") + return getNodeIO(); else + return null; +})(); +var DefinitelyTyped; +(function (DefinitelyTyped) { + (function (TestManager) { + var path = require('path'); + + function endsWith(str, suffix) { + return str.indexOf(suffix, str.length - suffix.length) !== -1; + } + + var Iterator = (function () { + function Iterator(list) { + this.list = list; + this.index = -1; + } + Iterator.prototype.next = function () { + this.index++; + return this.list[this.index]; + }; + + Iterator.prototype.hasNext = function () { + return this.list[1 + this.index] != null; + }; + return Iterator; + })(); + + var Tsc = (function () { + function Tsc() { + } + Tsc.run = function (tsfile, callback) { + Exec.exec('node ./_infrastructure/typescript/tsc.js ', [tsfile], function (ExecResult) { + callback(ExecResult); + }); + }; + return Tsc; + })(); + + var Test = (function () { + function Test(tsfile) { + this.tsfile = tsfile; + } + Test.prototype.run = function (callback) { + Tsc.run(this.tsfile, callback); + }; + return Test; + })(); + + var Typing = (function () { + function Typing(name, baseDir) { + this.name = name; + this.fileHandler = new FileHandler(baseDir + '/' + name + '/', /.\.ts/g); + } + return Typing; + })(); + + var FileHandler = (function () { + function FileHandler(path, pattern) { + this.path = path; + this.files = []; + this.typings = []; + this.files = IO.dir(path, pattern, { recursive: true }); + } + FileHandler.prototype.allTS = function () { + return this.files; + }; + + FileHandler.prototype.allTests = function () { + var tests = []; + + for (var i = 0; i < this.files.length; i++) { + if (endsWith(this.files[i].toUpperCase(), '-TESTS.TS')) { + tests.push(this.files[i]); + } + } + + return tests; + }; + + FileHandler.prototype.allTypings = function () { + var typings = {}; + + for (var i = 0; i < this.files.length; i++) { + var file = this.files[i]; + var firName = path.dirname(file.substr(this.path.length + 1)).replace('\\', '/'); + var dir = firName.split('/')[0]; + + if (!typings[dir]) + typings[dir] = true; + } + + var list = []; + for (var attr in typings) { + list.push(attr); + } + + return list; + }; + return FileHandler; + })(); + + var Timer = (function () { + function Timer() { + this.time = 0; + } + Timer.prettyDate = function (date1, date2) { + var diff = ((date2 - date1) / 1000), day_diff = Math.floor(diff / 86400); + + if (isNaN(day_diff) || day_diff < 0 || day_diff >= 31) + return; + + return (day_diff == 0 && (diff < 60 && (diff + " secconds") || diff < 120 && "1 minute" || diff < 3600 && Math.floor(diff / 60) + " minutes" || diff < 7200 && "1 hour" || diff < 86400 && Math.floor(diff / 3600) + " hours") || day_diff == 1 && "Yesterday" || day_diff < 7 && day_diff + " days" || day_diff < 31 && Math.ceil(day_diff / 7) + " weeks"); + }; + + Timer.prototype.start = function () { + this.time = 0; + this.startTime = this.now(); + }; + + Timer.prototype.now = function () { + return Date.now(); + }; + + Timer.prototype.end = function () { + this.time = (this.now() - this.startTime) / 1000; + this.asString = Timer.prettyDate(this.startTime, this.now()); + }; + return Timer; + })(); + + var Print = (function () { + function Print(version, typings, tsFiles) { + this.version = version; + this.typings = typings; + this.tsFiles = tsFiles; + } + Print.prototype.out = function (s) { + process.stdout.write(s); + }; + + Print.prototype.printHeader = function () { + this.out('=============================================================================\n'); + this.out(' \33[36m\33[1mDefinitelyTyped test runner 0.2.0\33[0m\n'); + this.out('=============================================================================\n'); + this.out(' \33[36m\33[1mTypescript version:\33[0m ' + this.version + '\n'); + this.out(' \33[36m\33[1mTypings :\33[0m ' + this.typings + '\n'); + this.out(' \33[36m\33[1mTypeScript files :\33[0m ' + this.tsFiles + '\n'); + }; + + Print.prototype.printSyntaxCheking = function () { + this.out('============================ \33[34m\33[1mSyntax cheking\33[0m =================================\n'); + }; + + Print.prototype.printTypingTests = function () { + this.out('============================= \33[34m\33[1mTyping tests\33[0m ==================================\n'); + }; + + Print.prototype.printSuccess = function () { + this.out('\33[36m\33[1m.\33[0m'); + }; + + Print.prototype.printFailure = function () { + this.out('x'); + }; + + Print.prototype.printDiv = function () { + this.out('-----------------------------------------------------------------------------\n'); + }; + + Print.prototype.printfilesWithSintaxErrorMessage = function () { + this.out(' \33[36m\33[1mFiles with syntax error\33[0m\n'); + }; + + Print.prototype.printFailedTestMessage = function () { + this.out(' \33[36m\33[1mFailed tests\33[0m\n'); + }; + + Print.prototype.printTypingsWithoutTestsMessage = function () { + this.out(' \33[36m\33[1mTyping without tests\33[0m\n'); + }; + + Print.prototype.printTotalMessage = function () { + this.out(' \33[36m\33[1mTotal\33[0m\n'); + }; + + Print.prototype.printErrorFile = function (file) { + this.out(' - ' + file + '\n'); + }; + + Print.prototype.printTypingsWithoutTest = function (file) { + this.out(' - \33[33m\33[1m' + file + '\33[0m\n'); + }; + + Print.prototype.breack = function () { + this.out('\n'); + }; + + Print.prototype.printSuccessCount = function (current, total) { + this.out(' \33[36m\33[1mSuccessful :\33[0m \33[32m\33[1m' + ((current / total) * 100).toFixed(2) + '% (' + current + '/' + total + ')\33[0m\n'); + }; + + Print.prototype.printFailedCount = function (current, total) { + this.out(' \33[36m\33[1mFailure :\33[0m \33[31m\33[1m' + ((current / total) * 100).toFixed(2) + '% (' + current + '/' + total + ')\33[0m\n'); + }; + + Print.prototype.printElapsedTime = function (time, s) { + this.out(' \33[36m\33[1mElapsed time :\33[0m ~' + time + ' (' + s + 's)\n'); + }; + + Print.prototype.printSyntaxErrorCount = function (current, total) { + this.out(' \33[36m\33[1mSyntaxe error :\33[0m \33[31m\33[1m' + ((current / total) * 100).toFixed(2) + '% (' + current + '/' + total + ')\33[0m\n'); + }; + + Print.prototype.printTestErrorCount = function (current, total) { + this.out(' \33[36m\33[1mFailed tests :\33[0m \33[31m\33[1m' + ((current / total) * 100).toFixed(2) + '% (' + current + '/' + total + ')\33[0m\n'); + }; + + Print.prototype.printWithoutTestCount = function (current, total) { + this.out(' \33[36m\33[1mWithout tests :\33[0m \33[33m\33[1m' + ((current / total) * 100).toFixed(2) + '% (' + current + '/' + total + ')\33[0m\n'); + }; + return Print; + })(); + + var File = (function () { + function File(name, hasError) { + this.name = name; + this.hasError = hasError; + } + File.prototype.formatName = function (baseDir) { + var dirName = path.dirname(this.name.substr(baseDir.length + 1)).replace('\\', '/'); + var dir = dirName.split('/')[0]; + var file = path.basename(this.name, '.ts'); + var ext = path.extname(this.name); + + return dir + ((dirName.split('/').length > 1) ? '/-/' : '/') + '\33[36m\33[1m' + file + '\33[0m' + ext; + }; + return File; + })(); + + var SyntaxCheking = (function () { + function SyntaxCheking(fielHandler, out) { + this.fielHandler = fielHandler; + this.out = out; + this.files = []; + this.timer = new Timer(); + } + SyntaxCheking.prototype.getFailedFiles = function () { + var list = []; + + for (var i = 0; i < this.files.length; i++) { + if (this.files[i].hasError) { + list.push(this.files[i]); + } + } + + return list; + }; + + SyntaxCheking.prototype.getSuccessFiles = function () { + var list = []; + + for (var i = 0; i < this.files.length; i++) { + if (!this.files[i].hasError) { + list.push(this.files[i]); + } + } + + return list; + }; + + SyntaxCheking.prototype.printStats = function () { + this.out.printDiv(); + this.out.printElapsedTime(this.timer.asString, this.timer.time); + this.out.printSuccessCount(this.getSuccessFiles().length, this.files.length); + this.out.printFailedCount(this.getFailedFiles().length, this.files.length); + }; + + SyntaxCheking.prototype.printFailedFiles = function () { + if (this.getFailedFiles().length > 0) { + this.out.printDiv(); + + this.out.printfilesWithSintaxErrorMessage(); + + this.out.printDiv(); + + for (var i = 0; i < this.getFailedFiles().length; i++) { + var errorFile = this.getFailedFiles()[i]; + this.out.printErrorFile(errorFile.formatName(this.fielHandler.path)); + } + } + }; + + SyntaxCheking.prototype.run = function (it, file, len, maxLen, callback) { + var _this = this; + if (!endsWith(file, '-tests.ts')) { + new Test(file).run(function (o) { + var failed = false; + + if (o.exitCode === 1) { + _this.out.printFailure(); + failed = true; + len++; + } else { + _this.out.printSuccess(); + len++; + } + + _this.files.push(new File(file, failed)); + + if (len > maxLen) { + len = 0; + _this.out.breack(); + } + + if (it.hasNext()) { + _this.run(it, it.next(), len, maxLen, callback); + } else { + _this.out.breack(); + _this.timer.end(); + _this.printFailedFiles(); + _this.printStats(); + + callback(_this.getFailedFiles().length, _this.files.length); + } + }); + } else if (it.hasNext()) { + this.run(it, it.next(), len, maxLen, callback); + } else { + this.out.breack(); + this.timer.end(); + this.printStats(); + this.printFailedFiles(); + + callback(this.getFailedFiles().length, this.files.length); + } + }; + + SyntaxCheking.prototype.start = function (callback) { + this.timer.start(); + + var tsFiles = this.fielHandler.allTS(); + + var it = new Iterator(tsFiles); + + var len = 0; + var maxLen = 76; + + if (it.hasNext()) { + this.run(it, it.next(), len, maxLen, callback); + } + }; + return SyntaxCheking; + })(); + + var TestEval = (function () { + function TestEval(fielHandler, out) { + this.fielHandler = fielHandler; + this.out = out; + this.files = []; + this.timer = new Timer(); + } + TestEval.prototype.getFailedFiles = function () { + var list = []; + + for (var i = 0; i < this.files.length; i++) { + if (this.files[i].hasError) { + list.push(this.files[i]); + } + } + + return list; + }; + + TestEval.prototype.getSuccessFiles = function () { + var list = []; + + for (var i = 0; i < this.files.length; i++) { + if (!this.files[i].hasError) { + list.push(this.files[i]); + } + } + + return list; + }; + + TestEval.prototype.printStats = function () { + this.out.printDiv(); + this.out.printElapsedTime(this.timer.asString, this.timer.time); + this.out.printSuccessCount(this.getSuccessFiles().length, this.files.length); + this.out.printFailedCount(this.getFailedFiles().length, this.files.length); + }; + + TestEval.prototype.printFailedFiles = function () { + if (this.getFailedFiles().length > 0) { + this.out.printDiv(); + + this.out.printFailedTestMessage(); + + this.out.printDiv(); + + for (var i = 0; i < this.getFailedFiles().length; i++) { + var errorFile = this.getFailedFiles()[i]; + this.out.printErrorFile(errorFile.formatName(this.fielHandler.path)); + } + } + }; + + TestEval.prototype.run = function (it, file, len, maxLen, callback) { + var _this = this; + if (endsWith(file, '-tests.ts')) { + new Test(file).run(function (o) { + var failed = false; + + if (o.exitCode === 1) { + _this.out.printFailure(); + failed = true; + len++; + } else { + _this.out.printSuccess(); + len++; + } + + _this.files.push(new File(file, failed)); + + if (len > maxLen) { + len = 0; + _this.out.breack(); + } + + if (it.hasNext()) { + _this.run(it, it.next(), len, maxLen, callback); + } else { + _this.out.breack(); + _this.timer.end(); + _this.printFailedFiles(); + _this.printStats(); + + callback(_this.getFailedFiles().length, _this.files.length); + } + }); + } else if (it.hasNext()) { + this.run(it, it.next(), len, maxLen, callback); + } else { + this.out.breack(); + this.timer.end(); + this.printFailedFiles(); + this.printStats(); + + callback(this.getFailedFiles().length, this.files.length); + } + }; + + TestEval.prototype.start = function (callback) { + this.timer.start(); + + var tsFiles = this.fielHandler.allTS(); + + var it = new Iterator(tsFiles); + + var len = 0; + var maxLen = 76; + + if (it.hasNext()) { + this.run(it, it.next(), len, maxLen, callback); + } + }; + return TestEval; + })(); + + var TestRunner = (function () { + function TestRunner(dtPath) { + this.dtPath = dtPath; + this.typings = []; + this.fh = new FileHandler(dtPath, /.\.ts/g); + this.out = new Print('0.9.0.0', this.fh.allTypings().length, this.fh.allTS().length); + this.sc = new SyntaxCheking(this.fh, this.out); + this.te = new TestEval(this.fh, this.out); + + var tpgs = this.fh.allTypings(); + for (var i = 0; i < tpgs.length; i++) { + this.typings.push(new Typing(tpgs[i], this.dtPath)); + } + } + TestRunner.prototype.printTypingsWithoutTest = function () { + var count = 0; + + if (this.typings.length > 0) { + this.out.printDiv(); + + this.out.printTypingsWithoutTestsMessage(); + + this.out.printDiv(); + + for (var i = 0; i < this.typings.length; i++) { + var typing = this.typings[i]; + if (typing.fileHandler.allTests().length == 0) { + if (typing.name != '_infrastructure' && typing.name != '_ReSharper.DefinitelyTyped' && typing.name != 'obj' && typing.name != 'bin' && typing.name != 'Properties') { + this.out.printTypingsWithoutTest(typing.name); + count++; + } + } + } + } + + return count; + }; + + TestRunner.prototype.run = function () { + var _this = this; + var timer = new Timer(); + timer.start(); + + this.out.printHeader(); + this.out.printSyntaxCheking(); + + this.sc.start(function (syntaxFailedCount, syntaxTotal) { + _this.out.printTypingTests(); + _this.te.start(function (testFailedCount, testTotal) { + var total = _this.printTypingsWithoutTest(); + + timer.end(); + + _this.out.printDiv(); + _this.out.printTotalMessage(); + _this.out.printDiv(); + + _this.out.printElapsedTime(timer.asString, timer.time); + _this.out.printSyntaxErrorCount(syntaxFailedCount, syntaxTotal); + _this.out.printTestErrorCount(testFailedCount, testTotal); + _this.out.printWithoutTestCount(total, _this.fh.allTypings().length); + + _this.out.printDiv(); + + if (syntaxFailedCount > 0 || testFailedCount > 0) { + process.exit(1); + } + }); + }); + }; + return TestRunner; + })(); + TestManager.TestRunner = TestRunner; + })(DefinitelyTyped.TestManager || (DefinitelyTyped.TestManager = {})); + var TestManager = DefinitelyTyped.TestManager; +})(DefinitelyTyped || (DefinitelyTyped = {})); + +var dtPath = __dirname + '/..'; + +var runner = new DefinitelyTyped.TestManager.TestRunner(dtPath); +runner.run(); From 57c7e3c00144a6e51860e19e145dec76afaa2ca3 Mon Sep 17 00:00:00 2001 From: Duncan Mak Date: Wed, 19 Jun 2013 02:13:46 -0400 Subject: [PATCH 21/57] A first pass at removing 'any's with generic Ts. --- async/async.d.ts | 94 ++++++++++++++++++++++++------------------------ 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/async/async.d.ts b/async/async.d.ts index 835c10777..a1e1f12b9 100644 --- a/async/async.d.ts +++ b/async/async.d.ts @@ -1,67 +1,67 @@ -// Type definitions for Async 0.1 +// Type definitions for Async 0.1.23 // Project: https://github.com/caolan/async // Definitions by: Boris Yankov // Definitions: https://github.com/borisyankov/DefinitelyTyped -interface AsyncCallback { (err: string, results: any): any; } -interface AsyncIterator { (item, callback: AsyncCallback): void; } -interface AsyncMemoIterator { (memo: any, item: any, callback: AsyncCallback): void; } -interface AsyncWorker { (task: any, callback: Function): void; } +interface AsyncCallback { (err: string, results: T[]): any; } +interface AsyncIterator { (item: T, callback: AsyncCallback): void; } +interface AsyncMemoIterator { (memo: T, item: T, callback: AsyncCallback): void; } +interface AsyncWorker { (task: T, callback: Function): void; } -interface AsyncQueue { +interface AsyncQueue { length(): number; concurrency: number; - push(task: any, callback: AsyncCallback): void; - saturated: AsyncCallback; - empty: AsyncCallback; - drain: AsyncCallback; + push(task: T, callback: AsyncCallback): void; + saturated: AsyncCallback; + empty: AsyncCallback; + drain: AsyncCallback; } interface Async { // Collections - forEach(arr: any[], iterator: AsyncIterator, callback: AsyncCallback): void; - forEachSeries(arr: any[], iterator: AsyncIterator, callback: AsyncCallback): void; - forEachLimit(arr: any[], limit: number, iterator: AsyncIterator, callback: AsyncCallback): void; - map(arr: any[], iterator: AsyncIterator, callback: AsyncCallback); - mapSeries(arr: any[], iterator: AsyncIterator, callback: AsyncCallback); - filter(arr: any[], iterator: AsyncIterator, callback: AsyncCallback); - select(arr: any[], iterator: AsyncIterator, callback: AsyncCallback); - filterSeries(arr: any[], iterator: AsyncIterator, callback: AsyncCallback); - selectSeries(arr: any[], iterator: AsyncIterator, callback: AsyncCallback); - reject(arr: any[], iterator: AsyncIterator, callback: AsyncCallback); - rejectSeries(arr: any[], iterator: AsyncIterator, callback: AsyncCallback); - reduce(arr: any[], memo: any, iterator: AsyncMemoIterator, callback: AsyncCallback); - inject(arr: any[], memo: any, iterator: AsyncMemoIterator, callback: AsyncCallback); - foldl(arr: any[], memo: any, iterator: AsyncMemoIterator, callback: AsyncCallback); - reduceRight(arr: any[], memo: any, iterator: AsyncMemoIterator, callback: AsyncCallback); - foldr(arr: any[], memo: any, iterator: AsyncMemoIterator, callback: AsyncCallback); - detect(arr: any[], iterator: AsyncIterator, callback: AsyncCallback); - detectSeries(arr: any[], iterator: AsyncIterator, callback: AsyncCallback); - sortBy(arr: any[], iterator: AsyncIterator, callback: AsyncCallback); - some(arr: any[], iterator: AsyncIterator, callback: AsyncCallback); - any(arr: any[], iterator: AsyncIterator, callback: AsyncCallback); - every(arr: any[], iterator: AsyncIterator, callback: AsyncCallback); - all(arr: any[], iterator: AsyncIterator, callback: AsyncCallback); - concat(arr: any[], iterator: AsyncIterator, callback: AsyncCallback); - concatSeries(arr: any[], iterator: AsyncIterator, callback: AsyncCallback); + forEach(arr: T[], iterator: AsyncIterator, callback: AsyncCallback): void; + forEachSeries(arr: T[], iterator: AsyncIterator, callback: AsyncCallback): void; + forEachLimit(arr: T[], limit: number, iterator: AsyncIterator, callback: AsyncCallback): void; + map(arr: T[], iterator: AsyncIterator, callback: AsyncCallback); + mapSeries(arr: T[], iterator: AsyncIterator, callback: AsyncCallback); + filter(arr: T[], iterator: AsyncIterator, callback: AsyncCallback); + select(arr: T[], iterator: AsyncIterator, callback: AsyncCallback); + filterSeries(arr: T[], iterator: AsyncIterator, callback: AsyncCallback); + selectSeries(arr: T[], iterator: AsyncIterator, callback: AsyncCallback); + reject(arr: T[], iterator: AsyncIterator, callback: AsyncCallback); + rejectSeries(arr: T[], iterator: AsyncIterator, callback: AsyncCallback); + reduce(arr: T[], memo: T, iterator: AsyncMemoIterator, callback: AsyncCallback); + inject(arr: T[], memo: T, iterator: AsyncMemoIterator, callback: AsyncCallback); + foldl(arr: T[], memo: T, iterator: AsyncMemoIterator, callback: AsyncCallback); + reduceRight(arr: T[], memo: T, iterator: AsyncMemoIterator, callback: AsyncCallback); + foldr(arr: T[], memo: T, iterator: AsyncMemoIterator, callback: AsyncCallback); + detect(arr: T[], iterator: AsyncIterator, callback: AsyncCallback); + detectSeries(arr: T[], iterator: AsyncIterator, callback: AsyncCallback); + sortBy(arr: T[], iterator: AsyncIterator, callback: AsyncCallback); + some(arr: T[], iterator: AsyncIterator, callback: AsyncCallback); + any(arr: T[], iterator: AsyncIterator, callback: AsyncCallback); + every(arr: T[], iterator: AsyncIterator, callback: AsyncCallback); + all(arr: T[], iterator: AsyncIterator, callback: AsyncCallback); + concat(arr: T[], iterator: AsyncIterator, callback: AsyncCallback); + concatSeries(arr: T[], iterator: AsyncIterator, callback: AsyncCallback); // Control Flow - series(tasks: any[], callback?: AsyncCallback): void; - series(tasks: any, callback?: AsyncCallback): void; - parallel(tasks: any[], callback?: AsyncCallback): void; - parallel(tasks: any, callback?: AsyncCallback): void; - whilst(test: Function, fn: Function, callback: AsyncCallback): void; - until(test: Function, fn: Function, callback: AsyncCallback): void; - waterfall(tasks: any[], callback?: AsyncCallback): void; - waterfall(tasks: any, callback?: AsyncCallback): void; - queue(worker: AsyncWorker, concurrency: number): AsyncQueue; - //auto(tasks: any[], callback?: AsyncCallback): void; - auto(tasks: any, callback?: AsyncCallback): void; + series(tasks: T[], callback?: AsyncCallback): void; + series(tasks: T, callback?: AsyncCallback): void; + parallel(tasks: T[], callback?: AsyncCallback): void; + parallel(tasks: T, callback?: AsyncCallback): void; + whilst(test: Function, fn: Function, callback: AsyncCallback): void; // TODO: generify + until(test: Function, fn: Function, callback: AsyncCallback): void; // TODO: generify + waterfall(tasks: T[], callback?: AsyncCallback): void; + waterfall(tasks: T, callback?: AsyncCallback): void; + queue(worker: AsyncWorker, concurrency: number): AsyncQueue; + //auto(tasks: any[], callback?: AsyncCallback): void; + auto(tasks: T, callback?: AsyncCallback): void; iterator(tasks): Function; apply(fn: Function, ...arguments: any[]): void; - nextTick(callback: AsyncCallback): void; + nextTick(callback: AsyncCallback): void; // Utils memoize(fn: Function, hasher?: Function): Function; From 7efa6bbca5b63c153592fd0b9819cf6c2716ac08 Mon Sep 17 00:00:00 2001 From: Duncan Mak Date: Thu, 20 Jun 2013 00:06:27 -0400 Subject: [PATCH 22/57] Differentiate between single-result and multiple-results callbacks. --- async/async.d.ts | 88 ++++++++++++++++++++++++------------------------ 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/async/async.d.ts b/async/async.d.ts index a1e1f12b9..ec92487fc 100644 --- a/async/async.d.ts +++ b/async/async.d.ts @@ -3,65 +3,65 @@ // Definitions by: Boris Yankov // Definitions: https://github.com/borisyankov/DefinitelyTyped - -interface AsyncCallback { (err: string, results: T[]): any; } -interface AsyncIterator { (item: T, callback: AsyncCallback): void; } -interface AsyncMemoIterator { (memo: T, item: T, callback: AsyncCallback): void; } +interface AsyncMultipleResultsCallback { (err: string, results: T[]): any; } +interface AsyncSingleResultCallback { (err: string, result: T): any; } +interface AsyncIterator { (item: T, callback: AsyncMultipleResultsCallback): void; } +interface AsyncMemoIterator { (memo: T, item: T, callback: AsyncSingleResultCallback): void; } interface AsyncWorker { (task: T, callback: Function): void; } interface AsyncQueue { length(): number; concurrency: number; - push(task: T, callback: AsyncCallback): void; - saturated: AsyncCallback; - empty: AsyncCallback; - drain: AsyncCallback; + push(task: T, callback: AsyncMultipleResultsCallback): void; + saturated: AsyncMultipleResultsCallback; + empty: AsyncMultipleResultsCallback; + drain: AsyncMultipleResultsCallback; } interface Async { // Collections - forEach(arr: T[], iterator: AsyncIterator, callback: AsyncCallback): void; - forEachSeries(arr: T[], iterator: AsyncIterator, callback: AsyncCallback): void; - forEachLimit(arr: T[], limit: number, iterator: AsyncIterator, callback: AsyncCallback): void; - map(arr: T[], iterator: AsyncIterator, callback: AsyncCallback); - mapSeries(arr: T[], iterator: AsyncIterator, callback: AsyncCallback); - filter(arr: T[], iterator: AsyncIterator, callback: AsyncCallback); - select(arr: T[], iterator: AsyncIterator, callback: AsyncCallback); - filterSeries(arr: T[], iterator: AsyncIterator, callback: AsyncCallback); - selectSeries(arr: T[], iterator: AsyncIterator, callback: AsyncCallback); - reject(arr: T[], iterator: AsyncIterator, callback: AsyncCallback); - rejectSeries(arr: T[], iterator: AsyncIterator, callback: AsyncCallback); - reduce(arr: T[], memo: T, iterator: AsyncMemoIterator, callback: AsyncCallback); - inject(arr: T[], memo: T, iterator: AsyncMemoIterator, callback: AsyncCallback); - foldl(arr: T[], memo: T, iterator: AsyncMemoIterator, callback: AsyncCallback); - reduceRight(arr: T[], memo: T, iterator: AsyncMemoIterator, callback: AsyncCallback); - foldr(arr: T[], memo: T, iterator: AsyncMemoIterator, callback: AsyncCallback); - detect(arr: T[], iterator: AsyncIterator, callback: AsyncCallback); - detectSeries(arr: T[], iterator: AsyncIterator, callback: AsyncCallback); - sortBy(arr: T[], iterator: AsyncIterator, callback: AsyncCallback); - some(arr: T[], iterator: AsyncIterator, callback: AsyncCallback); - any(arr: T[], iterator: AsyncIterator, callback: AsyncCallback); - every(arr: T[], iterator: AsyncIterator, callback: AsyncCallback); - all(arr: T[], iterator: AsyncIterator, callback: AsyncCallback); - concat(arr: T[], iterator: AsyncIterator, callback: AsyncCallback); - concatSeries(arr: T[], iterator: AsyncIterator, callback: AsyncCallback); + forEach(arr: T[], iterator: AsyncIterator, callback: AsyncMultipleResultsCallback): void; + forEachSeries(arr: T[], iterator: AsyncIterator, callback: AsyncMultipleResultsCallback): void; + forEachLimit(arr: T[], limit: number, iterator: AsyncIterator, callback: AsyncMultipleResultsCallback): void; + map(arr: T[], iterator: AsyncIterator, callback: AsyncMultipleResultsCallback); + mapSeries(arr: T[], iterator: AsyncIterator, callback: AsyncMultipleResultsCallback); + filter(arr: T[], iterator: AsyncIterator, callback: AsyncMultipleResultsCallback); + select(arr: T[], iterator: AsyncIterator, callback: AsyncMultipleResultsCallback); + filterSeries(arr: T[], iterator: AsyncIterator, callback: AsyncMultipleResultsCallback); + selectSeries(arr: T[], iterator: AsyncIterator, callback: AsyncMultipleResultsCallback); + reject(arr: T[], iterator: AsyncIterator, callback: AsyncMultipleResultsCallback); + rejectSeries(arr: T[], iterator: AsyncIterator, callback: AsyncMultipleResultsCallback); + reduce(arr: T[], memo: T, iterator: AsyncMemoIterator, callback: AsyncSingleResultCallback); + inject(arr: T[], memo: T, iterator: AsyncMemoIterator, callback: AsyncSingleResultCallback); + foldl(arr: T[], memo: T, iterator: AsyncMemoIterator, callback: AsyncSingleResultCallback); + reduceRight(arr: T[], memo: T, iterator: AsyncMemoIterator, callback: AsyncSingleResultCallback); + foldr(arr: T[], memo: T, iterator: AsyncMemoIterator, callback: AsyncSingleResultCallback); + detect(arr: T[], iterator: AsyncIterator, callback: AsyncMultipleResultsCallback); + detectSeries(arr: T[], iterator: AsyncIterator, callback: AsyncMultipleResultsCallback); + sortBy(arr: T[], iterator: AsyncIterator, callback: AsyncMultipleResultsCallback); + some(arr: T[], iterator: AsyncIterator, callback: AsyncMultipleResultsCallback); + any(arr: T[], iterator: AsyncIterator, callback: AsyncMultipleResultsCallback); + every(arr: T[], iterator: AsyncIterator, callback: (result: boolean) => any); + all(arr: T[], iterator: AsyncIterator, callback: (result: boolean) => any); + concat(arr: T[], iterator: AsyncIterator, callback: AsyncMultipleResultsCallback); + concatSeries(arr: T[], iterator: AsyncIterator, callback: AsyncMultipleResultsCallback); // Control Flow - series(tasks: T[], callback?: AsyncCallback): void; - series(tasks: T, callback?: AsyncCallback): void; - parallel(tasks: T[], callback?: AsyncCallback): void; - parallel(tasks: T, callback?: AsyncCallback): void; - whilst(test: Function, fn: Function, callback: AsyncCallback): void; // TODO: generify - until(test: Function, fn: Function, callback: AsyncCallback): void; // TODO: generify - waterfall(tasks: T[], callback?: AsyncCallback): void; - waterfall(tasks: T, callback?: AsyncCallback): void; + series(tasks: T[], callback?: AsyncMultipleResultsCallback): void; + series(tasks: T, callback?: AsyncMultipleResultsCallback): void; + parallel(tasks: T[], callback?: AsyncMultipleResultsCallback): void; + parallel(tasks: T, callback?: AsyncMultipleResultsCallback): void; + whilst(test: Function, fn: Function, callback: Function): void; + until(test: Function, fn: Function, callback: Function): void; + waterfall(tasks: T[], callback?: AsyncMultipleResultsCallback): void; + waterfall(tasks: T, callback?: AsyncMultipleResultsCallback): void; queue(worker: AsyncWorker, concurrency: number): AsyncQueue; - //auto(tasks: any[], callback?: AsyncCallback): void; - auto(tasks: T, callback?: AsyncCallback): void; + //auto(tasks: any[], callback?: AsyncMultipleResultsCallback): void; + auto(tasks: T, callback?: AsyncMultipleResultsCallback): void; iterator(tasks): Function; apply(fn: Function, ...arguments: any[]): void; - nextTick(callback: AsyncCallback): void; + nextTick(callback: AsyncMultipleResultsCallback): void; // Utils memoize(fn: Function, hasher?: Function): Function; From 4d7a581f410d67a6e1b26bbfaa71bc5345992f1d Mon Sep 17 00:00:00 2001 From: Duncan Mak Date: Thu, 20 Jun 2013 00:20:23 -0400 Subject: [PATCH 23/57] Include definition for 'times' and 'timesSeries'. --- async/async.d.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/async/async.d.ts b/async/async.d.ts index ec92487fc..6c06348d5 100644 --- a/async/async.d.ts +++ b/async/async.d.ts @@ -5,6 +5,7 @@ interface AsyncMultipleResultsCallback { (err: string, results: T[]): any; } interface AsyncSingleResultCallback { (err: string, result: T): any; } +interface AsyncTimesCallback { (n: number, callback: AsyncMultipleResultsCallback): void; } interface AsyncIterator { (item: T, callback: AsyncMultipleResultsCallback): void; } interface AsyncMemoIterator { (memo: T, item: T, callback: AsyncSingleResultCallback): void; } interface AsyncWorker { (task: T, callback: Function): void; } @@ -57,11 +58,14 @@ interface Async { waterfall(tasks: T[], callback?: AsyncMultipleResultsCallback): void; waterfall(tasks: T, callback?: AsyncMultipleResultsCallback): void; queue(worker: AsyncWorker, concurrency: number): AsyncQueue; - //auto(tasks: any[], callback?: AsyncMultipleResultsCallback): void; - auto(tasks: T, callback?: AsyncMultipleResultsCallback): void; - iterator(tasks): Function; + // auto(tasks: any[], callback?: AsyncMultipleResultsCallback): void; + auto(tasks: any, callback?: AsyncMultipleResultsCallback): void; + iterator(tasks: Function[]): Function; apply(fn: Function, ...arguments: any[]): void; - nextTick(callback: AsyncMultipleResultsCallback): void; + nextTick(callback: Function): void; + + times (n: number, callback: AsyncTimesCallback): void; + timesSeries (n: number, callback: AsyncTimesCallback): void; // Utils memoize(fn: Function, hasher?: Function): Function; From 9ccfc8fc6f02f3ae028f76cbaa0bbb995fc925b5 Mon Sep 17 00:00:00 2001 From: Duncan Mak Date: Thu, 20 Jun 2013 14:18:55 -0400 Subject: [PATCH 24/57] Fix the test to make it compile. --- async/async-tests.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/async/async-tests.ts b/async/async-tests.ts index e7b57a1f8..fefc3fd2a 100644 --- a/async/async-tests.ts +++ b/async/async-tests.ts @@ -18,10 +18,10 @@ async.series([ function () { } ]); -var data; -function asyncProcess() { } +var data = []; +function asyncProcess(item, callback) { } async.map(data, asyncProcess, function (err, results) { - alert(results); + console.log(results); }); var openFiles = ['file1', 'file2']; From 0072169721fef972f10678c12e4b5828403c63c9 Mon Sep 17 00:00:00 2001 From: Diullei Gomes Date: Thu, 20 Jun 2013 15:31:55 -0300 Subject: [PATCH 25/57] bug fixed. CI script --- _infrastructure/src/exec.ts | 77 - _infrastructure/src/io.ts | 525 -- _infrastructure/{ => tests}/runner.js | 516 +- _infrastructure/{ => tests}/runner.ts | 4 +- _infrastructure/tests/src/io.js | 8 +- _infrastructure/tests/src/io.ts | 34 +- _infrastructure/tests/testRunner.js | 152 - _infrastructure/tests/testRunner.ts | 168 - _infrastructure/typescript/lib.d.ts | 9074 ------------------------- _infrastructure/typescript/tsc | 2 - package.json | 2 +- 11 files changed, 29 insertions(+), 10533 deletions(-) delete mode 100644 _infrastructure/src/exec.ts delete mode 100644 _infrastructure/src/io.ts rename _infrastructure/{ => tests}/runner.js (50%) rename _infrastructure/{ => tests}/runner.ts (95%) delete mode 100644 _infrastructure/tests/testRunner.js delete mode 100644 _infrastructure/tests/testRunner.ts delete mode 100644 _infrastructure/typescript/lib.d.ts delete mode 100644 _infrastructure/typescript/tsc diff --git a/_infrastructure/src/exec.ts b/_infrastructure/src/exec.ts deleted file mode 100644 index f277d3942..000000000 --- a/_infrastructure/src/exec.ts +++ /dev/null @@ -1,77 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -// Allows for executing a program with command-line arguments and reading the result -interface IExec { - exec: (filename: string, cmdLineArgs: string[], handleResult: (ExecResult) => void) => void; -} - -declare var require; - -class ExecResult { - public stdout = ""; - public stderr = ""; - public exitCode: number; -} - -class WindowsScriptHostExec implements IExec { - public exec(filename: string, cmdLineArgs: string[], handleResult: (ExecResult) => void) : void { - var result = new ExecResult(); - var shell = new ActiveXObject('WScript.Shell'); - try { - var process = shell.Exec(filename + ' ' + cmdLineArgs.join(' ')); - } catch(e) { - result.stderr = e.message; - result.exitCode = 1 - handleResult(result); - return; - } - // Wait for it to finish running - while (process.Status != 0) { /* todo: sleep? */ } - - - result.exitCode = process.ExitCode; - if(!process.StdOut.AtEndOfStream) result.stdout = process.StdOut.ReadAll(); - if(!process.StdErr.AtEndOfStream) result.stderr = process.StdErr.ReadAll(); - - handleResult(result); - } -} - -class NodeExec implements IExec { - public exec(filename: string, cmdLineArgs: string[], handleResult: (ExecResult) => void) : void { - var nodeExec = require('child_process').exec; - - var result = new ExecResult(); - result.exitCode = null; - var cmdLine = filename + ' ' + cmdLineArgs.join(' '); - - var process = nodeExec(cmdLine, function (error, stdout, stderr) { - result.stdout = stdout; - result.stderr = stderr; - result.exitCode = error ? error.code : 0; - handleResult(result); - }); - } -} - -var Exec: IExec = function() : IExec { - var global = Function("return this;").call(null); - if(typeof global.ActiveXObject !== "undefined") { - return new WindowsScriptHostExec(); - } else { - return new NodeExec(); - } -}(); \ No newline at end of file diff --git a/_infrastructure/src/io.ts b/_infrastructure/src/io.ts deleted file mode 100644 index 9c5345136..000000000 --- a/_infrastructure/src/io.ts +++ /dev/null @@ -1,525 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -interface IResolvedFile { - content: string; - path: string; -} - -interface IFileWatcher { - close(): void; -} - -interface IIO { - readFile(path: string): string; - writeFile(path: string, contents: string): void; - createFile(path: string, useUTF8?: bool): ITextWriter; - deleteFile(path: string): void; - dir(path: string, re?: RegExp, options?: { recursive?: bool; deep?: number; }): string[]; - fileExists(path: string): bool; - directoryExists(path: string): bool; - createDirectory(path: string): void; - resolvePath(path: string): string; - dirName(path: string): string; - findFile(rootPath: string, partialFilePath: string): IResolvedFile; - print(str: string): void; - printLine(str: string): void; - arguments: string[]; - stderr: ITextWriter; - stdout: ITextWriter; - watchFile(filename: string, callback: (string) => void ): IFileWatcher; - run(source: string, filename: string): void; - getExecutingFilePath(): string; - quit(exitCode?: number); -} - -module IOUtils { - // Creates the directory including its parent if not already present - function createDirectoryStructure(ioHost: IIO, dirName: string) { - if (ioHost.directoryExists(dirName)) { - return; - } - - var parentDirectory = ioHost.dirName(dirName); - if (parentDirectory != "") { - createDirectoryStructure(ioHost, parentDirectory); - } - ioHost.createDirectory(dirName); - } - - // Creates a file including its directory structure if not already present - export function createFileAndFolderStructure(ioHost: IIO, fileName: string, useUTF8?: bool) { - var path = ioHost.resolvePath(fileName); - var dirName = ioHost.dirName(path); - createDirectoryStructure(ioHost, dirName); - return ioHost.createFile(path, useUTF8); - } - - export function throwIOError(message: string, error: Error) { - var errorMessage = message; - if (error && error.message) { - errorMessage += (" " + error.message); - } - throw new Error(errorMessage); - } -} - -// Declare dependencies needed for all supported hosts -declare class Enumerator { - public atEnd(): bool; - public moveNext(); - public item(): any; - constructor (o: any); -} -declare function setTimeout(callback: () =>void , ms?: number); -//declare var require: any; -declare module process { - export var argv: string[]; - export var platform: string; - export function on(event: string, handler: (any) => void ): void; - export module stdout { - export function write(str: string); - } - export module stderr { - export function write(str: string); - } - export module mainModule { - export var filename: string; - } - export function exit(exitCode?: number); -} - -var IO = (function() { - - // Create an IO object for use inside WindowsScriptHost hosts - // Depends on WSCript and FileSystemObject - function getWindowsScriptHostIO(): IIO { - var fso = new ActiveXObject("Scripting.FileSystemObject"); - var streamObjectPool = []; - - function getStreamObject(): any { - if (streamObjectPool.length > 0) { - return streamObjectPool.pop(); - } else { - return new ActiveXObject("ADODB.Stream"); - } - } - - function releaseStreamObject(obj: any) { - streamObjectPool.push(obj); - } - - var args = []; - for (var i = 0; i < WScript.Arguments.length; i++) { - args[i] = WScript.Arguments.Item(i); - } - - return { - readFile: function(path) { - try { - var streamObj = getStreamObject(); - streamObj.Open(); - streamObj.Type = 2; // Text data - streamObj.Charset = 'x-ansi'; // Assume we are reading ansi text - streamObj.LoadFromFile(path); - var bomChar = streamObj.ReadText(2); // Read the BOM char - streamObj.Position = 0; // Position has to be at 0 before changing the encoding - if ((bomChar.charCodeAt(0) == 0xFE && bomChar.charCodeAt(1) == 0xFF) - || (bomChar.charCodeAt(0) == 0xFF && bomChar.charCodeAt(1) == 0xFE)) { - streamObj.Charset = 'unicode'; - } else if (bomChar.charCodeAt(0) == 0xEF && bomChar.charCodeAt(1) == 0xBB) { - streamObj.Charset = 'utf-8'; - } - - // Read the whole file - var str = streamObj.ReadText(-1 /* read from the current position to EOS */); - streamObj.Close(); - releaseStreamObject(streamObj); - return str; - } - catch (err) { - IOUtils.throwIOError("Error reading file \"" + path + "\".", err); - } - }, - - writeFile: function(path, contents) { - var file = this.createFile(path); - file.Write(contents); - file.Close(); - }, - - fileExists: function(path: string): bool { - return fso.FileExists(path); - }, - - resolvePath: function(path: string): string { - return fso.GetAbsolutePathName(path); - }, - - dirName: function(path: string): string { - return fso.GetParentFolderName(path); - }, - - findFile: function(rootPath: string, partialFilePath: string): IResolvedFile { - var path = fso.GetAbsolutePathName(rootPath) + "/" + partialFilePath; - - while (true) { - if (fso.FileExists(path)) { - try { - var content = this.readFile(path); - return { content: content, path: path }; - } - catch (err) { - //Tools.CompilerDiagnostics.debugPrint("Could not find " + path + ", trying parent"); - } - } - else { - rootPath = fso.GetParentFolderName(fso.GetAbsolutePathName(rootPath)); - - if (rootPath == "") { - return null; - } - else { - path = fso.BuildPath(rootPath, partialFilePath); - } - } - } - }, - - deleteFile: function(path: string): void { - try { - if (fso.FileExists(path)) { - fso.DeleteFile(path, true); // true: delete read-only files - } - } catch (e) { - IOUtils.throwIOError("Couldn't delete file '" + path + "'.", e); - } - }, - - createFile: function (path, useUTF8?) { - try { - var streamObj = getStreamObject(); - streamObj.Charset = useUTF8 ? 'utf-8' : 'x-ansi'; - streamObj.Open(); - return { - Write: function (str) { streamObj.WriteText(str, 0); }, - WriteLine: function (str) { streamObj.WriteText(str, 1); }, - Close: function() { - try { - streamObj.SaveToFile(path, 2); - } catch (saveError) { - IOUtils.throwIOError("Couldn't write to file '" + path + "'.", saveError); - } - finally { - if (streamObj.State != 0 /*adStateClosed*/) { - streamObj.Close(); - } - releaseStreamObject(streamObj); - } - } - }; - } catch (creationError) { - IOUtils.throwIOError("Couldn't write to file '" + path + "'.", creationError); - } - }, - - directoryExists: function(path) { - return fso.FolderExists(path); - }, - - createDirectory: function(path) { - try { - if (!this.directoryExists(path)) { - fso.CreateFolder(path); - } - } catch (e) { - IOUtils.throwIOError("Couldn't create directory '" + path + "'.", e); - } - }, - - dir: function(path, spec?, options?) { - options = options || <{ recursive?: bool; deep?: number; }>{}; - function filesInFolder(folder, root): string[]{ - var paths = []; - var fc: Enumerator; - - if (options.recursive) { - fc = new Enumerator(folder.subfolders); - - for (; !fc.atEnd() ; fc.moveNext()) { - paths = paths.concat(filesInFolder(fc.item(), root + "/" + fc.item().Name)); - } - } - - fc = new Enumerator(folder.files); - - for (; !fc.atEnd() ; fc.moveNext()) { - if (!spec || fc.item().Name.match(spec)) { - paths.push(root + "/" + fc.item().Name); - } - } - - return paths; - } - - var folder = fso.GetFolder(path); - var paths = []; - - return filesInFolder(folder, path); - }, - - print: function(str) { - WScript.StdOut.Write(str); - }, - - printLine: function(str) { - WScript.Echo(str); - }, - - arguments: args, - stderr: WScript.StdErr, - stdout: WScript.StdOut, - watchFile: null, - run: function(source, filename) { - try { - eval(source); - } catch (e) { - IOUtils.throwIOError("Error while executing file '" + filename + "'.", e); - } - }, - getExecutingFilePath: function () { - return WScript.ScriptFullName; - }, - quit: function (exitCode : number = 0) { - try { - WScript.Quit(exitCode); - } catch (e) { - } - } - } - - }; - - // Create an IO object for use inside Node.js hosts - // Depends on 'fs' and 'path' modules - function getNodeIO(): IIO { - - var _fs = require('fs'); - var _path = require('path'); - var _module = require('module'); - - return { - readFile: function(file) { - try { - var buffer = _fs.readFileSync(file); - switch (buffer[0]) { - case 0xFE: - if (buffer[1] == 0xFF) { - // utf16-be. Reading the buffer as big endian is not supported, so convert it to - // Little Endian first - var i = 0; - while ((i + 1) < buffer.length) { - var temp = buffer[i] - buffer[i] = buffer[i + 1]; - buffer[i + 1] = temp; - i += 2; - } - return buffer.toString("ucs2", 2); - } - break; - case 0xFF: - if (buffer[1] == 0xFE) { - // utf16-le - return buffer.toString("ucs2", 2); - } - break; - case 0xEF: - if (buffer[1] == 0xBB) { - // utf-8 - return buffer.toString("utf8", 3); - } - } - // Default behaviour - return buffer.toString(); - } catch (e) { - IOUtils.throwIOError("Error reading file \"" + file + "\".", e); - } - }, - writeFile: <(path: string, contents: string) => void >_fs.writeFileSync, - deleteFile: function(path) { - try { - _fs.unlinkSync(path); - } catch (e) { - IOUtils.throwIOError("Couldn't delete file '" + path + "'.", e); - } - }, - fileExists: function(path): bool { - return _fs.existsSync(path); - }, - createFile: function(path, useUTF8?) { - function mkdirRecursiveSync(path) { - var stats = _fs.statSync(path); - if (stats.isFile()) { - IOUtils.throwIOError("\"" + path + "\" exists but isn't a directory.", null); - } else if (stats.isDirectory()) { - return; - } else { - mkdirRecursiveSync(_path.dirname(path)); - _fs.mkdirSync(path, 0775); - } - } - - mkdirRecursiveSync(_path.dirname(path)); - - try { - var fd = _fs.openSync(path, 'w'); - } catch (e) { - IOUtils.throwIOError("Couldn't write to file '" + path + "'.", e); - } - return { - Write: function(str) { _fs.writeSync(fd, str); }, - WriteLine: function(str) { _fs.writeSync(fd, str + '\r\n'); }, - Close: function() { _fs.closeSync(fd); fd = null; } - }; - }, - dir: function dir(path, spec?, options?) { - options = options || <{ recursive?: bool; deep?: number; }>{}; - - function filesInFolder(folder: string, deep?: number): string[]{ - var paths = []; - - var files = _fs.readdirSync(folder); - for (var i = 0; i < files.length; i++) { - var stat = _fs.statSync(folder + "/" + files[i]); - if (options.recursive && stat.isDirectory()) { - if (deep < (options.deep || 100)) { - paths = paths.concat(filesInFolder(folder + "/" + files[i], 1)); - } - } else if (stat.isFile() && (!spec || files[i].match(spec))) { - paths.push(folder + "/" + files[i]); - } - } - - return paths; - } - - return filesInFolder(path, 0); - }, - createDirectory: function(path: string): void { - try { - if (!this.directoryExists(path)) { - _fs.mkdirSync(path); - } - } catch (e) { - IOUtils.throwIOError("Couldn't create directory '" + path + "'.", e); - } - }, - - directoryExists: function(path: string): bool { - return _fs.existsSync(path) && _fs.lstatSync(path).isDirectory(); - }, - resolvePath: function(path: string): string { - return _path.resolve(path); - }, - dirName: function(path: string): string { - return _path.dirname(path); - }, - findFile: function(rootPath: string, partialFilePath): IResolvedFile { - var path = rootPath + "/" + partialFilePath; - - while (true) { - if (_fs.existsSync(path)) { - try { - var content = this.readFile(path); - return { content: content, path: path }; - } catch (err) { - //Tools.CompilerDiagnostics.debugPrint(("Could not find " + path) + ", trying parent"); - } - } - else { - var parentPath = _path.resolve(rootPath, ".."); - - // Node will just continue to repeat the root path, rather than return null - if (rootPath === parentPath) { - return null; - } - else { - rootPath = parentPath; - path = _path.resolve(rootPath, partialFilePath); - } - } - } - }, - print: function(str) { process.stdout.write(str) }, - printLine: function(str) { process.stdout.write(str + '\n') }, - arguments: process.argv.slice(2), - stderr: { - Write: function(str) { process.stderr.write(str); }, - WriteLine: function(str) { process.stderr.write(str + '\n'); }, - Close: function() { } - }, - stdout: { - Write: function(str) { process.stdout.write(str); }, - WriteLine: function(str) { process.stdout.write(str + '\n'); }, - Close: function() { } - }, - watchFile: function(filename: string, callback: (string) => void ): IFileWatcher { - var firstRun = true; - var processingChange = false; - - var fileChanged: any = function(curr, prev) { - if (!firstRun) { - if (curr.mtime < prev.mtime) { - return; - } - - _fs.unwatchFile(filename, fileChanged); - if (!processingChange) { - processingChange = true; - callback(filename); - setTimeout(function() { processingChange = false; }, 100); - } - } - firstRun = false; - _fs.watchFile(filename, { persistent: true, interval: 500 }, fileChanged); - }; - - fileChanged(); - return { - filename: filename, - close: function() { - _fs.unwatchFile(filename, fileChanged); - } - }; - }, - run: function(source, filename) { - require.main.filename = filename; - require.main.paths = _module._nodeModulePaths(_path.dirname(_fs.realpathSync(filename))); - require.main._compile(source, filename); - }, - getExecutingFilePath: function () { - return process.mainModule.filename; - }, - quit: process.exit - } - }; - - if (typeof ActiveXObject === "function") - return getWindowsScriptHostIO(); - else if (typeof require === "function") - return getNodeIO(); - else - return null; // Unsupported host -})(); diff --git a/_infrastructure/runner.js b/_infrastructure/tests/runner.js similarity index 50% rename from _infrastructure/runner.js rename to _infrastructure/tests/runner.js index 21be7da7b..7788858c6 100644 --- a/_infrastructure/runner.js +++ b/_infrastructure/tests/runner.js @@ -1,514 +1,4 @@ -var ExecResult = (function () { - function ExecResult() { - this.stdout = ""; - this.stderr = ""; - } - return ExecResult; -})(); - -var WindowsScriptHostExec = (function () { - function WindowsScriptHostExec() { - } - WindowsScriptHostExec.prototype.exec = function (filename, cmdLineArgs, handleResult) { - var result = new ExecResult(); - var shell = new ActiveXObject('WScript.Shell'); - try { - var process = shell.Exec(filename + ' ' + cmdLineArgs.join(' ')); - } catch (e) { - result.stderr = e.message; - result.exitCode = 1; - handleResult(result); - return; - } - - while (process.Status != 0) { - } - - result.exitCode = process.ExitCode; - if (!process.StdOut.AtEndOfStream) - result.stdout = process.StdOut.ReadAll(); - if (!process.StdErr.AtEndOfStream) - result.stderr = process.StdErr.ReadAll(); - - handleResult(result); - }; - return WindowsScriptHostExec; -})(); - -var NodeExec = (function () { - function NodeExec() { - } - NodeExec.prototype.exec = function (filename, cmdLineArgs, handleResult) { - var nodeExec = require('child_process').exec; - - var result = new ExecResult(); - result.exitCode = null; - var cmdLine = filename + ' ' + cmdLineArgs.join(' '); - - var process = nodeExec(cmdLine, function (error, stdout, stderr) { - result.stdout = stdout; - result.stderr = stderr; - result.exitCode = error ? error.code : 0; - handleResult(result); - }); - }; - return NodeExec; -})(); - -var Exec = (function () { - var global = Function("return this;").call(null); - if (typeof global.ActiveXObject !== "undefined") { - return new WindowsScriptHostExec(); - } else { - return new NodeExec(); - } -})(); -var IOUtils; -(function (IOUtils) { - function createDirectoryStructure(ioHost, dirName) { - if (ioHost.directoryExists(dirName)) { - return; - } - - var parentDirectory = ioHost.dirName(dirName); - if (parentDirectory != "") { - createDirectoryStructure(ioHost, parentDirectory); - } - ioHost.createDirectory(dirName); - } - - function createFileAndFolderStructure(ioHost, fileName, useUTF8) { - var path = ioHost.resolvePath(fileName); - var dirName = ioHost.dirName(path); - createDirectoryStructure(ioHost, dirName); - return ioHost.createFile(path, useUTF8); - } - IOUtils.createFileAndFolderStructure = createFileAndFolderStructure; - - function throwIOError(message, error) { - var errorMessage = message; - if (error && error.message) { - errorMessage += (" " + error.message); - } - throw new Error(errorMessage); - } - IOUtils.throwIOError = throwIOError; -})(IOUtils || (IOUtils = {})); - -var IO = (function () { - function getWindowsScriptHostIO() { - var fso = new ActiveXObject("Scripting.FileSystemObject"); - var streamObjectPool = []; - - function getStreamObject() { - if (streamObjectPool.length > 0) { - return streamObjectPool.pop(); - } else { - return new ActiveXObject("ADODB.Stream"); - } - } - - function releaseStreamObject(obj) { - streamObjectPool.push(obj); - } - - var args = []; - for (var i = 0; i < WScript.Arguments.length; i++) { - args[i] = WScript.Arguments.Item(i); - } - - return { - readFile: function (path) { - try { - var streamObj = getStreamObject(); - streamObj.Open(); - streamObj.Type = 2; - streamObj.Charset = 'x-ansi'; - streamObj.LoadFromFile(path); - var bomChar = streamObj.ReadText(2); - streamObj.Position = 0; - if ((bomChar.charCodeAt(0) == 0xFE && bomChar.charCodeAt(1) == 0xFF) || (bomChar.charCodeAt(0) == 0xFF && bomChar.charCodeAt(1) == 0xFE)) { - streamObj.Charset = 'unicode'; - } else if (bomChar.charCodeAt(0) == 0xEF && bomChar.charCodeAt(1) == 0xBB) { - streamObj.Charset = 'utf-8'; - } - - var str = streamObj.ReadText(-1); - streamObj.Close(); - releaseStreamObject(streamObj); - return str; - } catch (err) { - IOUtils.throwIOError("Error reading file \"" + path + "\".", err); - } - }, - writeFile: function (path, contents) { - var file = this.createFile(path); - file.Write(contents); - file.Close(); - }, - fileExists: function (path) { - return fso.FileExists(path); - }, - resolvePath: function (path) { - return fso.GetAbsolutePathName(path); - }, - dirName: function (path) { - return fso.GetParentFolderName(path); - }, - findFile: function (rootPath, partialFilePath) { - var path = fso.GetAbsolutePathName(rootPath) + "/" + partialFilePath; - - while (true) { - if (fso.FileExists(path)) { - try { - var content = this.readFile(path); - return { content: content, path: path }; - } catch (err) { - } - } else { - rootPath = fso.GetParentFolderName(fso.GetAbsolutePathName(rootPath)); - - if (rootPath == "") { - return null; - } else { - path = fso.BuildPath(rootPath, partialFilePath); - } - } - } - }, - deleteFile: function (path) { - try { - if (fso.FileExists(path)) { - fso.DeleteFile(path, true); - } - } catch (e) { - IOUtils.throwIOError("Couldn't delete file '" + path + "'.", e); - } - }, - createFile: function (path, useUTF8) { - try { - var streamObj = getStreamObject(); - streamObj.Charset = useUTF8 ? 'utf-8' : 'x-ansi'; - streamObj.Open(); - return { - Write: function (str) { - streamObj.WriteText(str, 0); - }, - WriteLine: function (str) { - streamObj.WriteText(str, 1); - }, - Close: function () { - try { - streamObj.SaveToFile(path, 2); - } catch (saveError) { - IOUtils.throwIOError("Couldn't write to file '" + path + "'.", saveError); - } finally { - if (streamObj.State != 0) { - streamObj.Close(); - } - releaseStreamObject(streamObj); - } - } - }; - } catch (creationError) { - IOUtils.throwIOError("Couldn't write to file '" + path + "'.", creationError); - } - }, - directoryExists: function (path) { - return fso.FolderExists(path); - }, - createDirectory: function (path) { - try { - if (!this.directoryExists(path)) { - fso.CreateFolder(path); - } - } catch (e) { - IOUtils.throwIOError("Couldn't create directory '" + path + "'.", e); - } - }, - dir: function (path, spec, options) { - options = options || {}; - function filesInFolder(folder, root) { - var paths = []; - var fc; - - if (options.recursive) { - fc = new Enumerator(folder.subfolders); - - for (; !fc.atEnd(); fc.moveNext()) { - paths = paths.concat(filesInFolder(fc.item(), root + "/" + fc.item().Name)); - } - } - - fc = new Enumerator(folder.files); - - for (; !fc.atEnd(); fc.moveNext()) { - if (!spec || fc.item().Name.match(spec)) { - paths.push(root + "/" + fc.item().Name); - } - } - - return paths; - } - - var folder = fso.GetFolder(path); - var paths = []; - - return filesInFolder(folder, path); - }, - print: function (str) { - WScript.StdOut.Write(str); - }, - printLine: function (str) { - WScript.Echo(str); - }, - arguments: args, - stderr: WScript.StdErr, - stdout: WScript.StdOut, - watchFile: null, - run: function (source, filename) { - try { - eval(source); - } catch (e) { - IOUtils.throwIOError("Error while executing file '" + filename + "'.", e); - } - }, - getExecutingFilePath: function () { - return WScript.ScriptFullName; - }, - quit: function (exitCode) { - if (typeof exitCode === "undefined") { exitCode = 0; } - try { - WScript.Quit(exitCode); - } catch (e) { - } - } - }; - } - ; - - function getNodeIO() { - var _fs = require('fs'); - var _path = require('path'); - var _module = require('module'); - - return { - readFile: function (file) { - try { - var buffer = _fs.readFileSync(file); - switch (buffer[0]) { - case 0xFE: - if (buffer[1] == 0xFF) { - var i = 0; - while ((i + 1) < buffer.length) { - var temp = buffer[i]; - buffer[i] = buffer[i + 1]; - buffer[i + 1] = temp; - i += 2; - } - return buffer.toString("ucs2", 2); - } - break; - case 0xFF: - if (buffer[1] == 0xFE) { - return buffer.toString("ucs2", 2); - } - break; - case 0xEF: - if (buffer[1] == 0xBB) { - return buffer.toString("utf8", 3); - } - } - - return buffer.toString(); - } catch (e) { - IOUtils.throwIOError("Error reading file \"" + file + "\".", e); - } - }, - writeFile: _fs.writeFileSync, - deleteFile: function (path) { - try { - _fs.unlinkSync(path); - } catch (e) { - IOUtils.throwIOError("Couldn't delete file '" + path + "'.", e); - } - }, - fileExists: function (path) { - return _fs.existsSync(path); - }, - createFile: function (path, useUTF8) { - function mkdirRecursiveSync(path) { - var stats = _fs.statSync(path); - if (stats.isFile()) { - IOUtils.throwIOError("\"" + path + "\" exists but isn't a directory.", null); - } else if (stats.isDirectory()) { - return; - } else { - mkdirRecursiveSync(_path.dirname(path)); - _fs.mkdirSync(path, 0775); - } - } - - mkdirRecursiveSync(_path.dirname(path)); - - try { - var fd = _fs.openSync(path, 'w'); - } catch (e) { - IOUtils.throwIOError("Couldn't write to file '" + path + "'.", e); - } - return { - Write: function (str) { - _fs.writeSync(fd, str); - }, - WriteLine: function (str) { - _fs.writeSync(fd, str + '\r\n'); - }, - Close: function () { - _fs.closeSync(fd); - fd = null; - } - }; - }, - dir: function dir(path, spec, options) { - options = options || {}; - - function filesInFolder(folder, deep) { - var paths = []; - - var files = _fs.readdirSync(folder); - for (var i = 0; i < files.length; i++) { - var stat = _fs.statSync(folder + "/" + files[i]); - if (options.recursive && stat.isDirectory()) { - if (deep < (options.deep || 100)) { - paths = paths.concat(filesInFolder(folder + "/" + files[i], 1)); - } - } else if (stat.isFile() && (!spec || files[i].match(spec))) { - paths.push(folder + "/" + files[i]); - } - } - - return paths; - } - - return filesInFolder(path, 0); - }, - createDirectory: function (path) { - try { - if (!this.directoryExists(path)) { - _fs.mkdirSync(path); - } - } catch (e) { - IOUtils.throwIOError("Couldn't create directory '" + path + "'.", e); - } - }, - directoryExists: function (path) { - return _fs.existsSync(path) && _fs.lstatSync(path).isDirectory(); - }, - resolvePath: function (path) { - return _path.resolve(path); - }, - dirName: function (path) { - return _path.dirname(path); - }, - findFile: function (rootPath, partialFilePath) { - var path = rootPath + "/" + partialFilePath; - - while (true) { - if (_fs.existsSync(path)) { - try { - var content = this.readFile(path); - return { content: content, path: path }; - } catch (err) { - } - } else { - var parentPath = _path.resolve(rootPath, ".."); - - if (rootPath === parentPath) { - return null; - } else { - rootPath = parentPath; - path = _path.resolve(rootPath, partialFilePath); - } - } - } - }, - print: function (str) { - process.stdout.write(str); - }, - printLine: function (str) { - process.stdout.write(str + '\n'); - }, - arguments: process.argv.slice(2), - stderr: { - Write: function (str) { - process.stderr.write(str); - }, - WriteLine: function (str) { - process.stderr.write(str + '\n'); - }, - Close: function () { - } - }, - stdout: { - Write: function (str) { - process.stdout.write(str); - }, - WriteLine: function (str) { - process.stdout.write(str + '\n'); - }, - Close: function () { - } - }, - watchFile: function (filename, callback) { - var firstRun = true; - var processingChange = false; - - var fileChanged = function (curr, prev) { - if (!firstRun) { - if (curr.mtime < prev.mtime) { - return; - } - - _fs.unwatchFile(filename, fileChanged); - if (!processingChange) { - processingChange = true; - callback(filename); - setTimeout(function () { - processingChange = false; - }, 100); - } - } - firstRun = false; - _fs.watchFile(filename, { persistent: true, interval: 500 }, fileChanged); - }; - - fileChanged(); - return { - filename: filename, - close: function () { - _fs.unwatchFile(filename, fileChanged); - } - }; - }, - run: function (source, filename) { - require.main.filename = filename; - require.main.paths = _module._nodeModulePaths(_path.dirname(_fs.realpathSync(filename))); - require.main._compile(source, filename); - }, - getExecutingFilePath: function () { - return process.mainModule.filename; - }, - quit: process.exit - }; - } - ; - - if (typeof ActiveXObject === "function") - return getWindowsScriptHostIO(); else if (typeof require === "function") - return getNodeIO(); else - return null; -})(); -var DefinitelyTyped; +var DefinitelyTyped; (function (DefinitelyTyped) { (function (TestManager) { var path = require('path'); @@ -537,7 +27,7 @@ var DefinitelyTyped; function Tsc() { } Tsc.run = function (tsfile, callback) { - Exec.exec('node ./_infrastructure/typescript/tsc.js ', [tsfile], function (ExecResult) { + Exec.exec('node ./_infrastructure/tests/typescript/tsc.js ', [tsfile], function (ExecResult) { callback(ExecResult); }); }; @@ -1052,7 +542,7 @@ var DefinitelyTyped; var TestManager = DefinitelyTyped.TestManager; })(DefinitelyTyped || (DefinitelyTyped = {})); -var dtPath = __dirname + '/..'; +var dtPath = __dirname + '/../..'; var runner = new DefinitelyTyped.TestManager.TestRunner(dtPath); runner.run(); diff --git a/_infrastructure/runner.ts b/_infrastructure/tests/runner.ts similarity index 95% rename from _infrastructure/runner.ts rename to _infrastructure/tests/runner.ts index 0afe954e9..175194755 100644 --- a/_infrastructure/runner.ts +++ b/_infrastructure/tests/runner.ts @@ -28,7 +28,7 @@ module DefinitelyTyped { class Tsc { public static run(tsfile: string, callback: Function) { - Exec.exec('node ./_infrastructure/typescript/tsc.js ', [tsfile], (ExecResult) => { + Exec.exec('node ./_infrastructure/tests/typescript/tsc.js ', [tsfile], (ExecResult) => { callback(ExecResult); }); } @@ -551,7 +551,7 @@ module DefinitelyTyped { declare var __dirname: any; -var dtPath = __dirname + '/..'; +var dtPath = __dirname + '/../..'; var runner = new DefinitelyTyped.TestManager.TestRunner(dtPath); runner.run(); diff --git a/_infrastructure/tests/src/io.js b/_infrastructure/tests/src/io.js index 0a3418568..0058d59f9 100644 --- a/_infrastructure/tests/src/io.js +++ b/_infrastructure/tests/src/io.js @@ -307,14 +307,16 @@ var IO = (function () { dir: function dir(path, spec, options) { options = options || {}; - function filesInFolder(folder) { + function filesInFolder(folder, deep) { var paths = []; var files = _fs.readdirSync(folder); for (var i = 0; i < files.length; i++) { var stat = _fs.statSync(folder + "/" + files[i]); if (options.recursive && stat.isDirectory()) { - paths = paths.concat(filesInFolder(folder + "/" + files[i])); + if (deep < (options.deep || 100)) { + paths = paths.concat(filesInFolder(folder + "/" + files[i], 1)); + } } else if (stat.isFile() && (!spec || files[i].match(spec))) { paths.push(folder + "/" + files[i]); } @@ -323,7 +325,7 @@ var IO = (function () { return paths; } - return filesInFolder(path); + return filesInFolder(path, 0); }, createDirectory: function (path) { try { diff --git a/_infrastructure/tests/src/io.ts b/_infrastructure/tests/src/io.ts index 3c68154a1..9c5345136 100644 --- a/_infrastructure/tests/src/io.ts +++ b/_infrastructure/tests/src/io.ts @@ -25,11 +25,11 @@ interface IFileWatcher { interface IIO { readFile(path: string): string; writeFile(path: string, contents: string): void; - createFile(path: string, useUTF8?: boolean): ITextWriter; + createFile(path: string, useUTF8?: bool): ITextWriter; deleteFile(path: string): void; - dir(path: string, re?: RegExp, options?: { recursive?: boolean; }): string[]; - fileExists(path: string): boolean; - directoryExists(path: string): boolean; + dir(path: string, re?: RegExp, options?: { recursive?: bool; deep?: number; }): string[]; + fileExists(path: string): bool; + directoryExists(path: string): bool; createDirectory(path: string): void; resolvePath(path: string): string; dirName(path: string): string; @@ -60,7 +60,7 @@ module IOUtils { } // Creates a file including its directory structure if not already present - export function createFileAndFolderStructure(ioHost: IIO, fileName: string, useUTF8?: boolean) { + export function createFileAndFolderStructure(ioHost: IIO, fileName: string, useUTF8?: bool) { var path = ioHost.resolvePath(fileName); var dirName = ioHost.dirName(path); createDirectoryStructure(ioHost, dirName); @@ -78,13 +78,13 @@ module IOUtils { // Declare dependencies needed for all supported hosts declare class Enumerator { - public atEnd(): boolean; + public atEnd(): bool; public moveNext(); public item(): any; constructor (o: any); } declare function setTimeout(callback: () =>void , ms?: number); -declare var require: any; +//declare var require: any; declare module process { export var argv: string[]; export var platform: string; @@ -160,7 +160,7 @@ var IO = (function() { file.Close(); }, - fileExists: function(path: string): boolean { + fileExists: function(path: string): bool { return fso.FileExists(path); }, @@ -236,7 +236,7 @@ var IO = (function() { }, directoryExists: function(path) { - return fso.FolderExists(path); + return fso.FolderExists(path); }, createDirectory: function(path) { @@ -250,7 +250,7 @@ var IO = (function() { }, dir: function(path, spec?, options?) { - options = options || <{ recursive?: boolean; }>{}; + options = options || <{ recursive?: bool; deep?: number; }>{}; function filesInFolder(folder, root): string[]{ var paths = []; var fc: Enumerator; @@ -365,7 +365,7 @@ var IO = (function() { IOUtils.throwIOError("Couldn't delete file '" + path + "'.", e); } }, - fileExists: function(path): boolean { + fileExists: function(path): bool { return _fs.existsSync(path); }, createFile: function(path, useUTF8?) { @@ -395,16 +395,18 @@ var IO = (function() { }; }, dir: function dir(path, spec?, options?) { - options = options || <{ recursive?: boolean; }>{}; + options = options || <{ recursive?: bool; deep?: number; }>{}; - function filesInFolder(folder: string): string[]{ + function filesInFolder(folder: string, deep?: number): string[]{ var paths = []; var files = _fs.readdirSync(folder); for (var i = 0; i < files.length; i++) { var stat = _fs.statSync(folder + "/" + files[i]); if (options.recursive && stat.isDirectory()) { - paths = paths.concat(filesInFolder(folder + "/" + files[i])); + if (deep < (options.deep || 100)) { + paths = paths.concat(filesInFolder(folder + "/" + files[i], 1)); + } } else if (stat.isFile() && (!spec || files[i].match(spec))) { paths.push(folder + "/" + files[i]); } @@ -413,7 +415,7 @@ var IO = (function() { return paths; } - return filesInFolder(path); + return filesInFolder(path, 0); }, createDirectory: function(path: string): void { try { @@ -425,7 +427,7 @@ var IO = (function() { } }, - directoryExists: function(path: string): boolean { + directoryExists: function(path: string): bool { return _fs.existsSync(path) && _fs.lstatSync(path).isDirectory(); }, resolvePath: function(path: string): string { diff --git a/_infrastructure/tests/testRunner.js b/_infrastructure/tests/testRunner.js deleted file mode 100644 index 53a36dcd3..000000000 --- a/_infrastructure/tests/testRunner.js +++ /dev/null @@ -1,152 +0,0 @@ -var cfg = { - root: '.', - pattern: /.\-tests\.ts/g, - tsc: 'node ./_infrastructure/tests/typescript/tsc.js ', - exclude: { - '.git': true, - '.gitignore': true, - 'package.json': true, - '_infrastructure': true, - '.travis.yml': true, - 'LICENSE': true, - 'README.md': true, - '_ReSharper.DefinitelyTyped': true, - 'obj': true, - 'bin': true, - 'Properties': true, - 'DefinitelyTyped.csproj': true, - 'DefinitelyTyped.csproj.user': true, - 'DefinitelyTyped.sln': true, - 'DefinitelyTyped.v11.suo': true - } -}; - -if (process.argv.length > 2) { - cfg.root = process.argv[2]; -} - -var TestFile = (function () { - function TestFile() { - this.errors = []; - } - return TestFile; -})(); - -var Test = (function () { - function Test(lib) { - this.lib = lib; - this.files = []; - } - return Test; -})(); - -var Tests = (function () { - function Tests() { - this.tests = []; - } - return Tests; -})(); - -function getLibDirectory(file) { - return file.substr(cfg.root.length).split('/')[1]; -} - -function getErrorList(out) { - var splitContentByNewlines = function (content) { - var lines = content.split('\r\n'); - if (lines.length === 1) { - lines = content.split('\n'); - } - return lines; - }; - - var result = []; - - var lines = splitContentByNewlines(out); - - for (var i = 0; i < lines.length; i++) { - if (lines[i]) { - result.push(lines[i]); - } - } - - return result; -} - -function runTests(testFiles) { - var tests = new Tests(); - - Exec.exec(cfg.tsc, [testFiles[testIndex]], function (ExecResult) { - var lib = getLibDirectory(testFiles[testIndex]); - - cache_visited_libs[lib] = true; - - var testFile = new TestFile(); - testFile.name = testFiles[testIndex]; - testFile.errors = getErrorList(ExecResult.stderr); - - if (testFile.errors.length == 0) { - total_success++; - } else { - total_failure++; - } - - console.log(' [\033[36m' + lib + '\033[0m] ' + testFiles[testIndex].substr(cfg.root.length) + ' - ' + (testFile.errors.length == 0 ? '\033[32msuccess\033[0m' : '\033[31mfailure\033[0m')); - - var test = new Test(lib); - test.files.push(testFile); - tests.tests.push(test); - - testIndex++; - if (testIndex < totalTest) { - Exec.exec(cfg.tsc, [testFiles[testIndex]], arguments.callee); - } else { - var withoutTests = {}; - for (var k = 0; k < allFiles.length; k++) { - var rootFolder = allFiles[k].substr(cfg.root.length).split('/')[1]; - if (!(rootFolder in cfg.exclude)) { - if (!(rootFolder in cache_visited_libs)) { - withoutTests[rootFolder] = true; - } - } - } - - var withoutTestsCount = 0; - for (var attr in withoutTests) { - var test = new Test(attr); - tests.tests.push(test); - - console.log(' [\033[36m' + attr + '\033[0m] without tests'); - withoutTestsCount++; - } - - console.log('\n> ' + (total_failure + total_success + withoutTestsCount) + ' tests. ' + '\033[32m' + total_success + ' tests success\033[0m, ' + '\033[31m' + total_failure + ' tests failed\033[0m and ' + withoutTestsCount + ' definitions without tests.\n'); - - if (total_failure > 0) { - process.exit(1); - } - } - }); -} - -var testFiles = IO.dir(cfg.root, cfg.pattern, { recursive: true, deep: 1 }); - -var allFiles = IO.dir(cfg.root, null, { recursive: true }); - -var totalTest = testFiles.length; -var testIndex = 0; -var cache_visited_libs = {}; - -var total_failure = 0; -var total_success = 0; - -var tscVersion = '?.?.?'; - -Exec.exec(cfg.tsc, ['-version'], function (ExecResult) { - tscVersion = ExecResult.stdout; - - console.log('$ tsc -version'); - console.log(tscVersion); - - runTests(testFiles); -}); diff --git a/_infrastructure/tests/testRunner.ts b/_infrastructure/tests/testRunner.ts deleted file mode 100644 index c70da8d3c..000000000 --- a/_infrastructure/tests/testRunner.ts +++ /dev/null @@ -1,168 +0,0 @@ -/// -/// - -var cfg = { - root: '.', - pattern: /.\-tests\.ts/g, - tsc: 'node ./_infrastructure/tests/typescript/tsc.js ', - exclude: { - '.git': true, - '.gitignore': true, - 'package.json': true, - '_infrastructure': true, - '.travis.yml': true, - 'LICENSE': true, - 'README.md': true, - '_ReSharper.DefinitelyTyped': true, - 'obj': true, - 'bin': true, - 'Properties': true, - 'DefinitelyTyped.csproj': true, - 'DefinitelyTyped.csproj.user': true, - 'DefinitelyTyped.sln': true, - 'DefinitelyTyped.v11.suo': true - } -}; - -if (process.argv.length > 2) { - cfg.root = process.argv[2]; -} - -class TestFile { - public name: string; - public errors: string[] = []; -} - -class Test { - public files: TestFile[] = []; - constructor(public lib: string) { } -} - -class Tests { - public tests: Test[] = []; -} - -function getLibDirectory(file: string) { - return file.substr(cfg.root.length).split('/')[1]; -} - -function getErrorList(out): string[] { - var splitContentByNewlines = function (content: string) { - var lines = content.split('\r\n'); - if (lines.length === 1) { - lines = content.split('\n'); - } - return lines; - } - - var result: string[] = []; - - var lines = splitContentByNewlines(out); - - for (var i = 0; i < lines.length; i++) { - if (lines[i]) { - result.push(lines[i]); - } - } - - return result; -} - -function runTests(testFiles) { - var tests = new Tests(); - - Exec.exec( - cfg.tsc, - [testFiles[testIndex]], - (ExecResult) => { - var lib = getLibDirectory(testFiles[testIndex]); - - cache_visited_libs[lib] = true; - - var testFile = new TestFile(); - testFile.name = testFiles[testIndex]; - testFile.errors = getErrorList(ExecResult.stderr); - - if (testFile.errors.length == 0) { - total_success++; - } else { - total_failure++; - } - - console.log(' [\033[36m' + lib + '\033[0m] ' + testFiles[testIndex].substr(cfg.root.length) - + ' - ' + (testFile.errors.length == 0 ? '\033[32msuccess\033[0m' : '\033[31mfailure\033[0m')); - - var test = new Test(lib); - test.files.push(testFile); - tests.tests.push(test); - - testIndex++; - if (testIndex < totalTest) { - Exec.exec( - cfg.tsc, - [testFiles[testIndex]], - <(ExecResult) => any>arguments.callee); - } else { - var withoutTests = {}; - for (var k = 0; k < allFiles.length; k++) { - var rootFolder = allFiles[k].substr(cfg.root.length).split('/')[1]; - if (!(rootFolder in cfg.exclude)) { - if (!(rootFolder in cache_visited_libs)) { - withoutTests[rootFolder] = true; - } - } - } - - var withoutTestsCount = 0; - for (var attr in withoutTests) { - - var test = new Test(attr); - tests.tests.push(test); - - console.log(' [\033[36m' + attr + '\033[0m] without tests'); - withoutTestsCount++; - } - - console.log('\n> ' + (total_failure + total_success + withoutTestsCount) - + ' tests. ' - + '\033[32m' + total_success + ' tests success\033[0m, ' - + '\033[31m' + total_failure + ' tests failed\033[0m and ' - + withoutTestsCount + ' definitions without tests.\n'); - - if (total_failure > 0) { - process.exit(1); - } - } - }); -} - -////// GLOBAL VARS - -// get all files: "*-tests.ts" -var testFiles = IO.dir(cfg.root, cfg.pattern, { recursive: true, deep: 1 }); - -// get all proect files -var allFiles = IO.dir(cfg.root, null, { recursive: true }); - -var totalTest = testFiles.length; -var testIndex = 0; -var cache_visited_libs = {}; - -// total -var total_failure = 0; -var total_success = 0; - -// var to have current typescript version -var tscVersion = '?.?.?'; - -////// END GLOBAL VARS - -// entry point -Exec.exec(cfg.tsc, ['-version'], (ExecResult) => { - tscVersion = ExecResult.stdout; - - console.log('$ tsc -version'); - console.log(tscVersion); - - runTests(testFiles); -}); \ No newline at end of file diff --git a/_infrastructure/typescript/lib.d.ts b/_infrastructure/typescript/lib.d.ts deleted file mode 100644 index 95d15c1a2..000000000 --- a/_infrastructure/typescript/lib.d.ts +++ /dev/null @@ -1,9074 +0,0 @@ -/* ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - -/// - -//////////////// -/// ECMAScript APIs -//////////////// - -declare var NaN: number; -declare var Infinity: number; - -/** - * Evaluates JavaScript code and executes it. - * @param x A String value that contains valid JavaScript code. - */ -declare function eval(x: string): any; - -/** - * Converts A string to an integer. - * @param s A string to convert into a number. - * @param radix A value between 2 and 36 that specifies the base of the number in numString. - * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. - * All other strings are considered decimal. - */ -declare function parseInt(s: string, radix?: number): number; - -/** - * Converts a string to a floating-point number. - * @param string A string that contains a floating-point number. - */ -declare function parseFloat(string: string): number; - -/** - * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number). - * @param number A numeric value. - */ -declare function isNaN(number: number): boolean; - -/** - * Determines whether a supplied number is finite. - * @param number Any numeric value. - */ -declare function isFinite(number: number): boolean; - -/** - * Gets the unencoded version of an encoded Uniform Resource Identifier (URI). - * @param encodedURI A value representing an encoded URI. - */ -declare function decodeURI(encodedURI: string): string; - -/** - * Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI). - * @param encodedURIComponent A value representing an encoded URI component. - */ -declare function decodeURIComponent(encodedURIComponent: string): string; - -/** - * Encodes a text string as a valid Uniform Resource Identifier (URI) - * @param uri A value representing an encoded URI. - */ -declare function encodeURI(uri: string): string; - -/** - * Encodes a text string as a valid component of a Uniform Resource Identifier (URI). - * @param uriComponent A value representing an encoded URI component. - */ -declare function encodeURIComponent(uriComponent: string): string; - -interface PropertyDescriptor { - configurable?: boolean; - enumerable?: boolean; - value?: any; - writable?: boolean; - get?(): any; - set?(v: any): void; -} - -interface PropertyDescriptorMap { - [s: string]: PropertyDescriptor; -} - -interface Object { - /** Returns a string representation of an object. */ - toString(): string; - - /** Returns a date converted to a string using the current locale. */ - toLocaleString(): string; - - /** Returns the primitive value of the specified object. */ - valueOf(): Object; - - /** - * Determines whether an object has a property with the specified name. - * @param v A property name. - */ - hasOwnProperty(v: string): boolean; - - /** - * Determines whether an object exists in another object's prototype chain. - * @param v Another object whose prototype chain is to be checked. - */ - isPrototypeOf(v: Object): boolean; - - /** - * Determines whether a specified property is enumerable. - * @param v A property name. - */ - propertyIsEnumerable(v: string): boolean; - - [s: string]: any; -} - -/** - * Provides functionality common to all JavaScript objects. - */ -declare var Object: { - new (value?: any): Object; - (): any; - (value: any): any; - - /** A reference to the prototype for a class of objects. */ - prototype: Object; - - /** - * Returns the prototype of an object. - * @param o The object that references the prototype. - */ - getPrototypeOf(o: any): any; - - /** - * Gets the own property descriptor of the specified object. - * An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype. - * @param o Object that contains the property. - * @param p Name of the property. - */ - getOwnPropertyDescriptor(o: any, p: string): PropertyDescriptor; - - /** - * Returns the names of the own properties of an object. The own properties of an object are those that are defined directly - * on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions. - * @param o Object that contains the own properties. - */ - getOwnPropertyNames(o: any): string[]; - - /** - * Creates an object that has the specified prototype, and that optionally contains specified properties. - * @param o Object to use as a prototype. May be null - * @param properties JavaScript object that contains one or more property descriptors. - */ - create(o: any, properties?: PropertyDescriptorMap): any; - - /** - * Adds a property to an object, or modifies attributes of an existing property. - * @param o Object on which to add or modify the property. This can be a native JavaScript object (that is, a user-defined object or a built in object) or a DOM object. - * @param p The property name. - * @param attributes Descriptor for the property. It can be for a data property or an accessor property. - */ - defineProperty(o: any, p: string, attributes: PropertyDescriptor): any; - - /** - * Adds one or more properties to an object, and/or modifies attributes of existing properties. - * @param o Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object. - * @param properties JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property. - */ - defineProperties(o: any, properties: PropertyDescriptorMap): any; - - /** - * Prevents the modification of attributes of existing properties, and prevents the addition of new properties. - * @param o Object on which to lock the attributes. - */ - seal(o: any): any; - - /** - * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. - * @param o Object on which to lock the attributes. - */ - freeze(o: any): any; - - /** - * Prevents the addition of new properties to an object. - * @param o Object to make non-extensible. - */ - preventExtensions(o: any): any; - - /** - * Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object. - * @param o Object to test. - */ - isSealed(o: any): boolean; - - /** - * Returns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object. - * @param o Object to test. - */ - isFrozen(o: any): boolean; - - /** - * Returns a value that indicates whether new properties can be added to an object. - * @param o Object to test. - */ - isExtensible(o: any): boolean; - - /** - * Returns the names of the enumerable properties and methods of an object. - * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. - */ - keys(o: any): string[]; -} - -/** - * Creates a new function. - */ -interface Function { - /** - * Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function. - * @param thisArg The object to be used as the this object. - * @param argArray A set of arguments to be passed to the function. - */ - apply(thisArg: any, argArray?: any): any; - - /** - * Calls a method of an object, substituting another object for the current object. - * @param thisArg The object to be used as the current object. - * @param argArray A list of arguments to be passed to the method. - */ - call(thisArg: any, ...argArray: any[]): any; - - /** - * For a given function, creates a bound function that has the same body as the original function. - * The this object of the bound function is associated with the specified object, and has the specified initial parameters. - * @param thisArg An object to which the this keyword can refer inside the new function. - * @param argArray A list of arguments to be passed to the new function. - */ - bind(thisArg: any, ...argArray: any[]): any; - - prototype: any; - length: number; - - // Non-standard extensions - arguments: any; - caller: Function; -} - -declare var Function: { - /** - * Creates a new function. - * @param args A list of arguments the function accepts. - */ - new (...args: string[]): Function; - (...args: string[]): Function; - prototype: Function; -} - -interface IArguments { - [index: number]: any; - length: number; - callee: Function; -} - -interface String { - /** Returns a string representation of a string. */ - toString(): string; - - /** - * Returns the character at the specified index. - * @param pos The zero-based index of the desired character. - */ - charAt(pos: number): string; - - /** - * Returns the Unicode value of the character at the specified location. - * @param index The zero-based index of the desired character. If there is no character at the specified index, NaN is returned. - */ - charCodeAt(index: number): number; - - /** - * Returns a string that contains the concatenation of two or more strings. - * @param strings The strings to append to the end of the string. - */ - concat(...strings: string[]): string; - - /** - * Returns the position of the first occurrence of a substring. - * @param searchString The substring to search for in the string - * @param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string. - */ - indexOf(searchString: string, position?: number): number; - - /** - * Returns the last occurrence of a substring in the string. - * @param searchString The substring to search for. - * @param position The index at which to begin searching. If omitted, the search begins at the end of the string. - */ - lastIndexOf(searchString: string, position?: number): number; - - /** - * Determines whether two strings are equivalent in the current locale. - * @param that String to compare to target string - */ - localeCompare(that: string): number; - - /** - * Matches a string with a regular expression, and returns an array containing the results of that search. - * @param regexp A variable name or string literal containing the regular expression pattern and flags. - */ - match(regexp: string): string[]; - /** - * Matches a string with a regular expression, and returns an array containing the results of that search. - * @param regexp A regular expression object that contains the regular expression pattern and applicable flags. - */ - match(regexp: RegExp): string[]; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A String object or string literal that represents the regular expression - * @param replaceValue A String object or string literal containing the text to replace for every successful match of rgExp in stringObj. - */ - replace(searchValue: string, replaceValue: string): string; - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A String object or string literal that represents the regular expression - * @param replaceValue A function that returns the replacement text. - */ - replace(searchValue: string, replaceValue: (substring: string, ...args: any[]) => string): string; - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags - * @param replaceValue A String object or string literal containing the text to replace for every successful match of rgExp in stringObj. - */ - replace(searchValue: RegExp, replaceValue: string): string; - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags - * @param replaceValue A function that returns the replacement text. - */ - replace(searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; - - /** - * Finds the first substring match in a regular expression search. - * @param regexp The regular expression pattern and applicable flags. - */ - search(regexp: string): number; - /** - * Finds the first substring match in a regular expression search. - * @param regexp The regular expression pattern and applicable flags. - */ - search(regexp: RegExp): number; - - /** - * Returns a section of a string. - * @param start The index to the beginning of the specified portion of stringObj. - * @param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end. - * If this value is not specified, the substring continues to the end of stringObj. - */ - slice(start: number, end?: number): string; - - /** - * Split a string into substrings using the specified separator and return them as an array. - * @param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned. - * @param limit A value used to limit the number of elements returned in the array. - */ - split(separator: string, limit?: number): string[]; - /** - * Split a string into substrings using the specified separator and return them as an array. - * @param separator A Regular Express that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned. - * @param limit A value used to limit the number of elements returned in the array. - */ - split(separator: RegExp, limit?: number): string[]; - - /** - * Returns the substring at the specified location within a String object. - * @param start The zero-based index integer indicating the beginning of the substring. - * @param end Zero-based index integer indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end. - * If end is omitted, the characters from start through the end of the original string are returned. - */ - substring(start: number, end?: number): string; - - /** Converts all the alphabetic characters in a string to lowercase. */ - toLowerCase(): string; - - /** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */ - toLocaleLowerCase(): string; - - /** Converts all the alphabetic characters in a string to uppercase. */ - toUpperCase(): string; - - /** Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. */ - toLocaleUpperCase(): string; - - /** Removes the leading and trailing white space and line terminator characters from a string. */ - trim(): string; - - /** Returns the length of a String object. */ - length: number; - - // IE extensions - /** - * Gets a substring beginning at the specified location and having the specified length. - * @param from The starting position of the desired substring. The index of the first character in the string is zero. - * @param length The number of characters to include in the returned substring. - */ - substr(from: number, length?: number): string; -} - -/** - * Allows manipulation and formatting of text strings and determination and location of substrings within strings. - */ -declare var String: { - new (value?: any): String; - (value?: any): string; - prototype: String; - fromCharCode(...codes: number[]): string; -} - -interface Boolean { -} -declare var Boolean: { - new (value?: any): Boolean; - (value?: any): boolean; - prototype: Boolean; -} - -interface Number { - toString(radix?: number): string; - toFixed(fractionDigits?: number): string; - toExponential(fractionDigits?: number): string; - toPrecision(precision: number): string; -} -/** An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers. */ -declare var Number: { - new (value?: any): Number; - (value?: any): number; - prototype: Number; - /** The largest number that can be represented in JavaScript. Equal to approximately 1.79E+308. */ - MAX_VALUE: number; - /** The closest number to zero that can be represented in JavaScript. Equal to approximately 5.00E-324. */ - MIN_VALUE: number; - /** - * A value that is not a number. - * In equality comparisons, NaN does not equal any value, including itself. To test whether a value is equivalent to NaN, use the isNaN function. - */ - NaN: number; - /** - * A value that is less than the largest negative number that can be represented in JavaScript. - * JavaScript displays NEGATIVE_INFINITY values as -infinity. - */ - NEGATIVE_INFINITY: number; - /** - * A value greater than the largest number that can be represented in JavaScript. - * JavaScript displays POSITIVE_INFINITY values as infinity. - */ - POSITIVE_INFINITY: number; -} - -interface Math { - /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */ - E: number; - /** The natural logarithm of 10. */ - LN10: number; - /** The natural logarithm of 2. */ - LN2: number; - /** The base-2 logarithm of e. */ - LOG2E: number; - /** The base-10 logarithm of e. */ - LOG10E: number; - /** Pi. This is the ratio of the circumference of a circle to its diameter. */ - PI: number; - /** The square root of 0.5, or, equivalently, one divided by the square root of 2. */ - SQRT1_2: number; - /** The square root of 2. */ - SQRT2: number; - /** - * Returns the absolute value of a number (the value without regard to whether it is positive or negative). - * For example, the absolute value of -5 is the same as the absolute value of 5. - * @param x A numeric expression for which the absolute value is needed. - */ - abs(x: number): number; - /** - * Returns the arc cosine (or inverse cosine) of a number. - * @param x A numeric expression. - */ - acos(x: number): number; - /** - * Returns the arcsine of a number. - * @param x A numeric expression. - */ - asin(x: number): number; - /** - * Returns the arctangent of a number. - * @param x A numeric expression for which the arctangent is needed. - */ - atan(x: number): number; - /** - * Returns the angle (in radians) from the X axis to a point (y,x). - * @param y A numeric expression representing the cartesian y-coordinate. - * @param x A numeric expression representing the cartesian x-coordinate. - */ - atan2(y: number, x: number): number; - /** - * Returns the smallest integer greater than or equal to its numeric argument. - * @param x A numeric expression. - */ - ceil(x: number): number; - /** - * Returns the cosine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - cos(x: number): number; - /** - * Returns e (the base of natural logarithms) raised to a power. - * @param x A numeric expression representing the power of e. - */ - exp(x: number): number; - /** - * Returns the greatest integer less than or equal to its numeric argument. - * @param x A numeric expression. - */ - floor(x: number): number; - /** - * Returns the natural logarithm (base e) of a number. - * @param x A numeric expression. - */ - log(x: number): number; - /** - * Returns the larger of a set of supplied numeric expressions. - * @param values Numeric expressions to be evaluated. - */ - max(...values: number[]): number; - /** - * Returns the smaller of a set of supplied numeric expressions. - * @param values Numeric expressions to be evaluated. - */ - min(...values: number[]): number; - /** - * Returns the value of a base expression taken to a specified power. - * @param x The base value of the expression. - * @param y The exponent value of the expression. - */ - pow(x: number, y: number): number; - /** Returns a pseudorandom number between 0 and 1. */ - random(): number; - /** - * Returns a supplied numeric expression rounded to the nearest integer. - * @param x The value to be rounded to the nearest integer. - */ - round(x: number): number; - /** - * Returns the sine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - sin(x: number): number; - /** - * Returns the square root of a number. - * @param x A numeric expression. - */ - sqrt(x: number): number; - /** - * Returns the tangent of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - tan(x: number): number; -} -/** An intrinsic object that provides basic mathematics functionality and constants. */ -declare var Math: Math; - -/** Enables basic storage and retrieval of dates and times. */ -interface Date { - /** Returns a string representation of a date. The format of the string depends on the locale. */ - toString(): string; - /** Returns a date as a string value. */ - toDateString(): string; - /** Returns a time as a string value. */ - toTimeString(): string; - toLocaleString(): string; - /** Returns a date as a string value appropriate to the host environment's current locale. */ - toLocaleDateString(): string; - /** Returns a time as a string value appropriate to the host environment's current locale. */ - toLocaleTimeString(): string; - /** Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC. */ - valueOf(): number; - /** Gets the time value in milliseconds. */ - getTime(): number; - /** Gets the year, using local time. */ - getFullYear(): number; - /** Gets the year using Universal Coordinated Time (UTC). */ - getUTCFullYear(): number; - /** Gets the month, using local time. */ - getMonth(): number; - /** Gets the month of a Date object using Universal Coordinated Time (UTC). */ - getUTCMonth(): number; - /** Gets the day-of-the-month, using local time. */ - getDate(): number; - /** Gets the day-of-the-month, using Universal Coordinated Time (UTC). */ - getUTCDate(): number; - /** Gets the day of the week, using local time. */ - getDay(): number; - /** Gets the day of the week using Universal Coordinated Time (UTC). */ - getUTCDay(): number; - /** Gets the hours in a date, using local time. */ - getHours(): number; - /** Gets the hours value in a Date object using Universal Coordinated Time (UTC). */ - getUTCHours(): number; - /** Gets the minutes of a Date object, using local time. */ - getMinutes(): number; - /** Gets the minutes of a Date object using Universal Coordinated Time (UTC). */ - getUTCMinutes(): number; - /** Gets the seconds of a Date object, using local time. */ - getSeconds(): number; - /** Gets the seconds of a Date object using Universal Coordinated Time (UTC). */ - getUTCSeconds(): number; - /** Gets the milliseconds of a Date, using local time. */ - getMilliseconds(): number; - /** Gets the milliseconds of a Date object using Universal Coordinated Time (UTC). */ - getUTCMilliseconds(): number; - /** Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC). */ - getTimezoneOffset(): number; - /** - * Sets the date and time value in the Date object. - * @param time A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT. - */ - setTime(time: number): void; - /** - * Sets the milliseconds value in the Date object using local time. - * @param ms A numeric value equal to the millisecond value. - */ - setMilliseconds(ms: number): void; - /** - * Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC). - * @param ms A numeric value equal to the millisecond value. - */ - setUTCMilliseconds(ms: number): void; - - /** - * Sets the seconds value in the Date object using local time. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setSeconds(sec: number, ms?: number): void; - /** - * Sets the seconds value in the Date object using Universal Coordinated Time (UTC). - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setUTCSeconds(sec: number, ms?: number): void; - /** - * Sets the minutes value in the Date object using local time. - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setMinutes(min: number, sec?: number, ms?: number): void; - /** - * Sets the minutes value in the Date object using Universal Coordinated Time (UTC). - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setUTCMinutes(min: number, sec?: number, ms?: number): void; - /** - * Sets the hour value in the Date object using local time. - * @param hours A numeric value equal to the hours value. - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setHours(hours: number, min?: number, sec?: number, ms?: number): void; - /** - * Sets the hours value in the Date object using Universal Coordinated Time (UTC). - * @param hours A numeric value equal to the hours value. - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setUTCHours(hours: number, min?: number, sec?: number, ms?: number): void; - /** - * Sets the numeric day-of-the-month value of the Date object using local time. - * @param date A numeric value equal to the day of the month. - */ - setDate(date: number): void; - /** - * Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC). - * @param date A numeric value equal to the day of the month. - */ - setUTCDate(date: number): void; - /** - * Sets the month value in the Date object using local time. - * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. - * @param date A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used. - */ - setMonth(month: number, date?: number): void; - /** - * Sets the month value in the Date object using Universal Coordinated Time (UTC). - * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. - * @param date A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used. - */ - setUTCMonth(month: number, date?: number): void; - /** - * Sets the year of the Date object using local time. - * @param year A numeric value for the year. - * @param month A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified. - * @param date A numeric value equal for the day of the month. - */ - setFullYear(year: number, month?: number, date?: number): void; - /** - * Sets the year value in the Date object using Universal Coordinated Time (UTC). - * @param year A numeric value equal to the year. - * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied. - * @param date A numeric value equal to the day of the month. - */ - setUTCFullYear(year: number, month?: number, date?: number): void; - /** Returns a date converted to a string using Universal Coordinated Time (UTC). */ - toUTCString(): string; - /** Returns a date as a string value in ISO format. */ - toISOString(): string; - /** Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization. */ - toJSON(key?: any): string; -} -/** - * Enables basic storage and retrieval of dates and times. - */ -declare var Date: { - new (): Date; - new (value: number): Date; - new (value: string): Date; - new (year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date; - (): string; - prototype: Date; - /** - * Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970. - * @param s A date string - */ - parse(s: string): number; - /** - * Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date. - * @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year. - * @param month The month as an integer between 0 and 11 (January to December). - * @param date The date as an integer between 1 and 31. - * @param hours Must be supplied if minutes is supplied. An integer from 0 to 23 (midnight to 11pm) that specifies the hour. - * @param minutes Must be supplied if seconds is supplied. An integer from 0 to 59 that specifies the minutes. - * @param seconds Must be supplied if milliseconds is supplied. An integer from 0 to 59 that specifies the seconds. - * @param ms An integer from 0 to 999 that specifies the milliseconds. - */ - UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number; - now(): number; -} - -interface RegExpExecArray { - [index: number]: string; - length: number; - - index: number; - input: string; - - toString(): string; - toLocaleString(): string; - concat(...items: string[][]): string[]; - join(separator?: string): string; - pop(): string; - push(...items: string[]): number; - reverse(): string[]; - shift(): string; - slice(start: number, end?: number): string[]; - sort(compareFn?: (a: string, b: string) => number): string[]; - splice(start: number): string[]; - splice(start: number, deleteCount: number, ...items: string[]): string[]; - unshift(...items: string[]): number; - - indexOf(searchElement: string, fromIndex?: number): number; - lastIndexOf(searchElement: string, fromIndex?: number): number; - every(callbackfn: (value: string, index: number, array: string[]) => boolean, thisArg?: any): boolean; - some(callbackfn: (value: string, index: number, array: string[]) => boolean, thisArg?: any): boolean; - forEach(callbackfn: (value: string, index: number, array: string[]) => void , thisArg?: any): void; - map(callbackfn: (value: string, index: number, array: string[]) => any, thisArg?: any): any[]; - filter(callbackfn: (value: string, index: number, array: string[]) => boolean, thisArg?: any): string[]; - reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: string[]) => any, initialValue?: any): any; - reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: string[]) => any, initialValue?: any): any; -} - - -interface RegExp { - /** - * Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search. - * @param string The String object or string literal on which to perform the search. - */ - exec(string: string): RegExpExecArray; - /** - * Returns a Boolean value that indicates whether or not a pattern exists in a searched string. - * @param string String on which to perform the search. - */ - test(string: string): boolean; - /** Returns a copy of the text of the regular expression pattern. Read-only. The rgExp argument is a Regular expression object. It can be a variable name or a literal. */ - source: string; - /** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */ - global: boolean; - /** Returns a Boolean value indicating the state of the ignoreCase flag (i) used with a regular expression. Default is false. Read-only. */ - ignoreCase: boolean; - /** Returns a Boolean value indicating the state of the multiline flag (m) used with a regular expression. Default is false. Read-only. */ - multiline: boolean; - - lastIndex: number; - - // Non-standard extensions - compile(): RegExp; -} -declare var RegExp: { - new (pattern: string, flags?: string): RegExp; - (pattern: string, flags?: string): RegExp; - - // Non-standard extensions - $1: string; - $2: string; - $3: string; - $4: string; - $5: string; - $6: string; - $7: string; - $8: string; - $9: string; - lastMatch: string; -} - -interface Error { - name: string; - message: string; -} -declare var Error: { - new (message?: string): Error; - (message?: string): Error; - prototype: Error; -} - -interface EvalError extends Error { -} -declare var EvalError: { - new (message?: string): EvalError; - (message?: string): EvalError; - prototype: EvalError; -} - -interface RangeError extends Error { -} -declare var RangeError: { - new (message?: string): RangeError; - (message?: string): RangeError; - prototype: RangeError; -} - -interface ReferenceError extends Error { -} -declare var ReferenceError: { - new (message?: string): ReferenceError; - (message?: string): ReferenceError; - prototype: ReferenceError; -} - -interface SyntaxError extends Error { -} -declare var SyntaxError: { - new (message?: string): SyntaxError; - (message?: string): SyntaxError; - prototype: SyntaxError; -} - -interface TypeError extends Error { -} -declare var TypeError: { - new (message?: string): TypeError; - (message?: string): TypeError; - prototype: TypeError; -} - -interface URIError extends Error { -} -declare var URIError: { - new (message?: string): URIError; - (message?: string): URIError; - prototype: URIError; -} - -interface JSON { - /** - * Converts a JavaScript Object Notation (JSON) string into an object. - * @param text A valid JSON string. - * @param reviver A function that transforms the results. This function is called for each member of the object. - * If a member contains nested objects, the nested objects are transformed before the parent object is. - */ - parse(text: string, reviver?: (key: any, value: any) => any): any; - /** - * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. - * @param value A JavaScript value, usually an object or array, to be converted. - */ - stringify(value: any): string; - /** - * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. - * @param value A JavaScript value, usually an object or array, to be converted. - * @param replacer A function that transforms the results. - */ - stringify(value: any, replacer: (key: string, value: any) => any): string; - /** - * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. - * @param value A JavaScript value, usually an object or array, to be converted. - * @param replacer Array that transforms the results. - */ - stringify(value: any, replacer: any[]): string; - /** - * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. - * @param value A JavaScript value, usually an object or array, to be converted. - * @param replacer A function that transforms the results. - * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. - */ - stringify(value: any, replacer: (key: string, value: any) => any, space: any): string; - /** - * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. - * @param value A JavaScript value, usually an object or array, to be converted. - * @param replacer Array that transforms the results. - * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. - */ - stringify(value: any, replacer: any[], space: any): string; -} -/** - * An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format. - */ -declare var JSON: JSON; - -//////////////// -/// ECMAScript Array API (specially handled by compiler) -//////////////// - -interface Array { - toString(): string; - toLocaleString(): string; - concat(...items: U[]): T[]; - concat(...items: T[]): T[]; - join(separator?: string): string; - pop(): T; - push(...items: T[]): number; - reverse(): T[]; - shift(): T; - slice(start: number, end?: number): T[]; - sort(compareFn?: (a: T, b: T) => number): T[]; - splice(start: number): T[]; - splice(start: number, deleteCount: number, ...items: T[]): T[]; - unshift(...items: T[]): number; - - indexOf(searchElement: T, fromIndex?: number): number; - lastIndexOf(searchElement: T, fromIndex?: number): number; - every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; - some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; - forEach(callbackfn: (value: T, index: number, array: T[]) => void , thisArg?: any): void; - map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; - filter(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): T[]; - reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; - reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; - reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; - reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; - - length: number; - -} -declare var Array: { - new (arrayLength: number): T[]; - new (...items: T[]): T[]; - (arrayLength: number): T[]; - (...items: T[]): T[]; - isArray(arg: any): boolean; - prototype: Array; -} - - -//////////////// -/// IE10 ECMAScript Extensions -//////////////// - -interface ArrayBuffer { - byteLength: number; -} -declare var ArrayBuffer: { - prototype: ArrayBuffer; - new (byteLength: number); -} - -interface ArrayBufferView { - buffer: ArrayBuffer; - byteOffset: number; - byteLength: number; -} - -interface Int8Array extends ArrayBufferView { - BYTES_PER_ELEMENT: number; - length: number; - [index: number]: number; - get(index: number): number; - set(index: number, value: number): void; - set(array: Int8Array, offset?: number): void; - set(array: number[], offset?: number): void; - subarray(begin: number, end?: number): Int8Array; -} -declare var Int8Array: { - prototype: Int8Array; - new (length: number): Int8Array; - new (array: Int8Array): Int8Array; - new (array: number[]): Int8Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int8Array; - BYTES_PER_ELEMENT: number; -} - -interface Uint8Array extends ArrayBufferView { - BYTES_PER_ELEMENT: number; - length: number; - [index: number]: number; - get(index: number): number; - set(index: number, value: number): void; - set(array: Uint8Array, offset?: number): void; - set(array: number[], offset?: number): void; - subarray(begin: number, end?: number): Uint8Array; -} -declare var Uint8Array: { - prototype: Uint8Array; - new (length: number): Uint8Array; - new (array: Uint8Array): Uint8Array; - new (array: number[]): Uint8Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8Array; - BYTES_PER_ELEMENT: number; -} - -interface Int16Array extends ArrayBufferView { - BYTES_PER_ELEMENT: number; - length: number; - [index: number]: number; - get(index: number): number; - set(index: number, value: number): void; - set(array: Int16Array, offset?: number): void; - set(array: number[], offset?: number): void; - subarray(begin: number, end?: number): Int16Array; -} -declare var Int16Array: { - prototype: Int16Array; - new (length: number): Int16Array; - new (array: Int16Array): Int16Array; - new (array: number[]): Int16Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int16Array; - BYTES_PER_ELEMENT: number; -} - -interface Uint16Array extends ArrayBufferView { - BYTES_PER_ELEMENT: number; - length: number; - [index: number]: number; - get(index: number): number; - set(index: number, value: number): void; - set(array: Uint16Array, offset?: number): void; - set(array: number[], offset?: number): void; - subarray(begin: number, end?: number): Uint16Array; -} -declare var Uint16Array: { - prototype: Uint16Array; - new (length: number): Uint16Array; - new (array: Uint16Array): Uint16Array; - new (array: number[]): Uint16Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint16Array; - BYTES_PER_ELEMENT: number; -} - -interface Int32Array extends ArrayBufferView { - BYTES_PER_ELEMENT: number; - length: number; - [index: number]: number; - get(index: number): number; - set(index: number, value: number): void; - set(array: Int32Array, offset?: number): void; - set(array: number[], offset?: number): void; - subarray(begin: number, end?: number): Int32Array; -} -declare var Int32Array: { - prototype: Int32Array; - new (length: number): Int32Array; - new (array: Int32Array): Int32Array; - new (array: number[]): Int32Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int32Array; - BYTES_PER_ELEMENT: number; -} - -interface Uint32Array extends ArrayBufferView { - BYTES_PER_ELEMENT: number; - length: number; - [index: number]: number; - get(index: number): number; - set(index: number, value: number): void; - set(array: Uint32Array, offset?: number): void; - set(array: number[], offset?: number): void; - subarray(begin: number, end?: number): Uint32Array; -} -declare var Uint32Array: { - prototype: Uint32Array; - new (length: number): Uint32Array; - new (array: Uint32Array): Uint32Array; - new (array: number[]): Uint32Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint32Array; - BYTES_PER_ELEMENT: number; -} - -interface Float32Array extends ArrayBufferView { - BYTES_PER_ELEMENT: number; - length: number; - [index: number]: number; - get(index: number): number; - set(index: number, value: number): void; - set(array: Float32Array, offset?: number): void; - set(array: number[], offset?: number): void; - subarray(begin: number, end?: number): Float32Array; -} -declare var Float32Array: { - prototype: Float32Array; - new (length: number): Float32Array; - new (array: Float32Array): Float32Array; - new (array: number[]): Float32Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float32Array; - BYTES_PER_ELEMENT: number; -} - -interface Float64Array extends ArrayBufferView { - BYTES_PER_ELEMENT: number; - length: number; - [index: number]: number; - get(index: number): number; - set(index: number, value: number): void; - set(array: Float64Array, offset?: number): void; - set(array: number[], offset?: number): void; - subarray(begin: number, end?: number): Float64Array; -} -declare var Float64Array: { - prototype: Float64Array; - new (length: number): Float64Array; - new (array: Float64Array): Float64Array; - new (array: number[]): Float64Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float64Array; - BYTES_PER_ELEMENT: number; -} - -interface DataView extends ArrayBufferView { - getInt8(byteOffset: number): number; - getUint8(byteOffset: number): number; - getInt16(byteOffset: number, littleEndian?: boolean): number; - getUint16(byteOffset: number, littleEndian?: boolean): number; - getInt32(byteOffset: number, littleEndian?: boolean): number; - getUint32(byteOffset: number, littleEndian?: boolean): number; - getFloat32(byteOffset: number, littleEndian?: boolean): number; - getFloat64(byteOffset: number, littleEndian?: boolean): number; - - setInt8(byteOffset: number, value: number): void; - setUint8(byteOffset: number, value: number): void; - setInt16(byteOffset: number, value: number, littleEndian?: boolean): void; - setUint16(byteOffset: number, value: number, littleEndian?: boolean): void; - setInt32(byteOffset: number, value: number, littleEndian?: boolean): void; - setUint32(byteOffset: number, value: number, littleEndian?: boolean): void; - setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void; - setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void; -} -declare var DataView: { - prototype: DataView; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): DataView; -} - -//////////////// -/// IE9 DOM APIs (note that -//////////////// - -interface NavigatorID { - appVersion: string; - appName: string; - userAgent: string; - platform: string; -} - -interface HTMLTableElement extends HTMLElement, DOML2DeprecatedBorderStyle_HTMLTableElement, DOML2DeprecatedAlignmentStyle_HTMLTableElement, MSBorderColorStyle, MSDataBindingExtensions, MSHTMLTableElementExtensions, DOML2DeprecatedBackgroundStyle, MSBorderColorHighlightStyle, MSDataBindingTableExtensions, DOML2DeprecatedBackgroundColorStyle { - tBodies: HTMLCollection; - width: string; - tHead: HTMLTableSectionElement; - cellSpacing: string; - tFoot: HTMLTableSectionElement; - frame: string; - rows: HTMLCollection; - rules: string; - cellPadding: string; - summary: string; - caption: HTMLTableCaptionElement; - deleteRow(index?: number): void; - createTBody(): HTMLElement; - deleteCaption(): void; - insertRow(index?: number): HTMLElement; - deleteTFoot(): void; - createTHead(): HTMLElement; - deleteTHead(): void; - createCaption(): HTMLElement; - createTFoot(): HTMLElement; -} -declare var HTMLTableElement: { - prototype: HTMLTableElement; - new(): HTMLTableElement; -} - -interface TreeWalker { - whatToShow: number; - filter: NodeFilterCallback; - root: Node; - currentNode: Node; - expandEntityReferences: boolean; - previousSibling(): Node; - lastChild(): Node; - nextSibling(): Node; - nextNode(): Node; - parentNode(): Node; - firstChild(): Node; - previousNode(): Node; -} -declare var TreeWalker: { - prototype: TreeWalker; - new(): TreeWalker; -} - -interface GetSVGDocument { - getSVGDocument(): SVGDocument; -} - -interface HTMLHtmlElementDOML2Deprecated { - version: string; -} - -interface SVGPathSegCurvetoQuadraticRel extends SVGPathSeg { - y: number; - y1: number; - x: number; - x1: number; -} -declare var SVGPathSegCurvetoQuadraticRel: { - prototype: SVGPathSegCurvetoQuadraticRel; - new(): SVGPathSegCurvetoQuadraticRel; -} - -interface Performance { - navigation: PerformanceNavigation; - timing: PerformanceTiming; - toJSON(): any; -} -declare var Performance: { - prototype: Performance; - new(): Performance; -} - -interface SVGSVGElementEventHandlers { - onresize: (ev: UIEvent) => any; - addEventListener(type: "resize", listener: (ev: UIEvent) => void, useCapture?: boolean): void; - onunload: (ev: Event) => any; - addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; - onscroll: (ev: UIEvent) => any; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - onerror: (ev: Event) => any; - addEventListener(type: "error", listener: (ev: Event) => any, useCapture?: boolean): void; - onzoom: (ev: any) => any; - addEventListener(type: "zoom", listener: (ev: any) => any, useCapture?: boolean): void; - onabort: (ev: UIEvent) => any; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface MSDataBindingTableExtensions { - dataPageSize: number; - nextPage(): void; - firstPage(): void; - refresh(): void; - previousPage(): void; - lastPage(): void; -} - -interface DOML2DeprecatedAlignmentStyle_HTMLParagraphElement { - align: string; -} - -interface CompositionEvent extends UIEvent { - data: string; - locale: string; - initCompositionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: AbstractView, dataArg: string, locale: string): void; -} -declare var CompositionEvent: { - prototype: CompositionEvent; - new(): CompositionEvent; -} - -interface SVGMarkerElement extends SVGElement, SVGStylable, SVGLangSpace, SVGFitToViewBox { - orientType: SVGAnimatedEnumeration; - markerUnits: SVGAnimatedEnumeration; - markerWidth: SVGAnimatedLength; - markerHeight: SVGAnimatedLength; - orientAngle: SVGAnimatedAngle; - refY: SVGAnimatedLength; - refX: SVGAnimatedLength; - setOrientToAngle(angle: SVGAngle): void; - setOrientToAuto(): void; - SVG_MARKER_ORIENT_UNKNOWN: number; - SVG_MARKER_ORIENT_ANGLE: number; - SVG_MARKERUNITS_UNKNOWN: number; - SVG_MARKERUNITS_STROKEWIDTH: number; - SVG_MARKER_ORIENT_AUTO: number; - SVG_MARKERUNITS_USERSPACEONUSE: number; -} -declare var SVGMarkerElement: { - prototype: SVGMarkerElement; - new(): SVGMarkerElement; - SVG_MARKER_ORIENT_UNKNOWN: number; - SVG_MARKER_ORIENT_ANGLE: number; - SVG_MARKERUNITS_UNKNOWN: number; - SVG_MARKERUNITS_STROKEWIDTH: number; - SVG_MARKER_ORIENT_AUTO: number; - SVG_MARKERUNITS_USERSPACEONUSE: number; -} - -interface WindowTimers { - clearTimeout(handle: number): void; - setTimeout(expression: any, msec?: number, language?: any): number; - clearInterval(handle: number): void; - setInterval(expression: any, msec?: number, language?: any): number; -} - -interface CSSStyleDeclaration extends CSS3Properties, SVG1_1Properties, CSS2Properties { - cssText: string; - length: number; - parentRule: CSSRule; - getPropertyPriority(propertyName: string): string; - getPropertyValue(propertyName: string): string; - removeProperty(propertyName: string): string; - item(index: number): string; - [index: number]: string; - setProperty(propertyName: string, value: string, priority?: string): void; -} -declare var CSSStyleDeclaration: { - prototype: CSSStyleDeclaration; - new(): CSSStyleDeclaration; -} - -interface SVGGElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests { -} -declare var SVGGElement: { - prototype: SVGGElement; - new(): SVGGElement; -} - -interface MSStyleCSSProperties extends MSCSSProperties { - pixelWidth: number; - posHeight: number; - posLeft: number; - pixelTop: number; - pixelBottom: number; - textDecorationNone: boolean; - pixelLeft: number; - posTop: number; - posBottom: number; - textDecorationOverline: boolean; - posWidth: number; - textDecorationLineThrough: boolean; - pixelHeight: number; - textDecorationBlink: boolean; - posRight: number; - pixelRight: number; - textDecorationUnderline: boolean; -} -declare var MSStyleCSSProperties: { - prototype: MSStyleCSSProperties; - new(): MSStyleCSSProperties; -} - -interface MSCSSStyleSheetExtensions { - owningElement: Element; - imports: StyleSheetList; - isAlternate: boolean; - rules: MSCSSRuleList; - isPrefAlternate: boolean; - readOnly: boolean; - cssText: string; - href: string; - id: string; - pages: StyleSheetPageList; - addImport(bstrURL: string, lIndex?: number): number; - addPageRule(bstrSelector: string, bstrStyle: string, lIndex?: number): number; - removeRule(lIndex: number): void; - addRule(bstrSelector: string, bstrStyle?: string, lIndex?: number): number; - removeImport(lIndex: number): void; -} - -interface Navigator extends NavigatorID, NavigatorOnLine, NavigatorDoNotTrack, NavigatorAbilities, NavigatorGeolocation, MSNavigatorAbilities { -} -declare var Navigator: { - prototype: Navigator; - new(): Navigator; -} - -interface SVGPathSegCurvetoCubicSmoothAbs extends SVGPathSeg { - y: number; - x2: number; - x: number; - y2: number; -} -declare var SVGPathSegCurvetoCubicSmoothAbs: { - prototype: SVGPathSegCurvetoCubicSmoothAbs; - new(): SVGPathSegCurvetoCubicSmoothAbs; -} - -interface MSBorderColorStyle_HTMLFrameSetElement { - borderColor: any; -} - -interface SVGZoomEvent extends UIEvent { - zoomRectScreen: SVGRect; - previousScale: number; - newScale: number; - previousTranslate: SVGPoint; - newTranslate: SVGPoint; -} -declare var SVGZoomEvent: { - prototype: SVGZoomEvent; - new(): SVGZoomEvent; -} - -interface NodeSelector { - querySelectorAll(selectors: string): NodeList; - querySelector(selectors: string): Element; -} - -interface HTMLTableDataCellElement extends HTMLTableCellElement, MSHTMLTableDataCellElementExtensions { -} -declare var HTMLTableDataCellElement: { - prototype: HTMLTableDataCellElement; - new(): HTMLTableDataCellElement; -} - -interface MSHTMLDirectoryElementExtensions extends DOML2DeprecatedListNumberingAndBulletStyle { -} - -interface HTMLBaseElement extends HTMLElement { - target: string; - href: string; -} -declare var HTMLBaseElement: { - prototype: HTMLBaseElement; - new(): HTMLBaseElement; -} - -interface ClientRect { - left: number; - width: number; - right: number; - top: number; - bottom: number; - height: number; -} -declare var ClientRect: { - prototype: ClientRect; - new(): ClientRect; -} - -interface PositionErrorCallback { - (error: PositionError): void; -} - -interface DOMImplementation extends DOMHTMLImplementation { - createDocumentType(qualifiedName: string, publicId: string, systemId: string): DocumentType; - createDocument(namespaceURI: string, qualifiedName: string, doctype: DocumentType): Document; - hasFeature(feature: string, version?: string): boolean; -} -declare var DOMImplementation: { - prototype: DOMImplementation; - new(): DOMImplementation; -} - -interface DOML2DeprecatedWidthStyle_HTMLBlockElement { - width: number; -} - -interface SVGUnitTypes { - SVG_UNIT_TYPE_UNKNOWN: number; - SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number; - SVG_UNIT_TYPE_USERSPACEONUSE: number; -} -declare var SVGUnitTypes: { - prototype: SVGUnitTypes; - new(): SVGUnitTypes; - SVG_UNIT_TYPE_UNKNOWN: number; - SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number; - SVG_UNIT_TYPE_USERSPACEONUSE: number; -} - -interface DocumentRange { - createRange(): Range; -} - -interface MSHTMLDocumentExtensions { - onrowexit: (ev: MSEventObj) => any; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - compatible: MSCompatibleInfoCollection; - oncontrolselect: (ev: MSEventObj) => any; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - onrowsinserted: (ev: MSEventObj) => any; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - onpropertychange: (ev: MSEventObj) => any; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - media: string; - onafterupdate: (ev: MSEventObj) => any; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - onhelp: (ev: Event) => any; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - uniqueID: string; - onbeforeactivate: (ev: UIEvent) => any; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - onstoragecommit: (ev: StorageEvent) => any; - addEventListener(type: "storagecommit", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; - onselectionchange: (ev: Event) => any; - addEventListener(type: "selectionchange", listener: (ev: Event) => any, useCapture?: boolean): void; - documentMode: number; - onfocusout: (ev: FocusEvent) => any; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - ondataavailable: (ev: MSEventObj) => any; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - onbeforeupdate: (ev: MSEventObj) => any; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - onfocusin: (ev: FocusEvent) => any; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - security: string; - namespaces: MSNamespaceInfoCollection; - ondatasetcomplete: (ev: MSEventObj) => any; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - onbeforedeactivate: (ev: UIEvent) => any; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - onstop: (ev: Event) => any; - addEventListener(type: "stop", listener: (ev: Event) => any, useCapture?: boolean): void; - onactivate: (ev: UIEvent) => any; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - onmssitemodejumplistitemremoved: (ev: MSSiteModeEvent) => any; - addEventListener(type: "mssitemodejumplistitemremoved", listener: (ev: MSSiteModeEvent) => any, useCapture?: boolean): void; - frames: Window; - onselectstart: (ev: Event) => any; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - onerrorupdate: (ev: MSEventObj) => any; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - parentWindow: Window; - ondeactivate: (ev: UIEvent) => any; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - ondatasetchanged: (ev: MSEventObj) => any; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - onrowsdelete: (ev: MSEventObj) => any; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - onmsthumbnailclick: (ev: MSSiteModeEvent) => any; - addEventListener(type: "msthumbnailclick", listener: (ev: MSSiteModeEvent) => any, useCapture?: boolean): void; - onrowenter: (ev: MSEventObj) => any; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - onbeforeeditfocus: (ev: MSEventObj) => any; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - Script: MSScriptHost; - oncellchange: (ev: MSEventObj) => any; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - URLUnencoded: string; - updateSettings(): void; - execCommandShowHelp(commandId: string): boolean; - releaseCapture(): void; - focus(): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface CSS2Properties { - backgroundAttachment: string; - visibility: string; - fontFamily: string; - borderRightStyle: string; - clear: string; - content: string; - counterIncrement: string; - orphans: string; - marginBottom: string; - borderStyle: string; - counterReset: string; - outlineWidth: string; - marginRight: string; - paddingLeft: string; - borderBottom: string; - marginTop: string; - borderTopColor: string; - top: string; - fontWeight: string; - textIndent: string; - borderRight: string; - width: string; - listStyleImage: string; - cursor: string; - listStylePosition: string; - borderTopStyle: string; - direction: string; - maxWidth: string; - color: string; - clip: string; - borderRightWidth: string; - verticalAlign: string; - pageBreakAfter: string; - overflow: string; - borderBottomStyle: string; - borderLeftStyle: string; - fontStretch: string; - emptyCells: string; - padding: string; - paddingRight: string; - background: string; - bottom: string; - height: string; - paddingTop: string; - right: string; - borderLeftWidth: string; - borderLeft: string; - backgroundPosition: string; - backgroundColor: string; - widows: string; - lineHeight: string; - pageBreakInside: string; - borderTopWidth: string; - left: string; - outlineStyle: string; - borderTop: string; - paddingBottom: string; - outlineColor: string; - wordSpacing: string; - outline: string; - font: string; - marginLeft: string; - display: string; - maxHeight: string; - cssFloat: string; - letterSpacing: string; - borderSpacing: string; - backgroundRepeat: string; - fontSizeAdjust: string; - borderLeftColor: string; - borderWidth: string; - backgroundImage: string; - listStyleType: string; - whiteSpace: string; - fontStyle: string; - borderBottomColor: string; - minWidth: string; - position: string; - zIndex: string; - borderColor: string; - listStyle: string; - captionSide: string; - borderCollapse: string; - fontVariant: string; - quotes: string; - tableLayout: string; - unicodeBidi: string; - borderBottomWidth: string; - minHeight: string; - textDecoration: string; - fontSize: string; - border: string; - pageBreakBefore: string; - textAlign: string; - textTransform: string; - margin: string; - borderRightColor: string; -} - -interface MSImageResourceExtensions_HTMLInputElement { - dynsrc: string; - vrml: string; - lowsrc: string; - start: string; - loop: number; -} - -interface MSHTMLEmbedElementExtensions { - palette: string; - hidden: string; - pluginspage: string; - units: string; -} - -interface MSHTMLModElementExtensions { -} - -interface Element extends Node, NodeSelector, ElementTraversal, MSElementExtensions { - scrollTop: number; - clientLeft: number; - scrollLeft: number; - tagName: string; - clientWidth: number; - scrollWidth: number; - clientHeight: number; - clientTop: number; - scrollHeight: number; - getAttribute(name?: string): string; - getElementsByTagNameNS(namespaceURI: string, localName: string): NodeList; - hasAttributeNS(namespaceURI: string, localName: string): boolean; - getBoundingClientRect(): ClientRect; - getAttributeNS(namespaceURI: string, localName: string): string; - getAttributeNodeNS(namespaceURI: string, localName: string): Attr; - setAttributeNodeNS(newAttr: Attr): Attr; - hasAttribute(name: string): boolean; - removeAttribute(name?: string): void; - setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void; - getAttributeNode(name: string): Attr; - getElementsByTagName(name: string): NodeList; - getElementsByTagName(name: "a"): NodeListOf; - getElementsByTagName(name: "abbr"): NodeListOf; - getElementsByTagName(name: "address"): NodeListOf; - getElementsByTagName(name: "area"): NodeListOf; - getElementsByTagName(name: "article"): NodeListOf; - getElementsByTagName(name: "aside"): NodeListOf; - getElementsByTagName(name: "audio"): NodeListOf; - getElementsByTagName(name: "b"): NodeListOf; - getElementsByTagName(name: "base"): NodeListOf; - getElementsByTagName(name: "bdi"): NodeListOf; - getElementsByTagName(name: "bdo"): NodeListOf; - getElementsByTagName(name: "blockquote"): NodeListOf; - getElementsByTagName(name: "body"): NodeListOf; - getElementsByTagName(name: "br"): NodeListOf; - getElementsByTagName(name: "button"): NodeListOf; - getElementsByTagName(name: "canvas"): NodeListOf; - getElementsByTagName(name: "caption"): NodeListOf; - getElementsByTagName(name: "cite"): NodeListOf; - getElementsByTagName(name: "code"): NodeListOf; - getElementsByTagName(name: "col"): NodeListOf; - getElementsByTagName(name: "colgroup"): NodeListOf; - getElementsByTagName(name: "datalist"): NodeListOf; - getElementsByTagName(name: "dd"): NodeListOf; - getElementsByTagName(name: "del"): NodeListOf; - getElementsByTagName(name: "dfn"): NodeListOf; - getElementsByTagName(name: "div"): NodeListOf; - getElementsByTagName(name: "dl"): NodeListOf; - getElementsByTagName(name: "dt"): NodeListOf; - getElementsByTagName(name: "em"): NodeListOf; - getElementsByTagName(name: "embed"): NodeListOf; - getElementsByTagName(name: "fieldset"): NodeListOf; - getElementsByTagName(name: "figcaption"): NodeListOf; - getElementsByTagName(name: "figure"): NodeListOf; - getElementsByTagName(name: "footer"): NodeListOf; - getElementsByTagName(name: "form"): NodeListOf; - getElementsByTagName(name: "h1"): NodeListOf; - getElementsByTagName(name: "h2"): NodeListOf; - getElementsByTagName(name: "h3"): NodeListOf; - getElementsByTagName(name: "h4"): NodeListOf; - getElementsByTagName(name: "h5"): NodeListOf; - getElementsByTagName(name: "h6"): NodeListOf; - getElementsByTagName(name: "head"): NodeListOf; - getElementsByTagName(name: "header"): NodeListOf; - getElementsByTagName(name: "hgroup"): NodeListOf; - getElementsByTagName(name: "hr"): NodeListOf; - getElementsByTagName(name: "html"): NodeListOf; - getElementsByTagName(name: "i"): NodeListOf; - getElementsByTagName(name: "iframe"): NodeListOf; - getElementsByTagName(name: "img"): NodeListOf; - getElementsByTagName(name: "input"): NodeListOf; - getElementsByTagName(name: "ins"): NodeListOf; - getElementsByTagName(name: "kbd"): NodeListOf; - getElementsByTagName(name: "label"): NodeListOf; - getElementsByTagName(name: "legend"): NodeListOf; - getElementsByTagName(name: "li"): NodeListOf; - getElementsByTagName(name: "link"): NodeListOf; - getElementsByTagName(name: "main"): NodeListOf; - getElementsByTagName(name: "map"): NodeListOf; - getElementsByTagName(name: "mark"): NodeListOf; - getElementsByTagName(name: "menu"): NodeListOf; - getElementsByTagName(name: "meta"): NodeListOf; - getElementsByTagName(name: "nav"): NodeListOf; - getElementsByTagName(name: "noscript"): NodeListOf; - getElementsByTagName(name: "object"): NodeListOf; - getElementsByTagName(name: "ol"): NodeListOf; - getElementsByTagName(name: "optgroup"): NodeListOf; - getElementsByTagName(name: "option"): NodeListOf; - getElementsByTagName(name: "p"): NodeListOf; - getElementsByTagName(name: "param"): NodeListOf; - getElementsByTagName(name: "pre"): NodeListOf; - getElementsByTagName(name: "progress"): NodeListOf; - getElementsByTagName(name: "q"): NodeListOf; - getElementsByTagName(name: "rp"): NodeListOf; - getElementsByTagName(name: "rt"): NodeListOf; - getElementsByTagName(name: "ruby"): NodeListOf; - getElementsByTagName(name: "s"): NodeListOf; - getElementsByTagName(name: "samp"): NodeListOf; - getElementsByTagName(name: "script"): NodeListOf; - getElementsByTagName(name: "section"): NodeListOf; - getElementsByTagName(name: "select"): NodeListOf; - getElementsByTagName(name: "small"): NodeListOf; - getElementsByTagName(name: "source"): NodeListOf; - getElementsByTagName(name: "span"): NodeListOf; - getElementsByTagName(name: "strong"): NodeListOf; - getElementsByTagName(name: "style"): NodeListOf; - getElementsByTagName(name: "sub"): NodeListOf; - getElementsByTagName(name: "summary"): NodeListOf; - getElementsByTagName(name: "sup"): NodeListOf; - getElementsByTagName(name: "table"): NodeListOf; - getElementsByTagName(name: "tbody"): NodeListOf; - getElementsByTagName(name: "td"): NodeListOf; - getElementsByTagName(name: "textarea"): NodeListOf; - getElementsByTagName(name: "tfoot"): NodeListOf; - getElementsByTagName(name: "th"): NodeListOf; - getElementsByTagName(name: "thead"): NodeListOf; - getElementsByTagName(name: "title"): NodeListOf; - getElementsByTagName(name: "tr"): NodeListOf; - getElementsByTagName(name: "track"): NodeListOf; - getElementsByTagName(name: "u"): NodeListOf; - getElementsByTagName(name: "ul"): NodeListOf; - getElementsByTagName(name: "var"): NodeListOf; - getElementsByTagName(name: "video"): NodeListOf; - getElementsByTagName(name: "wbr"): NodeListOf; - setAttributeNode(newAttr: Attr): Attr; - getClientRects(): ClientRectList; - removeAttributeNode(oldAttr: Attr): Attr; - setAttribute(name?: string, value?: string): void; - removeAttributeNS(namespaceURI: string, localName: string): void; -} -declare var Element: { - prototype: Element; - new(): Element; -} - -interface SVGDocument { - rootElement: SVGSVGElement; -} - -interface HTMLNextIdElement extends HTMLElement { - n: string; -} -declare var HTMLNextIdElement: { - prototype: HTMLNextIdElement; - new(): HTMLNextIdElement; -} - -interface SVGPathSegMovetoRel extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegMovetoRel: { - prototype: SVGPathSegMovetoRel; - new(): SVGPathSegMovetoRel; -} - -interface SVGLineElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests { - y1: SVGAnimatedLength; - x2: SVGAnimatedLength; - x1: SVGAnimatedLength; - y2: SVGAnimatedLength; -} -declare var SVGLineElement: { - prototype: SVGLineElement; - new(): SVGLineElement; -} - -interface HTMLParagraphElement extends HTMLElement, DOML2DeprecatedAlignmentStyle_HTMLParagraphElement, MSHTMLParagraphElementExtensions { -} -declare var HTMLParagraphElement: { - prototype: HTMLParagraphElement; - new(): HTMLParagraphElement; -} - -interface MSHTMLTextAreaElementExtensions { - status: any; - createTextRange(): TextRange; -} - -interface ErrorFunction { - (eventOrMessage: any, source: string, fileno: number): any; -} - -interface HTMLAreasCollection extends HTMLCollection { - remove(index?: number): void; - add(element: HTMLElement, before?: any): void; -} -declare var HTMLAreasCollection: { - prototype: HTMLAreasCollection; - new(): HTMLAreasCollection; -} - -interface SVGDescElement extends SVGElement, SVGStylable, SVGLangSpace { -} -declare var SVGDescElement: { - prototype: SVGDescElement; - new(): SVGDescElement; -} - -interface Node extends EventTarget { - nodeType: number; - previousSibling: Node; - localName: string; - namespaceURI: string; - textContent: string; - parentNode: Node; - nextSibling: Node; - nodeValue: string; - lastChild: Node; - childNodes: NodeList; - nodeName: string; - ownerDocument: Document; - attributes: Attr[]; - firstChild: Node; - prefix: string; - removeChild(oldChild: Node): Node; - appendChild(newChild: Node): Node; - isSupported(feature: string, version: string): boolean; - isEqualNode(arg: Node): boolean; - lookupPrefix(namespaceURI: string): string; - isDefaultNamespace(namespaceURI: string): boolean; - compareDocumentPosition(other: Node): number; - normalize(): void; - isSameNode(other: Node): boolean; - hasAttributes(): boolean; - lookupNamespaceURI(prefix: string): string; - cloneNode(deep?: boolean): Node; - hasChildNodes(): boolean; - replaceChild(newChild: Node, oldChild: Node): Node; - insertBefore(newChild: Node, refChild?: Node): Node; - ENTITY_REFERENCE_NODE: number; - ATTRIBUTE_NODE: number; - DOCUMENT_FRAGMENT_NODE: number; - TEXT_NODE: number; - ELEMENT_NODE: number; - COMMENT_NODE: number; - DOCUMENT_POSITION_DISCONNECTED: number; - DOCUMENT_POSITION_CONTAINED_BY: number; - DOCUMENT_POSITION_CONTAINS: number; - DOCUMENT_TYPE_NODE: number; - DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; - DOCUMENT_NODE: number; - ENTITY_NODE: number; - PROCESSING_INSTRUCTION_NODE: number; - CDATA_SECTION_NODE: number; - NOTATION_NODE: number; - DOCUMENT_POSITION_FOLLOWING: number; - DOCUMENT_POSITION_PRECEDING: number; -} -declare var Node: { - prototype: Node; - new(): Node; - ENTITY_REFERENCE_NODE: number; - ATTRIBUTE_NODE: number; - DOCUMENT_FRAGMENT_NODE: number; - TEXT_NODE: number; - ELEMENT_NODE: number; - COMMENT_NODE: number; - DOCUMENT_POSITION_DISCONNECTED: number; - DOCUMENT_POSITION_CONTAINED_BY: number; - DOCUMENT_POSITION_CONTAINS: number; - DOCUMENT_TYPE_NODE: number; - DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; - DOCUMENT_NODE: number; - ENTITY_NODE: number; - PROCESSING_INSTRUCTION_NODE: number; - CDATA_SECTION_NODE: number; - NOTATION_NODE: number; - DOCUMENT_POSITION_FOLLOWING: number; - DOCUMENT_POSITION_PRECEDING: number; -} - -interface MSHTMLLegendElementExtensions { -} - -interface MSCSSStyleDeclarationExtensions { - getAttribute(attributeName: string, flags?: number): any; - setAttribute(attributeName: string, AttributeValue: any, flags?: number): void; - removeAttribute(attributeName: string, flags?: number): boolean; -} - -interface SVGPathSegCurvetoQuadraticSmoothRel extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegCurvetoQuadraticSmoothRel: { - prototype: SVGPathSegCurvetoQuadraticSmoothRel; - new(): SVGPathSegCurvetoQuadraticSmoothRel; -} - -interface DOML2DeprecatedAlignmentStyle_HTMLTableRowElement { - align: string; -} - -interface DOML2DeprecatedBorderStyle_HTMLObjectElement { - border: string; -} - -interface MSHTMLSpanElementExtensions { -} - -interface MSHTMLObjectElementExtensions { - object: Object; - alt: string; - classid: string; - altHtml: string; - BaseHref: string; -} - -interface DOML2DeprecatedListSpaceReduction { - compact: boolean; -} - -interface CSS3Properties { - textAlignLast: string; - textUnderlinePosition: string; - wordWrap: string; - borderTopLeftRadius: string; - backgroundClip: string; - msTransformOrigin: string; - opacity: string; - overflowY: string; - boxShadow: string; - backgroundSize: string; - wordBreak: string; - boxSizing: string; - rubyOverhang: string; - rubyAlign: string; - textJustify: string; - borderRadius: string; - overflowX: string; - borderTopRightRadius: string; - msTransform: string; - borderBottomLeftRadius: string; - rubyPosition: string; - borderBottomRightRadius: string; - backgroundOrigin: string; - textOverflow: string; -} - -interface MSScriptHost { -} -declare var MSScriptHost: { - prototype: MSScriptHost; - new(): MSScriptHost; -} - -interface SVGClipPathElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests { - clipPathUnits: SVGAnimatedEnumeration; -} -declare var SVGClipPathElement: { - prototype: SVGClipPathElement; - new(): SVGClipPathElement; -} - -interface MouseEvent extends UIEvent, MSMouseEventExtensions { - pageX: number; - offsetY: number; - x: number; - y: number; - altKey: boolean; - metaKey: boolean; - ctrlKey: boolean; - offsetX: number; - screenX: number; - clientY: number; - shiftKey: boolean; - screenY: number; - relatedTarget: EventTarget; - button: number; - pageY: number; - buttons: number; - clientX: number; - initMouseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: AbstractView, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget): void; - getModifierState(keyArg: string): boolean; -} -declare var MouseEvent: { - prototype: MouseEvent; - new(): MouseEvent; -} - -interface DOML2DeprecatedAlignmentStyle_HTMLTableElement { - align: string; -} - -interface RangeException { - code: number; - message: string; - toString(): string; - INVALID_NODE_TYPE_ERR: number; - BAD_BOUNDARYPOINTS_ERR: number; -} -declare var RangeException: { - prototype: RangeException; - new(): RangeException; - INVALID_NODE_TYPE_ERR: number; - BAD_BOUNDARYPOINTS_ERR: number; -} - -interface DOML2DeprecatedAlignmentStyle_HTMLHRElement { - align: string; -} - -interface SVGTextPositioningElement extends SVGTextContentElement { - y: SVGAnimatedLengthList; - rotate: SVGAnimatedNumberList; - dy: SVGAnimatedLengthList; - x: SVGAnimatedLengthList; - dx: SVGAnimatedLengthList; -} -declare var SVGTextPositioningElement: { - prototype: SVGTextPositioningElement; - new(): SVGTextPositioningElement; -} - -interface HTMLAppletElement extends HTMLElement, DOML2DeprecatedWidthStyle_HTMLAppletElement, DOML2DeprecatedMarginStyle_HTMLObjectElement, MSHTMLAppletElementExtensions, MSDataBindingExtensions, MSDataBindingRecordSetExtensions, DOML2DeprecatedAlignmentStyle_HTMLObjectElement { - object: string; - archive: string; - codeBase: string; - alt: string; - name: string; - height: string; - code: string; -} -declare var HTMLAppletElement: { - prototype: HTMLAppletElement; - new(): HTMLAppletElement; -} - -interface MSHTMLFieldSetElementExtensions extends DOML2DeprecatedAlignmentStyle_HTMLFieldSetElement { -} - -interface DocumentEvent { - createEvent(eventInterface: string): Event; -} - -interface MSHTMLUnknownElementExtensions { -} - -interface TextMetrics { - width: number; -} -declare var TextMetrics: { - prototype: TextMetrics; - new(): TextMetrics; -} - -interface DOML2DeprecatedWordWrapSuppression_HTMLBodyElement { - noWrap: boolean; -} - -interface HTMLOListElement extends HTMLElement, DOML2DeprecatedListNumberingAndBulletStyle, DOML2DeprecatedListSpaceReduction, MSHTMLOListElementExtensions { - start: number; -} -declare var HTMLOListElement: { - prototype: HTMLOListElement; - new(): HTMLOListElement; -} - -interface MSHTMLTableCaptionElementExtensions { - vAlign: string; -} - -interface SVGAnimatedString { - animVal: string; - baseVal: string; -} -declare var SVGAnimatedString: { - prototype: SVGAnimatedString; - new(): SVGAnimatedString; -} - -interface SVGPathSegLinetoVerticalRel extends SVGPathSeg { - y: number; -} -declare var SVGPathSegLinetoVerticalRel: { - prototype: SVGPathSegLinetoVerticalRel; - new(): SVGPathSegLinetoVerticalRel; -} - -interface CDATASection extends Text { -} -declare var CDATASection: { - prototype: CDATASection; - new(): CDATASection; -} - -interface StyleMedia { - type: string; - matchMedium(mediaquery: string): boolean; -} -declare var StyleMedia: { - prototype: StyleMedia; - new(): StyleMedia; -} - -interface TextRange { - boundingLeft: number; - htmlText: string; - offsetLeft: number; - boundingWidth: number; - boundingHeight: number; - boundingTop: number; - text: string; - offsetTop: number; - moveToPoint(x: number, y: number): void; - queryCommandValue(cmdID: string): any; - getBookmark(): string; - move(Unit: string, Count?: number): number; - queryCommandIndeterm(cmdID: string): boolean; - scrollIntoView(fStart?: boolean): void; - findText(string: string, count?: number, flags?: number): boolean; - execCommand(cmdID: string, showUI?: boolean, value?: any): boolean; - getBoundingClientRect(): ClientRect; - moveToBookmark(Bookmark: string): boolean; - isEqual(range: TextRange): boolean; - duplicate(): TextRange; - collapse(Start?: boolean): void; - queryCommandText(cmdID: string): string; - select(): void; - pasteHTML(html: string): void; - inRange(range: TextRange): boolean; - moveEnd(Unit: string, Count?: number): number; - getClientRects(): ClientRectList; - moveStart(Unit: string, Count?: number): number; - parentElement(): Element; - queryCommandState(cmdID: string): boolean; - compareEndPoints(how: string, sourceRange: TextRange): number; - execCommandShowHelp(cmdID: string): boolean; - moveToElementText(element: Element): void; - expand(Unit: string): boolean; - queryCommandSupported(cmdID: string): boolean; - setEndPoint(how: string, SourceRange: TextRange): void; - queryCommandEnabled(cmdID: string): boolean; -} -declare var TextRange: { - prototype: TextRange; - new(): TextRange; -} - -interface HTMLSelectElement extends HTMLElement, MSHTMLCollectionExtensions, MSDataBindingExtensions, MSHTMLSelectElementExtensions { - options: HTMLSelectElement; - value: string; - form: HTMLFormElement; - name: string; - size: number; - length: number; - selectedIndex: number; - multiple: boolean; - type: string; - remove(index?: number): void; - add(element: HTMLElement, before?: any): void; - item(name?: any, index?: any): any; - (name: any, index: any): any; - namedItem(name: string): any; - [name: string]: any; - (name: string): any; -} -declare var HTMLSelectElement: { - prototype: HTMLSelectElement; - new(): HTMLSelectElement; -} - -interface CSSStyleSheet extends StyleSheet, MSCSSStyleSheetExtensions { - ownerRule: CSSRule; - cssRules: CSSRuleList; - insertRule(rule: string, index?: number): number; - deleteRule(index?: number): void; -} -declare var CSSStyleSheet: { - prototype: CSSStyleSheet; - new(): CSSStyleSheet; -} - -interface HTMLBlockElement extends HTMLElement, DOML2DeprecatedTextFlowControl_HTMLBlockElement, DOML2DeprecatedWidthStyle_HTMLBlockElement { - cite: string; -} -declare var HTMLBlockElement: { - prototype: HTMLBlockElement; - new(): HTMLBlockElement; -} - -interface SVGTests { - requiredFeatures: SVGStringList; - requiredExtensions: SVGStringList; - systemLanguage: SVGStringList; - hasExtension(extension: string): boolean; -} - -interface MSSelection { - type: string; - typeDetail: string; - createRange(): TextRange; - clear(): void; - createRangeCollection(): TextRangeCollection; - empty(): void; -} -declare var MSSelection: { - prototype: MSSelection; - new(): MSSelection; -} - -interface MSHTMLDListElementExtensions { -} - -interface HTMLMetaElement extends HTMLElement, MSHTMLMetaElementExtensions { - httpEquiv: string; - name: string; - content: string; - scheme: string; -} -declare var HTMLMetaElement: { - prototype: HTMLMetaElement; - new(): HTMLMetaElement; -} - -interface Selection { - isCollapsed: boolean; - anchorNode: Node; - focusNode: Node; - anchorOffset: number; - focusOffset: number; - rangeCount: number; - addRange(range: Range): void; - collapseToEnd(): void; - toString(): string; - selectAllChildren(parentNode: Node): void; - getRangeAt(index: number): Range; - collapse(parentNode: Node, offset: number): void; - removeAllRanges(): void; - collapseToStart(): void; - deleteFromDocument(): void; - removeRange(range: Range): void; -} -declare var Selection: { - prototype: Selection; - new(): Selection; -} - -interface SVGAnimatedAngle { - animVal: SVGAngle; - baseVal: SVGAngle; -} -declare var SVGAnimatedAngle: { - prototype: SVGAnimatedAngle; - new(): SVGAnimatedAngle; -} - -interface SVGPatternElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGTests, SVGFitToViewBox, SVGURIReference { - patternUnits: SVGAnimatedEnumeration; - y: SVGAnimatedLength; - width: SVGAnimatedLength; - x: SVGAnimatedLength; - patternContentUnits: SVGAnimatedEnumeration; - patternTransform: SVGAnimatedTransformList; - height: SVGAnimatedLength; -} -declare var SVGPatternElement: { - prototype: SVGPatternElement; - new(): SVGPatternElement; -} - -interface SVGScriptElement extends SVGElement, SVGURIReference { - type: string; -} -declare var SVGScriptElement: { - prototype: SVGScriptElement; - new(): SVGScriptElement; -} - -interface HTMLDDElement extends HTMLElement, DOML2DeprecatedWordWrapSuppression_HTMLDDElement { -} -declare var HTMLDDElement: { - prototype: HTMLDDElement; - new(): HTMLDDElement; -} - -interface NodeIterator { - whatToShow: number; - filter: NodeFilterCallback; - root: Node; - expandEntityReferences: boolean; - nextNode(): Node; - detach(): void; - previousNode(): Node; -} -declare var NodeIterator: { - prototype: NodeIterator; - new(): NodeIterator; -} - -interface CSSStyleRule extends CSSRule, MSCSSStyleRuleExtensions { - selectorText: string; - style: MSStyleCSSProperties; -} -declare var CSSStyleRule: { - prototype: CSSStyleRule; - new(): CSSStyleRule; -} - -interface MSDataBindingRecordSetReadonlyExtensions { - recordset: Object; - namedRecordset(dataMember: string, hierarchy?: any): Object; -} - -interface HTMLLinkElement extends HTMLElement, MSLinkStyleExtensions, LinkStyle { - rel: string; - target: string; - href: string; - media: string; - rev: string; - type: string; - charset: string; - hreflang: string; -} -declare var HTMLLinkElement: { - prototype: HTMLLinkElement; - new(): HTMLLinkElement; -} - -interface SVGViewElement extends SVGElement, SVGZoomAndPan, SVGFitToViewBox { - viewTarget: SVGStringList; -} -declare var SVGViewElement: { - prototype: SVGViewElement; - new(): SVGViewElement; -} - -interface MSHTMLAppletElementExtensions extends DOML2DeprecatedBorderStyle_HTMLObjectElement { - codeType: string; - standby: string; - classid: string; - useMap: string; - form: HTMLFormElement; - data: string; - contentDocument: Document; - altHtml: string; - declare: boolean; - type: string; - BaseHref: string; -} - -interface SVGLocatable { - farthestViewportElement: SVGElement; - nearestViewportElement: SVGElement; - getBBox(): SVGRect; - getTransformToElement(element: SVGElement): SVGMatrix; - getCTM(): SVGMatrix; - getScreenCTM(): SVGMatrix; -} - -interface HTMLFontElement extends HTMLElement, DOML2DeprecatedColorProperty, MSHTMLFontElementExtensions, DOML2DeprecatedSizeProperty { - face: string; -} -declare var HTMLFontElement: { - prototype: HTMLFontElement; - new(): HTMLFontElement; -} - -interface MSHTMLTableElementExtensions { - cells: HTMLCollection; - height: any; - cols: number; - moveRow(indexFrom?: number, indexTo?: number): Object; -} - -interface SVGTitleElement extends SVGElement, SVGStylable, SVGLangSpace { -} -declare var SVGTitleElement: { - prototype: SVGTitleElement; - new(): SVGTitleElement; -} - -interface ControlRangeCollection { - length: number; - queryCommandValue(cmdID: string): any; - remove(index: number): void; - add(item: Element): void; - queryCommandIndeterm(cmdID: string): boolean; - scrollIntoView(varargStart?: any): void; - item(index: number): Element; - [index: number]: Element; - execCommand(cmdID: string, showUI?: boolean, value?: any): boolean; - addElement(item: Element): void; - queryCommandState(cmdID: string): boolean; - queryCommandSupported(cmdID: string): boolean; - queryCommandEnabled(cmdID: string): boolean; - queryCommandText(cmdID: string): string; - select(): void; -} -declare var ControlRangeCollection: { - prototype: ControlRangeCollection; - new(): ControlRangeCollection; -} - -interface DOML2DeprecatedAlignmentStyle_HTMLImageElement { - align: string; -} - -interface MSHTMLFrameElementExtensions { - width: any; - contentWindow: Window; - onload: (ev: Event) => any; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - frameBorder: string; - height: any; - border: string; - frameSpacing: any; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface MSNamespaceInfo extends MSEventAttachmentTarget { - urn: string; - onreadystatechange: (ev: Event) => any; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - name: string; - readyState: string; - doImport(implementationUrl: string): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var MSNamespaceInfo: { - prototype: MSNamespaceInfo; - new(): MSNamespaceInfo; -} - -interface WindowSessionStorage { - sessionStorage: Storage; -} - -interface SVGAnimatedTransformList { - animVal: SVGTransformList; - baseVal: SVGTransformList; -} -declare var SVGAnimatedTransformList: { - prototype: SVGAnimatedTransformList; - new(): SVGAnimatedTransformList; -} - -interface HTMLTableCaptionElement extends HTMLElement, MSHTMLTableCaptionElementExtensions, DOML2DeprecatedAlignmentStyle_HTMLTableCaptionElement { -} -declare var HTMLTableCaptionElement: { - prototype: HTMLTableCaptionElement; - new(): HTMLTableCaptionElement; -} - -interface HTMLOptionElement extends HTMLElement, MSDataBindingExtensions { - index: number; - defaultSelected: boolean; - value: string; - text: string; - form: HTMLFormElement; - label: string; - selected: boolean; -} -declare var HTMLOptionElement: { - prototype: HTMLOptionElement; - new(): HTMLOptionElement; -} - -interface HTMLMapElement extends HTMLElement { - name: string; - areas: HTMLAreasCollection; -} -declare var HTMLMapElement: { - prototype: HTMLMapElement; - new(): HTMLMapElement; -} - -interface HTMLMenuElement extends HTMLElement, DOML2DeprecatedListSpaceReduction, MSHTMLMenuElementExtensions { - type: string; -} -declare var HTMLMenuElement: { - prototype: HTMLMenuElement; - new(): HTMLMenuElement; -} - -interface MouseWheelEvent extends MouseEvent { - wheelDelta: number; - initMouseWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: AbstractView, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, wheelDeltaArg: number): void; -} -declare var MouseWheelEvent: { - prototype: MouseWheelEvent; - new(): MouseWheelEvent; -} - -interface SVGFitToViewBox { - viewBox: SVGAnimatedRect; - preserveAspectRatio: SVGAnimatedPreserveAspectRatio; -} - -interface MSHTMLAnchorElementExtensions { - nameProp: string; - protocolLong: string; - urn: string; - mimeType: string; - Methods: string; -} - -interface SVGPointList { - numberOfItems: number; - replaceItem(newItem: SVGPoint, index: number): SVGPoint; - getItem(index: number): SVGPoint; - clear(): void; - appendItem(newItem: SVGPoint): SVGPoint; - initialize(newItem: SVGPoint): SVGPoint; - removeItem(index: number): SVGPoint; - insertItemBefore(newItem: SVGPoint, index: number): SVGPoint; -} -declare var SVGPointList: { - prototype: SVGPointList; - new(): SVGPointList; -} - -interface MSElementCSSInlineStyleExtensions { - doScroll(component?: any): void; - componentFromPoint(x: number, y: number): string; -} - -interface SVGAnimatedLengthList { - animVal: SVGLengthList; - baseVal: SVGLengthList; -} -declare var SVGAnimatedLengthList: { - prototype: SVGAnimatedLengthList; - new(): SVGAnimatedLengthList; -} - -interface MSHTMLTableDataCellElementExtensions { -} - -interface Window extends ViewCSS, MSEventAttachmentTarget, MSWindowExtensions, WindowPerformance, ScreenView, EventTarget, WindowLocalStorage, WindowSessionStorage, WindowTimers { - ondragend: (ev: DragEvent) => any; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - onkeydown: (ev: KeyboardEvent) => any; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - ondragover: (ev: DragEvent) => any; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - onkeyup: (ev: KeyboardEvent) => any; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - onreset: (ev: Event) => any; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - onmouseup: (ev: MouseEvent) => any; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - ondragstart: (ev: DragEvent) => any; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - ondrag: (ev: DragEvent) => any; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - onmouseover: (ev: MouseEvent) => any; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - ondragleave: (ev: DragEvent) => any; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - history: History; - name: string; - onafterprint: (ev: Event) => any; - addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; - onpause: (ev: Event) => any; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - onbeforeprint: (ev: Event) => any; - addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; - top: Window; - onmousedown: (ev: MouseEvent) => any; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - onseeked: (ev: Event) => any; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - opener: Window; - onclick: (ev: MouseEvent) => any; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - onwaiting: (ev: Event) => any; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - ononline: (ev: Event) => any; - addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; - ondurationchange: (ev: Event) => any; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - frames: Window; - onblur: (ev: FocusEvent) => any; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - onemptied: (ev: Event) => any; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - onseeking: (ev: Event) => any; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - oncanplay: (ev: Event) => any; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - onstalled: (ev: Event) => any; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - onmousemove: (ev: MouseEvent) => any; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - onoffline: (ev: Event) => any; - addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; - length: number; - onbeforeunload: (ev: BeforeUnloadEvent) => any; - addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; - onratechange: (ev: Event) => any; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - onstorage: (ev: StorageEvent) => any; - addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; - onloadstart: (ev: Event) => any; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - ondragenter: (ev: DragEvent) => any; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - onsubmit: (ev: Event) => any; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - self: Window; - onprogress: (ev: any) => any; - addEventListener(type: "progress", listener: (ev: any) => any, useCapture?: boolean): void; - ondblclick: (ev: MouseEvent) => any; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - oncontextmenu: (ev: MouseEvent) => any; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - onchange: (ev: Event) => any; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - onloadedmetadata: (ev: Event) => any; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - onplay: (ev: Event) => any; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - onerror: ErrorFunction; - onplaying: (ev: Event) => any; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - parent: Window; - location: Location; - oncanplaythrough: (ev: Event) => any; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - onabort: (ev: UIEvent) => any; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - onreadystatechange: (ev: Event) => any; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - onkeypress: (ev: KeyboardEvent) => any; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - frameElement: Element; - onloadeddata: (ev: Event) => any; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - onsuspend: (ev: Event) => any; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - window: Window; - onfocus: (ev: FocusEvent) => any; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - onmessage: (ev: MessageEvent) => any; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - ontimeupdate: (ev: Event) => any; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - onresize: (ev: UIEvent) => any; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - navigator: Navigator; - onselect: (ev: UIEvent) => any; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - ondrop: (ev: DragEvent) => any; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - onmouseout: (ev: MouseEvent) => any; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - onended: (ev: Event) => any; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - onhashchange: (ev: Event) => any; - addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; - onunload: (ev: Event) => any; - addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; - onscroll: (ev: UIEvent) => any; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - onmousewheel: (ev: MouseWheelEvent) => any; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - onload: (ev: Event) => any; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - onvolumechange: (ev: Event) => any; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - oninput: (ev: Event) => any; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - alert(message?: string): void; - focus(): void; - print(): void; - prompt(message?: string, defaul?: string): string; - toString(): string; - open(url?: string, target?: string, features?: string, replace?: boolean): Window; - close(): void; - confirm(message?: string): boolean; - postMessage(message: any, targetOrigin: string, ports?: any): void; - showModalDialog(url?: string, argument?: any, options?: any): any; - blur(): void; - getSelection(): Selection; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var Window: { - prototype: Window; - new(): Window; -} - -interface SVGAnimatedPreserveAspectRatio { - animVal: SVGPreserveAspectRatio; - baseVal: SVGPreserveAspectRatio; -} -declare var SVGAnimatedPreserveAspectRatio: { - prototype: SVGAnimatedPreserveAspectRatio; - new(): SVGAnimatedPreserveAspectRatio; -} - -interface MSSiteModeEvent extends Event { - buttonID: number; - actionURL: string; -} -declare var MSSiteModeEvent: { - prototype: MSSiteModeEvent; - new(): MSSiteModeEvent; -} - -interface MSCSSStyleRuleExtensions { - readOnly: boolean; -} - -interface StyleSheetPageList { - length: number; - item(index: number): StyleSheetPage; - [index: number]: StyleSheetPage; -} -declare var StyleSheetPageList: { - prototype: StyleSheetPageList; - new(): StyleSheetPageList; -} - -interface HTMLCollection extends MSHTMLCollectionExtensions { - length: number; - item(nameOrIndex?: any, optionalIndex?: any): Element; - (nameOrIndex: any, optionalIndex: any): Element; - namedItem(name: string): Element; - [index: number]: Element; - (name: string): Element; -} -declare var HTMLCollection: { - prototype: HTMLCollection; - new(): HTMLCollection; -} - -interface MSCSSProperties extends CSSStyleDeclaration, MSCSSStyleDeclarationExtensions { - scrollbarShadowColor: string; - scrollbarHighlightColor: string; - layoutGridChar: string; - layoutGridType: string; - textAutospace: string; - textKashidaSpace: string; - writingMode: string; - scrollbarFaceColor: string; - backgroundPositionY: string; - lineBreak: string; - imeMode: string; - msBlockProgression: string; - layoutGridLine: string; - scrollbarBaseColor: string; - layoutGrid: string; - layoutFlow: string; - textKashida: string; - filter: string; - zoom: string; - scrollbarArrowColor: string; - behavior: string; - backgroundPositionX: string; - accelerator: string; - layoutGridMode: string; - textJustifyTrim: string; - scrollbar3dLightColor: string; - msInterpolationMode: string; - scrollbarTrackColor: string; - scrollbarDarkShadowColor: string; - styleFloat: string; -} -declare var MSCSSProperties: { - prototype: MSCSSProperties; - new(): MSCSSProperties; -} - -interface HTMLImageElement extends HTMLElement, DOML2DeprecatedMarginStyle, DOML2DeprecatedBorderStyle, DOML2DeprecatedAlignmentStyle_HTMLImageElement, MSImageResourceExtensions, MSHTMLImageElementExtensions, MSDataBindingExtensions, MSResourceMetadata { - width: number; - naturalHeight: number; - alt: string; - src: string; - useMap: string; - naturalWidth: number; - name: string; - height: number; - longDesc: string; - isMap: boolean; - complete: boolean; -} -declare var HTMLImageElement: { - prototype: HTMLImageElement; - new(): HTMLImageElement; -} - -interface HTMLAreaElement extends HTMLElement, MSHTMLAreaElementExtensions { - protocol: string; - search: string; - alt: string; - coords: string; - hostname: string; - port: string; - pathname: string; - host: string; - hash: string; - target: string; - href: string; - noHref: boolean; - shape: string; - toString(): string; -} -declare var HTMLAreaElement: { - prototype: HTMLAreaElement; - new(): HTMLAreaElement; -} - -interface EventTarget { - removeEventListener(type: string, listener: EventListener, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; - dispatchEvent(evt: Event): boolean; -} - -interface SVGAngle { - valueAsString: string; - valueInSpecifiedUnits: number; - value: number; - unitType: number; - newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; - convertToSpecifiedUnits(unitType: number): void; - SVG_ANGLETYPE_RAD: number; - SVG_ANGLETYPE_UNKNOWN: number; - SVG_ANGLETYPE_UNSPECIFIED: number; - SVG_ANGLETYPE_DEG: number; - SVG_ANGLETYPE_GRAD: number; -} -declare var SVGAngle: { - prototype: SVGAngle; - new(): SVGAngle; - SVG_ANGLETYPE_RAD: number; - SVG_ANGLETYPE_UNKNOWN: number; - SVG_ANGLETYPE_UNSPECIFIED: number; - SVG_ANGLETYPE_DEG: number; - SVG_ANGLETYPE_GRAD: number; -} - -interface HTMLButtonElement extends HTMLElement, MSHTMLButtonElementExtensions, MSDataBindingExtensions { - value: string; - form: HTMLFormElement; - name: string; - type: string; -} -declare var HTMLButtonElement: { - prototype: HTMLButtonElement; - new(): HTMLButtonElement; -} - -interface MSHTMLLabelElementExtensions { -} - -interface HTMLSourceElement extends HTMLElement { - src: string; - media: string; - type: string; -} -declare var HTMLSourceElement: { - prototype: HTMLSourceElement; - new(): HTMLSourceElement; -} - -interface CanvasGradient { - addColorStop(offset: number, color: string): void; -} -declare var CanvasGradient: { - prototype: CanvasGradient; - new(): CanvasGradient; -} - -interface KeyboardEvent extends UIEvent, KeyboardEventExtensions { - location: number; - shiftKey: boolean; - locale: string; - key: string; - altKey: boolean; - metaKey: boolean; - char: string; - ctrlKey: boolean; - repeat: boolean; - getModifierState(keyArg: string): boolean; - initKeyboardEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: AbstractView, keyArg: string, locationArg: number, modifiersListArg: string, repeat: boolean, locale: string): void; - DOM_KEY_LOCATION_RIGHT: number; - DOM_KEY_LOCATION_STANDARD: number; - DOM_KEY_LOCATION_LEFT: number; - DOM_KEY_LOCATION_NUMPAD: number; - DOM_KEY_LOCATION_JOYSTICK: number; - DOM_KEY_LOCATION_MOBILE: number; -} -declare var KeyboardEvent: { - prototype: KeyboardEvent; - new(): KeyboardEvent; - DOM_KEY_LOCATION_RIGHT: number; - DOM_KEY_LOCATION_STANDARD: number; - DOM_KEY_LOCATION_LEFT: number; - DOM_KEY_LOCATION_NUMPAD: number; - DOM_KEY_LOCATION_JOYSTICK: number; - DOM_KEY_LOCATION_MOBILE: number; -} - -interface Document extends Node, DocumentStyle, DocumentRange, HTMLDocument, NodeSelector, DocumentEvent, DocumentTraversal, DocumentView, SVGDocument { - doctype: DocumentType; - xmlVersion: string; - implementation: DOMImplementation; - xmlEncoding: string; - xmlStandalone: boolean; - documentElement: HTMLElement; - inputEncoding: string; - createElement(tagName: string): HTMLElement; - createElement(tagName: "a"): HTMLAnchorElement; - createElement(tagName: "abbr"): HTMLElement; - createElement(tagName: "address"): HTMLElement; - createElement(tagName: "area"): HTMLAreaElement; - createElement(tagName: "article"): HTMLElement; - createElement(tagName: "aside"): HTMLElement; - createElement(tagName: "audio"): HTMLAudioElement; - createElement(tagName: "b"): HTMLElement; - createElement(tagName: "base"): HTMLBaseElement; - createElement(tagName: "bdi"): HTMLElement; - createElement(tagName: "bdo"): HTMLElement; - createElement(tagName: "blockquote"): HTMLQuoteElement; - createElement(tagName: "body"): HTMLBodyElement; - createElement(tagName: "br"): HTMLBRElement; - createElement(tagName: "button"): HTMLButtonElement; - createElement(tagName: "canvas"): HTMLCanvasElement; - createElement(tagName: "caption"): HTMLTableCaptionElement; - createElement(tagName: "cite"): HTMLElement; - createElement(tagName: "code"): HTMLElement; - createElement(tagName: "col"): HTMLTableColElement; - createElement(tagName: "colgroup"): HTMLTableColElement; - createElement(tagName: "datalist"): HTMLDataListElement; - createElement(tagName: "dd"): HTMLElement; - createElement(tagName: "del"): HTMLModElement; - createElement(tagName: "dfn"): HTMLElement; - createElement(tagName: "div"): HTMLDivElement; - createElement(tagName: "dl"): HTMLDListElement; - createElement(tagName: "dt"): HTMLElement; - createElement(tagName: "em"): HTMLElement; - createElement(tagName: "embed"): HTMLEmbedElement; - createElement(tagName: "fieldset"): HTMLFieldSetElement; - createElement(tagName: "figcaption"): HTMLElement; - createElement(tagName: "figure"): HTMLElement; - createElement(tagName: "footer"): HTMLElement; - createElement(tagName: "form"): HTMLFormElement; - createElement(tagName: "h1"): HTMLHeadingElement; - createElement(tagName: "h2"): HTMLHeadingElement; - createElement(tagName: "h3"): HTMLHeadingElement; - createElement(tagName: "h4"): HTMLHeadingElement; - createElement(tagName: "h5"): HTMLHeadingElement; - createElement(tagName: "h6"): HTMLHeadingElement; - createElement(tagName: "head"): HTMLHeadElement; - createElement(tagName: "header"): HTMLElement; - createElement(tagName: "hgroup"): HTMLElement; - createElement(tagName: "hr"): HTMLHRElement; - createElement(tagName: "html"): HTMLHtmlElement; - createElement(tagName: "i"): HTMLElement; - createElement(tagName: "iframe"): HTMLIFrameElement; - createElement(tagName: "img"): HTMLImageElement; - createElement(tagName: "input"): HTMLInputElement; - createElement(tagName: "ins"): HTMLModElement; - createElement(tagName: "kbd"): HTMLElement; - createElement(tagName: "label"): HTMLLabelElement; - createElement(tagName: "legend"): HTMLLegendElement; - createElement(tagName: "li"): HTMLLIElement; - createElement(tagName: "link"): HTMLLinkElement; - createElement(tagName: "main"): HTMLElement; - createElement(tagName: "map"): HTMLMapElement; - createElement(tagName: "mark"): HTMLElement; - createElement(tagName: "menu"): HTMLMenuElement; - createElement(tagName: "meta"): HTMLMetaElement; - createElement(tagName: "nav"): HTMLElement; - createElement(tagName: "noscript"): HTMLElement; - createElement(tagName: "object"): HTMLObjectElement; - createElement(tagName: "ol"): HTMLOListElement; - createElement(tagName: "optgroup"): HTMLOptGroupElement; - createElement(tagName: "option"): HTMLOptionElement; - createElement(tagName: "p"): HTMLParagraphElement; - createElement(tagName: "param"): HTMLParamElement; - createElement(tagName: "pre"): HTMLPreElement; - createElement(tagName: "progress"): HTMLProgressElement; - createElement(tagName: "q"): HTMLQuoteElement; - createElement(tagName: "rp"): HTMLElement; - createElement(tagName: "rt"): HTMLElement; - createElement(tagName: "ruby"): HTMLElement; - createElement(tagName: "s"): HTMLElement; - createElement(tagName: "samp"): HTMLElement; - createElement(tagName: "script"): HTMLScriptElement; - createElement(tagName: "section"): HTMLElement; - createElement(tagName: "select"): HTMLSelectElement; - createElement(tagName: "small"): HTMLElement; - createElement(tagName: "source"): HTMLSourceElement; - createElement(tagName: "span"): HTMLSpanElement; - createElement(tagName: "strong"): HTMLElement; - createElement(tagName: "style"): HTMLStyleElement; - createElement(tagName: "sub"): HTMLElement; - createElement(tagName: "summary"): HTMLElement; - createElement(tagName: "sup"): HTMLElement; - createElement(tagName: "table"): HTMLTableElement; - createElement(tagName: "tbody"): HTMLTableSectionElement; - createElement(tagName: "td"): HTMLTableDataCellElement; - createElement(tagName: "textarea"): HTMLTextAreaElement; - createElement(tagName: "tfoot"): HTMLTableSectionElement; - createElement(tagName: "th"): HTMLTableHeaderCellElement; - createElement(tagName: "thead"): HTMLTableSectionElement; - createElement(tagName: "title"): HTMLTitleElement; - createElement(tagName: "tr"): HTMLTableRowElement; - createElement(tagName: "track"): HTMLTrackElement; - createElement(tagName: "u"): HTMLElement; - createElement(tagName: "ul"): HTMLUListElement; - createElement(tagName: "var"): HTMLElement; - createElement(tagName: "video"): HTMLVideoElement; - createElement(tagName: "wbr"): HTMLElement; - adoptNode(source: Node): Node; - createComment(data: string): Comment; - createDocumentFragment(): DocumentFragment; - getElementsByTagName(tagname: string): NodeList; - getElementsByTagName(name: "a"): NodeListOf; - getElementsByTagName(name: "abbr"): NodeListOf; - getElementsByTagName(name: "address"): NodeListOf; - getElementsByTagName(name: "area"): NodeListOf; - getElementsByTagName(name: "article"): NodeListOf; - getElementsByTagName(name: "aside"): NodeListOf; - getElementsByTagName(name: "audio"): NodeListOf; - getElementsByTagName(name: "b"): NodeListOf; - getElementsByTagName(name: "base"): NodeListOf; - getElementsByTagName(name: "bdi"): NodeListOf; - getElementsByTagName(name: "bdo"): NodeListOf; - getElementsByTagName(name: "blockquote"): NodeListOf; - getElementsByTagName(name: "body"): NodeListOf; - getElementsByTagName(name: "br"): NodeListOf; - getElementsByTagName(name: "button"): NodeListOf; - getElementsByTagName(name: "canvas"): NodeListOf; - getElementsByTagName(name: "caption"): NodeListOf; - getElementsByTagName(name: "cite"): NodeListOf; - getElementsByTagName(name: "code"): NodeListOf; - getElementsByTagName(name: "col"): NodeListOf; - getElementsByTagName(name: "colgroup"): NodeListOf; - getElementsByTagName(name: "datalist"): NodeListOf; - getElementsByTagName(name: "dd"): NodeListOf; - getElementsByTagName(name: "del"): NodeListOf; - getElementsByTagName(name: "dfn"): NodeListOf; - getElementsByTagName(name: "div"): NodeListOf; - getElementsByTagName(name: "dl"): NodeListOf; - getElementsByTagName(name: "dt"): NodeListOf; - getElementsByTagName(name: "em"): NodeListOf; - getElementsByTagName(name: "embed"): NodeListOf; - getElementsByTagName(name: "fieldset"): NodeListOf; - getElementsByTagName(name: "figcaption"): NodeListOf; - getElementsByTagName(name: "figure"): NodeListOf; - getElementsByTagName(name: "footer"): NodeListOf; - getElementsByTagName(name: "form"): NodeListOf; - getElementsByTagName(name: "h1"): NodeListOf; - getElementsByTagName(name: "h2"): NodeListOf; - getElementsByTagName(name: "h3"): NodeListOf; - getElementsByTagName(name: "h4"): NodeListOf; - getElementsByTagName(name: "h5"): NodeListOf; - getElementsByTagName(name: "h6"): NodeListOf; - getElementsByTagName(name: "head"): NodeListOf; - getElementsByTagName(name: "header"): NodeListOf; - getElementsByTagName(name: "hgroup"): NodeListOf; - getElementsByTagName(name: "hr"): NodeListOf; - getElementsByTagName(name: "html"): NodeListOf; - getElementsByTagName(name: "i"): NodeListOf; - getElementsByTagName(name: "iframe"): NodeListOf; - getElementsByTagName(name: "img"): NodeListOf; - getElementsByTagName(name: "input"): NodeListOf; - getElementsByTagName(name: "ins"): NodeListOf; - getElementsByTagName(name: "kbd"): NodeListOf; - getElementsByTagName(name: "label"): NodeListOf; - getElementsByTagName(name: "legend"): NodeListOf; - getElementsByTagName(name: "li"): NodeListOf; - getElementsByTagName(name: "link"): NodeListOf; - getElementsByTagName(name: "main"): NodeListOf; - getElementsByTagName(name: "map"): NodeListOf; - getElementsByTagName(name: "mark"): NodeListOf; - getElementsByTagName(name: "menu"): NodeListOf; - getElementsByTagName(name: "meta"): NodeListOf; - getElementsByTagName(name: "nav"): NodeListOf; - getElementsByTagName(name: "noscript"): NodeListOf; - getElementsByTagName(name: "object"): NodeListOf; - getElementsByTagName(name: "ol"): NodeListOf; - getElementsByTagName(name: "optgroup"): NodeListOf; - getElementsByTagName(name: "option"): NodeListOf; - getElementsByTagName(name: "p"): NodeListOf; - getElementsByTagName(name: "param"): NodeListOf; - getElementsByTagName(name: "pre"): NodeListOf; - getElementsByTagName(name: "progress"): NodeListOf; - getElementsByTagName(name: "q"): NodeListOf; - getElementsByTagName(name: "rp"): NodeListOf; - getElementsByTagName(name: "rt"): NodeListOf; - getElementsByTagName(name: "ruby"): NodeListOf; - getElementsByTagName(name: "s"): NodeListOf; - getElementsByTagName(name: "samp"): NodeListOf; - getElementsByTagName(name: "script"): NodeListOf; - getElementsByTagName(name: "section"): NodeListOf; - getElementsByTagName(name: "select"): NodeListOf; - getElementsByTagName(name: "small"): NodeListOf; - getElementsByTagName(name: "source"): NodeListOf; - getElementsByTagName(name: "span"): NodeListOf; - getElementsByTagName(name: "strong"): NodeListOf; - getElementsByTagName(name: "style"): NodeListOf; - getElementsByTagName(name: "sub"): NodeListOf; - getElementsByTagName(name: "summary"): NodeListOf; - getElementsByTagName(name: "sup"): NodeListOf; - getElementsByTagName(name: "table"): NodeListOf; - getElementsByTagName(name: "tbody"): NodeListOf; - getElementsByTagName(name: "td"): NodeListOf; - getElementsByTagName(name: "textarea"): NodeListOf; - getElementsByTagName(name: "tfoot"): NodeListOf; - getElementsByTagName(name: "th"): NodeListOf; - getElementsByTagName(name: "thead"): NodeListOf; - getElementsByTagName(name: "title"): NodeListOf; - getElementsByTagName(name: "tr"): NodeListOf; - getElementsByTagName(name: "track"): NodeListOf; - getElementsByTagName(name: "u"): NodeListOf; - getElementsByTagName(name: "ul"): NodeListOf; - getElementsByTagName(name: "var"): NodeListOf; - getElementsByTagName(name: "video"): NodeListOf; - getElementsByTagName(name: "wbr"): NodeListOf; - getElementsByTagNameNS(namespaceURI: string, localName: string): NodeList; - createProcessingInstruction(target: string, data: string): ProcessingInstruction; - createElementNS(namespaceURI: string, qualifiedName: string): Element; - createAttribute(name: string): Attr; - createTextNode(data: string): Text; - importNode(importedNode: Node, deep: boolean): Node; - createCDATASection(data: string): CDATASection; - createAttributeNS(namespaceURI: string, qualifiedName: string): Attr; - getElementById(elementId: string): HTMLElement; -} -declare var Document: { - prototype: Document; - new(): Document; -} - -interface MessageEvent extends Event { - source: Window; - origin: string; - data: any; - initMessageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, dataArg: any, originArg: string, lastEventIdArg: string, sourceArg: Window): void; -} -declare var MessageEvent: { - prototype: MessageEvent; - new(): MessageEvent; -} - -interface SVGElement extends Element, SVGElementEventHandlers { - xmlbase: string; - viewportElement: SVGElement; - id: string; - ownerSVGElement: SVGSVGElement; -} -declare var SVGElement: { - prototype: SVGElement; - new(): SVGElement; -} - -interface HTMLScriptElement extends HTMLElement { - defer: boolean; - text: string; - src: string; - htmlFor: string; - charset: string; - type: string; - event: string; -} -declare var HTMLScriptElement: { - prototype: HTMLScriptElement; - new(): HTMLScriptElement; -} - -interface MSHTMLBodyElementExtensions extends DOML2DeprecatedWordWrapSuppression_HTMLBodyElement { - scroll: string; - bottomMargin: any; - topMargin: any; - rightMargin: any; - bgProperties: string; - leftMargin: any; - createTextRange(): TextRange; -} - -interface HTMLTableRowElement extends HTMLElement, MSBorderColorHighlightStyle_HTMLTableRowElement, HTMLTableAlignment, MSBorderColorStyle_HTMLTableRowElement, DOML2DeprecatedAlignmentStyle_HTMLTableRowElement, DOML2DeprecatedBackgroundColorStyle, MSHTMLTableRowElementExtensions { - rowIndex: number; - cells: HTMLCollection; - sectionRowIndex: number; - deleteCell(index?: number): void; - insertCell(index?: number): HTMLElement; -} -declare var HTMLTableRowElement: { - prototype: HTMLTableRowElement; - new(): HTMLTableRowElement; -} - -interface MSCommentExtensions { - text: string; -} - -interface DOML2DeprecatedMarginStyle_HTMLMarqueeElement { - vspace: number; - hspace: number; -} - -interface MSCSSRuleList { - length: number; - item(index?: number): CSSStyleRule; - [index: number]: CSSStyleRule; -} -declare var MSCSSRuleList: { - prototype: MSCSSRuleList; - new(): MSCSSRuleList; -} - -interface CanvasRenderingContext2D { - shadowOffsetX: number; - lineWidth: number; - miterLimit: number; - canvas: HTMLCanvasElement; - strokeStyle: any; - font: string; - globalAlpha: number; - globalCompositeOperation: string; - shadowOffsetY: number; - fillStyle: any; - lineCap: string; - shadowBlur: number; - textAlign: string; - textBaseline: string; - shadowColor: string; - lineJoin: string; - restore(): void; - setTransform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; - save(): void; - arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; - measureText(text: string): TextMetrics; - isPointInPath(x: number, y: number): boolean; - quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; - putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX?: number, dirtyY?: number, dirtyWidth?: number, dirtyHeight?: number): void; - rotate(angle: number): void; - fillText(text: string, x: number, y: number, maxWidth?: number): void; - translate(x: number, y: number): void; - scale(x: number, y: number): void; - createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; - lineTo(x: number, y: number): void; - fill(): void; - createPattern(image: HTMLElement, repetition: string): CanvasPattern; - closePath(): void; - rect(x: number, y: number, w: number, h: number): void; - clip(): void; - createImageData(imageDataOrSw: any, sh?: number): ImageData; - clearRect(x: number, y: number, w: number, h: number): void; - moveTo(x: number, y: number): void; - getImageData(sx: number, sy: number, sw: number, sh: number): ImageData; - fillRect(x: number, y: number, w: number, h: number): void; - bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; - drawImage(image: HTMLElement, offsetX: number, offsetY: number, width?: number, height?: number, canvasOffsetX?: number, canvasOffsetY?: number, canvasImageWidth?: number, canvasImageHeight?: number): void; - transform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; - stroke(): void; - strokeRect(x: number, y: number, w: number, h: number): void; - strokeText(text: string, x: number, y: number, maxWidth?: number): void; - beginPath(): void; - arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; - createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient; -} -declare var CanvasRenderingContext2D: { - prototype: CanvasRenderingContext2D; - new(): CanvasRenderingContext2D; -} - -interface SVGPathSegLinetoHorizontalAbs extends SVGPathSeg { - x: number; -} -declare var SVGPathSegLinetoHorizontalAbs: { - prototype: SVGPathSegLinetoHorizontalAbs; - new(): SVGPathSegLinetoHorizontalAbs; -} - -interface DOML2DeprecatedAlignmentStyle_HTMLObjectElement { - align: string; -} - -interface DOML2DeprecatedBorderStyle_MSHTMLIFrameElementExtensions { - border: string; -} - -interface MSHTMLElementRangeExtensions { - createControlRange(): ControlRangeCollection; -} - -interface SVGPathSegArcAbs extends SVGPathSeg { - y: number; - sweepFlag: boolean; - r2: number; - x: number; - angle: number; - r1: number; - largeArcFlag: boolean; -} -declare var SVGPathSegArcAbs: { - prototype: SVGPathSegArcAbs; - new(): SVGPathSegArcAbs; -} - -interface MSScreenExtensions { - deviceXDPI: number; - fontSmoothingEnabled: boolean; - bufferDepth: number; - logicalXDPI: number; - systemXDPI: number; - logicalYDPI: number; - systemYDPI: number; - updateInterval: number; - deviceYDPI: number; -} - -interface HTMLHtmlElement extends HTMLElement, HTMLHtmlElementDOML2Deprecated { -} -declare var HTMLHtmlElement: { - prototype: HTMLHtmlElement; - new(): HTMLHtmlElement; -} - -interface MSBorderColorStyle { - borderColor: any; -} - -interface SVGTransformList { - numberOfItems: number; - getItem(index: number): SVGTransform; - consolidate(): SVGTransform; - clear(): void; - appendItem(newItem: SVGTransform): SVGTransform; - initialize(newItem: SVGTransform): SVGTransform; - removeItem(index: number): SVGTransform; - insertItemBefore(newItem: SVGTransform, index: number): SVGTransform; - replaceItem(newItem: SVGTransform, index: number): SVGTransform; - createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; -} -declare var SVGTransformList: { - prototype: SVGTransformList; - new(): SVGTransformList; -} - -interface SVGPathSegClosePath extends SVGPathSeg { -} -declare var SVGPathSegClosePath: { - prototype: SVGPathSegClosePath; - new(): SVGPathSegClosePath; -} - -interface DOML2DeprecatedMarginStyle_MSHTMLIFrameElementExtensions { - vspace: number; - hspace: number; -} - -interface HTMLFrameElement extends HTMLElement, GetSVGDocument, MSHTMLFrameElementExtensions, MSDataBindingExtensions, MSBorderColorStyle_HTMLFrameElement { - scrolling: string; - marginHeight: string; - src: string; - name: string; - marginWidth: string; - contentDocument: Document; - longDesc: string; - noResize: boolean; -} -declare var HTMLFrameElement: { - prototype: HTMLFrameElement; - new(): HTMLFrameElement; -} - -interface SVGAnimatedLength { - animVal: SVGLength; - baseVal: SVGLength; -} -declare var SVGAnimatedLength: { - prototype: SVGAnimatedLength; - new(): SVGAnimatedLength; -} - -interface CSSMediaRule extends CSSRule { - media: MediaList; - cssRules: CSSRuleList; - insertRule(rule: string, index?: number): number; - deleteRule(index?: number): void; -} -declare var CSSMediaRule: { - prototype: CSSMediaRule; - new(): CSSMediaRule; -} - -interface HTMLQuoteElement extends HTMLElement, MSHTMLQuoteElementExtensions { - cite: string; -} -declare var HTMLQuoteElement: { - prototype: HTMLQuoteElement; - new(): HTMLQuoteElement; -} - -interface SVGDefsElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests { -} -declare var SVGDefsElement: { - prototype: SVGDefsElement; - new(): SVGDefsElement; -} - -interface SVGAnimatedPoints { - points: SVGPointList; - animatedPoints: SVGPointList; -} - -interface WindowModal { - dialogArguments: any; - returnValue: any; -} - -interface MSHTMLButtonElementExtensions { - status: any; - createTextRange(): TextRange; -} - -interface XMLHttpRequest extends EventTarget, MSXMLHttpRequestExtensions { - onreadystatechange: (ev: Event) => any; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - status: number; - onload: (ev: Event) => any; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - readyState: number; - responseText: string; - responseXML: Document; - statusText: string; - open(method: string, url: string, async?: boolean, user?: string, password?: string): void; - send(data?: any): void; - abort(): void; - getAllResponseHeaders(): string; - setRequestHeader(header: string, value: string): void; - getResponseHeader(header: string): string; - LOADING: number; - DONE: number; - UNSENT: number; - OPENED: number; - HEADERS_RECEIVED: number; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var XMLHttpRequest: { - prototype: XMLHttpRequest; - new (): XMLHttpRequest; - LOADING: number; - DONE: number; - UNSENT: number; - OPENED: number; - HEADERS_RECEIVED: number; -} - -interface HTMLTableHeaderCellElement extends HTMLTableCellElement, HTMLTableHeaderCellScope { -} -declare var HTMLTableHeaderCellElement: { - prototype: HTMLTableHeaderCellElement; - new(): HTMLTableHeaderCellElement; -} - -interface HTMLDListElement extends HTMLElement, DOML2DeprecatedListSpaceReduction, MSHTMLDListElementExtensions { -} -declare var HTMLDListElement: { - prototype: HTMLDListElement; - new(): HTMLDListElement; -} - -interface MSDataBindingExtensions { - dataSrc: string; - dataFormatAs: string; - dataFld: string; -} - -interface SVGEllipseElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests { - ry: SVGAnimatedLength; - cx: SVGAnimatedLength; - rx: SVGAnimatedLength; - cy: SVGAnimatedLength; -} -declare var SVGEllipseElement: { - prototype: SVGEllipseElement; - new(): SVGEllipseElement; -} - -interface SVGPathSegLinetoHorizontalRel extends SVGPathSeg { - x: number; -} -declare var SVGPathSegLinetoHorizontalRel: { - prototype: SVGPathSegLinetoHorizontalRel; - new(): SVGPathSegLinetoHorizontalRel; -} - -interface SVGAElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGURIReference { - target: SVGAnimatedString; -} -declare var SVGAElement: { - prototype: SVGAElement; - new(): SVGAElement; -} - -interface MSHTMLMetaElementExtensions { - url: string; - charset: string; -} - -interface SVGStylable { - className: SVGAnimatedString; - style: CSSStyleDeclaration; -} - -interface MSHTMLTableCellElementExtensions { -} - -interface HTMLFrameSetElement extends HTMLElement, MSHTMLFrameSetElementExtensions, MSBorderColorStyle_HTMLFrameSetElement { - onresize: (ev: UIEvent) => any; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - ononline: (ev: Event) => any; - addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; - onafterprint: (ev: Event) => any; - addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; - onbeforeprint: (ev: Event) => any; - addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; - onoffline: (ev: Event) => any; - addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; - rows: string; - cols: string; - onblur: (ev: FocusEvent) => any; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - onunload: (ev: Event) => any; - addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; - onhashchange: (ev: Event) => any; - addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; - onfocus: (ev: FocusEvent) => any; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - onmessage: (ev: MessageEvent) => any; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - onload: (ev: Event) => any; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - onerror: (ev: Event) => any; - addEventListener(type: "error", listener: (ev: Event) => any, useCapture?: boolean): void; - onbeforeunload: (ev: BeforeUnloadEvent) => any; - addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; - onstorage: (ev: StorageEvent) => any; - addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLFrameSetElement: { - prototype: HTMLFrameSetElement; - new(): HTMLFrameSetElement; -} - -interface SVGTransformable extends SVGLocatable { - transform: SVGAnimatedTransformList; -} - -interface Screen extends MSScreenExtensions { - width: number; - colorDepth: number; - availWidth: number; - pixelDepth: number; - availHeight: number; - height: number; -} -declare var Screen: { - prototype: Screen; - new(): Screen; -} - -interface NavigatorGeolocation { - geolocation: Geolocation; -} - -interface Coordinates { - altitudeAccuracy: number; - longitude: number; - latitude: number; - speed: number; - heading: number; - altitude: number; - accuracy: number; -} -declare var Coordinates: { - prototype: Coordinates; - new(): Coordinates; -} - -interface DOML2DeprecatedAlignmentStyle_HTMLTableColElement { - align: string; -} - -interface EventListener { - (evt: Event): void; -} - -interface SVGLangSpace { - xmllang: string; - xmlspace: string; -} - -interface DataTransfer { - effectAllowed: string; - dropEffect: string; - clearData(format?: string): boolean; - setData(format: string, data: string): boolean; - getData(format: string): string; -} -declare var DataTransfer: { - prototype: DataTransfer; - new(): DataTransfer; -} - -interface FocusEvent extends UIEvent { - relatedTarget: EventTarget; - initFocusEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: AbstractView, detailArg: number, relatedTargetArg: EventTarget): void; -} -declare var FocusEvent: { - prototype: FocusEvent; - new(): FocusEvent; -} - -interface Range { - startOffset: number; - collapsed: boolean; - endOffset: number; - startContainer: Node; - endContainer: Node; - commonAncestorContainer: Node; - setStart(refNode: Node, offset: number): void; - setEndBefore(refNode: Node): void; - setStartBefore(refNode: Node): void; - selectNode(refNode: Node): void; - detach(): void; - getBoundingClientRect(): ClientRect; - toString(): string; - compareBoundaryPoints(how: number, sourceRange: Range): number; - insertNode(newNode: Node): void; - collapse(toStart: boolean): void; - selectNodeContents(refNode: Node): void; - cloneContents(): DocumentFragment; - setEnd(refNode: Node, offset: number): void; - cloneRange(): Range; - getClientRects(): ClientRectList; - surroundContents(newParent: Node): void; - deleteContents(): void; - setStartAfter(refNode: Node): void; - extractContents(): DocumentFragment; - setEndAfter(refNode: Node): void; - END_TO_END: number; - START_TO_START: number; - START_TO_END: number; - END_TO_START: number; -} -declare var Range: { - prototype: Range; - new(): Range; - END_TO_END: number; - START_TO_START: number; - START_TO_END: number; - END_TO_START: number; -} - -interface MSHTMLPreElementExtensions extends DOML2DeprecatedTextFlowControl_HTMLBlockElement { - cite: string; -} - -interface SVGPoint { - y: number; - x: number; - matrixTransform(matrix: SVGMatrix): SVGPoint; -} -declare var SVGPoint: { - prototype: SVGPoint; - new(): SVGPoint; -} - -interface MSPluginsCollection { - length: number; - refresh(reload?: boolean): void; -} -declare var MSPluginsCollection: { - prototype: MSPluginsCollection; - new(): MSPluginsCollection; -} - -interface MSHTMLFontElementExtensions { -} - -interface SVGAnimatedNumberList { - animVal: SVGNumberList; - baseVal: SVGNumberList; -} -declare var SVGAnimatedNumberList: { - prototype: SVGAnimatedNumberList; - new(): SVGAnimatedNumberList; -} - -interface SVGSVGElement extends SVGElement, SVGZoomAndPan, SVGLangSpace, SVGLocatable, SVGTests, SVGFitToViewBox, SVGSVGElementEventHandlers, SVGStylable, DocumentEvent, ViewCSS_SVGSVGElement { - width: SVGAnimatedLength; - x: SVGAnimatedLength; - contentStyleType: string; - screenPixelToMillimeterY: number; - height: SVGAnimatedLength; - contentScriptType: string; - pixelUnitToMillimeterX: number; - currentTranslate: SVGPoint; - y: SVGAnimatedLength; - viewport: SVGRect; - currentScale: number; - screenPixelToMillimeterX: number; - pixelUnitToMillimeterY: number; - setCurrentTime(seconds: number): void; - createSVGLength(): SVGLength; - getIntersectionList(rect: SVGRect, referenceElement: SVGElement): NodeList; - unpauseAnimations(): void; - createSVGRect(): SVGRect; - checkIntersection(element: SVGElement, rect: SVGRect): boolean; - unsuspendRedrawAll(): void; - pauseAnimations(): void; - suspendRedraw(maxWaitMilliseconds: number): number; - deselectAll(): void; - createSVGAngle(): SVGAngle; - getEnclosureList(rect: SVGRect, referenceElement: SVGElement): NodeList; - createSVGTransform(): SVGTransform; - unsuspendRedraw(suspendHandleID: number): void; - forceRedraw(): void; - getCurrentTime(): number; - checkEnclosure(element: SVGElement, rect: SVGRect): boolean; - createSVGMatrix(): SVGMatrix; - createSVGPoint(): SVGPoint; - createSVGNumber(): SVGNumber; - createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; - getElementById(elementId: string): Element; -} -declare var SVGSVGElement: { - prototype: SVGSVGElement; - new(): SVGSVGElement; -} - -interface HTMLLabelElement extends HTMLElement, MSDataBindingExtensions, MSHTMLLabelElementExtensions { - htmlFor: string; - form: HTMLFormElement; -} -declare var HTMLLabelElement: { - prototype: HTMLLabelElement; - new(): HTMLLabelElement; -} - -interface MSResourceMetadata { - protocol: string; - fileSize: string; - fileUpdatedDate: string; - nameProp: string; - fileCreatedDate: string; - fileModifiedDate: string; - mimeType: string; -} - -interface MSHTMLQuoteElementExtensions { - dateTime: string; -} - -interface DOML2DeprecatedAlignmentStyle_HTMLIFrameElement { - align: string; -} - -interface HTMLLegendElement extends HTMLElement, DOML2DeprecatedAlignmentStyle_HTMLLegendElement, MSDataBindingExtensions, MSHTMLLegendElementExtensions { - form: HTMLFormElement; -} -declare var HTMLLegendElement: { - prototype: HTMLLegendElement; - new(): HTMLLegendElement; -} - -interface HTMLDirectoryElement extends HTMLElement, DOML2DeprecatedListSpaceReduction, MSHTMLDirectoryElementExtensions { -} -declare var HTMLDirectoryElement: { - prototype: HTMLDirectoryElement; - new(): HTMLDirectoryElement; -} - -interface NavigatorAbilities { -} - -interface MSHTMLImageElementExtensions { - href: string; -} - -interface SVGAnimatedInteger { - animVal: number; - baseVal: number; -} -declare var SVGAnimatedInteger: { - prototype: SVGAnimatedInteger; - new(): SVGAnimatedInteger; -} - -interface SVGTextElement extends SVGTextPositioningElement, SVGTransformable { -} -declare var SVGTextElement: { - prototype: SVGTextElement; - new(): SVGTextElement; -} - -interface SVGTSpanElement extends SVGTextPositioningElement { -} -declare var SVGTSpanElement: { - prototype: SVGTSpanElement; - new(): SVGTSpanElement; -} - -interface HTMLLIElement extends HTMLElement, DOML2DeprecatedListNumberingAndBulletStyle, MSHTMLLIElementExtensions { - value: number; -} -declare var HTMLLIElement: { - prototype: HTMLLIElement; - new(): HTMLLIElement; -} - -interface SVGPathSegLinetoVerticalAbs extends SVGPathSeg { - y: number; -} -declare var SVGPathSegLinetoVerticalAbs: { - prototype: SVGPathSegLinetoVerticalAbs; - new(): SVGPathSegLinetoVerticalAbs; -} - -interface ViewCSS { - getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; -} - -interface MSAttrExtensions { - expando: boolean; -} - -interface MSStorageExtensions { - remainingSpace: number; -} - -interface SVGStyleElement extends SVGElement, SVGLangSpace { - media: string; - type: string; - title: string; -} -declare var SVGStyleElement: { - prototype: SVGStyleElement; - new(): SVGStyleElement; -} - -interface MSCurrentStyleCSSProperties extends MSCSSProperties { - blockDirection: string; - clipBottom: string; - clipLeft: string; - clipRight: string; - clipTop: string; - hasLayout: string; -} -declare var MSCurrentStyleCSSProperties: { - prototype: MSCurrentStyleCSSProperties; - new(): MSCurrentStyleCSSProperties; -} - -interface MSLinkStyleExtensions { - styleSheet: StyleSheet; -} - -interface MSHTMLCollectionExtensions { - urns(urn: any): Object; - tags(tagName: any): Object; -} - -interface DOML2DeprecatedWordWrapSuppression_HTMLDivElement { - noWrap: boolean; -} - -interface DocumentTraversal { - createNodeIterator(root: Node, whatToShow: number, filter: NodeFilterCallback, entityReferenceExpansion: boolean): NodeIterator; - createTreeWalker(root: Node, whatToShow: number, filter: NodeFilterCallback, entityReferenceExpansion: boolean): TreeWalker; -} - -interface Storage extends MSStorageExtensions { - length: number; - getItem(key: string): any; - [key: string]: any; - setItem(key: string, data: string): void; - clear(): void; - removeItem(key: string): void; - key(index: number): string; - [index: number]: any; -} -declare var Storage: { - prototype: Storage; - new(): Storage; -} - -interface HTMLTableHeaderCellScope { - scope: string; -} - -interface HTMLIFrameElement extends HTMLElement, GetSVGDocument, MSHTMLIFrameElementExtensions, MSDataBindingExtensions, DOML2DeprecatedAlignmentStyle_HTMLIFrameElement { - width: string; - contentWindow: Window; - scrolling: string; - src: string; - marginHeight: string; - name: string; - marginWidth: string; - height: string; - contentDocument: Document; - longDesc: string; - frameBorder: string; -} -declare var HTMLIFrameElement: { - prototype: HTMLIFrameElement; - new(): HTMLIFrameElement; -} - -interface MSNavigatorAbilities { - userLanguage: string; - plugins: MSPluginsCollection; - cookieEnabled: boolean; - appCodeName: string; - cpuClass: string; - appMinorVersion: string; - connectionSpeed: number; - browserLanguage: string; - mimeTypes: MSMimeTypesCollection; - product: string; - systemLanguage: string; - javaEnabled(): boolean; - taintEnabled(): boolean; -} - -interface TextRangeCollection { - length: number; - item(index: number): TextRange; - [index: number]: TextRange; -} -declare var TextRangeCollection: { - prototype: TextRangeCollection; - new(): TextRangeCollection; -} - -interface HTMLBodyElement extends HTMLElement, HTMLBodyElementDOML2Deprecated, MSHTMLBodyElementExtensions, DOML2DeprecatedBackgroundStyle, DOML2DeprecatedBackgroundColorStyle { - onresize: (ev: UIEvent) => any; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - ononline: (ev: Event) => any; - addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; - onafterprint: (ev: Event) => any; - addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; - onbeforeprint: (ev: Event) => any; - addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; - onoffline: (ev: Event) => any; - addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; - onblur: (ev: FocusEvent) => any; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - onhashchange: (ev: Event) => any; - addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; - onunload: (ev: Event) => any; - addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; - onfocus: (ev: FocusEvent) => any; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - onmessage: (ev: MessageEvent) => any; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - onload: (ev: Event) => any; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - onerror: (ev: Event) => any; - addEventListener(type: "error", listener: (ev: Event) => any, useCapture?: boolean): void; - onbeforeunload: (ev: BeforeUnloadEvent) => any; - addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; - onstorage: (ev: StorageEvent) => any; - addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLBodyElement: { - prototype: HTMLBodyElement; - new(): HTMLBodyElement; -} - -interface DocumentType extends Node { - name: string; - notations: NamedNodeMap; - systemId: string; - internalSubset: string; - entities: NamedNodeMap; - publicId: string; -} -declare var DocumentType: { - prototype: DocumentType; - new(): DocumentType; -} - -interface MSHTMLInputElementExtensions extends DOML2DeprecatedMarginStyle_HTMLInputElement, DOML2DeprecatedBorderStyle_HTMLInputElement { - status: boolean; - complete: boolean; - createTextRange(): TextRange; -} - -interface DOML2DeprecatedAlignmentStyle_HTMLLegendElement { - align: string; -} - -interface SVGRadialGradientElement extends SVGGradientElement { - cx: SVGAnimatedLength; - r: SVGAnimatedLength; - cy: SVGAnimatedLength; - fx: SVGAnimatedLength; - fy: SVGAnimatedLength; -} -declare var SVGRadialGradientElement: { - prototype: SVGRadialGradientElement; - new(): SVGRadialGradientElement; -} - -interface MutationEvent extends Event { - newValue: string; - attrChange: number; - attrName: string; - prevValue: string; - relatedNode: Node; - initMutationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, relatedNodeArg: Node, prevValueArg: string, newValueArg: string, attrNameArg: string, attrChangeArg: number): void; - MODIFICATION: number; - REMOVAL: number; - ADDITION: number; -} -declare var MutationEvent: { - prototype: MutationEvent; - new(): MutationEvent; - MODIFICATION: number; - REMOVAL: number; - ADDITION: number; -} - -interface DragEvent extends MouseEvent { - dataTransfer: DataTransfer; - initDragEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: AbstractView, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, dataTransferArg: DataTransfer): void; -} -declare var DragEvent: { - prototype: DragEvent; - new(): DragEvent; -} - -interface DOML2DeprecatedWidthStyle_HTMLTableCellElement { - width: number; -} - -interface HTMLTableSectionElement extends HTMLElement, MSHTMLTableSectionElementExtensions, DOML2DeprecatedAlignmentStyle_HTMLTableSectionElement, HTMLTableAlignment { - rows: HTMLCollection; - deleteRow(index?: number): void; - insertRow(index?: number): HTMLElement; -} -declare var HTMLTableSectionElement: { - prototype: HTMLTableSectionElement; - new(): HTMLTableSectionElement; -} - -interface DOML2DeprecatedListNumberingAndBulletStyle { - type: string; -} - -interface HTMLInputElement extends HTMLElement, DOML2DeprecatedAlignmentStyle_HTMLInputElement, MSImageResourceExtensions_HTMLInputElement, MSHTMLInputElementExtensions, MSDataBindingExtensions { - width: string; - defaultChecked: boolean; - alt: string; - accept: string; - value: string; - src: string; - useMap: string; - name: string; - form: HTMLFormElement; - selectionStart: number; - height: string; - indeterminate: boolean; - readOnly: boolean; - size: number; - checked: boolean; - maxLength: number; - selectionEnd: number; - type: string; - defaultValue: string; - setSelectionRange(start: number, end: number): void; - select(): void; -} -declare var HTMLInputElement: { - prototype: HTMLInputElement; - new(): HTMLInputElement; -} - -interface HTMLAnchorElement extends HTMLElement, MSHTMLAnchorElementExtensions, MSDataBindingExtensions { - rel: string; - protocol: string; - search: string; - coords: string; - hostname: string; - pathname: string; - target: string; - href: string; - name: string; - charset: string; - hreflang: string; - port: string; - host: string; - hash: string; - rev: string; - type: string; - shape: string; - toString(): string; -} -declare var HTMLAnchorElement: { - prototype: HTMLAnchorElement; - new(): HTMLAnchorElement; -} - -interface SVGImageElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGURIReference { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - preserveAspectRatio: SVGAnimatedPreserveAspectRatio; - x: SVGAnimatedLength; - height: SVGAnimatedLength; -} -declare var SVGImageElement: { - prototype: SVGImageElement; - new(): SVGImageElement; -} - -interface MSElementExtensions { - msMatchesSelector(selectors: string): boolean; - fireEvent(eventName: string, eventObj?: any): boolean; -} - -interface HTMLParamElement extends HTMLElement { - value: string; - name: string; - type: string; - valueType: string; -} -declare var HTMLParamElement: { - prototype: HTMLParamElement; - new(): HTMLParamElement; -} - -interface MSHTMLDocumentViewExtensions { - createStyleSheet(href?: string, index?: number): CSSStyleSheet; -} - -interface SVGAnimatedNumber { - animVal: number; - baseVal: number; -} -declare var SVGAnimatedNumber: { - prototype: SVGAnimatedNumber; - new(): SVGAnimatedNumber; -} - -interface PerformanceTiming { - redirectStart: number; - domainLookupEnd: number; - responseStart: number; - domComplete: number; - domainLookupStart: number; - loadEventStart: number; - msFirstPaint: number; - unloadEventEnd: number; - fetchStart: number; - requestStart: number; - domInteractive: number; - navigationStart: number; - connectEnd: number; - loadEventEnd: number; - connectStart: number; - responseEnd: number; - domLoading: number; - redirectEnd: number; - unloadEventStart: number; - domContentLoadedEventStart: number; - domContentLoadedEventEnd: number; - toJSON(): any; -} -declare var PerformanceTiming: { - prototype: PerformanceTiming; - new(): PerformanceTiming; -} - -interface DOML2DeprecatedAlignmentStyle_HTMLInputElement { - align: string; -} - -interface HTMLPreElement extends HTMLElement, DOML2DeprecatedWidthStyle, MSHTMLPreElementExtensions { -} -declare var HTMLPreElement: { - prototype: HTMLPreElement; - new(): HTMLPreElement; -} - -interface EventException { - code: number; - message: string; - toString(): string; - DISPATCH_REQUEST_ERR: number; - UNSPECIFIED_EVENT_TYPE_ERR: number; -} -declare var EventException: { - prototype: EventException; - new(): EventException; - DISPATCH_REQUEST_ERR: number; - UNSPECIFIED_EVENT_TYPE_ERR: number; -} - -interface MSBorderColorHighlightStyle_HTMLTableCellElement { - borderColorLight: any; - borderColorDark: any; -} - -interface DOMHTMLImplementation { - createHTMLDocument(title: string): Document; -} - -interface NavigatorOnLine { - onLine: boolean; -} - -interface SVGElementEventHandlers { - onmouseover: (ev: MouseEvent) => any; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - onmousemove: (ev: MouseEvent) => any; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - onmouseout: (ev: MouseEvent) => any; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - ondblclick: (ev: MouseEvent) => any; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - onfocusout: (ev: FocusEvent) => any; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - onfocusin: (ev: FocusEvent) => any; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - onmousedown: (ev: MouseEvent) => any; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - onmouseup: (ev: MouseEvent) => any; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - onload: (ev: Event) => any; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - onclick: (ev: MouseEvent) => any; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface WindowLocalStorage { - localStorage: Storage; -} - -interface SVGMetadataElement extends SVGElement { -} -declare var SVGMetadataElement: { - prototype: SVGMetadataElement; - new(): SVGMetadataElement; -} - -interface SVGPathSegArcRel extends SVGPathSeg { - y: number; - sweepFlag: boolean; - r2: number; - x: number; - angle: number; - r1: number; - largeArcFlag: boolean; -} -declare var SVGPathSegArcRel: { - prototype: SVGPathSegArcRel; - new(): SVGPathSegArcRel; -} - -interface SVGPathSegMovetoAbs extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegMovetoAbs: { - prototype: SVGPathSegMovetoAbs; - new(): SVGPathSegMovetoAbs; -} - -interface SVGStringList { - numberOfItems: number; - replaceItem(newItem: string, index: number): string; - getItem(index: number): string; - clear(): void; - appendItem(newItem: string): string; - initialize(newItem: string): string; - removeItem(index: number): string; - insertItemBefore(newItem: string, index: number): string; -} -declare var SVGStringList: { - prototype: SVGStringList; - new(): SVGStringList; -} - -interface XDomainRequest { - timeout: number; - onerror: (ev: Event) => any; - addEventListener(type: "error", listener: (ev: Event) => any, useCapture?: boolean): void; - onload: (ev: Event) => any; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - onprogress: (ev: any) => any; - addEventListener(type: "progress", listener: (ev: any) => any, useCapture?: boolean): void; - ontimeout: (ev: Event) => any; - addEventListener(type: "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; - responseText: string; - contentType: string; - open(method: string, url: string): void; - abort(): void; - send(data?: any): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var XDomainRequest: { - prototype: XDomainRequest; - new (): XDomainRequest; -} - -interface DOML2DeprecatedBackgroundColorStyle { - bgColor: any; -} - -interface ElementTraversal { - childElementCount: number; - previousElementSibling: Element; - lastElementChild: Element; - nextElementSibling: Element; - firstElementChild: Element; -} - -interface SVGLength { - valueAsString: string; - valueInSpecifiedUnits: number; - value: number; - unitType: number; - newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; - convertToSpecifiedUnits(unitType: number): void; - SVG_LENGTHTYPE_NUMBER: number; - SVG_LENGTHTYPE_CM: number; - SVG_LENGTHTYPE_PC: number; - SVG_LENGTHTYPE_PERCENTAGE: number; - SVG_LENGTHTYPE_MM: number; - SVG_LENGTHTYPE_PT: number; - SVG_LENGTHTYPE_IN: number; - SVG_LENGTHTYPE_EMS: number; - SVG_LENGTHTYPE_PX: number; - SVG_LENGTHTYPE_UNKNOWN: number; - SVG_LENGTHTYPE_EXS: number; -} -declare var SVGLength: { - prototype: SVGLength; - new(): SVGLength; - SVG_LENGTHTYPE_NUMBER: number; - SVG_LENGTHTYPE_CM: number; - SVG_LENGTHTYPE_PC: number; - SVG_LENGTHTYPE_PERCENTAGE: number; - SVG_LENGTHTYPE_MM: number; - SVG_LENGTHTYPE_PT: number; - SVG_LENGTHTYPE_IN: number; - SVG_LENGTHTYPE_EMS: number; - SVG_LENGTHTYPE_PX: number; - SVG_LENGTHTYPE_UNKNOWN: number; - SVG_LENGTHTYPE_EXS: number; -} - -interface SVGPolygonElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGAnimatedPoints, SVGTests { -} -declare var SVGPolygonElement: { - prototype: SVGPolygonElement; - new(): SVGPolygonElement; -} - -interface HTMLPhraseElement extends HTMLElement { - dateTime: string; - cite: string; -} -declare var HTMLPhraseElement: { - prototype: HTMLPhraseElement; - new(): HTMLPhraseElement; -} - -interface MSHTMLAreaElementExtensions { -} - -interface SVGPathSegCurvetoCubicRel extends SVGPathSeg { - y: number; - y1: number; - x2: number; - x: number; - x1: number; - y2: number; -} -declare var SVGPathSegCurvetoCubicRel: { - prototype: SVGPathSegCurvetoCubicRel; - new(): SVGPathSegCurvetoCubicRel; -} - -interface MSEventObj extends Event { - nextPage: string; - keyCode: number; - toElement: Element; - returnValue: any; - dataFld: string; - y: number; - dataTransfer: DataTransfer; - propertyName: string; - url: string; - offsetX: number; - recordset: Object; - screenX: number; - buttonID: number; - wheelDelta: number; - reason: number; - origin: string; - data: string; - srcFilter: Object; - boundElements: HTMLCollection; - cancelBubble: boolean; - altLeft: boolean; - behaviorCookie: number; - bookmarks: BookmarkCollection; - type: string; - repeat: boolean; - srcElement: Element; - source: Window; - fromElement: Element; - offsetY: number; - x: number; - behaviorPart: number; - qualifier: string; - altKey: boolean; - ctrlKey: boolean; - clientY: number; - shiftKey: boolean; - shiftLeft: boolean; - contentOverflow: boolean; - screenY: number; - ctrlLeft: boolean; - button: number; - srcUrn: string; - clientX: number; - actionURL: string; - getAttribute(strAttributeName: string, lFlags?: number): any; - setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; - removeAttribute(strAttributeName: string, lFlags?: number): boolean; -} -declare var MSEventObj: { - prototype: MSEventObj; - new(): MSEventObj; -} - -interface SVGTextContentElement extends SVGElement, SVGStylable, SVGLangSpace, SVGTests { - textLength: SVGAnimatedLength; - lengthAdjust: SVGAnimatedEnumeration; - getCharNumAtPosition(point: SVGPoint): number; - getStartPositionOfChar(charnum: number): SVGPoint; - getExtentOfChar(charnum: number): SVGRect; - getComputedTextLength(): number; - getSubStringLength(charnum: number, nchars: number): number; - selectSubString(charnum: number, nchars: number): void; - getNumberOfChars(): number; - getRotationOfChar(charnum: number): number; - getEndPositionOfChar(charnum: number): SVGPoint; - LENGTHADJUST_SPACING: number; - LENGTHADJUST_SPACINGANDGLYPHS: number; - LENGTHADJUST_UNKNOWN: number; -} -declare var SVGTextContentElement: { - prototype: SVGTextContentElement; - new(): SVGTextContentElement; - LENGTHADJUST_SPACING: number; - LENGTHADJUST_SPACINGANDGLYPHS: number; - LENGTHADJUST_UNKNOWN: number; -} - -interface DOML2DeprecatedColorProperty { - color: string; -} - -interface MSHTMLLIElementExtensions { -} - -interface HTMLCanvasElement extends HTMLElement { - width: number; - height: number; - toDataURL(): string; - toDataURL(type: string, ...args: any[]): string; - getContext(contextId: string): any; - getContext(contextId: "2d"): CanvasRenderingContext2D; -} -declare var HTMLCanvasElement: { - prototype: HTMLCanvasElement; - new(): HTMLCanvasElement; -} - -interface HTMLTitleElement extends HTMLElement { - text: string; -} -declare var HTMLTitleElement: { - prototype: HTMLTitleElement; - new(): HTMLTitleElement; -} - -interface Location { - hash: string; - protocol: string; - search: string; - href: string; - hostname: string; - port: string; - pathname: string; - host: string; - reload(flag?: boolean): void; - replace(url: string): void; - assign(url: string): void; - toString(): string; -} -declare var Location: { - prototype: Location; - new(): Location; -} - -interface HTMLStyleElement extends HTMLElement, MSLinkStyleExtensions, LinkStyle { - media: string; - type: string; -} -declare var HTMLStyleElement: { - prototype: HTMLStyleElement; - new(): HTMLStyleElement; -} - -interface MSHTMLOptGroupElementExtensions { - index: number; - defaultSelected: boolean; - text: string; - value: string; - form: HTMLFormElement; - selected: boolean; -} - -interface MSBorderColorHighlightStyle { - borderColorLight: any; - borderColorDark: any; -} - -interface DOML2DeprecatedSizeProperty_HTMLBaseFontElement { - size: number; -} - -interface SVGTransform { - type: number; - angle: number; - matrix: SVGMatrix; - setTranslate(tx: number, ty: number): void; - setScale(sx: number, sy: number): void; - setMatrix(matrix: SVGMatrix): void; - setSkewY(angle: number): void; - setRotate(angle: number, cx: number, cy: number): void; - setSkewX(angle: number): void; - SVG_TRANSFORM_SKEWX: number; - SVG_TRANSFORM_UNKNOWN: number; - SVG_TRANSFORM_SCALE: number; - SVG_TRANSFORM_TRANSLATE: number; - SVG_TRANSFORM_MATRIX: number; - SVG_TRANSFORM_ROTATE: number; - SVG_TRANSFORM_SKEWY: number; -} -declare var SVGTransform: { - prototype: SVGTransform; - new(): SVGTransform; - SVG_TRANSFORM_SKEWX: number; - SVG_TRANSFORM_UNKNOWN: number; - SVG_TRANSFORM_SCALE: number; - SVG_TRANSFORM_TRANSLATE: number; - SVG_TRANSFORM_MATRIX: number; - SVG_TRANSFORM_ROTATE: number; - SVG_TRANSFORM_SKEWY: number; -} - -interface MSCSSFilter { - Percent: number; - Enabled: boolean; - Duration: number; - Play(Duration: number): void; - Apply(): void; - Stop(): void; -} -declare var MSCSSFilter: { - prototype: MSCSSFilter; - new(): MSCSSFilter; -} - -interface UIEvent extends Event { - detail: number; - view: AbstractView; - initUIEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: AbstractView, detailArg: number): void; -} -declare var UIEvent: { - prototype: UIEvent; - new(): UIEvent; -} - -interface ViewCSS_SVGSVGElement { - getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; -} - -interface SVGURIReference { - href: SVGAnimatedString; -} - -interface SVGPathSeg { - pathSegType: number; - pathSegTypeAsLetter: string; - PATHSEG_MOVETO_REL: number; - PATHSEG_LINETO_VERTICAL_REL: number; - PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; - PATHSEG_CURVETO_QUADRATIC_REL: number; - PATHSEG_CURVETO_CUBIC_ABS: number; - PATHSEG_LINETO_HORIZONTAL_ABS: number; - PATHSEG_CURVETO_QUADRATIC_ABS: number; - PATHSEG_LINETO_ABS: number; - PATHSEG_CLOSEPATH: number; - PATHSEG_LINETO_HORIZONTAL_REL: number; - PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; - PATHSEG_LINETO_REL: number; - PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; - PATHSEG_ARC_REL: number; - PATHSEG_CURVETO_CUBIC_REL: number; - PATHSEG_UNKNOWN: number; - PATHSEG_LINETO_VERTICAL_ABS: number; - PATHSEG_ARC_ABS: number; - PATHSEG_MOVETO_ABS: number; - PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; -} -declare var SVGPathSeg: { - PATHSEG_MOVETO_REL: number; - PATHSEG_LINETO_VERTICAL_REL: number; - PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; - PATHSEG_CURVETO_QUADRATIC_REL: number; - PATHSEG_CURVETO_CUBIC_ABS: number; - PATHSEG_LINETO_HORIZONTAL_ABS: number; - PATHSEG_CURVETO_QUADRATIC_ABS: number; - PATHSEG_LINETO_ABS: number; - PATHSEG_CLOSEPATH: number; - PATHSEG_LINETO_HORIZONTAL_REL: number; - PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; - PATHSEG_LINETO_REL: number; - PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; - PATHSEG_ARC_REL: number; - PATHSEG_CURVETO_CUBIC_REL: number; - PATHSEG_UNKNOWN: number; - PATHSEG_LINETO_VERTICAL_ABS: number; - PATHSEG_ARC_ABS: number; - PATHSEG_MOVETO_ABS: number; - PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; -} - -interface WheelEvent extends MouseEvent { - deltaZ: number; - deltaX: number; - deltaMode: number; - deltaY: number; - initWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: AbstractView, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, deltaXArg: number, deltaYArg: number, deltaZArg: number, deltaMode: number): void; - DOM_DELTA_PIXEL: number; - DOM_DELTA_LINE: number; - DOM_DELTA_PAGE: number; -} -declare var WheelEvent: { - prototype: WheelEvent; - new(): WheelEvent; - DOM_DELTA_PIXEL: number; - DOM_DELTA_LINE: number; - DOM_DELTA_PAGE: number; -} - -interface DOML2DeprecatedAlignmentStyle_HTMLDivElement { - align: string; -} - -interface MSEventAttachmentTarget { - attachEvent(event: string, listener: EventListener): boolean; - detachEvent(event: string, listener: EventListener): void; -} - -interface SVGNumber { - value: number; -} -declare var SVGNumber: { - prototype: SVGNumber; - new(): SVGNumber; -} - -interface SVGPathElement extends SVGElement, SVGStylable, SVGAnimatedPathData, SVGTransformable, SVGLangSpace, SVGTests { - getPathSegAtLength(distance: number): number; - getPointAtLength(distance: number): SVGPoint; - createSVGPathSegCurvetoQuadraticAbs(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticAbs; - createSVGPathSegLinetoRel(x: number, y: number): SVGPathSegLinetoRel; - createSVGPathSegCurvetoQuadraticRel(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticRel; - createSVGPathSegCurvetoCubicAbs(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicAbs; - createSVGPathSegLinetoAbs(x: number, y: number): SVGPathSegLinetoAbs; - createSVGPathSegClosePath(): SVGPathSegClosePath; - createSVGPathSegCurvetoCubicRel(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicRel; - createSVGPathSegCurvetoQuadraticSmoothRel(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothRel; - createSVGPathSegMovetoRel(x: number, y: number): SVGPathSegMovetoRel; - createSVGPathSegCurvetoCubicSmoothAbs(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothAbs; - createSVGPathSegMovetoAbs(x: number, y: number): SVGPathSegMovetoAbs; - createSVGPathSegLinetoVerticalRel(y: number): SVGPathSegLinetoVerticalRel; - createSVGPathSegArcRel(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcRel; - createSVGPathSegCurvetoQuadraticSmoothAbs(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothAbs; - createSVGPathSegLinetoHorizontalRel(x: number): SVGPathSegLinetoHorizontalRel; - getTotalLength(): number; - createSVGPathSegCurvetoCubicSmoothRel(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothRel; - createSVGPathSegLinetoHorizontalAbs(x: number): SVGPathSegLinetoHorizontalAbs; - createSVGPathSegLinetoVerticalAbs(y: number): SVGPathSegLinetoVerticalAbs; - createSVGPathSegArcAbs(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcAbs; -} -declare var SVGPathElement: { - prototype: SVGPathElement; - new(): SVGPathElement; -} - -interface MSCompatibleInfo { - version: string; - userAgent: string; -} -declare var MSCompatibleInfo: { - prototype: MSCompatibleInfo; - new(): MSCompatibleInfo; -} - -interface MSHTMLDocumentEventExtensions { - createEventObject(eventObj?: any): MSEventObj; - fireEvent(eventName: string, eventObj?: any): boolean; -} - -interface Text extends CharacterData, MSNodeExtensions { - wholeText: string; - splitText(offset: number): Text; - replaceWholeText(content: string): Text; -} -declare var Text: { - prototype: Text; - new(): Text; -} - -interface SVGAnimatedRect { - animVal: SVGRect; - baseVal: SVGRect; -} -declare var SVGAnimatedRect: { - prototype: SVGAnimatedRect; - new(): SVGAnimatedRect; -} - -interface CSSNamespaceRule extends CSSRule { - namespaceURI: string; - prefix: string; -} -declare var CSSNamespaceRule: { - prototype: CSSNamespaceRule; - new(): CSSNamespaceRule; -} - -interface HTMLUnknownElement extends HTMLElement, MSDataBindingRecordSetReadonlyExtensions, MSHTMLUnknownElementExtensions { -} -declare var HTMLUnknownElement: { - prototype: HTMLUnknownElement; - new(): HTMLUnknownElement; -} - -interface SVGPathSegList { - numberOfItems: number; - replaceItem(newItem: SVGPathSeg, index: number): SVGPathSeg; - getItem(index: number): SVGPathSeg; - clear(): void; - appendItem(newItem: SVGPathSeg): SVGPathSeg; - initialize(newItem: SVGPathSeg): SVGPathSeg; - removeItem(index: number): SVGPathSeg; - insertItemBefore(newItem: SVGPathSeg, index: number): SVGPathSeg; -} -declare var SVGPathSegList: { - prototype: SVGPathSegList; - new(): SVGPathSegList; -} - -interface HTMLAudioElement extends HTMLMediaElement { -} -declare var HTMLAudioElement: { - prototype: HTMLAudioElement; - new(): HTMLAudioElement; -} - -interface MSImageResourceExtensions { - dynsrc: string; - vrml: string; - lowsrc: string; - start: string; - loop: number; -} - -interface MSBorderColorHighlightStyle_HTMLTableRowElement { - borderColorLight: any; - borderColorDark: any; -} - -interface PositionError { - code: number; - message: string; - toString(): string; - POSITION_UNAVAILABLE: number; - PERMISSION_DENIED: number; - TIMEOUT: number; -} -declare var PositionError: { - POSITION_UNAVAILABLE: number; - PERMISSION_DENIED: number; - TIMEOUT: number; -} - -interface BrowserPublic { -} -declare var BrowserPublic: { - prototype: BrowserPublic; - new(): BrowserPublic; -} - -interface HTMLTableCellElement extends HTMLElement, DOML2DeprecatedTableCellHeight, HTMLTableAlignment, MSBorderColorHighlightStyle_HTMLTableCellElement, DOML2DeprecatedWidthStyle_HTMLTableCellElement, DOML2DeprecatedBackgroundStyle, MSBorderColorStyle_HTMLTableCellElement, MSHTMLTableCellElementExtensions, DOML2DeprecatedAlignmentStyle_HTMLTableCellElement, HTMLTableHeaderCellScope, DOML2DeprecatedWordWrapSuppression, DOML2DeprecatedBackgroundColorStyle { - headers: string; - abbr: string; - rowSpan: number; - cellIndex: number; - colSpan: number; - axis: string; -} -declare var HTMLTableCellElement: { - prototype: HTMLTableCellElement; - new(): HTMLTableCellElement; -} - -interface MSNamespaceInfoCollection { - length: number; - add(namespace?: string, urn?: string, implementationUrl?: any): Object; - item(index: any): Object; - [index: string]: Object; - (index: any): Object; -} -declare var MSNamespaceInfoCollection: { - prototype: MSNamespaceInfoCollection; - new(): MSNamespaceInfoCollection; -} - -interface SVGElementInstance extends EventTarget { - previousSibling: SVGElementInstance; - parentNode: SVGElementInstance; - lastChild: SVGElementInstance; - nextSibling: SVGElementInstance; - childNodes: SVGElementInstanceList; - correspondingUseElement: SVGUseElement; - correspondingElement: SVGElement; - firstChild: SVGElementInstance; -} -declare var SVGElementInstance: { - prototype: SVGElementInstance; - new(): SVGElementInstance; -} - -interface MSHTMLUListElementExtensions { -} - -interface SVGCircleElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests { - cx: SVGAnimatedLength; - r: SVGAnimatedLength; - cy: SVGAnimatedLength; -} -declare var SVGCircleElement: { - prototype: SVGCircleElement; - new(): SVGCircleElement; -} - -interface HTMLBaseFontElement extends HTMLElement, DOML2DeprecatedSizeProperty_HTMLBaseFontElement, DOML2DeprecatedColorProperty { - face: string; -} -declare var HTMLBaseFontElement: { - prototype: HTMLBaseFontElement; - new(): HTMLBaseFontElement; -} - -interface CustomEvent extends Event { - detail: Object; - initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: Object): void; -} -declare var CustomEvent: { - prototype: CustomEvent; - new(): CustomEvent; -} - -interface CSSImportRule extends CSSRule { - styleSheet: CSSStyleSheet; - href: string; - media: MediaList; -} -declare var CSSImportRule: { - prototype: CSSImportRule; - new(): CSSImportRule; -} - -interface StyleSheetList { - length: number; - item(index?: number): StyleSheet; - [index: number]: StyleSheet; -} -declare var StyleSheetList: { - prototype: StyleSheetList; - new(): StyleSheetList; -} - -interface HTMLTextAreaElement extends HTMLElement, MSDataBindingExtensions, MSHTMLTextAreaElementExtensions { - value: string; - form: HTMLFormElement; - name: string; - selectionStart: number; - rows: number; - cols: number; - readOnly: boolean; - wrap: string; - selectionEnd: number; - type: string; - defaultValue: string; - setSelectionRange(start: number, end: number): void; - select(): void; -} -declare var HTMLTextAreaElement: { - prototype: HTMLTextAreaElement; - new(): HTMLTextAreaElement; -} - -interface MSHTMLFormElementExtensions { - encoding: string; -} - -interface DOML2DeprecatedMarginStyle { - vspace: number; - hspace: number; -} - -interface Geolocation { - clearWatch(watchId: number): void; - getCurrentPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): void; - watchPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): number; -} -declare var Geolocation: { - prototype: Geolocation; - new(): Geolocation; -} - -interface MSWindowModeless { - dialogTop: any; - dialogLeft: any; - dialogWidth: any; - dialogHeight: any; - menuArguments: any; -} - -interface HTMLMarqueeElement extends HTMLElement, DOML2DeprecatedMarginStyle_HTMLMarqueeElement, MSDataBindingExtensions, MSHTMLMarqueeElementExtensions, DOML2DeprecatedBackgroundColorStyle { - width: string; - onbounce: (ev: Event) => any; - addEventListener(type: "bounce", listener: (ev: Event) => any, useCapture?: boolean): void; - trueSpeed: boolean; - scrollAmount: number; - scrollDelay: number; - behavior: string; - height: string; - loop: number; - direction: string; - onstart: (ev: Event) => any; - addEventListener(type: "start", listener: (ev: Event) => any, useCapture?: boolean): void; - onfinish: (ev: Event) => any; - addEventListener(type: "finish", listener: (ev: Event) => any, useCapture?: boolean): void; - stop(): void; - start(): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLMarqueeElement: { - prototype: HTMLMarqueeElement; - new(): HTMLMarqueeElement; -} - -interface SVGRect { - y: number; - width: number; - x: number; - height: number; -} -declare var SVGRect: { - prototype: SVGRect; - new(): SVGRect; -} - -interface MSNodeExtensions { - swapNode(otherNode: Node): Node; - removeNode(deep?: boolean): Node; - replaceNode(replacement: Node): Node; -} - -interface KeyboardEventExtensions { - keyCode: number; - which: number; - charCode: number; -} - -interface History { - length: number; - back(distance?: any): void; - forward(distance?: any): void; - go(delta?: any): void; -} -declare var History: { - prototype: History; - new(): History; -} - -interface DocumentStyle { - styleSheets: StyleSheetList; -} - -interface SVGPathSegCurvetoCubicAbs extends SVGPathSeg { - y: number; - y1: number; - x2: number; - x: number; - x1: number; - y2: number; -} -declare var SVGPathSegCurvetoCubicAbs: { - prototype: SVGPathSegCurvetoCubicAbs; - new(): SVGPathSegCurvetoCubicAbs; -} - -interface TimeRanges { - length: number; - start(index: number): number; - end(index: number): number; -} -declare var TimeRanges: { - prototype: TimeRanges; - new(): TimeRanges; -} - -interface SVGPathSegCurvetoQuadraticAbs extends SVGPathSeg { - y: number; - y1: number; - x: number; - x1: number; -} -declare var SVGPathSegCurvetoQuadraticAbs: { - prototype: SVGPathSegCurvetoQuadraticAbs; - new(): SVGPathSegCurvetoQuadraticAbs; -} - -interface MSHTMLSelectElementExtensions { -} - -interface CSSRule { - cssText: string; - parentStyleSheet: CSSStyleSheet; - parentRule: CSSRule; - type: number; - IMPORT_RULE: number; - MEDIA_RULE: number; - STYLE_RULE: number; - NAMESPACE_RULE: number; - PAGE_RULE: number; - UNKNOWN_RULE: number; - FONT_FACE_RULE: number; - CHARSET_RULE: number; -} -declare var CSSRule: { - prototype: CSSRule; - new(): CSSRule; - IMPORT_RULE: number; - MEDIA_RULE: number; - STYLE_RULE: number; - NAMESPACE_RULE: number; - PAGE_RULE: number; - UNKNOWN_RULE: number; - FONT_FACE_RULE: number; - CHARSET_RULE: number; -} - -interface SVGPathSegLinetoAbs extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegLinetoAbs: { - prototype: SVGPathSegLinetoAbs; - new(): SVGPathSegLinetoAbs; -} - -interface MSMouseEventExtensions { - toElement: Element; - layerY: number; - fromElement: Element; - which: number; - layerX: number; -} - -interface HTMLModElement extends HTMLElement, MSHTMLModElementExtensions { - dateTime: string; - cite: string; -} -declare var HTMLModElement: { - prototype: HTMLModElement; - new(): HTMLModElement; -} - -interface DOML2DeprecatedWordWrapSuppression { - noWrap: boolean; -} - -interface BeforeUnloadEvent extends Event { - returnValue: string; -} -declare var BeforeUnloadEvent: { - prototype: BeforeUnloadEvent; - new(): BeforeUnloadEvent; -} - -interface MSPopupWindow { - document: HTMLDocument; - isOpen: boolean; - show(x: number, y: number, w: number, h: number, element?: any): void; - hide(): void; -} -declare var MSPopupWindow: { - prototype: MSPopupWindow; - new(): MSPopupWindow; -} - -interface SVGMatrix { - e: number; - c: number; - a: number; - b: number; - d: number; - f: number; - multiply(secondMatrix: SVGMatrix): SVGMatrix; - flipY(): SVGMatrix; - skewY(angle: number): SVGMatrix; - inverse(): SVGMatrix; - scaleNonUniform(scaleFactorX: number, scaleFactorY: number): SVGMatrix; - rotate(angle: number): SVGMatrix; - flipX(): SVGMatrix; - translate(x: number, y: number): SVGMatrix; - scale(scaleFactor: number): SVGMatrix; - rotateFromVector(x: number, y: number): SVGMatrix; - skewX(angle: number): SVGMatrix; -} -declare var SVGMatrix: { - prototype: SVGMatrix; - new(): SVGMatrix; -} - -interface SVGUseElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGURIReference { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - animatedInstanceRoot: SVGElementInstance; - instanceRoot: SVGElementInstance; - x: SVGAnimatedLength; - height: SVGAnimatedLength; -} -declare var SVGUseElement: { - prototype: SVGUseElement; - new(): SVGUseElement; -} - -interface Event extends MSEventExtensions { - timeStamp: number; - defaultPrevented: boolean; - isTrusted: boolean; - currentTarget: EventTarget; - target: EventTarget; - eventPhase: number; - type: string; - cancelable: boolean; - bubbles: boolean; - initEvent(eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean): void; - stopPropagation(): void; - stopImmediatePropagation(): void; - preventDefault(): void; - CAPTURING_PHASE: number; - AT_TARGET: number; - BUBBLING_PHASE: number; -} -declare var Event: { - prototype: Event; - new(): Event; - CAPTURING_PHASE: number; - AT_TARGET: number; - BUBBLING_PHASE: number; -} - -interface ImageData { - width: number; - data: number[]; - height: number; -} -declare var ImageData: { - prototype: ImageData; - new(): ImageData; -} - -interface MSHTMLElementExtensions { - onlosecapture: (ev: MSEventObj) => any; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - onrowexit: (ev: MSEventObj) => any; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - oncontrolselect: (ev: MSEventObj) => any; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - onrowsinserted: (ev: MSEventObj) => any; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - onmouseleave: (ev: MouseEvent) => any; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - document: HTMLDocument; - behaviorUrns: MSBehaviorUrnsCollection; - onpropertychange: (ev: MSEventObj) => any; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - children: HTMLCollection; - filters: Object; - onbeforecut: (ev: DragEvent) => any; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - scopeName: string; - onbeforepaste: (ev: DragEvent) => any; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - onmove: (ev: MSEventObj) => any; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - onafterupdate: (ev: MSEventObj) => any; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - onbeforecopy: (ev: DragEvent) => any; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - onlayoutcomplete: (ev: MSEventObj) => any; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - onresizeend: (ev: MSEventObj) => any; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - uniqueID: string; - onhelp: (ev: Event) => any; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - onbeforeactivate: (ev: UIEvent) => any; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - isMultiLine: boolean; - uniqueNumber: number; - tagUrn: string; - onfocusout: (ev: FocusEvent) => any; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - ondataavailable: (ev: MSEventObj) => any; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - hideFocus: boolean; - onbeforeupdate: (ev: MSEventObj) => any; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - onfilterchange: (ev: MSEventObj) => any; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - onfocusin: (ev: FocusEvent) => any; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - recordNumber: any; - parentTextEdit: Element; - ondatasetcomplete: (ev: MSEventObj) => any; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - onbeforedeactivate: (ev: UIEvent) => any; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - outerText: string; - onresizestart: (ev: MSEventObj) => any; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - onactivate: (ev: UIEvent) => any; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - isTextEdit: boolean; - isDisabled: boolean; - readyState: string; - all: HTMLCollection; - onmouseenter: (ev: MouseEvent) => any; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - onmovestart: (ev: MSEventObj) => any; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - onselectstart: (ev: Event) => any; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - onpaste: (ev: DragEvent) => any; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - canHaveHTML: boolean; - innerText: string; - onerrorupdate: (ev: MSEventObj) => any; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - ondeactivate: (ev: UIEvent) => any; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - oncut: (ev: DragEvent) => any; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - onmoveend: (ev: MSEventObj) => any; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - onresize: (ev: UIEvent) => any; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - language: string; - ondatasetchanged: (ev: MSEventObj) => any; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - oncopy: (ev: DragEvent) => any; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - onrowsdelete: (ev: MSEventObj) => any; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - parentElement: HTMLElement; - onrowenter: (ev: MSEventObj) => any; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - onbeforeeditfocus: (ev: MSEventObj) => any; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - canHaveChildren: boolean; - sourceIndex: number; - oncellchange: (ev: MSEventObj) => any; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - dragDrop(): boolean; - releaseCapture(): void; - addFilter(filter: Object): void; - setCapture(containerCapture?: boolean): void; - removeBehavior(cookie: number): boolean; - contains(child: HTMLElement): boolean; - applyElement(apply: Element, where?: string): Element; - replaceAdjacentText(where: string, newText: string): string; - mergeAttributes(source: HTMLElement, preserveIdentity?: boolean): void; - insertAdjacentElement(position: string, insertedElement: Element): Element; - insertAdjacentText(where: string, text: string): void; - getAdjacentText(where: string): string; - removeFilter(filter: Object): void; - setActive(): void; - addBehavior(bstrUrl: string, factory?: any): number; - clearAttributes(): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface HTMLTableColElement extends HTMLElement, MSHTMLTableColElementExtensions, HTMLTableAlignment, DOML2DeprecatedAlignmentStyle_HTMLTableColElement { - width: any; - span: number; -} -declare var HTMLTableColElement: { - prototype: HTMLTableColElement; - new(): HTMLTableColElement; -} - -interface HTMLDocument extends MSEventAttachmentTarget, MSHTMLDocumentSelection, MSHTMLDocumentExtensions, MSNodeExtensions, MSResourceMetadata, MSHTMLDocumentEventExtensions, MSHTMLDocumentViewExtensions { - ondragend: (ev: DragEvent) => any; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - ondragover: (ev: DragEvent) => any; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - onkeydown: (ev: KeyboardEvent) => any; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - bgColor: string; - onkeyup: (ev: KeyboardEvent) => any; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - onreset: (ev: Event) => any; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - onmouseup: (ev: MouseEvent) => any; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - ondragstart: (ev: DragEvent) => any; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - scripts: HTMLCollection; - ondrag: (ev: DragEvent) => any; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - linkColor: string; - ondragleave: (ev: DragEvent) => any; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - onmouseover: (ev: MouseEvent) => any; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - onpause: (ev: Event) => any; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - charset: string; - vlinkColor: string; - onmousedown: (ev: MouseEvent) => any; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - onseeked: (ev: Event) => any; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - title: string; - onclick: (ev: MouseEvent) => any; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - onwaiting: (ev: Event) => any; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - defaultCharset: string; - embeds: HTMLCollection; - ondurationchange: (ev: Event) => any; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - all: HTMLCollection; - applets: HTMLCollection; - forms: HTMLCollection; - onblur: (ev: FocusEvent) => any; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - dir: string; - body: HTMLElement; - designMode: string; - onemptied: (ev: Event) => any; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - domain: string; - onseeking: (ev: Event) => any; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - oncanplay: (ev: Event) => any; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - onstalled: (ev: Event) => any; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - onmousemove: (ev: MouseEvent) => any; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - onratechange: (ev: Event) => any; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - onloadstart: (ev: Event) => any; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - ondragenter: (ev: DragEvent) => any; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - onsubmit: (ev: Event) => any; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - onprogress: (ev: any) => any; - addEventListener(type: "progress", listener: (ev: any) => any, useCapture?: boolean): void; - ondblclick: (ev: MouseEvent) => any; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - oncontextmenu: (ev: MouseEvent) => any; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - activeElement: Element; - onchange: (ev: Event) => any; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - onloadedmetadata: (ev: Event) => any; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - onerror: (ev: Event) => any; - addEventListener(type: "error", listener: (ev: Event) => any, useCapture?: boolean): void; - onplay: (ev: Event) => any; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - links: HTMLCollection; - onplaying: (ev: Event) => any; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - URL: string; - images: HTMLCollection; - head: HTMLHeadElement; - location: Location; - cookie: string; - oncanplaythrough: (ev: Event) => any; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - onabort: (ev: UIEvent) => any; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - characterSet: string; - anchors: HTMLCollection; - lastModified: string; - onreadystatechange: (ev: Event) => any; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - onkeypress: (ev: KeyboardEvent) => any; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - onloadeddata: (ev: Event) => any; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - plugins: HTMLCollection; - onsuspend: (ev: Event) => any; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - referrer: string; - readyState: string; - alinkColor: string; - onfocus: (ev: FocusEvent) => any; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - fgColor: string; - ontimeupdate: (ev: Event) => any; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - onselect: (ev: UIEvent) => any; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - ondrop: (ev: DragEvent) => any; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - onmouseout: (ev: MouseEvent) => any; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - onended: (ev: Event) => any; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - compatMode: string; - onscroll: (ev: UIEvent) => any; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - onmousewheel: (ev: MouseWheelEvent) => any; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - onload: (ev: Event) => any; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - onvolumechange: (ev: Event) => any; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - oninput: (ev: Event) => any; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - queryCommandValue(commandId: string): string; - queryCommandIndeterm(commandId: string): boolean; - execCommand(commandId: string, showUI?: boolean, value?: any): boolean; - getElementsByName(elementName: string): NodeList; - writeln(...content: string[]): void; - open(url?: string, name?: string, features?: string, replace?: boolean): any; - queryCommandState(commandId: string): boolean; - close(): void; - hasFocus(): boolean; - getElementsByClassName(classNames: string): NodeList; - queryCommandSupported(commandId: string): boolean; - getSelection(): Selection; - queryCommandEnabled(commandId: string): boolean; - write(...content: string[]): void; - queryCommandText(commandId: string): string; - addEventListener(type: "DOMContentLoaded", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface SVGException { - code: number; - message: string; - toString(): string; - SVG_MATRIX_NOT_INVERTABLE: number; - SVG_WRONG_TYPE_ERR: number; - SVG_INVALID_VALUE_ERR: number; -} -declare var SVGException: { - prototype: SVGException; - new(): SVGException; - SVG_MATRIX_NOT_INVERTABLE: number; - SVG_WRONG_TYPE_ERR: number; - SVG_INVALID_VALUE_ERR: number; -} - -interface DOML2DeprecatedTableCellHeight { - height: any; -} - -interface HTMLTableAlignment { - ch: string; - vAlign: string; - chOff: string; -} - -interface SVGAnimatedEnumeration { - animVal: number; - baseVal: number; -} -declare var SVGAnimatedEnumeration: { - prototype: SVGAnimatedEnumeration; - new(): SVGAnimatedEnumeration; -} - -interface SVGLinearGradientElement extends SVGGradientElement { - y1: SVGAnimatedLength; - x2: SVGAnimatedLength; - x1: SVGAnimatedLength; - y2: SVGAnimatedLength; -} -declare var SVGLinearGradientElement: { - prototype: SVGLinearGradientElement; - new(): SVGLinearGradientElement; -} - -interface DOML2DeprecatedSizeProperty { - size: number; -} - -interface MSHTMLHeadingElementExtensions extends DOML2DeprecatedTextFlowControl_HTMLBlockElement { -} - -interface MSBorderColorStyle_HTMLTableCellElement { - borderColor: any; -} - -interface DOML2DeprecatedWidthStyle_HTMLHRElement { - width: number; -} - -interface HTMLUListElement extends HTMLElement, DOML2DeprecatedListSpaceReduction, DOML2DeprecatedListNumberingAndBulletStyle, MSHTMLUListElementExtensions { -} -declare var HTMLUListElement: { - prototype: HTMLUListElement; - new(): HTMLUListElement; -} - -interface SVGRectElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - ry: SVGAnimatedLength; - rx: SVGAnimatedLength; - x: SVGAnimatedLength; - height: SVGAnimatedLength; -} -declare var SVGRectElement: { - prototype: SVGRectElement; - new(): SVGRectElement; -} - -interface DOML2DeprecatedBorderStyle { - border: string; -} - -interface HTMLDivElement extends HTMLElement, DOML2DeprecatedAlignmentStyle_HTMLDivElement, MSHTMLDivElementExtensions, MSDataBindingExtensions { -} -declare var HTMLDivElement: { - prototype: HTMLDivElement; - new(): HTMLDivElement; -} - -interface NavigatorDoNotTrack { - msDoNotTrack: string; -} - -interface SVG1_1Properties { - fillRule: string; - strokeLinecap: string; - stopColor: string; - glyphOrientationHorizontal: string; - kerning: string; - alignmentBaseline: string; - dominantBaseline: string; - fill: string; - strokeMiterlimit: string; - marker: string; - glyphOrientationVertical: string; - markerMid: string; - textAnchor: string; - fillOpacity: string; - strokeDasharray: string; - mask: string; - stopOpacity: string; - stroke: string; - strokeDashoffset: string; - strokeOpacity: string; - markerStart: string; - pointerEvents: string; - baselineShift: string; - markerEnd: string; - clipRule: string; - strokeLinejoin: string; - clipPath: string; - strokeWidth: string; -} - -interface NamedNodeMap { - length: number; - removeNamedItemNS(namespaceURI: string, localName: string): Node; - item(index: number): Node; - [index: number]: Node; - removeNamedItem(name: string): Node; - getNamedItem(name: string): Node; - setNamedItem(arg: Node): Node; - getNamedItemNS(namespaceURI: string, localName: string): Node; - setNamedItemNS(arg: Node): Node; -} -declare var NamedNodeMap: { - prototype: NamedNodeMap; - new(): NamedNodeMap; -} - -interface MediaList { - length: number; - mediaText: string; - deleteMedium(oldMedium: string): void; - appendMedium(newMedium: string): void; - item(index: number): string; - [index: number]: string; - toString(): string; -} -declare var MediaList: { - prototype: MediaList; - new(): MediaList; -} - -interface SVGPathSegCurvetoQuadraticSmoothAbs extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegCurvetoQuadraticSmoothAbs: { - prototype: SVGPathSegCurvetoQuadraticSmoothAbs; - new(): SVGPathSegCurvetoQuadraticSmoothAbs; -} - -interface SVGLengthList { - numberOfItems: number; - replaceItem(newItem: SVGLength, index: number): SVGLength; - getItem(index: number): SVGLength; - clear(): void; - appendItem(newItem: SVGLength): SVGLength; - initialize(newItem: SVGLength): SVGLength; - removeItem(index: number): SVGLength; - insertItemBefore(newItem: SVGLength, index: number): SVGLength; -} -declare var SVGLengthList: { - prototype: SVGLengthList; - new(): SVGLengthList; -} - -interface SVGPathSegCurvetoCubicSmoothRel extends SVGPathSeg { - y: number; - x2: number; - x: number; - y2: number; -} -declare var SVGPathSegCurvetoCubicSmoothRel: { - prototype: SVGPathSegCurvetoCubicSmoothRel; - new(): SVGPathSegCurvetoCubicSmoothRel; -} - -interface MSWindowExtensions { - status: string; - onmouseleave: (ev: MouseEvent) => any; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - screenLeft: number; - offscreenBuffering: any; - maxConnectionsPerServer: number; - onmouseenter: (ev: MouseEvent) => any; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - clipboardData: DataTransfer; - defaultStatus: string; - clientInformation: Navigator; - closed: boolean; - onhelp: (ev: Event) => any; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - external: BrowserPublic; - event: MSEventObj; - onfocusout: (ev: FocusEvent) => any; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - screenTop: number; - onfocusin: (ev: FocusEvent) => any; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - showModelessDialog(url?: string, argument?: any, options?: any): Window; - navigate(url: string): void; - resizeBy(x?: number, y?: number): void; - item(index: any): any; - resizeTo(x?: number, y?: number): void; - createPopup(arguments?: any): MSPopupWindow; - toStaticHTML(html: string): string; - execScript(code: string, language?: string): any; - msWriteProfilerMark(profilerMarkName: string): void; - moveTo(x?: number, y?: number): void; - moveBy(x?: number, y?: number): void; - showHelp(url: string, helpArg?: any, features?: string): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface ProcessingInstruction extends Node { - target: string; - data: string; -} -declare var ProcessingInstruction: { - prototype: ProcessingInstruction; - new(): ProcessingInstruction; -} - -interface MSBehaviorUrnsCollection { - length: number; - item(index: number): string; -} -declare var MSBehaviorUrnsCollection: { - prototype: MSBehaviorUrnsCollection; - new(): MSBehaviorUrnsCollection; -} - -interface CSSFontFaceRule extends CSSRule { - style: CSSStyleDeclaration; -} -declare var CSSFontFaceRule: { - prototype: CSSFontFaceRule; - new(): CSSFontFaceRule; -} - -interface DOML2DeprecatedBackgroundStyle { - background: string; -} - -interface TextEvent extends UIEvent { - inputMethod: number; - data: string; - locale: string; - initTextEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: AbstractView, dataArg: string, inputMethod: number, locale: string): void; - DOM_INPUT_METHOD_KEYBOARD: number; - DOM_INPUT_METHOD_DROP: number; - DOM_INPUT_METHOD_IME: number; - DOM_INPUT_METHOD_SCRIPT: number; - DOM_INPUT_METHOD_VOICE: number; - DOM_INPUT_METHOD_UNKNOWN: number; - DOM_INPUT_METHOD_PASTE: number; - DOM_INPUT_METHOD_HANDWRITING: number; - DOM_INPUT_METHOD_OPTION: number; - DOM_INPUT_METHOD_MULTIMODAL: number; -} -declare var TextEvent: { - prototype: TextEvent; - new(): TextEvent; - DOM_INPUT_METHOD_KEYBOARD: number; - DOM_INPUT_METHOD_DROP: number; - DOM_INPUT_METHOD_IME: number; - DOM_INPUT_METHOD_SCRIPT: number; - DOM_INPUT_METHOD_VOICE: number; - DOM_INPUT_METHOD_UNKNOWN: number; - DOM_INPUT_METHOD_PASTE: number; - DOM_INPUT_METHOD_HANDWRITING: number; - DOM_INPUT_METHOD_OPTION: number; - DOM_INPUT_METHOD_MULTIMODAL: number; -} - -interface MSHTMLHRElementExtensions extends DOML2DeprecatedColorProperty { -} - -interface AbstractView { - styleMedia: StyleMedia; - document: Document; -} - -interface DocumentFragment extends Node, NodeSelector, MSEventAttachmentTarget, MSNodeExtensions { -} -declare var DocumentFragment: { - prototype: DocumentFragment; - new(): DocumentFragment; -} - -interface DOML2DeprecatedAlignmentStyle_HTMLFieldSetElement { - align: string; -} - -interface SVGPolylineElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGAnimatedPoints, SVGTests { -} -declare var SVGPolylineElement: { - prototype: SVGPolylineElement; - new(): SVGPolylineElement; -} - -interface DOML2DeprecatedWidthStyle { - width: number; -} - -interface DOML2DeprecatedAlignmentStyle_HTMLHeadingElement { - align: string; -} - -interface SVGAnimatedPathData { - pathSegList: SVGPathSegList; -} - -interface Position { - timestamp: number; - coords: Coordinates; -} -declare var Position: { - prototype: Position; - new(): Position; -} - -interface BookmarkCollection { - length: number; - item(index: number): any; - [index: number]: any; -} -declare var BookmarkCollection: { - prototype: BookmarkCollection; - new(): BookmarkCollection; -} - -interface CSSPageRule extends CSSRule, StyleSheetPage { - selectorText: string; - style: CSSStyleDeclaration; -} -declare var CSSPageRule: { - prototype: CSSPageRule; - new(): CSSPageRule; -} - -interface WindowPerformance { - performance: any; -} - -interface HTMLBRElement extends HTMLElement, DOML2DeprecatedTextFlowControl_HTMLBRElement { -} -declare var HTMLBRElement: { - prototype: HTMLBRElement; - new(): HTMLBRElement; -} - -interface MSHTMLDivElementExtensions extends DOML2DeprecatedWordWrapSuppression_HTMLDivElement { -} - -interface DOML2DeprecatedBorderStyle_HTMLInputElement { - border: string; -} - -interface HTMLSpanElement extends HTMLElement, MSHTMLSpanElementExtensions, MSDataBindingExtensions { -} -declare var HTMLSpanElement: { - prototype: HTMLSpanElement; - new(): HTMLSpanElement; -} - -interface HTMLHRElementDOML2Deprecated { - noShade: boolean; -} - -interface HTMLHeadElement extends HTMLElement { - profile: string; -} -declare var HTMLHeadElement: { - prototype: HTMLHeadElement; - new(): HTMLHeadElement; -} - -interface NodeFilterCallback { - (...args: any[]): any; -} - -interface HTMLHeadingElement extends HTMLElement, DOML2DeprecatedAlignmentStyle_HTMLHeadingElement, MSHTMLHeadingElementExtensions { -} -declare var HTMLHeadingElement: { - prototype: HTMLHeadingElement; - new(): HTMLHeadingElement; -} - -interface HTMLFormElement extends HTMLElement, MSHTMLFormElementExtensions, MSHTMLCollectionExtensions { - length: number; - target: string; - acceptCharset: string; - enctype: string; - elements: HTMLCollection; - action: string; - name: string; - method: string; - reset(): void; - item(name?: any, index?: any): any; - (name: any, index: any): any; - submit(): void; - namedItem(name: string): any; - [name: string]: any; - (name: string): any; -} -declare var HTMLFormElement: { - prototype: HTMLFormElement; - new(): HTMLFormElement; -} - -interface SVGZoomAndPan { - zoomAndPan: number; - SVG_ZOOMANDPAN_MAGNIFY: number; - SVG_ZOOMANDPAN_UNKNOWN: number; - SVG_ZOOMANDPAN_DISABLE: number; -} -declare var SVGZoomAndPan: { - prototype: SVGZoomAndPan; - new(): SVGZoomAndPan; - SVG_ZOOMANDPAN_MAGNIFY: number; - SVG_ZOOMANDPAN_UNKNOWN: number; - SVG_ZOOMANDPAN_DISABLE: number; -} - -interface MSEventExtensions { - cancelBubble: boolean; - srcElement: Element; -} - -interface HTMLMediaElement extends HTMLElement { - initialTime: number; - played: TimeRanges; - currentSrc: string; - readyState: string; - autobuffer: boolean; - loop: boolean; - ended: boolean; - buffered: TimeRanges; - error: MediaError; - seekable: TimeRanges; - autoplay: boolean; - controls: boolean; - volume: number; - src: string; - playbackRate: number; - duration: number; - muted: boolean; - defaultPlaybackRate: number; - paused: boolean; - seeking: boolean; - currentTime: number; - preload: string; - networkState: number; - pause(): void; - play(): void; - load(): void; - canPlayType(type: string): string; - HAVE_METADATA: number; - HAVE_CURRENT_DATA: number; - HAVE_NOTHING: number; - NETWORK_NO_SOURCE: number; - HAVE_ENOUGH_DATA: number; - NETWORK_EMPTY: number; - NETWORK_LOADING: number; - NETWORK_IDLE: number; - HAVE_FUTURE_DATA: number; -} -declare var HTMLMediaElement: { - prototype: HTMLMediaElement; - new(): HTMLMediaElement; - HAVE_METADATA: number; - HAVE_CURRENT_DATA: number; - HAVE_NOTHING: number; - NETWORK_NO_SOURCE: number; - HAVE_ENOUGH_DATA: number; - NETWORK_EMPTY: number; - NETWORK_LOADING: number; - NETWORK_IDLE: number; - HAVE_FUTURE_DATA: number; -} - -interface ElementCSSInlineStyle extends MSElementCSSInlineStyleExtensions { - runtimeStyle: MSStyleCSSProperties; - currentStyle: MSCurrentStyleCSSProperties; -} - -interface DOMParser { - parseFromString(source: string, mimeType: string): Document; -} -declare var DOMParser: { - prototype: DOMParser; - new (): DOMParser; -} - -interface MSMimeTypesCollection { - length: number; -} -declare var MSMimeTypesCollection: { - prototype: MSMimeTypesCollection; - new(): MSMimeTypesCollection; -} - -interface StyleSheet { - disabled: boolean; - ownerNode: Node; - parentStyleSheet: StyleSheet; - href: string; - media: MediaList; - type: string; - title: string; -} -declare var StyleSheet: { - prototype: StyleSheet; - new(): StyleSheet; -} - -interface DOML2DeprecatedBorderStyle_HTMLTableElement { - border: string; -} - -interface DOML2DeprecatedWidthStyle_HTMLAppletElement { - width: number; -} - -interface SVGTextPathElement extends SVGTextContentElement, SVGURIReference { - startOffset: SVGAnimatedLength; - method: SVGAnimatedEnumeration; - spacing: SVGAnimatedEnumeration; - TEXTPATH_SPACINGTYPE_EXACT: number; - TEXTPATH_METHODTYPE_STRETCH: number; - TEXTPATH_SPACINGTYPE_AUTO: number; - TEXTPATH_SPACINGTYPE_UNKNOWN: number; - TEXTPATH_METHODTYPE_UNKNOWN: number; - TEXTPATH_METHODTYPE_ALIGN: number; -} -declare var SVGTextPathElement: { - prototype: SVGTextPathElement; - new(): SVGTextPathElement; - TEXTPATH_SPACINGTYPE_EXACT: number; - TEXTPATH_METHODTYPE_STRETCH: number; - TEXTPATH_SPACINGTYPE_AUTO: number; - TEXTPATH_SPACINGTYPE_UNKNOWN: number; - TEXTPATH_METHODTYPE_UNKNOWN: number; - TEXTPATH_METHODTYPE_ALIGN: number; -} - -interface NodeList { - length: number; - item(index: number): Node; - [index: number]: Node; -} -declare var NodeList: { - prototype: NodeList; - new(): NodeList; -} - -interface NodeListOf { - length: number; - item(index: number): TNode; - [index: number]: TNode; -} - -interface HTMLDTElement extends HTMLElement, DOML2DeprecatedWordWrapSuppression_HTMLDTElement { -} -declare var HTMLDTElement: { - prototype: HTMLDTElement; - new(): HTMLDTElement; -} - -interface XMLSerializer { - serializeToString(target: Node): string; -} -declare var XMLSerializer: { - prototype: XMLSerializer; - new (): XMLSerializer; -} - -interface StyleSheetPage { - pseudoClass: string; - selector: string; -} - -interface DOML2DeprecatedWordWrapSuppression_HTMLDDElement { - noWrap: boolean; -} - -interface MSHTMLTableRowElementExtensions { - height: any; -} - -interface SVGGradientElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGURIReference { - spreadMethod: SVGAnimatedEnumeration; - gradientTransform: SVGAnimatedTransformList; - gradientUnits: SVGAnimatedEnumeration; - SVG_SPREADMETHOD_REFLECT: number; - SVG_SPREADMETHOD_PAD: number; - SVG_SPREADMETHOD_UNKNOWN: number; - SVG_SPREADMETHOD_REPEAT: number; -} -declare var SVGGradientElement: { - prototype: SVGGradientElement; - new(): SVGGradientElement; - SVG_SPREADMETHOD_REFLECT: number; - SVG_SPREADMETHOD_PAD: number; - SVG_SPREADMETHOD_UNKNOWN: number; - SVG_SPREADMETHOD_REPEAT: number; -} - -interface DOML2DeprecatedTextFlowControl_HTMLBRElement { - clear: string; -} - -interface MSHTMLParagraphElementExtensions extends DOML2DeprecatedTextFlowControl_HTMLBlockElement { -} - -interface NodeFilter { - acceptNode(n: Node): number; - SHOW_ENTITY_REFERENCE: number; - SHOW_NOTATION: number; - SHOW_ENTITY: number; - SHOW_DOCUMENT: number; - SHOW_PROCESSING_INSTRUCTION: number; - FILTER_REJECT: number; - SHOW_CDATA_SECTION: number; - FILTER_ACCEPT: number; - SHOW_ALL: number; - SHOW_DOCUMENT_TYPE: number; - SHOW_TEXT: number; - SHOW_ELEMENT: number; - SHOW_COMMENT: number; - FILTER_SKIP: number; - SHOW_ATTRIBUTE: number; - SHOW_DOCUMENT_FRAGMENT: number; -} -declare var NodeFilter: { - prototype: NodeFilter; - new(): NodeFilter; - SHOW_ENTITY_REFERENCE: number; - SHOW_NOTATION: number; - SHOW_ENTITY: number; - SHOW_DOCUMENT: number; - SHOW_PROCESSING_INSTRUCTION: number; - FILTER_REJECT: number; - SHOW_CDATA_SECTION: number; - FILTER_ACCEPT: number; - SHOW_ALL: number; - SHOW_DOCUMENT_TYPE: number; - SHOW_TEXT: number; - SHOW_ELEMENT: number; - SHOW_COMMENT: number; - FILTER_SKIP: number; - SHOW_ATTRIBUTE: number; - SHOW_DOCUMENT_FRAGMENT: number; -} - -interface MSBorderColorStyle_HTMLFrameElement { - borderColor: any; -} - -interface MSHTMLOListElementExtensions { -} - -interface DOML2DeprecatedWordWrapSuppression_HTMLDTElement { - noWrap: boolean; -} - -interface ScreenView extends AbstractView { - outerWidth: number; - pageXOffset: number; - innerWidth: number; - pageYOffset: number; - screenY: number; - outerHeight: number; - screen: Screen; - innerHeight: number; - screenX: number; - scroll(x?: number, y?: number): void; - scrollBy(x?: number, y?: number): void; - scrollTo(x?: number, y?: number): void; -} - -interface DOML2DeprecatedMarginStyle_HTMLObjectElement { - vspace: number; - hspace: number; -} - -interface DOML2DeprecatedMarginStyle_HTMLInputElement { - vspace: number; - hspace: number; -} - -interface MSHTMLTableSectionElementExtensions extends DOML2DeprecatedBackgroundColorStyle { - moveRow(indexFrom?: number, indexTo?: number): Object; -} - -interface HTMLFieldSetElement extends HTMLElement, MSHTMLFieldSetElementExtensions { - form: HTMLFormElement; -} -declare var HTMLFieldSetElement: { - prototype: HTMLFieldSetElement; - new(): HTMLFieldSetElement; -} - -interface MediaError { - code: number; - MEDIA_ERR_ABORTED: number; - MEDIA_ERR_NETWORK: number; - MEDIA_ERR_SRC_NOT_SUPPORTED: number; - MEDIA_ERR_DECODE: number; -} -declare var MediaError: { - prototype: MediaError; - new(): MediaError; - MEDIA_ERR_ABORTED: number; - MEDIA_ERR_NETWORK: number; - MEDIA_ERR_SRC_NOT_SUPPORTED: number; - MEDIA_ERR_DECODE: number; -} - -interface SVGNumberList { - numberOfItems: number; - replaceItem(newItem: SVGNumber, index: number): SVGNumber; - getItem(index: number): SVGNumber; - clear(): void; - appendItem(newItem: SVGNumber): SVGNumber; - initialize(newItem: SVGNumber): SVGNumber; - removeItem(index: number): SVGNumber; - insertItemBefore(newItem: SVGNumber, index: number): SVGNumber; -} -declare var SVGNumberList: { - prototype: SVGNumberList; - new(): SVGNumberList; -} - -interface HTMLBGSoundElement extends HTMLElement { - balance: any; - volume: any; - src: string; - loop: number; -} -declare var HTMLBGSoundElement: { - prototype: HTMLBGSoundElement; - new(): HTMLBGSoundElement; -} - -interface HTMLElement extends Element, MSHTMLElementRangeExtensions, ElementCSSInlineStyle, MSEventAttachmentTarget, MSHTMLElementExtensions, MSNodeExtensions { - ondragend: (ev: DragEvent) => any; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - onkeydown: (ev: KeyboardEvent) => any; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - ondragover: (ev: DragEvent) => any; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - onkeyup: (ev: KeyboardEvent) => any; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - offsetTop: number; - onreset: (ev: Event) => any; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - onmouseup: (ev: MouseEvent) => any; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - ondragstart: (ev: DragEvent) => any; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - ondrag: (ev: DragEvent) => any; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - innerHTML: string; - onmouseover: (ev: MouseEvent) => any; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - ondragleave: (ev: DragEvent) => any; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - lang: string; - onpause: (ev: Event) => any; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - className: string; - onseeked: (ev: Event) => any; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - onmousedown: (ev: MouseEvent) => any; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - title: string; - onclick: (ev: MouseEvent) => any; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - onwaiting: (ev: Event) => any; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - outerHTML: string; - offsetLeft: number; - ondurationchange: (ev: Event) => any; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - offsetHeight: number; - dir: string; - onblur: (ev: FocusEvent) => any; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - onemptied: (ev: Event) => any; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - onseeking: (ev: Event) => any; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - oncanplay: (ev: Event) => any; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - onstalled: (ev: Event) => any; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - onmousemove: (ev: MouseEvent) => any; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - style: MSStyleCSSProperties; - isContentEditable: boolean; - onratechange: (ev: Event) => any; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - onloadstart: (ev: Event) => any; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - ondragenter: (ev: DragEvent) => any; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - contentEditable: string; - onsubmit: (ev: Event) => any; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - tabIndex: number; - onprogress: (ev: any) => any; - addEventListener(type: "progress", listener: (ev: any) => any, useCapture?: boolean): void; - ondblclick: (ev: MouseEvent) => any; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - oncontextmenu: (ev: MouseEvent) => any; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - onchange: (ev: Event) => any; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - onloadedmetadata: (ev: Event) => any; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - onerror: (ev: Event) => any; - addEventListener(type: "error", listener: (ev: Event) => any, useCapture?: boolean): void; - onplay: (ev: Event) => any; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - id: string; - onplaying: (ev: Event) => any; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - oncanplaythrough: (ev: Event) => any; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - onabort: (ev: UIEvent) => any; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - onreadystatechange: (ev: Event) => any; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - onkeypress: (ev: KeyboardEvent) => any; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - offsetParent: Element; - onloadeddata: (ev: Event) => any; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - disabled: boolean; - onsuspend: (ev: Event) => any; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - accessKey: string; - onfocus: (ev: FocusEvent) => any; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - ontimeupdate: (ev: Event) => any; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - onselect: (ev: UIEvent) => any; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - ondrop: (ev: DragEvent) => any; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - offsetWidth: number; - onmouseout: (ev: MouseEvent) => any; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - onended: (ev: Event) => any; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - onscroll: (ev: UIEvent) => any; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - onmousewheel: (ev: MouseWheelEvent) => any; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - onvolumechange: (ev: Event) => any; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - onload: (ev: Event) => any; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - oninput: (ev: Event) => any; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - click(): void; - getElementsByClassName(classNames: string): NodeList; - scrollIntoView(top?: boolean): void; - focus(): void; - blur(): void; - insertAdjacentHTML(where: string, html: string): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLElement: { - prototype: HTMLElement; - new(): HTMLElement; -} - -interface Comment extends CharacterData, MSCommentExtensions { -} -declare var Comment: { - prototype: Comment; - new(): Comment; -} - -interface CanvasPattern { -} -declare var CanvasPattern: { - prototype: CanvasPattern; - new(): CanvasPattern; -} - -interface HTMLHRElement extends HTMLElement, DOML2DeprecatedWidthStyle_HTMLHRElement, MSHTMLHRElementExtensions, HTMLHRElementDOML2Deprecated, DOML2DeprecatedAlignmentStyle_HTMLHRElement, DOML2DeprecatedSizeProperty { -} -declare var HTMLHRElement: { - prototype: HTMLHRElement; - new(): HTMLHRElement; -} - -interface MSHTMLFrameSetElementExtensions { - name: string; - frameBorder: string; - border: string; - frameSpacing: any; -} - -interface DOML2DeprecatedTextFlowControl_HTMLBlockElement { - clear: string; -} - -interface PositionOptions { - enableHighAccuracy?: boolean; - timeout?: number; - maximumAge?: number; -} - -interface HTMLObjectElement extends HTMLElement, MSHTMLObjectElementExtensions, GetSVGDocument, DOML2DeprecatedMarginStyle_HTMLObjectElement, MSDataBindingExtensions, MSDataBindingRecordSetExtensions, DOML2DeprecatedAlignmentStyle_HTMLObjectElement, DOML2DeprecatedBorderStyle_HTMLObjectElement { - width: string; - codeType: string; - archive: string; - standby: string; - name: string; - useMap: string; - form: HTMLFormElement; - data: string; - height: string; - contentDocument: Document; - codeBase: string; - declare: boolean; - type: string; - code: string; -} -declare var HTMLObjectElement: { - prototype: HTMLObjectElement; - new(): HTMLObjectElement; -} - -interface MSHTMLMenuElementExtensions { -} - -interface DocumentView { - defaultView: AbstractView; - elementFromPoint(x: number, y: number): Element; -} - -interface StorageEvent extends Event { - oldValue: any; - newValue: any; - url: string; - storageArea: Storage; - key: string; - initStorageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, keyArg: string, oldValueArg: any, newValueArg: any, urlArg: string, storageAreaArg: Storage): void; -} -declare var StorageEvent: { - prototype: StorageEvent; - new(): StorageEvent; -} - -interface HTMLEmbedElement extends HTMLElement, GetSVGDocument, MSHTMLEmbedElementExtensions { - width: string; - src: string; - name: string; - height: string; -} -declare var HTMLEmbedElement: { - prototype: HTMLEmbedElement; - new(): HTMLEmbedElement; -} - -interface CharacterData extends Node { - length: number; - data: string; - deleteData(offset: number, count: number): void; - replaceData(offset: number, count: number, arg: string): void; - appendData(arg: string): void; - insertData(offset: number, arg: string): void; - substringData(offset: number, count: number): string; -} -declare var CharacterData: { - prototype: CharacterData; - new(): CharacterData; -} - -interface DOML2DeprecatedAlignmentStyle_HTMLTableSectionElement { - align: string; -} - -interface HTMLOptGroupElement extends HTMLElement, MSDataBindingExtensions, MSHTMLOptGroupElementExtensions { - label: string; -} -declare var HTMLOptGroupElement: { - prototype: HTMLOptGroupElement; - new(): HTMLOptGroupElement; -} - -interface HTMLIsIndexElement extends HTMLElement, MSHTMLIsIndexElementExtensions { - form: HTMLFormElement; - prompt: string; -} -declare var HTMLIsIndexElement: { - prototype: HTMLIsIndexElement; - new(): HTMLIsIndexElement; -} - -interface SVGPathSegLinetoRel extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegLinetoRel: { - prototype: SVGPathSegLinetoRel; - new(): SVGPathSegLinetoRel; -} - -interface MSHTMLDocumentSelection { - selection: MSSelection; -} - -interface DOMException { - code: number; - message: string; - toString(): string; - HIERARCHY_REQUEST_ERR: number; - NO_MODIFICATION_ALLOWED_ERR: number; - INVALID_MODIFICATION_ERR: number; - NAMESPACE_ERR: number; - INVALID_CHARACTER_ERR: number; - TYPE_MISMATCH_ERR: number; - ABORT_ERR: number; - INVALID_STATE_ERR: number; - SECURITY_ERR: number; - NETWORK_ERR: number; - WRONG_DOCUMENT_ERR: number; - QUOTA_EXCEEDED_ERR: number; - INDEX_SIZE_ERR: number; - DOMSTRING_SIZE_ERR: number; - SYNTAX_ERR: number; - SERIALIZE_ERR: number; - VALIDATION_ERR: number; - NOT_FOUND_ERR: number; - URL_MISMATCH_ERR: number; - PARSE_ERR: number; - NO_DATA_ALLOWED_ERR: number; - NOT_SUPPORTED_ERR: number; - INVALID_ACCESS_ERR: number; - INUSE_ATTRIBUTE_ERR: number; -} -declare var DOMException: { - prototype: DOMException; - new(): DOMException; - HIERARCHY_REQUEST_ERR: number; - NO_MODIFICATION_ALLOWED_ERR: number; - INVALID_MODIFICATION_ERR: number; - NAMESPACE_ERR: number; - INVALID_CHARACTER_ERR: number; - TYPE_MISMATCH_ERR: number; - ABORT_ERR: number; - INVALID_STATE_ERR: number; - SECURITY_ERR: number; - NETWORK_ERR: number; - WRONG_DOCUMENT_ERR: number; - QUOTA_EXCEEDED_ERR: number; - INDEX_SIZE_ERR: number; - DOMSTRING_SIZE_ERR: number; - SYNTAX_ERR: number; - SERIALIZE_ERR: number; - VALIDATION_ERR: number; - NOT_FOUND_ERR: number; - URL_MISMATCH_ERR: number; - PARSE_ERR: number; - NO_DATA_ALLOWED_ERR: number; - NOT_SUPPORTED_ERR: number; - INVALID_ACCESS_ERR: number; - INUSE_ATTRIBUTE_ERR: number; -} - -interface MSCompatibleInfoCollection { - length: number; - item(index: number): MSCompatibleInfo; -} -declare var MSCompatibleInfoCollection: { - prototype: MSCompatibleInfoCollection; - new(): MSCompatibleInfoCollection; -} - -interface MSHTMLIsIndexElementExtensions { - action: string; -} - -interface SVGAnimatedBoolean { - animVal: boolean; - baseVal: boolean; -} -declare var SVGAnimatedBoolean: { - prototype: SVGAnimatedBoolean; - new(): SVGAnimatedBoolean; -} - -interface SVGSwitchElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests { -} -declare var SVGSwitchElement: { - prototype: SVGSwitchElement; - new(): SVGSwitchElement; -} - -interface MSHTMLIFrameElementExtensions extends DOML2DeprecatedMarginStyle_MSHTMLIFrameElementExtensions, DOML2DeprecatedBorderStyle_MSHTMLIFrameElementExtensions { - onload: (ev: Event) => any; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - frameSpacing: any; - noResize: boolean; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface SVGPreserveAspectRatio { - align: number; - meetOrSlice: number; - SVG_PRESERVEASPECTRATIO_NONE: number; - SVG_PRESERVEASPECTRATIO_XMINYMID: number; - SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; - SVG_PRESERVEASPECTRATIO_XMINYMAX: number; - SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; - SVG_MEETORSLICE_UNKNOWN: number; - SVG_PRESERVEASPECTRATIO_XMAXYMID: number; - SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; - SVG_PRESERVEASPECTRATIO_XMINYMIN: number; - SVG_MEETORSLICE_MEET: number; - SVG_PRESERVEASPECTRATIO_XMIDYMID: number; - SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; - SVG_MEETORSLICE_SLICE: number; - SVG_PRESERVEASPECTRATIO_UNKNOWN: number; -} -declare var SVGPreserveAspectRatio: { - prototype: SVGPreserveAspectRatio; - new(): SVGPreserveAspectRatio; - SVG_PRESERVEASPECTRATIO_NONE: number; - SVG_PRESERVEASPECTRATIO_XMINYMID: number; - SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; - SVG_PRESERVEASPECTRATIO_XMINYMAX: number; - SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; - SVG_MEETORSLICE_UNKNOWN: number; - SVG_PRESERVEASPECTRATIO_XMAXYMID: number; - SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; - SVG_PRESERVEASPECTRATIO_XMINYMIN: number; - SVG_MEETORSLICE_MEET: number; - SVG_PRESERVEASPECTRATIO_XMIDYMID: number; - SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; - SVG_MEETORSLICE_SLICE: number; - SVG_PRESERVEASPECTRATIO_UNKNOWN: number; -} - -interface Attr extends Node, MSAttrExtensions { - specified: boolean; - ownerElement: Element; - value: string; - name: string; -} -declare var Attr: { - prototype: Attr; - new(): Attr; -} - -interface MSBorderColorStyle_HTMLTableRowElement { - borderColor: any; -} - -interface DOML2DeprecatedAlignmentStyle_HTMLTableCaptionElement { - align: string; -} - -interface PerformanceNavigation { - redirectCount: number; - type: number; - toJSON(): any; - TYPE_RELOAD: number; - TYPE_RESERVED: number; - TYPE_BACK_FORWARD: number; - TYPE_NAVIGATE: number; -} -declare var PerformanceNavigation: { - prototype: PerformanceNavigation; - new(): PerformanceNavigation; - TYPE_RELOAD: number; - TYPE_RESERVED: number; - TYPE_BACK_FORWARD: number; - TYPE_NAVIGATE: number; -} - -interface HTMLBodyElementDOML2Deprecated { - link: any; - aLink: any; - text: any; - vLink: any; -} - -interface SVGStopElement extends SVGElement, SVGStylable { - offset: SVGAnimatedNumber; -} -declare var SVGStopElement: { - prototype: SVGStopElement; - new(): SVGStopElement; -} - -interface PositionCallback { - (position: Position): void; -} - -interface SVGSymbolElement extends SVGElement, SVGStylable, SVGLangSpace, SVGFitToViewBox { -} -declare var SVGSymbolElement: { - prototype: SVGSymbolElement; - new(): SVGSymbolElement; -} - -interface SVGElementInstanceList { - length: number; - item(index: number): SVGElementInstance; -} -declare var SVGElementInstanceList: { - prototype: SVGElementInstanceList; - new(): SVGElementInstanceList; -} - -interface MSDataBindingRecordSetExtensions { - recordset: Object; - namedRecordset(dataMember: string, hierarchy?: any): Object; -} - -interface CSSRuleList { - length: number; - item(index: number): CSSRule; - [index: number]: CSSRule; -} -declare var CSSRuleList: { - prototype: CSSRuleList; - new(): CSSRuleList; -} - -interface MSHTMLTableColElementExtensions { -} - -interface LinkStyle { - sheet: StyleSheet; -} - -interface MSHTMLMarqueeElementExtensions { -} - -interface HTMLVideoElement extends HTMLMediaElement { - width: number; - videoWidth: number; - videoHeight: number; - height: number; - poster: string; -} -declare var HTMLVideoElement: { - prototype: HTMLVideoElement; - new(): HTMLVideoElement; -} - -interface MSXMLHttpRequestExtensions { - responseBody: any; - timeout: number; - ontimeout: (ev: Event) => any; -} - -interface ClientRectList { - length: number; - item(index: number): ClientRect; - [index: number]: ClientRect; -} -declare var ClientRectList: { - prototype: ClientRectList; - new(): ClientRectList; -} - -interface DOML2DeprecatedAlignmentStyle_HTMLTableCellElement { - align: string; -} - -interface SVGMaskElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGTests { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - maskUnits: SVGAnimatedEnumeration; - maskContentUnits: SVGAnimatedEnumeration; - x: SVGAnimatedLength; - height: SVGAnimatedLength; -} -declare var SVGMaskElement: { - prototype: SVGMaskElement; - new(): SVGMaskElement; -} - -declare var Audio: { new (src?: string): HTMLAudioElement; }; -declare var Option: { new (text?: string, value?: string, defaultSelected?: boolean, selected?: boolean): HTMLOptionElement; }; -declare var Image: { new (width?: number, height?: number): HTMLImageElement; }; - -declare var ondragend: (ev: DragEvent) => any; -declare function addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare var onkeydown: (ev: KeyboardEvent) => any; -declare function addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; -declare var ondragover: (ev: DragEvent) => any; -declare function addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare var onkeyup: (ev: KeyboardEvent) => any; -declare function addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; -declare var onreset: (ev: Event) => any; -declare function addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; -declare var onmouseup: (ev: MouseEvent) => any; -declare function addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare var ondragstart: (ev: DragEvent) => any; -declare function addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare var ondrag: (ev: DragEvent) => any; -declare function addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare var onmouseover: (ev: MouseEvent) => any; -declare function addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare var ondragleave: (ev: DragEvent) => any; -declare function addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare var history: History; -declare var name: string; -declare var onafterprint: (ev: Event) => any; -declare function addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; -declare var onpause: (ev: Event) => any; -declare function addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; -declare var onbeforeprint: (ev: Event) => any; -declare function addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; -declare var top: Window; -declare var onmousedown: (ev: MouseEvent) => any; -declare function addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare var onseeked: (ev: Event) => any; -declare function addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; -declare var opener: Window; -declare var onclick: (ev: MouseEvent) => any; -declare function addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare var onwaiting: (ev: Event) => any; -declare function addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; -declare var ononline: (ev: Event) => any; -declare function addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; -declare var ondurationchange: (ev: Event) => any; -declare function addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare var frames: Window; -declare var onblur: (ev: FocusEvent) => any; -declare function addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; -declare var onemptied: (ev: Event) => any; -declare function addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; -declare var onseeking: (ev: Event) => any; -declare function addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; -declare var oncanplay: (ev: Event) => any; -declare function addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; -declare var onstalled: (ev: Event) => any; -declare function addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; -declare var onmousemove: (ev: MouseEvent) => any; -declare function addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare var onoffline: (ev: Event) => any; -declare function addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; -declare var length: number; -declare var onbeforeunload: (ev: BeforeUnloadEvent) => any; -declare function addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; -declare var onratechange: (ev: Event) => any; -declare function addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare var onstorage: (ev: StorageEvent) => any; -declare function addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; -declare var onloadstart: (ev: Event) => any; -declare function addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; -declare var ondragenter: (ev: DragEvent) => any; -declare function addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare var onsubmit: (ev: Event) => any; -declare function addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; -declare var self: Window; -declare var onprogress: (ev: any) => any; -declare function addEventListener(type: "progress", listener: (ev: any) => any, useCapture?: boolean): void; -declare var ondblclick: (ev: MouseEvent) => any; -declare function addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare var oncontextmenu: (ev: MouseEvent) => any; -declare function addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare var onchange: (ev: Event) => any; -declare function addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; -declare var onloadedmetadata: (ev: Event) => any; -declare function addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; -declare var onplay: (ev: Event) => any; -declare function addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; -declare var onerror: ErrorFunction; -declare var onplaying: (ev: Event) => any; -declare function addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; -declare var parent: Window; -declare var location: Location; -declare var oncanplaythrough: (ev: Event) => any; -declare function addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; -declare var onabort: (ev: UIEvent) => any; -declare function addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; -declare var onreadystatechange: (ev: Event) => any; -declare function addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare var onkeypress: (ev: KeyboardEvent) => any; -declare function addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; -declare var frameElement: Element; -declare var onloadeddata: (ev: Event) => any; -declare function addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; -declare var onsuspend: (ev: Event) => any; -declare function addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; -declare var window: Window; -declare var onfocus: (ev: FocusEvent) => any; -declare function addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; -declare var onmessage: (ev: MessageEvent) => any; -declare function addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; -declare var ontimeupdate: (ev: Event) => any; -declare function addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; -declare var onresize: (ev: UIEvent) => any; -declare function addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; -declare var navigator: Navigator; -declare var onselect: (ev: UIEvent) => any; -declare function addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; -declare var ondrop: (ev: DragEvent) => any; -declare function addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare var onmouseout: (ev: MouseEvent) => any; -declare function addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare var onended: (ev: Event) => any; -declare function addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; -declare var onhashchange: (ev: Event) => any; -declare function addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare var onunload: (ev: Event) => any; -declare function addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; -declare var onscroll: (ev: UIEvent) => any; -declare function addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; -declare var onmousewheel: (ev: MouseWheelEvent) => any; -declare function addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; -declare var onload: (ev: Event) => any; -declare function addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; -declare var onvolumechange: (ev: Event) => any; -declare function addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare var oninput: (ev: Event) => any; -declare function addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function alert(message?: string): void; -declare function focus(): void; -declare function print(): void; -declare function prompt(message?: string, defaul?: string): string; -declare function toString(): string; -declare function open(url?: string, target?: string, features?: string, replace?: boolean): Window; -declare function close(): void; -declare function confirm(message?: string): boolean; -declare function postMessage(message: any, targetOrigin: string, ports?: any): void; -declare function showModalDialog(url?: string, argument?: any, options?: any): any; -declare function blur(): void; -declare function getSelection(): Selection; -declare function getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; -declare function attachEvent(event: string, listener: EventListener): boolean; -declare function detachEvent(event: string, listener: EventListener): void; -declare var status: string; -declare var onmouseleave: (ev: MouseEvent) => any; -declare function addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare var screenLeft: number; -declare var offscreenBuffering: any; -declare var maxConnectionsPerServer: number; -declare var onmouseenter: (ev: MouseEvent) => any; -declare function addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare var clipboardData: DataTransfer; -declare var defaultStatus: string; -declare var clientInformation: Navigator; -declare var closed: boolean; -declare var onhelp: (ev: Event) => any; -declare function addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; -declare var external: BrowserPublic; -declare var event: MSEventObj; -declare var onfocusout: (ev: FocusEvent) => any; -declare function addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; -declare var screenTop: number; -declare var onfocusin: (ev: FocusEvent) => any; -declare function addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; -declare function showModelessDialog(url?: string, argument?: any, options?: any): Window; -declare function navigate(url: string): void; -declare function resizeBy(x?: number, y?: number): void; -declare function item(index: any): any; -declare function resizeTo(x?: number, y?: number): void; -declare function createPopup(arguments?: any): MSPopupWindow; -declare function toStaticHTML(html: string): string; -declare function execScript(code: string, language?: string): any; -declare function msWriteProfilerMark(profilerMarkName: string): void; -declare function moveTo(x?: number, y?: number): void; -declare function moveBy(x?: number, y?: number): void; -declare function showHelp(url: string, helpArg?: any, features?: string): void; -declare var performance: any; -declare var outerWidth: number; -declare var pageXOffset: number; -declare var innerWidth: number; -declare var pageYOffset: number; -declare var screenY: number; -declare var outerHeight: number; -declare var screen: Screen; -declare var innerHeight: number; -declare var screenX: number; -declare function scroll(x?: number, y?: number): void; -declare function scrollBy(x?: number, y?: number): void; -declare function scrollTo(x?: number, y?: number): void; -declare var styleMedia: StyleMedia; -declare var document: Document; -declare function removeEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -declare function addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -declare function dispatchEvent(evt: Event): boolean; -declare var localStorage: Storage; -declare var sessionStorage: Storage; -declare function clearTimeout(handle: number): void; -declare function setTimeout(expression: any, msec?: number, language?: any): number; -declare function clearInterval(handle: number): void; -declare function setInterval(expression: any, msec?: number, language?: any): number; - - -///////////////////////////// -/// IE10 DOM APIs -///////////////////////////// - -interface HTMLBodyElement { - onpopstate: (ev: PopStateEvent) => any; - addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; -} - -interface MSGestureEvent extends UIEvent { - offsetY: number; - translationY: number; - velocityExpansion: number; - velocityY: number; - velocityAngular: number; - translationX: number; - velocityX: number; - hwTimestamp: number; - offsetX: number; - screenX: number; - rotation: number; - expansion: number; - clientY: number; - screenY: number; - scale: number; - gestureObject: any; - clientX: number; - initGestureEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: AbstractView, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, offsetXArg: number, offsetYArg: number, translationXArg: number, translationYArg: number, scaleArg: number, expansionArg: number, rotationArg: number, velocityXArg: number, velocityYArg: number, velocityExpansionArg: number, velocityAngularArg: number, hwTimestampArg: number): void; - MSGESTURE_FLAG_BEGIN: number; - MSGESTURE_FLAG_END: number; - MSGESTURE_FLAG_CANCEL: number; - MSGESTURE_FLAG_INERTIA: number; - MSGESTURE_FLAG_NONE: number; -} -declare var MSGestureEvent: { - prototype: MSGestureEvent; - new(): MSGestureEvent; - MSGESTURE_FLAG_BEGIN: number; - MSGESTURE_FLAG_END: number; - MSGESTURE_FLAG_CANCEL: number; - MSGESTURE_FLAG_INERTIA: number; - MSGESTURE_FLAG_NONE: number; -} - -interface HTMLAnchorElement { - text: string; -} - -interface HTMLInputElement { - validationMessage: string; - files: FileList; - max: string; - formTarget: string; - willValidate: boolean; - step: string; - autofocus: boolean; - required: boolean; - formEnctype: string; - valueAsNumber: number; - placeholder: string; - formMethod: string; - list: HTMLElement; - autocomplete: string; - min: string; - formAction: string; - pattern: string; - validity: ValidityState; - formNoValidate: string; - multiple: boolean; - checkValidity(): boolean; - stepDown(n?: number): void; - stepUp(n?: number): void; - setCustomValidity(error: string): void; -} - -interface ErrorEvent extends Event { - colno: number; - filename: string; - lineno: number; - message: string; - initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void; -} -declare var ErrorEvent: { - prototype: ErrorEvent; - new(): ErrorEvent; -} - -interface SVGFilterElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGURIReference { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - filterResX: SVGAnimatedInteger; - filterUnits: SVGAnimatedEnumeration; - primitiveUnits: SVGAnimatedEnumeration; - x: SVGAnimatedLength; - height: SVGAnimatedLength; - filterResY: SVGAnimatedInteger; - setFilterRes(filterResX: number, filterResY: number): void; -} -declare var SVGFilterElement: { - prototype: SVGFilterElement; - new(): SVGFilterElement; -} - -interface TrackEvent extends Event { - track: any; -} -declare var TrackEvent: { - prototype: TrackEvent; - new(): TrackEvent; -} - -interface SVGFEMergeNodeElement extends SVGElement { - in1: SVGAnimatedString; -} -declare var SVGFEMergeNodeElement: { - prototype: SVGFEMergeNodeElement; - new(): SVGFEMergeNodeElement; -} - -interface SVGFEFloodElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { -} -declare var SVGFEFloodElement: { - prototype: SVGFEFloodElement; - new(): SVGFEFloodElement; -} - -interface MSElementExtensions { - msRegionOverflow: string; - onmspointerdown: (ev: any) => any; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - onmsgotpointercapture: (ev: any) => any; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - onmsgesturedoubletap: (ev: any) => any; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - onmspointerhover: (ev: any) => any; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - onmsgesturehold: (ev: any) => any; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - onmspointermove: (ev: any) => any; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - onmsgesturechange: (ev: any) => any; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - onmsgesturestart: (ev: any) => any; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - onmspointercancel: (ev: any) => any; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - onmsgestureend: (ev: any) => any; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - onmsgesturetap: (ev: any) => any; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - onmspointerout: (ev: any) => any; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - onmsinertiastart: (ev: any) => any; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - onmslostpointercapture: (ev: any) => any; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - onmspointerover: (ev: any) => any; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - msContentZoomFactor: number; - onmspointerup: (ev: any) => any; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - msGetRegionContent(): MSRangeCollection; - msReleasePointerCapture(pointerId: number): void; - msSetPointerCapture(pointerId: number): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var MSElementExtensions: { - prototype: MSElementExtensions; - new(): MSElementExtensions; -} - -interface MSCSSScrollTranslationProperties { - msScrollTranslation: string; -} - -interface MSGesture { - target: Element; - addPointer(pointerId: number): void; - stop(): void; -} -declare var MSGesture: { - prototype: MSGesture; - new (): MSGesture; -} - -interface TextTrackCue extends EventTarget { - onenter: (ev: Event) => any; - addEventListener(type: "enter", listener: (ev: Event) => any, useCapture?: boolean): void; - track: TextTrack; - endTime: number; - text: string; - pauseOnExit: boolean; - id: string; - startTime: number; - onexit: (ev: Event) => any; - addEventListener(type: "exit", listener: (ev: Event) => any, useCapture?: boolean): void; - getCueAsHTML(): DocumentFragment; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var TextTrackCue: { - prototype: TextTrackCue; - new(): TextTrackCue; -} - -interface MSHTMLDocumentViewExtensions { - msCSSOMElementFloatMetrics: boolean; - msElementsFromPoint(x: number, y: number): NodeList; - msElementsFromRect(left: number, top: number, width: number, height: number): NodeList; -} -declare var MSHTMLDocumentViewExtensions: { - prototype: MSHTMLDocumentViewExtensions; - new(): MSHTMLDocumentViewExtensions; -} - -interface MSStreamReader extends MSBaseReader { - error: DOMError; - readAsArrayBuffer(stream: MSStream, size?: number): void; - readAsBlob(stream: MSStream, size?: number): void; - readAsDataURL(stream: MSStream, size?: number): void; - readAsText(stream: MSStream, encoding?: string, size?: number): void; -} -declare var MSStreamReader: { - prototype: MSStreamReader; - new (): MSStreamReader; -} - -interface CSSFlexibleBoxProperties { - msFlex: string; - msFlexDirection: string; - msFlexNegative: string; - msFlexPack: string; - msFlexWrap: string; - msFlexItemAlign: string; - msFlexOrder: string; - msFlexPositive: string; - msFlexAlign: string; - msFlexFlow: string; - msFlexPreferredSize: string; - msFlexLinePack: string; -} - -interface DOMTokenList { - length: number; - contains(token: string): boolean; - remove(token: string): void; - toggle(token: string): boolean; - add(token: string): void; - item(index: number): string; - [index: number]: string; - toString(): string; -} -declare var DOMTokenList: { - prototype: DOMTokenList; - new(): DOMTokenList; -} - -interface EventException { - name: string; -} - -interface SVGFEFuncAElement extends SVGComponentTransferFunctionElement { -} -declare var SVGFEFuncAElement: { - prototype: SVGFEFuncAElement; - new(): SVGFEFuncAElement; -} - -interface Performance { - now(): number; -} - -interface SVGFETileElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in1: SVGAnimatedString; -} -declare var SVGFETileElement: { - prototype: SVGFETileElement; - new(): SVGFETileElement; -} - -interface SVGFEBlendElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in2: SVGAnimatedString; - mode: SVGAnimatedEnumeration; - in1: SVGAnimatedString; - SVG_FEBLEND_MODE_DARKEN: number; - SVG_FEBLEND_MODE_UNKNOWN: number; - SVG_FEBLEND_MODE_MULTIPLY: number; - SVG_FEBLEND_MODE_NORMAL: number; - SVG_FEBLEND_MODE_SCREEN: number; - SVG_FEBLEND_MODE_LIGHTEN: number; -} -declare var SVGFEBlendElement: { - prototype: SVGFEBlendElement; - new(): SVGFEBlendElement; - SVG_FEBLEND_MODE_DARKEN: number; - SVG_FEBLEND_MODE_UNKNOWN: number; - SVG_FEBLEND_MODE_MULTIPLY: number; - SVG_FEBLEND_MODE_NORMAL: number; - SVG_FEBLEND_MODE_SCREEN: number; - SVG_FEBLEND_MODE_LIGHTEN: number; -} - -interface WindowTimers extends WindowTimersExtension { -} -declare var WindowTimers: { - prototype: WindowTimers; - new(): WindowTimers; -} - -interface CSSStyleDeclaration extends CSS2DTransformsProperties, CSSTransitionsProperties, CSSFontsProperties, MSCSSHighContrastProperties, CSSGridProperties, CSSAnimationsProperties, MSCSSContentZoomProperties, MSCSSScrollTranslationProperties, MSCSSTouchManipulationProperties, CSSFlexibleBoxProperties, MSCSSPositionedFloatsProperties, MSCSSRegionProperties, MSCSSSelectionBoundaryProperties, CSSMultiColumnProperties, CSSTextProperties, CSS3DTransformsProperties { -} - -interface MessageChannel { - port2: MessagePort; - port1: MessagePort; -} -declare var MessageChannel: { - prototype: MessageChannel; - new (): MessageChannel; -} - -interface SVGFEMergeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { -} -declare var SVGFEMergeElement: { - prototype: SVGFEMergeElement; - new(): SVGFEMergeElement; -} - -interface Navigator extends MSFileSaver { -} - -interface TransitionEvent extends Event { - propertyName: string; - elapsedTime: number; - initTransitionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, propertyNameArg: string, elapsedTimeArg: number): void; -} -declare var TransitionEvent: { - prototype: TransitionEvent; - new(): TransitionEvent; -} - -interface MediaQueryList { - matches: boolean; - media: string; - addListener(listener: MediaQueryListListener): void; - removeListener(listener: MediaQueryListListener): void; -} -declare var MediaQueryList: { - prototype: MediaQueryList; - new(): MediaQueryList; -} - -interface DOMError { - name: string; - toString(): string; -} -declare var DOMError: { - prototype: DOMError; - new(): DOMError; -} - -interface SVGFEPointLightElement extends SVGElement { - y: SVGAnimatedNumber; - x: SVGAnimatedNumber; - z: SVGAnimatedNumber; -} -declare var SVGFEPointLightElement: { - prototype: SVGFEPointLightElement; - new(): SVGFEPointLightElement; -} - -interface CSSFontsProperties { - msFontFeatureSettings: string; - fontFeatureSettings: string; -} - -interface CloseEvent extends Event { - wasClean: boolean; - reason: string; - code: number; - initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void; -} -declare var CloseEvent: { - prototype: CloseEvent; - new(): CloseEvent; -} - -interface WebSocket extends EventTarget { - protocol: string; - readyState: number; - bufferedAmount: number; - onopen: (ev: Event) => any; - addEventListener(type: "open", listener: (ev: Event) => any, useCapture?: boolean): void; - extensions: string; - onmessage: (ev: any) => any; - addEventListener(type: "message", listener: (ev: any) => any, useCapture?: boolean): void; - onclose: (ev: CloseEvent) => any; - addEventListener(type: "close", listener: (ev: CloseEvent) => any, useCapture?: boolean): void; - onerror: (ev: ErrorEvent) => any; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - binaryType: string; - url: string; - close(code?: number, reason?: string): void; - send(data: any): void; - OPEN: number; - CLOSING: number; - CONNECTING: number; - CLOSED: number; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var WebSocket: { - prototype: WebSocket; - new (url: string): WebSocket; - new (url: string, prototcol: string): WebSocket; - new (url: string, prototcol: string[]): WebSocket; - OPEN: number; - CLOSING: number; - CONNECTING: number; - CLOSED: number; -} - -interface ProgressEvent extends Event { - loaded: number; - lengthComputable: boolean; - total: number; - initProgressEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, lengthComputableArg: boolean, loadedArg: number, totalArg: number): void; -} -declare var ProgressEvent: { - prototype: ProgressEvent; - new(): ProgressEvent; -} - -interface HTMLCanvasElement { - msToBlob(): Blob; -} - -interface IDBObjectStore { - indexNames: DOMStringList; - name: string; - transaction: IDBTransaction; - keyPath: string; - count(key?: any): IDBRequest; - add(value: any, key?: any): IDBRequest; - clear(): IDBRequest; - createIndex(name: string, keyPath: string, optionalParameters?: any): IDBIndex; - put(value: any, key?: any): IDBRequest; - openCursor(range?: any, direction?: string): IDBRequest; - deleteIndex(indexName: string): void; - index(name: string): IDBIndex; - get(key: any): IDBRequest; - delete(key: any): IDBRequest; -} -declare var IDBObjectStore: { - prototype: IDBObjectStore; - new(): IDBObjectStore; -} - -interface ObjectURLOptions { - oneTimeOnly?: boolean; -} - -interface SVGFEGaussianBlurElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - stdDeviationX: SVGAnimatedNumber; - in1: SVGAnimatedString; - stdDeviationY: SVGAnimatedNumber; - setStdDeviation(stdDeviationX: number, stdDeviationY: number): void; -} -declare var SVGFEGaussianBlurElement: { - prototype: SVGFEGaussianBlurElement; - new(): SVGFEGaussianBlurElement; -} - -interface MSHTMLDocumentExtensions { - onmspointerdown: (ev: any) => any; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - onmspointercancel: (ev: any) => any; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - onmsgesturedoubletap: (ev: any) => any; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - onmsgesturetap: (ev: any) => any; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - onmsgestureend: (ev: any) => any; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - onmspointerout: (ev: any) => any; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - onmsmanipulationstatechanged: (ev: any) => any; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - onmsinertiastart: (ev: any) => any; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - onmspointerhover: (ev: any) => any; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - onmscontentzoom: (ev: any) => any; - addEventListener(type: "mscontentzoom", listener: (ev: any) => any, useCapture?: boolean): void; - onmsgesturehold: (ev: any) => any; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - onmspointermove: (ev: any) => any; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - onmspointerover: (ev: any) => any; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - onmsgesturechange: (ev: any) => any; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - onmsgesturestart: (ev: any) => any; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - onmspointerup: (ev: any) => any; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; -} -declare var MSHTMLDocumentExtensions: { - prototype: MSHTMLDocumentExtensions; - new(): MSHTMLDocumentExtensions; -} - -interface MSCSSSelectionBoundaryProperties { - msUserSelect: string; -} - -interface SVGFilterPrimitiveStandardAttributes extends SVGStylable { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - x: SVGAnimatedLength; - height: SVGAnimatedLength; - result: SVGAnimatedString; -} - -interface IDBVersionChangeEvent extends Event { - newVersion: number; - oldVersion: number; -} -declare var IDBVersionChangeEvent: { - prototype: IDBVersionChangeEvent; - new(): IDBVersionChangeEvent; -} - -interface IDBIndex { - unique: boolean; - name: string; - keyPath: string; - objectStore: IDBObjectStore; - count(key?: any): IDBRequest; - getKey(key: any): IDBRequest; - openKeyCursor(range?: IDBKeyRange, direction?: string): IDBRequest; - get(key: any): IDBRequest; - openCursor(range?: IDBKeyRange, direction?: string): IDBRequest; -} -declare var IDBIndex: { - prototype: IDBIndex; - new(): IDBIndex; -} - -interface FileList { - length: number; - item(index: number): File; - [index: number]: File; -} -declare var FileList: { - prototype: FileList; - new(): FileList; -} - -interface IDBCursor { - source: any; - direction: string; - key: any; - primaryKey: any; - advance(count: number): void; - delete(): IDBRequest; - continue(key?: any): void; - update(value: any): IDBRequest; -} -declare var IDBCursor: { - prototype: IDBCursor; - new(): IDBCursor; -} - -interface CSSAnimationsProperties { - animationFillMode: string; - msAnimationDirection: string; - msAnimationDelay: string; - msAnimationFillMode: string; - animationIterationCount: string; - msAnimationPlayState: string; - msAnimationIterationCount: string; - animationDelay: string; - animationTimingFunction: string; - msAnimation: string; - animation: string; - animationDirection: string; - animationDuration: string; - animationName: string; - animationPlayState: string; - msAnimationTimingFunction: string; - msAnimationName: string; - msAnimationDuration: string; -} - -interface SVGFESpecularLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - kernelUnitLengthY: SVGAnimatedNumber; - surfaceScale: SVGAnimatedNumber; - specularExponent: SVGAnimatedNumber; - in1: SVGAnimatedString; - kernelUnitLengthX: SVGAnimatedNumber; - specularConstant: SVGAnimatedNumber; -} -declare var SVGFESpecularLightingElement: { - prototype: SVGFESpecularLightingElement; - new(): SVGFESpecularLightingElement; -} - -interface File extends Blob { - lastModifiedDate: any; - name: string; -} -declare var File: { - prototype: File; - new(): File; -} - -interface URL { - revokeObjectURL(url: string): void; - createObjectURL(object: any, options?: ObjectURLOptions): string; -} -declare var URL: URL; - -interface RangeException { - name: string; -} - -interface IDBCursorWithValue extends IDBCursor { - value: any; -} -declare var IDBCursorWithValue: { - prototype: IDBCursorWithValue; - new(): IDBCursorWithValue; -} - -interface HTMLTextAreaElement { - validationMessage: string; - autofocus: boolean; - validity: ValidityState; - required: boolean; - maxLength: number; - willValidate: boolean; - placeholder: string; - checkValidity(): boolean; - setCustomValidity(error: string): void; -} - -interface XMLHttpRequestEventTarget extends EventTarget { - onprogress: (ev: ProgressEvent) => any; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - onerror: (ev: ErrorEvent) => any; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - onload: (ev: any) => any; - addEventListener(type: "load", listener: (ev: any) => any, useCapture?: boolean): void; - ontimeout: (ev: any) => any; - addEventListener(type: "timeout", listener: (ev: any) => any, useCapture?: boolean): void; - onabort: (ev: any) => any; - addEventListener(type: "abort", listener: (ev: any) => any, useCapture?: boolean): void; - onloadstart: (ev: any) => any; - addEventListener(type: "loadstart", listener: (ev: any) => any, useCapture?: boolean): void; - onloadend: (ev: ProgressEvent) => any; - addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var XMLHttpRequestEventTarget: { - prototype: XMLHttpRequestEventTarget; - new(): XMLHttpRequestEventTarget; -} - -interface IDBEnvironment { - msIndexedDB: IDBFactory; - indexedDB: IDBFactory; -} - -interface AudioTrackList extends EventTarget { - length: number; - onchange: (ev: any) => any; - addEventListener(type: "change", listener: (ev: any) => any, useCapture?: boolean): void; - onaddtrack: (ev: TrackEvent) => any; - addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; - getTrackById(id: string): AudioTrack; - item(index: number): AudioTrack; - [index: number]: AudioTrack; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var AudioTrackList: { - prototype: AudioTrackList; - new(): AudioTrackList; -} - -interface MSBaseReader extends EventTarget { - onprogress: (ev: ProgressEvent) => any; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - readyState: number; - onabort: (ev: any) => any; - addEventListener(type: "abort", listener: (ev: any) => any, useCapture?: boolean): void; - onloadend: (ev: ProgressEvent) => any; - addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - onerror: (ev: ErrorEvent) => any; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - onload: (ev: any) => any; - addEventListener(type: "load", listener: (ev: any) => any, useCapture?: boolean): void; - onloadstart: (ev: any) => any; - addEventListener(type: "loadstart", listener: (ev: any) => any, useCapture?: boolean): void; - result: any; - abort(): void; - LOADING: number; - EMPTY: number; - DONE: number; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface History { - state: any; - replaceState(statedata: any, title: string, url?: string): void; - pushState(statedata: any, title: string, url?: string): void; -} - -interface MSProtocol { - protocol: string; -} -declare var MSProtocol: { - prototype: MSProtocol; - new(): MSProtocol; -} - -interface SVGFEMorphologyElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - operator: SVGAnimatedEnumeration; - radiusX: SVGAnimatedNumber; - radiusY: SVGAnimatedNumber; - in1: SVGAnimatedString; - SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; - SVG_MORPHOLOGY_OPERATOR_ERODE: number; - SVG_MORPHOLOGY_OPERATOR_DILATE: number; -} -declare var SVGFEMorphologyElement: { - prototype: SVGFEMorphologyElement; - new(): SVGFEMorphologyElement; - SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; - SVG_MORPHOLOGY_OPERATOR_ERODE: number; - SVG_MORPHOLOGY_OPERATOR_DILATE: number; -} - -interface HTMLSelectElement { - validationMessage: string; - autofocus: boolean; - validity: ValidityState; - required: boolean; - willValidate: boolean; - checkValidity(): boolean; - setCustomValidity(error: string): void; -} - -interface CSSTransitionsProperties { - transition: string; - transitionDelay: string; - transitionDuration: string; - msTransitionTimingFunction: string; - msTransition: string; - msTransitionDuration: string; - transitionTimingFunction: string; - msTransitionDelay: string; - transitionProperty: string; - msTransitionProperty: string; -} - -interface SVGFEFuncRElement extends SVGComponentTransferFunctionElement { -} -declare var SVGFEFuncRElement: { - prototype: SVGFEFuncRElement; - new(): SVGFEFuncRElement; -} - -interface CSSRule { - KEYFRAMES_RULE: number; - KEYFRAME_RULE: number; - VIEWPORT_RULE: number; -} -//declare var CSSRule: { -// KEYFRAMES_RULE: number; -// KEYFRAME_RULE: number; -// VIEWPORT_RULE: number; -//} - -interface WindowTimersExtension { - msSetImmediate(expression: any, ...args: any[]): number; - clearImmediate(handle: number): void; - msClearImmediate(handle: number): void; - setImmediate(expression: any, ...args: any[]): number; -} - -interface SVGFEDisplacementMapElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in2: SVGAnimatedString; - xChannelSelector: SVGAnimatedEnumeration; - yChannelSelector: SVGAnimatedEnumeration; - scale: SVGAnimatedNumber; - in1: SVGAnimatedString; - SVG_CHANNEL_B: number; - SVG_CHANNEL_R: number; - SVG_CHANNEL_G: number; - SVG_CHANNEL_UNKNOWN: number; - SVG_CHANNEL_A: number; -} -declare var SVGFEDisplacementMapElement: { - prototype: SVGFEDisplacementMapElement; - new(): SVGFEDisplacementMapElement; - SVG_CHANNEL_B: number; - SVG_CHANNEL_R: number; - SVG_CHANNEL_G: number; - SVG_CHANNEL_UNKNOWN: number; - SVG_CHANNEL_A: number; -} - -interface MSCSSContentZoomProperties { - msContentZoomLimit: string; - msContentZooming: string; - msContentZoomSnapType: string; - msContentZoomLimitMax: any; - msContentZoomSnapPoints: string; - msContentZoomSnap: string; - msContentZoomLimitMin: any; - msContentZoomChaining: string; -} - -interface AnimationEvent extends Event { - animationName: string; - elapsedTime: number; - initAnimationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, animationNameArg: string, elapsedTimeArg: number): void; -} -declare var AnimationEvent: { - prototype: AnimationEvent; - new(): AnimationEvent; -} - -interface SVGComponentTransferFunctionElement extends SVGElement { - tableValues: SVGAnimatedNumberList; - slope: SVGAnimatedNumber; - type: SVGAnimatedEnumeration; - exponent: SVGAnimatedNumber; - amplitude: SVGAnimatedNumber; - intercept: SVGAnimatedNumber; - offset: SVGAnimatedNumber; - SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; - SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; - SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; - SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; - SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; - SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; -} -declare var SVGComponentTransferFunctionElement: { - prototype: SVGComponentTransferFunctionElement; - new(): SVGComponentTransferFunctionElement; - SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; - SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; - SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; - SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; - SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; - SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; -} - -interface MSRangeCollection { - length: number; - item(index: number): Range; - [index: number]: Range; -} -declare var MSRangeCollection: { - prototype: MSRangeCollection; - new(): MSRangeCollection; -} - -interface MSHTMLElementExtensions { - onmscontentzoom: (ev: any) => any; - addEventListener(type: "mscontentzoom", listener: (ev: any) => any, useCapture?: boolean): void; - onmsmanipulationstatechanged: (ev: any) => any; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; -} -declare var MSHTMLElementExtensions: { - prototype: MSHTMLElementExtensions; - new(): MSHTMLElementExtensions; -} - -interface MSCSSPositionedFloatsProperties { - msWrapMargin: any; - msWrapFlow: string; -} - -interface SVGException { - name: string; -} - -interface SVGFEDistantLightElement extends SVGElement { - azimuth: SVGAnimatedNumber; - elevation: SVGAnimatedNumber; -} -declare var SVGFEDistantLightElement: { - prototype: SVGFEDistantLightElement; - new(): SVGFEDistantLightElement; -} - -interface MSCSSRegionProperties { - msFlowFrom: string; - msFlowInto: string; - msWrapThrough: string; -} - -interface SVGFEFuncBElement extends SVGComponentTransferFunctionElement { -} -declare var SVGFEFuncBElement: { - prototype: SVGFEFuncBElement; - new(): SVGFEFuncBElement; -} - -interface IDBKeyRange { - upper: any; - upperOpen: boolean; - lower: any; - lowerOpen: boolean; - bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange; - only(value: any): IDBKeyRange; - lowerBound(bound: any, open?: boolean): IDBKeyRange; - upperBound(bound: any, open?: boolean): IDBKeyRange; -} -declare var IDBKeyRange: { - prototype: IDBKeyRange; - new (): IDBKeyRange; -} - -interface WindowConsole { - console: Console; -} - -interface SVG1_1Properties { - floodOpacity: string; - floodColor: string; - filter: string; - lightingColor: string; - enableBackground: string; - colorInterpolationFilters: string; -} -declare var SVG1_1Properties: { - prototype: SVG1_1Properties; - new(): SVG1_1Properties; -} - -interface IDBTransaction extends EventTarget { - oncomplete: (ev: Event) => any; - addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; - db: IDBDatabase; - mode: string; - error: DOMError; - onerror: (ev: ErrorEvent) => any; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - onabort: (ev: any) => any; - addEventListener(type: "abort", listener: (ev: any) => any, useCapture?: boolean): void; - abort(): void; - objectStore(name: string): IDBObjectStore; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var IDBTransaction: { - prototype: IDBTransaction; - new(): IDBTransaction; -} - -interface MSWindowExtensions { - onmspointerdown: (ev: any) => any; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - onmspointercancel: (ev: any) => any; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - onmsgesturedoubletap: (ev: any) => any; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - onmsgestureend: (ev: any) => any; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - onmsgesturetap: (ev: any) => any; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - onmspointerout: (ev: any) => any; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - onmspointerhover: (ev: any) => any; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - onmsinertiastart: (ev: any) => any; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - onmspointermove: (ev: any) => any; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - onmsgesturehold: (ev: any) => any; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - onmspointerover: (ev: any) => any; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - onmsgesturechange: (ev: any) => any; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - onmsgesturestart: (ev: any) => any; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - onmspointerup: (ev: any) => any; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - msIsStaticHTML(html: string): boolean; -} -declare var MSWindowExtensions: { - prototype: MSWindowExtensions; - new(): MSWindowExtensions; -} - -interface AudioTrack { - kind: string; - language: string; - id: string; - label: string; - enabled: boolean; -} -declare var AudioTrack: { - prototype: AudioTrack; - new(): AudioTrack; -} - -interface SVGFEConvolveMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - orderY: SVGAnimatedInteger; - kernelUnitLengthY: SVGAnimatedNumber; - orderX: SVGAnimatedInteger; - preserveAlpha: SVGAnimatedBoolean; - kernelMatrix: SVGAnimatedNumberList; - edgeMode: SVGAnimatedEnumeration; - kernelUnitLengthX: SVGAnimatedNumber; - bias: SVGAnimatedNumber; - targetX: SVGAnimatedInteger; - targetY: SVGAnimatedInteger; - divisor: SVGAnimatedNumber; - in1: SVGAnimatedString; - SVG_EDGEMODE_WRAP: number; - SVG_EDGEMODE_DUPLICATE: number; - SVG_EDGEMODE_UNKNOWN: number; - SVG_EDGEMODE_NONE: number; -} -declare var SVGFEConvolveMatrixElement: { - prototype: SVGFEConvolveMatrixElement; - new(): SVGFEConvolveMatrixElement; - SVG_EDGEMODE_WRAP: number; - SVG_EDGEMODE_DUPLICATE: number; - SVG_EDGEMODE_UNKNOWN: number; - SVG_EDGEMODE_NONE: number; -} - -interface TextTrackCueList { - length: number; - item(index: number): TextTrackCue; - [index: number]: TextTrackCue; - getCueById(id: string): TextTrackCue; -} -declare var TextTrackCueList: { - prototype: TextTrackCueList; - new(): TextTrackCueList; -} - -interface CSSKeyframesRule extends CSSRule { - name: string; - cssRules: CSSRuleList; - findRule(rule: string): CSSKeyframeRule; - deleteRule(rule: string): void; - appendRule(rule: string): void; -} -declare var CSSKeyframesRule: { - prototype: CSSKeyframesRule; - new(): CSSKeyframesRule; -} - -interface MSCSSTouchManipulationProperties { - msScrollSnapPointsY: string; - msOverflowStyle: string; - msScrollLimitXMax: any; - msScrollSnapType: string; - msScrollSnapPointsX: string; - msScrollLimitYMax: any; - msScrollSnapY: string; - msScrollLimitXMin: any; - msScrollLimitYMin: any; - msScrollChaining: string; - msTouchAction: string; - msScrollSnapX: string; - msScrollLimit: string; - msScrollRails: string; - msTouchSelect: string; -} - -interface Window extends WindowAnimationTiming, WindowBase64, IDBEnvironment, WindowConsole { - onpopstate: (ev: PopStateEvent) => any; - addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; - applicationCache: ApplicationCache; - matchMedia(mediaQuery: string): MediaQueryList; - msMatchMedia(mediaQuery: string): MediaQueryList; -} - -interface SVGFETurbulenceElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - baseFrequencyX: SVGAnimatedNumber; - numOctaves: SVGAnimatedInteger; - type: SVGAnimatedEnumeration; - baseFrequencyY: SVGAnimatedNumber; - stitchTiles: SVGAnimatedEnumeration; - seed: SVGAnimatedNumber; - SVG_STITCHTYPE_UNKNOWN: number; - SVG_STITCHTYPE_NOSTITCH: number; - SVG_TURBULENCE_TYPE_UNKNOWN: number; - SVG_TURBULENCE_TYPE_TURBULENCE: number; - SVG_TURBULENCE_TYPE_FRACTALNOISE: number; - SVG_STITCHTYPE_STITCH: number; -} -declare var SVGFETurbulenceElement: { - prototype: SVGFETurbulenceElement; - new(): SVGFETurbulenceElement; - SVG_STITCHTYPE_UNKNOWN: number; - SVG_STITCHTYPE_NOSTITCH: number; - SVG_TURBULENCE_TYPE_UNKNOWN: number; - SVG_TURBULENCE_TYPE_TURBULENCE: number; - SVG_TURBULENCE_TYPE_FRACTALNOISE: number; - SVG_STITCHTYPE_STITCH: number; -} - -interface TextTrackList { - length: number; - item(index: number): TextTrack; - [index: number]: TextTrack; -} -declare var TextTrackList: { - prototype: TextTrackList; - new(): TextTrackList; -} - -interface WindowAnimationTiming { - animationStartTime: number; - msAnimationStartTime: number; - msCancelRequestAnimationFrame(handle: number): void; - cancelAnimationFrame(handle: number): void; - requestAnimationFrame(callback: FrameRequestCallback): number; - msRequestAnimationFrame(callback: FrameRequestCallback): number; -} - -interface SVGFEFuncGElement extends SVGComponentTransferFunctionElement { -} -declare var SVGFEFuncGElement: { - prototype: SVGFEFuncGElement; - new(): SVGFEFuncGElement; -} - -interface SVGFEColorMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in1: SVGAnimatedString; - type: SVGAnimatedEnumeration; - values: SVGAnimatedNumberList; - SVG_FECOLORMATRIX_TYPE_SATURATE: number; - SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; - SVG_FECOLORMATRIX_TYPE_MATRIX: number; - SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; - SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; -} -declare var SVGFEColorMatrixElement: { - prototype: SVGFEColorMatrixElement; - new(): SVGFEColorMatrixElement; - SVG_FECOLORMATRIX_TYPE_SATURATE: number; - SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; - SVG_FECOLORMATRIX_TYPE_MATRIX: number; - SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; - SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; -} - -interface Console { - info(): void; - info(message: any, ...optionalParams: any[]): void; - profile(reportName?: string): boolean; - assert(): void; - assert(test: boolean): void; - assert(test: boolean, message: any, ...optionalParams: any[]): void; - msIsIndependentlyComposed(element: Element): boolean; - clear(): boolean; - dir(): boolean; - dir(value: any, ...optionalParams: any[]): boolean; - warn(): void; - warn(message: any, ...optionalParams: any[]): void; - error(): void; - error(message: any, ...optionalParams: any[]): void; - log(): void; - log(message: any, ...optionalParams: any[]): void; - profileEnd(): boolean; -} -declare var Console: { - prototype: Console; - new(): Console; -} - -interface SVGFESpotLightElement extends SVGElement { - pointsAtY: SVGAnimatedNumber; - y: SVGAnimatedNumber; - limitingConeAngle: SVGAnimatedNumber; - specularExponent: SVGAnimatedNumber; - x: SVGAnimatedNumber; - pointsAtZ: SVGAnimatedNumber; - z: SVGAnimatedNumber; - pointsAtX: SVGAnimatedNumber; -} -declare var SVGFESpotLightElement: { - prototype: SVGFESpotLightElement; - new(): SVGFESpotLightElement; -} - -interface DocumentVisibility { - msHidden: boolean; - msVisibilityState: string; - visibilityState: string; - hidden: boolean; -} - -interface WindowBase64 { - btoa(rawString: string): string; - atob(encodedString: string): string; -} - -interface IDBDatabase extends EventTarget { - version: string; - name: string; - objectStoreNames: DOMStringList; - onerror: (ev: ErrorEvent) => any; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - onabort: (ev: any) => any; - addEventListener(type: "abort", listener: (ev: any) => any, useCapture?: boolean): void; - createObjectStore(name: string, optionalParameters?: any): IDBObjectStore; - close(): void; - transaction(storeNames: any, mode?: string): IDBTransaction; - deleteObjectStore(name: string): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var IDBDatabase: { - prototype: IDBDatabase; - new(): IDBDatabase; -} - -interface MSProtocolsCollection { -} -declare var MSProtocolsCollection: { - prototype: MSProtocolsCollection; - new(): MSProtocolsCollection; -} - -interface DOMStringList { - length: number; - contains(str: string): boolean; - item(index: number): string; - [index: number]: string; -} -declare var DOMStringList: { - prototype: DOMStringList; - new(): DOMStringList; -} - -interface CSSMultiColumnProperties { - breakAfter: string; - columnSpan: string; - columnRule: string; - columnFill: string; - columnRuleStyle: string; - breakBefore: string; - columnCount: any; - breakInside: string; - columnWidth: any; - columns: string; - columnRuleColor: any; - columnGap: any; - columnRuleWidth: any; -} - -interface IDBOpenDBRequest extends IDBRequest { - onupgradeneeded: (ev: IDBVersionChangeEvent) => any; - addEventListener(type: "upgradeneeded", listener: (ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void; - onblocked: (ev: Event) => any; - addEventListener(type: "blocked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var IDBOpenDBRequest: { - prototype: IDBOpenDBRequest; - new(): IDBOpenDBRequest; -} - -interface HTMLButtonElement { - validationMessage: string; - formTarget: string; - willValidate: boolean; - formAction: string; - autofocus: boolean; - validity: ValidityState; - formNoValidate: string; - formEnctype: string; - formMethod: string; - checkValidity(): boolean; - setCustomValidity(error: string): void; -} - -interface HTMLProgressElement extends HTMLElement { - value: number; - max: number; - position: number; - form: HTMLFormElement; -} -declare var HTMLProgressElement: { - prototype: HTMLProgressElement; - new(): HTMLProgressElement; -} - -interface SVGFEOffsetElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - dy: SVGAnimatedNumber; - in1: SVGAnimatedString; - dx: SVGAnimatedNumber; -} -declare var SVGFEOffsetElement: { - prototype: SVGFEOffsetElement; - new(): SVGFEOffsetElement; -} - -interface HTMLFormElement { - autocomplete: string; - noValidate: boolean; - checkValidity(): boolean; -} - -interface MSUnsafeFunctionCallback { - (): any; -} - -interface Document extends DocumentVisibility { -} - -interface MessageEvent extends Event { - ports: any; -} - -interface HTMLScriptElement { - async: boolean; -} - -interface HTMLMediaElement extends MSHTMLMediaElementExtensions { - textTracks: TextTrackList; - audioTracks: AudioTrackList; -} - -interface TextTrack extends EventTarget { - language: string; - mode: number; - readyState: string; - activeCues: TextTrackCueList; - cues: TextTrackCueList; - oncuechange: (ev: Event) => any; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - kind: string; - onload: (ev: any) => any; - addEventListener(type: "load", listener: (ev: any) => any, useCapture?: boolean): void; - onerror: (ev: ErrorEvent) => any; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - label: string; - ERROR: number; - SHOWING: number; - LOADING: number; - LOADED: number; - NONE: number; - HIDDEN: number; - DISABLED: number; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var TextTrack: { - prototype: TextTrack; - new(): TextTrack; - ERROR: number; - SHOWING: number; - LOADING: number; - LOADED: number; - NONE: number; - HIDDEN: number; - DISABLED: number; -} - -interface MediaQueryListListener { - (mql: MediaQueryList): void; -} - -interface IDBRequest extends EventTarget { - source: any; - onsuccess: (ev: Event) => any; - addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; - error: DOMError; - transaction: IDBTransaction; - onerror: (ev: ErrorEvent) => any; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - readyState: string; - result: any; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var IDBRequest: { - prototype: IDBRequest; - new(): IDBRequest; -} - -interface MessagePort extends EventTarget { - onmessage: (ev: any) => any; - addEventListener(type: "message", listener: (ev: any) => any, useCapture?: boolean): void; - close(): void; - postMessage(message: any, ports?: any): void; - start(): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var MessagePort: { - prototype: MessagePort; - new(): MessagePort; -} - -interface FileReader extends MSBaseReader { - error: DOMError; - readAsArrayBuffer(blob: Blob): void; - readAsDataURL(blob: Blob): void; - readAsText(blob: Blob, encoding?: string): void; -} -declare var FileReader: { - prototype: FileReader; - new (): FileReader; -} - -interface Blob { - type: string; - size: number; - msDetachStream(): any; - slice(start?: number, end?: number, contentType?: string): Blob; - close(): void; - msClose(): void; -} -interface BlobPropertyBag { - /** Corresponds to the 'type' property of the Blob object */ - type?: string; - /** Either 'transparent' or 'native' */ - endings?: string; -} -declare var Blob: { - prototype: Blob; - new (blobParts?: any[], options?: BlobPropertyBag): Blob; -} - -interface ApplicationCache extends EventTarget { - status: number; - ondownloading: (ev: Event) => any; - addEventListener(type: "downloading", listener: (ev: Event) => any, useCapture?: boolean): void; - onprogress: (ev: ProgressEvent) => any; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - onupdateready: (ev: Event) => any; - addEventListener(type: "updateready", listener: (ev: Event) => any, useCapture?: boolean): void; - oncached: (ev: Event) => any; - addEventListener(type: "cached", listener: (ev: Event) => any, useCapture?: boolean): void; - onobsolete: (ev: Event) => any; - addEventListener(type: "obsolete", listener: (ev: Event) => any, useCapture?: boolean): void; - onerror: (ev: ErrorEvent) => any; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - onchecking: (ev: Event) => any; - addEventListener(type: "checking", listener: (ev: Event) => any, useCapture?: boolean): void; - onnoupdate: (ev: Event) => any; - addEventListener(type: "noupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - swapCache(): void; - abort(): void; - update(): void; - CHECKING: number; - UNCACHED: number; - UPDATEREADY: number; - DOWNLOADING: number; - IDLE: number; - OBSOLETE: number; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var ApplicationCache: { - prototype: ApplicationCache; - new(): ApplicationCache; - CHECKING: number; - UNCACHED: number; - UPDATEREADY: number; - DOWNLOADING: number; - IDLE: number; - OBSOLETE: number; -} - -interface MSHTMLVideoElementExtensions { - msIsStereo3D: boolean; - msStereo3DPackingMode: string; - onMSVideoOptimalLayoutChanged: (ev: any) => any; - addEventListener(type: "MSVideoOptimalLayoutChanged", listener: (ev: any) => any, useCapture?: boolean): void; - onMSVideoFrameStepCompleted: (ev: any) => any; - addEventListener(type: "MSVideoFrameStepCompleted", listener: (ev: any) => any, useCapture?: boolean): void; - msStereo3DRenderMode: string; - msIsLayoutOptimalForPlayback: boolean; - msHorizontalMirror: boolean; - onMSVideoFormatChanged: (ev: any) => any; - addEventListener(type: "MSVideoFormatChanged", listener: (ev: any) => any, useCapture?: boolean): void; - msZoom: boolean; - msInsertVideoEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; - msSetVideoRectangle(left: number, top: number, right: number, bottom: number): void; - msFrameStep(forward: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface FrameRequestCallback { - (time: number): void; -} - -interface CSS3DTransformsProperties { - perspective: string; - msBackfaceVisibility: string; - perspectiveOrigin: string; - transformStyle: string; - backfaceVisibility: string; - msPerspectiveOrigin: string; - msTransformStyle: string; - msPerspective: string; -} - -interface XMLHttpRequest { - withCredentials: boolean; -} - -interface PopStateEvent extends Event { - state: any; - initPopStateEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, stateArg: any): void; -} -declare var PopStateEvent: { - prototype: PopStateEvent; - new(): PopStateEvent; -} - -interface CSSKeyframeRule extends CSSRule { - keyText: string; - style: CSSStyleDeclaration; -} -declare var CSSKeyframeRule: { - prototype: CSSKeyframeRule; - new(): CSSKeyframeRule; -} - -interface CSSGridProperties { - msGridRows: string; - msGridColumnSpan: any; - msGridRow: any; - msGridRowSpan: any; - msGridColumns: string; - msGridColumnAlign: string; - msGridRowAlign: string; - msGridColumn: any; -} - -interface MSFileSaver { - msSaveBlob(blob: any, defaultName?: string): boolean; - msSaveOrOpenBlob(blob: any, defaultName?: string): boolean; -} - -interface MSStream { - type: string; - msDetachStream(): any; - msClose(): void; -} -declare var MSStream: { - prototype: MSStream; - new(): MSStream; -} - -interface MediaError extends MSMediaErrorExtensions { -} - -interface HTMLFieldSetElement { - validationMessage: string; - validity: ValidityState; - willValidate: boolean; - checkValidity(): boolean; - setCustomValidity(error: string): void; -} - -interface MSBlobBuilder { - append(data: any, endings?: string): void; - getBlob(contentType?: string): Blob; -} -declare var MSBlobBuilder: { - prototype: MSBlobBuilder; - new (): MSBlobBuilder; -} - -interface MSRangeExtensions { - createContextualFragment(fragment: string): DocumentFragment; -} - -interface HTMLElement { - oncuechange: (ev: Event) => any; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - spellcheck: boolean; - classList: DOMTokenList; - draggable: boolean; -} - -interface DataTransfer { - types: DOMStringList; - files: FileList; -} - -interface DOMSettableTokenList extends DOMTokenList { - value: string; -} -declare var DOMSettableTokenList: { - prototype: DOMSettableTokenList; - new(): DOMSettableTokenList; -} - -interface IDBFactory { - open(name: string, version?: number): IDBOpenDBRequest; - cmp(first: any, second: any): number; - deleteDatabase(name: string): IDBOpenDBRequest; -} -declare var IDBFactory: { - prototype: IDBFactory; - new(): IDBFactory; -} - -interface Range extends MSRangeExtensions { -} - -interface HTMLObjectElement { - validationMessage: string; - validity: ValidityState; - willValidate: boolean; - checkValidity(): boolean; - setCustomValidity(error: string): void; -} - -interface MSPointerEvent extends MouseEvent { - width: number; - rotation: number; - pressure: number; - pointerType: number; - isPrimary: boolean; - tiltY: number; - height: number; - intermediatePoints: any; - currentPoint: any; - tiltX: number; - hwTimestamp: number; - pointerId: number; - initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: AbstractView, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: number, hwTimestampArg: number, isPrimary: boolean): void; - getCurrentPoint(element: Element): void; - getIntermediatePoints(element: Element): void; - MSPOINTER_TYPE_PEN: number; - MSPOINTER_TYPE_MOUSE: number; - MSPOINTER_TYPE_TOUCH: number; -} -declare var MSPointerEvent: { - prototype: MSPointerEvent; - new(): MSPointerEvent; - MSPOINTER_TYPE_PEN: number; - MSPOINTER_TYPE_MOUSE: number; - MSPOINTER_TYPE_TOUCH: number; -} - -interface CSSTextProperties { - textShadow: string; - msHyphenateLimitLines: any; - msHyphens: string; - msHyphenateLimitChars: string; - msHyphenateLimitZone: any; -} - -interface CSS2DTransformsProperties { - transform: string; - transformOrigin: string; -} - -interface DOMException { - name: string; - INVALID_NODE_TYPE_ERR: number; - DATA_CLONE_ERR: number; - TIMEOUT_ERR: number; -} -//declare var DOMException: { -// INVALID_NODE_TYPE_ERR: number; -// DATA_CLONE_ERR: number; -// TIMEOUT_ERR: number; -//} - -interface MSCSSHighContrastProperties { - msHighContrastAdjust: string; -} - -interface MSManipulationEvent extends UIEvent { - lastState: number; - currentState: number; - initMSManipulationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: AbstractView, detailArg: number, lastState: number, currentState: number): void; - MS_MANIPULATION_STATE_STOPPED: number; - MS_MANIPULATION_STATE_ACTIVE: number; - MS_MANIPULATION_STATE_INERTIA: number; -} -declare var MSManipulationEvent: { - prototype: MSManipulationEvent; - new(): MSManipulationEvent; - MS_MANIPULATION_STATE_STOPPED: number; - MS_MANIPULATION_STATE_ACTIVE: number; - MS_MANIPULATION_STATE_INERTIA: number; -} - -interface FormData { - append(name: any, value: any, blobName?: string): void; -} -declare var FormData: { - prototype: FormData; - new (form?: HTMLFormElement): FormData; -} - -interface MSHTMLImageElementExtensions { - msPlayToPrimary: boolean; - msPlayToDisabled: boolean; - msPlayToSource: any; -} -declare var MSHTMLImageElementExtensions: { - prototype: MSHTMLImageElementExtensions; - new(): MSHTMLImageElementExtensions; -} - -interface MSHTMLMediaElementExtensions { - msAudioCategory: string; - msRealTime: boolean; - msPlayToPrimary: boolean; - msPlayToDisabled: boolean; - msPlayToSource: any; - msAudioDeviceType: string; - msClearEffects(): void; - msSetMediaProtectionManager(mediaProtectionManager?: any): void; - msInsertAudioEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; -} - -interface SVGFEImageElement extends SVGElement, SVGLangSpace, SVGFilterPrimitiveStandardAttributes, SVGURIReference { - preserveAspectRatio: SVGAnimatedPreserveAspectRatio; -} -declare var SVGFEImageElement: { - prototype: SVGFEImageElement; - new(): SVGFEImageElement; -} - -interface HTMLDataListElement extends HTMLElement { - options: HTMLCollection; -} -declare var HTMLDataListElement: { - prototype: HTMLDataListElement; - new(): HTMLDataListElement; -} - -interface AbstractWorker extends EventTarget { - onerror: (ev: ErrorEvent) => any; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface SVGFECompositeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - operator: SVGAnimatedEnumeration; - in2: SVGAnimatedString; - k2: SVGAnimatedNumber; - k1: SVGAnimatedNumber; - k3: SVGAnimatedNumber; - in1: SVGAnimatedString; - k4: SVGAnimatedNumber; - SVG_FECOMPOSITE_OPERATOR_OUT: number; - SVG_FECOMPOSITE_OPERATOR_OVER: number; - SVG_FECOMPOSITE_OPERATOR_XOR: number; - SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; - SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; - SVG_FECOMPOSITE_OPERATOR_IN: number; - SVG_FECOMPOSITE_OPERATOR_ATOP: number; -} -declare var SVGFECompositeElement: { - prototype: SVGFECompositeElement; - new(): SVGFECompositeElement; - SVG_FECOMPOSITE_OPERATOR_OUT: number; - SVG_FECOMPOSITE_OPERATOR_OVER: number; - SVG_FECOMPOSITE_OPERATOR_XOR: number; - SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; - SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; - SVG_FECOMPOSITE_OPERATOR_IN: number; - SVG_FECOMPOSITE_OPERATOR_ATOP: number; -} - -interface ValidityState { - customError: boolean; - valueMissing: boolean; - stepMismatch: boolean; - rangeUnderflow: boolean; - rangeOverflow: boolean; - typeMismatch: boolean; - patternMismatch: boolean; - tooLong: boolean; - valid: boolean; -} -declare var ValidityState: { - prototype: ValidityState; - new(): ValidityState; -} - -interface HTMLVideoElement extends MSHTMLVideoElementExtensions { -} - -interface HTMLTrackElement extends HTMLElement { - kind: string; - src: string; - srclang: string; - track: TextTrack; - label: string; - defaul: boolean; -} -declare var HTMLTrackElement: { - prototype: HTMLTrackElement; - new(): HTMLTrackElement; -} - -interface MSApp { - createFileFromStorageFile(storageFile: any): File; - createBlobFromRandomAccessStream(type: string, seeker: any): Blob; - createStreamFromInputStream(type: string, inputStream: any): MSStream; - terminateApp(exceptionObject: any): void; - createDataPackage(object: any): any; - execUnsafeLocalFunction(unsafeFunction: MSUnsafeFunctionCallback): any; - getHtmlPrintDocumentSource(htmlDoc: any, printTemplate?: string): any; - addPublicLocalApplicationUri(uri: string): void; - createDataPackageFromSelection(): any; -} -declare var MSApp: MSApp; - -interface MSXMLHttpRequestExtensions { - response: any; - onprogress: (ev: ProgressEvent) => any; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - onabort: (ev: any) => any; - addEventListener(type: "abort", listener: (ev: any) => any, useCapture?: boolean): void; - responseType: string; - onloadend: (ev: ProgressEvent) => any; - addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - upload: XMLHttpRequestEventTarget; - onerror: (ev: ErrorEvent) => any; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - onloadstart: (ev: any) => any; - addEventListener(type: "loadstart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var MSXMLHttpRequestExtensions: { - prototype: MSXMLHttpRequestExtensions; - new(): MSXMLHttpRequestExtensions; -} - -interface SVGFEDiffuseLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - kernelUnitLengthY: SVGAnimatedNumber; - surfaceScale: SVGAnimatedNumber; - in1: SVGAnimatedString; - kernelUnitLengthX: SVGAnimatedNumber; - diffuseConstant: SVGAnimatedNumber; -} -declare var SVGFEDiffuseLightingElement: { - prototype: SVGFEDiffuseLightingElement; - new(): SVGFEDiffuseLightingElement; -} - -interface SVGFEComponentTransferElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in1: SVGAnimatedString; -} -declare var SVGFEComponentTransferElement: { - prototype: SVGFEComponentTransferElement; - new(): SVGFEComponentTransferElement; -} - -interface MSCSSMatrix { - m24: number; - m34: number; - a: number; - d: number; - m32: number; - m41: number; - m11: number; - f: number; - e: number; - m23: number; - m14: number; - m33: number; - m22: number; - m21: number; - c: number; - m12: number; - b: number; - m42: number; - m31: number; - m43: number; - m13: number; - m44: number; - multiply(secondMatrix: MSCSSMatrix): MSCSSMatrix; - skewY(angle: number): MSCSSMatrix; - setMatrixValue(value: string): void; - inverse(): MSCSSMatrix; - rotateAxisAngle(x: number, y: number, z: number, angle: number): MSCSSMatrix; - toString(): string; - rotate(angleX: number, angleY?: number, angleZ?: number): MSCSSMatrix; - translate(x: number, y: number, z?: number): MSCSSMatrix; - scale(scaleX: number, scaleY?: number, scaleZ?: number): MSCSSMatrix; - skewX(angle: number): MSCSSMatrix; -} -declare var MSCSSMatrix: { - prototype: MSCSSMatrix; - new (text?: string): MSCSSMatrix; -} - -interface Worker extends AbstractWorker { - onmessage: (ev: any) => any; - addEventListener(type: "message", listener: (ev: any) => any, useCapture?: boolean): void; - postMessage(message: any, ports?: any): void; - terminate(): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var Worker: { - prototype: Worker; - new (stringUrl: string): Worker; -} - -interface HTMLIFrameElement { - sandbox: DOMSettableTokenList; -} - -interface MSMediaErrorExtensions { - msExtendedCode: number; -} - -interface MSNavigatorAbilities { - msProtocols: MSProtocolsCollection; - msMaxTouchPoints: number; - msPointerEnabled: boolean; - msManipulationViewsEnabled: boolean; -} -declare var MSNavigatorAbilities: { - prototype: MSNavigatorAbilities; - new(): MSNavigatorAbilities; -} - -declare var onpopstate: (ev: PopStateEvent) => any; -declare function addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; -declare var applicationCache: ApplicationCache; -declare function matchMedia(mediaQuery: string): MediaQueryList; -declare function msMatchMedia(mediaQuery: string): MediaQueryList; -declare var animationStartTime: number; -declare var msAnimationStartTime: number; -declare function msCancelRequestAnimationFrame(handle: number): void; -declare function cancelAnimationFrame(handle: number): void; -declare function requestAnimationFrame(callback: FrameRequestCallback): number; -declare function msRequestAnimationFrame(callback: FrameRequestCallback): number; -declare function btoa(rawString: string): string; -declare function atob(encodedString: string): string; -declare var msIndexedDB: IDBFactory; -declare var indexedDB: IDBFactory; -declare var console: Console; - - -///////////////////////////// -/// WorkerGlobalScope APIs -///////////////////////////// -// TODO: These are only available in a Web Worker - should be in a separate lib file -declare function importScripts(...urls: string[]): void; - - -///////////////////////////// -/// Windows Script Host APIS -///////////////////////////// -declare var ActiveXObject: { new (s: string): any; }; - -interface ITextWriter { - Write(s: string): void; - WriteLine(s: string): void; - Close(): void; -} - -declare var WScript : { - Echo(s: any); - StdErr: ITextWriter; - StdOut: ITextWriter; - Arguments: { length: number; Item(n: number): string; }; - ScriptFullName: string; - Quit(exitCode?: number); -} diff --git a/_infrastructure/typescript/tsc b/_infrastructure/typescript/tsc deleted file mode 100644 index 3c0dab574..000000000 --- a/_infrastructure/typescript/tsc +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env node -require('./tsc.js') diff --git a/package.json b/package.json index eaed7a066..8044c470a 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,6 @@ "name": "DefinitelyTyped", "version": "0.0.0", "scripts": { - "test": "node ./_infrastructure/runner.js" + "test": "node ./_infrastructure/tests/runner.js" } } From ca5100a0c0489828a55af478ea88a9be74793792 Mon Sep 17 00:00:00 2001 From: Diullei Gomes Date: Thu, 20 Jun 2013 15:40:12 -0300 Subject: [PATCH 26/57] bug fixed. Travis CI script. --- _infrastructure/tests/runner.js | 512 +++++++++++++++++++++++++++++++- 1 file changed, 511 insertions(+), 1 deletion(-) diff --git a/_infrastructure/tests/runner.js b/_infrastructure/tests/runner.js index 7788858c6..8b1ff53dd 100644 --- a/_infrastructure/tests/runner.js +++ b/_infrastructure/tests/runner.js @@ -1,4 +1,514 @@ -var DefinitelyTyped; +var ExecResult = (function () { + function ExecResult() { + this.stdout = ""; + this.stderr = ""; + } + return ExecResult; +})(); + +var WindowsScriptHostExec = (function () { + function WindowsScriptHostExec() { + } + WindowsScriptHostExec.prototype.exec = function (filename, cmdLineArgs, handleResult) { + var result = new ExecResult(); + var shell = new ActiveXObject('WScript.Shell'); + try { + var process = shell.Exec(filename + ' ' + cmdLineArgs.join(' ')); + } catch (e) { + result.stderr = e.message; + result.exitCode = 1; + handleResult(result); + return; + } + + while (process.Status != 0) { + } + + result.exitCode = process.ExitCode; + if (!process.StdOut.AtEndOfStream) + result.stdout = process.StdOut.ReadAll(); + if (!process.StdErr.AtEndOfStream) + result.stderr = process.StdErr.ReadAll(); + + handleResult(result); + }; + return WindowsScriptHostExec; +})(); + +var NodeExec = (function () { + function NodeExec() { + } + NodeExec.prototype.exec = function (filename, cmdLineArgs, handleResult) { + var nodeExec = require('child_process').exec; + + var result = new ExecResult(); + result.exitCode = null; + var cmdLine = filename + ' ' + cmdLineArgs.join(' '); + + var process = nodeExec(cmdLine, function (error, stdout, stderr) { + result.stdout = stdout; + result.stderr = stderr; + result.exitCode = error ? error.code : 0; + handleResult(result); + }); + }; + return NodeExec; +})(); + +var Exec = (function () { + var global = Function("return this;").call(null); + if (typeof global.ActiveXObject !== "undefined") { + return new WindowsScriptHostExec(); + } else { + return new NodeExec(); + } +})(); +var IOUtils; +(function (IOUtils) { + function createDirectoryStructure(ioHost, dirName) { + if (ioHost.directoryExists(dirName)) { + return; + } + + var parentDirectory = ioHost.dirName(dirName); + if (parentDirectory != "") { + createDirectoryStructure(ioHost, parentDirectory); + } + ioHost.createDirectory(dirName); + } + + function createFileAndFolderStructure(ioHost, fileName, useUTF8) { + var path = ioHost.resolvePath(fileName); + var dirName = ioHost.dirName(path); + createDirectoryStructure(ioHost, dirName); + return ioHost.createFile(path, useUTF8); + } + IOUtils.createFileAndFolderStructure = createFileAndFolderStructure; + + function throwIOError(message, error) { + var errorMessage = message; + if (error && error.message) { + errorMessage += (" " + error.message); + } + throw new Error(errorMessage); + } + IOUtils.throwIOError = throwIOError; +})(IOUtils || (IOUtils = {})); + +var IO = (function () { + function getWindowsScriptHostIO() { + var fso = new ActiveXObject("Scripting.FileSystemObject"); + var streamObjectPool = []; + + function getStreamObject() { + if (streamObjectPool.length > 0) { + return streamObjectPool.pop(); + } else { + return new ActiveXObject("ADODB.Stream"); + } + } + + function releaseStreamObject(obj) { + streamObjectPool.push(obj); + } + + var args = []; + for (var i = 0; i < WScript.Arguments.length; i++) { + args[i] = WScript.Arguments.Item(i); + } + + return { + readFile: function (path) { + try { + var streamObj = getStreamObject(); + streamObj.Open(); + streamObj.Type = 2; + streamObj.Charset = 'x-ansi'; + streamObj.LoadFromFile(path); + var bomChar = streamObj.ReadText(2); + streamObj.Position = 0; + if ((bomChar.charCodeAt(0) == 0xFE && bomChar.charCodeAt(1) == 0xFF) || (bomChar.charCodeAt(0) == 0xFF && bomChar.charCodeAt(1) == 0xFE)) { + streamObj.Charset = 'unicode'; + } else if (bomChar.charCodeAt(0) == 0xEF && bomChar.charCodeAt(1) == 0xBB) { + streamObj.Charset = 'utf-8'; + } + + var str = streamObj.ReadText(-1); + streamObj.Close(); + releaseStreamObject(streamObj); + return str; + } catch (err) { + IOUtils.throwIOError("Error reading file \"" + path + "\".", err); + } + }, + writeFile: function (path, contents) { + var file = this.createFile(path); + file.Write(contents); + file.Close(); + }, + fileExists: function (path) { + return fso.FileExists(path); + }, + resolvePath: function (path) { + return fso.GetAbsolutePathName(path); + }, + dirName: function (path) { + return fso.GetParentFolderName(path); + }, + findFile: function (rootPath, partialFilePath) { + var path = fso.GetAbsolutePathName(rootPath) + "/" + partialFilePath; + + while (true) { + if (fso.FileExists(path)) { + try { + var content = this.readFile(path); + return { content: content, path: path }; + } catch (err) { + } + } else { + rootPath = fso.GetParentFolderName(fso.GetAbsolutePathName(rootPath)); + + if (rootPath == "") { + return null; + } else { + path = fso.BuildPath(rootPath, partialFilePath); + } + } + } + }, + deleteFile: function (path) { + try { + if (fso.FileExists(path)) { + fso.DeleteFile(path, true); + } + } catch (e) { + IOUtils.throwIOError("Couldn't delete file '" + path + "'.", e); + } + }, + createFile: function (path, useUTF8) { + try { + var streamObj = getStreamObject(); + streamObj.Charset = useUTF8 ? 'utf-8' : 'x-ansi'; + streamObj.Open(); + return { + Write: function (str) { + streamObj.WriteText(str, 0); + }, + WriteLine: function (str) { + streamObj.WriteText(str, 1); + }, + Close: function () { + try { + streamObj.SaveToFile(path, 2); + } catch (saveError) { + IOUtils.throwIOError("Couldn't write to file '" + path + "'.", saveError); + } finally { + if (streamObj.State != 0) { + streamObj.Close(); + } + releaseStreamObject(streamObj); + } + } + }; + } catch (creationError) { + IOUtils.throwIOError("Couldn't write to file '" + path + "'.", creationError); + } + }, + directoryExists: function (path) { + return fso.FolderExists(path); + }, + createDirectory: function (path) { + try { + if (!this.directoryExists(path)) { + fso.CreateFolder(path); + } + } catch (e) { + IOUtils.throwIOError("Couldn't create directory '" + path + "'.", e); + } + }, + dir: function (path, spec, options) { + options = options || {}; + function filesInFolder(folder, root) { + var paths = []; + var fc; + + if (options.recursive) { + fc = new Enumerator(folder.subfolders); + + for (; !fc.atEnd(); fc.moveNext()) { + paths = paths.concat(filesInFolder(fc.item(), root + "/" + fc.item().Name)); + } + } + + fc = new Enumerator(folder.files); + + for (; !fc.atEnd(); fc.moveNext()) { + if (!spec || fc.item().Name.match(spec)) { + paths.push(root + "/" + fc.item().Name); + } + } + + return paths; + } + + var folder = fso.GetFolder(path); + var paths = []; + + return filesInFolder(folder, path); + }, + print: function (str) { + WScript.StdOut.Write(str); + }, + printLine: function (str) { + WScript.Echo(str); + }, + arguments: args, + stderr: WScript.StdErr, + stdout: WScript.StdOut, + watchFile: null, + run: function (source, filename) { + try { + eval(source); + } catch (e) { + IOUtils.throwIOError("Error while executing file '" + filename + "'.", e); + } + }, + getExecutingFilePath: function () { + return WScript.ScriptFullName; + }, + quit: function (exitCode) { + if (typeof exitCode === "undefined") { exitCode = 0; } + try { + WScript.Quit(exitCode); + } catch (e) { + } + } + }; + } + ; + + function getNodeIO() { + var _fs = require('fs'); + var _path = require('path'); + var _module = require('module'); + + return { + readFile: function (file) { + try { + var buffer = _fs.readFileSync(file); + switch (buffer[0]) { + case 0xFE: + if (buffer[1] == 0xFF) { + var i = 0; + while ((i + 1) < buffer.length) { + var temp = buffer[i]; + buffer[i] = buffer[i + 1]; + buffer[i + 1] = temp; + i += 2; + } + return buffer.toString("ucs2", 2); + } + break; + case 0xFF: + if (buffer[1] == 0xFE) { + return buffer.toString("ucs2", 2); + } + break; + case 0xEF: + if (buffer[1] == 0xBB) { + return buffer.toString("utf8", 3); + } + } + + return buffer.toString(); + } catch (e) { + IOUtils.throwIOError("Error reading file \"" + file + "\".", e); + } + }, + writeFile: _fs.writeFileSync, + deleteFile: function (path) { + try { + _fs.unlinkSync(path); + } catch (e) { + IOUtils.throwIOError("Couldn't delete file '" + path + "'.", e); + } + }, + fileExists: function (path) { + return _fs.existsSync(path); + }, + createFile: function (path, useUTF8) { + function mkdirRecursiveSync(path) { + var stats = _fs.statSync(path); + if (stats.isFile()) { + IOUtils.throwIOError("\"" + path + "\" exists but isn't a directory.", null); + } else if (stats.isDirectory()) { + return; + } else { + mkdirRecursiveSync(_path.dirname(path)); + _fs.mkdirSync(path, 0775); + } + } + + mkdirRecursiveSync(_path.dirname(path)); + + try { + var fd = _fs.openSync(path, 'w'); + } catch (e) { + IOUtils.throwIOError("Couldn't write to file '" + path + "'.", e); + } + return { + Write: function (str) { + _fs.writeSync(fd, str); + }, + WriteLine: function (str) { + _fs.writeSync(fd, str + '\r\n'); + }, + Close: function () { + _fs.closeSync(fd); + fd = null; + } + }; + }, + dir: function dir(path, spec, options) { + options = options || {}; + + function filesInFolder(folder, deep) { + var paths = []; + + var files = _fs.readdirSync(folder); + for (var i = 0; i < files.length; i++) { + var stat = _fs.statSync(folder + "/" + files[i]); + if (options.recursive && stat.isDirectory()) { + if (deep < (options.deep || 100)) { + paths = paths.concat(filesInFolder(folder + "/" + files[i], 1)); + } + } else if (stat.isFile() && (!spec || files[i].match(spec))) { + paths.push(folder + "/" + files[i]); + } + } + + return paths; + } + + return filesInFolder(path, 0); + }, + createDirectory: function (path) { + try { + if (!this.directoryExists(path)) { + _fs.mkdirSync(path); + } + } catch (e) { + IOUtils.throwIOError("Couldn't create directory '" + path + "'.", e); + } + }, + directoryExists: function (path) { + return _fs.existsSync(path) && _fs.lstatSync(path).isDirectory(); + }, + resolvePath: function (path) { + return _path.resolve(path); + }, + dirName: function (path) { + return _path.dirname(path); + }, + findFile: function (rootPath, partialFilePath) { + var path = rootPath + "/" + partialFilePath; + + while (true) { + if (_fs.existsSync(path)) { + try { + var content = this.readFile(path); + return { content: content, path: path }; + } catch (err) { + } + } else { + var parentPath = _path.resolve(rootPath, ".."); + + if (rootPath === parentPath) { + return null; + } else { + rootPath = parentPath; + path = _path.resolve(rootPath, partialFilePath); + } + } + } + }, + print: function (str) { + process.stdout.write(str); + }, + printLine: function (str) { + process.stdout.write(str + '\n'); + }, + arguments: process.argv.slice(2), + stderr: { + Write: function (str) { + process.stderr.write(str); + }, + WriteLine: function (str) { + process.stderr.write(str + '\n'); + }, + Close: function () { + } + }, + stdout: { + Write: function (str) { + process.stdout.write(str); + }, + WriteLine: function (str) { + process.stdout.write(str + '\n'); + }, + Close: function () { + } + }, + watchFile: function (filename, callback) { + var firstRun = true; + var processingChange = false; + + var fileChanged = function (curr, prev) { + if (!firstRun) { + if (curr.mtime < prev.mtime) { + return; + } + + _fs.unwatchFile(filename, fileChanged); + if (!processingChange) { + processingChange = true; + callback(filename); + setTimeout(function () { + processingChange = false; + }, 100); + } + } + firstRun = false; + _fs.watchFile(filename, { persistent: true, interval: 500 }, fileChanged); + }; + + fileChanged(); + return { + filename: filename, + close: function () { + _fs.unwatchFile(filename, fileChanged); + } + }; + }, + run: function (source, filename) { + require.main.filename = filename; + require.main.paths = _module._nodeModulePaths(_path.dirname(_fs.realpathSync(filename))); + require.main._compile(source, filename); + }, + getExecutingFilePath: function () { + return process.mainModule.filename; + }, + quit: process.exit + }; + } + ; + + if (typeof ActiveXObject === "function") + return getWindowsScriptHostIO(); else if (typeof require === "function") + return getNodeIO(); else + return null; +})(); +var DefinitelyTyped; (function (DefinitelyTyped) { (function (TestManager) { var path = require('path'); From 12116b890fe5b0ff86edad130c44c34a9a9b9d9a Mon Sep 17 00:00:00 2001 From: Neil Stalker Date: Thu, 20 Jun 2013 20:11:40 +0100 Subject: [PATCH 27/57] Update d3 --- d3/d3-tests.ts | 1344 ++++++++++++++++++- d3/d3.d.ts | 3436 ++++++++++++++++++++++++++++++++++-------------- 2 files changed, 3782 insertions(+), 998 deletions(-) diff --git a/d3/d3-tests.ts b/d3/d3-tests.ts index 1581cdb71..872432f34 100644 --- a/d3/d3-tests.ts +++ b/d3/d3-tests.ts @@ -48,7 +48,7 @@ function testPieChart() { } //Example from http://bl.ocks.org/3887051 -function groupedBarChart() => { +function groupedBarChart() { var margin = { top: 20, right: 20, bottom: 30, left: 40 }, width = 960 - margin.left - margin.right, height = 500 - margin.top - margin.bottom; @@ -105,7 +105,7 @@ function groupedBarChart() => { .style("text-anchor", "end") .text("Population"); - var state = svg.selectAll(".state") + var state = svg.selectAll(".state") .data(data) .enter().append("g") .attr("class", "g") @@ -487,7 +487,7 @@ function callenderView() { } // example from http://bl.ocks.org/3883245 -function lineChart { +function lineChart() { var margin = { top: 20, right: 20, bottom: 30, left: 50 }, width = 960 - margin.left - margin.right, height = 500 - margin.top - margin.bottom; @@ -550,7 +550,7 @@ function lineChart { } //example from http://bl.ocks.org/3884914 -function bivariateAreaChart { +function bivariateAreaChart() { var margin = { top: 20, right: 20, bottom: 30, left: 50 }, width = 960 - margin.left - margin.right, height = 500 - margin.top - margin.bottom; @@ -590,7 +590,7 @@ function bivariateAreaChart { }); x.domain(d3.extent(data, function (d) { return d.date; })); - y.domain([d3.min(data, function (d) { return d.low; }), d3.max(data, function (d) { return d.high; })]); + y.domain([d3.min(data, function (d) { return d.low; }), d3.max(data, function (d) { return d.high; })]); svg.append("path") .datum(data) @@ -610,12 +610,12 @@ function bivariateAreaChart { .attr("y", 6) .attr("dy", ".71em") .style("text-anchor", "end") - .text("Temperature (ºF)"); + .text("Temperature (ºF)"); }); } //Example from http://bl.ocks.org/mbostock/1557377 -function dragMultiples { +function dragMultiples() { var width = 238, height = 123, radius = 20; @@ -644,7 +644,7 @@ function dragMultiples { } //Example from http://bl.ocks.org/mbostock/3892919 -function panAndZoom { +function panAndZoom() { var margin = { top: 20, right: 20, bottom: 30, left: 40 }, width = 960 - margin.left - margin.right, height = 500 - margin.top - margin.bottom; @@ -729,3 +729,1331 @@ function chainedTransitions() { }; } } + +//Example from http://bl.ocks.org/mbostock/4062085 +function populationPyramid() { + var margin = { top: 20, right: 40, bottom: 30, left: 20 }, + width = 960 - margin.left - margin.right, + height = 500 - margin.top - margin.bottom, + barWidth = Math.floor(width / 19) - 1; + + var x = d3.scale.linear() + .range([barWidth / 2, width - barWidth / 2]); + + var y = d3.scale.linear() + .range([height, 0]); + + var yAxis = d3.svg.axis() + .scale(y) + .orient("right") + .tickSize(-width) + .tickFormat(function (d) { return Math.round(d / 1e6) + "M"; } ); + + // An SVG element with a bottom-right origin. + var svg = d3.select("body").append("svg") + .attr("width", width + margin.left + margin.right) + .attr("height", height + margin.top + margin.bottom) + .append("g") + .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); + + // A sliding container to hold the bars by birthyear. + var birthyears = svg.append("g") + .attr("class", "birthyears"); + + // A label for the current year. + var title = svg.append("text") + .attr("class", "title") + .attr("dy", ".71em") + .text(2000); + + d3.csv("population.csv", function (error, data) { + + // Convert strings to numbers. + data.forEach(function (d) { + d.people = +d.people; + d.year = +d.year; + d.age = +d.age; + } ); + + // Compute the extent of the data set in age and years. + var age1 = d3.max(data, function (d) { return d.age; } ), + year0 = d3.min(data, function (d) { return d.year; } ), + year1 = d3.max(data, function (d) { return d.year; } ), + year = year1; + + // Update the scale domains. + x.domain([year1 - age1, year1]); + y.domain([0, d3.max(data, function (d) { return d.people; } )]); + + // Produce a map from year and birthyear to [male, female]. + data = d3.nest() + .key(function (d) { return d.year; } ) + .key(function (d) { return d.year - d.age; } ) + .rollup(function (v) { return v.map(function (d) { return d.people; } ); } ) + .map(data); + + // Add an axis to show the population values. + svg.append("g") + .attr("class", "y axis") + .attr("transform", "translate(" + width + ",0)") + .call(yAxis) + .selectAll("g") + .filter(function (value) { return !value; } ) + .classed("zero", true); + + // Add labeled rects for each birthyear (so that no enter or exit is required). + var birthyear = birthyears.selectAll(".birthyear") + .data(d3.range(year0 - age1, year1 + 1, 5)) + .enter().append("g") + .attr("class", "birthyear") + .attr("transform", function (birthyear) { return "translate(" + x(birthyear) + ",0)"; } ); + + birthyear.selectAll("rect") + .data(function (birthyear) { return data[year][birthyear] || [0, 0]; } ) + .enter().append("rect") + .attr("x", -barWidth / 2) + .attr("width", barWidth) + .attr("y", y) + .attr("height", function (value) { return height - y(value); } ); + + // Add labels to show birthyear. + birthyear.append("text") + .attr("y", height - 4) + .text(function (birthyear) { return birthyear; } ); + + // Add labels to show age (separate; not animated). + svg.selectAll(".age") + .data(d3.range(0, age1 + 1, 5)) + .enter().append("text") + .attr("class", "age") + .attr("x", function (age) { return x(year - age); } ) + .attr("y", height + 4) + .attr("dy", ".71em") + .text(function (age) { return age; } ); + + // Allow the arrow keys to change the displayed year. + window.focus(); + d3.select(window).on("keydown", function () { + switch (d3.event.keyCode) { + case 37: year = Math.max(year0, year - 10); break; + case 39: year = Math.min(year1, year + 10); break; + } + update(); + } ); + + function update() { + if (!(year in data)) return; + title.text(year); + + birthyears.transition() + .duration(750) + .attr("transform", "translate(" + (x(year1) - x(year)) + ",0)"); + + birthyear.selectAll("rect") + .data(function (birthyear) { return data[year][birthyear] || [0, 0]; } ) + .transition() + .duration(750) + .attr("y", y) + .attr("height", function (value) { return height - y(value); } ); + } + } ); +} + +//Example from http://bl.ocks.org/MoritzStefaner/1377729 +function forcedBasedLabelPlacemant() { + var w = 960, h = 500; + + var labelDistance = 0; + + var vis = d3.select("body").append("svg:svg").attr("width", w).attr("height", h); + + var nodes = []; + var labelAnchors = []; + var labelAnchorLinks = []; + var links = []; + + for (var i = 0; i < 30; i++) { + var nodeLabel = { + label: "node " + i + }; + nodes.push(nodeLabel); + labelAnchors.push({ + node: nodeLabel + }); + labelAnchors.push({ + node: nodeLabel + }); + }; + + for (var i = 0; i < nodes.length; i++) { + for (var j = 0; j < i; j++) { + if (Math.random() > .95) + links.push({ + source: i, + target: j, + weight: Math.random() + }); + } + labelAnchorLinks.push({ + source: i * 2, + target: i * 2 + 1, + weight: 1 + }); + }; + + var force = d3.layout.force().size([w, h]).nodes(nodes).links(links).gravity(1).linkDistance(50).charge(-3000).linkStrength(function (x) { + return x.weight * 10 + } ); + + + force.start(); + + var force2 = d3.layout.force().nodes(labelAnchors).links(labelAnchorLinks).gravity(0).linkDistance(0).linkStrength(8).charge(-100).size([w, h]); + force2.start(); + + var link = vis.selectAll("line.link").data(links).enter().append("svg:line").attr("class", "link").style("stroke", "#CCC"); + + var node = vis.selectAll("g.node").data(force.nodes()).enter().append("svg:g").attr("class", "node"); + node.append("svg:circle").attr("r", 5).style("fill", "#555").style("stroke", "#FFF").style("stroke-width", 3); + node.call(force.drag); + + + var anchorLink = vis.selectAll("line.anchorLink").data(labelAnchorLinks)//.enter().append("svg:line").attr("class", "anchorLink").style("stroke", "#999"); + + var anchorNode = vis.selectAll("g.anchorNode").data(force2.nodes()).enter().append("svg:g").attr("class", "anchorNode"); + anchorNode.append("svg:circle").attr("r", 0).style("fill", "#FFF"); + anchorNode.append("svg:text").text(function (d, i) { + return i % 2 == 0 ? "" : d.node.label + } ).style("fill", "#555").style("font-family", "Arial").style("font-size", 12); + + var updateLink = function () { + this.attr("x1", function (d) { + return d.source.x; + } ).attr("y1", function (d) { + return d.source.y; + } ).attr("x2", function (d) { + return d.target.x; + } ).attr("y2", function (d) { + return d.target.y; + } ); + + } + + var updateNode = function () { + this.attr("transform", function (d) { + return "translate(" + d.x + "," + d.y + ")"; + } ); + + } + + force.on("tick", function () { + + force2.start(); + + node.call(updateNode); + + anchorNode.each(function (d, i) { + if (i % 2 == 0) { + d.x = d.node.x; + d.y = d.node.y; + } else { + var b = this.childNodes[1].getBBox(); + + var diffX = d.x - d.node.x; + var diffY = d.y - d.node.y; + + var dist = Math.sqrt(diffX * diffX + diffY * diffY); + + var shiftX = b.width * (diffX - dist) / (dist * 2); + shiftX = Math.max(-b.width, Math.min(0, shiftX)); + var shiftY = 5; + this.childNodes[1].setAttribute("transform", "translate(" + shiftX + "," + shiftY + ")"); + } + } ); + + + anchorNode.call(updateNode); + + link.call(updateLink); + anchorLink.call(updateLink); + + } ); +} + +//Example from http://bl.ocks.org/mbostock/1125997 +function forceCollapsable() { + var w = 1280, + h = 800, + node, + link, + root; + + var force = d3.layout.force() + .on("tick", tick) + .charge(function (d) { return d._children ? -d.size / 100 : -30; } ) + .linkDistance(function (d) { return d.target._children ? 80 : 30; } ) + .size([w, h - 160]); + + var vis = d3.select("body").append("svg:svg") + .attr("width", w) + .attr("height", h); + + d3.json("flare.json", function (json) { + root = json; + root.fixed = true; + root.x = w / 2; + root.y = h / 2 - 80; + update(); + } ); + + function update() { + var nodes = flatten(root), + links = d3.layout.tree().links(nodes); + + // Restart the force layout. + force + .nodes(nodes) + .links(links) + .start(); + + // Update the links… + link = vis.selectAll("line.link") + .data(links, function (d) { return d.target.id; } ); + + // Enter any new links. + link.enter().insert("svg:line", ".node") + .attr("class", "link") + .attr("x1", function (d) { return d.source.x; } ) + .attr("y1", function (d) { return d.source.y; } ) + .attr("x2", function (d) { return d.target.x; } ) + .attr("y2", function (d) { return d.target.y; } ); + + // Exit any old links. + link.exit().remove(); + + // Update the nodes… + node = vis.selectAll("circle.node") + .data(nodes, function (d) { return d.id; } ) + .style("fill", color); + + node.transition() + .attr("r", function (d) { return d.children ? 4.5 : Math.sqrt(d.size) / 10; } ); + + // Enter any new nodes. + node.enter().append("svg:circle") + .attr("class", "node") + .attr("cx", function (d) { return d.x; } ) + .attr("cy", function (d) { return d.y; } ) + .attr("r", function (d) { return d.children ? 4.5 : Math.sqrt(d.size) / 10; } ) + .style("fill", color) + .on("click", click) + .call(force.drag); + + // Exit any old nodes. + node.exit().remove(); + } + + function tick() { + link.attr("x1", function (d) { return d.source.x; } ) + .attr("y1", function (d) { return d.source.y; } ) + .attr("x2", function (d) { return d.target.x; } ) + .attr("y2", function (d) { return d.target.y; } ); + + node.attr("cx", function (d) { return d.x; } ) + .attr("cy", function (d) { return d.y; } ); + } + + // Color leaf nodes orange, and packages white or blue. + function color(d) { + return d._children ? "#3182bd" : d.children ? "#c6dbef" : "#fd8d3c"; + } + + // Toggle children on click. + function click(d) { + if (d.children) { + d._children = d.children; + d.children = null; + } else { + d.children = d._children; + d._children = null; + } + update(); + } + + // Returns a list of all nodes under the root. + function flatten(root) { + var nodes = [], i = 0; + + function recurse(node) { + if (node.children) node.size = node.children.reduce(function (p, v) { return p + recurse(v); } , 0); + if (!node.id) node.id = ++i; + nodes.push(node); + return node.size; + } + + root.size = recurse(root); + return nodes; + } +} + +//Example from http://bl.ocks.org/mbostock/3757110 +function azimuthalEquidistant() { + var width = 960, + height = 960; + var topojson: any; + + var projection = d3.geo.azimuthalEquidistant() + .scale(150) + .translate([width / 2, height / 2]) + .clipAngle(180 - 1e-3) + .precision(.1); + + var path = d3.geo.path() + .projection(projection); + + var graticule = d3.geo.graticule(); + + var svg = d3.select("body").append("svg") + .attr("width", width) + .attr("height", height); + + svg.append("defs").append("path") + .datum({ type: "Sphere" }) + .attr("id", "sphere") + .attr("d", path); + + svg.append("use") + .attr("class", "stroke") + .attr("xlink:href", "#sphere"); + + svg.append("use") + .attr("class", "fill") + .attr("xlink:href", "#sphere"); + + svg.append("path") + .datum(graticule) + .attr("class", "graticule") + .attr("d", path); + + d3.json("/mbostock/raw/4090846/world-50m.json", function (error, world) { + svg.insert("path", ".graticule") + .datum(topojson.feature(world, world.objects.land)) + .attr("class", "land") + .attr("d", path); + + svg.insert("path", ".graticule") + .datum(topojson.mesh(world, world.objects.countries, function (a, b) { return a !== b; } )) + .attr("class", "boundary") + .attr("d", path); + } ); + + d3.select(self.frameElement).style("height", height + "px"); +} + +//Example from http://bl.ocks.org/mbostock/4060366 +function voroniTesselation() { + var width = 960, + height = 500; + + var vertices = >d3.range(100).map(function (d) { + return [Math.random() * width, Math.random() * height]; + } ); + + var svg = d3.select("body").append("svg") + .attr("width", width) + .attr("height", height) + .attr("class", "PiYG") + .on("mousemove", function () { vertices[0] = d3.mouse(this); redraw(); } ); + + var path = svg.append("g").selectAll("path"); + + svg.selectAll("circle") + .data(vertices.slice(1)) + .enter().append("circle") + .attr("transform", function (d) { return "translate(" + d + ")"; } ) + .attr("r", 2); + + redraw(); + + function redraw() { + path = path.data(d3.geom.voronoi(vertices).map(function (d) { return "M" + d.join("L") + "Z"; } ), String); + path.exit().remove(); + path.enter().append("path").attr("class", function (d, i) { return "q" + (i % 9) + "-9"; } ).attr("d", String); + path.order(); + } +} + +//Example from http://bl.ocks.org/mbostock/4341156 +function delaunayTesselation() { + var width = 960, + height = 500; + + var vertices = >d3.range(100).map(function (d) { + return [Math.random() * width, Math.random() * height]; + } ); + + var svg = d3.select("body").append("svg") + .attr("width", width) + .attr("height", height) + .attr("class", "PiYG") + .on("mousemove", function () { vertices[0] = d3.mouse(this); redraw(); } ); + + var path = svg.append("g").selectAll("path"); + + svg.selectAll("circle") + .data(vertices.slice(1)) + .enter().append("circle") + .attr("transform", function (d) { return "translate(" + d + ")"; } ) + .attr("r", 2); + + redraw(); + + function redraw() { + path = path.data(d3.geom.delaunay(vertices).map(function (d) { return "M" + d.join("L") + "Z"; } ), String); + path.exit().remove(); + path.enter().append("path").attr("class", function (d, i) { return "q" + (i % 9) + "-9"; } ).attr("d", String); + } +} + +//Example from http://bl.ocks.org/mbostock/4343214 +function quadtree() { + var width = 960, + height = 500; + + var data = d3.range(5000).map(function () { + return { x: Math.random() * width, y: Math.random() * width }; + } ); + + var quadtree = d3.geom.quadtree(data, -1, -1, width + 1, height + 1); + + var brush = d3.svg.brush() + .x(d3.scale.identity().domain([0, width])) + .y(d3.scale.identity().domain([0, height])) + .on("brush", brushed) + .extent([[100, 100], [200, 200]]); + + var svg = d3.select("body").append("svg") + .attr("width", width) + .attr("height", height); + + svg.selectAll(".node") + .data(nodes(quadtree)) + .enter().append("rect") + .attr("class", "node") + .attr("x", function (d) { return d.x; } ) + .attr("y", function (d) { return d.y; } ) + .attr("width", function (d) { return d.width; } ) + .attr("height", function (d) { return d.height; } ); + + var point = svg.selectAll(".point") + .data(data) + .enter().append("circle") + .attr("class", "point") + .attr("cx", function (d) { return d.x; } ) + .attr("cy", function (d) { return d.y; } ) + .attr("r", 4); + + svg.append("g") + .attr("class", "brush") + .call(brush); + + brushed(); + + function brushed() { + var extent = brush.extent(); + point.each(function (d) { d.scanned = d.selected = false; } ); + search(quadtree, extent[0][0], extent[0][1], extent[1][0], extent[1][1]); + point.classed("scanned", function (d) { return d.scanned; } ); + point.classed("selected", function (d) { return d.selected; } ); + } + + // Collapse the quadtree into an array of rectangles. + function nodes(quadtree) { + var nodes = []; + quadtree.visit(function (node, x1, y1, x2, y2) { + nodes.push({ x: x1, y: y1, width: x2 - x1, height: y2 - y1 }); + } ); + return nodes; + } + + // Find the nodes within the specified rectangle. + function search(quadtree, x0, y0, x3, y3) { + quadtree.visit(function (node, x1, y1, x2, y2) { + var p = node.point; + if (p) { + p.scanned = true; + p.selected = (p.x >= x0) && (p.x < x3) && (p.y >= y0) && (p.y < y3); + } + return x1 >= x3 || y1 >= y3 || x2 < x0 || y2 < y0; + } ); + } +} + +//Example from http://bl.ocks.org/mbostock/4341699 +function convexHull() { + var width = 960, + height = 500; + + var randomX = d3.random.normal(width / 2, 60), + randomY = d3.random.normal(height / 2, 60), + vertices = d3.range(100).map(function () { return [randomX(), randomY()]; } ); + + var svg = d3.select("body").append("svg") + .attr("width", width) + .attr("height", height) + .on("mousemove", function () { vertices[0] = d3.mouse(this); redraw(); } ) + .on("click", function () { vertices.push(d3.mouse(this)); redraw(); } ); + + svg.append("rect") + .attr("width", width) + .attr("height", height); + + var hull = svg.append("path") + .attr("class", "hull"); + + var circle = svg.selectAll("circle"); + + redraw(); + + function redraw() { + hull.datum(d3.geom.hull(vertices)).attr("d", function (d) { return "M" + d.join("L") + "Z"; } ); + circle = circle.data(vertices); + circle.enter().append("circle").attr("r", 3); + circle.attr("transform", function (d) { return "translate(" + d + ")"; } ); + } +} + +// example from http://bl.ocks.org/mbostock/1044242 +function hierarchicalEdgeBundling() { + var diameter = 960, + radius = diameter / 2, + innerRadius = radius - 120; + + var cluster = d3.layout.cluster() + .size([360, innerRadius]) + .sort(null) + .value(function (d) { return d.size; } ); + + var bundle = d3.layout.bundle(); + + var line = d3.svg.line.radial() + .interpolate("bundle") + .tension(.85) + .radius(function (d) { return d.y; } ) + .angle(function (d) { return d.x / 180 * Math.PI; } ); + + var svg = d3.select("body").append("svg") + .attr("width", diameter) + .attr("height", diameter) + .append("g") + .attr("transform", "translate(" + radius + "," + radius + ")"); + + d3.json("readme-flare-imports.json", function (error, classes) { + var nodes = cluster.nodes(packages.root(classes)), + links = packages.imports(nodes); + + svg.selectAll(".link") + .data(bundle(links)) + .enter().append("path") + .attr("class", "link") + .attr("d", line); + + svg.selectAll(".node") + .data(nodes.filter(function (n) { return !n.children; } )) + .enter().append("g") + .attr("class", "node") + .attr("transform", function (d) { return "rotate(" + (d.x - 90) + ")translate(" + d.y + ")"; } ) + .append("text") + .attr("dx", function (d) { return d.x < 180 ? 8 : -8; } ) + .attr("dy", ".31em") + .attr("text-anchor", function (d) { return d.x < 180 ? "start" : "end"; } ) + .attr("transform", function (d) { return d.x < 180 ? null : "rotate(180)"; } ) + .text(function (d) { return d.key; } ); + } ); + + d3.select(self.frameElement).style("height", diameter + "px"); + + var packages = { + + // Lazily construct the package hierarchy from class names. + root: function (classes) { + var map = {}; + + function find(name, data?) { + var node = map[name], i; + if (!node) { + node = map[name] = data || { name: name, children: [] }; + if (name.length) { + node.parent = find(name.substring(0, i = name.lastIndexOf("."))); + node.parent.children.push(node); + node.key = name.substring(i + 1); + } + } + return node; + } + + classes.forEach(function (d) { + find(d.name, d); + } ); + + return map[""]; + } , + + // Return a list of imports for the given array of nodes. + imports: function (nodes) { + var map = {}, + imports = []; + + // Compute a map from name to node. + nodes.forEach(function (d) { + map[d.name] = d; + } ); + + // For each import, construct a link from the source to target node. + nodes.forEach(function (d) { + if (d.imports) d.imports.forEach(function (i) { + imports.push({ source: map[d.name], target: map[i] }); + } ); + } ); + + return imports; + } + }; +} + +// example from http://bl.ocks.org/mbostock/1123639 +function roundedRectangles() { + var mouse = [480, 250], + count = 0; + + var svg = d3.select("body").append("svg:svg") + .attr("width", 960) + .attr("height", 500); + + var g = svg.selectAll("g") + .data(d3.range(25)) + .enter().append("svg:g") + .attr("transform", "translate(" + mouse + ")"); + + g.append("svg:rect") + .attr("rx", 6) + .attr("ry", 6) + .attr("x", -12.5) + .attr("y", -12.5) + .attr("width", 25) + .attr("height", 25) + .attr("transform", function (d, i) { return "scale(" + (1 - d / 25) * 20 + ")"; } ) + .style("fill", d3.scale.category20c()); + + g.map(function (d) { + return { center: [0, 0], angle: 0 }; + } ); + + svg.on("mousemove", function () { + mouse = d3.mouse(this); + } ); + + d3.timer(function () { + count++; + g.attr("transform", function (d, i) { + d.center[0] += (mouse[0] - d.center[0]) / (i + 5); + d.center[1] += (mouse[1] - d.center[1]) / (i + 5); + d.angle += Math.sin((count + i) / 10) * 7; + return "translate(" + d.center + ")rotate(" + d.angle + ")"; + } ); + return true; + } ); +} + +// example from http://bl.ocks.org/mbostock/4060954 +function streamGraph() { + var n = 20, // number of layers + m = 200, // number of samples per layer + stack = d3.layout.stack().offset("wiggle"), + layers0 = stack(d3.range(n).map(function () { return bumpLayer(m); } )), + layers1 = stack(d3.range(n).map(function () { return bumpLayer(m); } )); + + var width = 960, + height = 500; + + var x = d3.scale.linear() + .domain([0, m - 1]) + .range([0, width]); + + var y = d3.scale.linear() + .domain([0, d3.max(layers0.concat(layers1), function (layer) { return d3.max(layer, function (d) { return d.y0 + d.y; } ); } )]) + .range([height, 0]); + + var color = d3.scale.linear() + .range(["#aad", "#556"]); + + var area = d3.svg.area() + .x(function (d) { return x(d.x); } ) + .y0(function (d) { return y(d.y0); } ) + .y1(function (d) { return y(d.y0 + d.y); } ); + + var svg = d3.select("body").append("svg") + .attr("width", width) + .attr("height", height); + + svg.selectAll("path") + .data(layers0) + .enter().append("path") + .attr("d", area) + .style("fill", function () { return color(Math.random()); } ); + + function transition() { + d3.selectAll("path") + .data(function () { + var d = layers1; + layers1 = layers0; + return layers0 = d; + } ) + .transition() + .duration(2500) + .attr("d", area); + } + + // Inspired by Lee Byron's test data generator. + function bumpLayer(n) { + + function bump(a) { + var x = 1 / (.1 + Math.random()), + y = 2 * Math.random() - .5, + z = 10 / (.1 + Math.random()); + for (var i = 0; i < n; i++) { + var w = (i / n - y) * z; + a[i] += x * Math.exp(-w * w); + } + } + + var a = [], i; + for (i = 0; i < n; ++i) a[i] = 0; + for (i = 0; i < 5; ++i) bump(a); + return a.map(function (d, i) { return { x: i, y: Math.max(0, d) }; } ); + } +} + +// example from http://mbostock.github.io/d3/talk/20111116/force-collapsible.html +function forceCollapsable2() { + var w = 1280, + h = 800, + node, + link, + root; + + var force = d3.layout.force() + .on("tick", tick) + .charge(function (d) { return d._children ? -d.size / 100 : -30; } ) + .linkDistance(function (d) { return d.target._children ? 80 : 30; } ) + .size([w, h - 160]); + + var vis = d3.select("body").append("svg:svg") + .attr("width", w) + .attr("height", h); + + d3.json("flare.json", function (json) { + root = json; + root.fixed = true; + root.x = w / 2; + root.y = h / 2 - 80; + update(); + } ); + + function update() { + var nodes = flatten(root), + links = d3.layout.tree().links(nodes); + + // Restart the force layout. + force + .nodes(nodes) + .links(links) + .start(); + + // Update the links… + link = vis.selectAll("line.link") + .data(links, function (d) { return d.target.id; } ); + + // Enter any new links. + link.enter().insert("svg:line", ".node") + .attr("class", "link") + .attr("x1", function (d) { return d.source.x; } ) + .attr("y1", function (d) { return d.source.y; } ) + .attr("x2", function (d) { return d.target.x; } ) + .attr("y2", function (d) { return d.target.y; } ); + + // Exit any old links. + link.exit().remove(); + + // Update the nodes… + node = vis.selectAll("circle.node") + .data(nodes, function (d) { return d.id; } ) + .style("fill", color); + + node.transition() + .attr("r", function (d) { return d.children ? 4.5 : Math.sqrt(d.size) / 10; } ); + + // Enter any new nodes. + node.enter().append("svg:circle") + .attr("class", "node") + .attr("cx", function (d) { return d.x; } ) + .attr("cy", function (d) { return d.y; } ) + .attr("r", function (d) { return d.children ? 4.5 : Math.sqrt(d.size) / 10; } ) + .style("fill", color) + .on("click", click) + .call(force.drag); + + // Exit any old nodes. + node.exit().remove(); + } + + function tick() { + link.attr("x1", function (d) { return d.source.x; } ) + .attr("y1", function (d) { return d.source.y; } ) + .attr("x2", function (d) { return d.target.x; } ) + .attr("y2", function (d) { return d.target.y; } ); + + node.attr("cx", function (d) { return d.x; } ) + .attr("cy", function (d) { return d.y; } ); + } + + // Color leaf nodes orange, and packages white or blue. + function color(d) { + return d._children ? "#3182bd" : d.children ? "#c6dbef" : "#fd8d3c"; + } + + // Toggle children on click. + function click(d) { + if (d.children) { + d._children = d.children; + d.children = null; + } else { + d.children = d._children; + d._children = null; + } + update(); + } + + // Returns a list of all nodes under the root. + function flatten(root) { + var nodes = [], i = 0; + + function recurse(node) { + if (node.children) node.size = node.children.reduce(function (p, v) { return p + recurse(v); } , 0); + if (!node.id) node.id = ++i; + nodes.push(node); + return node.size; + } + + root.size = recurse(root); + return nodes; + } +} + +//exapmle from http://bl.ocks.org/mbostock/4062006 +function chordDiagram() { + var matrix = [ + [11975, 5871, 8916, 2868], + [1951, 10048, 2060, 6171], + [8010, 16145, 8090, 8045], + [1013, 990, 940, 6907] + ]; + + var chord = d3.layout.chord() + .padding(.05) + .sortSubgroups(d3.descending) + .matrix(matrix); + + var width = 960, + height = 500, + innerRadius = Math.min(width, height) * .41, + outerRadius = innerRadius * 1.1; + + var fill = d3.scale.ordinal() + .domain(d3.range(4)) + .range(["#000000", "#FFDD89", "#957244", "#F26223"]); + + var svg = d3.select("body").append("svg") + .attr("width", width) + .attr("height", height) + .append("g") + .attr("transform", "translate(" + width / 2 + "," + height / 2 + ")"); + + svg.append("g").selectAll("path") + .data(chord.groups) + .enter().append("path") + .style("fill", function (d) { return fill(d.index); } ) + .style("stroke", function (d) { return fill(d.index); } ) + .attr("d", d3.svg.arc().innerRadius(innerRadius).outerRadius(outerRadius)) + .on("mouseover", fade(.1)) + .on("mouseout", fade(1)); + + var ticks = svg.append("g").selectAll("g") + .data(chord.groups) + .enter().append("g").selectAll("g") + .data(groupTicks) + .enter().append("g") + .attr("transform", function (d) { + return "rotate(" + (d.angle * 180 / Math.PI - 90) + ")" + + "translate(" + outerRadius + ",0)"; + } ); + + ticks.append("line") + .attr("x1", 1) + .attr("y1", 0) + .attr("x2", 5) + .attr("y2", 0) + .style("stroke", "#000"); + + ticks.append("text") + .attr("x", 8) + .attr("dy", ".35em") + .attr("transform", function (d) { return d.angle > Math.PI ? "rotate(180)translate(-16)" : null; } ) + .style("text-anchor", function (d) { return d.angle > Math.PI ? "end" : null; } ) + .text(function (d) { return d.label; } ); + + svg.append("g") + .attr("class", "chord") + .selectAll("path") + .data(chord.chords) + .enter().append("path") + .attr("d", d3.svg.chord().radius(innerRadius)) + .style("fill", function (d) { return fill(d.target.index); } ) + .style("opacity", 1); + + // Returns an array of tick angles and labels, given a group. + function groupTicks(d) { + var k = (d.endAngle - d.startAngle) / d.value; + return d3.range(0, d.value, 1000).map(function (v, i) { + return { + angle: v * k + d.startAngle, + label: i % 5 ? null : v / 1000 + "k" + }; + } ); + } + + // Returns an event handler for fading a given chord group. + function fade(opacity) { + return function (g, i) { + svg.selectAll(".chord path") + .filter(function (d) { return d.source.index != i && d.target.index != i; } ) + .transition() + .style("opacity", opacity); + }; + } +} + +//example from http://mbostock.github.io/d3/talk/20111116/iris-parallel.html +function irisParallel() { + var species = ["setosa", "versicolor", "virginica"], + traits = ["sepal length", "petal length", "sepal width", "petal width"]; + + var m = [80, 160, 200, 160], + w = 1280 - m[1] - m[3], + h = 800 - m[0] - m[2]; + + var x = d3.scale.ordinal().domain(traits).rangePoints([0, w]), + y = {}; + + var line = d3.svg.line(), + axis = d3.svg.axis().orient("left"), + foreground; + + var svg = d3.select("body").append("svg:svg") + .attr("width", w + m[1] + m[3]) + .attr("height", h + m[0] + m[2]) + .append("svg:g") + .attr("transform", "translate(" + m[3] + "," + m[0] + ")"); + + d3.csv("iris.csv", function (flowers) { + + // Create a scale and brush for each trait. + traits.forEach(function (d) { + // Coerce values to numbers. + flowers.forEach(function (p) { p[d] = +p[d]; } ); + + y[d] = d3.scale.linear() + .domain(d3.extent(flowers, function (p) { return p[d]; } )) + .range([h, 0]); + + y[d].brush = d3.svg.brush() + .y(y[d]) + .on("brush", brush); + } ); + + // Add a legend. + var legend = svg.selectAll("g.legend") + .data(species) + .enter().append("svg:g") + .attr("class", "legend") + .attr("transform", function (d, i) { return "translate(0," + (i * 20 + 584) + ")"; } ); + + legend.append("svg:line") + .attr("class", String) + .attr("x2", 8); + + legend.append("svg:text") + .attr("x", 12) + .attr("dy", ".31em") + .text(function (d) { return "Iris " + d; } ); + + // Add foreground lines. + foreground = svg.append("svg:g") + .attr("class", "foreground") + .selectAll("path") + .data(flowers) + .enter().append("svg:path") + .attr("d", path) + .attr("class", function (d) { return d.species; } ); + + // Add a group element for each trait. + var g = svg.selectAll(".trait") + .data(traits) + .enter().append("svg:g") + .attr("class", "trait") + .attr("transform", function (d) { return "translate(" + x(d) + ")"; } ) + .call(d3.behavior.drag() + .origin(function (d) { return { x: x(d) }; } ) + .on("dragstart", dragstart) + .on("drag", drag) + .on("dragend", dragend)); + + // Add an axis and title. + g.append("svg:g") + .attr("class", "axis") + .each(function (d) { d3.select(this).call(axis.scale(y[d])); } ) + .append("svg:text") + .attr("text-anchor", "middle") + .attr("y", -9) + .text(String); + + // Add a brush for each axis. + g.append("svg:g") + .attr("class", "brush") + .each(function (d) { d3.select(this).call(y[d].brush); } ) + .selectAll("rect") + .attr("x", -8) + .attr("width", 16); + + function dragstart(d, i?) { + i = traits.indexOf(d); + } + + function drag(d, i?) { + x.range()[i] = d3.event.x; + traits.sort(function (a, b) { return x(a) - x(b); } ); + g.attr("transform", function (d) { return "translate(" + x(d) + ")"; } ); + foreground.attr("d", path); + } + + function dragend(d) { + x.domain(traits).rangePoints([0, w]); + var t = d3.transition().duration(500); + t.selectAll(".trait").attr("transform", function (d) { return "translate(" + x(d) + ")"; } ); + t.selectAll(".foreground path").attr("d", path); + } + } ); + + // Returns the path for a given data point. + function path(d) { + return line(traits.map(function (p) { return [x(p), y[p](d[p])]; } )); + } + + // Handles a brush event, toggling the display of foreground lines. + function brush() { + var actives = traits.filter(function (p) { return !y[p].brush.empty(); } ), + extents = actives.map(function (p) { return y[p].brush.extent(); } ); + foreground.classed("fade", function (d) { + return !actives.every(function (p, i) { + return extents[i][0] <= d[p] && d[p] <= extents[i][1]; + } ); + } ); + } +} + +//example from +function healthAndWealth() { + // Various accessors that specify the four dimensions of data to visualize. + function x(d) { return d.income; } + function y(d) { return d.lifeExpectancy; } + function radius(d) { return d.population; } + function color(d) { return d.region; } + function key(d) { return d.name; } + + // Chart dimensions. + var margin = { top: 19.5, right: 19.5, bottom: 19.5, left: 39.5 }, + width = 960 - margin.right, + height = 500 - margin.top - margin.bottom; + + // Various scales. These domains make assumptions of data, naturally. + var xScale = d3.scale.log().domain([300, 1e5]).range([0, width]), + yScale = d3.scale.linear().domain([10, 85]).range([height, 0]), + radiusScale = d3.scale.sqrt().domain([0, 5e8]).range([0, 40]), + colorScale = d3.scale.category10(); + + // The x & y axes. + var xAxis = d3.svg.axis().orient("bottom").scale(xScale).ticks(12, d3.format(",d")), + yAxis = d3.svg.axis().scale(yScale).orient("left"); + + // Create the SVG container and set the origin. + var svg = d3.select("#chart").append("svg") + .attr("width", width + margin.left + margin.right) + .attr("height", height + margin.top + margin.bottom) + .append("g") + .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); + + // Add the x-axis. + svg.append("g") + .attr("class", "x axis") + .attr("transform", "translate(0," + height + ")") + .call(xAxis); + + // Add the y-axis. + svg.append("g") + .attr("class", "y axis") + .call(yAxis); + + // Add an x-axis label. + svg.append("text") + .attr("class", "x label") + .attr("text-anchor", "end") + .attr("x", width) + .attr("y", height - 6) + .text("income per capita, inflation-adjusted (dollars)"); + + // Add a y-axis label. + svg.append("text") + .attr("class", "y label") + .attr("text-anchor", "end") + .attr("y", 6) + .attr("dy", ".75em") + .attr("transform", "rotate(-90)") + .text("life expectancy (years)"); + + // Add the year label; the value is set on transition. + var label = svg.append("text") + .attr("class", "year label") + .attr("text-anchor", "end") + .attr("y", height - 24) + .attr("x", width) + .text(1800); + + // Load the data. + d3.json("nations.json", function (nations) { + + // A bisector since many nation's data is sparsely-defined. + var bisect = d3.bisector(function (d) { return d[0]; } ); + + // Add a dot per nation. Initialize the data at 1800, and set the colors. + var dot = svg.append("g") + .attr("class", "dots") + .selectAll(".dot") + .data(interpolateData(1800)) + .enter().append("circle") + .attr("class", "dot") + .style("fill", function (d) { return colorScale(color(d)); } ) + .call(position) + .sort(order); + + // Add a title. + dot.append("title") + .text(function (d) { return d.name; } ); + + // Add an overlay for the year label. + var box = label.node().getBBox(); + + var overlay = svg.append("rect") + .attr("class", "overlay") + .attr("x", box.x) + .attr("y", box.y) + .attr("width", box.width) + .attr("height", box.height) + .on("mouseover", enableInteraction); + + // Start a transition that interpolates the data based on year. + svg.transition() + .duration(30000) + .ease("linear") + .tween("year", tweenYear) + .each("end", enableInteraction); + + // Positions the dots based on data. + function position(dot) { + dot.attr("cx", function (d) { return xScale(x(d)); } ) + .attr("cy", function (d) { return yScale(y(d)); } ) + .attr("r", function (d) { return radiusScale(radius(d)); } ); + } + + // Defines a sort order so that the smallest dots are drawn on top. + function order(a, b) { + return radius(b) - radius(a); + } + + // After the transition finishes, you can mouseover to change the year. + function enableInteraction() { + var yearScale = d3.scale.linear() + .domain([1800, 2009]) + .range([box.x + 10, box.x + box.width - 10]) + .clamp(true); + + // Cancel the current transition, if any. + svg.transition().duration(0); + + overlay + .on("mouseover", mouseover) + .on("mouseout", mouseout) + .on("mousemove", mousemove) + .on("touchmove", mousemove); + + function mouseover() { + label.classed("active", true); + } + + function mouseout() { + label.classed("active", false); + } + + function mousemove() { + displayYear(yearScale.invert(d3.mouse(this)[0])); + } + } + + // Tweens the entire chart by first tweening the year, and then the data. + // For the interpolated data, the dots and label are redrawn. + function tweenYear() { + var year = d3.interpolateNumber(1800, 2009); + return function (t) { displayYear(year(t)); }; + } + + // Updates the display to show the specified year. + function displayYear(year) { + dot.data(interpolateData(year), key).call(position).sort(order); + label.text(Math.round(year)); + } + + // Interpolates the dataset for the given (fractional) year. + function interpolateData(year) { + return nations.map(function (d) { + return { + name: d.name, + region: d.region, + income: interpolateValues(d.income, year), + population: interpolateValues(d.population, year), + lifeExpectancy: interpolateValues(d.lifeExpectancy, year) + }; + } ); + } + + // Finds (and possibly interpolates) the value for the specified year. + function interpolateValues(values, year) { + var i = bisect.left(values, year, 0, values.length - 1), + a = values[i]; + if (i > 0) { + var b = values[i - 1], + t = (year - a[0]) / (b[0] - a[0]); + return a[1] * (1 - t) + b[1] * t; + } + return a[1]; + } + } ); +} diff --git a/d3/d3.d.ts b/d3/d3.d.ts index 2f60ad1dc..a79bbd8e9 100644 --- a/d3/d3.d.ts +++ b/d3/d3.d.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/borisyankov/DefinitelyTyped declare module D3 { - interface Selectors { + export interface Selectors { /** * Select an element from the current document */ @@ -42,145 +42,7 @@ declare module D3 { }; } - interface Behavior { - /** - * Constructs a new drag behaviour - */ - drag: () => Drag; - /** - * Constructs a new zoom behaviour - */ - zoom: () => Zoom; - } - - interface Zoom { - /** - * Execute zoom method - */ - (): any; - - /** - * Registers a listener to receive events - * - * @param type Enent name to attach the listener to - * @param listener Function to attach to event - */ - on: (type: string, listener: (data: any, index?: number) => any) => Zoom; - - /** - * Gets or set the current zoom scale - */ - scale: { - /** - * Get the current current zoom scale - */ - (): number; - /** - * Set the current current zoom scale - * - * @param origin Zoom scale - */ - (scale: number): Zoom; - }; - - /** - * Gets or set the current zoom translation vector - */ - translate: { - /** - * Get the current zoom translation vector - */ - (): number[]; - /** - * Set the current zoom translation vector - * - * @param translate Tranlation vector - */ - (translate: number[]): Zoom; - }; - - /** - * Gets or set the allowed scale range - */ - scaleExtent: { - /** - * Get the current allowed zoom range - */ - (): number[]; - /** - * Set the allowable zoom range - * - * @param extent Allowed zoom range - */ - (extent: number[]): Zoom; - }; - - /** - * Gets or set the X-Scale that should be adjusted when zooming - */ - x: { - /** - * Get the X-Scale - */ - (): Scale; - /** - * Set the X-Scale to be adjusted - * - * @param x The X Scale - */ - (x: Scale): Zoom; - - }; - - /** - * Gets or set the Y-Scale that should be adjusted when zooming - */ - y: { - /** - * Get the Y-Scale - */ - (): Scale; - /** - * Set the Y-Scale to be adjusted - * - * @param y The Y Scale - */ - (y: Scale): Zoom; - }; - } - - interface Drag { - /** - * Execute drag method - */ - (): any; - - /** - * Registers a listener to receive events - * - * @param type Enent name to attach the listener to - * @param listener Function to attach to event - */ - on: (type: string, listener: (data: any, index?: number) => any) => Drag; - - /** - * Gets or set the current origin accessor function - */ - origin: { - /** - * Get the current origin accessor function - */ - (): any; - /** - * Set the origin accessor function - * - * @param origin Accessor function - */ - (origin?: any): Drag; - }; - } - - interface Event { + export interface Event { dx: number; dy: number; clientX: number; @@ -190,79 +52,78 @@ declare module D3 { sourceEvent: Event; x: number; y: number; + keyCode: number; altKey: any; } - interface Base extends Selectors { + export interface Base extends Selectors { /** * Create a behaviour */ - behavior: Behavior; + behavior: Behaviour.Behavior; /** * Access the current user event for interaction */ event: Event; - + /** * Compare two values for sorting. * Returns -1 if a is less than b, or 1 if a is greater than b, or 0 * - * @param a First number - * @param b Second number + * @param a First value + * @param b Second value */ - ascending: (a: number, b: number) => number; + ascending(a: T, b: T): number; /** * Compare two values for sorting. * Returns -1 if a is greater than b, or 1 if a is less than b, or 0 * - * @param a First number - * @param b Second number + * @param a First value + * @param b Second value */ - descending: (a: number, b: number) => number; + descending(a: T, b: T): number; /** * Find the minimum value in an array * * @param arr Array to search * @param map Accsessor function */ - min: (arr: number[], map?: (v: any) => any) => number; + min(arr: T[], map?: (v: T) => number): number; /** * Find the maximum value in an array * * @param arr Array to search * @param map Accsessor function */ - max: (arr: any[], map?: (v: any) => number) => number; - - + max(arr: T[], map?: (v: T) => number): number; /** * Find the minimum and maximum value in an array * * @param arr Array to search * @param map Accsessor function */ - extent: (arr: number[], map?: (v: any) => any) => number[]; + extent(arr: T[], map?: (v: T) => number): number[]; /** * Compute the sum of an array of numbers * * @param arr Array to search * @param map Accsessor function */ - sum: (arr: number[], map?: (v: any) => any) => number; + sum(arr: T[], map?: (v: T) => number): number; /** * Compute the arithmetic mean of an array of numbers * * @param arr Array to search * @param map Accsessor function */ - mean: (arr: number[], map?: (v: any) => any) => number; + mean(arr: T[], map?: (v: T) => number): number; /** * Compute the median of an array of numbers (the 0.5-quantile). * * @param arr Array to search * @param map Accsessor function */ - median: (arr: number[], map?: (v: any) => any) => number; + median(arr: T[], map?: (v: T) => number): number; /** * Compute a quantile for a sorted array of numbers. * @@ -278,7 +139,7 @@ declare module D3 { * @param low Minimum value of array subset * @param hihg Maximum value of array subset */ - bisect: (arr: any[], x: any, low?: number, high?: number) => number; + bisect(arr: T[], x: T, low?: number, high?: number): number; /** * Locate the insertion point for x in array to maintain sorted order * @@ -287,7 +148,7 @@ declare module D3 { * @param low Minimum value of array subset * @param high Maximum value of array subset */ - bisectLeft: (arr: any[], x: any, low?: number, high?: number) => number; + bisectLeft(arr: T[], x: T, low?: number, high?: number): number; /** * Locate the insertion point for x in array to maintain sorted order * @@ -296,7 +157,7 @@ declare module D3 { * @param low Minimum value of array subset * @param high Maximum value of array subset */ - bisectRight: (arr: any[], x: any, low?: number, high?: number) => number; + bisectRight(arr: T[], x: T, low?: number, high?: number): number; /** * Bisect using an accessor. * @@ -308,7 +169,7 @@ declare module D3 { * * @param arr Array to randomise */ - shuffle(arr: any[]): any[]; + shuffle(arr: T[]): T[]; /** * Reorder an array of elements according to an array of indexes * @@ -376,7 +237,6 @@ declare module D3 { * Create new nest operator */ nest(): Nest; - /** * Request a resource using XMLHttpRequest. */ @@ -423,7 +283,7 @@ declare module D3 { * @param url Url to request * @param callback Function to invoke when resource is loaded or the request fails */ - json: (url: string, callback?: (response: any) => void ) => Xhr; + json: (url: string, callback?: (error: any, data: any) => void ) => Xhr; /** * Request an HTML document fragment. */ @@ -454,163 +314,213 @@ declare module D3 { /** * Request a comma-separated values (CSV) file. */ - csv: { - /** - * Request a comma-separated values (CSV) file. - * - * @param url Url to request - * @param callback Function to invoke when resource is loaded or the request fails - */ - (url: string, callback?: (error: any, response: any[]) => void ): Xhr; - /** - * Parse a CSV string into objects using the header row. - * - * @param string CSV formatted string to parse - */ - parse(string: string): any[]; - /** - * Parse a CSV string into tuples, ignoring the header row. - * - * @param string CSV formatted string to parse - */ - parseRows(string: string, accessor: (row: any[], index: number) => any): any; - /** - * Format an array of tuples into a CSV string. - * - * @param rows Array to convert to a CSV string - */ - format(rows: any[]): string; - }; + csv: Dsv; /** * Request a tab-separated values (TSV) file */ - tsv: { - /** - * Request a tab-separated values (TSV) file - * - * @param url Url to request - * @param callback Function to invoke when resource is loaded or the request fails - */ - (url: string, callback?: (error: any, response: any[]) => void ): Xhr; - /** - * Parse a TSV string into objects using the header row. - * - * @param string TSV formatted string to parse - */ - parse(string: string): any[]; - /** - * Parse a TSV string into tuples, ignoring the header row. - * - * @param string TSV formatted string to parse - */ - parseRows(string: string, accessor: (row: any[], index: number) => any): any; - /** - * Format an array of tuples into a TSV string. - * - * @param rows Array to convert to a TSV string - */ - format(rows: any[]): string; - }; - + tsv: Dsv; /** * Time Functions */ - time: Time; - + time: Time.Time; /** * Scales */ - scale: { - /** - * Construct a linear quantitative scale. - */ - linear(): LinearScale; - /* - * Construct an ordinal scale. - */ - ordinal(): OrdinalScale; - /** - * Construct a linear quantitative scale with a discrete output range. - */ - quantize(): QuantizeScale; - /* - * Construct an ordinal scale with ten categorical colors. - */ - category10(): OrdinalScale; - /* - * Construct an ordinal scale with twenty categorical colors - */ - category20(): OrdinalScale; - /* - * Construct an ordinal scale with twenty categorical colors - */ - category20b(): OrdinalScale; - /* - * Construct an ordinal scale with twenty categorical colors - */ - category20c(): OrdinalScale; - }; + scale: Scale.ScaleBase; /* * Interpolate two values */ - interpolate: BaseInterpolate; + interpolate: Transition.BaseInterpolate; /* * Interpolate two numbers */ - interpolateNumber: BaseInterpolate; + interpolateNumber: Transition.BaseInterpolate; /* * Interpolate two integers */ - interpolateRound: BaseInterpolate; + interpolateRound: Transition.BaseInterpolate; /* * Interpolate two strings */ - interpolateString: BaseInterpolate; + interpolateString: Transition.BaseInterpolate; /* * Interpolate two RGB colours */ - interpolateRgb: BaseInterpolate; + interpolateRgb: Transition.BaseInterpolate; /* * Interpolate two HSL colours */ - interpolateHsl: BaseInterpolate; + interpolateHsl: Transition.BaseInterpolate; + /* + * Interpolate two HCL colours + */ + interpolateHcl: Transition.BaseInterpolate; + /* + * Interpolate two L*a*b* colors + */ + interpolateLab: Transition.BaseInterpolate; /* * Interpolate two arrays of values */ - interpolateArray: BaseInterpolate; + interpolateArray: Transition.BaseInterpolate; /* * Interpolate two arbitary objects */ - interpolateObject: BaseInterpolate; + interpolateObject: Transition.BaseInterpolate; /* * Interpolate two 2D matrix transforms */ - interpolateTransform: BaseInterpolate; - + interpolateTransform: Transition.BaseInterpolate; + /* + * The array of built-in interpolator factories + */ + interpolators: Array; /** * Layouts */ - layout: Layout; - + layout: Layout.Layout; /** * Svg's */ - svg: Svg; - + svg: Svg.Svg; /** * Random number generators */ random: Random; - /** * Create a function to format a number as a string * * @param specifier The format specifier to use */ format(specifier: string): (value: number) => string; + /** + * Returns the SI prefix for the specified value at the specified precision + */ + formatPrefix(value: number, precision?: number): MetricPrefix; + /** + * The version of the d3 library + */ + version: string; + /** + * Returns the root selection + */ + selection(): Selection; + ns: { + /** + * The map of registered namespace prefixes + */ + prefix: { + svg: string; + xhtml: string; + xlink: string; + xml: string; + xmlns: string; + }; + /** + * Qualifies the specified name + */ + qualify(name: string): { space: string; local: string; }; + }; + /** + * Returns a built-in easing function of the specified type + */ + ease: (type: string, ...arrs: any[]) => Transition; + /** + * Constructs a new RGB color. + */ + rgb: { + /** + * Constructs a new RGB color with the specified r, g and b channel values + */ + (r: number, g: number, b: number): D3.Color.RGBColor; + /** + * Constructs a new RGB color by parsing the specified color string + */ + (color: string): D3.Color.RGBColor; + }; + /** + * Constructs a new HCL color. + */ + hcl: { + /** + * Constructs a new HCL color. + */ + (h: number, c: number, l: number): Color.HCLColor; + /** + * Constructs a new HCL color by parsing the specified color string + */ + (color: string): Color.HCLColor; + }; + /** + * Constructs a new HSL color. + */ + hsl: { + /** + * Constructs a new HSL color with the specified hue h, saturation s and lightness l + */ + (h: number, s: number, l: number): Color.HSLColor; + /** + * Constructs a new HSL color by parsing the specified color string + */ + (color: string): Color.HSLColor; + }; + /** + * Constructs a new RGB color. + */ + lab: { + /** + * Constructs a new LAB color. + */ + (l: number, a: number, b: number): Color.LABColor; + /** + * Constructs a new LAB color by parsing the specified color string + */ + (color: string): Color.LABColor; + }; + geo: Geo.Geo; + geom: Geom.Geom; + /** + * gets the mouse position relative to a specified container. + */ + mouse(container: any): Array; + /** + * gets the touch positions relative to a specified container. + */ + touches(container: any): Array; + functor(value: T): T; + functor(value: () => T): T; + map(object?: any): Map; + set(array?: Array): Set; + dispatch(...types: Array): Dispatch; + rebind(target: any, source: any, ...names: Array): any; + requote(str: string): string; + timer: { + (funct: () => boolean, delay?: number, mark?: number): void; + flush(): void; + } + transition(): Transition.Transition; } - interface Xhr { + export interface Dispatch { + [event: string]: any; + on: { + (type: string): any; + (type: string, listener: any): any; + } + } + + export interface MetricPrefix { + /** + * the scale function, for converting numbers to the appropriate prefixed scale. + */ + scale: (d: number) => number; + /** + * the prefix symbol + */ + symbol: string; + } + + export interface Xhr { /** * Get or set request header */ @@ -657,14 +567,14 @@ declare module D3 { * * @param value The function used to map the response to a data value */ - (value: (xhr: XMLHttpRequest) => any ): Xhr; + (value: (xhr: XMLHttpRequest) => any): Xhr; }; /** * Issue the request using the GET method * * @param callback Function to invoke on completion of request */ - get (callback?: (xhr: XMLHttpRequest) => void ): Xhr; + get(callback?: (xhr: XMLHttpRequest) => void ): Xhr; /** * Issue the request using the POST method */ @@ -716,7 +626,35 @@ declare module D3 { on: (type: string, listener: (data: any, index?: number) => any) => Xhr; } - interface Selection extends Selectors { + export interface Dsv { + /** + * Request a delimited values file + * + * @param url Url to request + * @param callback Function to invoke when resource is loaded or the request fails + */ + (url: string, callback?: (error: any, response: any[]) => void ): Xhr; + /** + * Parse a delimited string into objects using the header row. + * + * @param string delimited formatted string to parse + */ + parse(string: string): any[]; + /** + * Parse a delimited string into tuples, ignoring the header row. + * + * @param string delimited formatted string to parse + */ + parseRows(string: string, accessor: (row: any[], index: number) => any): any; + /** + * Format an array of tuples into a delimited string. + * + * @param rows Array to convert to a delimited string + */ + format(rows: any[]): string; + } + + export interface Selection extends Selectors, Array { attr: { (name: string): string; (name: string, value: any): Selection; @@ -768,617 +706,68 @@ declare module D3 { }; filter: { - (filter: (data: any, index: number) => bool): UpdateSelection; - (filter: string): UpdateSelection; + (filter: (data: any, index: number) => boolean, thisArg?: any): UpdateSelection; + //(filter: string): UpdateSelection; }; call(callback: (selection: Selection) => void ): Selection; each(eachFunction: (data: any, index: number) => any): Selection; on: { (type: string): (data: any, index: number) => any; - (type: string, listener: (data: any, index: number) => any, capture?: bool): Selection; + (type: string, listener: (data: any, index: number) => any, capture?: boolean): Selection; }; - transition: () => Transition; + transition(): Transition.Transition; + /** + * sort elements in the document based on data. + * + * params comparator the specified comparator function + */ + sort(comparator?: (a: T, b: T) => number): Selection; + order: () => Selection; + node: () => SVGLocatable; } - interface EnterSelection { + export interface EnterSelection { append: (name: string) => Selection; insert: (name: string, before: string) => Selection; select: (selector: string) => Selection; empty: () => bool; - node: () => Node; + node: () => HTMLElementSVGLocatable; } - interface UpdateSelection extends Selection { + export interface UpdateSelection extends Selection { enter: () => EnterSelection; update: () => Selection; exit: () => Selection; } - interface Transition { - duration: { - (duration: number): Transition; - (duration: (data: any, index: number) => any): Transition; - }; - delay: { - (delay: number): Transition; - (delay: (data: any, index: number) => any): Transition; - }; - attr: { - (name: string): string; - (name: string, value: any): Transition; - (name: string, valueFunction: (data: any, index: number) => any): Transition; - }; - - style: { - (name: string): string; - (name: string, value: any, priority?: string): Transition; - (name: string, valueFunction: (data: any, index: number) => any, priority?: string): Transition; - }; - - call(callback: (selection: Selection) => void ): Transition; - - select: (selector: string) => Transition; - selectAll: (selector: string) => Transition; - - each: (type?: string, eachFunction?: (data: any, index: number) => any) => Transition; - transition: () => Transition; - ease: (value: string, ...arrs: any[]) => Transition; - remove: () => Transition; - } - - interface Nest { + export interface Nest { key(keyFunction: (data: any, index: number) => any): Nest; rollup(rollupFunction: (data: any, index: number) => any): Nest; map(values: any[]): Nest; } - interface Time { - second: Interval; - minute: Interval; - hour: Interval; - day: Interval; - week: Interval; - sunday: Interval; - monday: Interval; - tuesday: Interval; - wednesday: Interval; - thursday: Interval; - friday: Interval; - saturday: Interval; - month: Interval; - year: Interval; - - seconds: Range; - minutes: Range; - hours: Range; - days: Range; - weeks: Range; - months: Range; - years: Range; - - sundays: Range; - mondays: Range; - tuesdays: Range; - wednesdays: Range; - thursdays: Range; - fridays: Range; - saturdays: Range; - format: { - - (specifier: string): TimeFormat; - utc: (specifier: string) => TimeFormat; - iso: TimeFormat; - }; - - scale(): TimeScale; + export interface Map{ + has(key: string): boolean; + get(key: string): any; + set(key: string, value: T): T; + remove(key: string): boolean; + keys(): Array; + values(): Array; + entries(): Array; + forEach(func: (key: string, value: any) => void ): void; } - interface Range { - (start: Date, end: Date, step?: number): Date[]; + export interface Set{ + has(value: any): boolean; + Add(value: any): any; + remove(value: any): boolean; + values(): Array; + forEach(func: (value: any) => void ): void; } - interface Interval { - (date: Date): Date; - floor: (date: Date) => Date; - round: (date: Date) => Date; - ceil: (date: Date) => Date; - range: Range; - offset: (date: Date, step: number) => Date; - utc: Interval; - } - - interface TimeFormat { - (date: Date): string; - parse: (string: string) => Date; - } - - interface Scale { - (value: any): any; - domain: { - (values: any[]): Scale; - (): any[]; - }; - range: { - (values: any[]): Scale; - (): any[]; - }; - copy(): Scale; - } - - interface LinearScale extends Scale { - (value: number): number; - invert(value: number): number; - domain: { - (values: any[]): LinearScale; - (): any[]; - }; - range: { - (values: any[]): LinearScale; - (): any[]; - }; - rangeRound: (values: any[]) => LinearScale; - interpolate: { - (): Interpolate; - (factory: Interpolate): LinearScale; - }; - clamp(clamp: bool): LinearScale; - nice(): LinearScale; - ticks(count: number): any[]; - tickFormat(count: number): (n: number) => string; - copy(): LinearScale; - } - - interface OrdinalScale extends Scale { - (value: any): any; - domain: { - (values: any[]): OrdinalScale; - (): any[]; - }; - range: { - (values: any[]): OrdinalScale; - (): any[]; - }; - rangePoints(interval: any[], padding?: number): OrdinalScale; - rangeBands(interval: any[], padding?: number, outerPadding?: number): OrdinalScale; - rangeRoundBands(interval: any[], padding?: number, outerPadding?: number): OrdinalScale; - rangeBand(): number; - rangeExtent(): any[]; - copy(): OrdinalScale; - } - - interface QuantizeScale extends Scale { - (value: any): any; - domain: { - (values: number[]): QuantizeScale; - (): any[]; - }; - range: { - (values: any[]): QuantizeScale; - (): any[]; - }; - copy(): QuantizeScale; - } - - interface TimeScale extends Scale { - (value: Date): number; - invert(value: number): Date; - domain: { - (values: any[]): TimeScale; - (): any[]; - }; - range: { - (values: any[]): TimeScale; - (): any[]; - }; - rangeRound: (values: any[]) => TimeScale; - interpolate: { - (): Interpolate; - (factory: InterpolateFactory): TimeScale; - }; - clamp(clamp: bool): TimeScale; - ticks: { - (count: number): any[]; - (range: Range, count: number): any[]; - }; - tickFormat(count: number): (n: number) => string; - copy(): TimeScale; - } - - interface InterpolateFactory { - (a: any, b: any): BaseInterpolate; - } - interface BaseInterpolate { - (a: any, b: any): Interpolate; - } - - interface Interpolate { - (t: number): number; - } - - interface Layout { - stack(): StackLayout; - pie(): PieLayout; - force(): ForceLayout; - tree(): TreeLayout; - } - - interface StackLayout { - (layers: any[], index?: number): any[]; - values(accessor?: (d: any) => any): StackLayout; - offset(offset: string): StackLayout; - } - - interface PieLayout { - (values: any[], index?: number): ArcDescriptor[]; - value: { - (): (d: any, index: number) => number; - (accessor: (d: any, index: number) => number): PieLayout; - }; - sort: { - (): (d1: any, d2: any) => number; - (comparator: (d1: any, d2: any) => number): PieLayout; - }; - startAngle: { - (): number; - (angle: number): Arc; - (angle: () => number): Arc; - }; - endAngle: { - (): number; - (angle: number): Arc; - (angle: () => number): Arc; - }; - } - - interface ArcDescriptor { - value: any; - data: any; - startAngle: number; - endAngle: number; - } - - interface Symbol { - type: (string) => Symbol; - size: (number) => Symbol; - } - - - - interface ProjectionPoint - { - x: number; - y: number; - } - - interface Projector - { - (d: ProjectionPoint): ProjectionPoint; - } - - interface Diagonal - { - (): () => Diagonal; - (projectionPoint): Diagonal; - projection: - { - (projector): Diagonal; - (): Projector; - }; - - } - - interface Svg { - /** - * Create a new symbol generator - */ - symbol: () => Symbol; - /** - * Create a new axis generator - */ - axis(): Axis; - /** - * Create a new arc generator - */ - arc(): Arc; - /** - * Create a new line generator - */ - line(): Line; - /** - * Create a new area generator - */ - area(): Area; - /** - * Constructs a new diagonal generator with the default accessor functions - */ - diagonal(): Diagonal; - - } - - interface Axis { - (selection: Selection): void; - scale: { - (): any; - (scale: any): Axis; - }; - - orient: { - (): string; - (orientation: string): Axis; - }; - - ticks: { - (count: number): Axis; - (range: Range, count?: number): Axis; - }; - - tickSubdivide(count: number): Axis; - tickSize(major?: number, minor?: number, end?: number): Axis; - tickFormat(formatter: (value: any) => string): Axis; - } - - interface Arc { - (options?: ArcOptions): string; - innerRadius: { - (): number; - (radius: number): Arc; - (radius: () => number): Arc; - }; - outerRadius: { - (): number; - (radius: number): Arc; - (radius: () => number): Arc; - }; - startAngle: { - (): number; - (angle: number): Arc; - (angle: () => number): Arc; - }; - endAngle: { - (): number; - (angle: number): Arc; - (angle: () => number): Arc; - }; - centroid(options?: ArcOptions): number[]; - } - - interface ArcOptions { - innerRadius?: number; - outerRadius?: number; - startAngle?: number; - endAngle?: number; - } - - interface Line { - /** - * Returns the path data string - * - * @param data Array of data elements - * @param index Optional index - */ - (data: any[], index?: number): string; - /** - * Get or set the x-coordinate accessor. - */ - x: { - /** - * Get the x-coordinate accessor. - */ - (): (data: any) => any; - /** - * Set the x-coordinate accessor. - * - * @param accessor The new accessor function - */ - (accessor: (data: any) => any): Line; - }; - /** - * Get or set the y-coordinate accessor. - */ - y: { - /** - * Get the y-coordinate accessor. - */ - (): (data: any) => any; - /** - * Set the y-coordinate accessor. - * - * @param accessor The new accessor function - */ - (accessor: (data: any) => any): Line; - }; - /** - * Get or set the interpolation mode. - */ - interpolate: { - /** - * Get the interpolation accessor. - */ - (): string; - /** - * Set the interpolation accessor. - * - * @param interpolate The interpolation mode - */ - (interpolate: string): Line; - }; - /** - * Get or set the cardinal spline tension. - */ - tension: { - /** - * Get the cardinal spline accessor. - */ - (): number; - /** - * Set the cardinal spline accessor. - * - * @param tension The Cardinal spline interpolation tension - */ - (tension: number): Line; - }; - /** - * Control whether the line is defined at a given point. - */ - defined: { - /** - * Get the accessor function that controls where the line is defined. - */ - (): (data: any) => any; - /** - * Set the accessor function that controls where the area is defined. - * - * @param defined The new accessor function - */ - (defined: (data: any) => any): Line; - }; - } - - interface Area { - /** - * Generate a piecewise linear area, as in an area chart. - */ - (data: any[], index?: number): string; - /** - * Get or set the x-coordinate accessor. - */ - x: { - /** - * Get the x-coordinate accessor. - */ - (): (data: any) => any; - /** - * Set the x-coordinate accessor. - * - * @param accessor The new accessor function - */ - (accessor: (data: any) => any): Area; - }; - /** - * Get or set the x0-coordinate (baseline) accessor. - */ - x0: { - /** - * Get the x0-coordinate (baseline) accessor. - */ - (): (data: any) => any; - /** - * Set the x0-coordinate (baseline) accessor. - * - * @param accessor The new accessor function - */ - (accessor: (data: any) => any): Area; - }; - /** - * Get or set the x1-coordinate (topline) accessor. - */ - x1: { - /** - * Get the x1-coordinate (topline) accessor. - */ - (): (data: any) => any; - /** - * Set the x1-coordinate (topline) accessor. - * - * @param accessor The new accessor function - */ - (accessor: (data: any) => any): Area; - }; - /** - * Get or set the y-coordinate accessor. - */ - y: { - /** - * Get the y-coordinate accessor. - */ - (): (data: any) => any; - /** - * Set the y-coordinate accessor. - * - * @param accessor The new accessor function - */ - (accessor: (data: any) => any): Area; - }; - /** - * Get or set the y0-coordinate (baseline) accessor. - */ - y0: { - /** - * Get the y0-coordinate (baseline) accessor. - */ - (): (data: any) => any; - /** - * Set the y0-coordinate (baseline) accessor. - * - * @param accessor The new accessor function - */ - (accessor: (data: any) => any): Area; - }; - /** - * Get or set the y1-coordinate (topline) accessor. - */ - y1: { - /** - * Get the y1-coordinate (topline) accessor. - */ - (): (data: any) => any; - /** - * Set the y1-coordinate (topline) accessor. - * - * @param accessor The new accessor function - */ - (accessor: (data: any) => any): Area; - }; - /** - * Get or set the interpolation mode. - */ - interpolate: { - /** - * Get the interpolation accessor. - */ - (): string; - /** - * Set the interpolation accessor. - * - * @param interpolate The interpolation mode - */ - (interpolate: string): Area; - }; - /** - * Get or set the cardinal spline tension. - */ - tension: { - /** - * Get the cardinal spline accessor. - */ - (): number; - /** - * Set the cardinal spline accessor. - * - * @param tension The Cardinal spline interpolation tension - */ - (tension: number): Area; - }; - /** - * Control whether the area is defined at a given point. - */ - defined: { - /** - * Get the accessor function that controls where the area is defined. - */ - (): (data: any) => any; - /** - * Set the accessor function that controls where the area is defined. - * - * @param defined The new accessor function - */ - (defined: (data: any) => any): Area; - }; - } - - interface Random { + export interface Random { /** * Returns a function for generating random numbers with a normal distribution * @@ -1400,167 +789,2234 @@ declare module D3 { */ irwinHall(count: number): () => number; } - - // force layout definitions - export interface TwoDGraphPoint { - id: number; - index: number; - name: string; - px: number; - py: number; - size: number; - weight: number; - x: number; - y: number; - x0: number; - y0: number; + + // Transitions + export module Transition { + export interface Transition { + duration: { + (duration: number): Transition; + (duration: (data: any, index: number) => any): Transition; + }; + delay: { + (delay: number): Transition; + (delay: (data: any, index: number) => any): Transition; + }; + attr: { + (name: string): string; + (name: string, value: any): Transition; + (name: string, valueFunction: (data: any, index: number) => any): Transition; + }; + style: { + (name: string): string; + (name: string, value: any, priority?: string): Transition; + (name: string, valueFunction: (data: any, index: number) => any, priority?: string): Transition; + }; + call(callback: (selection: Selection) => void ): Transition; + /** + * Select an element from the current document + */ + select: { + /** + * Selects the first element that matches the specified selector string + * + * @param selector Selection String to match + */ + (selector: string): Transition; + /** + * Selects the specified node + * + * @param element Node element to select + */ + (element: EventTarget): Transition; + }; + + /** + * Select multiple elements from the current document + */ + selectAll: { + /** + * Selects all elements that match the specified selector + * + * @param selector Selection String to match + */ + (selector: string): Transition; + /** + * Selects the specified array of elements + * + * @param elements Array of node elements to select + */ + (elements: EventTarget[]): Transition; + } + each: (type?: string, eachFunction?: (data: any, index: number) => any) => Transition; + transition: () => Transition; + ease: (value: string, ...arrs: any[]) => Transition; + attrTween(name: string, tween: (d: any, i: number, a: any) => BaseInterpolate): Transition; + styleTween(name: string, tween: (d: any, i: number, a: any) => BaseInterpolate, priority?: string): Transition; + text: { + (text: string): Transition; + (text: (d: any, i: number) => string): Transition; + } + tween(name: string, factory: InterpolateFactory): Transition; + filter: { + (selector: string): Transition; + (selector: (data: any, index: number) => boolean): Transition; + }; + remove(): Transition; + } + + export interface InterpolateFactory { + (a?: any, b?: any): BaseInterpolate; + } + + export interface BaseInterpolate { + (a: any, b?: any): any; + } + + export interface Interpolate { + (t: any): any; + } } - export interface LayoutNode extends TwoDGraphPoint { - fixed: bool; - parent: LayoutNode; - depth: number; - children: LayoutNode[]; - _children: LayoutNode[]; + //Time + export module Time { + export interface Time { + second: Interval; + minute: Interval; + hour: Interval; + day: Interval; + week: Interval; + sunday: Interval; + monday: Interval; + tuesday: Interval; + wednesday: Interval; + thursday: Interval; + friday: Interval; + saturday: Interval; + month: Interval; + year: Interval; + + seconds: Range; + minutes: Range; + hours: Range; + days: Range; + weeks: Range; + months: Range; + years: Range; + + sundays: Range; + mondays: Range; + tuesdays: Range; + wednesdays: Range; + thursdays: Range; + fridays: Range; + saturdays: Range; + format: { + + (specifier: string): TimeFormat; + utc: (specifier: string) => TimeFormat; + iso: TimeFormat; + }; + + scale(): Scale.TimeScale; + } + + export interface Range { + (start: Date, end: Date, step?: number): Date[]; + } + + export interface Interval { + (date: Date): Date; + floor: (date: Date) => Date; + round: (date: Date) => Date; + ceil: (date: Date) => Date; + range: Range; + offset: (date: Date, step: number) => Date; + utc: Interval; + } + + export interface TimeFormat { + (date: Date): string; + parse: (string: string) => Date; + } } - export interface LayoutLink { - source: LayoutNode; - target: LayoutNode; - } + // Layout + export module Layout { + export interface Layout { + /** + * Creates a new Stack layout + */ + stack(): StackLayout; + /** + * Creates a new pie layout + */ + pie(): PieLayout; + /** + * Creates a new force layout + */ + force(): ForceLayout; + /** + * Creates a new tree layout + */ + tree(): TreeLayout; + bundle(): BundleLayout; + chord(): ChordLayout; + cluster(): ClusterLayout; + hierarchy(): HierarchyLayout; + histogram(): HistogramLayout; + pack(): PackLayout; + partition(): PartitionLayout; + treeMap(): TreeMapLayout; + } + export interface StackLayout { + (layers: any[], index?: number): any[]; + values(accessor?: (d: any) => any): StackLayout; + offset(offset: string): StackLayout; + } - export interface ForceLayout { - (): ForceLayout; - size: { - (): number; - (mysize: number[]): ForceLayout; - (accessor: (d: any, index: number) => {}): ForceLayout; + export interface TreeLayout { + /** + * Gets or sets the sort order of sibling nodes for the layout using the specified comparator function + */ + sort: { + /** + * Gets the sort order function of sibling nodes for the layout + */ + (): (d1: any, d2: any) => number; + /** + * Sets the sort order of sibling nodes for the layout using the specified comparator function + */ + (comparator: (d1: any, d2: any) => number): TreeLayout; + }; + /** + * Gets or sets the specified children accessor function + */ + children: { + /** + * Gets the children accessor function + */ + (): (d: any) => any; + /** + * Sets the specified children accessor function + */ + (children: (d: any) => any): TreeLayout; + }; + /** + * Runs the tree layout + */ + nodes(root: GraphNode): TreeLayout; + /** + * Given the specified array of nodes, such as those returned by nodes, returns an array of objects representing the links from parent to child for each node + */ + links(nodes: Array): Array; + /** + * If separation is specified, uses the specified function to compute separation between neighboring nodes. If separation is not specified, returns the current separation function + */ + seperation: { + /** + * Gets the current separation function + */ + (): (a: GraphNode, b: GraphNode) => number; + /** + * Sets the specified function to compute separation between neighboring nodes + */ + (seperation: (a: GraphNode, b: GraphNode) => number): TreeLayout; + }; + /** + * Gets or sets the available layout size + */ + size: { + /** + * Gets the available layout size + */ + (): Array; + /** + * Sets the available layout size + */ + (size: Array): TreeLayout; + }; + } - }; + export interface PieLayout { + (values: any[], index?: number): ArcDescriptor[]; + value: { + (): (d: any, index: number) => number; + (accessor: (d: any, index: number) => number): PieLayout; + }; + sort: { + (): (d1: any, d2: any) => number; + (comparator: (d1: any, d2: any) => number): PieLayout; + }; + startAngle: { + (): number; + (angle: number): D3.Svg.Arc; + (angle: () => number): D3.Svg.Arc; + }; + endAngle: { + (): number; + (angle: number): D3.Svg.Arc; + (angle: () => number): D3.Svg.Arc; + }; + } - linkDistance: { - (): number; - (number): ForceLayout; - (accessor: (d: any, index: number) => number): ForceLayout; - }; + export interface ArcDescriptor { + value: any; + data: any; + startAngle: number; + endAngle: number; + index: number; + } - linkStrength: + export interface GraphNode { + id: number; + index: number; + name: string; + px: number; + py: number; + size: number; + weight: number; + x: number; + y: number; + subindex: number; + startAngle: number; + endAngle: number; + value: number; + fixed: bool; + children: GraphNode[]; + _children: GraphNode[]; + parent: GraphNode; + depth: number; + } + + export interface GraphLink { + source: GraphNode; + target: GraphNode; + } + + export interface ForceLayout { + (): ForceLayout; + size: { + (): number; + (mysize: number[]): ForceLayout; + (accessor: (d: any, index: number) => {}): ForceLayout; + + }; + linkDistance: { + (): number; + (number): ForceLayout; + (accessor: (d: any, index: number) => number): ForceLayout; + }; + linkStrength: { (): number; (number): ForceLayout; (accessor: (d: any, index: number) => number): ForceLayout; }; - - friction: - { - (): number; - (number): ForceLayout; - (accessor: (d: any, index: number) => number): ForceLayout; - }; - - - alpha: { - (): number; - (number): ForceLayout; - (accessor: (d: any, index: number) => number): ForceLayout; - }; - charge: { - (): number; - (number): ForceLayout; - (accessor: (d: any, index: number) => number): ForceLayout; - }; - - theta: { - (): number; - (number): ForceLayout; - (accessor: (d: any, index: number) => number): ForceLayout; - }; - - gravity: { - (): number; - (number): ForceLayout; - (accessor: (d: any, index: number) => number): ForceLayout; - }; - - links: { - (): LayoutLink[]; - (arLinks: LayoutLink[]): ForceLayout; - - }; - nodes: - { - (): LayoutNode[]; - (arNodes: LayoutNode[]): ForceLayout; - - }; - start(): ForceLayout; - resume(): ForceLayout; - stop(): ForceLayout; - tick(): ForceLayout; - on(type: string, listener: () => void ): ForceLayout; - drag(): ForceLayout; - } - - // tree layout - - - interface Comparator - { - (a: LayoutNode, b: LayoutNode): () => any; - - } - - interface ObjectWithChildrenArray - { - children: ObjectWithChildrenArray[]; - } - - interface ChildrenAccessorFunction - { - (d: ObjectWithChildrenArray): ()=> any; - } - - interface CalculateSeparation - { - (a: any, b: any): () => number; - - } - - - export interface TreeLayout - { - (): TreeLayout; - size: { - (): number; - (mysize: number[]): TreeLayout; - (accessor: (d: any, index: number) => {}): TreeLayout; - - }; - nodes: (LayoutNode) => LayoutNode[]; - links: (nodes: LayoutNode[]) => LayoutLink[]; - - - sort: + friction: { - (): () => Comparator; - (Comparator): (comp) => Comparator; + (): number; + (number): ForceLayout; + (accessor: (d: any, index: number) => number): ForceLayout; + }; + alpha: { + (): number; + (number): ForceLayout; + (accessor: (d: any, index: number) => number): ForceLayout; + }; + charge: { + (): number; + (number): ForceLayout; + (accessor: (d: any, index: number) => number): ForceLayout; }; - - children: - { - (): () => ChildrenAccessorFunction; - (ObjectWithChildrenArray): () => ObjectWithChildrenArray; + theta: { + (): number; + (number): ForceLayout; + (accessor: (d: any, index: number) => number): ForceLayout; }; - separation: - { - (): CalculateSeparation; - (CalculateSeparation): () => number; - }; + gravity: { + (): number; + (number): ForceLayout; + (accessor: (d: any, index: number) => number): ForceLayout; + }; + + links: { + (): GraphLink[]; + (arLinks: GraphLink[]): ForceLayout; + + }; + nodes: + { + (): GraphNode[]; + (arNodes: GraphNode[]): ForceLayout; + + }; + start(): ForceLayout; + resume(): ForceLayout; + stop(): ForceLayout; + tick(): ForceLayout; + on(type: string, listener: () => void ): ForceLayout; + drag(): ForceLayout; + } + + export interface BundleLayout{ + (links: Array): Array; + } + + export interface ChordLayout { + matrix: { + (): Array>; + (matrix: Array>): ChordLayout; + } + padding: { + (): number; + (padding: number): ChordLayout; + } + sortGroups: { + (): Array; + (comparator: (a: number, b: number) => number): ChordLayout; + } + sortSubgroups: { + (): Array; + (comparator: (a: number, b: number) => number): ChordLayout; + } + sortChords: { + (): Array; + (comparator: (a: number, b: number) => number): ChordLayout; + } + chords(): Array; + groups(): Array; + } + + export interface ClusterLayout{ + sort: { + (): (a: GraphNode, b: GraphNode) => number; + (comparator: (a: GraphNode, b: GraphNode) => number): ClusterLayout; + } + children: { + (): (d: any, i?: number) => Array; + (children: (d: any, i?: number) => Array): ClusterLayout; + } + nodes(root: GraphNode): Array; + links(nodes: Array): Array; + seperation: { + (): (a: GraphNode, b: GraphNode) => number; + (seperation: (a: GraphNode, b: GraphNode) => number): ClusterLayout; + } + size: { + (): Array; + (size: Array): ClusterLayout; + } + value: { + (): (node: GraphNode) => number; + (value: (node: GraphNode) => number): ClusterLayout; + } + } + + export interface HierarchyLayout { + sort: { + (): (a: GraphNode, b: GraphNode) => number; + (comparator: (a: GraphNode, b: GraphNode) => number): HierarchyLayout; + } + children: { + (): (d: any, i?: number) => Array; + (children: (d: any, i?: number) => Array): HierarchyLayout; + } + nodes(root: GraphNode): Array; + links(nodes: Array): Array; + value: { + (): (node: GraphNode) => number; + (value: (node: GraphNode) => number): HierarchyLayout; + } + reValue(root: GraphNode): HierarchyLayout; + } + + export interface Bin extends Array { + x: number; + dx: number; + y: number; + } + + export interface HistogramLayout { + (values: Array, index?: number): Array; + value: { + (): (value: any) => any; + (accessor: (value: any) => any): HistogramLayout + } + range: { + (): (value: any, index: number) => Array; + (range: (value: any, index: number) => Array): HistogramLayout; + (range: Array): HistogramLayout; + } + bins: { + (): (range: Array, index: number) => Array; + (bins: (range: Array, index: number) => Array): HistogramLayout; + (bins: number): HistogramLayout; + (bins: Array): HistogramLayout; + } + frequency: { + (): boolean; + (frequency: boolean): HistogramLayout; + } + } + + export interface PackLayout { + sort: { + (): (a: GraphNode, b: GraphNode) => number; + (comparator: (a: GraphNode, b: GraphNode) => number): PackLayout; + } + children: { + (): (d: any, i?: number) => Array; + (children: (d: any, i?: number) => Array): PackLayout; + } + nodes(root: GraphNode): Array; + links(nodes: Array): Array; + value: { + (): (node: GraphNode) => number; + (value: (node: GraphNode) => number): PackLayout; + } + size: { + (): Array; + (size: Array): PackLayout; + } + padding: { + (): number; + (padding: number): PackLayout; + } + } + + export interface PartitionLayout { + sort: { + (): (a: GraphNode, b: GraphNode) => number; + (comparator: (a: GraphNode, b: GraphNode) => number): PackLayout; + } + children: { + (): (d: any, i?: number) => Array; + (children: (d: any, i?: number) => Array): PackLayout; + } + nodes(root: GraphNode): Array; + links(nodes: Array): Array; + value: { + (): (node: GraphNode) => number; + (value: (node: GraphNode) => number): PackLayout; + } + size: { + (): Array; + (size: Array): PackLayout; + } + } + + export interface TreeMapLayout { + sort: { + (): (a: GraphNode, b: GraphNode) => number; + (comparator: (a: GraphNode, b: GraphNode) => number): TreeMapLayout; + } + children: { + (): (d: any, i?: number) => Array; + (children: (d: any, i?: number) => Array): TreeMapLayout; + } + nodes(root: GraphNode): Array; + links(nodes: Array): Array; + value: { + (): (node: GraphNode) => number; + (value: (node: GraphNode) => number): TreeMapLayout; + } + size: { + (): Array; + (size: Array): TreeMapLayout; + } + padding: { + (): number; + (padding: number): TreeMapLayout; + } + round: { + (): boolean; + (round: boolean): TreeMapLayout; + } + sticky: { + (): boolean; + (sticky: boolean): TreeMapLayout; + } + mode: { + (): string; + (mode: string): TreeMapLayout; + } + } } + // Colour + export module Color { + export interface Color { + /** + * increase lightness by some exponential factor (gamma) + */ + brighter(k: number): Color; + /** + * decrease lightness by some exponential factor (gamma) + */ + darker(k: number): Color; + /** + * convert the color to a string. + */ + toString(): Color; + } + + export interface RGBColor extends Color{ + /** + * convert from RGB to HSL. + */ + hsl(): HSLColor; + } + + export interface HSLColor extends Color{ + /** + * convert from HSL to RGB. + */ + rgb(): RGBColor; + } + + export interface LABColor extends Color{ + /** + * convert from LAB to RGB. + */ + rgb(): RGBColor; + } + + export interface HCLColor extends Color{ + /** + * convert from HCL to RGB. + */ + rgb(): RGBColor; + } + } + + // SVG + export module Svg { + export interface Svg { + /** + * Create a new symbol generator + */ + symbol(): Symbol; + /** + * Create a new axis generator + */ + axis(): Axis; + /** + * Create a new arc generator + */ + arc(): Arc; + /** + * Create a new line generator + */ + line: { + (): Line; + radial(): LineRadial; + } + /** + * Create a new area generator + */ + area: { + (): Area; + radial(): AreaRadial; + } + /** + * Create a new brush generator + */ + brush(): Brush; + /** + * Create a new chord generator + */ + chord(): Chord; + /** + * Create a new diagonal generator + */ + diagonal: { + (): Diagonal; + radial(): Diagonal; + } + /** + * The array of supported symbol types. + */ + symbolTypes: Array; + } + + export interface Symbol { + type: (string) => Symbol; + size: (number) => Symbol; + } + + export interface Brush { + /** + * Draws or redraws this brush into the specified selection of elements + */ + (selection: Selection): void; + /** + * Gets or sets the x-scale associated with the brush + */ + x: { + /** + * Gets the x-scale associated with the brush + */ + (): D3.Scale.Scale; + /** + * Sets the x-scale associated with the brush + * + * @param accessor The new Scale + */ + (scale: D3.Scale.Scale): Brush; + }; + /** + * Gets or sets the x-scale associated with the brush + */ + y: { + /** + * Gets the x-scale associated with the brush + */ + (): D3.Scale.Scale; + /** + * Sets the x-scale associated with the brush + * + * @param accessor The new Scale + */ + (scale: D3.Scale.Scale): Brush; + }; + /** + * Gets or sets the current brush extent + */ + extent: { + /** + * Gets the current brush extent + */ + (): Array>; + /** + * Sets the current brush extent + */ + (values: Array>): Brush; + }; + /** + * Clears the extent, making the brush extent empty. + */ + clear(): Brush; + /** + * Returns true if and only if the brush extent is empty + */ + empty(): boolean; + /** + * Gets or sets the listener for the specified event type + */ + on: { + /** + * Gets the listener for the specified event type + */ + (type: string): (data: any, index: number) => any; + /** + * Sets the listener for the specified event type + */ + (type: string, listener: (data: any, index: number) => any, capture?: boolean): Brush; + }; + } + + export interface Axis { + (selection: Selection): void; + scale: { + (): any; + (scale: any): Axis; + }; + + orient: { + (): string; + (orientation: string): Axis; + }; + + ticks: { + (): any[]; + (...arguments: any[]): Axis; + }; + + tickSubdivide(count: number): Axis; + tickSize(major?: number, minor?: number, end?: number): Axis; + tickFormat(formatter: (value: any) => string): Axis; + } + + export interface Arc { + (options?: ArcOptions): string; + innerRadius: { + (): number; + (radius: number): Arc; + (radius: () => number): Arc; + }; + outerRadius: { + (): number; + (radius: number): Arc; + (radius: () => number): Arc; + }; + startAngle: { + (): number; + (angle: number): Arc; + (angle: () => number): Arc; + }; + endAngle: { + (): number; + (angle: number): Arc; + (angle: () => number): Arc; + }; + centroid(options?: ArcOptions): number[]; + } + + export interface ArcOptions { + innerRadius?: number; + outerRadius?: number; + startAngle?: number; + endAngle?: number; + } + + export interface Line { + /** + * Returns the path data string + * + * @param data Array of data elements + * @param index Optional index + */ + (data: any[], index?: number): string; + /** + * Get or set the x-coordinate accessor. + */ + x: { + /** + * Get the x-coordinate accessor. + */ + (): (data: any) => any; + /** + * Set the x-coordinate accessor. + * + * @param accessor The new accessor function + */ + (accessor: (data: any) => any): Line; + }; + /** + * Get or set the y-coordinate accessor. + */ + y: { + /** + * Get the y-coordinate accessor. + */ + (): (data: any) => any; + /** + * Set the y-coordinate accessor. + * + * @param accessor The new accessor function + */ + (accessor: (data: any) => any): Line; + }; + /** + * Get or set the interpolation mode. + */ + interpolate: { + /** + * Get the interpolation accessor. + */ + (): string; + /** + * Set the interpolation accessor. + * + * @param interpolate The interpolation mode + */ + (interpolate: string): Line; + }; + /** + * Get or set the cardinal spline tension. + */ + tension: { + /** + * Get the cardinal spline accessor. + */ + (): number; + /** + * Set the cardinal spline accessor. + * + * @param tension The Cardinal spline interpolation tension + */ + (tension: number): Line; + }; + /** + * Control whether the line is defined at a given point. + */ + defined: { + /** + * Get the accessor function that controls where the line is defined. + */ + (): (data: any) => any; + /** + * Set the accessor function that controls where the area is defined. + * + * @param defined The new accessor function + */ + (defined: (data: any) => any): Line; + }; + } + + export interface LineRadial { + /** + * Returns the path data string + * + * @param data Array of data elements + * @param index Optional index + */ + (data: any[], index?: number): string; + /** + * Get or set the x-coordinate accessor. + */ + x: { + /** + * Get the x-coordinate accessor. + */ + (): (data: any) => any; + /** + * Set the x-coordinate accessor. + * + * @param accessor The new accessor function + */ + (accessor: (data: any) => any): LineRadial; + }; + /** + * Get or set the y-coordinate accessor. + */ + y: { + /** + * Get the y-coordinate accessor. + */ + (): (data: any) => any; + /** + * Set the y-coordinate accessor. + * + * @param accessor The new accessor function + */ + (accessor: (data: any) => any): LineRadial; + }; + /** + * Get or set the interpolation mode. + */ + interpolate: { + /** + * Get the interpolation accessor. + */ + (): string; + /** + * Set the interpolation accessor. + * + * @param interpolate The interpolation mode + */ + (interpolate: string): LineRadial; + }; + /** + * Get or set the cardinal spline tension. + */ + tension: { + /** + * Get the cardinal spline accessor. + */ + (): number; + /** + * Set the cardinal spline accessor. + * + * @param tension The Cardinal spline interpolation tension + */ + (tension: number): LineRadial; + }; + /** + * Control whether the line is defined at a given point. + */ + defined: { + /** + * Get the accessor function that controls where the line is defined. + */ + (): (data: any) => any; + /** + * Set the accessor function that controls where the area is defined. + * + * @param defined The new accessor function + */ + (defined: (data: any) => any): LineRadial; + }; + radius: { + (): (d: any, i: any) => number; + (radius: number): LineRadial; + (radius: (d: any, i: any) => number): LineRadial; + } + angle: { + (): (d: any, i: any) => number; + (angle: number): LineRadial; + (angle: (d: any, i: any) => number): LineRadial; + } + } + + export interface Area { + /** + * Generate a piecewise linear area, as in an area chart. + */ + (data: any[], index?: number): string; + /** + * Get or set the x-coordinate accessor. + */ + x: { + /** + * Get the x-coordinate accessor. + */ + (): (data: any) => any; + /** + * Set the x-coordinate accessor. + * + * @param accessor The new accessor function + */ + (accessor: (data: any) => any): Area; + }; + /** + * Get or set the x0-coordinate (baseline) accessor. + */ + x0: { + /** + * Get the x0-coordinate (baseline) accessor. + */ + (): (data: any) => any; + /** + * Set the x0-coordinate (baseline) accessor. + * + * @param accessor The new accessor function + */ + (accessor: (data: any) => any): Area; + }; + /** + * Get or set the x1-coordinate (topline) accessor. + */ + x1: { + /** + * Get the x1-coordinate (topline) accessor. + */ + (): (data: any) => any; + /** + * Set the x1-coordinate (topline) accessor. + * + * @param accessor The new accessor function + */ + (accessor: (data: any) => any): Area; + }; + /** + * Get or set the y-coordinate accessor. + */ + y: { + /** + * Get the y-coordinate accessor. + */ + (): (data: any) => any; + /** + * Set the y-coordinate accessor. + * + * @param accessor The new accessor function + */ + (accessor: (data: any) => any): Area; + }; + /** + * Get or set the y0-coordinate (baseline) accessor. + */ + y0: { + /** + * Get the y0-coordinate (baseline) accessor. + */ + (): (data: any) => any; + /** + * Set the y0-coordinate (baseline) accessor. + * + * @param accessor The new accessor function + */ + (accessor: (data: any) => any): Area; + }; + /** + * Get or set the y1-coordinate (topline) accessor. + */ + y1: { + /** + * Get the y1-coordinate (topline) accessor. + */ + (): (data: any) => any; + /** + * Set the y1-coordinate (topline) accessor. + * + * @param accessor The new accessor function + */ + (accessor: (data: any) => any): Area; + }; + /** + * Get or set the interpolation mode. + */ + interpolate: { + /** + * Get the interpolation accessor. + */ + (): string; + /** + * Set the interpolation accessor. + * + * @param interpolate The interpolation mode + */ + (interpolate: string): Area; + }; + /** + * Get or set the cardinal spline tension. + */ + tension: { + /** + * Get the cardinal spline accessor. + */ + (): number; + /** + * Set the cardinal spline accessor. + * + * @param tension The Cardinal spline interpolation tension + */ + (tension: number): Area; + }; + /** + * Control whether the area is defined at a given point. + */ + defined: { + /** + * Get the accessor function that controls where the area is defined. + */ + (): (data: any) => any; + /** + * Set the accessor function that controls where the area is defined. + * + * @param defined The new accessor function + */ + (defined: (data: any) => any): Area; + }; + } + + export interface AreaRadial { + /** + * Generate a piecewise linear area, as in an area chart. + */ + (data: any[], index?: number): string; + /** + * Get or set the x-coordinate accessor. + */ + x: { + /** + * Get the x-coordinate accessor. + */ + (): (data: any) => any; + /** + * Set the x-coordinate accessor. + * + * @param accessor The new accessor function + */ + (accessor: (data: any) => any): AreaRadial; + }; + /** + * Get or set the x0-coordinate (baseline) accessor. + */ + x0: { + /** + * Get the x0-coordinate (baseline) accessor. + */ + (): (data: any) => any; + /** + * Set the x0-coordinate (baseline) accessor. + * + * @param accessor The new accessor function + */ + (accessor: (data: any) => any): AreaRadial; + }; + /** + * Get or set the x1-coordinate (topline) accessor. + */ + x1: { + /** + * Get the x1-coordinate (topline) accessor. + */ + (): (data: any) => any; + /** + * Set the x1-coordinate (topline) accessor. + * + * @param accessor The new accessor function + */ + (accessor: (data: any) => any): AreaRadial; + }; + /** + * Get or set the y-coordinate accessor. + */ + y: { + /** + * Get the y-coordinate accessor. + */ + (): (data: any) => any; + /** + * Set the y-coordinate accessor. + * + * @param accessor The new accessor function + */ + (accessor: (data: any) => any): AreaRadial; + }; + /** + * Get or set the y0-coordinate (baseline) accessor. + */ + y0: { + /** + * Get the y0-coordinate (baseline) accessor. + */ + (): (data: any) => any; + /** + * Set the y0-coordinate (baseline) accessor. + * + * @param accessor The new accessor function + */ + (accessor: (data: any) => any): AreaRadial; + }; + /** + * Get or set the y1-coordinate (topline) accessor. + */ + y1: { + /** + * Get the y1-coordinate (topline) accessor. + */ + (): (data: any) => any; + /** + * Set the y1-coordinate (topline) accessor. + * + * @param accessor The new accessor function + */ + (accessor: (data: any) => any): AreaRadial; + }; + /** + * Get or set the interpolation mode. + */ + interpolate: { + /** + * Get the interpolation accessor. + */ + (): string; + /** + * Set the interpolation accessor. + * + * @param interpolate The interpolation mode + */ + (interpolate: string): AreaRadial; + }; + /** + * Get or set the cardinal spline tension. + */ + tension: { + /** + * Get the cardinal spline accessor. + */ + (): number; + /** + * Set the cardinal spline accessor. + * + * @param tension The Cardinal spline interpolation tension + */ + (tension: number): AreaRadial; + }; + /** + * Control whether the area is defined at a given point. + */ + defined: { + /** + * Get the accessor function that controls where the area is defined. + */ + (): (data: any) => any; + /** + * Set the accessor function that controls where the area is defined. + * + * @param defined The new accessor function + */ + (defined: (data: any) => any): AreaRadial; + }; + radius: { + (): number; + (radius: number): AreaRadial; + (radius: () => number): AreaRadial; + }; + innerRadius: { + (): number; + (radius: number): AreaRadial; + (radius: () => number): AreaRadial; + }; + outerRadius: { + (): number; + (radius: number): AreaRadial; + (radius: () => number): AreaRadial; + }; + angle: { + (): number; + (angle: number): AreaRadial; + (angle: () => number): AreaRadial; + }; + startAngle: { + (): number; + (angle: number): AreaRadial; + (angle: () => number): AreaRadial; + }; + endAngle: { + (): number; + (angle: number): AreaRadial; + (angle: () => number): AreaRadial; + }; + } + + export interface Chord { + (datum: any, index?: number): string; + radius: { + (): number; + (radius: number): Chord; + (radius: () => number): Chord; + }; + startAngle: { + (): number; + (angle: number): Chord; + (angle: () => number): Chord; + }; + endAngle: { + (): number; + (angle: number): Chord; + (angle: () => number): Chord; + }; + source: { + (): any; + (angle: any): Chord; + (angle: (d: any, i?: number) => any): Chord; + }; + target: { + (): any; + (angle: any): Chord; + (angle: (d: any, i?: number) => any): Chord; + }; + } + + export interface Diagonal { + (datum: any, index?: number): string; + projection: { + (): Array; + (radius: (d: any, i?: number) => Array): Diagonal; + }; + source: { + (): any; + (angle: any): Diagonal; + (angle: (d: any, i?: number) => any): Diagonal; + }; + target: { + (): any; + (angle: any): Diagonal; + (angle: (d: any, i?: number) => any): Diagonal; + }; + } + } + + // Scales + export module Scale { + export interface ScaleBase { + /** + * Construct a linear quantitative scale. + */ + linear(): LinearScale; + /* + * Construct an ordinal scale. + */ + ordinal(): OrdinalScale; + /** + * Construct a linear quantitative scale with a discrete output range. + */ + quantize(): QuantizeScale; + /* + * Construct an ordinal scale with ten categorical colors. + */ + category10(): OrdinalScale; + /* + * Construct an ordinal scale with twenty categorical colors + */ + category20(): OrdinalScale; + /* + * Construct an ordinal scale with twenty categorical colors + */ + category20b(): OrdinalScale; + /* + * Construct an ordinal scale with twenty categorical colors + */ + category20c(): OrdinalScale; + /* + * Construct a linear identity scale. + */ + identity(): IdentityScale; + /* + * Construct a quantitative scale with an logarithmic transform. + */ + log(): LogScale; + /* + * Construct a quantitative scale with an exponential transform. + */ + pow(): PowScale; + /* + * Construct a quantitative scale mapping to quantiles. + */ + quantile(): QuantileScale; + /* + * Construct a quantitative scale with a square root transform. + */ + sqrt(): SqrtScale; + /* + * Construct a threshold scale with a discrete output range. + */ + theshold(): ThresholdScale; + } + + export interface Scale { + (value: any): any; + domain: { + (values: any[]): Scale; + (): any[]; + }; + range: { + (values: any[]): Scale; + (): any[]; + }; + copy(): Scale; + } + + export interface QuantitiveScale extends Scale { + /** + * Get the range value corresponding to a given domain value. + * + * @param value Domain Value + */ + (value: number): number; + /** + * Get the domain value corresponding to a given range value. + * + * @param value Range Value + */ + invert(value: number): number; + /** + * Get or set the scale's input domain. + */ + domain: { + /** + * Set the scale's input domain. + * + * @param value The input domain + */ + (values: any[]): QuantitiveScale; + /** + * Get the scale's input domain. + */ + (): any[]; + }; + /** + * get or set the scale's output range. + */ + range: { + /** + * Set the scale's output range. + * + * @param value The output range. + */ + (values: any[]): QuantitiveScale; + /** + * Get the scale's output range. + */ + (): any[]; + }; + /** + * Set the scale's output range, and enable rounding. + * + * @param value The output range. + */ + rangeRound: (values: any[]) => QuantitiveScale; + /** + * get or set the scale's output interpolator. + */ + interpolate: { + (): D3.Transition.Interpolate; + (factory: D3.Transition.Interpolate): QuantitiveScale; + }; + /** + * enable or disable clamping of the output range. + * + * @param clamp Enable or disable + */ + clamp(clamp: boolean): QuantitiveScale; + /** + * extend the scale domain to nice round numbers. + */ + nice(): QuantitiveScale; + /** + * get representative values from the input domain. + * + * @param count Aproximate representative values to return. + */ + ticks(count: number): any[]; + /** + * get a formatter for displaying tick values + * + * @param count Aproximate representative values to return + */ + tickFormat(count: number): (n: number) => string; + /** + * create a new scale from an existing scale.. + */ + copy(): QuantitiveScale; + } + + export interface LinearScale extends QuantitiveScale { + /** + * Get the range value corresponding to a given domain value. + * + * @param value Domain Value + */ + (value: number): number; + } + + export interface IdentityScale extends QuantitiveScale { + /** + * Get the range value corresponding to a given domain value. + * + * @param value Domain Value + */ + (value: number): number; + } + + export interface SqrtScale extends QuantitiveScale { + /** + * Get the range value corresponding to a given domain value. + * + * @param value Domain Value + */ + (value: number): number; + } + + export interface PowScale extends QuantitiveScale { + /** + * Get the range value corresponding to a given domain value. + * + * @param value Domain Value + */ + (value: number): number; + } + + export interface LogScale extends QuantitiveScale { + /** + * Get the range value corresponding to a given domain value. + * + * @param value Domain Value + */ + (value: number): number; + } + + export interface OrdinalScale extends Scale { + /** + * Get the range value corresponding to a given domain value. + * + * @param value Domain Value + */ + (value: any): any; + /** + * Get or set the scale's input domain. + */ + domain: { + /** + * Set the scale's input domain. + * + * @param value The input domain + */ + (values: any[]): OrdinalScale; + /** + * Get the scale's input domain. + */ + (): any[]; + }; + /** + * get or set the scale's output range. + */ + range: { + /** + * Set the scale's output range. + * + * @param value The output range. + */ + (values: any[]): OrdinalScale; + /** + * Get the scale's output range. + */ + (): any[]; + }; + rangePoints(interval: any[], padding?: number): OrdinalScale; + rangeBands(interval: any[], padding?: number, outerPadding?: number): OrdinalScale; + rangeRoundBands(interval: any[], padding?: number, outerPadding?: number): OrdinalScale; + rangeBand(): number; + rangeExtent(): any[]; + /** + * create a new scale from an existing scale.. + */ + copy(): OrdinalScale; + } + + export interface QuantizeScale extends Scale { + (value: any): any; + domain: { + (values: number[]): QuantizeScale; + (): any[]; + }; + range: { + (values: any[]): QuantizeScale; + (): any[]; + }; + copy(): QuantizeScale; + } + + export interface ThresholdScale extends Scale { + (value: any): any; + domain: { + (values: number[]): ThresholdScale; + (): any[]; + }; + range: { + (values: any[]): ThresholdScale; + (): any[]; + }; + copy(): ThresholdScale; + } + + export interface QuantileScale extends Scale { + (value: any): any; + domain: { + (values: number[]): QuantileScale; + (): any[]; + }; + range: { + (values: any[]): QuantileScale; + (): any[]; + }; + quantiles(): any[]; + copy(): QuantileScale; + } + + export interface TimeScale extends Scale { + (value: Date): number; + invert(value: number): Date; + domain: { + (values: any[]): TimeScale; + (): any[]; + }; + range: { + (values: any[]): TimeScale; + (): any[]; + }; + rangeRound: (values: any[]) => TimeScale; + interpolate: { + (): D3.Transition.Interpolate; + (factory: D3.Transition.InterpolateFactory): TimeScale; + }; + clamp(clamp: boolean): TimeScale; + ticks: { + (count: number): any[]; + (range: Range, count: number): any[]; + }; + tickFormat(count: number): (n: number) => string; + copy(): TimeScale; + } + } + + // Behaviour + export module Behaviour { + export interface Behavior{ + /** + * Constructs a new drag behaviour + */ + drag(): Drag; + /** + * Constructs a new zoom behaviour + */ + zoom(): Zoom; + } + + export interface Zoom { + /** + * Execute zoom method + */ + (): any; + + /** + * Registers a listener to receive events + * + * @param type Enent name to attach the listener to + * @param listener Function to attach to event + */ + on: (type: string, listener: (data: any, index?: number) => any) => Zoom; + + /** + * Gets or set the current zoom scale + */ + scale: { + /** + * Get the current current zoom scale + */ + (): number; + /** + * Set the current current zoom scale + * + * @param origin Zoom scale + */ + (scale: number): Zoom; + }; + + /** + * Gets or set the current zoom translation vector + */ + translate: { + /** + * Get the current zoom translation vector + */ + (): number[]; + /** + * Set the current zoom translation vector + * + * @param translate Tranlation vector + */ + (translate: number[]): Zoom; + }; + + /** + * Gets or set the allowed scale range + */ + scaleExtent: { + /** + * Get the current allowed zoom range + */ + (): number[]; + /** + * Set the allowable zoom range + * + * @param extent Allowed zoom range + */ + (extent: number[]): Zoom; + }; + + /** + * Gets or set the X-Scale that should be adjusted when zooming + */ + x: { + /** + * Get the X-Scale + */ + (): D3.Scale.Scale; + /** + * Set the X-Scale to be adjusted + * + * @param x The X Scale + */ + (x: D3.Scale.Scale): Zoom; + + }; + + /** + * Gets or set the Y-Scale that should be adjusted when zooming + */ + y: { + /** + * Get the Y-Scale + */ + (): D3.Scale.Scale; + /** + * Set the Y-Scale to be adjusted + * + * @param y The Y Scale + */ + (y: D3.Scale.Scale): Zoom; + }; + } + + export interface Drag { + /** + * Execute drag method + */ + (): any; + + /** + * Registers a listener to receive events + * + * @param type Enent name to attach the listener to + * @param listener Function to attach to event + */ + on: (type: string, listener: (data: any, index?: number) => any) => Drag; + + /** + * Gets or set the current origin accessor function + */ + origin: { + /** + * Get the current origin accessor function + */ + (): any; + /** + * Set the origin accessor function + * + * @param origin Accessor function + */ + (origin?: any): Drag; + }; + } + } + + // Geography + export module Geo { + export interface Geo { + /** + * create a new geographic path generator + */ + path(): Path; + /** + * create a circle generator. + */ + circle(): Circle; + /** + * compute the spherical area of a given feature. + */ + area(feature: any): number; + /** + * compute the latitude-longitude bounding box for a given feature. + */ + bounds(feature: any): Array>; + /** + * compute the spherical centroid of a given feature. + */ + centroid(feature: any): Array; + /** + * compute the great-arc distance between two points. + */ + distance(a: Array, b: Array): number; + /** + * interpolate between two points along a great arc. + */ + interpolate(a: Array, b: Array): (t: number) => Array; + /** + * compute the length of a line string or the circumference of a polygon. + */ + length(feature: any): number; + /** + * create a standard projection from a raw projection. + */ + projection(raw: (lambda: any, phi: any) => any): Projection; + /** + * create a standard projection from a mutable raw projection. + */ + projectionMutator(rawFactory: (lambda: number, phi: number) => Array): Projection; + /** + * the Albers equal-area conic projection. + */ + albers(): Projection; + /** + * a composite Albers projection for the United States. + */ + albersUsa(): Projection; + /** + * the azimuthal equal-area projection. + */ + azimuthalEqualArea: { + (): Projection; + raw(): Projection; + } + /** + * the azimuthal equidistant projection. + */ + azimuthalEquidistant: { + (): Projection; + raw(): Projection; + } + /** + * the conic conformal projection. + */ + conicConformal: { + (): Projection; + raw(): Projection; + } + /** + * the conic equidistant projection. + */ + conicEquidistant: { + (): Projection; + raw(): Projection; + } + /** + * the conic equal-area (a.k.a. Albers) projection. + */ + conicEqualArea: { + (): Projection; + raw(): Projection; + } + /** + * the equirectangular (plate carreé) projection. + */ + equirectangular: { + (): Projection; + raw(): Projection; + } + /** + * the gnomonic projection. + */ + gnomonic: { + (): Projection; + raw(): Projection; + } + /** + * the spherical Mercator projection. + */ + mercator: { + (): Projection; + raw(): Projection; + } + /** + * the azimuthal orthographic projection. + */ + othographic: { + (): Projection; + raw(): Projection; + } + /** + * the azimuthal stereographic projection. + */ + stereographic: { + (): Projection; + raw(): Projection; + } + /** + * the transverse Mercator projection. + */ + transverseMercator: { + (): Projection; + raw(): Projection; + } + /** + * convert a GeoJSON object to a geometry stream. + */ + stream(object: GeoJSON, listener: any): Stream; + /** + * + */ + graticule(): Graticule; + /** + * + */ + greatArc: GreatArc; + /** + * + */ + rotation(rotation: Array): Rotation; + } + + export interface Path { + /** + * Returns the path data string for the given feature + */ + (feature: any, index?: any): string; + /** + * get or set the geographic projection. + */ + projection: { + /** + * get the geographic projection. + */ + (): Projection; + /** + * set the geographic projection. + */ + (projection: Projection): Path; + } + /** + * get or set the render context. + */ + context: { + /** + * return an SVG path string invoked on the given feature. + */ + (): string; + /** + * sets the render context and returns the path generator + */ + (context: Context): Path; + } + /** + * Computes the projected area + */ + area(feature: any); + /** + * Computes the projected centroid + */ + centroid(feature: any); + /** + * Computes the projected bounding box + */ + bounds(feature: any); + /** + * get or set the radius to display point features. + */ + pointRadius: { + /** + * returns the current radius + */ + (): number; + /** + * sets the radius used to display Point and MultiPoint features to the specified number + */ + (radius: number): Path; + /** + * sets the radius used to display Point and MultiPoint features to the specified number + */ + (radius: (feature: any, index: number) => number): Path; + } + } + + export interface Context { + beginPath(): any; + moveTo(x: number, y: number): any; + lineTo(x: number, y: number): any; + arc(x: number, y: number, radius: number, startAngle: number, endAngle: number): any; + closePath(): any; + } + + export interface Circle { + (...args: Array): GeoJSON; + origin: { + (): Array; + (origin: Array): Circle; + (origin: (...args: Array) => Array): Circle; + } + angle: { + (): number; + (angle: number): Circle; + } + precision: { + (): number; + (precision: number): Circle; + } + } + + export interface Graticule{ + (): GeoJSON; + lines(): GeoJSON; + outline(): GeoJSON; + extent: { + (): Array>; + (extent: Array>): Graticule; + } + minorExtent: { + (): Array>; + (extent: Array>): Graticule; + } + majorExtent: { + (): Array>; + (extent: Array>): Graticule; + } + step: { + (): Array>; + (extent: Array>): Graticule; + } + minorStep: { + (): Array>; + (extent: Array>): Graticule; + } + majorStep: { + (): Array>; + (extent: Array>): Graticule; + } + precision: { + (): number; + (precision: number): Graticule; + } + } + + export interface GreatArc { + (): GeoJSON; + distance(): number; + source: { + (): any; + (source: any): GreatArc; + } + target: { + (): any; + (target: any): GreatArc; + } + precision: { + (): number; + (precision: number): GreatArc; + } + } + + export interface GeoJSON { + coordinates: Array>; + type: string; + } + + export interface Projection { + (coordinates: Array): Array; + invert(point: Array): Array; + rotate: { + (): Array; + (rotation: Array): Projection; + }; + center: { + (): Array; + (location: Array): Projection; + }; + translate: { + (): Array; + (point: Array): Projection; + }; + scale: { + (): number; + (scale: number): Projection; + }; + clipAngle: { + (): number; + (angle: number): Projection; + }; + clipExtent: { + (): Array>; + (extent: Array>): Projection; + }; + precision: { + (): number; + (precision: number): Projection; + }; + stream(listener?: any): Stream; + } + + export interface Stream { + point(x: number, y: number, z?: number): void; + lineStart(): void; + lineEnd(): void; + polygonStart(): void; + polygonEnd(): void; + sphere(): void; + } + + export interface Rotation extends Array { + (location: Array): Rotation; + invert(location: Array): Rotation; + } + } + + // Geometry + export module Geom { + export interface Geom { + /** + * compute the Voronoi diagram for the specified points. + */ + voronoi: Voronoi + /** + * compute the Delaunay triangulation for the specified points. + */ + delaunay(vertices?: Array): Array; + /** + * constructs a quadtree for an array of points. + */ + quadtree: Quadtree; + /** + * constructs a polygon + */ + polygon: Polygon; + /** + * creates a new hull layout with the default settings. + */ + hull: Hull; + } + + export interface Vertice extends Array { + /** + * Returns the angle of the vertice + */ + angle?: number; + } + + export interface Polygon extends Array { + /** + * Returns the input array of vertices with additional methods attached + */ + (vertices: Array): Polygon; + /** + * Returns the signed area of this polygon + */ + area(): number; + /** + * Returns a two-element array representing the centroid of this polygon. + */ + centroid(): Array; + /** + * Clips the subject polygon against this polygon + */ + clip(subject: Polygon): Polygon; + } + + export interface Quadtree { + /** + * Constructs a new quadtree for the specified array of points. + */ + (): Quadtree; + /** + * Constructs a new quadtree for the specified array of points. + */ + (points: Array, x1: number, y1: number, x2: number, y2: number): Quadtree; + /** + * Constructs a new quadtree for the specified array of points. + */ + (points: Array, width: number, height: number): Quadtree; + /** + * Adds a new point to the quadtree. + */ + add(point: Point): Quadtree; + visit(callback: any): Quadtree; + x: { + (): (d: any) => any; + (accesor: (d: any) => any): Quadtree; + + } + y: { + (): (d: any) => any; + (accesor: (d: any) => any): Quadtree; + + } + size(size: Array): Quadtree; + } + + export interface Point { + x: number; + y: number; + } + + export interface Voronoi { + (vertices?: Array): Array; + x: { + (): (d: any) => any; + (accesor: (d: any) => any): any; + } + y: { + (): (d: any) => any; + (accesor: (d: any) => any): any; + } + } + + export interface Hull { + (vertices: Array): Hull; + x: { + (): (d: any) => any; + (accesor: (d: any) => any): any; + } + y: { + (): (d: any) => any; + (accesor: (d: any) => any): any; + } + } + } } declare var d3: D3.Base; From d1dcb7100b0286823f461a3eddc17c1a90f0ba3c Mon Sep 17 00:00:00 2001 From: Diullei Gomes Date: Thu, 20 Jun 2013 22:06:07 -0300 Subject: [PATCH 28/57] fixed qunit test file. --- qunit/qunit-tests.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/qunit/qunit-tests.ts b/qunit/qunit-tests.ts index 9a4849379..abc1af8c7 100644 --- a/qunit/qunit-tests.ts +++ b/qunit/qunit-tests.ts @@ -122,7 +122,7 @@ test("a test", function () { QUnit.config.autostart = false; QUnit.start(); -QUnit.config.urlConfig.push({ +QUnit.config.urlConfig.push({ id: "min", label: "Minified source", tooltip: "Load minified source files instead of the regular unminified ones." @@ -729,13 +729,7 @@ test("just a test", function() { // ************** BUG ? ****************** // TODO disable reordering for this suite! -var begin = 0, - moduleStart = 0, - moduleDone = 0, - testStart = 0, - testDone = 0, - log = 0, - moduleContext, +var moduleContext, moduleDoneContext, testContext, testDoneContext, From 29ca030b2546dafb65209278881b1e1446093da0 Mon Sep 17 00:00:00 2001 From: Theodore Brown Date: Thu, 20 Jun 2013 20:20:53 -0500 Subject: [PATCH 29/57] Fixed several incorrectly encoded characters, escaped apostrophe in string --- jquery.pickadate/jquery.pickadate-tests.ts | 2 +- jquery.pickadate/jquery.pickadate.d.ts | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/jquery.pickadate/jquery.pickadate-tests.ts b/jquery.pickadate/jquery.pickadate-tests.ts index ca68d6e91..ac6a161c6 100644 --- a/jquery.pickadate/jquery.pickadate-tests.ts +++ b/jquery.pickadate/jquery.pickadate-tests.ts @@ -392,7 +392,7 @@ $('.datepicker').pickadate({ }); picker.on('open', function () { - console.log('Didn't open.. yet here I am!'); + console.log('Didn\'t open.. yet here I am!'); }) picker.trigger('open'); diff --git a/jquery.pickadate/jquery.pickadate.d.ts b/jquery.pickadate/jquery.pickadate.d.ts index 0de785108..d0825c770 100644 --- a/jquery.pickadate/jquery.pickadate.d.ts +++ b/jquery.pickadate/jquery.pickadate.d.ts @@ -262,10 +262,10 @@ interface DatePickerObject extends PickerObject { /** Returns the item object that sets the current view. */ get(thing: 'view'): DatePickerItemObject; - /** Returns the item object that limits the picker�s lower range. */ + /** Returns the item object that limits the picker's lower range. */ get(thing: 'min'): DatePickerItemObject; - /** Returns the item object that limits the picker�s upper range. */ + /** Returns the item object that limits the picker's upper range. */ get(thing: 'max'): DatePickerItemObject; /** Returns a boolean value of whether the picker is open or not. */ @@ -310,13 +310,13 @@ interface TimePickerObject extends PickerObject { /** Refresh the picker after adding something to the holder. */ render(): TimePickerObject; - /** Clear the value in the picker�s input element. */ + /** Clear the value in the picker's input element. */ clear(): TimePickerObject; /** Get the properties, objects, and states that make up the current state of the picker. */ get(thing: string): any; - /** Returns the string value of the picker�s input element. */ + /** Returns the string value of the picker's input element. */ get(thing?: 'value'): string; /** Returns the item object that is visually selected. */ @@ -328,10 +328,10 @@ interface TimePickerObject extends PickerObject { /** Returns the item object that sets the current view. */ get(thing: 'view'): TimePickerItemObject; - /** Returns the item object that limits the picker�s lower range. */ + /** Returns the item object that limits the picker's lower range. */ get(thing: 'min'): TimePickerItemObject; - /** Returns the item object that limits the picker�s upper range. */ + /** Returns the item object that limits the picker's upper range. */ get(thing: 'max'): TimePickerItemObject; /** Returns a boolean value of whether the picker is open or not. */ From b4adabde422d362e168031cddea651137ef9fc86 Mon Sep 17 00:00:00 2001 From: Diullei Gomes Date: Fri, 21 Jun 2013 02:01:23 -0300 Subject: [PATCH 30/57] Merge pull request #641 --- knockout/knockout.d.ts | 46 +++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/knockout/knockout.d.ts b/knockout/knockout.d.ts index 67858f088..f0909ddc9 100644 --- a/knockout/knockout.d.ts +++ b/knockout/knockout.d.ts @@ -15,7 +15,7 @@ interface KnockoutSubscribableFunctions { interface KnockoutComputedFunctions extends KnockoutSubscribableFunctions { getDependenciesCount(): number; - hasWriteFunction(): bool; + hasWriteFunction(): boolean; } interface KnockoutObservableFunctions extends KnockoutSubscribableFunctions { @@ -72,15 +72,15 @@ interface KnockoutComputed extends KnockoutComputedFunctions { (value: T): void; subscribe(callback: (newValue: T) => void, target?:any, topic?: string): KnockoutSubscription; - notifySubscribers(valueToWrite: T, topic?: string); + notifySubscribers(valueToWrite: T, topic?: string); } interface KnockoutObservableArrayStatic { fn: KnockoutObservableArrayFunctions; - + (): KnockoutObservableArray; - (value: T[]): KnockoutObservableArray; + (value: T[]): KnockoutObservableArray; } interface KnockoutObservableArray extends KnockoutObservableArrayFunctions { @@ -94,18 +94,18 @@ interface KnockoutObservableArray extends KnockoutObservableArrayFunctions interface KnockoutObservableStatic { fn: KnockoutObservableFunctions; - (value: T): KnockoutObservable; - (): KnockoutObservable; + (value?: T): KnockoutObservable; + (): KnockoutObservable; } /** use as method to get/set the value */ interface KnockoutObservableBase extends KnockoutObservableFunctions { getSubscriptionsCount(): number; } - + interface KnockoutObservable extends KnockoutObservableBase { (): T; - (value: T): void; + (value: T): void; subscribe(callback: (newValue: T) => void, target?:any, topic?: string): KnockoutSubscription; notifySubscribers(valueToWrite: T, topic?: string); @@ -176,7 +176,7 @@ interface KnockoutMemoization { interface KnockoutVirtualElement {} interface KnockoutVirtualElements { - allowedBindings: { [bindingName: string]: bool; }; + allowedBindings: { [bindingName: string]: boolean; }; emptyNode( e: KnockoutVirtualElement ); firstChild( e: KnockoutVirtualElement ); insertAfter( container: KnockoutVirtualElement, nodeToInsert: HTMLElement, insertAfter: HTMLElement ); @@ -216,7 +216,7 @@ interface KnockoutUtils { set (node: Element, key: string, value: any); - getAll(node: Element, createIfNotFound: bool); + getAll(node: Element, createIfNotFound: boolean); clear(node: Element); }; @@ -245,7 +245,7 @@ interface KnockoutUtils { arrayIndexOf(array: any[], item: any): number; - arrayFirst(array: any[], predicate: (item) => bool, predicateOwner?: any): any; + arrayFirst(array: any[], predicate: (item) => boolean, predicateOwner?: any): any; arrayRemoveItem(array: any[], itemToRemove: any): void; @@ -253,7 +253,7 @@ interface KnockoutUtils { arrayMap(array: any[], mapping: (item) => any): any[]; - arrayFilter(array: any[], predicate: (item) => bool): any[]; + arrayFilter(array: any[], predicate: (item) => boolean): any[]; arrayPushAll(array: any[], valuesToPush: any[]): any[]; @@ -263,13 +263,13 @@ interface KnockoutUtils { moveCleanedNodesToContainerElement(nodes: any[]): HTMLElement; - cloneNodes(nodesArray: any[], shouldCleanNodes: bool): any[]; + cloneNodes(nodesArray: any[], shouldCleanNodes: boolean): any[]; setDomNodeChildren(domNode: any, childNodes: any[]): void; replaceDomNodes(nodeToReplaceOrNodeArray: any, newNodesArray: any[]): void; - setOptionNodeSelectionState(optionNode: any, isSelected: bool): void; + setOptionNodeSelectionState(optionNode: any, isSelected: boolean): void; stringTrim(str: string): string; @@ -277,9 +277,9 @@ interface KnockoutUtils { stringStartsWith(str: string, startsWith: string): string; - domNodeIsContainedBy(node: any, containedByNode: any): bool; + domNodeIsContainedBy(node: any, containedByNode: any): boolean; - domNodeIsAttachedToDocument(node: any): bool; + domNodeIsAttachedToDocument(node: any): boolean; tagNameLower(element: any): string; @@ -289,7 +289,7 @@ interface KnockoutUtils { unwrapObservable(value: any): any; - toggleDomNodeCssClass(node: any, className: string, shouldHaveClass: bool): void; + toggleDomNodeCssClass(node: any, className: string, shouldHaveClass: boolean): void; //setTextContent(element: any, textContent: string): void; // NOT PART OF THE MINIFIED API SURFACE (ONLY IN knockout-{version}.debug.js) https://github.com/SteveSanderson/knockout/issues/670 @@ -315,9 +315,9 @@ interface KnockoutUtils { ieVersion: number; - isIe6: bool; + isIe6: boolean; - isIe7: bool; + isIe7: boolean; } ////////////////////////////////// @@ -365,7 +365,7 @@ interface KnockoutTemplateEngine extends KnockoutNativeTemplateEngine { renderTemplate(template, bindingContext, options, templateDocument); - isTemplateRewritten(template, templateDocument): bool; + isTemplateRewritten(template, templateDocument): boolean; rewriteTemplate(template, rewriterCallback, templateDocument); } @@ -389,11 +389,11 @@ interface KnockoutStatic { observableArray: KnockoutObservableArrayStatic; contextFor(node: any): any; - isSubscribable(instance: any): bool; + isSubscribable(instance: any): boolean; toJSON(viewModel: any, replacer?: Function, space?: any): string; toJS(viewModel: any): any; - isObservable(instance: any): bool; - isComputed(instance: any): bool; + isObservable(instance: any): boolean; + isComputed(instance: any): boolean; dataFor(node: any): any; removeNode(node: Element); cleanNode(node: Element); From 91a4452e37e0c97ac17b991b7e22d4e979da82bf Mon Sep 17 00:00:00 2001 From: Andrew Gaspar Date: Thu, 20 Jun 2013 22:03:23 -0700 Subject: [PATCH 31/57] Removed separate q module tests and updated with some addition typing information for Q.d.ts. --- q/Q-tests.ts | 17 +++++----- q/Q.d.ts | 44 ++++++++++++++------------ q/q.module-tests.ts | 75 --------------------------------------------- 3 files changed, 34 insertions(+), 102 deletions(-) delete mode 100644 q/q.module-tests.ts diff --git a/q/Q-tests.ts b/q/Q-tests.ts index 02a409b6b..f982ae8d6 100644 --- a/q/Q-tests.ts +++ b/q/Q-tests.ts @@ -1,5 +1,7 @@ /// +import q = module('q'); + Q(8).then(x => console.log(x.toExponential())); var delay = function (delay: number) { @@ -12,6 +14,14 @@ Q.when(delay(1000), function () { console.log('Hello, World!'); }); +Q.delay(Q(8), 1000).then(x => x.toExponential()); +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); +eventualAdd(Q(1), Q(2)).then(x => x.toExponential()); + var eventually = function (eventually) { return Q.delay(eventually, 1000); }; @@ -48,11 +58,4 @@ Q.allResolved([]) var exception = promise.valueOf().exception; } }) -}); - -var initialVal: any; -var funcs = ['foo', 'bar', 'baz', 'qux']; -var result = Q.resolve(initialVal); -funcs.forEach(function (f) { - result = result.then(f); }); \ No newline at end of file diff --git a/q/Q.d.ts b/q/Q.d.ts index 951f615d0..56a070b35 100644 --- a/q/Q.d.ts +++ b/q/Q.d.ts @@ -16,22 +16,23 @@ declare module Q { interface Promise { fail(errorCallback: Function): Promise; - fin(finallyCallback: Function): Promise; + fin(finallyCallback: Function): Promise; + finally(finallyCallback: Function): Promise; then(onFulfilled?: (value: T) => any, onRejected?: (reason) => any, onProgress?: Function): Promise; spread(onFulfilled: Function, onRejected?: Function): Promise; catch(onRejected: Function): Promise; progress(onProgress: Function): Promise; - done(onFulfilled?: Function, onRejected?: Function, onProgress?: Function): Promise; + done(onFulfilled?: Function, onRejected?: Function, onProgress?: Function): void; get(propertyName: String): Promise; set(propertyName: String, value: any): Promise; delete(propertyName: String): Promise; post(methodName: String, args: any[]): Promise; invoke(methodName: String, ...args: any[]): Promise; - keys(): Promise; + keys(): Promise; fapply(args: any[]): Promise; fcall(method: Function, ...args: any[]): Promise; - timeout(ms: number): Promise; - delay(ms: number): Promise; + timeout(ms: number, message?): Promise; + delay(ms: number): Promise; isFulfilled(): bool; isRejected(): bool; isPending(): bool; @@ -48,22 +49,25 @@ declare module Q { export function all(promises: Promise[]): Promise; export function allResolved(promises: Promise[]): Promise; export function spread(onFulfilled: Function, onRejected: Function): Promise; - export function timeout(ms: number): Promise; - export function delay(ms: number): Promise; - export function delay(value: any, ms: number): Promise; - export function isFulfilled(): bool; - export function isRejected(): bool; - export function isPending(): bool; - export function valueOf(): any; + export function timeout(promise: Promise, ms: number, message?): Promise; + export function delay(promise: Promise, ms: number): Promise; + export function delay(value: T, ms: number): Promise; + export function isFulfilled(promise: Promise): bool; + export function isRejected(promise: Promise): bool; + export function isPending(promise: Promise): bool; + export function valueOf(promise: Promise): T; export function defer(): Deferred; - export function reject(): Promise; - export function promise(factory: { resolve: Function; reject: Function; notify: Function; }): Promise; - export function isPromise(value: any): bool; - export function async(generatorFunction: any): Deferred; - export function nextTick(callback: Function); - export var oneerror: any; - export var longStackJumpLimit: number; - export function resolve(object?: Promise); + export function reject(reason?): Promise; + export function promise(factory: { resolve: Function; reject: Function; notify: Function; }): Promise; + export function promised(callback: (...any) => T): (...any) => Promise; + export function isPromise(object): bool; + export function isPromiseAlike(object): bool; + export function isPending(object): bool; + export function async(generatorFunction: any): (...args) => Promise; + export function nextTick(callback: Function): void; + export var oneerror: () => void; + export var longStackSupport: bool; + export function resolve(object): Promise; } declare module "q" { diff --git a/q/q.module-tests.ts b/q/q.module-tests.ts deleted file mode 100644 index a589ca1d6..000000000 --- a/q/q.module-tests.ts +++ /dev/null @@ -1,75 +0,0 @@ -/// -/// -/// - -import q = module("q"); -import fs = module("fs"); - -q(8).then(x => console.log(x.toExponential())); - -var delay = function (delay) { - var d = q.defer(); - setTimeout(d.resolve, delay); - return d.promise; -}; - -q.when(delay(1000), function () { - console.log('Hello, World!'); -}); - -var eventually = function (eventually) { - return q.delay(eventually, 1000); -}; - -var x = q.all([1, 2, 3].map(eventually)); -q.when(x, function (x) { - console.log(x); -}); - -q.all([ - eventually(10), - eventually(20) -]) -.spread(function (x, y) { - console.log(x, y); -}); - -q.fcall(function () { }) -.then(function () { }) -.then(function () { }) -.then(function () { }) -.then(function (value4) { - // Do something with value4 -}, function (error) { - // Handle any error from step1 through step4 -}).done(); - -q.allResolved([]).then(function (promises: Q.Promise[]) { - promises.forEach(function (promise) { - if (promise.isFulfilled()) { - var value = promise.valueOf(); - } else { - var exception = promise.valueOf().exception; - } - }) -}); - -var initialVal: any; -var funcs = ['foo', 'bar', 'baz', 'qux']; -var result = q.resolve(initialVal); -funcs.forEach(function (f) { - result = result.then(f); -}); - -var replaceText = (text: string) => text.replace("a", "b"); - -q.nfcall(fs.readFile, "foo.txt", "utf-8").then(replaceText); - -q.ninvoke(fs, "readFile", "foo.txt", "utf-8").then(replaceText); - -var deferred = q.defer(); -fs.readFile("foo.txt", "utf-8", deferred.makeNodeResolver()); -deferred.promise.then(replaceText); - -var readFile = q.nfbind(fs.readFile); -readFile("foo.txt", "utf-8").then(replaceText); \ No newline at end of file From d4b888e50fc7626f64d220ad14db1a2681f125c7 Mon Sep 17 00:00:00 2001 From: Andrew Gaspar Date: Thu, 20 Jun 2013 22:06:09 -0700 Subject: [PATCH 32/57] Slight update to q.d.ts to reflect current limitations in TypeScript. --- q/Q.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/q/Q.d.ts b/q/Q.d.ts index 56a070b35..dd6786594 100644 --- a/q/Q.d.ts +++ b/q/Q.d.ts @@ -3,8 +3,8 @@ // Definitions by: Barrie Nemetchek, Andrew Gaspar // Definitions: https://github.com/borisyankov/DefinitelyTyped -declare function Q(value: T): Q.Promise; -//declare function Q(value: Q.Promise): Q.Promise +declare function Q(value): Q.Promise; + declare module Q { interface Deferred { promise: Promise; From 41c216fb10e2da757f55d1ee2d1d0035b7f3e768 Mon Sep 17 00:00:00 2001 From: Andrew Gaspar Date: Thu, 20 Jun 2013 22:25:55 -0700 Subject: [PATCH 33/57] Changed bool to boolean for q.d.ts --- q/Q.d.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/q/Q.d.ts b/q/Q.d.ts index dd6786594..9fd4518f2 100644 --- a/q/Q.d.ts +++ b/q/Q.d.ts @@ -33,9 +33,9 @@ declare module Q { fcall(method: Function, ...args: any[]): Promise; timeout(ms: number, message?): Promise; delay(ms: number): Promise; - isFulfilled(): bool; - isRejected(): bool; - isPending(): bool; + isFulfilled(): boolean; + isRejected(): boolean; + isPending(): boolean; valueOf(): any; } @@ -52,21 +52,21 @@ declare module Q { export function timeout(promise: Promise, ms: number, message?): Promise; export function delay(promise: Promise, ms: number): Promise; export function delay(value: T, ms: number): Promise; - export function isFulfilled(promise: Promise): bool; - export function isRejected(promise: Promise): bool; - export function isPending(promise: Promise): bool; + export function isFulfilled(promise: Promise): boolean; + export function isRejected(promise: Promise): boolean; + export function isPending(promise: Promise): boolean; export function valueOf(promise: Promise): T; export function defer(): Deferred; export function reject(reason?): Promise; export function promise(factory: { resolve: Function; reject: Function; notify: Function; }): Promise; export function promised(callback: (...any) => T): (...any) => Promise; - export function isPromise(object): bool; - export function isPromiseAlike(object): bool; - export function isPending(object): bool; + export function isPromise(object): boolean; + export function isPromiseAlike(object): boolean; + export function isPending(object): boolean; export function async(generatorFunction: any): (...args) => Promise; export function nextTick(callback: Function): void; export var oneerror: () => void; - export var longStackSupport: bool; + export var longStackSupport: boolean; export function resolve(object): Promise; } From 82ae26b96c4005311282d6e5e120cce30ccc7d79 Mon Sep 17 00:00:00 2001 From: Andrew Gaspar Date: Thu, 20 Jun 2013 22:41:35 -0700 Subject: [PATCH 34/57] Fixed express module definition. --- express/express-tests.ts | 2 +- express/express.d.ts | 1217 +++++++++++++++++++------------------- 2 files changed, 612 insertions(+), 607 deletions(-) diff --git a/express/express-tests.ts b/express/express-tests.ts index 53dfc1143..a8d373467 100644 --- a/express/express-tests.ts +++ b/express/express-tests.ts @@ -1277,7 +1277,7 @@ function test_general() { app.enabled('trust proxy'); - app.configure(function () => { + app.configure(() => { app.set('title', 'My Application'); }); diff --git a/express/express.d.ts b/express/express.d.ts index ea7ebdf38..d7ac6efd9 100644 --- a/express/express.d.ts +++ b/express/express.d.ts @@ -1312,643 +1312,648 @@ interface Express extends ExpressApplication { response: ExpressServerResponse; } + declare module "express" { - export function (): Express; + function express(): Express; - /** - * Body parser: - * - * Parse request bodies, supports _application/json_, - * _application/x-www-form-urlencoded_, and _multipart/form-data_. - * - * This is equivalent to: - * - * app.use(connect.json()); - * app.use(connect.urlencoded()); - * app.use(connect.multipart()); - * - * Examples: - * - * connect() - * .use(connect.bodyParser()) - * .use(function(req, res) { - * res.end('viewing user ' + req.body.user.name); - * }); - * - * $ curl -d 'user[name]=tj' http://local/ - * $ curl -d '{"user":{"name":"tj"}}' -H "Content-Type: application/json" http://local/ - * - * View [json](json.html), [urlencoded](urlencoded.html), and [multipart](multipart.html) for more info. - * - * @param options - */ - export function bodyParser(options?: any): Handler; + module express { + /** + * Body parser: + * + * Parse request bodies, supports _application/json_, + * _application/x-www-form-urlencoded_, and _multipart/form-data_. + * + * This is equivalent to: + * + * app.use(connect.json()); + * app.use(connect.urlencoded()); + * app.use(connect.multipart()); + * + * Examples: + * + * connect() + * .use(connect.bodyParser()) + * .use(function(req, res) { + * res.end('viewing user ' + req.body.user.name); + * }); + * + * $ curl -d 'user[name]=tj' http://local/ + * $ curl -d '{"user":{"name":"tj"}}' -H "Content-Type: application/json" http://local/ + * + * View [json](json.html), [urlencoded](urlencoded.html), and [multipart](multipart.html) for more info. + * + * @param options + */ + export function bodyParser(options?: any): Handler; - /** - * Error handler: - * - * Development error handler, providing stack traces - * and error message responses for requests accepting text, html, - * or json. - * - * Text: - * - * By default, and when _text/plain_ is accepted a simple stack trace - * or error message will be returned. - * - * JSON: - * - * When _application/json_ is accepted, connect will respond with - * an object in the form of `{ "error": error }`. - * - * HTML: - * - * When accepted connect will output a nice html stack trace. - */ - export function errorHandler(opts?: any): Handler; + /** + * Error handler: + * + * Development error handler, providing stack traces + * and error message responses for requests accepting text, html, + * or json. + * + * Text: + * + * By default, and when _text/plain_ is accepted a simple stack trace + * or error message will be returned. + * + * JSON: + * + * When _application/json_ is accepted, connect will respond with + * an object in the form of `{ "error": error }`. + * + * HTML: + * + * When accepted connect will output a nice html stack trace. + */ + export function errorHandler(opts?: any): Handler; - /** - * Method Override: - * - * Provides faux HTTP method support. - * - * Pass an optional `key` to use when checking for - * a method override, othewise defaults to _\_method_. - * The original method is available via `req.originalMethod`. - * - * @param key - */ - export function methodOverride(key?: string): Handler; + /** + * Method Override: + * + * Provides faux HTTP method support. + * + * Pass an optional `key` to use when checking for + * a method override, othewise defaults to _\_method_. + * The original method is available via `req.originalMethod`. + * + * @param key + */ + export function methodOverride(key?: string): Handler; - /** - * Cookie parser: - * - * Parse _Cookie_ header and populate `req.cookies` - * with an object keyed by the cookie names. Optionally - * you may enabled signed cookie support by passing - * a `secret` string, which assigns `req.secret` so - * it may be used by other middleware. - * - * Examples: - * - * connect() - * .use(connect.cookieParser('optional secret string')) - * .use(function(req, res, next){ - * res.end(JSON.stringify(req.cookies)); - * }) - * - * @param secret - */ - export function cookieParser(secret?: string): Handler; + /** + * Cookie parser: + * + * Parse _Cookie_ header and populate `req.cookies` + * with an object keyed by the cookie names. Optionally + * you may enabled signed cookie support by passing + * a `secret` string, which assigns `req.secret` so + * it may be used by other middleware. + * + * Examples: + * + * connect() + * .use(connect.cookieParser('optional secret string')) + * .use(function(req, res, next){ + * res.end(JSON.stringify(req.cookies)); + * }) + * + * @param secret + */ + export function cookieParser(secret?: string): Handler; - /** - * Session: - * - * Setup session store with the given `options`. - * - * Session data is _not_ saved in the cookie itself, however - * cookies are used, so we must use the [cookieParser()](cookieParser.html) - * middleware _before_ `session()`. - * - * Examples: - * - * connect() - * .use(connect.cookieParser()) - * .use(connect.session({ secret: 'keyboard cat', key: 'sid', cookie: { secure: true }})) - * - * Options: - * - * - `key` cookie name defaulting to `connect.sid` - * - `store` session store instance - * - `secret` session cookie is signed with this secret to prevent tampering - * - `cookie` session cookie settings, defaulting to `{ path: '/', httpOnly: true, maxAge: null }` - * - `proxy` trust the reverse proxy when setting secure cookies (via "x-forwarded-proto") - * - * Cookie option: - * - * By default `cookie.maxAge` is `null`, meaning no "expires" parameter is set - * so the cookie becomes a browser-session cookie. When the user closes the - * browser the cookie (and session) will be removed. - * - * ## req.session - * - * To store or access session data, simply use the request property `req.session`, - * which is (generally) serialized as JSON by the store, so nested objects - * are typically fine. For example below is a user-specific view counter: - * - * connect() - * .use(connect.favicon()) - * .use(connect.cookieParser()) - * .use(connect.session({ secret: 'keyboard cat', cookie: { maxAge: 60000 }})) - * .use(function(req, res, next){ - * var sess = req.session; - * if (sess.views) { - * res.setHeader('Content-Type', 'text/html'); - * res.write('

views: ' + sess.views + '

'); - * res.write('

expires in: ' + (sess.cookie.maxAge / 1000) + 's

'); - * res.end(); - * sess.views++; - * } else { - * sess.views = 1; - * res.end('welcome to the session demo. refresh!'); - * } - * } - * )).listen(3000); - * - * ## Session#regenerate() - * - * To regenerate the session simply invoke the method, once complete - * a new SID and `Session` instance will be initialized at `req.session`. - * - * req.session.regenerate(function(err){ - * // will have a new session here - * }); - * - * ## Session#destroy() - * - * Destroys the session, removing `req.session`, will be re-generated next request. - * - * req.session.destroy(function(err){ - * // cannot access session here - * }); - * - * ## Session#reload() - * - * Reloads the session data. - * - * req.session.reload(function(err){ - * // session updated - * }); - * - * ## Session#save() - * - * Save the session. - * - * req.session.save(function(err){ - * // session saved - * }); - * - * ## Session#touch() - * - * Updates the `.maxAge` property. Typically this is - * not necessary to call, as the session middleware does this for you. - * - * ## Session#cookie - * - * Each session has a unique cookie object accompany it. This allows - * you to alter the session cookie per visitor. For example we can - * set `req.session.cookie.expires` to `false` to enable the cookie - * to remain for only the duration of the user-agent. - * - * ## Session#maxAge - * - * Alternatively `req.session.cookie.maxAge` will return the time - * remaining in milliseconds, which we may also re-assign a new value - * to adjust the `.expires` property appropriately. The following - * are essentially equivalent - * - * var hour = 3600000; - * req.session.cookie.expires = new Date(Date.now() + hour); - * req.session.cookie.maxAge = hour; - * - * For example when `maxAge` is set to `60000` (one minute), and 30 seconds - * has elapsed it will return `30000` until the current request has completed, - * at which time `req.session.touch()` is called to reset `req.session.maxAge` - * to its original value. - * - * req.session.cookie.maxAge; - * // => 30000 - * - * Session Store Implementation: - * - * Every session store _must_ implement the following methods - * - * - `.get(sid, callback)` - * - `.set(sid, session, callback)` - * - `.destroy(sid, callback)` - * - * Recommended methods include, but are not limited to: - * - * - `.length(callback)` - * - `.clear(callback)` - * - * For an example implementation view the [connect-redis](http://github.com/visionmedia/connect-redis) repo. - * - * @param options - */ - export function session(options?: any): Handler; + /** + * Session: + * + * Setup session store with the given `options`. + * + * Session data is _not_ saved in the cookie itself, however + * cookies are used, so we must use the [cookieParser()](cookieParser.html) + * middleware _before_ `session()`. + * + * Examples: + * + * connect() + * .use(connect.cookieParser()) + * .use(connect.session({ secret: 'keyboard cat', key: 'sid', cookie: { secure: true }})) + * + * Options: + * + * - `key` cookie name defaulting to `connect.sid` + * - `store` session store instance + * - `secret` session cookie is signed with this secret to prevent tampering + * - `cookie` session cookie settings, defaulting to `{ path: '/', httpOnly: true, maxAge: null }` + * - `proxy` trust the reverse proxy when setting secure cookies (via "x-forwarded-proto") + * + * Cookie option: + * + * By default `cookie.maxAge` is `null`, meaning no "expires" parameter is set + * so the cookie becomes a browser-session cookie. When the user closes the + * browser the cookie (and session) will be removed. + * + * ## req.session + * + * To store or access session data, simply use the request property `req.session`, + * which is (generally) serialized as JSON by the store, so nested objects + * are typically fine. For example below is a user-specific view counter: + * + * connect() + * .use(connect.favicon()) + * .use(connect.cookieParser()) + * .use(connect.session({ secret: 'keyboard cat', cookie: { maxAge: 60000 }})) + * .use(function(req, res, next){ + * var sess = req.session; + * if (sess.views) { + * res.setHeader('Content-Type', 'text/html'); + * res.write('

views: ' + sess.views + '

'); + * res.write('

expires in: ' + (sess.cookie.maxAge / 1000) + 's

'); + * res.end(); + * sess.views++; + * } else { + * sess.views = 1; + * res.end('welcome to the session demo. refresh!'); + * } + * } + * )).listen(3000); + * + * ## Session#regenerate() + * + * To regenerate the session simply invoke the method, once complete + * a new SID and `Session` instance will be initialized at `req.session`. + * + * req.session.regenerate(function(err){ + * // will have a new session here + * }); + * + * ## Session#destroy() + * + * Destroys the session, removing `req.session`, will be re-generated next request. + * + * req.session.destroy(function(err){ + * // cannot access session here + * }); + * + * ## Session#reload() + * + * Reloads the session data. + * + * req.session.reload(function(err){ + * // session updated + * }); + * + * ## Session#save() + * + * Save the session. + * + * req.session.save(function(err){ + * // session saved + * }); + * + * ## Session#touch() + * + * Updates the `.maxAge` property. Typically this is + * not necessary to call, as the session middleware does this for you. + * + * ## Session#cookie + * + * Each session has a unique cookie object accompany it. This allows + * you to alter the session cookie per visitor. For example we can + * set `req.session.cookie.expires` to `false` to enable the cookie + * to remain for only the duration of the user-agent. + * + * ## Session#maxAge + * + * Alternatively `req.session.cookie.maxAge` will return the time + * remaining in milliseconds, which we may also re-assign a new value + * to adjust the `.expires` property appropriately. The following + * are essentially equivalent + * + * var hour = 3600000; + * req.session.cookie.expires = new Date(Date.now() + hour); + * req.session.cookie.maxAge = hour; + * + * For example when `maxAge` is set to `60000` (one minute), and 30 seconds + * has elapsed it will return `30000` until the current request has completed, + * at which time `req.session.touch()` is called to reset `req.session.maxAge` + * to its original value. + * + * req.session.cookie.maxAge; + * // => 30000 + * + * Session Store Implementation: + * + * Every session store _must_ implement the following methods + * + * - `.get(sid, callback)` + * - `.set(sid, session, callback)` + * - `.destroy(sid, callback)` + * + * Recommended methods include, but are not limited to: + * + * - `.length(callback)` + * - `.clear(callback)` + * + * For an example implementation view the [connect-redis](http://github.com/visionmedia/connect-redis) repo. + * + * @param options + */ + export function session(options?: any): Handler; - /** - * Hash the given `sess` object omitting changes - * to `.cookie`. - * - * @param sess - */ - export function hash(sess: string): string; + /** + * Hash the given `sess` object omitting changes + * to `.cookie`. + * + * @param sess + */ + export function hash(sess: string): string; - /** - * Static: - * - * Static file server with the given `root` path. - * - * Examples: - * - * var oneDay = 86400000; - * - * connect() - * .use(connect.static(__dirname + '/public')) - * - * connect() - * .use(connect.static(__dirname + '/public', { maxAge: oneDay })) - * - * Options: - * - * - `maxAge` Browser cache maxAge in milliseconds. defaults to 0 - * - `hidden` Allow transfer of hidden files. defaults to false - * - `redirect` Redirect to trailing "/" when the pathname is a dir. defaults to true - * - * @param root - * @param options - */ - export function static (root: string, options?: any): Handler; + /** + * Static: + * + * Static file server with the given `root` path. + * + * Examples: + * + * var oneDay = 86400000; + * + * connect() + * .use(connect.static(__dirname + '/public')) + * + * connect() + * .use(connect.static(__dirname + '/public', { maxAge: oneDay })) + * + * Options: + * + * - `maxAge` Browser cache maxAge in milliseconds. defaults to 0 + * - `hidden` Allow transfer of hidden files. defaults to false + * - `redirect` Redirect to trailing "/" when the pathname is a dir. defaults to true + * + * @param root + * @param options + */ + export function static(root: string, options?: any): Handler; - /** - * Basic Auth: - * - * Enfore basic authentication by providing a `callback(user, pass)`, - * which must return `true` in order to gain access. Alternatively an async - * method is provided as well, invoking `callback(user, pass, callback)`. Populates - * `req.user`. The final alternative is simply passing username / password - * strings. - * - * Simple username and password - * - * connect(connect.basicAuth('username', 'password')); - * - * Callback verification - * - * connect() - * .use(connect.basicAuth(function(user, pass){ - * return 'tj' == user & 'wahoo' == pass; - * })) - * - * Async callback verification, accepting `fn(err, user)`. - * - * connect() - * .use(connect.basicAuth(function(user, pass, fn){ - * User.authenticate({ user: user, pass: pass }, fn); - * })) - * - * @param callback or username - * @param realm - */ - export function basicAuth(callback: Function, realm: string); + /** + * Basic Auth: + * + * Enfore basic authentication by providing a `callback(user, pass)`, + * which must return `true` in order to gain access. Alternatively an async + * method is provided as well, invoking `callback(user, pass, callback)`. Populates + * `req.user`. The final alternative is simply passing username / password + * strings. + * + * Simple username and password + * + * connect(connect.basicAuth('username', 'password')); + * + * Callback verification + * + * connect() + * .use(connect.basicAuth(function(user, pass){ + * return 'tj' == user & 'wahoo' == pass; + * })) + * + * Async callback verification, accepting `fn(err, user)`. + * + * connect() + * .use(connect.basicAuth(function(user, pass, fn){ + * User.authenticate({ user: user, pass: pass }, fn); + * })) + * + * @param callback or username + * @param realm + */ + export function basicAuth(callback: Function, realm: string); - export function basicAuth(callback: string, realm: string); + export function basicAuth(callback: string, realm: string); - export function basicAuth(callback: Function); + export function basicAuth(callback: Function); - /** - * Compress: - * - * Compress response data with gzip/deflate. - * - * Filter: - * - * A `filter` callback function may be passed to - * replace the default logic of: - * - * exports.filter = function(req, res){ - * return /json|text|javascript/.test(res.getHeader('Content-Type')); - * }; - * - * Options: - * - * All remaining options are passed to the gzip/deflate - * creation functions. Consult node's docs for additional details. - * - * - `chunkSize` (default: 16*1024) - * - `windowBits` - * - `level`: 0-9 where 0 is no compression, and 9 is slow but best compression - * - `memLevel`: 1-9 low is slower but uses less memory, high is fast but uses more - * - `strategy`: compression strategy - * - * @param options - */ - export function compress(options?: any): Handler; + /** + * Compress: + * + * Compress response data with gzip/deflate. + * + * Filter: + * + * A `filter` callback function may be passed to + * replace the default logic of: + * + * exports.filter = function(req, res){ + * return /json|text|javascript/.test(res.getHeader('Content-Type')); + * }; + * + * Options: + * + * All remaining options are passed to the gzip/deflate + * creation functions. Consult node's docs for additional details. + * + * - `chunkSize` (default: 16*1024) + * - `windowBits` + * - `level`: 0-9 where 0 is no compression, and 9 is slow but best compression + * - `memLevel`: 1-9 low is slower but uses less memory, high is fast but uses more + * - `strategy`: compression strategy + * + * @param options + */ + export function compress(options?: any): Handler; - /** - * Cookie Session: - * - * Cookie session middleware. - * - * var app = connect(); - * app.use(connect.cookieParser()); - * app.use(connect.cookieSession({ secret: 'tobo!', cookie: { maxAge: 60 * 60 * 1000 }})); - * - * Options: - * - * - `key` cookie name defaulting to `connect.sess` - * - `secret` prevents cookie tampering - * - `cookie` session cookie settings, defaulting to `{ path: '/', httpOnly: true, maxAge: null }` - * - `proxy` trust the reverse proxy when setting secure cookies (via "x-forwarded-proto") - * - * Clearing sessions: - * - * To clear the session simply set its value to `null`, - * `cookieSession()` will then respond with a 1970 Set-Cookie. - * - * req.session = null; - * - * @param options - */ - export function cookieSession(options?: any): Handler; + /** + * Cookie Session: + * + * Cookie session middleware. + * + * var app = connect(); + * app.use(connect.cookieParser()); + * app.use(connect.cookieSession({ secret: 'tobo!', cookie: { maxAge: 60 * 60 * 1000 }})); + * + * Options: + * + * - `key` cookie name defaulting to `connect.sess` + * - `secret` prevents cookie tampering + * - `cookie` session cookie settings, defaulting to `{ path: '/', httpOnly: true, maxAge: null }` + * - `proxy` trust the reverse proxy when setting secure cookies (via "x-forwarded-proto") + * + * Clearing sessions: + * + * To clear the session simply set its value to `null`, + * `cookieSession()` will then respond with a 1970 Set-Cookie. + * + * req.session = null; + * + * @param options + */ + export function cookieSession(options?: any): Handler; - /** - * Anti CSRF: - * - * CRSF protection middleware. - * - * By default this middleware generates a token named "_csrf" - * which should be added to requests which mutate - * state, within a hidden form field, query-string etc. This - * token is validated against the visitor's `req.session._csrf` - * property. - * - * The default `value` function checks `req.body` generated - * by the `bodyParser()` middleware, `req.query` generated - * by `query()`, and the "X-CSRF-Token" header field. - * - * This middleware requires session support, thus should be added - * somewhere _below_ `session()` and `cookieParser()`. - * - * Options: - * - * - `value` a function accepting the request, returning the token - * - * @param options - */ - export function csrf(options: any); + /** + * Anti CSRF: + * + * CRSF protection middleware. + * + * By default this middleware generates a token named "_csrf" + * which should be added to requests which mutate + * state, within a hidden form field, query-string etc. This + * token is validated against the visitor's `req.session._csrf` + * property. + * + * The default `value` function checks `req.body` generated + * by the `bodyParser()` middleware, `req.query` generated + * by `query()`, and the "X-CSRF-Token" header field. + * + * This middleware requires session support, thus should be added + * somewhere _below_ `session()` and `cookieParser()`. + * + * Options: + * + * - `value` a function accepting the request, returning the token + * + * @param options + */ + export function csrf(options: any); - /** - * Directory: - * - * Serve directory listings with the given `root` path. - * - * Options: - * - * - `hidden` display hidden (dot) files. Defaults to false. - * - `icons` display icons. Defaults to false. - * - `filter` Apply this filter function to files. Defaults to false. - * - * @param root - * @param options - */ - export function directory(root: string, options?: any): Handler; + /** + * Directory: + * + * Serve directory listings with the given `root` path. + * + * Options: + * + * - `hidden` display hidden (dot) files. Defaults to false. + * - `icons` display icons. Defaults to false. + * - `filter` Apply this filter function to files. Defaults to false. + * + * @param root + * @param options + */ + export function directory(root: string, options?: any): Handler; - /** - * Favicon: - * - * By default serves the connect favicon, or the favicon - * located by the given `path`. - * - * Options: - * - * - `maxAge` cache-control max-age directive, defaulting to 1 day - * - * Examples: - * - * Serve default favicon: - * - * connect() - * .use(connect.favicon()) - * - * Serve favicon before logging for brevity: - * - * connect() - * .use(connect.favicon()) - * .use(connect.logger('dev')) - * - * Serve custom favicon: - * - * connect() - * .use(connect.favicon('public/favicon.ico)) - * - * @param path - * @param options - */ - export function favicon(path?: string, options?: any); + /** + * Favicon: + * + * By default serves the connect favicon, or the favicon + * located by the given `path`. + * + * Options: + * + * - `maxAge` cache-control max-age directive, defaulting to 1 day + * + * Examples: + * + * Serve default favicon: + * + * connect() + * .use(connect.favicon()) + * + * Serve favicon before logging for brevity: + * + * connect() + * .use(connect.favicon()) + * .use(connect.logger('dev')) + * + * Serve custom favicon: + * + * connect() + * .use(connect.favicon('public/favicon.ico)) + * + * @param path + * @param options + */ + export function favicon(path?: string, options?: any); - /** - * JSON: - * - * Parse JSON request bodies, providing the - * parsed object as `req.body`. - * - * Options: - * - * - `strict` when `false` anything `JSON.parse()` accepts will be parsed - * - `reviver` used as the second "reviver" argument for JSON.parse - * - `limit` byte limit disabled by default - * - * @param options - */ - export function json(options?: any): Handler; + /** + * JSON: + * + * Parse JSON request bodies, providing the + * parsed object as `req.body`. + * + * Options: + * + * - `strict` when `false` anything `JSON.parse()` accepts will be parsed + * - `reviver` used as the second "reviver" argument for JSON.parse + * - `limit` byte limit disabled by default + * + * @param options + */ + export function json(options?: any): Handler; - /** - * Limit: - * - * Limit request bodies to the given size in `bytes`. - * - * A string representation of the bytesize may also be passed, - * for example "5mb", "200kb", "1gb", etc. - * - * connect() - * .use(connect.limit('5.5mb')) - * .use(handleImageUpload) - */ - export function limit(bytes: number): Handler; + /** + * Limit: + * + * Limit request bodies to the given size in `bytes`. + * + * A string representation of the bytesize may also be passed, + * for example "5mb", "200kb", "1gb", etc. + * + * connect() + * .use(connect.limit('5.5mb')) + * .use(handleImageUpload) + */ + export function limit(bytes: number): Handler; - export function limit(bytes: string): Handler; + export function limit(bytes: string): Handler; - /** - * Logger: - * - * Log requests with the given `options` or a `format` string. - * - * Options: - * - * - `format` Format string, see below for tokens - * - `stream` Output stream, defaults to _stdout_ - * - `buffer` Buffer duration, defaults to 1000ms when _true_ - * - `immediate` Write log line on request instead of response (for response times) - * - * Tokens: - * - * - `:req[header]` ex: `:req[Accept]` - * - `:res[header]` ex: `:res[Content-Length]` - * - `:http-version` - * - `:response-time` - * - `:remote-addr` - * - `:date` - * - `:method` - * - `:url` - * - `:referrer` - * - `:user-agent` - * - `:status` - * - * Formats: - * - * Pre-defined formats that ship with connect: - * - * - `default` ':remote-addr - - [:date] ":method :url HTTP/:http-version" :status :res[content-length] ":referrer" ":user-agent"' - * - `short` ':remote-addr - :method :url HTTP/:http-version :status :res[content-length] - :response-time ms' - * - `tiny` ':method :url :status :res[content-length] - :response-time ms' - * - `dev` concise output colored by response status for development use - * - * Examples: - * - * connect.logger() // default - * connect.logger('short') - * connect.logger('tiny') - * connect.logger({ immediate: true, format: 'dev' }) - * connect.logger(':method :url - :referrer') - * connect.logger(':req[content-type] -> :res[content-type]') - * connect.logger(function(tokens, req, res){ return 'some format string' }) - * - * Defining Tokens: - * - * To define a token, simply invoke `connect.logger.token()` with the - * name and a callback function. The value returned is then available - * as ":type" in this case. - * - * connect.logger.token('type', function(req, res){ return req.headers['content-type']; }) - * - * Defining Formats: - * - * All default formats are defined this way, however it's public API as well: - * - * connect.logger.format('name', 'string or function') - */ - export function logger(options: string): Handler; + /** + * Logger: + * + * Log requests with the given `options` or a `format` string. + * + * Options: + * + * - `format` Format string, see below for tokens + * - `stream` Output stream, defaults to _stdout_ + * - `buffer` Buffer duration, defaults to 1000ms when _true_ + * - `immediate` Write log line on request instead of response (for response times) + * + * Tokens: + * + * - `:req[header]` ex: `:req[Accept]` + * - `:res[header]` ex: `:res[Content-Length]` + * - `:http-version` + * - `:response-time` + * - `:remote-addr` + * - `:date` + * - `:method` + * - `:url` + * - `:referrer` + * - `:user-agent` + * - `:status` + * + * Formats: + * + * Pre-defined formats that ship with connect: + * + * - `default` ':remote-addr - - [:date] ":method :url HTTP/:http-version" :status :res[content-length] ":referrer" ":user-agent"' + * - `short` ':remote-addr - :method :url HTTP/:http-version :status :res[content-length] - :response-time ms' + * - `tiny` ':method :url :status :res[content-length] - :response-time ms' + * - `dev` concise output colored by response status for development use + * + * Examples: + * + * connect.logger() // default + * connect.logger('short') + * connect.logger('tiny') + * connect.logger({ immediate: true, format: 'dev' }) + * connect.logger(':method :url - :referrer') + * connect.logger(':req[content-type] -> :res[content-type]') + * connect.logger(function(tokens, req, res){ return 'some format string' }) + * + * Defining Tokens: + * + * To define a token, simply invoke `connect.logger.token()` with the + * name and a callback function. The value returned is then available + * as ":type" in this case. + * + * connect.logger.token('type', function(req, res){ return req.headers['content-type']; }) + * + * Defining Formats: + * + * All default formats are defined this way, however it's public API as well: + * + * connect.logger.format('name', 'string or function') + */ + export function logger(options: string): Handler; - export function logger(options: Function): Handler; + export function logger(options: Function): Handler; - export function logger(options?: any): Handler; + export function logger(options?: any): Handler; - /** - * Compile `fmt` into a function. - * - * @param fmt - */ - export function compile(fmt: string): Handler; + /** + * Compile `fmt` into a function. + * + * @param fmt + */ + export function compile(fmt: string): Handler; - /** - * Define a token function with the given `name`, - * and callback `fn(req, res)`. - * - * @param name - * @param fn - */ - export function token(name: string, fn: Function): any; + /** + * Define a token function with the given `name`, + * and callback `fn(req, res)`. + * + * @param name + * @param fn + */ + export function token(name: string, fn: Function): any; - /** - * Define a `fmt` with the given `name`. - */ - export function format(name: string, str: string): any; + /** + * Define a `fmt` with the given `name`. + */ + export function format(name: string, str: string): any; - export function format(name: string, str: Function): any; + export function format(name: string, str: Function): any; - /** - * Query: - * - * Automatically parse the query-string when available, - * populating the `req.query` object. - * - * Examples: - * - * connect() - * .use(connect.query()) - * .use(function(req, res){ - * res.end(JSON.stringify(req.query)); - * }); - * - * The `options` passed are provided to qs.parse function. - */ - export function query(options: any): Handler; + /** + * Query: + * + * Automatically parse the query-string when available, + * populating the `req.query` object. + * + * Examples: + * + * connect() + * .use(connect.query()) + * .use(function(req, res){ + * res.end(JSON.stringify(req.query)); + * }); + * + * The `options` passed are provided to qs.parse function. + */ + export function query(options: any): Handler; - /** - * Reponse time: - * - * Adds the `X-Response-Time` header displaying the response - * duration in milliseconds. - */ - export function responseTime(): Handler; + /** + * Reponse time: + * + * Adds the `X-Response-Time` header displaying the response + * duration in milliseconds. + */ + export function responseTime(): Handler; - /** - * Static cache: - * - * Enables a memory cache layer on top of - * the `static()` middleware, serving popular - * static files. - * - * By default a maximum of 128 objects are - * held in cache, with a max of 256k each, - * totalling ~32mb. - * - * A Least-Recently-Used (LRU) cache algo - * is implemented through the `Cache` object, - * simply rotating cache objects as they are - * hit. This means that increasingly popular - * objects maintain their positions while - * others get shoved out of the stack and - * garbage collected. - * - * Benchmarks: - * - * static(): 2700 rps - * node-static: 5300 rps - * static() + staticCache(): 7500 rps - * - * Options: - * - * - `maxObjects` max cache objects [128] - * - `maxLength` max cache object length 256kb - */ - export function staticCache(options: any): Handler; + /** + * Static cache: + * + * Enables a memory cache layer on top of + * the `static()` middleware, serving popular + * static files. + * + * By default a maximum of 128 objects are + * held in cache, with a max of 256k each, + * totalling ~32mb. + * + * A Least-Recently-Used (LRU) cache algo + * is implemented through the `Cache` object, + * simply rotating cache objects as they are + * hit. This means that increasingly popular + * objects maintain their positions while + * others get shoved out of the stack and + * garbage collected. + * + * Benchmarks: + * + * static(): 2700 rps + * node-static: 5300 rps + * static() + staticCache(): 7500 rps + * + * Options: + * + * - `maxObjects` max cache objects [128] + * - `maxLength` max cache object length 256kb + */ + export function staticCache(options: any): Handler; - /** - * Timeout: - * - * Times out the request in `ms`, defaulting to `5000`. The - * method `req.clearTimeout()` is added to revert this behaviour - * programmatically within your application's middleware, routes, etc. - * - * The timeout error is passed to `next()` so that you may customize - * the response behaviour. This error has the `.timeout` property as - * well as `.status == 408`. - */ - export function timeout(ms: number): Handler; + /** + * Timeout: + * + * Times out the request in `ms`, defaulting to `5000`. The + * method `req.clearTimeout()` is added to revert this behaviour + * programmatically within your application's middleware, routes, etc. + * + * The timeout error is passed to `next()` so that you may customize + * the response behaviour. This error has the `.timeout` property as + * well as `.status == 408`. + */ + export function timeout(ms: number): Handler; - /** - * Vhost: - * - * Setup vhost for the given `hostname` and `server`. - * - * connect() - * .use(connect.vhost('foo.com', fooApp)) - * .use(connect.vhost('bar.com', barApp)) - * .use(connect.vhost('*.com', mainApp)) - * - * The `server` may be a Connect server or - * a regular Node `http.Server`. - * - * @param hostname - * @param server - */ - export function vhost(hostname: string, server: any): Handler; + /** + * Vhost: + * + * Setup vhost for the given `hostname` and `server`. + * + * connect() + * .use(connect.vhost('foo.com', fooApp)) + * .use(connect.vhost('bar.com', barApp)) + * .use(connect.vhost('*.com', mainApp)) + * + * The `server` may be a Connect server or + * a regular Node `http.Server`. + * + * @param hostname + * @param server + */ + export function vhost(hostname: string, server: any): Handler; - export function urlencoded(): any; + export function urlencoded(): any; - export function multipart(): any; + export function multipart(): any; + } + + export = express; } From e8dd7a5c8fdbcb0836f51a2cc7945225f1e2faa7 Mon Sep 17 00:00:00 2001 From: ZOS Date: Fri, 21 Jun 2013 10:00:46 +0400 Subject: [PATCH 35/57] Knockout.validation support new Knockout definition (generics) and replace bool to boolean. --- knockout.validation/knockout.validation.d.ts | 109 +++++++++---------- 1 file changed, 53 insertions(+), 56 deletions(-) diff --git a/knockout.validation/knockout.validation.d.ts b/knockout.validation/knockout.validation.d.ts index 88c1cc59d..72ea55dc9 100644 --- a/knockout.validation/knockout.validation.d.ts +++ b/knockout.validation/knockout.validation.d.ts @@ -5,66 +5,66 @@ /// -interface KnockoutValidationGroupingOptions { - deep?: bool; - observable?: bool; +interface KnockoutValidationGroupingOptions { + deep?: boolean; + observable?: boolean; } -interface KnockoutValidationConfiguration { - registerExtenders?: bool; - messagesOnModified?: bool; +interface KnockoutValidationConfiguration { + registerExtenders?: boolean; + messagesOnModified?: boolean; messageTemplate?: string; - insertMessages?: bool; - parseInputAttributes?: bool; - writeInputAttributes?: bool; - decorateElement?: bool; + insertMessages?: boolean; + parseInputAttributes?: boolean; + writeInputAttributes?: boolean; + decorateElement?: boolean; errorClass?: string; errorElementClass?: string; errorMessageClass?: string; - grouping?: KnockoutValidationGroupingOptions; + grouping?: KnockoutValidationGroupingOptions; } -interface KnockoutValidationUtils { - isArray(o: any): bool; - isObject(o: any): bool; +interface KnockoutValidationUtils { + isArray(o: any): boolean; + isObject(o: any): boolean; values(o: any): any[]; getValue(o: any): any; - hasAttribute(node: Element, attr: string): bool; - isValidatable(o: any): bool; + hasAttribute(node: Element, attr: string): boolean; + isValidatable(o: any): boolean; insertAfter(node: Element, newNode: Element): void; newId(): number; getConfigOptions(element: Element): KnockoutValidationConfiguration; setDomData(node: Element, data: KnockoutValidationConfiguration): void; getDomData(node: Element): KnockoutValidationConfiguration; contextFor(node: Element): KnockoutValidationConfiguration; - isEmptyVal(val: any): bool; + isEmptyVal(val: any): boolean; } -interface KnockoutValidationAsyncCallbackArgs { - isValid: bool; +interface KnockoutValidationAsyncCallbackArgs { + isValid: boolean; + message: string; +} + +interface KnockoutValidationAsyncCallback { + (result: boolean): void; + (result: KnockoutValidationAsyncCallbackArgs): void; +} + +interface KnockoutValidationRuleDefinition { message: string; + validator(value: any, params: any): boolean; } -interface KnockoutValidationAsyncCallback { - (result: bool): void; - (result: KnockoutValidationAsyncCallbackArgs): void; +interface KnockoutValidationAsyncRuleDefinition extends KnockoutValidationRuleDefinition { + async: boolean; + validator(value: any, params: any, callback: KnockoutValidationAsyncCallback): void; } -interface KnockoutValidationRuleDefinition { - message: string; - validator(value: any, params: any): bool; +interface KnockoutValidationAnonymousRuleDefinition { + validation: KnockoutValidationRuleDefinition; } -interface KnockoutValidationAsyncRuleDefinition extends KnockoutValidationRuleDefinition { - async: bool; - validator(value: any, params: any, callback: KnockoutValidationAsyncCallback): void; -} - -interface KnockoutValidationAnonymousRuleDefinition { - validation: KnockoutValidationRuleDefinition; -} - -interface KnockoutValidationRuleDefinitions { +interface KnockoutValidationRuleDefinitions { date: KnockoutValidationRuleDefinition; dateISO: KnockoutValidationRuleDefinition; digit: KnockoutValidationRuleDefinition; @@ -80,30 +80,30 @@ interface KnockoutValidationRuleDefinitions { phoneUS: KnockoutValidationRuleDefinition; required: KnockoutValidationRuleDefinition; step: KnockoutValidationRuleDefinition; - unique: KnockoutValidationRuleDefinition; + unique: KnockoutValidationRuleDefinition; } -interface KnockoutValidationRule { +interface KnockoutValidationRule { rule: string; params: any; message?: string; - condition?: () => bool; + condition?: () => boolean; } -interface KnockoutValidationErrors { +interface KnockoutValidationErrors { (): string[]; showAllMessages(): void; - showAllMessages(show: bool): void; + showAllMessages(show: boolean): void; } -interface KnockoutValidationGroup { +interface KnockoutValidationGroup { errors?: KnockoutValidationErrors; - isValid?: () => bool; - isAnyMessageShown?: () => bool; + isValid?: () => boolean; + isAnyMessageShown?: () => boolean; } -interface KnockoutValidationStatic { - init(options?: KnockoutValidationConfiguration, force?: bool): void; +interface KnockoutValidationStatic { + init(options?: KnockoutValidationConfiguration, force?: boolean): void; configure(options: KnockoutValidationConfiguration): void; reset(): void; @@ -111,11 +111,8 @@ interface KnockoutValidationStatic { formatMessage(message: string, params: string): string; - addRule(observable: KnockoutObservableAny, rule: KnockoutValidationRule): KnockoutObservableAny; - addRule(observable: KnockoutObservableString, rule: KnockoutValidationRule): KnockoutObservableString; - addRule(observable: KnockoutObservableNumber, rule: KnockoutValidationRule): KnockoutObservableNumber; - addRule(observable: KnockoutObservableBool, rule: KnockoutValidationRule): KnockoutObservableBool; - addRule(observable: KnockoutObservableDate, rule: KnockoutValidationRule): KnockoutObservableDate; + addRule(observable: KnockoutObservable, rule: KnockoutValidationRule): KnockoutObservable; + addAnonymousRule(observable: KnockoutObservableBase, ruleObj: KnockoutValidationAnonymousRuleDefinition): void; insertValidationMessage(element: Element): Element; @@ -128,18 +125,18 @@ interface KnockoutValidationStatic { utils: KnockoutValidationUtils; localize(msgTranslations: any): void; - validateObservable(observable: KnockoutObservableBase): bool; + validateObservable(observable: KnockoutObservableBase): boolean; } -interface KnockoutStatic { +interface KnockoutStatic { validation: KnockoutValidationStatic; validatedObservable(initialValue: any): KnockoutObservableBase; - applyBindingsWithValidation(viewModel: any, rootNode?: any, options?: KnockoutValidationConfiguration): void; + applyBindingsWithValidation(viewModel: any, rootNode?: any, options?: KnockoutValidationConfiguration): void; } -interface KnockoutSubscribableFunctions { +interface KnockoutSubscribableFunctions { isValid: KnockoutComputed; - isValidating: KnockoutObservableBool; - rules: KnockoutObservableArray; + isValidating: KnockoutObservable; + rules: KnockoutObservableArray; } From d95235848c9a30b3d7a160328d081f4844b1510e Mon Sep 17 00:00:00 2001 From: ZOS Date: Fri, 21 Jun 2013 11:13:21 +0400 Subject: [PATCH 36/57] Generics support to KnockoutSubscribableFunctions and added base interface to rule definitions. --- knockout.validation/knockout.validation.d.ts | 234 ++++++++++--------- 1 file changed, 119 insertions(+), 115 deletions(-) diff --git a/knockout.validation/knockout.validation.d.ts b/knockout.validation/knockout.validation.d.ts index 72ea55dc9..725902e60 100644 --- a/knockout.validation/knockout.validation.d.ts +++ b/knockout.validation/knockout.validation.d.ts @@ -1,142 +1,146 @@ -// Type definitions for Knockout Validation -// Project: https://github.com/ericmbarnard/Knockout-Validation -// Definitions by: Dan Ludwig -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// - +// Type definitions for Knockout Validation +// Project: https://github.com/ericmbarnard/Knockout-Validation +// Definitions by: Dan Ludwig +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + interface KnockoutValidationGroupingOptions { - deep?: boolean; + deep?: boolean; observable?: boolean; -} - +} + interface KnockoutValidationConfiguration { - registerExtenders?: boolean; - messagesOnModified?: boolean; - messageTemplate?: string; - insertMessages?: boolean; - parseInputAttributes?: boolean; - writeInputAttributes?: boolean; - decorateElement?: boolean; - errorClass?: string; - errorElementClass?: string; - errorMessageClass?: string; + registerExtenders?: boolean; + messagesOnModified?: boolean; + messageTemplate?: string; + insertMessages?: boolean; + parseInputAttributes?: boolean; + writeInputAttributes?: boolean; + decorateElement?: boolean; + errorClass?: string; + errorElementClass?: string; + errorMessageClass?: string; grouping?: KnockoutValidationGroupingOptions; -} - +} + interface KnockoutValidationUtils { - isArray(o: any): boolean; - isObject(o: any): boolean; - values(o: any): any[]; - getValue(o: any): any; - hasAttribute(node: Element, attr: string): boolean; - isValidatable(o: any): boolean; - insertAfter(node: Element, newNode: Element): void; - newId(): number; - getConfigOptions(element: Element): KnockoutValidationConfiguration; - setDomData(node: Element, data: KnockoutValidationConfiguration): void; - getDomData(node: Element): KnockoutValidationConfiguration; - contextFor(node: Element): KnockoutValidationConfiguration; + isArray(o: any): boolean; + isObject(o: any): boolean; + values(o: any): any[]; + getValue(o: any): any; + hasAttribute(node: Element, attr: string): boolean; + isValidatable(o: any): boolean; + insertAfter(node: Element, newNode: Element): void; + newId(): number; + getConfigOptions(element: Element): KnockoutValidationConfiguration; + setDomData(node: Element, data: KnockoutValidationConfiguration): void; + getDomData(node: Element): KnockoutValidationConfiguration; + contextFor(node: Element): KnockoutValidationConfiguration; isEmptyVal(val: any): boolean; -} - +} + interface KnockoutValidationAsyncCallbackArgs { - isValid: boolean; + isValid: boolean; message: string; -} - +} + interface KnockoutValidationAsyncCallback { - (result: boolean): void; + (result: boolean): void; (result: KnockoutValidationAsyncCallbackArgs): void; -} - -interface KnockoutValidationRuleDefinition { - message: string; +} + +interface KnockoutValidationRuleBase +{ + message: string; +} + +interface KnockoutValidationRuleDefinition extends KnockoutValidationRuleBase { validator(value: any, params: any): boolean; -} - -interface KnockoutValidationAsyncRuleDefinition extends KnockoutValidationRuleDefinition { - async: boolean; +} + +interface KnockoutValidationAsyncRuleDefinition extends KnockoutValidationRuleBase { + async: boolean; validator(value: any, params: any, callback: KnockoutValidationAsyncCallback): void; -} - +} + interface KnockoutValidationAnonymousRuleDefinition { validation: KnockoutValidationRuleDefinition; -} - +} + interface KnockoutValidationRuleDefinitions { - date: KnockoutValidationRuleDefinition; - dateISO: KnockoutValidationRuleDefinition; - digit: KnockoutValidationRuleDefinition; - email: KnockoutValidationRuleDefinition; - equal: KnockoutValidationRuleDefinition; - max: KnockoutValidationRuleDefinition; - maxLength: KnockoutValidationRuleDefinition; - min: KnockoutValidationRuleDefinition; - minLength: KnockoutValidationRuleDefinition; - notEqual: KnockoutValidationRuleDefinition; - number: KnockoutValidationRuleDefinition; - pattern: KnockoutValidationRuleDefinition; - phoneUS: KnockoutValidationRuleDefinition; - required: KnockoutValidationRuleDefinition; - step: KnockoutValidationRuleDefinition; + date: KnockoutValidationRuleDefinition; + dateISO: KnockoutValidationRuleDefinition; + digit: KnockoutValidationRuleDefinition; + email: KnockoutValidationRuleDefinition; + equal: KnockoutValidationRuleDefinition; + max: KnockoutValidationRuleDefinition; + maxLength: KnockoutValidationRuleDefinition; + min: KnockoutValidationRuleDefinition; + minLength: KnockoutValidationRuleDefinition; + notEqual: KnockoutValidationRuleDefinition; + number: KnockoutValidationRuleDefinition; + pattern: KnockoutValidationRuleDefinition; + phoneUS: KnockoutValidationRuleDefinition; + required: KnockoutValidationRuleDefinition; + step: KnockoutValidationRuleDefinition; unique: KnockoutValidationRuleDefinition; -} - +} + interface KnockoutValidationRule { - rule: string; - params: any; - message?: string; + rule: string; + params: any; + message?: string; condition?: () => boolean; -} - +} + interface KnockoutValidationErrors { - (): string[]; - showAllMessages(): void; + (): string[]; + showAllMessages(): void; showAllMessages(show: boolean): void; -} - +} + interface KnockoutValidationGroup { - errors?: KnockoutValidationErrors; - isValid?: () => boolean; + errors?: KnockoutValidationErrors; + isValid?: () => boolean; isAnyMessageShown?: () => boolean; -} - +} + interface KnockoutValidationStatic { - init(options?: KnockoutValidationConfiguration, force?: boolean): void; - configure(options: KnockoutValidationConfiguration): void; - reset(): void; - - group(obj: any, options?: any): KnockoutValidationErrors; - - formatMessage(message: string, params: string): string; - - addRule(observable: KnockoutObservable, rule: KnockoutValidationRule): KnockoutObservable; - - addAnonymousRule(observable: KnockoutObservableBase, ruleObj: KnockoutValidationAnonymousRuleDefinition): void; - - insertValidationMessage(element: Element): Element; - parseInputValidationAttributes(element: Element, valueAccessor: () => KnockoutObservableBase): void; - - rules: KnockoutValidationRuleDefinitions; - - addExtender(ruleName: string): void; - registerExtenders(): void; - utils: KnockoutValidationUtils; - - localize(msgTranslations: any): void; + init(options?: KnockoutValidationConfiguration, force?: boolean): void; + configure(options: KnockoutValidationConfiguration): void; + reset(): void; + + group(obj: any, options?: any): KnockoutValidationErrors; + + formatMessage(message: string, params: string): string; + + addRule(observable: KnockoutObservable, rule: KnockoutValidationRule): KnockoutObservable; + + addAnonymousRule(observable: KnockoutObservableBase, ruleObj: KnockoutValidationAnonymousRuleDefinition): void; + + insertValidationMessage(element: Element): Element; + parseInputValidationAttributes(element: Element, valueAccessor: () => KnockoutObservableBase): void; + + rules: KnockoutValidationRuleDefinitions; + + addExtender(ruleName: string): void; + registerExtenders(): void; + utils: KnockoutValidationUtils; + + localize(msgTranslations: any): void; validateObservable(observable: KnockoutObservableBase): boolean; -} - +} + interface KnockoutStatic { - validation: KnockoutValidationStatic; - validatedObservable(initialValue: any): KnockoutObservableBase; + validation: KnockoutValidationStatic; + validatedObservable(initialValue: any): KnockoutObservableBase; applyBindingsWithValidation(viewModel: any, rootNode?: any, options?: KnockoutValidationConfiguration): void; -} - +} + interface KnockoutSubscribableFunctions { - isValid: KnockoutComputed; - isValidating: KnockoutObservable; - rules: KnockoutObservableArray; -} - + isValid: KnockoutComputed; + isValidating: KnockoutObservable; + rules: KnockoutObservableArray; +} + From 0687ab6e497ded398412262b1bc432211e628cb0 Mon Sep 17 00:00:00 2001 From: "harry@ardimedia.com" Date: Fri, 21 Jun 2013 09:55:54 +0200 Subject: [PATCH 37/57] Missing declaration for 'testTimeout' in QUnit.config. --- qunit/qunit.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/qunit/qunit.d.ts b/qunit/qunit.d.ts index b8ba3bb4a..afc2645e0 100644 --- a/qunit/qunit.d.ts +++ b/qunit/qunit.d.ts @@ -134,6 +134,7 @@ interface Config { current: Object; reorder: bool; requireExpects: bool; + testTimeout: number; urlConfig: Array; done: any; } From 36b9b3420a4ce2229f105fc398a9c61ecc76518b Mon Sep 17 00:00:00 2001 From: Neil Stalker Date: Fri, 21 Jun 2013 12:54:08 +0100 Subject: [PATCH 38/57] Add FullCalendar 1.6.1 definition --- README.md | 1 + fullCalendar/fullCalendar-tests.ts | 832 +++++++++++++++++++++++++++++ fullCalendar/fullCalendar.d.ts | 188 +++++++ 3 files changed, 1021 insertions(+) create mode 100644 fullCalendar/fullCalendar-tests.ts create mode 100644 fullCalendar/fullCalendar.d.ts diff --git a/README.md b/README.md index 960c06c80..e220f7bef 100755 --- a/README.md +++ b/README.md @@ -63,6 +63,7 @@ List of Definitions * [FlexSlider](http://www.woothemes.com/flexslider/) (by [Diullei Gomes](https://github.com/Diullei)) * [Foundation](http://foundation.zurb.com/) (by [Boris Yankov](https://github.com/borisyankov)) * [FPSMeter](http://darsa.in/fpsmeter/) (by [Aaron Lampros](https://github.com/alampros)) +* [FullCalendar](http://arshaw.com/fullcalendar/) (by [Neil Stalker](https://github.com/nestalk)) * [Gamepad](http://www.w3.org/TR/gamepad/) (by [Kon](http://phyzkit.net/)) * [glDatePicker](http://glad.github.com/glDatePicker/) (by [Dániel Tar](https://github.com/qcz)) * [GreenSock Animation Platform (GSAP)](http://www.greensock.com/get-started-js/) (by [Robert S.](https://github.com/codeBelt)) diff --git a/fullCalendar/fullCalendar-tests.ts b/fullCalendar/fullCalendar-tests.ts new file mode 100644 index 000000000..a85dd1d6e --- /dev/null +++ b/fullCalendar/fullCalendar-tests.ts @@ -0,0 +1,832 @@ +/// +/// +/// + +// All examples from http://arshaw.com/fullcalendar/docs/ + +$('#calendar').fullCalendar({ +}) + +$('#calendar').fullCalendar({ + weekends: false +}); + +$('#calendar').fullCalendar({ + dayClick: function () { + alert('a day has been clicked!'); + } +}); + +$('#calendar').fullCalendar('next'); + +$('#calendar').fullCalendar({ + events: 'http://www.google.com/your_feed_url/' +}); + +$('#calendar').fullCalendar({ + events: { + url: 'http://www.google.com/your_feed_url/', + className: 'gcal-event', // an option! + currentTimezone: 'America/Chicago' // an option! + } +}); + +$('#calendar').fullCalendar({ + eventSources: [ + + // source with no options + "http://www.google.com/your_feed_url1/", + + // source with no options + "http://www.google.com/your_feed_url2/", + + // source WITH options + { + url: "http://www.google.com/your_feed_url3/", + className: 'nice-event' + } + ] +}); + +$('#calendar').fullCalendar({ + height: 650 +}); + +$('#calendar').fullCalendar('option', 'height', 700); + +$('#calendar').fullCalendar({ + contentHeight: 600 +}); + +$('#calendar').fullCalendar('option', 'contentHeight', 650); + +$('#calendar').fullCalendar({ + aspectRatio: 2 +}); + +$('#calendar').fullCalendar('option', 'aspectRatio', 1.8); + +$('#calendar').fullCalendar({ + viewDisplay: function (view) { + alert('The new title of the view is ' + view.title); + } +}); + +$('#calendar').fullCalendar({ + windowResize: function (view) { + alert('The calendar has adjusted to a window resize'); + } +}); + +$('#calendar').fullCalendar('render'); + +$('#calendar').fullCalendar({ + dragOpacity: { + month: .2, + '': .5 + } +}); + +var view: FullCalendar.View = $('#calendar').fullCalendar('getView'); +alert("The view's title is " + view.title); + +$(document).ready(function () { + + var date = new Date(); + var d = date.getDate(); + var m = date.getMonth(); + var y = date.getFullYear(); + + $('#calendar').fullCalendar({ + header: { + left: 'prev,next today', + center: 'title', + right: 'month,basicWeek,basicDay' + }, + editable: true, + events: [ + { + title: 'All Day Event', + start: new Date(y, m, 1) + }, + { + title: 'Long Event', + start: new Date(y, m, d - 5), + end: new Date(y, m, d - 2) + }, + { + id: 999, + title: 'Repeating Event', + start: new Date(y, m, d - 3, 16, 0), + allDay: false + }, + { + id: 999, + title: 'Repeating Event', + start: new Date(y, m, d + 4, 16, 0), + allDay: false + }, + { + title: 'Meeting', + start: new Date(y, m, d, 10, 30), + allDay: false + }, + { + title: 'Lunch', + start: new Date(y, m, d, 12, 0), + end: new Date(y, m, d, 14, 0), + allDay: false + }, + { + title: 'Birthday Party', + start: new Date(y, m, d + 1, 19, 0), + end: new Date(y, m, d + 1, 22, 30), + allDay: false + }, + { + title: 'Click for Google', + start: new Date(y, m, 28), + end: new Date(y, m, 29), + url: 'http://google.com/' + } + ] + }); + +}); + +$(document).ready(function () { + + var date = new Date(); + var d = date.getDate(); + var m = date.getMonth(); + var y = date.getFullYear(); + + $('#calendar').fullCalendar({ + header: { + left: 'prev,next today', + center: 'title', + right: 'month,basicWeek,basicDay' + }, + defaultView: 'basicWeek', + editable: true, + events: [ + { + title: 'All Day Event', + start: new Date(y, m, 1) + }, + { + title: 'Long Event', + start: new Date(y, m, d - 5), + end: new Date(y, m, d - 2) + }, + { + id: 999, + title: 'Repeating Event', + start: new Date(y, m, d - 3, 16, 0), + allDay: false + }, + { + id: 999, + title: 'Repeating Event', + start: new Date(y, m, d + 4, 16, 0), + allDay: false + }, + { + title: 'Meeting', + start: new Date(y, m, d, 10, 30), + allDay: false + }, + { + title: 'Lunch', + start: new Date(y, m, d, 12, 0), + end: new Date(y, m, d, 14, 0), + allDay: false + }, + { + title: 'Birthday Party', + start: new Date(y, m, d + 1, 19, 0), + end: new Date(y, m, d + 1, 22, 30), + allDay: false + }, + { + title: 'Click for Google', + start: new Date(y, m, 28), + end: new Date(y, m, 29), + url: 'http://google.com/' + } + ] + }); + +}); + +$(document).ready(function () { + + var date = new Date(); + var d = date.getDate(); + var m = date.getMonth(); + var y = date.getFullYear(); + + $('#calendar').fullCalendar({ + header: { + left: 'prev,next today', + center: 'title', + right: 'month,basicWeek,basicDay' + }, + defaultView: 'basicDay', + editable: true, + events: [ + { + id: 1, + title: "Long Event", + start: new Date(y, m, d, 14, 0), + end: new Date(y, m, d + 3), + allDay: false + }, + { + id: 2, + title: "Repeating Event", + start: new Date(y, m, d - 1), + allDay: true + }, + { + id: 2, + title: "Repeating Event", + start: new Date(y, m, d + 6), + allDay: true + }, + { + id: 3, + title: "Meeting", + start: new Date(y, m, d, 9, 0), + allDay: false + }, + { + id: 4, + title: "Click for Facebook", + start: new Date(y, m, d, 16), + end: new Date(y, m, d), + url: "http://facebook.com/", + allDay: false + } + ] + }); + +}); + +$(document).ready(function () { + + var date = new Date(); + var d = date.getDate(); + var m = date.getMonth(); + var y = date.getFullYear(); + + $('#calendar').fullCalendar({ + editable: true, + header: { + left: 'prev,next today', + center: 'title', + right: 'month,agendaWeek,agendaDay' + }, + defaultView: 'agendaWeek', + events: [ + { + title: 'All Day Event', + start: new Date(y, m, 1) + }, + { + title: 'Long Event', + start: new Date(y, m, d - 5), + end: new Date(y, m, d - 2) + }, + { + id: 999, + title: 'Repeating Event', + start: new Date(y, m, d - 3, 16, 0), + allDay: false + }, + { + id: 999, + title: 'Repeating Event', + start: new Date(y, m, d + 4, 16, 0), + allDay: false + }, + { + title: 'Meeting', + start: new Date(y, m, d, 10, 30), + allDay: false + }, + { + title: 'Lunch', + start: new Date(y, m, d, 12, 0), + end: new Date(y, m, d, 14, 0), + allDay: false + }, + { + title: 'Birthday Party', + start: new Date(y, m, d + 1, 19, 0), + end: new Date(y, m, d + 1, 22, 30), + allDay: false + }, + { + title: 'Click for Google', + start: new Date(y, m, 28), + end: new Date(y, m, 29), + url: 'http://google.com/' + } + ] + }); + +}); + +$(document).ready(function () { + + var date = new Date(); + var d = date.getDate(); + var m = date.getMonth(); + var y = date.getFullYear(); + + $('#calendar').fullCalendar({ + header: { + left: 'prev,next today', + center: 'title', + right: 'month,agendaWeek,agendaDay' + }, + defaultView: 'agendaDay', + editable: true, + events: [ + { + id: 1, + title: "Long Event", + start: new Date(y, m, d), + end: new Date(y, m, d + 3), + allDay: true + }, + { + id: 2, + title: "Repeating Event", + start: new Date(y, m, d - 1), + allDay: true + }, + { + id: 2, + title: "Repeating Event", + start: new Date(y, m, d + 6), + allDay: true + }, + { + id: 3, + title: "Meeting", + start: new Date(y, m, d, 10, 0), + allDay: false + }, + { + id: 4, + title: "Click for Facebook", + start: new Date(y, m, d, 11, 30), + end: new Date(y, m, d), + url: "http://facebook.com/", + allDay: false + } + ] + }); + +}); + +$('#my-prev-button').click(function () { + $('#calendar').fullCalendar('prev'); +}); + +$('#my-next-button').click(function () { + $('#calendar').fullCalendar('next'); +}); + +$('#my-today-button').click(function () { + $('#calendar').fullCalendar('today'); +}); + +$('#calendar').fullCalendar('gotoDate', 1, 0, 1); + +$('#my-button').click(function () { + var d: Date = $('#calendar').fullCalendar('getDate'); + alert("The current date of the calendar is " + d); +}); + +$('#calendar').fullCalendar({ + events: [ + { + title: 'My Event', + start: '2010-01-01T14:30:00', + allDay: false + } + // other events here... + ], + timeFormat: 'H(:mm)' // uppercase H for 24-hour clock +}); + +$('#calendar').fullCalendar({ + buttonText: { + prev: '<', + next: '>' + } +}); + +$('#calendar').fullCalendar({ + dayClick: function (date, allDay, jsEvent, view) { + + if (allDay) { + alert('Clicked on the entire day: ' + date); + } else { + alert('Clicked on the slot: ' + date); + } + + alert('Coordinates: ' + jsEvent.pageX + ',' + jsEvent.pageY); + + alert('Current view: ' + view.name); + + // change the day's background color just for fun + $(this).css('background-color', 'red'); + + } +}); + +$('#calendar').fullCalendar({ + eventClick: function (calEvent, jsEvent, view) { + + alert('Event: ' + calEvent.title); + alert('Coordinates: ' + jsEvent.pageX + ',' + jsEvent.pageY); + alert('View: ' + view.name); + + // change the border color just for fun + $(this).css('border-color', 'red'); + + } +}); + +$('#calendar').fullCalendar({ + events: [ + { + title: 'My Event', + start: '2010-01-01', + url: 'http://google.com/' + } + // other events here + ], + eventClick: function (event) { + if (event.url) { + window.open(event.url); + return false; + } + } +}); + +$('#calendar').fullCalendar({ + + eventSources: [ + + // your event source + { + url: '/myfeed.php', + type: 'POST', + data: { + custom_param1: 'something', + custom_param2: 'somethingelse' + }, + error: function () { + alert('there was an error while fetching events!'); + }, + color: 'yellow', // a non-ajax option + textColor: 'black' // a non-ajax option + } + + // any other sources... + + ] + +}); + +$('#calendar').fullCalendar({ + + events: { + url: '/myfeed.php', + type: 'POST', + data: { + custom_param1: 'something', + custom_param2: 'somethingelse' + }, + error: function () { + alert('there was an error while fetching events!'); + }, + color: 'yellow', // a non-ajax option + textColor: 'black' // a non-ajax option + } + +}); + +$('#calendar').fullCalendar({ + + events: { + url: '/myfeed.php', + cache: true + } + +}); + +$('#calendar').fullCalendar({ + + eventSources: [ + + // your event source + { + url: '/myfeed.php', // use the `url` property + color: 'yellow', // an option! + textColor: 'black' // an option! + } + + // any other sources... + + ] + +}); + +$('#calendar').fullCalendar({ + events: '/myfeed.php' +}); + +$('#calendar').fullCalendar({ + events: [ + { + title: 'event1', + start: '2010-01-01' + }, + { + title: 'event2', + start: '2010-01-05', + end: '2010-01-07' + }, + { + title: 'event3', + start: '2010-01-09 12:30:00', + allDay: false // will make the time show + } + ] +}); + +$('#calendar').fullCalendar({ + + eventSources: [ + + // your event source + { + events: [ // put the array in the `events` property + { + title: 'event1', + start: '2010-01-01' + }, + { + title: 'event2', + start: '2010-01-05', + end: '2010-01-07' + }, + { + title: 'event3', + start: '2010-01-09 12:30:00', + } + ], + color: 'black', // an option! + textColor: 'yellow' // an option! + } + + // any other event sources... + + ] + +}); + +$('#calendar').fullCalendar({ + events: function (start, end, callback) { + $.ajax({ + url: 'myxmlfeed.php', + dataType: 'xml', + data: { + // our hypothetical feed requires UNIX timestamps + start: Math.round(start.getTime() / 1000), + end: Math.round(end.getTime() / 1000) + }, + success: function (doc) { + var events = []; + $(doc).find('event').each(function () { + events.push({ + title: $(this).attr('title'), + start: $(this).attr('start') // will be parsed + }); + }); + callback(events); + } + }); + } +}); + +$('#calendar').fullCalendar({ + + eventSources: [ + + // your event source + { + events: function (start, end, callback) { + // ... + }, + color: 'yellow', // an option! + textColor: 'black' // an option! + } + + // any other sources... + + ] + +}); + +$('#calendar').fullCalendar({ + eventSources: [ + '/feed1.php', + '/feed2.php' + ] +}); + +$('#calendar').fullCalendar({ + eventClick: function (event, element) { + + event.title = "CLICKED!"; + + $('#calendar').fullCalendar('updateEvent', event); + + } +}); + +$('#calendar').fullCalendar({ + events: [ + // my event data + ], + eventColor: '#378006' +}); + +$('#calendar').fullCalendar({ + events: [ + { + title: 'My Event', + start: '2010-01-01', + description: 'This is a cool event' + } + // more events here + ], + eventRender: function (event, element) { + element.qtip({ + content: event.description + }); + } +}); +$('#my-draggable').draggable({ + revert: true, // immediately snap back to original position + revertDuration: 0 // +}); + +$('#calendar').fullCalendar({ + droppable: true, + drop: function (date, allDay) { + alert("Dropped on " + date + " with allDay=" + allDay); + } +}); + +$('#calendar').fullCalendar({ + droppable: true, + dropAccept: '.cool-event', + drop: function () { + alert('dropped!'); + } +}); + +$('#draggable1').draggable(); +$('#draggable2').draggable(); + +$(document).ready(function () { + + var date = new Date(); + var d = date.getDate(); + var m = date.getMonth(); + var y = date.getFullYear(); + + $('#calendar').fullCalendar({ + theme: true, + header: { + left: 'prev,next today', + center: 'title', + right: 'month,agendaWeek,agendaDay' + }, + editable: true, + events: [ + { + title: 'All Day Event', + start: new Date(y, m, 1) + }, + { + title: 'Long Event', + start: new Date(y, m, d - 5), + end: new Date(y, m, d - 2) + }, + { + id: 999, + title: 'Repeating Event', + start: new Date(y, m, d - 3, 16, 0), + allDay: false + }, + { + id: 999, + title: 'Repeating Event', + start: new Date(y, m, d + 4, 16, 0), + allDay: false + }, + { + title: 'Meeting', + start: new Date(y, m, d, 10, 30), + allDay: false + }, + { + title: 'Lunch', + start: new Date(y, m, d, 12, 0), + end: new Date(y, m, d, 14, 0), + allDay: false + }, + { + title: 'Birthday Party', + start: new Date(y, m, d + 1, 19, 0), + end: new Date(y, m, d + 1, 22, 30), + allDay: false + }, + { + title: 'Click for Google', + start: new Date(y, m, 28), + end: new Date(y, m, 29), + url: 'http://google.com/' + } + ] + }); + +}); + +$(document).ready(function () { + /* initialize the external events + -----------------------------------------------------------------*/ + $('#external-events div.external-event').each(function () { + + // create an Event Object (http://arshaw.com/fullcalendar/docs/event_data/Event_Object/) + // it doesn't need to have a start or end + var eventObject = { + title: $.trim($(this).text()) // use the element's text as the event title + }; + + // store the Event Object in the DOM element so we can get to it later + $(this).data('eventObject', eventObject); + + // make the event draggable using jQuery UI + $(this).draggable({ + zIndex: 999, + revert: true, // will cause the event to go back to its + revertDuration: 0 // original position after the drag + }); + + }); + /* initialize the calendar + -----------------------------------------------------------------*/ + + $('#calendar').fullCalendar({ + header: { + left: 'prev,next today', + center: 'title', + right: 'month,agendaWeek,agendaDay' + }, + editable: true, + droppable: true, // this allows things to be dropped onto the calendar !!! + drop: function (date, allDay) { // this function is called when something is dropped + + // retrieve the dropped element's stored Event Object + var originalEventObject = $(this).data('eventObject'); + + // we need to copy it, so that multiple events don't have a reference to the same object + var copiedEventObject: any = $.extend({}, originalEventObject); + + // assign it the date that was reported + copiedEventObject.start = date; + copiedEventObject.allDay = allDay; + + // render the event on the calendar + // the last `true` argument determines if the event "sticks" (http://arshaw.com/fullcalendar/docs/event_rendering/renderEvent/) + $('#calendar').fullCalendar('renderEvent', copiedEventObject, true); + + // is the "remove after drop" checkbox checked? + if ($('#drop-remove').is(':checked')) { + // if so, remove the element from the "Draggable Events" list + $(this).remove(); + } + + } + }); +}); \ No newline at end of file diff --git a/fullCalendar/fullCalendar.d.ts b/fullCalendar/fullCalendar.d.ts new file mode 100644 index 000000000..d11c68e04 --- /dev/null +++ b/fullCalendar/fullCalendar.d.ts @@ -0,0 +1,188 @@ +// Type definitions for FullCalendar 1.6.1 +// Project: http://arshaw.com/fullcalendar/ (http://arshaw.com/fullcalendar/) +// Definitions by: Neil Stalker +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module FullCalendar { + export interface Calendar { + formatDate(date: Date, format: string, options?: Options): string; + formatDates(date1: Date, date2: Date, format: string, options?: Options): string; + parseDate(dateString: string, ignoreTimezone?: boolean): Date; + parseISO8601(dateString: string, ignoreTimezone?: boolean): Date; + version: string; + } + + export interface Options { + header?: { + left: string; + center: string; + right: string; + } + theme?: boolean + buttonIcons?: { + prev: string; + next: string; + } + firstDay?: number; + isRTL?: boolean; + weekends?: boolean; + weekMode?: string; + weekNumbers?: boolean; + weekNumberCalculation?: any; // String/Function + height?: number; + contentHeight?: number; + aspectRation?: number; + viewDisplay?: (view: View) => void; + windowResize?: (view: View) => void; + dayRender?: (date: Date, cell: HTMLTableDataCellElement) => void; + + defaultView?: string; + + year?: number; + month?: number; + date?: number; + + timeFormat?: any; // String/ViewOptionHash + columnFormat?: any; // String/ViewOptionHash + titleFormat?: any; // String/ViewOptionHash + buttonText?: ButtonTextObject; + monthNames?: Array; + monthNamesShort?: Array; + dayNames?: Array; + dayNamesShort?: Array; + weekNumberTitle?: number; + + dayClick?: (date: Date, allDay: boolean, jsEvent: Event, view: View) => void; + eventClick?: (event: EventObject, jsEvent: Event, view: View) => any; // return type boolean or void + eventMouseover?: (event: EventObject, jsEvent: Event, view: View) => void; + eventMouseout?: (event: EventObject, jsEvent: Event, view: View) => void; + + selectable?: any; // Boolean/ViewOptionHash + selectHelper?: any; // Boolean/Function + unselectAuto?: boolean; + unselectCancel?: string; + select?: (startDate: Date, endDate: Date, allDay: boolean, jsEvent: Event, view: View) => void; + unselect?: (view: View, jsEvent: Event) => void; + + eventSources?: Array; + allDayDefault?: boolean; + ignoreTimezone?: boolean; + eventDataTransform?: (eventData: any) => EventObject; + startParam?: string; + endParam?: string + lazyFetching?: boolean; + loading?: (isLoading: boolean, view: View) => void; + + eventColor?: string; + eventBackgroundColor?: string; + eventBorderColor?: string; + eventTextColor?: string; + eventRender?: (event: EventObject, element: HTMLDivElement, view: View) => void; + eventAfterRender?: (event: EventObject, element: HTMLDivElement, view: View) => void; + eventAllAfterRender?: (view: View) => void; + + editable?: boolean; + disableDragging?: boolean; + disableResizing?: boolean; + dragRevertDuration?: number; + dragOpacity?: any; // Float/ViewOptionHash + eventDragStart?: (event: EventObject, jsEvent: Event, ui: any, view: View) => void; + eventDragStop?: (event: EventObject, jsEvent: Event, ui: any, view: View) => void; + eventDrop?: (event: EventObject, dayDelta: number, minuteDelta: number, revertFunc: Function, jsEvent: Event, ui: any, view: View) => void; + eventResizeStart?: (event: EventObject, jsEvent: Event, ui: any, view: View) => void; + eventResizeStop?: (event: EventObject, jsEvent: Event, ui: any, view: View) => void; + eventResize?: (event: EventObject, dayDelta: number, minuteDelta: number, revertFunc: Function, jsEvent: Event, ui: any, view: View) => void; + + droppable?: boolean; + dropAccept?: any; // String/Function + drop?: (date: Date, allDay: boolean, jsEvent: Event, ui: any) => void; + } + + export interface View { + name: string; + title: string; + start: Date; + End: Date; + visStart: Date; + visEnd: Date; + } + + export interface ViewOptionHash { + month?: any; + week?: any; + day?: any; + agenda?: any; + agendaDay?: any; + agendaWeek?: any; + basic?: any; + basicDay?: any; + basicWeek?: any; + ''?: any; + } + + export interface AgendaOptions { + allDaySlot?: boolean; + allDayText?: string; + axisFormat?: string; + slotMinutes?: number; + snapMinutes?: number; + defaultEventMinutes?: number; + firstHour?: number; + minTime?: any; // Integer/String + maxTime?: any; // Integer/String + } + + export interface ButtonTextObject { + prev?: string; + next?: string; + prevYear?: string; + nextYear?: string; + today?: string; + month?: string; + week?: string; + day?: string; + } + + export interface EventObject { + id?: any // String/number + title: string; + allDay?: boolean; + start: Date; + end?: Date; + url?: string; + className?: any; // string/Array + editable?: boolean; + source?: EventSource; + color?: string; + backgroundColor?: string; + borderColor?: string; + textColor?: string; + } + + export interface EventSource extends JQueryAjaxSettings { + events?: any; + color?: string; + backgroundColor?: string; + borderColor?: string; + textColor?: string; + className?: any; // string/Array + editable?: boolean; + allDayDefault?: boolean; + ignoreTimezone?: boolean; + eventTransform?: any; + startParam?: string; + endParam?: string + } + +} + +interface JQuery { + fullCalendar(options: FullCalendar.Options): JQuery; + fullCalendar(method: string, ...args: Array): JQuery; +} + +interface JQueryStatic { + fullCalendar: FullCalendar.Calendar; +} \ No newline at end of file From 5144d0553f877ded6d36026ca0b5eb9504fd25e1 Mon Sep 17 00:00:00 2001 From: Neil Stalker Date: Fri, 21 Jun 2013 14:14:08 +0100 Subject: [PATCH 39/57] Move jQueryUI interfaces into a module --- jqueryui/jqueryui-tests.ts | 2 +- jqueryui/jqueryui.d.ts | 1616 ++++++++++++++++++------------------ 2 files changed, 810 insertions(+), 808 deletions(-) diff --git a/jqueryui/jqueryui-tests.ts b/jqueryui/jqueryui-tests.ts index bb77d14f1..120945550 100644 --- a/jqueryui/jqueryui-tests.ts +++ b/jqueryui/jqueryui-tests.ts @@ -601,7 +601,7 @@ function test_accordion() { var heightStyle = $(".selector").accordion("option", "heightStyle"); $(".selector").accordion("option", "heightStyle", "fill"); $(".selector").accordion({ icons: { "header": "ui-icon-plus", "headerSelected": "ui-icon-minus" } }); - var icons = $(".selector").accordion("option", "icons"); + icons = $(".selector").accordion("option", "icons"); $(".selector").accordion("option", "icons", { "header": "ui-icon-plus", "headerSelected": "ui-icon-minus" }); var isDisabled = $(".selector").accordion("option", "disabled"); $(".selector").accordion("option", { disabled: true }); diff --git a/jqueryui/jqueryui.d.ts b/jqueryui/jqueryui.d.ts index e0ee81ded..ba6bf05fd 100644 --- a/jqueryui/jqueryui.d.ts +++ b/jqueryui/jqueryui.d.ts @@ -6,895 +6,897 @@ /// +declare module JQueryUI { + // Accordion ////////////////////////////////////////////////// + + interface AccordionOptions { + active?: any; // bool or number + animate?: any; // bool, number, string or object + collapsible?: bool; + disabled?: bool; + event?: string; + header?: string; + heightStyle?: string; + icons?: any; + } + + interface AccordionUIParams { + newHeader: JQuery; + oldHeader: JQuery; + newPanel: JQuery; + oldPanel: JQuery; + } + + interface AccordionEvent { + (event: Event, ui: AccordionUIParams): void; + } + + interface AccordionEvents { + activate?: AccordionEvent; + beforeActivate?: AccordionEvent; + create?: AccordionEvent; + } + + interface Accordion extends Widget, AccordionOptions, AccordionEvents { + } + + + // Autocomplete ////////////////////////////////////////////////// + + interface AutocompleteOptions { + appendTo?: any; //Selector; + autoFocus?: bool; + delay?: number; + disabled?: bool; + minLength?: number; + position?: string; + source?: any; // [], string or () + } + + interface AutocompleteUIParams { + + } + + interface AutocompleteEvent { + (event: Event, ui: AutocompleteUIParams): void; + } + + interface AutocompleteEvents { + change?: AutocompleteEvent; + close?: AutocompleteEvent; + create?: AutocompleteEvent; + focus?: AutocompleteEvent; + open?: AutocompleteEvent; + response?: AutocompleteEvent; + search?: AutocompleteEvent; + select?: AutocompleteEvent; + } + + interface Autocomplete extends Widget, AutocompleteOptions, AutocompleteEvents { + escapeRegex: (string) => string; + } + + + // Button ////////////////////////////////////////////////// + + interface ButtonOptions { + disabled?: bool; + icons?: any; + label?: string; + text?: bool; + } + + interface Button extends Widget, ButtonOptions { + } + + + // Datepicker ////////////////////////////////////////////////// + + interface DatepickerOptions { + altFieldType?: any; // Selecotr, jQuery or Element + altFormat?: string; + appendText?: string; + autoSize?: bool; + beforeShow?: (input: Element, inst: any) => void; + beforeShowDay?: (date: Date) => void; + buttonImage?: string; + buttonImageOnly?: bool; + buttonText?: string; + calculateWeek?: () => any; + changeMonth?: bool; + changeYear?: bool; + closeText?: string; + constrainInput?: bool; + currentText?: string; + dateFormat?: string; + dayNames?: string[]; + dayNamesMin?: string[]; + dayNamesShort?: string[]; + defaultDateType?: any; // Date, number or string + duration?: string; + firstDay?: number; + gotoCurrent?: bool; + hideIfNoPrevNext?: bool; + isRTL?: bool; + maxDate?: any; // Date, number or string + minDate?: any; // Date, number or string + monthNames?: string[]; + monthNamesShort?: string[]; + navigationAsDateFormat?: bool; + nextText?: string; + numberOfMonths?: any; // number or [] + onChangeMonthYear?: (year: number, month: number, inst: any) => void; + onClose?: (dateText: string, inst: any) => void; + onSelect?: (dateText: string, inst: any) => void; + prevText?: string; + selectOtherMonths?: bool; + shortYearCutoff?: any; // number or string + showAnim?: string; + showButtonPanel?: bool; + showCurrentAtPos?: number; + showMonthAfterYear?: bool; + showOn?: string; + showOptions?: any; // TODO + showOtherMonths?: bool; + showWeek?: bool; + stepMonths?: number; + weekHeader?: string; + yearRange?: string; + yearSuffix?: string; + } + + interface DatepickerFormatDateOptions { + dayNamesShort?: string[]; + dayNames?: string[]; + monthNamesShort?: string[]; + monthNames?: string[]; + } + + interface Datepicker extends Widget, DatepickerOptions { + regional: { [languageCod3: string]: any; }; + setDefaults(defaults: DatepickerOptions); + formatDate(format: string, date: Date, settings?: DatepickerFormatDateOptions): string; + parseDate(format: string, date: string, settings?: DatepickerFormatDateOptions): Date; + iso8601Week(date: Date): void; + noWeekends(): void; + } + + + // Dialog ////////////////////////////////////////////////// + + interface DialogOptions { + autoOpen?: bool; + buttons?: any; // object or [] + closeOnEscape?: bool; + closeText?: string; + dialogClass?: string; + disabled?: bool; + draggable?: bool; + height?: any; // number or string + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + modal?: bool; + position?: any; // object, string or [] + resizable?: bool; + show?: any; // number, string or object + stack?: bool; + title?: string; + width?: any; // number or string + zIndex?: number; + } + + interface DialogUIParams { + } + + interface DialogEvent { + (event: Event, ui: DialogUIParams): void; + } + + interface DialogEvents { + beforeClose?: DialogEvent; + close?: DialogEvent; + create?: DialogEvent; + drag?: DialogEvent; + dragStart?: DialogEvent; + dragStop?: DialogEvent; + focus?: DialogEvent; + open?: DialogEvent; + resize?: DialogEvent; + resizeStart?: DialogEvent; + resizeStop?: DialogEvent; + } + + interface Dialog extends Widget, DialogOptions, DialogEvents { + } + + + // Draggable ////////////////////////////////////////////////// + + interface DraggableEventUIParams { + helper: JQuery; + position: { top: number; left: number; }; + offset: { top: number; left: number; }; + } + + interface DraggableEvent { + (event: Event, ui: DraggableEventUIParams): void; + } + + interface DraggableOptions { + disabled?: bool; + addClasses?: bool; + appendTo?: any; + axis?: string; + cancel?: string; + connectToSortable?: string; + containment?: any; + cursor?: string; + cursorAt?: any; + delay?: number; + distance?: number; + grid?: number[]; + handle?: any; + helper?: any; + iframeFix?: any; + opacity?: number; + refreshPositions?: bool; + revert?: any; + revertDuration?: number; + scope?: string; + scroll?: bool; + scrollSensitivity?: number; + scrollSpeed?: number; + snap?: any; + snapMode?: string; + snapTolerance?: number; + stack?: string; + zIndex?: number; + } + + interface DraggableEvents { + create?: DraggableEvent; + start?: DraggableEvent; + drag?: DraggableEvent; + stop?: DraggableEvent; + } + + interface Draggable extends Widget, DraggableOptions, DraggableEvent { + } + + + // Droppable ////////////////////////////////////////////////// + + interface DroppableEventUIParam { + draggable: JQuery; + helper: JQuery; + position: { top: number; left: number; }; + offset: { top: number; left: number; }; + } + + interface DroppableEvent { + (event: Event, ui: DroppableEventUIParam): void; + } + + interface DroppableOptions { + disabled?: bool; + accept?: any; + activeClass?: string; + greedy?: bool; + hoverClass?: string; + scope?: string; + tolerance?: string; + } + + interface DroppableEvents { + create?: DroppableEvent; + activate?: DroppableEvent; + deactivate?: DroppableEvent; + over?: DroppableEvent; + out?: DroppableEvent; + drop?: DroppableEvent; + } + + interface Droppable extends Widget, DroppableOptions, DroppableEvents { + } + + // Menu ////////////////////////////////////////////////// + + interface MenuOptions { + disabled?: bool; + icons?: any; + menus?: string; + position?: any; // TODO + role?: string; + } + + interface MenuUIParams { + } + + interface MenuEvent { + (event: Event, ui: MenuUIParams): void; + } + + interface MenuEvents { + blur?: MenuEvent; + create?: MenuEvent; + focus?: MenuEvent; + select?: MenuEvent; + } + + interface Menu extends Widget, MenuOptions, MenuEvents { + } + + + // Progressbar ////////////////////////////////////////////////// + + interface ProgressbarOptions { + disabled?: bool; + value?: number; + } + + interface ProgressbarUIParams { + } + + interface ProgressbarEvent { + (event: Event, ui: ProgressbarUIParams): void; + } + + interface ProgressbarEvents { + change?: ProgressbarEvent; + complete?: ProgressbarEvent; + create?: ProgressbarEvent; + } + + interface Progressbar extends Widget, ProgressbarOptions, ProgressbarEvents { + } + + + // Resizable ////////////////////////////////////////////////// + + interface ResizableOptions { + alsoResize?: any; // Selector, JQuery or Element + animate?: bool; + animateDuration?: any; // number or string + animateEasing?: string; + aspectRatio?: any; // bool or number + autoHide?: bool; + cancel?: string; + containment?: any; // Selector, Element or string + delay?: number; + disabled?: bool; + distance?: number; + ghost?: bool; + grid?: any; + handles?: any; // string or object + helper?: string; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + } + + interface ResizableUIParams { + element: JQuery; + helper: JQuery; + originalElement: JQuery; + originalPosition: any; + originalSize: any; + position: any; + size: any; + } + + interface ResizableEvent { + (event: Event, ui: ResizableUIParams): void; + } + + interface ResizableEvents { + resize?: ResizableEvent; + start?: ResizableEvent; + stop?: ResizableEvent; + } + + interface Resizable extends Widget, ResizableOptions, ResizableEvents { + } + + + // Selectable ////////////////////////////////////////////////// + + interface SelectableOptions { + autoRefresh?: bool; + cancel?: string; + delay?: number; + disabled?: bool; + distance?: number; + filter?: string; + tolerance?: string; + } + + interface SelectableEvents { + selected? (event: Event, ui: { selected?: Element; }): void; + selecting? (event: Event, ui: { selecting?: Element; }): void; + start? (event: Event, ui: any): void; + stop? (event: Event, ui: any): void; + unselected? (event: Event, ui: { unselected: Element; }): void; + unselecting? (event: Event, ui: { unselecting: Element; }): void; + } + + interface Selectable extends Widget, SelectableOptions, SelectableEvents { + } + + // Slider ////////////////////////////////////////////////// + + interface SliderOptions { + animate?: any; // bool, string or number + disabled?: bool; + max?: number; + min?: number; + orientation?: string; + range?: any; // bool or string + step?: number; + // value?: number; + // values?: number[]; + } + + interface SliderUIParams { + } + + interface SliderEvent { + (event: Event, ui: SliderUIParams): void; + } + + interface SliderEvents { + change?: SliderEvent; + create?: SliderEvent; + slide?: SliderEvent; + start?: SliderEvent; + stop?: SliderEvent; + } + + interface Slider extends Widget, SliderOptions, SliderEvents { + } + + + // Sortable ////////////////////////////////////////////////// + + interface SortableOptions { + appendTo?: any; // jQuery, Element, Selector or string + axis?: string; + cancel?: string; + connectWith?: string; + containment?: any; // Element, Selector or string + cursor?: string; + cursorAt?: any; + delay?: number; + disabled?: bool; + distance?: number; + dropOnEmpty?: bool; + forceHelperSize?: bool; + forcePlaceholderSize?: bool; + grid?: number[]; + handle?: any; // Selector or Element + items?: any; // Selector + opacity?: number; + placeholder?: string; + revert?: any; // bool or number + scroll?: bool; + scrollSensitivity?: number; + scrollSpeed?: number; + tolerance?: string; + zIndex?: number; + } + + interface SortableUIParams { + helper: JQuery; + item: JQuery; + offset: any; + position: any; + originalPosition: any; + sender: JQuery; + placeholder: JQuery; + } + + interface SortableEvent { + (event: Event, ui: SortableUIParams): void; + } + + interface SortableEvents { + activate?: SortableEvent; + beforeStop?: SortableEvent; + change?: SortableEvent; + deactivate?: SortableEvent; + out?: SortableEvent; + over?: SortableEvent; + receive?: SortableEvent; + remove?: SortableEvent; + sort?: SortableEvent; + start?: SortableEvent; + stop?: SortableEvent; + update?: SortableEvent; + } + + interface Sortable extends Widget, SortableOptions, SortableEvents { + } + + + // Spinner ////////////////////////////////////////////////// + + interface SpinnerOptions { + culture?: string; + disabled?: bool; + icons?: any; + incremental?: any; // bool or () + max?: any; // number or string + min?: any; // number or string + numberFormat?: string; + page?: number; + step?: any; // number or string + } + + interface SpinnerUIParams { + } + + interface SpinnerEvent { + (event: Event, ui: SpinnerUIParams): void; + } + + interface SpinnerEvents { + spin?: SpinnerEvent; + start?: SpinnerEvent; + stop?: SpinnerEvent; + } + + interface Spinner extends Widget, SpinnerOptions, SpinnerEvents { + } + + + // Tabs ////////////////////////////////////////////////// + + interface TabsOptions { + active?: any; // bool or number + collapsible?: bool; + disabled?: any; // bool or [] + event?: string; + heightStyle?: string; + hide?: any; // bool, number, string or object + show?: any; // bool, number, string or object + } + + interface TabsUIParams { + } + + interface TabsEvent { + (event: Event, ui: TabsUIParams): void; + } + + interface TabsEvents { + activate?: TabsEvent; + beforeActivate?: TabsEvent; + beforeLoad?: TabsEvent; + load?: TabsEvent; + } + + interface Tabs extends Widget, TabsOptions, TabsEvents { + } + + + // Tooltip ////////////////////////////////////////////////// + + interface TooltipOptions { + content?: any; // () or string + disabled?: bool; + hide?: any; // bool, number, string or object + items?: string; + position?: any; // TODO + show?: any; // bool, number, string or object + tooltipClass?: string; + track?: bool; + } + + interface TooltipUIParams { + } + + interface TooltipEvent { + (event: Event, ui: TooltipUIParams): void; + } + + interface TooltipEvents { + close?: TooltipEvent; + open?: TooltipEvent; + } + + interface Tooltip extends Widget, TooltipOptions, TooltipEvents { + } + + + // Effects ////////////////////////////////////////////////// + + interface EffectOptions { + effect: string; + easing?: string; + duration: any; + complete: Function; + } + + interface BlindEffect { + direction?: string; + } + + interface BounceEffect { + distance?: number; + times?: number; + } + + interface ClipEffect { + direction?: number; + } + + interface DropEffect { + direction?: number; + } + + interface ExplodeEffect { + pieces?: number; + } + + interface FadeEffect { } + + interface FoldEffect { + size?: any; + horizFirst?: bool; + } + + interface HighlightEffect { + color?: string; + } + + interface PuffEffect { + percent?: number; + } + + interface PulsateEffect { + times?: number; + } + + interface ScaleEffect { + direction?: string; + origin?: string[]; + percent?: number; + scale?: string; + } + + interface ShakeEffect { + direction?: string; + distance?: number; + times?: number; + } + + interface SizeEffect { + to?: any; + origin?: string[]; + scale?: string; + } + + interface SlideEffect { + direction?: string; + distance?: number; + } + + interface TransferEffect { + className?: string; + to?: string; + } + + interface JQueryPositionOptions { + my?: string; + at?: string; + of?: any; + collision?: string; + using?: Function; + within?: any; + } + + + // UI ////////////////////////////////////////////////// + + interface MouseOptions { + cancel?: string; + delay?: number; + distance?: number; + } + + interface keyCode { + BACKSPACE: number; + COMMA: number; + DELETE: number; + DOWN: number; + END: number; + ENTER: number; + ESCAPE: number; + HOME: number; + LEFT: number; + NUMPAD_ADD: number; + NUMPAD_DECIMAL: number; + NUMPAD_DIVIDE: number; + NUMPAD_ENTER: number; + NUMPAD_MULTIPLY: number; + NUMPAD_SUBTRACT: number; + PAGE_DOWN: number; + PAGE_UP: number; + PERIOD: number; + RIGHT: number; + SPACE: number; + TAB: number; + UP: number; + } + + interface UI { + mouse(method: string): JQuery; + mouse(options: MouseOptions): JQuery; + mouse(optionLiteral: string, optionName: string, optionValue: any): JQuery; + mouse(optionLiteral: string, optionValue: any): any; + + accordion: Accordion; + autocomplete: Autocomplete; + button: Button; + buttonset: Button; + datepicker: Datepicker; + dialog: Dialog; + keyCode: keyCode; + menu: Menu; + progressbar: Progressbar; + slider: Slider; + spinner: Spinner; + tabs: Tabs; + tooltip: Tooltip; + version: string; + } + + + // Widget ////////////////////////////////////////////////// + + interface WidgetOptions { + disabled?: bool; + hide?: any; + show?: any; + } + + interface Widget { + (methodName: string): JQuery; + (options: WidgetOptions): JQuery; + (options: AccordionOptions): JQuery; + (optionLiteral: string, optionName: string): any; + (optionLiteral: string, options: WidgetOptions): any; + (optionLiteral: string, optionName: string, optionValue: any): JQuery; + + (name: string, prototype: any): JQuery; + (name: string, base: Function, prototype: any): JQuery; + } + + //////////////////////////////////////////////////////////////////////////////////////////////////// -// Accordion ////////////////////////////////////////////////// - -interface AccordionOptions { - active?: any; // bool or number - animate?: any; // bool, number, string or object - collapsible?: bool; - disabled?: bool; - event?: string; - header?: string; - heightStyle?: string; - icons?: any; } -interface AccordionUIParams { - newHeader: JQuery; - oldHeader: JQuery; - newPanel: JQuery; - oldPanel: JQuery; -} - -interface AccordionEvent { - (event: Event, ui: AccordionUIParams): void; -} - -interface AccordionEvents { - activate?: AccordionEvent; - beforeActivate?: AccordionEvent; - create?: AccordionEvent; -} - -interface Accordion extends Widget, AccordionOptions, AccordionEvents { -} - - -// Autocomplete ////////////////////////////////////////////////// - -interface AutocompleteOptions { - appendTo?: any; //Selector; - autoFocus?: bool; - delay?: number; - disabled?: bool; - minLength?: number; - position?: string; - source?: any; // [], string or () -} - -interface AutocompleteUIParams { - -} - -interface AutocompleteEvent { - (event: Event, ui: AutocompleteUIParams): void; -} - -interface AutocompleteEvents { - change?: AutocompleteEvent; - close?: AutocompleteEvent; - create?: AutocompleteEvent; - focus?: AutocompleteEvent; - open?: AutocompleteEvent; - response?: AutocompleteEvent; - search?: AutocompleteEvent; - select?: AutocompleteEvent; -} - -interface Autocomplete extends Widget, AutocompleteOptions, AutocompleteEvents { - escapeRegex: (string) => string; -} - - -// Button ////////////////////////////////////////////////// - -interface ButtonOptions { - disabled?: bool; - icons?: any; - label?: string; - text?: bool; -} - -interface Button extends Widget, ButtonOptions { -} - - -// Datepicker ////////////////////////////////////////////////// - -interface DatepickerOptions { - altFieldType?: any; // Selecotr, jQuery or Element - altFormat?: string; - appendText?: string; - autoSize?: bool; - beforeShow?: (input: Element, inst: any) => void; - beforeShowDay?: (date: Date) => void; - buttonImage?: string; - buttonImageOnly?: bool; - buttonText?: string; - calculateWeek?: () => any; - changeMonth?: bool; - changeYear?: bool; - closeText?: string; - constrainInput?: bool; - currentText?: string; - dateFormat?: string; - dayNames?: string[]; - dayNamesMin?: string[]; - dayNamesShort?: string[]; - defaultDateType?: any; // Date, number or string - duration?: string; - firstDay?: number; - gotoCurrent?: bool; - hideIfNoPrevNext?: bool; - isRTL?: bool; - maxDate?: any; // Date, number or string - minDate?: any; // Date, number or string - monthNames?: string[]; - monthNamesShort?: string[]; - navigationAsDateFormat?: bool; - nextText?: string; - numberOfMonths?: any; // number or [] - onChangeMonthYear?: (year: number, month: number, inst: any) => void; - onClose?: (dateText: string, inst: any) => void; - onSelect?: (dateText: string, inst: any) => void; - prevText?: string; - selectOtherMonths?: bool; - shortYearCutoff?: any; // number or string - showAnim?: string; - showButtonPanel?: bool; - showCurrentAtPos?: number; - showMonthAfterYear?: bool; - showOn?: string; - showOptions?: any; // TODO - showOtherMonths?: bool; - showWeek?: bool; - stepMonths?: number; - weekHeader?: string; - yearRange?: string; - yearSuffix?: string; -} - -interface DatepickerFormatDateOptions { - dayNamesShort?: string[]; - dayNames?: string[]; - monthNamesShort?: string[]; - monthNames?: string[]; -} - -interface Datepicker extends Widget, DatepickerOptions { - regional: { [languageCod3: string]: any; }; - setDefaults(defaults: DatepickerOptions); - formatDate(format: string, date: Date, settings?: DatepickerFormatDateOptions): string; - parseDate(format: string, date: string, settings?: DatepickerFormatDateOptions): Date; - iso8601Week(date: Date): void; - noWeekends(): void; -} - - -// Dialog ////////////////////////////////////////////////// - -interface DialogOptions { - autoOpen?: bool; - buttons?: any; // object or [] - closeOnEscape?: bool; - closeText?: string; - dialogClass?: string; - disabled?: bool; - draggable?: bool; - height?: any; // number or string - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - modal?: bool; - position?: any; // object, string or [] - resizable?: bool; - show?: any; // number, string or object - stack?: bool; - title?: string; - width?: any; // number or string - zIndex?: number; -} - -interface DialogUIParams { -} - -interface DialogEvent { - (event: Event, ui: DialogUIParams): void; -} - -interface DialogEvents { - beforeClose?: DialogEvent; - close?: DialogEvent; - create?: DialogEvent; - drag?: DialogEvent; - dragStart?: DialogEvent; - dragStop?: DialogEvent; - focus?: DialogEvent; - open?: DialogEvent; - resize?: DialogEvent; - resizeStart?: DialogEvent; - resizeStop?: DialogEvent; -} - -interface Dialog extends Widget, DialogOptions, DialogEvents { -} - - -// Draggable ////////////////////////////////////////////////// - -interface DraggableEventUIParams { - helper: JQuery; - position: { top: number; left: number; }; - offset: { top: number; left: number; }; -} - -interface DraggableEvent { - (event: Event, ui: DraggableEventUIParams): void; -} - -interface DraggableOptions { - disabled?: bool; - addClasses?: bool; - appendTo?: any; - axis?: string; - cancel?: string; - connectToSortable?: string; - containment?: any; - cursor?: string; - cursorAt?: any; - delay?: number; - distance?: number; - grid?: number[]; - handle?: any; - helper?: any; - iframeFix?: any; - opacity?: number; - refreshPositions?: bool; - revert?: any; - revertDuration?: number; - scope?: string; - scroll?: bool; - scrollSensitivity?: number; - scrollSpeed?: number; - snap?: any; - snapMode?: string; - snapTolerance?: number; - stack?: string; - zIndex?: number; -} - -interface DraggableEvents { - create?: DraggableEvent; - start?: DraggableEvent; - drag?: DraggableEvent; - stop?: DraggableEvent; -} - -interface Draggable extends Widget, DraggableOptions, DraggableEvent { -} - - -// Droppable ////////////////////////////////////////////////// - -interface DroppableEventUIParam { - draggable: JQuery; - helper: JQuery; - position: { top: number; left: number; }; - offset: { top: number; left: number; }; -} - -interface DroppableEvent { - (event: Event, ui: DroppableEventUIParam): void; -} - -interface DroppableOptions { - disabled?: bool; - accept?: any; - activeClass?: string; - greedy?: bool; - hoverClass?: string; - scope?: string; - tolerance?: string; -} - -interface DroppableEvents { - create?: DroppableEvent; - activate?: DroppableEvent; - deactivate?: DroppableEvent; - over?: DroppableEvent; - out?: DroppableEvent; - drop?: DroppableEvent; -} - -interface Droppable extends Widget, DroppableOptions, DroppableEvents { -} - -// Menu ////////////////////////////////////////////////// - -interface MenuOptions { - disabled?: bool; - icons?: any; - menus?: string; - position?: any; // TODO - role?: string; -} - -interface MenuUIParams { -} - -interface MenuEvent { - (event: Event, ui: MenuUIParams): void; -} - -interface MenuEvents { - blur?: MenuEvent; - create?: MenuEvent; - focus?: MenuEvent; - select?: MenuEvent; -} - -interface Menu extends Widget, MenuOptions, MenuEvents { -} - - -// Progressbar ////////////////////////////////////////////////// - -interface ProgressbarOptions { - disabled?: bool; - value?: number; -} - -interface ProgressbarUIParams { -} - -interface ProgressbarEvent { - (event: Event, ui: ProgressbarUIParams): void; -} - -interface ProgressbarEvents { - change?: ProgressbarEvent; - complete?: ProgressbarEvent; - create?: ProgressbarEvent; -} - -interface Progressbar extends Widget, ProgressbarOptions, ProgressbarEvents { -} - - -// Resizable ////////////////////////////////////////////////// - -interface ResizableOptions { - alsoResize?: any; // Selector, JQuery or Element - animate?: bool; - animateDuration?: any; // number or string - animateEasing?: string; - aspectRatio?: any; // bool or number - autoHide?: bool; - cancel?: string; - containment?: any; // Selector, Element or string - delay?: number; - disabled?: bool; - distance?: number; - ghost?: bool; - grid?: any; - handles?: any; // string or object - helper?: string; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; -} - -interface ResizableUIParams { - element: JQuery; - helper: JQuery; - originalElement: JQuery; - originalPosition: any; - originalSize: any; - position: any; - size: any; -} - -interface ResizableEvent { - (event: Event, ui: ResizableUIParams): void; -} - -interface ResizableEvents { - resize?: ResizableEvent; - start?: ResizableEvent; - stop?: ResizableEvent; -} - -interface Resizable extends Widget, ResizableOptions, ResizableEvents { -} - - -// Selectable ////////////////////////////////////////////////// - -interface SelectableOptions { - autoRefresh?: bool; - cancel?: string; - delay?: number; - disabled?: bool; - distance?: number; - filter?: string; - tolerance?: string; -} - -interface SelectableEvents { - selected? (event: Event, ui: { selected?: Element; }): void; - selecting? (event: Event, ui: { selecting?: Element; }): void; - start? (event: Event, ui: any): void; - stop? (event: Event, ui: any): void; - unselected? (event: Event, ui: { unselected: Element; }): void; - unselecting? (event: Event, ui: { unselecting: Element; }): void; -} - -interface Selectable extends Widget, SelectableOptions, SelectableEvents { -} - -// Slider ////////////////////////////////////////////////// - -interface SliderOptions { - animate?: any; // bool, string or number - disabled?: bool; - max?: number; - min?: number; - orientation?: string; - range?: any; // bool or string - step?: number; - // value?: number; - // values?: number[]; -} - -interface SliderUIParams { -} - -interface SliderEvent { - (event: Event, ui: SliderUIParams): void; -} - -interface SliderEvents { - change?: SliderEvent; - create?: SliderEvent; - slide?: SliderEvent; - start?: SliderEvent; - stop?: SliderEvent; -} - -interface Slider extends Widget, SliderOptions, SliderEvents { -} - - -// Sortable ////////////////////////////////////////////////// - -interface SortableOptions { - appendTo?: any; // jQuery, Element, Selector or string - axis?: string; - cancel?: string; - connectWith?: string; - containment?: any; // Element, Selector or string - cursor?: string; - cursorAt?: any; - delay?: number; - disabled?: bool; - distance?: number; - dropOnEmpty?: bool; - forceHelperSize?: bool; - forcePlaceholderSize?: bool; - grid?: number[]; - handle?: any; // Selector or Element - items?: any; // Selector - opacity?: number; - placeholder?: string; - revert?: any; // bool or number - scroll?: bool; - scrollSensitivity?: number; - scrollSpeed?: number; - tolerance?: string; - zIndex?: number; -} - -interface SortableUIParams { - helper: JQuery; - item: JQuery; - offset: any; - position: any; - originalPosition: any; - sender: JQuery; - placeholder: JQuery; -} - -interface SortableEvent { - (event: Event, ui: SortableUIParams): void; -} - -interface SortableEvents { - activate?: SortableEvent; - beforeStop?: SortableEvent; - change?: SortableEvent; - deactivate?: SortableEvent; - out?: SortableEvent; - over?: SortableEvent; - receive?: SortableEvent; - remove?: SortableEvent; - sort?: SortableEvent; - start?: SortableEvent; - stop?: SortableEvent; - update?: SortableEvent; -} - -interface Sortable extends Widget, SortableOptions, SortableEvents { -} - - -// Spinner ////////////////////////////////////////////////// - -interface SpinnerOptions { - culture?: string; - disabled?: bool; - icons?: any; - incremental?: any; // bool or () - max?: any; // number or string - min?: any; // number or string - numberFormat?: string; - page?: number; - step?: any; // number or string -} - -interface SpinnerUIParams { -} - -interface SpinnerEvent { - (event: Event, ui: SpinnerUIParams): void; -} - -interface SpinnerEvents { - spin?: SpinnerEvent; - start?: SpinnerEvent; - stop?: SpinnerEvent; -} - -interface Spinner extends Widget, SpinnerOptions, SpinnerEvents { -} - - -// Tabs ////////////////////////////////////////////////// - -interface TabsOptions { - active?: any; // bool or number - collapsible?: bool; - disabled?: any; // bool or [] - event?: string; - heightStyle?: string; - hide?: any; // bool, number, string or object - show?: any; // bool, number, string or object -} - -interface TabsUIParams { -} - -interface TabsEvent { - (event: Event, ui: TabsUIParams): void; -} - -interface TabsEvents { - activate?: TabsEvent; - beforeActivate?: TabsEvent; - beforeLoad?: TabsEvent; - load?: TabsEvent; -} - -interface Tabs extends Widget, TabsOptions, TabsEvents { -} - - -// Tooltip ////////////////////////////////////////////////// - -interface TooltipOptions { - content?: any; // () or string - disabled?: bool; - hide?: any; // bool, number, string or object - items?: string; - position?: any; // TODO - show?: any; // bool, number, string or object - tooltipClass?: string; - track?: bool; -} - -interface TooltipUIParams { -} - -interface TooltipEvent { - (event: Event, ui: TooltipUIParams): void; -} - -interface TooltipEvents { - close?: TooltipEvent; - open?: TooltipEvent; -} - -interface Tooltip extends Widget, TooltipOptions, TooltipEvents { -} - - -// Effects ////////////////////////////////////////////////// - -interface EffectOptions { - effect: string; - easing?: string; - duration: any; - complete: Function; -} - -interface BlindEffect { - direction?: string; -} - -interface BounceEffect { - distance?: number; - times?: number; -} - -interface ClipEffect { - direction?: number; -} - -interface DropEffect { - direction?: number; -} - -interface ExplodeEffect { - pieces?: number; -} - -interface FadeEffect { } - -interface FoldEffect { - size?: any; - horizFirst?: bool; -} - -interface HighlightEffect { - color?: string; -} - -interface PuffEffect { - percent?: number; -} - -interface PulsateEffect { - times?: number; -} - -interface ScaleEffect { - direction?: string; - origin?: string[]; - percent?: number; - scale?: string; -} - -interface ShakeEffect { - direction?: string; - distance?: number; - times?: number; -} - -interface SizeEffect { - to?: any; - origin?: string[]; - scale?: string; -} - -interface SlideEffect { - direction?: string; - distance?: number; -} - -interface TransferEffect { - className?: string; - to?: string; -} - -interface JQueryPositionOptions { - my?: string; - at?: string; - of?: any; - collision?: string; - using?: Function; - within?: any; -} - - -// UI ////////////////////////////////////////////////// - -interface MouseOptions { - cancel?: string; - delay?: number; - distance?: number; -} - -interface keyCode { - BACKSPACE: number; - COMMA: number; - DELETE: number; - DOWN: number; - END: number; - ENTER: number; - ESCAPE: number; - HOME: number; - LEFT: number; - NUMPAD_ADD: number; - NUMPAD_DECIMAL: number; - NUMPAD_DIVIDE: number; - NUMPAD_ENTER: number; - NUMPAD_MULTIPLY: number; - NUMPAD_SUBTRACT: number; - PAGE_DOWN: number; - PAGE_UP: number; - PERIOD: number; - RIGHT: number; - SPACE: number; - TAB: number; - UP: number; -} - -interface UI { - mouse(method: string): JQuery; - mouse(options: MouseOptions): JQuery; - mouse(optionLiteral: string, optionName: string, optionValue: any): JQuery; - mouse(optionLiteral: string, optionValue: any): any; - - accordion: Accordion; - autocomplete: Autocomplete; - button: Button; - buttonset: Button; - datepicker: Datepicker; - dialog: Dialog; - keyCode: keyCode ; - menu: Menu; - progressbar: Progressbar; - slider: Slider; - spinner: Spinner; - tabs: Tabs; - tooltip: Tooltip; - version: string; -} - - -// Widget ////////////////////////////////////////////////// - -interface WidgetOptions { - disabled?: bool; - hide?: any; - show?: any; -} - -interface Widget { - (methodName: string): JQuery; - (options: WidgetOptions): JQuery; - (options: AccordionOptions): JQuery; - (optionLiteral: string, optionName: string): any; - (optionLiteral: string, options: WidgetOptions): any; - (optionLiteral: string, optionName: string, optionValue: any): JQuery; - - (name: string, prototype: any): JQuery; - (name: string, base: Function, prototype: any): JQuery; -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// - interface JQuery { accordion(): JQuery; accordion(methodName: string): JQuery; - accordion(options: AccordionOptions): JQuery; + accordion(options: JQueryUI.AccordionOptions): JQuery; accordion(optionLiteral: string, optionName: string): any; - accordion(optionLiteral: string, options: AccordionOptions): any; + accordion(optionLiteral: string, options: JQueryUI.AccordionOptions): any; accordion(optionLiteral: string, optionName: string, optionValue: any): JQuery; autocomplete(): JQuery; autocomplete(methodName: string): JQuery; - autocomplete(options: AutocompleteOptions): JQuery; + autocomplete(options: JQueryUI.AutocompleteOptions): JQuery; autocomplete(optionLiteral: string, optionName: string): any; - autocomplete(optionLiteral: string, options: AutocompleteOptions): any; + autocomplete(optionLiteral: string, options: JQueryUI.AutocompleteOptions): any; autocomplete(optionLiteral: string, optionName: string, optionValue: any): JQuery; button(): JQuery; button(methodName: string): JQuery; - button(options: ButtonOptions): JQuery; + button(options: JQueryUI.ButtonOptions): JQuery; button(optionLiteral: string, optionName: string): any; - button(optionLiteral: string, options: ButtonOptions): any; + button(optionLiteral: string, options: JQueryUI.ButtonOptions): any; button(optionLiteral: string, optionName: string, optionValue: any): JQuery; buttonset(): JQuery; buttonset(methodName: string): JQuery; - buttonset(options: ButtonOptions): JQuery; + buttonset(options: JQueryUI.ButtonOptions): JQuery; buttonset(optionLiteral: string, optionName: string): any; - buttonset(optionLiteral: string, options: ButtonOptions): any; + buttonset(optionLiteral: string, options: JQueryUI.ButtonOptions): any; buttonset(optionLiteral: string, optionName: string, optionValue: any): JQuery; datepicker(): JQuery; datepicker(methodName: string): JQuery; - datepicker(options: DatepickerOptions): JQuery; + datepicker(options: JQueryUI.DatepickerOptions): JQuery; datepicker(optionLiteral: string, optionName: string): any; - datepicker(optionLiteral: string, options: DatepickerOptions): any; + datepicker(optionLiteral: string, options: JQueryUI.DatepickerOptions): any; datepicker(optionLiteral: string, optionName: string, optionValue: any): JQuery; dialog(): JQuery; dialog(methodName: string): JQuery; - dialog(options: DialogOptions): JQuery; + dialog(options: JQueryUI.DialogOptions): JQuery; dialog(optionLiteral: string, optionName: string): any; - dialog(optionLiteral: string, options: DialogOptions): any; + dialog(optionLiteral: string, options: JQueryUI.DialogOptions): any; dialog(optionLiteral: string, optionName: string, optionValue: any): JQuery; draggable(): JQuery; draggable(methodName: string): JQuery; - draggable(options: DraggableOptions): JQuery; + draggable(options: JQueryUI.DraggableOptions): JQuery; draggable(optionLiteral: string, optionName: string): any; - draggable(optionLiteral: string, options: DraggableOptions): any; + draggable(optionLiteral: string, options: JQueryUI.DraggableOptions): any; draggable(optionLiteral: string, optionName: string, optionValue: any): JQuery; droppable(): JQuery; droppable(methodName: string): JQuery; - droppable(options: DroppableOptions): JQuery; + droppable(options: JQueryUI.DroppableOptions): JQuery; droppable(optionLiteral: string, optionName: string): any; - droppable(optionLiteral: string, options: DraggableOptions): any; + droppable(optionLiteral: string, options: JQueryUI.DraggableOptions): any; droppable(optionLiteral: string, optionName: string, optionValue: any): JQuery; menu(): JQuery; menu(methodName: string): JQuery; - menu(options: MenuOptions): JQuery; + menu(options: JQueryUI.MenuOptions): JQuery; menu(optionLiteral: string, optionName: string): any; - menu(optionLiteral: string, options: MenuOptions): any; + menu(optionLiteral: string, options: JQueryUI.MenuOptions): any; menu(optionLiteral: string, optionName: string, optionValue: any): JQuery; progressbar(): JQuery; progressbar(methodName: string): JQuery; - progressbar(options: ProgressbarOptions): JQuery; + progressbar(options: JQueryUI.ProgressbarOptions): JQuery; progressbar(optionLiteral: string, optionName: string): any; - progressbar(optionLiteral: string, options: ProgressbarOptions): any; + progressbar(optionLiteral: string, options: JQueryUI.ProgressbarOptions): any; progressbar(optionLiteral: string, optionName: string, optionValue: any): JQuery; resizable(): JQuery; resizable(methodName: string): JQuery; - resizable(options: ResizableOptions): JQuery; + resizable(options: JQueryUI.ResizableOptions): JQuery; resizable(optionLiteral: string, optionName: string): any; - resizable(optionLiteral: string, options: ResizableOptions): any; + resizable(optionLiteral: string, options: JQueryUI.ResizableOptions): any; resizable(optionLiteral: string, optionName: string, optionValue: any): JQuery; selectable(): JQuery; selectable(methodName: string): JQuery; - selectable(options: SelectableOptions): JQuery; + selectable(options: JQueryUI.SelectableOptions): JQuery; selectable(optionLiteral: string, optionName: string): any; - selectable(optionLiteral: string, options: SelectableOptions): any; + selectable(optionLiteral: string, options: JQueryUI.SelectableOptions): any; selectable(optionLiteral: string, optionName: string, optionValue: any): JQuery; slider(): JQuery; slider(methodName: string): JQuery; - slider(options: SliderOptions): JQuery; + slider(options: JQueryUI.SliderOptions): JQuery; slider(optionLiteral: string, optionName: string): any; - slider(optionLiteral: string, options: SliderOptions): any; + slider(optionLiteral: string, options: JQueryUI.SliderOptions): any; slider(optionLiteral: string, optionName: string, optionValue: any): JQuery; sortable(): JQuery; sortable(methodName: string): JQuery; - sortable(options: SortableOptions): JQuery; + sortable(options: JQueryUI.SortableOptions): JQuery; sortable(optionLiteral: string, optionName: string): any; - sortable(optionLiteral: string, options: SortableOptions): any; + sortable(optionLiteral: string, options: JQueryUI.SortableOptions): any; sortable(optionLiteral: string, optionName: string, optionValue: any): JQuery; spinner(): JQuery; spinner(methodName: string): JQuery; - spinner(options: SpinnerOptions): JQuery; + spinner(options: JQueryUI.SpinnerOptions): JQuery; spinner(optionLiteral: string, optionName: string): any; - spinner(optionLiteral: string, options: SpinnerOptions): any; + spinner(optionLiteral: string, options: JQueryUI.SpinnerOptions): any; spinner(optionLiteral: string, optionName: string, optionValue: any): JQuery; tabs(): JQuery; tabs(methodName: string): JQuery; - tabs(options: TabsOptions): JQuery; + tabs(options: JQueryUI.TabsOptions): JQuery; tabs(optionLiteral: string, optionName: string): any; - tabs(optionLiteral: string, options: TabsOptions): any; + tabs(optionLiteral: string, options: JQueryUI.TabsOptions): any; tabs(optionLiteral: string, optionName: string, optionValue: any): JQuery; tooltip(): JQuery; tooltip(methodName: string): JQuery; - tooltip(options: TooltipOptions): JQuery; + tooltip(options: JQueryUI.TooltipOptions): JQuery; tooltip(optionLiteral: string, optionName: string): any; - tooltip(optionLiteral: string, options: TooltipOptions): any; + tooltip(optionLiteral: string, options: JQueryUI.TooltipOptions): any; tooltip(optionLiteral: string, optionName: string, optionValue: any): JQuery; @@ -932,7 +934,7 @@ interface JQuery { toggle(effect: string, options?: any, duration?: number, complete?: Function): JQuery; toggle(effect: string, options?: any, duration?: string, complete?: Function): JQuery; - position(options: JQueryPositionOptions): JQuery; + position(options: JQueryUI.JQueryPositionOptions): JQuery; enableSelection(): JQuery; disableSelection(): JQuery; @@ -943,14 +945,14 @@ interface JQuery { zIndex(): JQuery; zIndex(zIndex: number): JQuery; - widget: Widget; + widget: JQueryUI.Widget; jQuery: JQueryStatic; } interface JQueryStatic { - ui: UI; - datepicker: Datepicker; - widget: Widget; - Widget: Widget; + ui: JQueryUI.UI; + datepicker: JQueryUI.Datepicker; + widget: JQueryUI.Widget; + Widget: JQueryUI.Widget; } \ No newline at end of file From ef82ef1bede3af0b4b229ec995bafb476ad38879 Mon Sep 17 00:00:00 2001 From: Neil Stalker Date: Fri, 21 Jun 2013 14:50:25 +0100 Subject: [PATCH 40/57] Fix toastr tests --- toastr/toastr-tests.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/toastr/toastr-tests.ts b/toastr/toastr-tests.ts index 31a09e609..d973731a5 100644 --- a/toastr/toastr-tests.ts +++ b/toastr/toastr-tests.ts @@ -16,7 +16,6 @@ function test_basic() { toastr.options.onclick = function () { } } -declare var $; function test_fromdemo() { var i = -1, toastCount = 0, From fb147bbcfc2e27815684fd5224e75cc21eec058d Mon Sep 17 00:00:00 2001 From: Neil Stalker Date: Fri, 21 Jun 2013 14:59:19 +0100 Subject: [PATCH 41/57] Update AzureMobileServicesClient for 0.9 --- .../AzureMobileServicesClient-tests.ts | 4 ++-- azure-mobile-services-client/AzureMobileServicesClient.d.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/azure-mobile-services-client/AzureMobileServicesClient-tests.ts b/azure-mobile-services-client/AzureMobileServicesClient-tests.ts index b557a2baf..f381c0809 100644 --- a/azure-mobile-services-client/AzureMobileServicesClient-tests.ts +++ b/azure-mobile-services-client/AzureMobileServicesClient-tests.ts @@ -32,8 +32,8 @@ tableTodoItems.read() //define simple handler used in callback calls for insert/update and delete -function handlerInsUpd(e, i) => { if (!e) data.push( i); }; -function handlerDelErr(e) => { if (e) alert("ERROR: " + e); } +function handlerInsUpd(e, i) { if (!e) data.push( i); }; +function handlerDelErr(e) { if (e) alert("ERROR: " + e); } //insert one data passing info in POST + custom data in QueryString + simple callback handler diff --git a/azure-mobile-services-client/AzureMobileServicesClient.d.ts b/azure-mobile-services-client/AzureMobileServicesClient.d.ts index 1dcf9e5a6..09d0efb7c 100644 --- a/azure-mobile-services-client/AzureMobileServicesClient.d.ts +++ b/azure-mobile-services-client/AzureMobileServicesClient.d.ts @@ -3,7 +3,7 @@ // Definitions by: Morosinotto Daniele // Definitions: https://github.com/borisyankov/DefinitelyTyped -module Microsoft.WindowsAzure { +declare module Microsoft.WindowsAzure { // MobileServiceClient object based on Microsoft Azure documentation: http://msdn.microsoft.com/en-us/library/windowsazure/jj554219.aspx interface MobileServiceClient { From 4b44767f4a05c7628c1306ca6e492e20abd646d5 Mon Sep 17 00:00:00 2001 From: Neil Stalker Date: Fri, 21 Jun 2013 15:21:45 +0100 Subject: [PATCH 42/57] Fix colors for 0.9 and rename test file --- colors/{colors.test.ts => colors-test.ts} | 0 colors/colors.d.ts | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename colors/{colors.test.ts => colors-test.ts} (100%) diff --git a/colors/colors.test.ts b/colors/colors-test.ts similarity index 100% rename from colors/colors.test.ts rename to colors/colors-test.ts diff --git a/colors/colors.d.ts b/colors/colors.d.ts index 99388e69d..c87112d7c 100644 --- a/colors/colors.d.ts +++ b/colors/colors.d.ts @@ -3,7 +3,7 @@ // Definitions by: Bart van der Schoor // Definitions: https://github.com/borisyankov/DefinitelyTyped -declare interface String { +interface String { bold:string; italic:string; underline:string; From 7b441a8d21a1bf0fe44c64b1a068a9ff987d893f Mon Sep 17 00:00:00 2001 From: Neil Stalker Date: Fri, 21 Jun 2013 15:47:23 +0100 Subject: [PATCH 43/57] fix i18next, jsFixtures, sinon and expect for TS 0.9 move and rename i18next test file --- expect.js/expect.js.d.ts | 2 +- .../i18next.d.tests.ts => i18next-tests.ts} | 40 +- i18next/i18next.d.ts | 2 +- i18next/lib/jquery.d.ts | 758 ------------------ i18next/lib/mocha.d.ts | 44 - i18next/lib/sinon.d.ts | 33 - js-fixtures/fixtures.d.ts | 2 +- sinon/sinon-1.5.d.ts | 2 +- 8 files changed, 17 insertions(+), 866 deletions(-) rename i18next/{tests/i18next.d.tests.ts => i18next-tests.ts} (96%) delete mode 100644 i18next/lib/jquery.d.ts delete mode 100644 i18next/lib/mocha.d.ts delete mode 100644 i18next/lib/sinon.d.ts diff --git a/expect.js/expect.js.d.ts b/expect.js/expect.js.d.ts index c4884f07d..c943f4e4f 100644 --- a/expect.js/expect.js.d.ts +++ b/expect.js/expect.js.d.ts @@ -5,7 +5,7 @@ declare function expect(target?: any): Expect.Root; -module Expect { +declare module Expect { interface Assertion { /** * Check if the value is truthy diff --git a/i18next/tests/i18next.d.tests.ts b/i18next/i18next-tests.ts similarity index 96% rename from i18next/tests/i18next.d.tests.ts rename to i18next/i18next-tests.ts index 2feb294b1..a0fbd4332 100644 --- a/i18next/tests/i18next.d.tests.ts +++ b/i18next/i18next-tests.ts @@ -1,15 +1,12 @@ -/// -/// +/// +/// +/// +/// /// -/// - -// declarations for expect.js -declare var expect: (actual: string) => any; -declare var expect: (actual: number) => any; - -// declarations for jsfixtures.js -declare var setFixtures: (html) => void; +/// +declare function done(): void; + describe('i18next', function () { var i18n = $.i18n @@ -1221,9 +1218,7 @@ describe('i18next', function () { }; beforeEach(function (done) { - setFixtures(' - -'); + fixtures.set(''); i18n.init($.extend(opts, { resStore: resStore }), function (t) { done(); }); @@ -1250,9 +1245,7 @@ describe('i18next', function () { }; beforeEach(function (done) { - setFixtures(' - -'); + fixtures.set(''); i18n.init($.extend(opts, { resStore: resStore }), function (t) { done(); }); @@ -1279,9 +1272,7 @@ describe('i18next', function () { }; beforeEach(function (done) { - setFixtures(' - -'); + fixtures.set(''); i18n.init($.extend(opts, { resStore: resStore }), function (t) { done(); }); @@ -1299,14 +1290,11 @@ describe('i18next', function () { var resStore = { dev: { translation: {} }, en: { translation: {} }, - 'en-US': { translation: { 'simpleTest': ' -test -' } } + 'en-US': { translation: { 'simpleTest': 'test' } } }; beforeEach(function (done) { - setFixtures(' -'); + fixtures.set(''); i18n.init($.extend(opts, { resStore: resStore }), function (t) { done(); }); @@ -1329,9 +1317,7 @@ test }; beforeEach(function (done) { - setFixtures(' - -'); + fixtures.set(''); i18n.init($.extend(opts, { resStore: resStore, diff --git a/i18next/i18next.d.ts b/i18next/i18next.d.ts index cd85d7104..a1b843640 100644 --- a/i18next/i18next.d.ts +++ b/i18next/i18next.d.ts @@ -13,7 +13,7 @@ interface IResourceStoreLanguage { [namespace: string]: IResourceStoreKey; } interface IResourceStoreKey { - [key: string]; + [key: string]: any; } interface I18nextOptions { diff --git a/i18next/lib/jquery.d.ts b/i18next/lib/jquery.d.ts deleted file mode 100644 index 25e2aa626..000000000 --- a/i18next/lib/jquery.d.ts +++ /dev/null @@ -1,758 +0,0 @@ -/* ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - -// Typing for the jQuery library, version 1.7.x - -/* - Interface for the AJAX setting that will configure the AJAX request -*/ -interface JQueryAjaxSettings { - accepts?: any; - async?: bool; - beforeSend?(jqXHR: JQueryXHR, settings: JQueryAjaxSettings); - cache?: bool; - complete?(jqXHR: JQueryXHR, textStatus: string); - contents?: { [key: string]: any; }; - contentType?: string; - context?: any; - converters?: { [key: string]: any; }; - crossDomain?: bool; - data?: any; - dataFilter?(data: any, ty: any): any; - dataType?: string; - error?(jqXHR: JQueryXHR, textStatus: string, errorThrow: string): any; - global?: bool; - headers?: { [key: string]: any; }; - ifModified?: bool; - isLocal?: bool; - jsonp?: string; - jsonpCallback?: any; - mimeType?: string; - password?: string; - processData?: bool; - scriptCharset?: string; - statusCode?: { [key: string]: any; }; - success?(data: any, textStatus: string, jqXHR: JQueryXHR); - timeout?: number; - traditional?: bool; - type?: string; - url?: string; - username?: string; - xhr?: any; - xhrFields?: { [key: string]: any; }; -} - -/* - Interface for the jqXHR object -*/ -interface JQueryXHR extends XMLHttpRequest, JQueryPromise { - overrideMimeType(mimeType: string); -} - -/* - Interface for the JQuery callback -*/ -interface JQueryCallback { - add(...callbacks: any[]): any; - disable(): any; - empty(): any; - fire(...arguments: any[]): any; - fired(): bool; - fireWith(context: any, ...args: any[]): any; - has(callback: any): bool; - lock(): any; - locked(): bool; - remove(...callbacks: any[]): any; -} - -/* - Interface for the JQuery promise, part of callbacks -*/ -interface JQueryPromise { - always(...alwaysCallbacks: any[]): JQueryDeferred; - done(...doneCallbacks: any[]): JQueryDeferred; - fail(...failCallbacks: any[]): JQueryDeferred; - progress(...progressCallbacks: any[]): JQueryDeferred; - state(): string; - pipe(doneFilter?: (...args: any[]) => any, failFilter?: (...args: any[]) => any, progressFilter?: (...args: any[]) => any): JQueryPromise; - then(doneCallbacks: any, failCallbacks: any, progressCallbacks?: any): JQueryDeferred; -} - -/* - Interface for the JQuery deferred, part of callbacks -*/ -interface JQueryDeferred extends JQueryPromise { - notify(...args: any[]): JQueryDeferred; - notifyWith(context: any, ...args: any[]): JQueryDeferred; - - pipe(doneFilter?: any, failFilter?: any, progressFilter?: any): JQueryPromise; - progress(...progressCallbacks: any[]): JQueryDeferred; - promise(target? ): JQueryDeferred; - reject(...args: any[]): JQueryDeferred; - rejectWith(context:any, ...args: any[]): JQueryDeferred; - resolve(...args: any[]): JQueryDeferred; - resolveWith(context:any, ...args: any[]): JQueryDeferred; - state(): string; - then(doneCallbacks: any, failCallbacks: any, progressCallbacks?: any): JQueryDeferred; -} - -/* - Interface of the JQuery extension of the W3C event object -*/ -interface JQueryEventObject extends Event { - data: any; - delegateTarget: Element; - isDefaultPrevented(): bool; - isImmediatePropogationStopped(): bool; - isPropogationStopped(): bool; - namespace: string; - preventDefault(): any; - relatedTarget: Element; - result: any; - stopImmediatePropagation(); - stopPropagation(); - pageX: number; - pageY: number; - which: number; - metaKey: any; -} - -/* - Collection of properties of the current browser -*/ -interface JQueryBrowserInfo { - safari:bool; - opera:bool; - msie:bool; - mozilla:bool; - webkit:bool; - version:string; -} - -interface JQuerySupport { - ajax?: bool; - boxModel?: bool; - changeBubbles?: bool; - checkClone?: bool; - checkOn?: bool; - cors?: bool; - cssFloat?: bool; - hrefNormalized?: bool; - htmlSerialize?: bool; - leadingWhitespace?: bool; - noCloneChecked?: bool; - noCloneEvent?: bool; - opacity?: bool; - optDisabled?: bool; - optSelected?: bool; - scriptEval?(): bool; - style?: bool; - submitBubbles?: bool; - tbody?: bool; -} - -/* - Static members of jQuery (those on $ and jQuery themselves) -*/ -interface JQueryStatic { - - /**** - AJAX - *****/ - ajax(settings: JQueryAjaxSettings): JQueryXHR; - ajax(url: string, settings?: JQueryAjaxSettings): JQueryXHR; - - ajaxPrefilter(dataTypes: string, handler: (opts: any, originalOpts: any, jqXHR: JQueryXHR) => any): any; - ajaxPrefilter(handler: (opts: any, originalOpts: any, jqXHR: JQueryXHR) => any): any; - - ajaxSettings: JQueryAjaxSettings; - - ajaxSetup(options: any); - - get(url: string, data?: any, success?: any, dataType?: any): JQueryXHR; - getJSON(url: string, data?: any, success?: any): JQueryXHR; - getScript(url: string, success?: any): JQueryXHR; - - param(obj: any): string; - param(obj: any, traditional: bool): string; - - post(url: string, data?: any, success?: any, dataType?: any): JQueryXHR; - - /********* - CALLBACKS - **********/ - Callbacks(flags?: string): JQueryCallback; - - /**** - CORE - *****/ - holdReady(hold: bool): any; - - (selector: string, context?: any): JQuery; - (element: Element): JQuery; - (object: { }): JQuery; - (elementArray: Element[]): JQuery; - (object: JQuery): JQuery; - (func: Function): JQuery; - (array: any[]): JQuery; - (): JQuery; - - noConflict(removeAll?: bool): Object; - - when(...deferreds: any[]): JQueryPromise; - - /*** - CSS - ****/ - css(e: any, propertyName: string, value?: any); - css(e: any, propertyName: any, value?: any); - cssHooks: { [key: string]: any; }; - cssNumber: any; - - /**** - DATA - *****/ - data(element: Element, key: string, value: any): any; - data(element: Element, key: string): any; - data(element: Element): any; - - dequeue(element: Element, queueName?: string): any; - - hasData(element: Element): bool; - - queue(element: Element, queueName?: string): any[]; - queue(element: Element, queueName: string, newQueueOrCallback: any): JQuery; - - removeData(element: Element, name?: string): JQuery; - - /******* - EFFECTS - ********/ - fx: { tick: () => void; interval: number; stop: () => void; speeds: { slow: number; fast: number; }; off: bool; step: any; }; - - /****** - EVENTS - *******/ - proxy(fn: Function, context: any): any; - proxy(context: any, name: any): any; - Deferred(): JQueryDeferred; - - /********* - INTERNALS - **********/ - error(message: any); - - /************* - MISCELLANEOUS - **************/ - expr: any; - fn: any; //TODO: Decide how we want to type this - isReady: bool; - - /********** - PROPERTIES - ***********/ - browser: JQueryBrowserInfo; - support: JQuerySupport; - - /********* - UTILITIES - **********/ - contains(container: Element, contained: Element): bool; - - each(collection: any, callback: (indexInArray: any, valueOfElement: any) => any): any; - - extend(target: any, ...objs: any[]): Object; - extend(deep: bool, target: any, ...objs: any[]): Object; - - globalEval(code: string): any; - - grep(array: any[], func: any, invert?: bool): any[]; - - inArray(value: any, array: any[], fromIndex?: number): number; - - isArray(obj: any): bool; - isEmptyObject(obj: any): bool; - isFunction(obj: any): bool; - isNumeric(value: any): bool; - isPlainObject(obj: any): bool; - isWindow(obj: any): bool; - isXMLDoc(node: Node): bool; - - makeArray(obj: any): any[]; - - map(array: any[], callback: (elementOfArray: any, indexInArray: any) =>any): any[]; - - merge(first: any[], second: any[]): any[]; - - noop(): any; - - now(): number; - - parseJSON(json: string): Object; - - //FIXME: This should return an XMLDocument - parseXML(data: string): any; - - queue(element: Element, queueName: string, newQueue: any[]): JQuery; - - trim(str: string): string; - - type(obj: any): string; - - unique(arr: any[]): any[]; -} - -/* - The jQuery instance members -*/ -interface JQuery { - /**** - AJAX - *****/ - ajaxComplete(handler: any): JQuery; - ajaxError(handler: (event: any, jqXHR: any, settings: any, exception: any) => any): JQuery; - ajaxSend(handler: (event: any, jqXHR: any, settings: any, exception: any) => any): JQuery; - ajaxStart(handler: () => any): JQuery; - ajaxStop(handler: () => any): JQuery; - ajaxSuccess(handler: (event: any, jqXHR: any, settings: any, exception: any) => any): JQuery; - - load(url: string, data?: any, complete?: any): JQuery; - - serialize(): string; - serializeArray(): any[]; - - /********** - ATTRIBUTES - ***********/ - addClass(classNames: string): JQuery; - addClass(func: (index: any, currentClass: any) => string): JQuery; - - attr(attributeName: string): string; - attr(attributeName: string, value: any): JQuery; - attr(map: { [key: string]: any; }): JQuery; - attr(attributeName: string, func: (index: any, attr: any) => any): JQuery; - - hasClass(className: string): bool; - - html(): string; - html(htmlString: string): JQuery; - html(htmlContent: (index: number, oldhtml: string) => string): JQuery; - - prop(propertyName: string): any; - prop(propertyName: string, value: any): JQuery; - prop(map: any): JQuery; - prop(propertyName: string, func: (index: any, oldPropertyValue: any) => any): JQuery; - - removeAttr(attributeName: any): JQuery; - - removeClass(className?: any): JQuery; - removeClass(func: (index: any, cls: any) => any): JQuery; - - removeProp(propertyName: any): JQuery; - - toggleClass(className: any, swtch?: bool): JQuery; - toggleClass(swtch?: bool): JQuery; - toggleClass(func: (index: any, cls: any, swtch: any) => any): JQuery; - - val(): any; - val(value: string[]): JQuery; - val(value: string): JQuery; - val(value: number): JQuery; - val(func: (index: any, value: any) => any): JQuery; - - /*** - CSS - ****/ - css(propertyName: string, value?: any): any; - css(propertyName: any, value?: any): any; - - height(): number; - height(value: number): JQuery; - height(value: string): JQuery; - height(func: (index: any, height: any) => any): JQuery; - - innerHeight(): number; - innerWidth(): number; - - offset(): { left: number; top: number; }; - offset(coordinates: any): JQuery; - offset(func: (index: any, coords: any) => any): JQuery; - - outerHeight(includeMargin?: bool): number; - outerWidth(includeMargin?: bool): number; - - position(): { top: number; left: number; }; - - scrollLeft(): number; - scrollLeft(value: number): JQuery; - - scrollTop(): number; - scrollTop(value: number): JQuery; - - width(): number; - width(value: number): JQuery; - width(value: string): JQuery; - width(func: (index: any, height: any) => any): JQuery; - - /**** - DATA - *****/ - clearQueue(queueName?: string): JQuery; - - data(key: string, value: any): JQuery; - data(obj: { [key: string]: any; }): JQuery; - data(key?: string): any; - - dequeue(queueName?: string): JQuery; - - removeData(nameOrList?: any): JQuery; - - /******** - DEFERRED - *********/ - promise(type?: any, target?: any): JQueryPromise; - - /******* - EFFECTS - ********/ - animate(properties: any, duration?: any, complete?: Function): JQuery; - animate(properties: any, duration?: any, easing?: string, complete?: Function): JQuery; - animate(properties: any, options: { duration?: any; easing?: string; complete?: Function; step?: Function; queue?: bool; specialEasing?: any; }); - - delay(duration: number, queueName?: string): JQuery; - - fadeIn(duration?: any, callback?: any): JQuery; - fadeIn(duration?: any, easing?: string, callback?: any): JQuery; - - fadeOut(duration?: any, callback?: any): JQuery; - fadeOut(duration?: any, easing?: string, callback?: any): JQuery; - - fadeTo(duration: any, opacity: number, callback?: any): JQuery; - fadeTo(duration: any, opacity: number, easing?: string, callback?: any): JQuery; - - fadeToggle(duration?: any, callback?: any): JQuery; - fadeToggle(duration?: any, easing?: string, callback?: any): JQuery; - - hide(duration?: any, callback?: any): JQuery; - hide(duration?: any, easing?: string, callback?: any): JQuery; - - show(duration?: any, callback?: any): JQuery; - show(duration?: any, easing?: string, callback?: any): JQuery; - - slideDown(duration?: any, callback?: any): JQuery; - slideDown(duration?: any, easing?: string, callback?: any): JQuery; - - slideToggle(duration?: any, callback?: any): JQuery; - slideToggle(duration?: any, easing?: string, callback?: any): JQuery; - - slideUp(duration?: any, callback?: any): JQuery; - slideUp(duration?: any, easing?: string, callback?: any): JQuery; - - stop(clearQueue?: bool, jumpToEnd?: bool): JQuery; - stop(queue?:any, clearQueue?: bool, jumpToEnd?: bool): JQuery; - - toggle(duration?: any, callback?: any): JQuery; - toggle(duration?: any, easing?: string, callback?: any): JQuery; - toggle(showOrHide: bool): JQuery; - - /****** - EVENTS - *******/ - bind(eventType: string, eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - bind(eventType: string, eventData: any, preventBubble:bool): JQuery; - bind(eventType: string, preventBubble:bool): JQuery; - bind(...events: any[]); - - blur(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - blur(handler: (eventObject: JQueryEventObject) => any): JQuery; - - change(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - change(handler: (eventObject: JQueryEventObject) => any): JQuery; - - click(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - click(handler: (eventObject: JQueryEventObject) => any): JQuery; - - dblclick(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - dblclick(handler: (eventObject: JQueryEventObject) => any): JQuery; - - delegate(selector: any, eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery; - - focus(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - focus(handler: (eventObject: JQueryEventObject) => any): JQuery; - - focusin(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; - focusin(handler: (eventObject: JQueryEventObject) => any): JQuery; - - focusout(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; - focusout(handler: (eventObject: JQueryEventObject) => any): JQuery; - - hover(handlerIn: (eventObject: JQueryEventObject) => any, handlerOut: (eventObject: JQueryEventObject) => any): JQuery; - hover(handlerInOut: (eventObject: JQueryEventObject) => any): JQuery; - - keydown(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - keydown(handler: (eventObject: JQueryEventObject) => any): JQuery; - - keypress(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - keypress(handler: (eventObject: JQueryEventObject) => any): JQuery; - - keyup(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - keyup(handler: (eventObject: JQueryEventObject) => any): JQuery; - - load(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - load(handler: (eventObject: JQueryEventObject) => any): JQuery; - - mousedown(): JQuery; - mousedown(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; - mousedown(handler: (eventObject: JQueryEventObject) => any): JQuery; - - mouseevent(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; - mouseevent(handler: (eventObject: JQueryEventObject) => any): JQuery; - - mouseenter(): JQuery; - mouseenter(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; - mouseenter(handler: (eventObject: JQueryEventObject) => any): JQuery; - - mouseleave(): JQuery; - mouseleave(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; - mouseleave(handler: (eventObject: JQueryEventObject) => any): JQuery; - - mousemove(): JQuery; - mousemove(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; - mousemove(handler: (eventObject: JQueryEventObject) => any): JQuery; - - mouseout(): JQuery; - mouseout(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; - mouseout(handler: (eventObject: JQueryEventObject) => any): JQuery; - - mouseover(): JQuery; - mouseover(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; - mouseover(handler: (eventObject: JQueryEventObject) => any): JQuery; - - mouseup(): JQuery; - mouseup(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; - mouseup(handler: (eventObject: JQueryEventObject) => any): JQuery; - - off(events?: string, selector?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - off(eventsMap: { [key: string]: any; }, selector?: any): JQuery; - - on(events: string, selector?: any, data?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - on(eventsMap: { [key: string]: any; }, selector?: any, data?: any): JQuery; - - one(events: string, selector?: any, data?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - one(eventsMap: { [key: string]: any; }, selector?: any, data?: any): JQuery; - - ready(handler: any): JQuery; - - resize(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - resize(handler: (eventObject: JQueryEventObject) => any): JQuery; - - scroll(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - scroll(handler: (eventObject: JQueryEventObject) => any): JQuery; - - select(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - select(handler: (eventObject: JQueryEventObject) => any): JQuery; - - submit(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - submit(handler: (eventObject: JQueryEventObject) => any): JQuery; - - trigger(eventType: string, ...extraParameters: any[]): JQuery; - trigger(event: JQueryEventObject): JQuery; - - triggerHandler(eventType: string, ...extraParameters: any[]): Object; - - unbind(eventType?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; - unbind(eventType: string, fls: bool): JQuery; - unbind(evt: any): JQuery; - - undelegate(): JQuery; - undelegate(selector: any, eventType: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; - undelegate(selector: any, events: any): JQuery; - undelegate(namespace: string): JQuery; - - unload(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - unload(handler: (eventObject: JQueryEventObject) => any): JQuery; - - /********* - INTERNALS - **********/ - - context: Element; - jquery: string; - - error(handler: (eventObject: JQueryEventObject) => any): JQuery; - error(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; - - pushStack(elements: any[]): JQuery; - pushStack(elements: any[], name: any, arguments: any): JQuery; - - /************ - MANIPULATION - *************/ - after(...content: any[]): JQuery; - after(func: (index: any) => any); - - append(...content: any[]): JQuery; - append(func: (index: any, html: any) => any); - - appendTo(target: any): JQuery; - - before(...content: any[]): JQuery; - before(func: (index: any) => any); - - clone(withDataAndEvents?: bool, deepWithDataAndEvents?: bool): JQuery; - - detach(selector?: any): JQuery; - - empty(): JQuery; - - insertAfter(target: any): JQuery; - insertBefore(target: any): JQuery; - - prepend(...content: any[]): JQuery; - prepend(func: (index: any, html: any) =>any): JQuery; - - prependTo(target: any): JQuery; - - remove(selector?: any): JQuery; - - replaceAll(target: any): JQuery; - - replaceWith(func: any): JQuery; - - text(): string; - text(textString: any): JQuery; - text(textString: (index: number, text: string) => string): JQuery; - - toArray(): any[]; - - unwrap(): JQuery; - - wrap(wrappingElement: any): JQuery; - wrap(func: (index: any) =>any): JQuery; - - wrapAll(wrappingElement: any): JQuery; - - wrapInner(wrappingElement: any): JQuery; - wrapInner(func: (index: any) =>any): JQuery; - - /************* - MISCELLANEOUS - **************/ - each(func: (index: any, elem: Element) => any); - - get(index?: number): any; - - index(): number; - index(selector: string): number; - index(element: any): number; - - /********** - PROPERTIES - ***********/ - length: number; - [x: string]: HTMLElement; - [x: number]: HTMLElement; - - /********** - TRAVERSING - ***********/ - add(selector: string, context?: any): JQuery; - add(...elements: any[]): JQuery; - add(html: string): JQuery; - add(obj: JQuery): JQuery; - - andSelf(): JQuery; - - children(selector?: any): JQuery; - - closest(selector: string): JQuery; - closest(selector: string, context?: Element): JQuery; - closest(obj: JQuery): JQuery; - closest(element: any): JQuery; - closest(selectors: any, context?: Element): any[]; - - contents(): JQuery; - - end(): JQuery; - - eq(index: number): JQuery; - - filter(selector: string): JQuery; - filter(func: (index: any) =>any): JQuery; - filter(element: any): JQuery; - filter(obj: JQuery): JQuery; - - find(selector: string): JQuery; - find(element: any): JQuery; - find(obj: JQuery): JQuery; - - first(): JQuery; - - has(selector: string): JQuery; - has(contained: Element): JQuery; - - is(selector: string): bool; - is(func: (index: any) =>any): bool; - is(element: any): bool; - is(obj: JQuery): bool; - - last(): JQuery; - - map(callback: (index: any, domElement: Element) =>any): JQuery; - - next(selector?: string): JQuery; - - nextAll(selector?: string): JQuery; - - nextUntil(selector?: string, filter?: string): JQuery; - nextUntil(element?: Element, filter?: string): JQuery; - - not(selector: string): JQuery; - not(func: (index: any) =>any): JQuery; - not(element: any): JQuery; - not(obj: JQuery): JQuery; - - offsetParent(): JQuery; - - parent(selector?: string): JQuery; - - parents(selector?: string): JQuery; - - parentsUntil(selector?: string, filter?: string): JQuery; - parentsUntil(element?: Element, filter?: string): JQuery; - - prev(selector?: string): JQuery; - - prevAll(selector?: string): JQuery; - - prevUntil(selector?: string, filter?:string): JQuery; - prevUntil(element?: Element, filter?:string): JQuery; - - siblings(selector?: string): JQuery; - - slice(start: number, end?: number): JQuery; - - /********* - UTILITIES - **********/ - - queue(queueName?: string): any[]; - queue(queueName: string, newQueueOrCallback: any): JQuery; - queue(newQueueOrCallback: any): JQuery; -} - -declare var jQuery: JQueryStatic; -declare var $: JQueryStatic; diff --git a/i18next/lib/mocha.d.ts b/i18next/lib/mocha.d.ts deleted file mode 100644 index ee31e689d..000000000 --- a/i18next/lib/mocha.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -// BDD -declare function describe(cb: () => void); -declare function describe(cb: (done:() => void) => void); -declare function describe(title: string, cb: () => void); -declare function describe(title: string, cb: (done:() => void) => void); - -declare function it(cb: () => void); -declare function it(cb: (done:() => void) => void); -declare function it(title: string, cb: () => void); -declare function it(title: string, cb: (done:() => void) => void); - -declare function before(cb: () => void); -declare function before(cb: (done:() => void) => void); -declare function before(title: string, cb: () => void); -declare function before(title: string, cb: (done:() => void) => void); - -declare function after(cb: () => void); -declare function after(cb: (done:() => void) => void); -declare function after(title: string, cb: () => void); -declare function after(title: string, cb: (done:() => void) => void); - -declare function beforeEach(cb: () => void); -declare function beforeEach(cb: (done:() => void) => void); -declare function beforeEach(title: string, cb: () => void); -declare function beforeEach(title: string, cb: (done:() => void) => void); - -declare function afterEach(cb: () => void); -declare function afterEach(cb: (done:() => void) => void); -declare function afterEach(title: string, cb: () => void); -declare function afterEach(title: string, cb: (done:() => void) => void); - - -// TDD -declare function suite(title: string, cb: () => void); -declare function test(title: string, cb: () => void); -declare function test(title: string, cb: (done:() => void) => void); -declare function setup(title: string, cb: () => void); -declare function teardown(title: string, cb: () => void); - -declare function suite(cb: () => void); -declare function test(cb: () => void); -declare function test(cb: (done:() => void) => void); -declare function setup(cb: () => void); -declare function teardown(cb: () => void); diff --git a/i18next/lib/sinon.d.ts b/i18next/lib/sinon.d.ts deleted file mode 100644 index 25198e3b3..000000000 --- a/i18next/lib/sinon.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -/// - -interface spy { - called: bool; - getCall(x: number): any; - fakeServer: ISinonFakeServer; - calledOnce: bool; - calledWith(x: any, message: string): bool; -} - -interface IJsonReponse { - responseCode: number; - responseHeaders: any; - responseString: string; -} - -interface ISinonFakeServer { - create(): any; - restore(): void; - respondWith(postType: string, relativeUrl: string, x: any): any; - respond(): any; -} - -declare module sinon { - export function spy(): spy; - export function spy(fn: Function): spy; - //export function spy(jquery: JQueryStatic , x: string): spy; - export function spy(jquery: JQueryStatic , x: any): spy; - export function spy(obj: Object , methodName: string): spy; - export var fakeServer: ISinonFakeServer; - export function stub(x: any, name: string); - export function useFakeTimers(): void; -} \ No newline at end of file diff --git a/js-fixtures/fixtures.d.ts b/js-fixtures/fixtures.d.ts index 912bc693c..92bd548e0 100644 --- a/js-fixtures/fixtures.d.ts +++ b/js-fixtures/fixtures.d.ts @@ -3,7 +3,7 @@ // Definitions by: Kazi Manzur Rashid // DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped -declare interface Fixtures { +interface Fixtures { path: string; containerId: string; body(): string; diff --git a/sinon/sinon-1.5.d.ts b/sinon/sinon-1.5.d.ts index cb776563a..ed423515e 100644 --- a/sinon/sinon-1.5.d.ts +++ b/sinon/sinon-1.5.d.ts @@ -387,4 +387,4 @@ interface SinonStatic { log: (message: string) => void; } -var sinon: SinonStatic; +declare var sinon: SinonStatic; From 18628d14904e2bc1b32579f857620d4914d69f51 Mon Sep 17 00:00:00 2001 From: Neil Stalker Date: Fri, 21 Jun 2013 16:03:05 +0100 Subject: [PATCH 44/57] fix chai, chai-jquery and sinon-chai for TS 0.9 --- chai-jquery/chai-jquery-tests.ts | 4 ++-- chai/{chai-assert-test.ts => chai-assert-tests.ts} | 4 ++-- chai/chai-tests.ts | 1 - chai/chai.d.ts | 6 +----- sinon-chai/sinon-chai-tests.ts | 4 ++-- 5 files changed, 7 insertions(+), 12 deletions(-) rename chai/{chai-assert-test.ts => chai-assert-tests.ts} (99%) diff --git a/chai-jquery/chai-jquery-tests.ts b/chai-jquery/chai-jquery-tests.ts index fbd05480e..97ed7a36a 100644 --- a/chai-jquery/chai-jquery-tests.ts +++ b/chai-jquery/chai-jquery-tests.ts @@ -1,5 +1,5 @@ -///  -///  +/// +/// declare var $; var expect = chai.expect; diff --git a/chai/chai-assert-test.ts b/chai/chai-assert-tests.ts similarity index 99% rename from chai/chai-assert-test.ts rename to chai/chai-assert-tests.ts index b4a5a15be..19429b4c9 100644 --- a/chai/chai-assert-test.ts +++ b/chai/chai-assert-tests.ts @@ -330,7 +330,7 @@ suite('assert', function () { test('isArray', function () { assert.isArray([]); - assert.isArray(new Array); + assert.isArray(new Array()); err(function () { assert.isArray({}); @@ -345,7 +345,7 @@ suite('assert', function () { }, "expected [] not to be an array"); err(function () { - assert.isNotArray(new Array); + assert.isNotArray(new Array()); }, "expected [] not to be an array"); }); diff --git a/chai/chai-tests.ts b/chai/chai-tests.ts index 3774e3895..ab26aadbc 100644 --- a/chai/chai-tests.ts +++ b/chai/chai-tests.ts @@ -1,6 +1,5 @@ /// -var chai: chai; var expect = chai.expect; function test_be() { diff --git a/chai/chai.d.ts b/chai/chai.d.ts index f74673727..6a9010322 100644 --- a/chai/chai.d.ts +++ b/chai/chai.d.ts @@ -116,10 +116,6 @@ declare module chai { to: To; } + function expect(target: any): chai.ExpectMatchers; } -interface chai { - expect: { - (target: any): chai.ExpectMatchers; - } -} diff --git a/sinon-chai/sinon-chai-tests.ts b/sinon-chai/sinon-chai-tests.ts index 1ada034de..e4de0f5a4 100644 --- a/sinon-chai/sinon-chai-tests.ts +++ b/sinon-chai/sinon-chai-tests.ts @@ -1,5 +1,5 @@ -///  -///  +/// +/// var expect = chai.expect; From 25127bf917f1c0073051dadfc54e66c2fa845408 Mon Sep 17 00:00:00 2001 From: Neil Stalker Date: Fri, 21 Jun 2013 16:08:00 +0100 Subject: [PATCH 45/57] fix cheerio for TS 0.9 --- cheerio/{cheerio-test.ts => cheerio-tests.ts} | 130 +++++++++--------- cheerio/cheerio.d.ts | 6 +- 2 files changed, 68 insertions(+), 68 deletions(-) rename cheerio/{cheerio-test.ts => cheerio-tests.ts} (93%) diff --git a/cheerio/cheerio-test.ts b/cheerio/cheerio-tests.ts similarity index 93% rename from cheerio/cheerio-test.ts rename to cheerio/cheerio-tests.ts index b2a5d84f3..00cc95ee8 100644 --- a/cheerio/cheerio-test.ts +++ b/cheerio/cheerio-tests.ts @@ -1,65 +1,65 @@ -/// - -import cheerio = module("cheerio"); - -var $ = cheerio.load(""); -var $el = $('selector'); -var $multiEl = $('seletor', 'selector', 'selector'); - -$el.addClass("class").addClass("test"); -$el.hasClass("test"); -$el.removeClass("class").removeClass("test"); - -$el.attr('class'); -$el.attr('class', 'test'); -$el.removeAttr("class").removeAttr("test"); - -$el.find("ul").find("> li"); - -$el.parent().parent(); -$el.next().next(); -$el.prev().prev(); -$el.siblings().siblings(); - -$el.children().children(); -$el.children("li").children("a"); - -$el.children().each((index, element) => { - $(element).find('t'); -}); - -$el.children().map((index, element) => { - return $(element).find('t'); -}); - -$el.children().filter((index) => { - return $el.children().eq(index).find('t'); -}); - -$el.filter('span').filter('li'); - -$el.first().last().find('t'); - -$('div').eq(0).find('b'); - -$('#id').append("test html", "other html").find('a'); -$('#id').prepend("test html", "other html").find('a'); -$('#id').after("test html", "other html").find('a'); -$('#id').before("test html", "other html").find('a'); - -$el.remove('div').remove('a'); - -$('#id').replaceWith('some html').parent(); -$('#id').empty().parent(); - -$el.html(); -$el.html("").find('div'); - -$el.text(); -$el.text('some text'); - -$el.toArray(); -$el.clone().find('a').parent(); -$el.root().find('a'); - -$el.dom(); +/// + +import cheerio = module("cheerio"); + +var $ = cheerio.load(""); +var $el = $('selector'); +var $multiEl = $('seletor', 'selector', 'selector'); + +$el.addClass("class").addClass("test"); +$el.hasClass("test"); +$el.removeClass("class").removeClass("test"); + +$el.attr('class'); +$el.attr('class', 'test'); +$el.removeAttr("class").removeAttr("test"); + +$el.find("ul").find("> li"); + +$el.parent().parent(); +$el.next().next(); +$el.prev().prev(); +$el.siblings().siblings(); + +$el.children().children(); +$el.children("li").children("a"); + +$el.children().each((index, element) => { + return $(element).find('t'); +}); + +$el.children().map((index, element) => { + return $(element).find('t'); +}); + +$el.children().filter((index) => { + return $el.children().eq(index).find('t'); +}); + +$el.filter('span').filter('li'); + +$el.first().last().find('t'); + +$('div').eq(0).find('b'); + +$('#id').append("test html", "other html").find('a'); +$('#id').prepend("test html", "other html").find('a'); +$('#id').after("test html", "other html").find('a'); +$('#id').before("test html", "other html").find('a'); + +$el.remove('div').remove('a'); + +$('#id').replaceWith('some html').parent(); +$('#id').empty().parent(); + +$el.html(); +$el.html("").find('div'); + +$el.text(); +$el.text('some text'); + +$el.toArray(); +$el.clone().find('a').parent(); +$el.root().find('a'); + +$el.dom(); diff --git a/cheerio/cheerio.d.ts b/cheerio/cheerio.d.ts index cbf9e12da..8bb7307c0 100644 --- a/cheerio/cheerio.d.ts +++ b/cheerio/cheerio.d.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/borisyankov/DefinitelyTyped -declare interface Cheerio { +interface Cheerio { addClass(classNames: string): Cheerio; hasClass(className: string): bool; @@ -65,13 +65,13 @@ declare interface Cheerio { } -declare interface CheerioOptionsInterface { +interface CheerioOptionsInterface { ignoreWhitespace?: bool; xmlMode?: bool; lowerCaseTags?: bool; } -declare interface CheerioStatic { +interface CheerioStatic { (...selectors: any[]): Cheerio; (): Cheerio; } From dc8c737177467576250e0a0c99a0abab9ad54522 Mon Sep 17 00:00:00 2001 From: Neil Stalker Date: Fri, 21 Jun 2013 17:02:20 +0100 Subject: [PATCH 46/57] fix ace editor definition and tests for 0.9 --- ace/ace.d.ts | 36 ++++---- ace/tests/ace-anchor-tests.ts | 3 +- ace/tests/ace-background_tokenizer-tests.ts | 4 +- ace/tests/ace-default-tests.ts | 1 + ace/tests/ace-document-tests.ts | 3 +- ace/tests/ace-edit_session-tests.ts | 3 +- ace/tests/ace-editor1-tests.ts | 3 +- ...ce-editor_highlight_selected_word-tests.ts | 29 +++--- ace/tests/ace-editor_navigation-tests.ts | 18 ++-- ace/tests/ace-editor_text_edit-tests.ts | 89 ++++++++++--------- ace/tests/ace-multi_select-tests.ts | 13 +-- ace/tests/ace-placeholder-tests.ts | 29 +++--- ace/tests/ace-range-tests.ts | 3 +- ace/tests/ace-range_list-tests.ts | 3 +- ace/tests/ace-search-tests.ts | 3 +- ace/tests/ace-selection-tests.ts | 3 +- ace/tests/ace-token_iterator-tests.ts | 12 +-- ace/tests/ace-virtual_renderer-tests.ts | 3 +- 18 files changed, 143 insertions(+), 115 deletions(-) diff --git a/ace/ace.d.ts b/ace/ace.d.ts index fe31dcc20..6a8e81625 100644 --- a/ace/ace.d.ts +++ b/ace/ace.d.ts @@ -3,7 +3,7 @@ // Definitions by: Diullei Gomes // Definitions: https://github.com/borisyankov/DefinitelyTyped -module AceAjax { +declare module AceAjax { export interface Delta { action: string; @@ -75,7 +75,7 @@ module AceAjax { onTextInput(text); } - declare var KeyBinding: { + var KeyBinding: { new(editor: Editor): KeyBinding; } @@ -184,7 +184,7 @@ module AceAjax { **/ detach(); } - declare var Anchor: { + var Anchor: { /** * Creates a new `Anchor` and associates it with a document. * @param doc The document to associate with the anchor @@ -248,7 +248,7 @@ module AceAjax { **/ getState(row: number): string; } - declare var BackgroundTokenizer: { + var BackgroundTokenizer: { /** * Creates a new `BackgroundTokenizer` object. * @param tokenizer The tokenizer to use @@ -435,7 +435,7 @@ module AceAjax { **/ positionToIndex(pos: Position, startRow: number): number; } - declare var Document: { + var Document: { /** * Creates a new `Document`. If `text` is included, the `Document` contains those strings; otherwise, it's empty. * @param text The starting text @@ -1011,7 +1011,7 @@ module AceAjax { **/ getScreenLength(): number; } - declare var EditSession: { + var EditSession: { /** * Sets up a new `EditSession` and associates it with the given `Document` and `TextMode`. * @param text [If `text` is a `Document`, it associates the `EditSession` with it. Otherwise, a new `Document` is created, with the initial text]{: #textParam} @@ -1702,7 +1702,7 @@ module AceAjax { } - declare var Editor: { + var Editor: { /** * Creates a new `Editor` object. * @param renderer Associated `VirtualRenderer` that draws everything @@ -1761,7 +1761,7 @@ module AceAjax { **/ cancel(); } - declare var PlaceHolder: { + var PlaceHolder: { /** * - @param session (Document): The document to associate with the anchor * - @param length (Number): The starting row position @@ -1995,7 +1995,7 @@ module AceAjax { * @param endRow The ending row * @param endColumn The ending column **/ - declare var Range: { + var Range: { fromPoints(pos1: Position, pos2: Position): Range; new(startRow: number, startColumn: number, endRow: number, endColumn: number): Range; } @@ -2005,7 +2005,7 @@ module AceAjax { //////////////// export interface RenderLoop { } - declare var RenderLoop: { + var RenderLoop: { new(): RenderLoop; } @@ -2047,7 +2047,7 @@ module AceAjax { **/ setScrollTop(scrollTop: number); } - declare var ScrollBar: { + var ScrollBar: { /** * Creates a new `ScrollBar`. `parent` is the owner of the scroll bar. * @param parent A DOM element @@ -2102,7 +2102,7 @@ module AceAjax { **/ replace(input: string, replacement: string): string; } - declare var Search: { + var Search: { /** * Creates a new `Search` object. The following search options are avaliable: * - `needle`: The string or regular expression you're looking for @@ -2371,7 +2371,7 @@ module AceAjax { **/ moveCursorToScreen(row: number, column: number, keepDesiredColumn: boolean); } - declare var Selection: { + var Selection: { /** * Creates a new `Selection` object. * @param session The session to use @@ -2459,7 +2459,7 @@ module AceAjax { **/ resize(); } - declare var Split: { + var Split: { new(): Split; } @@ -2497,7 +2497,7 @@ module AceAjax { **/ getCurrentTokenColumn(): number; } - declare var TokenIterator: { + var TokenIterator: { /** * Creates a new token iterator object. The inital token index is set to the provided row and column coordinates. * @param session The session to associate with @@ -2522,7 +2522,7 @@ module AceAjax { **/ getLineTokens(): any; } - declare var Tokenizer: { + var Tokenizer: { /** * Constructs a new tokenizer based on the given rules and flags. * @param rules The highlighting rules @@ -2576,7 +2576,7 @@ module AceAjax { hasRedo(): boolean; } - declare var UndoManager: { + var UndoManager: { /** * Resets the current undo state and creates a new `UndoManager`. **/ @@ -2924,7 +2924,7 @@ module AceAjax { destroy(); } - declare var VirtualRenderer: { + var VirtualRenderer: { /** * Constructs a new `VirtualRenderer` within the `container` specified, applying the given `theme`. * @param container The root element of the editor diff --git a/ace/tests/ace-anchor-tests.ts b/ace/tests/ace-anchor-tests.ts index 40e81600a..08ca8f43f 100644 --- a/ace/tests/ace-anchor-tests.ts +++ b/ace/tests/ace-anchor-tests.ts @@ -1,6 +1,7 @@ /// -exports = { +var assert: any; +var exports = { "test create anchor" : function() { var doc = new AceAjax.Document("juhu"); diff --git a/ace/tests/ace-background_tokenizer-tests.ts b/ace/tests/ace-background_tokenizer-tests.ts index 8c29358a4..8f54bae51 100644 --- a/ace/tests/ace-background_tokenizer-tests.ts +++ b/ace/tests/ace-background_tokenizer-tests.ts @@ -1,5 +1,7 @@ /// +var assert: any; + function forceTokenize(session) { for (var i = 0, l = session.getLength(); i < l; i++) session.getTokens(i) @@ -11,7 +13,7 @@ function testStates(session, states) { assert.ok(l == states.length) } -exports = { +var exports = { "test background tokenizer update on session change": function() { var doc = new AceAjax.EditSession([ diff --git a/ace/tests/ace-default-tests.ts b/ace/tests/ace-default-tests.ts index dcd1ab103..f8a280c1a 100644 --- a/ace/tests/ace-default-tests.ts +++ b/ace/tests/ace-default-tests.ts @@ -1,5 +1,6 @@ /// +var assert: any; var editor = ace.edit("editor"); editor.setTheme("ace/theme/monokai"); editor.getSession().setMode("ace/mode/javascript"); diff --git a/ace/tests/ace-document-tests.ts b/ace/tests/ace-document-tests.ts index 1f3e0a9a2..7fc342f74 100644 --- a/ace/tests/ace-document-tests.ts +++ b/ace/tests/ace-document-tests.ts @@ -1,6 +1,7 @@ /// -exports = { +var assert: any; +var exports = { "test: insert text in line": function() { var doc = new AceAjax.Document(["12", "34"]); diff --git a/ace/tests/ace-edit_session-tests.ts b/ace/tests/ace-edit_session-tests.ts index 12a3ce5bf..caa2f1729 100644 --- a/ace/tests/ace-edit_session-tests.ts +++ b/ace/tests/ace-edit_session-tests.ts @@ -1,6 +1,7 @@ /// var lang: any; +var assert: any; function createFoldTestSession() { var lines = [ @@ -26,7 +27,7 @@ function assertArray(a, b) { } } -exports = { +var exports = { "test: find matching opening bracket in Text mode": function() { var session = new AceAjax.EditSession(["(()(", "())))"]); diff --git a/ace/tests/ace-editor1-tests.ts b/ace/tests/ace-editor1-tests.ts index ed8b3b3e8..78d3aff04 100644 --- a/ace/tests/ace-editor1-tests.ts +++ b/ace/tests/ace-editor1-tests.ts @@ -1,6 +1,7 @@ /// -exports = { +var assert: any; +var exports = { setUp: function(next) { this.session1 = new AceAjax.EditSession(["abc", "def"]); diff --git a/ace/tests/ace-editor_highlight_selected_word-tests.ts b/ace/tests/ace-editor_highlight_selected_word-tests.ts index 7e06c8c50..e02f32366 100644 --- a/ace/tests/ace-editor_highlight_selected_word-tests.ts +++ b/ace/tests/ace-editor_highlight_selected_word-tests.ts @@ -27,10 +27,13 @@ function callHighlighterUpdate(session: AceAjax.IEditSession, firstRow: number, return rangeCount; } -exports = { +var assert: any; +var renderer: AceAjax.VirtualRenderer; + +var exports = { setUp: function(next) { var session = new AceAjax.EditSession(lipsum); - editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); var selection = session.getSelection(); next(); } , @@ -38,7 +41,7 @@ exports = { "test: highlight selected words by default": function () { var selection = session.getSelection(); var session = new AceAjax.EditSession(lipsum); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); assert.equal(editor.getHighlightSelectedWord(), true); } , @@ -46,7 +49,7 @@ exports = { "test: highlight a word": function () { var selection = session.getSelection(); var session = new AceAjax.EditSession(lipsum); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); editor.moveCursorTo(0, 9); selection.selectWord(); @@ -63,7 +66,7 @@ exports = { "test: highlight a word and clear highlight": function () { var selection = session.getSelection(); var session = new AceAjax.EditSession(lipsum); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); editor.moveCursorTo(0, 8); selection.selectWord(); @@ -79,7 +82,7 @@ exports = { "test: highlight another word": function () { var selection = session.getSelection(); var session = new AceAjax.EditSession(lipsum); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); selection.moveCursorTo(0, 14); selection.selectWord(); @@ -92,7 +95,7 @@ exports = { "test: no selection, no highlight": function () { var selection = session.getSelection(); var session = new AceAjax.EditSession(lipsum); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); selection.clearSelection(); assert.equal(callHighlighterUpdate(session, 0, 0), 0); @@ -101,7 +104,7 @@ exports = { "test: select a word, no highlight": function () { var selection = session.getSelection(); var session = new AceAjax.EditSession(lipsum); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); selection.moveCursorTo(0, 14); selection.selectWord(); @@ -116,7 +119,7 @@ exports = { "test: select a word with no matches": function () { var selection = session.getSelection(); var session = new AceAjax.EditSession(lipsum); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); editor.setHighlightSelectedWord(true); @@ -143,7 +146,7 @@ exports = { "test: partial word selection 1": function () { var selection = session.getSelection(); var session = new AceAjax.EditSession(lipsum); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); selection.moveCursorTo(0, 14); selection.selectWord(); @@ -157,7 +160,7 @@ exports = { "test: partial word selection 2": function () { var selection = session.getSelection(); var session = new AceAjax.EditSession(lipsum); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); selection.moveCursorTo(0, 13); selection.selectWord(); @@ -171,7 +174,7 @@ exports = { "test: partial word selection 3": function () { var selection = session.getSelection(); var session = new AceAjax.EditSession(lipsum); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); selection.moveCursorTo(0, 14); selection.selectWord(); @@ -186,7 +189,7 @@ exports = { "test: select last word": function () { var selection = session.getSelection(); var session = new AceAjax.EditSession(lipsum); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); selection.moveCursorTo(0, 1); diff --git a/ace/tests/ace-editor_navigation-tests.ts b/ace/tests/ace-editor_navigation-tests.ts index c97ee0cd2..b68ae9b9d 100644 --- a/ace/tests/ace-editor_navigation-tests.ts +++ b/ace/tests/ace-editor_navigation-tests.ts @@ -1,6 +1,8 @@ /// -exports = { +var assert: any; +var renderer: AceAjax.VirtualRenderer; +var exports = { createEditSession: function (rows, cols) { var line = new Array(cols + 1).join("a"); var text = new Array(rows).join(line + "\n") + line; @@ -9,7 +11,7 @@ exports = { "test: navigate to end of file should scroll the last line into view": function () { var doc = this.createEditSession(200, 10); - var editor = new AceAjax.Editor(new MockRenderer(), doc); + var editor = new AceAjax.Editor(renderer, doc); editor.navigateFileEnd(); var cursor = editor.getCursorPosition(); @@ -20,7 +22,7 @@ exports = { "test: navigate to start of file should scroll the first row into view": function () { var doc = this.createEditSession(200, 10); - var editor = new AceAjax.Editor(new MockRenderer(), doc); + var editor = new AceAjax.Editor(renderer, doc); editor.moveCursorTo(editor.getLastVisibleRow() + 20); editor.navigateFileStart(); @@ -29,7 +31,7 @@ exports = { }, "test: goto hidden line should scroll the line into the middle of the viewport": function () { - var editor = new AceAjax.Editor(new MockRenderer(), this.createEditSession(200, 5)); + var editor = new AceAjax.Editor(renderer, this.createEditSession(200, 5)); editor.navigateTo(0, 0); editor.gotoLine(101); @@ -63,7 +65,7 @@ exports = { }, "test: goto visible line should only move the cursor and not scroll": function () { - var editor = new AceAjax.Editor(new MockRenderer(), this.createEditSession(200, 5)); + var editor = new AceAjax.Editor(renderer, this.createEditSession(200, 5)); editor.navigateTo(0, 0); editor.gotoLine(12); @@ -77,7 +79,7 @@ exports = { }, "test: navigate from the end of a long line down to a short line and back should maintain the curser column": function () { - var editor = new AceAjax.Editor(new MockRenderer(), new AceAjax.EditSession(["123456", "1"])); + var editor = new AceAjax.Editor(renderer, new AceAjax.EditSession(["123456", "1"])); editor.navigateTo(0, 6); assert.position(editor.getCursorPosition(), 0, 6); @@ -90,7 +92,7 @@ exports = { }, "test: reset desired column on navigate left or right": function () { - var editor = new AceAjax.Editor(new MockRenderer(), new AceAjax.EditSession(["123456", "12"])); + var editor = new AceAjax.Editor(renderer, new AceAjax.EditSession(["123456", "12"])); editor.navigateTo(0, 6); assert.position(editor.getCursorPosition(), 0, 6); @@ -106,7 +108,7 @@ exports = { }, "test: typing text should update the desired column": function () { - var editor = new AceAjax.Editor(new MockRenderer(), new AceAjax.EditSession(["1234", "1234567890"])); + var editor = new AceAjax.Editor(renderer, new AceAjax.EditSession(["1234", "1234567890"])); editor.navigateTo(0, 3); editor.insert("juhu"); diff --git a/ace/tests/ace-editor_text_edit-tests.ts b/ace/tests/ace-editor_text_edit-tests.ts index 9d618acc6..623183016 100644 --- a/ace/tests/ace-editor_text_edit-tests.ts +++ b/ace/tests/ace-editor_text_edit-tests.ts @@ -1,9 +1,12 @@ /// -exports = { +var assert: any; +var renderer: AceAjax.VirtualRenderer; +var mode: any; +var exports = { "test: delete line from the middle": function () { var session = new AceAjax.EditSession(["a", "b", "c", "d"].join("\n")); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); editor.moveCursorTo(1, 1); editor.removeLines(); @@ -29,7 +32,7 @@ exports = { "test: delete multiple selected lines": function () { var session = new AceAjax.EditSession(["a", "b", "c", "d"].join("\n")); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); editor.moveCursorTo(1, 1); editor.getSelection().selectDown(); @@ -41,7 +44,7 @@ exports = { "test: delete first line": function () { var session = new AceAjax.EditSession(["a", "b", "c"].join("\n")); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); editor.removeLines(); @@ -51,7 +54,7 @@ exports = { "test: delete last should also delete the new line of the previous line": function () { var session = new AceAjax.EditSession(["a", "b", "c", ""].join("\n")); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); editor.moveCursorTo(3, 0); @@ -66,7 +69,7 @@ exports = { "test: indent block": function () { var session = new AceAjax.EditSession(["a12345", "b12345", "c12345"].join("\n")); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); editor.moveCursorTo(1, 3); editor.getSelection().selectDown(); @@ -84,7 +87,7 @@ exports = { "test: indent selected lines": function () { var session = new AceAjax.EditSession(["a12345", "b12345", "c12345"].join("\n")); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); editor.moveCursorTo(1, 0); editor.getSelection().selectDown(); @@ -94,8 +97,8 @@ exports = { }, "test: no auto indent if cursor is before the {": function () { - var session = new AceAjax.EditSession("{", new JavaScriptMode()); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var session = new AceAjax.EditSession("{",mode); + var editor = new AceAjax.Editor(renderer, session); editor.moveCursorTo(0, 0); editor.onTextInput("\n"); @@ -104,7 +107,7 @@ exports = { "test: outdent block": function () { var session = new AceAjax.EditSession([" a12345", " b12345", " c12345"].join("\n")); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); editor.moveCursorTo(0, 5); editor.getSelection().selectDown(); @@ -129,7 +132,7 @@ exports = { "test: outent without a selection should update cursor": function () { var session = new AceAjax.EditSession(" 12"); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); editor.moveCursorTo(0, 3); editor.blockOutdent(" "); @@ -139,8 +142,8 @@ exports = { }, "test: comment lines should perserve selection": function () { - var session = new AceAjax.EditSession([" abc", "cde"].join("\n"), new JavaScriptMode()); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var session = new AceAjax.EditSession([" abc", "cde"].join("\n"),mode); + var editor = new AceAjax.Editor(renderer, session); editor.moveCursorTo(0, 2); editor.getSelection().selectDown(); @@ -154,8 +157,8 @@ exports = { }, "test: uncomment lines should perserve selection": function () { - var session = new AceAjax.EditSession(["// abc", "//cde"].join("\n"), new JavaScriptMode()); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var session = new AceAjax.EditSession(["// abc", "//cde"].join("\n"),mode); + var editor = new AceAjax.Editor(renderer, session); editor.moveCursorTo(0, 1); editor.getSelection().selectDown(); @@ -169,8 +172,8 @@ exports = { }, "test: toggle comment lines twice should return the original text": function () { - var session = new AceAjax.EditSession([" abc", "cde", "fg"], new JavaScriptMode()); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var session = new AceAjax.EditSession([" abc", "cde", "fg"], mode); + var editor = new AceAjax.Editor(renderer, session); editor.moveCursorTo(0, 0); editor.getSelection().selectDown(); @@ -185,8 +188,8 @@ exports = { "test: comment lines - if the selection end is at the line start it should stay there": function () { //select down - var session = new AceAjax.EditSession(["abc", "cde"].join("\n"), new JavaScriptMode()); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var session = new AceAjax.EditSession(["abc", "cde"].join("\n"),mode); + var editor = new AceAjax.Editor(renderer, session); editor.moveCursorTo(0, 0); editor.getSelection().selectDown(); @@ -195,8 +198,8 @@ exports = { assert.range(editor.getSelectionRange(), 0, 2, 1, 0); // select up - var session = new AceAjax.EditSession(["abc", "cde"].join("\n"), new JavaScriptMode()); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var session = new AceAjax.EditSession(["abc", "cde"].join("\n"),mode); + var editor = new AceAjax.Editor(renderer, session); editor.moveCursorTo(1, 0); editor.getSelection().selectUp(); @@ -207,7 +210,7 @@ exports = { "test: move lines down should select moved lines": function () { var session = new AceAjax.EditSession(["11", "22", "33", "44"].join("\n")); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); editor.moveCursorTo(0, 1); editor.getSelection().selectDown(); @@ -234,7 +237,7 @@ exports = { "test: move lines up should select moved lines": function () { var session = new AceAjax.EditSession(["11", "22", "33", "44"].join("\n")); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); editor.moveCursorTo(2, 1); editor.getSelection().selectDown(); @@ -254,7 +257,7 @@ exports = { "test: move line without active selection should not move cursor relative to the moved line": function () { var session = new AceAjax.EditSession(["11", "22", "33", "44"].join("\n")); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); editor.moveCursorTo(1, 1); editor.clearSelection(); @@ -272,7 +275,7 @@ exports = { "test: copy lines down should select lines and place cursor at the selection start": function () { var session = new AceAjax.EditSession(["11", "22", "33", "44"].join("\n")); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); editor.moveCursorTo(1, 1); editor.getSelection().selectDown(); @@ -287,7 +290,7 @@ exports = { "test: copy lines up should select lines and place cursor at the selection start": function () { var session = new AceAjax.EditSession(["11", "22", "33", "44"].join("\n")); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); editor.moveCursorTo(1, 1); editor.getSelection().selectDown(); @@ -302,7 +305,7 @@ exports = { "test: input a tab with soft tab should convert it to spaces": function () { var session = new AceAjax.EditSession(""); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); session.setTabSize(2); session.setUseSoftTabs(true); @@ -317,7 +320,7 @@ exports = { "test: input tab without soft tabs should keep the tab character": function () { var session = new AceAjax.EditSession(""); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); session.setUseSoftTabs(false); @@ -331,7 +334,7 @@ exports = { session.setUndoManager(undoManager); var initialText = session.toString(); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); editor.removeLines(); var step1 = session.toString(); @@ -361,7 +364,7 @@ exports = { "test: remove left should remove character left of the cursor": function () { var session = new AceAjax.EditSession(["123", "456"]); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); editor.moveCursorTo(1, 1); editor.remove("left"); assert.equal(session.toString(), "123\n56"); @@ -370,7 +373,7 @@ exports = { "test: remove left should remove line break if cursor is at line start": function () { var session = new AceAjax.EditSession(["123", "456"]); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); editor.moveCursorTo(1, 0); editor.remove("left"); assert.equal(session.toString(), "123456"); @@ -381,7 +384,7 @@ exports = { session.setUseSoftTabs(true); session.setTabSize(4); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); editor.moveCursorTo(1, 8); editor.remove("left"); assert.equal(session.toString(), "123\n 456"); @@ -390,7 +393,7 @@ exports = { "test: transpose at line start should be a noop": function () { var session = new AceAjax.EditSession(["123", "4567", "89"]); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); editor.moveCursorTo(1, 0); editor.transposeLetters(); @@ -400,7 +403,7 @@ exports = { "test: transpose in line should swap the charaters before and after the cursor": function () { var session = new AceAjax.EditSession(["123", "4567", "89"]); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); editor.moveCursorTo(1, 2); editor.transposeLetters(); @@ -410,7 +413,7 @@ exports = { "test: transpose at line end should swap the last two characters": function () { var session = new AceAjax.EditSession(["123", "4567", "89"]); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); editor.moveCursorTo(1, 4); editor.transposeLetters(); @@ -420,7 +423,7 @@ exports = { "test: transpose with non empty selection should be a noop": function () { var session = new AceAjax.EditSession(["123", "4567", "89"]); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); editor.moveCursorTo(1, 1); editor.getSelection().selectRight(); editor.transposeLetters(); @@ -431,7 +434,7 @@ exports = { "test: transpose should move the cursor behind the last swapped character": function () { var session = new AceAjax.EditSession(["123", "4567", "89"]); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); editor.moveCursorTo(1, 2); editor.transposeLetters(); assert.position(editor.getCursorPosition(), 1, 3); @@ -440,7 +443,7 @@ exports = { "test: remove to line end": function () { var session = new AceAjax.EditSession(["123", "4567", "89"]); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); editor.moveCursorTo(1, 2); editor.removeToLineEnd(); assert.equal(session.getValue(), ["123", "45", "89"].join("\n")); @@ -449,7 +452,7 @@ exports = { "test: remove to line end at line end should remove the new line": function () { var session = new AceAjax.EditSession(["123", "4567", "89"]); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); editor.moveCursorTo(1, 4); editor.removeToLineEnd(); assert.position(editor.getCursorPosition(), 1, 4); @@ -459,7 +462,7 @@ exports = { "test: transform selection to uppercase": function () { var session = new AceAjax.EditSession(["ajax", "dot", "org"]); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); editor.moveCursorTo(1, 0); editor.getSelection().selectLineEnd(); editor.toUpperCase() @@ -469,7 +472,7 @@ exports = { "test: transform word to uppercase": function () { var session = new AceAjax.EditSession(["ajax", "dot", "org"]); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); editor.moveCursorTo(1, 0); editor.toUpperCase() assert.equal(session.getValue(), ["ajax", "DOT", "org"].join("\n")); @@ -479,7 +482,7 @@ exports = { "test: transform selection to lowercase": function () { var session = new AceAjax.EditSession(["AJAX", "DOT", "ORG"]); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); editor.moveCursorTo(1, 0); editor.getSelection().selectLineEnd(); editor.toLowerCase() @@ -489,7 +492,7 @@ exports = { "test: transform word to lowercase": function () { var session = new AceAjax.EditSession(["AJAX", "DOT", "ORG"]); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); editor.moveCursorTo(1, 0); editor.toLowerCase() assert.equal(session.getValue(), ["AJAX", "dot", "ORG"].join("\n")); diff --git a/ace/tests/ace-multi_select-tests.ts b/ace/tests/ace-multi_select-tests.ts index ade1493e2..68c7d1af9 100644 --- a/ace/tests/ace-multi_select-tests.ts +++ b/ace/tests/ace-multi_select-tests.ts @@ -1,5 +1,8 @@ /// +var assert: any; +var editor: any; +var renderer: any; var exec = function (name?, times?, args?) { do { editor.commands.exec(name, editor, args); @@ -9,7 +12,7 @@ var testRanges = function (str) { assert.equal(editor.selection.getAllRanges() + "", str + ""); } -exports = { +var exports = { name: "ACE multi_select.js", @@ -19,7 +22,7 @@ exports = { " wtt.w", " wtt.w" ]); - editor = new AceAjax.Editor(new MockRenderer(), doc); + editor = new AceAjax.Editor(renderer, doc); editor.navigateFileEnd(); exec("selectMoreBefore", 3); @@ -45,7 +48,7 @@ exports = { " wtt.w", " wtt.we" ]); - editor = new AceAjax.Editor(new MockRenderer(), doc); + editor = new AceAjax.Editor(renderer, doc); editor.selectMoreLines(1); testRanges("Range: [0/0] -> [0/0],Range: [1/0] -> [1/0]"); @@ -67,7 +70,7 @@ exports = { " wtt.w", " wtt.w" ]); - editor = new AceAjax.Editor(new MockRenderer(), doc); + editor = new AceAjax.Editor(renderer, doc); editor.selectMoreLines(1) testRanges("Range: [0/0] -> [0/0],Range: [1/0] -> [1/0]"); @@ -87,7 +90,7 @@ exports = { " wtt.w", " wtt.w" ]); - editor = new AceAjax.Editor(new MockRenderer(), doc); + editor = new AceAjax.Editor(renderer, doc); var selection = editor.selection; diff --git a/ace/tests/ace-placeholder-tests.ts b/ace/tests/ace-placeholder-tests.ts index 124554cf7..b9693da37 100644 --- a/ace/tests/ace-placeholder-tests.ts +++ b/ace/tests/ace-placeholder-tests.ts @@ -1,10 +1,13 @@ /// -exports = { +var assert: any; +var renderer: AceAjax.VirtualRenderer; +var mode: any; +var exports = { "test: simple at the end appending of text": function () { - var session = new AceAjax.EditSession("var a = 10;\nconsole.log(a, a);", new JavaScriptMode()); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var session = new AceAjax.EditSession("var a = 10;\nconsole.log(a, a);", mode); + var editor = new AceAjax.Editor(renderer, session); new AceAjax.PlaceHolder(session, 1, { row: 0, column: 4 }, [{ row: 1, column: 12 }, { row: 1, column: 15 }]); @@ -20,8 +23,8 @@ exports = { }, "test: inserting text outside placeholder": function () { - var session = new AceAjax.EditSession("var a = 10;\nconsole.log(a, a);\n", new JavaScriptMode()); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var session = new AceAjax.EditSession("var a = 10;\nconsole.log(a, a);\n", mode); + var editor = new AceAjax.Editor(renderer, session); new AceAjax.PlaceHolder(session, 1, { row: 0, column: 4 }, [{ row: 1, column: 12 }, { row: 1, column: 15 }]); @@ -31,8 +34,8 @@ exports = { }, "test: insertion at the beginning": function (next) { - var session = new AceAjax.EditSession("var a = 10;\nconsole.log(a, a);", new JavaScriptMode()); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var session = new AceAjax.EditSession("var a = 10;\nconsole.log(a, a);", mode); + var editor = new AceAjax.Editor(renderer, session); var p = new AceAjax.PlaceHolder(session, 1, { row: 0, column: 4 }, [{ row: 1, column: 12 }, { row: 1, column: 15 }]); @@ -49,8 +52,8 @@ exports = { }, "test: detaching placeholder": function () { - var session = new AceAjax.EditSession("var a = 10;\nconsole.log(a, a);", new JavaScriptMode()); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var session = new AceAjax.EditSession("var a = 10;\nconsole.log(a, a);", mode); + var editor = new AceAjax.Editor(renderer, session); var p = new AceAjax.PlaceHolder(session, 1, { row: 0, column: 4 }, [{ row: 1, column: 12 }, { row: 1, column: 15 }]); @@ -63,8 +66,8 @@ exports = { }, "test: events": function () { - var session = new AceAjax.EditSession("var a = 10;\nconsole.log(a, a);", new JavaScriptMode()); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var session = new AceAjax.EditSession("var a = 10;\nconsole.log(a, a);", mode); + var editor = new AceAjax.Editor(renderer, session); var p = new AceAjax.PlaceHolder(session, 1, { row: 0, column: 4 }, [{ row: 1, column: 12 }, { row: 1, column: 15 }]); var entered = false; @@ -86,9 +89,9 @@ exports = { }, "test: cancel": function (next) { - var session = new AceAjax.EditSession("var a = 10;\nconsole.log(a, a);", new JavaScriptMode()); + var session = new AceAjax.EditSession("var a = 10;\nconsole.log(a, a);", mode); session.setUndoManager(new AceAjax.UndoManager()); - var editor = new AceAjax.Editor(new MockRenderer(), session); + var editor = new AceAjax.Editor(renderer, session); var p = new AceAjax.PlaceHolder(session, 1, { row: 0, column: 4 }, [{ row: 1, column: 12 }, { row: 1, column: 15 }]); editor.moveCursorTo(0, 5); diff --git a/ace/tests/ace-range-tests.ts b/ace/tests/ace-range-tests.ts index 8a1b1ccc6..8e560e8d2 100644 --- a/ace/tests/ace-range-tests.ts +++ b/ace/tests/ace-range-tests.ts @@ -1,6 +1,7 @@ /// -exports = { +var assert: any; +var exports = { name: "ACE range.js", diff --git a/ace/tests/ace-range_list-tests.ts b/ace/tests/ace-range_list-tests.ts index 83f3c8a91..3a531579e 100644 --- a/ace/tests/ace-range_list-tests.ts +++ b/ace/tests/ace-range_list-tests.ts @@ -1,5 +1,6 @@ /// +var assert: any; function flatten(rangeList) { var points = []; rangeList.ranges.forEach(function (r) { @@ -11,7 +12,7 @@ function testRangeList(rangeList, points) { assert.equal("" + flatten(rangeList), "" + points); } -exports = { +var exports = { name: "ACE range_list.js", diff --git a/ace/tests/ace-search-tests.ts b/ace/tests/ace-search-tests.ts index c30139d65..14b53397b 100644 --- a/ace/tests/ace-search-tests.ts +++ b/ace/tests/ace-search-tests.ts @@ -1,6 +1,7 @@ /// -exports = { +var assert: any; +var exports = { "test: configure the search object": function () { var search = new AceAjax.Search(); search.set({ diff --git a/ace/tests/ace-selection-tests.ts b/ace/tests/ace-selection-tests.ts index 030cdff66..884631085 100644 --- a/ace/tests/ace-selection-tests.ts +++ b/ace/tests/ace-selection-tests.ts @@ -1,6 +1,7 @@ /// -exports = { +var assert: any; +var exports = { createSession: function (rows, cols) { var line = new Array(cols + 1).join("a"); var text = new Array(rows).join(line + "\n") + line; diff --git a/ace/tests/ace-token_iterator-tests.ts b/ace/tests/ace-token_iterator-tests.ts index 75260e95a..892d781b9 100644 --- a/ace/tests/ace-token_iterator-tests.ts +++ b/ace/tests/ace-token_iterator-tests.ts @@ -1,6 +1,8 @@ /// -exports = { +var assert: any; +var mode: any; +var exports = { "test: token iterator initialization in JavaScript document": function () { var lines = [ "function foo(items) {", @@ -9,7 +11,7 @@ exports = { " } // Real Tab.", "}" ]; - var session = new AceAjax.EditSession(lines.join("\n"), new JavaScriptMode()); + var session = new AceAjax.EditSession(lines.join("\n"),mode); var iterator = new AceAjax.TokenIterator(session, 0, 0); assert.equal(iterator.getCurrentToken().value, "function"); @@ -96,7 +98,7 @@ exports = { " } // Real Tab.", "}" ]; - var session = new AceAjax.EditSession(lines.join("\n"), new JavaScriptMode()); + var session = new AceAjax.EditSession(lines.join("\n"),mode); var tokens = []; var len = session.getLength(); @@ -118,7 +120,7 @@ exports = { " } // Real Tab.", "}" ]; - var session = new AceAjax.EditSession(lines.join("\n"), new JavaScriptMode()); + var session = new AceAjax.EditSession(lines.join("\n"),mode); var tokens = []; var len = session.getLength(); @@ -140,7 +142,7 @@ exports = { " } // Real Tab.", "}" ]; - var session = new AceAjax.EditSession(lines.join("\n"), new JavaScriptMode()); + var session = new AceAjax.EditSession(lines.join("\n"),mode); var iterator = new AceAjax.TokenIterator(session, 0, 0); diff --git a/ace/tests/ace-virtual_renderer-tests.ts b/ace/tests/ace-virtual_renderer-tests.ts index 83372ad34..51f349dad 100644 --- a/ace/tests/ace-virtual_renderer-tests.ts +++ b/ace/tests/ace-virtual_renderer-tests.ts @@ -1,6 +1,7 @@ /// -exports = { +var assert: any; +var exports = { "test: screen2text the column should be rounded to the next character edge": function () { var el = document.createElement("div"); From 3501604cb112c8586bd86605d48bd7f65fee57f0 Mon Sep 17 00:00:00 2001 From: Judah Gabriel Himango Date: Fri, 21 Jun 2013 12:15:28 -0500 Subject: [PATCH 47/57] knockout.postbox now using generic Knockout --- knockout.postbox/knockout-postbox.d.ts | 53 ++++++-------------------- 1 file changed, 11 insertions(+), 42 deletions(-) diff --git a/knockout.postbox/knockout-postbox.d.ts b/knockout.postbox/knockout-postbox.d.ts index 0910ab5f5..3e6698851 100644 --- a/knockout.postbox/knockout-postbox.d.ts +++ b/knockout.postbox/knockout-postbox.d.ts @@ -1,53 +1,22 @@ // Type definitions for knockout-postbox // Project: https://github.com/rniemeyer/knockout-postbox -// Definitions by: Judah Gabriel +// Definitions by: Judah Gabriel Himango // Definitions: https://github.com/borisyankov/DefinitelyTyped +/// interface KnockoutPostBox { - subscribe: (topic: string, handler: (value) => void, target?: any) => KnockoutObservableAny; - publish: (topic: string, value?: any) => KnockoutObservableAny; - defaultComparer: (newValue: any, oldValue: any) => bool; + subscribe(topic: string, handler: (value: T) => void , target?: any): KnockoutSubscription; + publish(topic: string, value?: T): void; + defaultComparer(newValue: T, oldValue: T): boolean; } -interface KnockoutObservableString { - subscribeTo: (topic: string, useLastPublishedValueToInitialize?: bool, transform?: (val: any) => string) => KnockoutObservableString; - unsubscribeFrom: (topic: string) => KnockoutObservableString; - publishOn: (topic: string, skipInitialPublish?: bool, equalityComparer?: (newValue: string, oldValue: string) => bool) => KnockoutObservableString; - stopPublishingOn: (topic: string) => KnockoutObservableString; - syncWith: (topic: string, initializeWithLatestValue?: bool, skipInitialPublish?: bool, equalityComparer?: (newValue: string, oldValue: string) => bool) => KnockoutObservableString; -} - -interface KnockoutObservableDate { - subscribeTo: (topic: string, useLastPublishedValueToInitialize?: bool, transform?: (val: any) => Date) => KnockoutObservableDate; - unsubscribeFrom: (topic: string) => KnockoutObservableDate; - publishOn: (topic: string, skipInitialPublish?: bool, equalityComparer?: (newValue: Date, oldValue: Date) => bool) => KnockoutObservableDate; - stopPublishingOn: (topic: string) => KnockoutObservableDate; - syncWith: (topic: string, initializeWithLatestValue?: bool, skipInitialPublish?: bool, equalityComparer?: (newValue: Date, oldValue: Date) => bool) => KnockoutObservableDate; -} - -interface KnockoutObservableNumber { - subscribeTo: (topic: string, useLastPublishedValueToInitialize?: bool, transform?: (val: any) => number) => KnockoutObservableNumber; - unsubscribeFrom: (topic: string) => KnockoutObservableNumber; - publishOn: (topic: string, skipInitialPublish?: bool, equalityComparer?: (newValue: Number, oldValue: Number) => bool) => KnockoutObservableNumber; - stopPublishingOn: (topic: string) => KnockoutObservableNumber; - syncWith: (topic: string, initializeWithLatestValue?: bool, skipInitialPublish?: bool, equalityComparer?: (newValue: Number, oldValue: Number) => bool) => KnockoutObservableNumber; -} - -interface KnockoutObservableBool { - subscribeTo: (topic: string, useLastPublishedValueToInitialize?: bool, transform?: (val: any) => bool) => KnockoutObservableBool; - unsubscribeFrom: (topic: string) => KnockoutObservableBool; - publishOn: (topic: string, skipInitialPublish?: bool, equalityComparer?: (newValue: bool, oldValue: bool) => bool) => KnockoutObservableBool; - stopPublishingOn: (topic: string) => KnockoutObservableBool; - syncWith: (topic: string, initializeWithLatestValue?: bool, skipInitialPublish?: bool, equalityComparer?: (newValue: bool, oldValue: bool) => bool) => KnockoutObservableBool; -} - -interface KnockoutObservableAny { - subscribeTo: (topic: string, useLastPublishedValueToInitialize?: bool, transform?: (val: any) => any) => KnockoutObservableAny; - unsubscribeFrom: (topic: string) => KnockoutObservableAny; - publishOn: (topic: string, skipInitialPublish?: bool, equalityComparer?: (newValue: any, oldValue: any) => bool) => KnockoutObservableAny; - stopPublishingOn: (topic: string) => KnockoutObservableAny; - syncWith: (topic: string, initializeWithLatestValue?: bool, skipInitialPublish?: bool, equalityComparer?: (newValue: any, oldValue: any) => bool) => KnockoutObservableAny; +interface KnockoutObservable { + subscribeTo(topic: string, useLastPublishedValueToInitialize?: boolean, transform?: (val: any) => T): KnockoutObservable; + unsubscribeFrom(topic: string): KnockoutObservable; + publishOn(topic: string, skipInitialPublish?: boolean, equalityComparer?: (newValue: T, oldValue: T) => boolean): KnockoutObservable; + stopPublishingOn(topic: string): KnockoutObservable; + syncWith(topic: string, initializeWithLatestValue?: boolean, skipInitialPublish?: boolean, equalityComparer?: (newValue: T, oldValue: T) => boolean): KnockoutObservable; } interface KnockoutStatic { From d3ed16fbabec15296883eb9e74d8b93dddbf1cdf Mon Sep 17 00:00:00 2001 From: Diullei Gomes Date: Fri, 21 Jun 2013 15:03:23 -0300 Subject: [PATCH 48/57] #670 jquery.d.ts a parameter needs to be optional on JQueryPromise.then --- jquery/jquery.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index 1513959a8..c175d25f5 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -86,7 +86,7 @@ interface JQueryPromise { done(...doneCallbacks: any[]): JQueryDeferred; fail(...failCallbacks: any[]): JQueryDeferred; pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise; - then(doneCallbacks: any, failCallbacks: any, progressCallbacks?: any): JQueryDeferred; + then(doneCallbacks: any, failCallbacks?: any, progressCallbacks?: any): JQueryDeferred; } /* From 941dfaaf58c2ca9b94c83ae1f61d2150e70b2c43 Mon Sep 17 00:00:00 2001 From: Diullei Gomes Date: Fri, 21 Jun 2013 19:47:20 -0300 Subject: [PATCH 49/57] bug fixed - jquery.bbq --- jquery.bbq/jquery.bbq-tests.ts | 2 +- jquery.bbq/jquery.bbq.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jquery.bbq/jquery.bbq-tests.ts b/jquery.bbq/jquery.bbq-tests.ts index 1543ae63c..c9a337d71 100644 --- a/jquery.bbq/jquery.bbq-tests.ts +++ b/jquery.bbq/jquery.bbq-tests.ts @@ -149,7 +149,7 @@ test( 'jQuery.param.sorted', function() { expect( tests.length * 2 + 6 ); - $.each( tests, function(i,test){ + $.each( tests, function(i,test: any){ var unsorted = $.param( test.obj, test.traditional ), sorted = $.param.sorted( test.obj, test.traditional ); diff --git a/jquery.bbq/jquery.bbq.d.ts b/jquery.bbq/jquery.bbq.d.ts index 5e94efea9..488b1b6c7 100644 --- a/jquery.bbq/jquery.bbq.d.ts +++ b/jquery.bbq/jquery.bbq.d.ts @@ -5,7 +5,7 @@ /// -module JQueryBbq { +declare module JQueryBbq { interface JQuery { /** From 41aee7c70a8fb35e18d5930d6508f7a945f6d758 Mon Sep 17 00:00:00 2001 From: Diullei Gomes Date: Fri, 21 Jun 2013 20:25:26 -0300 Subject: [PATCH 50/57] bug fix - easeljs and tweenjs --- easeljs/easeljs.d.ts | 2 +- tweenjs/tweenjs.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/easeljs/easeljs.d.ts b/easeljs/easeljs.d.ts index e643382c3..a8f49f83c 100644 --- a/easeljs/easeljs.d.ts +++ b/easeljs/easeljs.d.ts @@ -11,7 +11,7 @@ */ -/// +/// // rename the native MouseEvent, to avoid conflit with createjs's MouseEvent interface NativeMouseEvent extends MouseEvent { diff --git a/tweenjs/tweenjs.d.ts b/tweenjs/tweenjs.d.ts index 7ab5cf350..256098254 100644 --- a/tweenjs/tweenjs.d.ts +++ b/tweenjs/tweenjs.d.ts @@ -10,7 +10,7 @@ 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 { +declare module createjs { export class TweenJS { // properties From 50f6e3ccfc64885e632be5b70148cfdfab12a8a1 Mon Sep 17 00:00:00 2001 From: Danil Flores Date: Fri, 21 Jun 2013 22:48:49 -0400 Subject: [PATCH 51/57] Added jStorage plugin --- README.md | 1 + jstorage/jstorage-tests.ts | 74 +++++++++++++++++ jstorage/jstorage.d.ts | 159 +++++++++++++++++++++++++++++++++++++ 3 files changed, 234 insertions(+) create mode 100644 jstorage/jstorage-tests.ts create mode 100644 jstorage/jstorage.d.ts diff --git a/README.md b/README.md index e220f7bef..3cfeba4d1 100755 --- a/README.md +++ b/README.md @@ -113,6 +113,7 @@ List of Definitions * [jScrollPane](http://jscrollpane.kelvinluck.com) (by [Dániel Tar](https://github.com/qcz)) * [JSDeferred](http://cho45.stfuawsc.com/jsdeferred/) (by [Daisuke Mino](https://github.com/minodisk)) * [JSONEditorOnline](https://github.com/josdejong/jsoneditoronline) (by [Vincent Bortone](https://github.com/vbortone/)) +* [jStorage](http://www.jstorage.info/) (by [Danil Flores](https://github.com/dflor003/)) * [JWPlayer](http://developer.longtailvideo.com/trac/) (by [Martin Duparc](https://github.com/martinduparc/)) * [KeyboardJS](https://github.com/RobertWHurst/KeyboardJS) (by [Vincent Bortone](https://github.com/vbortone/)) * [Knockback](http://kmalakoff.github.com/knockback/) (by [Marcel Binot](https://github.com/docgit)) diff --git a/jstorage/jstorage-tests.ts b/jstorage/jstorage-tests.ts new file mode 100644 index 000000000..a8bd01af4 --- /dev/null +++ b/jstorage/jstorage-tests.ts @@ -0,0 +1,74 @@ +/// + +// Test set first overload +var storedValue = $.jStorage.set("testObj", { foo: 'bar' }); +console.assert(storedValue.foo === "bar"); + +// Test set second overload +$.jStorage.set("testNum", 42, { TTL: 65535 }); +var readValue = $.jStorage.get("testNum"); +console.assert(readValue + 5 === 47); + +// Test deleteKey +if ($.jStorage.deleteKey("testObj") === true) { + console.log('deleted'); +} + +// Test setTTL/getTTL +$.jStorage.setTTL("testNum", 100); +console.assert($.jStorage.getTTL("testNum") === 100); + +// Test flush +console.assert($.jStorage.flush() === true); + +// Test storageObj +var storeObj = $.jStorage.storageObj(); +console.assert(storeObj["testNum"] !== null); + +// Test index +var keys = $.jStorage.index(); +console.assert(keys.length > 0); + +// Test storageSize +var size = $.jStorage.storageSize(); +console.assert(size > 0); + +// Test currentBackend +var currentBackend = $.jStorage.currentBackend(); +console.assert(currentBackend != null && typeof currentBackend.getItem !== "undefined"); + +// Test storageAvailable +var isStorageAvailable = $.jStorage.storageAvailable(); +console.assert(isStorageAvailable === true); + +// Test listenKeyChange +$.jStorage.listenKeyChange("testNum", (key, value) => { + console.assert(key.length > 0); + console.assert(value != null); +} ); + +$.jStorage.listenKeyChange("testNum", (key, value) => { + console.assert(key === "testNum"); + console.assert(value + 10 > 0); +} ); + +// Test stopListening +$.jStorage.stopListening("testNum"); +$.jStorage.stopListening("testNum", () => { console.assert(); } ); + +// Test subscribe +$.jStorage.subscribe("ESPN", (channel, value) => { + console.assert(channel !== "ABC"); + console.assert(value !== null); +} ); + +$.jStorage.subscribe("ESPN", (channel, value) => { + console.assert(channel === "ESPN"); + console.assert(value.getDate() > Date.now()); +} ); + +// Test publish +$.jStorage.publish("ESPN", { date: new Date(2013, 4, 26, 7), game: "Miami Heat" }); + +// Test reinit +$.jStorage.reInit(); \ No newline at end of file diff --git a/jstorage/jstorage.d.ts b/jstorage/jstorage.d.ts new file mode 100644 index 000000000..0acc93fbd --- /dev/null +++ b/jstorage/jstorage.d.ts @@ -0,0 +1,159 @@ +// Type definitions for jStorage 0.3.0 +// Project: http://www.jstorage.info/ +// Definitions by: Danil Flores +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module $.jStorage { + + class IStorageOptions { + TTL: number; + } + + interface IJStorage { + [key: string]: any; + } + + /** + * Sets a key's value. + * + * @param key Key to set. If this value is not set or not + * a string an exception is raised. + * @param value Value to set. This can be any value that is JSON + * compatible (Numbers, Strings, Objects etc.). + * @param [options] - possible options to use + * @param [options.TTL] - optional TTL value + * @return the used value + */ + function set (key: string, value: TValue, options?: IStorageOptions): TValue; + + /** + * Looks up a key in cache + * + * @param key - Key to look up. + * @param defaultIfNotFound - Default value to return, if key didn't exist. + * @return the key value, default value or null + */ + function get (key: string, defaultIfNotFound?: TValue): TValue; + + /** + * Deletes a key from cache. + * + * @param key - Key to delete. + * @return true if key existed or false if it didn't + */ + function deleteKey(key: string): boolean; + + /** + * Sets a TTL for a key, or remove it if ttl value is 0 or below + * + * @param key - key to set the TTL for + * @param ttl - TTL timeout in milliseconds + * @return true if key existed or false if it didn't + */ + function setTTL(key: string, ttl: number): boolean; + + /** + * Gets remaining TTL (in milliseconds) for a key or 0 when no TTL has been set + * + * @param key Key to check + * @return Remaining TTL in milliseconds + */ + function getTTL(key: string): number; + + /** + * Deletes everything in cache. + * + * @return Always true + */ + function flush(): boolean; + + /** + * Returns a read-only copy of _storage + * + * @return Read-only copy of _storage + */ + function storageObj(): IJStorage + + /** + * Returns an index of all used keys as an array + * ['key1', 'key2',..'keyN'] + * + * @return Used keys + */ + function index(): string[]; + + /** + * How much space in bytes does the storage take? + * + * @return Storage size in chars (not the same as in bytes, + * since some chars may take several bytes) + */ + function storageSize(): number; + + /** + * Which backend is currently in use? + * + * @return Backend name + */ + function currentBackend(): Storage; + + /** + * Test if storage is available + * + * @return True if storage can be used + */ + function storageAvailable(): boolean; + + /** + * Register change listeners + * + * @param key Key name + * @param callback Function to run when the key changes + */ + function listenKeyChange(key: string, callback: (key: string, value: any) => void ): void; + + /** + * Register change listeners + * + * @param key Key name + * @param callback Function to run when the key changes + */ + function listenKeyChange(key: string, callback: (key: string, value: TValue) => void ): void; + + /** + * Remove change listeners + * + * @param key Key name to unregister listeners against + * @param [callback] If set, unregister the callback, if not - unregister all + */ + function stopListening(key: string, callback?: Function): void; + + /** + * Subscribe to a Publish/Subscribe event stream + * + * @param channel Channel name + * @param callback Function to run when the something is published to the channel + */ + function subscribe(channel: string, callback: (channel: string, value: any) => void ): void; + + /** + * Subscribe to a Publish/Subscribe event stream + * + * @param channel Channel name + * @param callback Function to run when the something is published to the channel + */ + function subscribe(channel: string, callback: (channel: string, value: TValue) => void ): void; + + /** + * Publish data to an event stream + * + * @param channel Channel name + * @param payload Payload to deliver + */ + function publish(channel: string, payload: any): void; + + /** + * Reloads the data from browser storage + */ + function reInit(): void; +} \ No newline at end of file From 0ac130b9b46e0b667c29cc0a4d6d75479f6b7478 Mon Sep 17 00:00:00 2001 From: Diullei Gomes Date: Fri, 21 Jun 2013 23:53:09 -0300 Subject: [PATCH 52/57] bug fix - jquery.flot --- flot/jquery.flot.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flot/jquery.flot.d.ts b/flot/jquery.flot.d.ts index 3041966cd..a9d2171b9 100644 --- a/flot/jquery.flot.d.ts +++ b/flot/jquery.flot.d.ts @@ -6,7 +6,7 @@ /// -module jquery.flot { +declare module jquery.flot { interface plotOptions { colors?: any[]; series?: seriesOptions; From bca57e2d23064239445e1cabea6fe62a4c72461d Mon Sep 17 00:00:00 2001 From: Danil Flores Date: Fri, 21 Jun 2013 23:09:43 -0400 Subject: [PATCH 53/57] Added ladda library --- README.md | 3 ++- ladda/ladda-tests.ts | 20 ++++++++++++++++++++ ladda/ladda.d.ts | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 ladda/ladda-tests.ts create mode 100644 ladda/ladda.d.ts diff --git a/README.md b/README.md index 3cfeba4d1..2943452fd 100755 --- a/README.md +++ b/README.md @@ -126,8 +126,9 @@ List of Definitions * [KoLite](https://github.com/CodeSeven/kolite) (by [Boris Yankov](https://github.com/borisyankov)) * [Leaflet](https://github.com/Leaflet/Leaflet) (by [Vladimir](https://github.com/rgripper)) * [Libxmljs](https://github.com/polotek/libxmljs) (by [François de Campredon](https://github.com/fdecampredon)) +* [ladda](https://github.com/hakimel/Ladda) (by [Danil Flores](https://github.com/dflor003)) * [linq.js](http://linqjs.codeplex.com/) (by [Marcin Najder](https://github.com/marcinnajder)) -* [Livestamp.js](https://github.com/mattbradley/livestampjs) (by [Vincent Bortone] (https://github.com/vbortone)) +* [Livestamp.js](https://github.com/mattbradley/livestampjs) (by [Vincent Bortone](https://github.com/vbortone)) * [Marked](https://github.com/chjj/marked) (by [William Orr](https://github.com/worr)) * [Modernizr](http://modernizr.com/) (by [Boris Yankov](https://github.com/borisyankov) and [Theodore Brown](https://github.com/theodorejb/)) * [Moment.js](https://github.com/timrwood/moment) (by [Michael Lakerveld](https://github.com/Lakerfield)) diff --git a/ladda/ladda-tests.ts b/ladda/ladda-tests.ts new file mode 100644 index 000000000..9707534cc --- /dev/null +++ b/ladda/ladda-tests.ts @@ -0,0 +1,20 @@ +/// + +// Test bind +Ladda.bind('button.ladda-button', { timeout: 42, callback: btn => alert('Clicked!!!') }); +Ladda.bind('button.ladda-button'); +Ladda.bind(document.createElement('button'), {}); +Ladda.bind(document.createElement('button')); + +// Test stop all +Ladda.stopAll(); + +// Test create +var btnElement = document.createElement('button'); +var laddaBtn = Ladda.create(btnElement); + +// Test operations via chaining +laddaBtn.start().stop().toggle().setProgress(42).enable().disable().start(); + +// Test isLoading +console.assert(laddaBtn.isLoading() === true); \ No newline at end of file diff --git a/ladda/ladda.d.ts b/ladda/ladda.d.ts new file mode 100644 index 000000000..278f00379 --- /dev/null +++ b/ladda/ladda.d.ts @@ -0,0 +1,35 @@ +// Type definitions for jStorage 0.4.0 +// Project: https://github.com/hakimel/Ladda +// Definitions by: Danil Flores +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module Ladda { + + interface ILaddaButton { + start(): ILaddaButton; + + stop(): ILaddaButton; + + toggle(): ILaddaButton; + + setProgress(progress: number): ILaddaButton; + + enable(): ILaddaButton; + + disable(): ILaddaButton; + + isLoading(): boolean; + } + + interface ILaddaOptions { + timeout?: number; + callback?: (instance: ILaddaButton) => void; + } + + function bind(target: HTMLElement, options?: ILaddaOptions): void; + function bind(cssSelector: string, options?: ILaddaOptions): void; + + function create(button: HTMLElement): ILaddaButton; + + function stopAll(): void; +} \ No newline at end of file From 6024a59857917fcd1c8e26a8f6ae7e6090435e1b Mon Sep 17 00:00:00 2001 From: ZOS Date: Sat, 22 Jun 2013 11:53:14 +0400 Subject: [PATCH 54/57] Support new Knockout definition (generics) and replace bool to boolean --- durandal/durandal.d.ts | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/durandal/durandal.d.ts b/durandal/durandal.d.ts index 6f3a72a3e..98cdcd536 100644 --- a/durandal/durandal.d.ts +++ b/durandal/durandal.d.ts @@ -18,11 +18,11 @@ declare module "durandal/system" { /** * Call this function to enable or disable Durandal's debug mode. Calling it with no parameters will return true if the framework is currently in debug mode, false otherwise. */ - export var debug: (debug?: bool) => bool; + export var debug: (debug?: boolean) => boolean; /** * Checks if the obj is an array */ - export var isArray: (obj: any) => bool; + export var isArray: (obj: any) => boolean; /** * Logs data to the console. Pass any number of parameters to be logged. Log output is not processed if the framework is not running in debug mode. */ @@ -91,7 +91,7 @@ declare module "durandal/composition" { /** * sets activate: true on every compose binding */ - export var activateDuringComposition: bool; + export var activateDuringComposition: boolean; /** * changes the convention for finding where transitions are located */ @@ -161,7 +161,7 @@ declare module "durandal/modalDialog" { /** * This is a helper function which will tell you if any modals are currently open. */ - export var isModalOpen: () => bool; + export var isModalOpen: () => boolean; /** * You may wish to customize modal displays or add additional contexts in order to display modals in different ways. To alter the default context, you would acquire it by calling getContext() and then alter it's pipeline. If you don't provide a value for name it returns the default context. */ @@ -192,7 +192,7 @@ declare module "durandal/viewEngine" { /** * Returns true if the potential string is a url for a view, according to the view engine. */ - export var isViewUrl: (url: string) => bool; + export var isViewUrl: (url: string) => boolean; /** * Converts a view url into a view id. */ @@ -267,15 +267,15 @@ interface IViewModelDefaults { /** * When the activator attempts to activate an item as described below, it will only activate the new item, by default, if it is a different instance than the current. Overwrite this function to change that behavior. */ - areSameItem(currentItem, newItem, activationData): bool; + areSameItem(currentItem, newItem, activationData): boolean; /** * default is true */ - closeOnDeactivate: bool; + closeOnDeactivate: boolean; /** * Interprets values returned from guard methods like canActivate and canDeactivate by transforming them into bools. The default implementation translates string values "Yes" and "Ok" as true...and all other string values as false. Non string values evaluate according to the truthy/falsey values of JavaScript. Replace this function with your own to expand or set up different values. This transformation is used by the activator internally and allows it to work smoothly in the common scenario where a deactivated item needs to show a message box to prompt the user before closing. Since the message box returns a promise that resolves to the button option the user selected, it can be automatically processed as part of the activator's guard check. */ - interpretResponse(value: any): bool; + interpretResponse(value: any): boolean; /** * called before activating a module */ @@ -298,7 +298,7 @@ interface IDurandalViewModelActiveItem { /** * This observable is set internally by the activator during the activation process. It can be used to determine if an activation is currently happening. */ - isActivating(val?: bool): bool; + isActivating(val?: boolean): boolean; /** * Pass a specific item as well as an indication of whether it should be closed, and this function will tell you the answer. */ @@ -360,11 +360,11 @@ declare module "durandal/plugins/router" { /** used to set the document title */ caption: string; /** determines whether or not to include it in the router's visibleRoutes array for easy navigation UI binding */ - visible: bool; + visible: boolean; settings: Object; hash: string; /** only present on visible routes to track if they are active in the nav */ - isActive?: KnockoutComputed; + isActive?: KnockoutComputed; } /** * Parameters to the map function. e only required parameter is url the rest can be derived. The derivation @@ -383,25 +383,25 @@ declare module "durandal/plugins/router" { /** used to set the document title */ caption?: string; /** determines whether or not to include it in the router's visibleRoutes array for easy navigation UI binding */ - visible?: bool; + visible?: boolean; settings?: Object; } /** * observable that is called when the router is ready */ - export var ready: KnockoutObservableBool; + export var ready: KnockoutObservable; /** * An observable array containing all route info objects. */ - export var allRoutes: KnockoutObservableArray; + export var allRoutes: KnockoutObservableArray; /** * An observable array containing route info objects configured with visible:true (or by calling the mapNav function). */ - export var visibleRoutes: KnockoutObservableArray; + export var visibleRoutes: KnockoutObservableArray; /** * An observable boolean which is true while navigation is in process; false otherwise. */ - export var isNavigating: KnockoutObservableBool; + export var isNavigating: KnockoutObservable; /** * An observable whose value is the currently active item/module/page. */ @@ -409,7 +409,7 @@ declare module "durandal/plugins/router" { /** * An observable whose value is the currently active route. */ - export var activeRoute: KnockoutObservableAny; + export var activeRoute: KnockoutObservable; /** * called after an a new module is composed */ @@ -467,7 +467,7 @@ declare module "durandal/plugins/router" { */ export var mapRoute: { (route: IRouteInfoParameters): IRouteInfo; - (url: string, moduleId?: string, name?: string, visible?: bool): IRouteInfo; + (url: string, moduleId?: string, name?: string, visible?: boolean): IRouteInfo; } /** * This function takes an array of routeInfo objects or a single routeInfo object and uses it to configure the router. The finalized routeInfo (or array of infos) is returned. From 8c3bfa5ee549c629562cd5bd8b76446a30a6dd4f Mon Sep 17 00:00:00 2001 From: Natan Vivo Date: Sat, 22 Jun 2013 09:34:20 -0300 Subject: [PATCH 55/57] Backbone.js -> Fix compilation errors for 0.9. --- backbone/backbone.d.ts | 113 ++++++++++++++++++++++------------------- 1 file changed, 60 insertions(+), 53 deletions(-) diff --git a/backbone/backbone.d.ts b/backbone/backbone.d.ts index 92ff102dc..2a4a60819 100644 --- a/backbone/backbone.d.ts +++ b/backbone/backbone.d.ts @@ -1,6 +1,7 @@ -// Type definitions for Backbone 0.9.10 +// Type definitions for Backbone 1.0.0 // Project: http://backbonejs.org/ // Definitions by: Boris Yankov +// Definitions by: Natan Vivo // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -8,61 +9,61 @@ declare module Backbone { - export interface AddOptions extends Silenceable { + interface AddOptions extends Silenceable { at: number; } - export interface HistoryOptions extends Silenceable { - pushState?: bool; + interface HistoryOptions extends Silenceable { + pushState?: boolean; root?: string; } - export interface NavigateOptions { - trigger: bool; + interface NavigateOptions { + trigger: boolean; } - export interface RouterOptions { + interface RouterOptions { routes: any; } - export interface Silenceable { - silent?: bool; + interface Silenceable { + silent?: boolean; } interface Validable { - validate?: bool; + validate?: boolean; } interface Waitable { - wait?: bool; + wait?: boolean; } interface Parseable { parse?: any; } - export interface PersistenceOptions { + interface PersistenceOptions { url?: string; beforeSend?: (jqxhr: JQueryXHR) => void; success?: (modelOrCollection?: any, response?: any, options?: any) => void; error?: (modelOrCollection?: any, jqxhr?: JQueryXHR, options?: any) => void; } - export interface ModelSetOptions extends Silenceable extends Validable { + interface ModelSetOptions extends Silenceable, Validable { } - export interface ModelFetchOptions extends PersistenceOptions extends ModelSetOptions extends Parseable { + interface ModelFetchOptions extends PersistenceOptions, ModelSetOptions, Parseable { } - export interface ModelSaveOptions extends Silenceable extends Waitable extends Validable extends Parseable extends PersistenceOptions { - patch?: bool; + interface ModelSaveOptions extends Silenceable, Waitable, Validable, Parseable, PersistenceOptions { + patch?: boolean; } - export interface ModelDestroyOptions extends Waitable extends PersistenceOptions { + interface ModelDestroyOptions extends Waitable, PersistenceOptions { } - export interface CollectionFetchOptions extends PersistenceOptions extends Parseable { - reset?: bool; + interface CollectionFetchOptions extends PersistenceOptions, Parseable { + reset?: boolean; } interface on { (eventName: string, callback: (...args: any[]) => void, context?: any): any; } @@ -71,7 +72,7 @@ declare module Backbone { interface bind { (eventName: string, callback: (...args: any[]) => void, context?: any): any; } interface unbind { (eventName?: string, callback?: (...args: any[]) => void, context?: any): any; } - declare class Events { + class Events { on(eventName: string, callback: (...args:any[]) => void, context?: any): any; off(eventName?: string, callback?: (...args:any[]) => void, context?: any): any; trigger(eventName: string, ...args: any[]): any; @@ -84,7 +85,7 @@ declare module Backbone { stopListening(object?: any, events?: string, callback?: (...args: any[]) => void ): any; } - export class ModelBase extends Events { + class ModelBase extends Events { url: any; parse(response, options?: any); toJSON(options?: any): any; @@ -92,7 +93,7 @@ declare module Backbone { } - export class Model extends ModelBase { + class Model extends ModelBase { static extend(properties: any, classProperties?: any): any; // do not use, prefer TypeScript's extend functionality @@ -120,10 +121,10 @@ declare module Backbone { defaults(): any; destroy(options?: ModelDestroyOptions); escape(attribute: string); - has(attribute: string): bool; - hasChanged(attribute?: string): bool; - isNew(): bool; - isValid(): bool; + has(attribute: string): boolean; + hasChanged(attribute?: string): boolean; + isNew(): boolean; + isValid(): boolean; previous(attribute: string): any; previousAttributes(): any[]; save(attributes?: any, options?: ModelSaveOptions); @@ -131,7 +132,7 @@ declare module Backbone { validate(attributes: any, options?: any): any; } - export class Collection extends ModelBase { + class Collection extends ModelBase { static extend(properties: any, classProperties?: any): any; // do not use, prefer TypeScript's extend functionality @@ -164,34 +165,34 @@ declare module Backbone { unshift(model: Model, options?: AddOptions); where(properies: any): Model[]; - all(iterator: (element: Model, index: number) => bool, context?: any): bool; - any(iterator: (element: Model, index: number) => bool, context?: any): bool; + all(iterator: (element: Model, index: number) => boolean, context?: any): boolean; + any(iterator: (element: Model, index: number) => boolean, context?: any): boolean; collect(iterator: (element: Model, index: number, context?: any) => any[], context?: any): any[]; chain(): any; compact(): Model[]; - contains(value: any): bool; + contains(value: any): boolean; countBy(iterator: (element: Model, index: number) => any): any[]; countBy(attribute: string): any[]; - detect(iterator: (item: any) => bool, context?: any): any; // ??? + detect(iterator: (item: any) => boolean, context?: any): any; // ??? difference(...model: Model[]): Model[]; drop(): Model; drop(n: number): Model[]; each(iterator: (element: Model, index: number, list?: any) => void, context?: any); - every(iterator: (element: Model, index: number) => bool, context?: any): bool; - filter(iterator: (element: Model, index: number) => bool, context?: any): Model[]; - find(iterator: (element: Model, index: number) => bool, context?: any): Model; + every(iterator: (element: Model, index: number) => boolean, context?: any): boolean; + filter(iterator: (element: Model, index: number) => boolean, context?: any): Model[]; + find(iterator: (element: Model, index: number) => boolean, context?: any): Model; first(): Model; first(n: number): Model[]; - flatten(shallow?: bool): Model[]; + flatten(shallow?: boolean): Model[]; foldl(iterator: (memo: any, element: Model, index: number) => any, initialMemo: any, context?: any): any; forEach(iterator: (element: Model, index: number, list?: any) => void, context?: any); - include(value: any): bool; - indexOf(element: Model, isSorted?: bool): number; + include(value: any): boolean; + indexOf(element: Model, isSorted?: boolean): number; initial(): Model; initial(n: number): Model[]; inject(iterator: (memo: any, element: Model, index: number) => any, initialMemo: any, context?: any): any; intersection(...model: Model[]): Model[]; - isEmpty(object: any): bool; + isEmpty(object: any): boolean; invoke(methodName: string, arguments?: any[]); last(): Model; last(n: number): Model[]; @@ -204,26 +205,26 @@ declare module Backbone { select(iterator: any, context?: any): any[]; size(): number; shuffle(): any[]; - some(iterator: (element: Model, index: number) => bool, context?: any): bool; + some(iterator: (element: Model, index: number) => boolean, context?: any): boolean; sortBy(iterator: (element: Model, index: number) => number, context?: any): Model[]; sortBy(attribute: string, context?: any): Model[]; sortedIndex(element: Model, iterator?: (element: Model, index: number) => number): number; range(stop: number, step?: number); range(start: number, stop: number, step?: number); reduceRight(iterator: (memo: any, element: Model, index: number) => any, initialMemo: any, context?: any): any[]; - reject(iterator: (element: Model, index: number) => bool, context?: any): Model[]; + reject(iterator: (element: Model, index: number) => boolean, context?: any): Model[]; rest(): Model; rest(n: number): Model[]; tail(): Model; tail(n: number): Model[]; toArray(): any[]; union(...model: Model[]): Model[]; - uniq(isSorted?: bool, iterator?: (element: Model, index: number) => bool): Model[]; + uniq(isSorted?: boolean, iterator?: (element: Model, index: number) => boolean): Model[]; without(...values: any[]): Model[]; zip(...model: Model[]): Model[]; } - export class Router extends Events { + class Router extends Events { static extend(properties: any, classProperties?: any): any; // do not use, prefer TypeScript's extend functionality @@ -233,20 +234,20 @@ declare module Backbone { initialize (options?: RouterOptions); route(route: string, name: string, callback?: (...parameter: any[]) => void); navigate(fragment: string, options?: NavigateOptions); - navigate(fragment: string, trigger?: bool); + navigate(fragment: string, trigger?: boolean); } - export var history: History; - export class History { + var history: History; + class History { start(options?: HistoryOptions); navigate(fragment: string, options: any); pushSate(); - getFragment(fragment?: string, forcePushState?: bool): string; + getFragment(fragment?: string, forcePushState?: boolean): string; getHash(window?: Window): string; - started: bool; + started: boolean; } - export interface ViewOptions { + interface ViewOptions { model?: Backbone.Model; collection?: Backbone.Collection; el?: any; @@ -256,7 +257,7 @@ declare module Backbone { attributes?: any[]; } - export class View extends Events { + class View extends Events { static extend(properties: any, classProperties?: any): any; // do not use, prefer TypeScript's extend functionality @@ -267,7 +268,7 @@ declare module Backbone { collection: Collection; template: (data?: any) => string; make(tagName: string, attrs?, opts?): View; - setElement(element: HTMLElement, delegate?: bool); + setElement(element: HTMLElement, delegate?: boolean); id: string; className: string; tagName: string; @@ -288,10 +289,16 @@ declare module Backbone { // SYNC function sync(method, model, options?: JQueryAjaxSettings); - var emulateHTTP: bool; - var emulateJSONBackbone: bool; + var emulateHTTP: boolean; + var emulateJSONBackbone: boolean; // Utility - function noConflict(): Backbone; + + // 0.9 cannot return modules anymore, and "typeof " is not compiling for some reason + // returning "any" until this is fixed + + //function noConflict(): typeof Backbone; + function noConflict(): any; + function setDomLibrary(jQueryNew); } From 68a3c88230bfe4474d47549a84e55d4f85b187ad Mon Sep 17 00:00:00 2001 From: Natan Vivo Date: Sat, 22 Jun 2013 12:17:27 -0300 Subject: [PATCH 56/57] Upgrade knockback definition to 0.9. * Remove unnecessary exports. * Remove semicolon at the end of module. * Basic migration to new Knockout's generics implementation. --- knockback/knockback.d.ts | 68 ++++++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/knockback/knockback.d.ts b/knockback/knockback.d.ts index 0bb9e4a9d..12592f46f 100644 --- a/knockback/knockback.d.ts +++ b/knockback/knockback.d.ts @@ -2,37 +2,37 @@ /// declare module Knockback { - export interface EventWatcherOptions { + interface EventWatcherOptions { emitter: (newEmitter) => void; update: (newValue) => void; event_selector: string; key?: string; } - export interface FactoryOptions { + interface FactoryOptions { factories: any; } - export interface StoreOptions { + interface StoreOptions { creator: any; path: string; store: Store; factory: Factory; } - export class Destroyable { + class Destroyable { destroy(); } - export class ViewModel extends Destroyable { + class ViewModel extends Destroyable { constructor (model?: Backbone.Model, options?: ViewModelOptions, viewModel?: ViewModel); shareOptions(): ViewModelOptions; extend(source: any); model(): Backbone.Model; } - export class EventWatcher extends Destroyable { - static useOptionsOrCreate(options, emitter: KnockoutObservableAny, obj: Backbone.Model, callback_options: any); + class EventWatcher extends Destroyable { + static useOptionsOrCreate(options, emitter: KnockoutObservable, obj: Backbone.Model, callback_options: any); emitter(): Backbone.Model; emitter(newEmitter: Backbone.Model); @@ -40,7 +40,7 @@ declare module Knockback { releaseCallbacks(obj: any); } - export class Factory { + class Factory { static useOptionsOrCreate(options: FactoryOptions, obj: any, owner_path: string); constructor (parent_factory: any); @@ -51,39 +51,39 @@ declare module Knockback { creatorForPath(obj: any, path: string); } - export class Store extends Destroyable { - static useOptionsOrCreate(options: StoreOptions, obj: any, observable: KnockoutObservableAny); + class Store extends Destroyable { + static useOptionsOrCreate(options: StoreOptions, obj: any, observable: KnockoutObservable); constructor (model:Backbone.Model, options: StoreOptions); clear(); - register(obj: Backbone.Model, observable: KnockoutObservableAny, options: StoreOptions); + register(obj: Backbone.Model, observable: KnockoutObservable, options: StoreOptions); findOrCreate(obj: Backbone.Model, options: StoreOptions); } - export class DefaultObservable extends Destroyable { - constructor (targetObservable: KnockoutObservableAny, defaultValue: any); + class DefaultObservable extends Destroyable { + constructor (targetObservable: KnockoutObservable, defaultValue: any); setToDefault(); } - export class FormattedObservable extends Destroyable { + class FormattedObservable extends Destroyable { constructor (format: string, args: any[]); - constructor (format: KnockoutObservableAny, args: any[]); + constructor (format: KnockoutObservable, args: any[]); } - export interface LocalizedObservable { + interface LocalizedObservable { constructor (value: any, options: any, vm: any); destroy(); resetToCurrent(); observedValue(value: any); } - export class TriggeredObservable extends Destroyable { + class TriggeredObservable extends Destroyable { constructor (emitter: Backbone.ModelBase, event: string); emitter(): Backbone.ModelBase; emitter(newEmitter: Backbone.ModelBase); } - export class Statistics { + class Statistics { constructor (); clear(); addModelEvent(event: string); @@ -94,14 +94,14 @@ declare module Knockback { registeredStatsString(success_message: string): string; } - export interface OptionsBase { + interface OptionsBase { path?: string; // the path to the value (used to create related observables from the factory). store?: Store; // a store used to cache and share view models. factory?: Factory; // a factory used to create view models. options?: any; // a set of options merge into these options using _.defaults. Useful for extending options when deriving classes rather than merging them by hand. } - export interface ViewModelOptions extends OptionsBase { + interface ViewModelOptions extends OptionsBase { internals?: string[]; // an array of atttributes that should be scoped with an underscore, eg. name -> _name requires?: string[]; // an array of atttributes that will have kb.Observables created even if they do not exist on the Backbone.Model. Useful for binding Views that require specific observables to exist keys?: string[]; // restricts the keys used on a model. Useful for reducing the number of kb.Observables created from a limited set of Backbone.Model attributes @@ -110,7 +110,7 @@ declare module Knockback { factories?: any; // a map of dot-deliminated paths; for example {'models.name': kb.ViewModel} to either constructors or create functions. Signature: {'some.path': function(object, options)} } - export interface CollectionOptions extends OptionsBase { + interface CollectionOptions extends OptionsBase { models_only?: bool; // flag for skipping the creation of view models. The collection observable will be populated with (possibly sorted) models. view_model?: any; // (Constructor) — the view model constructor used for models in the collection. Signature: constructor(model, options) create?: any; // a function used to create a view model for models in the collection. Signature: create(model, options) @@ -120,7 +120,7 @@ declare module Knockback { filters?: any; // filters can be individual ids (observable or simple) or arrays of ids, functions, or arrays of functions. } - export interface CollectionObservable extends KnockoutObservableArray { + interface CollectionObservable extends KnockoutObservableArray { collection(colleciton: Backbone.Collection); collection(): Backbone.Collection; destroy(); @@ -134,7 +134,7 @@ declare module Knockback { hasViewModels(): bool; } - export interface Utils { + interface Utils { wrappedObservable(obj: any): any; wrappedObservable(obj: any, value: any); wrappedObject(obj: any): any; @@ -148,7 +148,7 @@ declare module Knockback { wrappedEventWatcher(obj: any): any; wrappedEventWatcher(obj: any, value: any); wrappedDestroy(obj: any); - valueType(observable: KnockoutObservableAny): any; + valueType(observable: KnockoutObservable): any; pathJoin(path1: string, path2: string): string; optionsPathJoin(options: any, path: string): any; inferCreator(value: any, factory: Factory, path: string, owner: any, key: string); @@ -157,7 +157,7 @@ declare module Knockback { hasCollectionSignature(obj: any): bool; } - export interface Static extends Utils { + interface Static extends Utils { collectionObservable(model?: Backbone.Collection, options?: CollectionOptions): CollectionObservable; /** Base class for observing model attributes. */ observable( @@ -166,19 +166,19 @@ declare module Knockback { /** the create options. String is a single attribute name, Array is an array of attribute names. */ options: IObservableOptions, /** the viewModel */ - vm?: ViewModel): KnockoutObservableAny; + vm?: ViewModel): KnockoutObservable; observable( /** the model to observe (can be null) */ model: Backbone.Model, /** the create options. String is a single attribute name, Array is an array of attribute names. */ options_attributeName: string, /** the viewModel */ - vm?: ViewModel): KnockoutObservableAny; - viewModel(model?: Backbone.Model, options?: any): KnockoutObservableAny; - defaultObservable(targetObservable: KnockoutObservableAny, defaultValue: any): KnockoutObservableAny; - formattedObservable(format: string, args: any[]): KnockoutObservableAny; - formattedObservable(format: KnockoutObservableAny, args: any[]): KnockoutObservableAny; - localizedObservable(data: any, options: any): KnockoutObservableAny; + vm?: ViewModel): KnockoutObservable; + viewModel(model?: Backbone.Model, options?: any): KnockoutObservable; + defaultObservable(targetObservable: KnockoutObservable, defaultValue: any): KnockoutObservable; + formattedObservable(format: string, args: any[]): KnockoutObservable; + formattedObservable(format: KnockoutObservable, args: any[]): KnockoutObservable; + localizedObservable(data: any, options: any): KnockoutObservable; release(object: any, pre_release?: () => void ); releaseKeys(object: any); releaseOnNodeRemove(viewmodel: ViewModel, node: Element); @@ -204,7 +204,7 @@ declare module Knockback { key: string; read?: () => any; write?: (value: any) => void; - args?: KnockoutObservableAny[]; + args?: KnockoutObservable[]; localizer?: LocalizedObservable; default?: any; path?: string; @@ -213,6 +213,6 @@ declare module Knockback { options?: any; } -}; +} declare var kb: Knockback.Static; \ No newline at end of file From b6307ba232ebea86a429f35e8e22606173751fa5 Mon Sep 17 00:00:00 2001 From: Natan Vivo Date: Sat, 22 Jun 2013 13:50:10 -0300 Subject: [PATCH 57/57] Fix wrong signature on knockout computed. Missing options argument. Ref: http://knockoutjs.com/documentation/computedObservables.html#computed_observable_reference --- knockout/knockout.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/knockout/knockout.d.ts b/knockout/knockout.d.ts index f0909ddc9..6016a6598 100644 --- a/knockout/knockout.d.ts +++ b/knockout/knockout.d.ts @@ -62,7 +62,7 @@ interface KnockoutComputedStatic { fn: KnockoutComputedFunctions; (): KnockoutComputed; - (func: () => T, context?: any): KnockoutComputed; + (func: () => T, context?: any, options?: any): KnockoutComputed; (def: KnockoutComputedDefine): KnockoutComputed; (options?: any): KnockoutComputed; }