diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index aafef048d..6768db043 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -1,4 +1,4 @@
-# Contributors
+# Contributors
This is a non-exhaustive list of definitions and their creators. If you created a definition but are not listed then feel free to send a pull request on this file with your name and url.
@@ -13,6 +13,7 @@ All definitions files include a header with the author and editors, so at some p
* [AngularFire](https://www.firebase.com/docs/angular/reference.html) (by [Dénes Harmath](https://github.com/thSoft))
* [AngularJS](http://angularjs.org) (by [Diego Vilar](https://github.com/diegovilar)) ([wiki](https://github.com/borisyankov/DefinitelyTyped/wiki/AngularJS-Definitions-Usage-Notes))
* [angularLocalStorage](https://github.com/agrublev/angularLocalStorage) (by [Hiroki Horiuchi](https://github.com/horiuchi/))
+* [angular-spinner](https://github.com/urish/angular-spinner) (by [Marcin Biegała](https://github.com/Biegal))
* [AngularUI](http://angular-ui.github.io/) (by [Michel Salib](https://github.com/michelsalib))
* [Angular Hotkeys](https://github.com/chieffancypants/angular-hotkeys/) (by [Jason Zhao](https://github.com/jlz27))
* [Angular Protractor](https://github.com/angular/protractor) (by [Bill Armstrong](https://github.com/BillArmstrong))
@@ -46,6 +47,7 @@ All definitions files include a header with the author and editors, so at some p
* [CasperJS](http://casperjs.org) (by [Jed Hunsaker](https://github.com/jedhunsaker))
* [Cheerio](https://github.com/MatthewMueller/cheerio) (by [Bret Little](https://github.com/blittle))
* [Chosen](http://harvesthq.github.com/chosen/) (by [Boris Yankov](https://github.com/borisyankov))
+* [Chroma.js](https://github.com/gka/chroma.js) (by [Sebastian Brückner](https://github.com/invliD))
* [Chrome](http://developer.chrome.com/extensions/) (by [Matthew Kimber](https://github.com/matthewkimber) and [otiai10](https://github.com/otiai10))
* [Chrome App](http://developer.chrome.com/apps/) (by [Adam Lay](https://github.com/AdamLay))
* [CKEditor](https://github.com/ckeditor/ckeditor-dev) (by [Ondrej Sevcik](https://github.com/ondrejsevcik))
@@ -72,12 +74,14 @@ All definitions files include a header with the author and editors, so at some p
* [Elm](http://elm-lang.org) (by [Dénes Harmath](https://github.com/thSoft))
* [ember.js](http://emberjs.com/) (by [Boris Yankov](https://github.com/borisyankov))
* [emissary](https://github.com/atom/emissary) (by [vvakame](https://github.com/vvakame))
+* [Emscripten](http://kripken.github.io/emscripten-site/) (by [Kensuke MATSUZAKI](https://github.com/zakki))
* [EpicEditor](http://epiceditor.com/) (by [Boris Yankov](https://github.com/borisyankov))
* [ES6-Promises](https://github.com/jakearchibald/ES6-Promises) (by [François de Campredon](https://github.com/fdecampredon/))
* [Esprima](http://esprima.org/) (by [Teppei Sato](https://github.com/teppeis))
* [expect.js](https://github.com/LearnBoost/expect.js) (by [Teppei Sato](https://github.com/teppeis))
* [expectations](https://github.com/spmason/expectations) (by [vvakame](https://github.com/vvakame))
* [Express](http://expressjs.com/) (by [Boris Yankov](https://github.com/borisyankov))
+* [express-session](https://www.npmjs.org/package/express-session) (by [Hiroki Horiuchi](https://github.com/horiuchi/))
* [Ext JS](http://www.sencha.com/products/extjs/) (by [Brian Kotek](https://github.com/brian428))
* [Fabric.js](http://fabricjs.com/) (by [Oliver Klemencic](https://github.com/oklemencic/))
* [Fancybox](http://fancybox.net/) (by [Boris Yankov](https://github.com/borisyankov))
@@ -115,6 +119,7 @@ All definitions files include a header with the author and editors, so at some p
* [Google Translate API](https://developers.google.com/translate/) (by [Frank M](https://github.com/sgtfrankieboy))
* [Google Url Shortener](https://developers.google.com/url-shortener/) (by [Frank M](https://github.com/sgtfrankieboy))
* [Hammer.js](http://eightmedia.github.com/hammer.js/) (by [Boris Yankov](https://github.com/borisyankov))
+* [Hapi](http://github.com/spumko/hapi) (by [Hakubo](http://github.com/hakubo))
* [Handlebars](http://handlebarsjs.com/) (by [Boris Yankov](https://github.com/borisyankov))
* [HashMap](https://github.com/flesler/hashmap) (by [Rafał Wrzeszcz](https://wrzasq.pl))
* [HashSet](http://www.timdown.co.uk/jshashtable/jshashset.html) (by [Sergey Gerasimov](https://github.com/gerich-home))
@@ -125,6 +130,8 @@ All definitions files include a header with the author and editors, so at some p
* [highlight.js](https://github.com/isagalaev/highlight.js) (by [Niklas Mollenhauer](https://github.com/nikeee))
* [History.js](https://github.com/browserstate/history.js) (by [Boris Yankov](https://github.com/borisyankov))
* [Html2Canvas.js](https://github.com/niklasvh/html2canvas/) (by [Richard Hepburn](https://github.com/rwhepburn))
+* [htmlparser2](https://github.com/fb55/htmlparser2/) (by [James Roland Cabresos](https://github.com/staticfunction))
+* [http-string-parser](https://github.com/apiaryio/http-string-parser) (by [MIZUNE Pine](https://github.com/pine613))
* [Humane.js](http://wavded.github.com/humane-js/) (by [John Vrbanac](https://github.com/jmvrbanac))
* [i18next](http://i18next.com/) (by [Maarten Docter](https://github.com/mdocter))
* [iCheck](http://damirfoy.com/iCheck/) (by [Dániel Tar](https://github.com/qcz))
@@ -137,6 +144,7 @@ All definitions files include a header with the author and editors, so at some p
* [IxJS (Interactive extensions)](https://github.com/Reactive-Extensions/IxJS) (by [Igor Oleinikov](https://github.com/Igorbek))
* [jake](https://github.com/mde/jake) (by [Kon](http://phyzkit.net/))
* [Jasmine](http://pivotal.github.com/jasmine/) (by [Boris Yankov](https://github.com/borisyankov))
+* [Jasmine-data_driven_tests](https://github.com/gburghardt/jasmine-data_driven_tests) (by [Anthony MacKinnon](https://github.com/AnthonyMacKinnon))
* [Jasmine-jQuery](https://github.com/velesin/jasmine-jquery) (by [Gregor Stamac](https://github.com/gstamac))
* [jDataView](https://github.com/jDataView/jDataView) (by [Ingvar Stepanyan](https://github.com/RReverser))
* [JointJS](http://www.jointjs.com/) (by [Aidan Reel](http://github.com/areel))
@@ -153,6 +161,7 @@ All definitions files include a header with the author and editors, so at some p
* [jQuery.Colorbox](http://www.jacklmoore.com/colorbox/) (by [Gidon Junge](https://github.com/gjunge))
* [jQuery.contextMenu](http://medialize.github.com/jQuery-contextMenu/) (by [Natan Vivo](https://github.com/nvivo/))
* [jQuery.Cookie](https://github.com/carhartl/jquery-cookie) (by [Roy Goode](https://github.com/RoyGoode))
+* [jQuery.customSelect](https://github.com/adamcoulombe/jquery.customSelect) (by [tomato360](https://github.com/tomato360))
* [jQuery.Cycle](http://jquery.malsup.com/cycle/) (by [François Guillot](http://fguillot.developpez.com/))
* [jQuery.Cycle2](http://jquery.malsup.com/cycle2/) (by [Donny Nadolny](https://github.com/dnadolny))
* [jQuery.dataTables](http://www.datatables.net) (by [Armin Sander](https://github.com/pragmatrix))
@@ -167,6 +176,7 @@ All definitions files include a header with the author and editors, so at some p
* [jQuery.jNotify](http://jnotify.codeplex.com) (by [James Curran](https://github.com/jamescurran/))
* [jQuery.joyride](http://zurb.com/playground/jquery-joyride-feature-tour-plugin) (by [Vincent Bortone](https://github.com/vbortone))
* [jQuery.jSignature](https://github.com/willowsystems/jSignature) (by [Patrick Magee](https://github.com/pjmagee))
+* [jQuery.leanModal](http://leanmodal.finelysliced.com.au/)(by [tomato360](https://github.com/tomato360))
* [jQuery.notifyBar](http://www.whoop.ee/posts/2013-04-05-the-resurrection-of-jquery-notify-bar/) (by [Shunsuke Ohtani](https://github.com/zaneli))
* [jQuery.noty](http://needim.github.io/noty/) (by [Aaron King](https://github.com/kingdango/))
* [jQuery.payment](http://needim.github.io/noty/) (by [Eric J. Smith](https://github.com/ejsmith/))
@@ -191,9 +201,11 @@ All definitions files include a header with the author and editors, so at some p
* [jQuery.Validation](http://bassistance.de/jquery-plugins/jquery-plugin-validation/) (by [Boris Yankov](https://github.com/borisyankov))
* [jQuery.Watermark](http://jquery-watermark.googlecode.com) (by [Anwar Javed](https://github.com/anwarjaved))
* [jQuery.base64](https://github.com/yatt/jquery.base64) (by [Shinya Mochizuki](https://github.com/enrapt-mochizuki))
+* [jquery-handsontable](https://github.com/handsontable/jquery-handsontable) (by [Ted John](https://github.com/intelorca))
* [js-git](https://github.com/creationix/js-git) (by [Bart van der Schoor](https://github.com/Bartvds))
* [js-url](https://github.com/websanova/js-url) (by [MIZUNE Pine](https://github.com/pine613))
* [js-yaml](https://github.com/nodeca/js-yaml) (by [Bart van der Schoor](https://github.com/Bartvds/))
+* [jsbn](http://www-cs-students.stanford.edu/%7Etjw/jsbn/) (by [Eugene Chernyshov](https://github.com/Evgenus))
* [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/))
@@ -235,6 +247,7 @@ All definitions files include a header with the author and editors, so at some p
* [MathJax](https://github.com/mathjax/MathJax) (by [Roland Zwaga](https://github.com/rolandzwaga))
* [mCustomScrollbar](https://github.com/malihu/malihu-custom-scrollbar-plugin) (by [Sarah Williams](https://github.com/flurg))
* [Meteor](https://www.meteor.com) (by [Dave Allen](https://github.com/fullflavedave))
+* [md5.js](http://labs.cybozu.co.jp/blog/mitsunari/2007/07/md5js_1.html) (by [MIZUNE Pine](https://github.com/pine613))
* [Microsoft Ajax](http://msdn.microsoft.com/en-us/library/ee341002(v=vs.100).aspx) (by [Patrick Magee](https://github.com/pjmagee))
* [Microsoft Live Connect](http://msdn.microsoft.com/en-us/library/live/hh243643.aspx) (by [John Vilk](https://github.com/jvilk))
* [Minimatch](https://github.com/isaacs/minimatch) (by [vvakame](https://github.com/vvakame))
@@ -245,10 +258,13 @@ All definitions files include a header with the author and editors, so at some p
* [Moment.js](https://github.com/timrwood/moment) (by [Michael Lakerveld](https://github.com/Lakerfield))
* [MongoDB](http://mongodb.github.io/node-mongodb-native/) (from TypeScript samples, updated by [Niklas Mollenhauer](https://github.com/nikeee))
* [mongoose](http://mongoosejs.com/) (by [Hiroki Horiuchi](https://github.com/horiuchi/))
+* [morgan](https://github.com/expressjs/morgan/) (by [James Roland Cabresos](https://github.com/staticfunction/))
* [Mousetrap](http://craig.is/killing/mice) (by [Dániel Tar](https://github.com/qcz))
* [msgpack.js](https://github.com/uupaa/msgpack.js) (by [Shinya Mochizuki](https://github.com/enrapt-mochizuki))
* [Mustache.js](https://github.com/janl/mustache.js) (by [Boris Yankov](https://github.com/borisyankov))
+* [mysql](https://github.com/felixge/node-mysql) (by [William Johnston](https://github.com/wjohnsto))
* [nconf](https://github.com/flatiron/nconf) (by [Jeff Goddard](https://github.com/jedigo))
+* [needle](https://github.com/tomas/needle) (by [San Chen](https://github.com/bigsan))
* [noble](https://github.com/sandeepmistry/noble) (by [Seon-Wook Park](https://github.com/swook))
* [nock](https://github.com/pgte/nock) (by [bonnici](https://github.com/bonnici))
* [Node.js](http://nodejs.org/) (from TypeScript samples)
@@ -268,6 +284,7 @@ All definitions files include a header with the author and editors, so at some p
* [OpenLayers](https://github.com/openlayers/openlayers) (by [Ilya Bolkhovsky](https://github.com/bolhovsky/))
* [Optimist](https://github.com/substack/node-optimist) (by [Carlos Ballesteros Velasco](https://github.com/soywiz))
* [Passport](http://passportjs.org/) (by [Hiroki Horiuchi](https://github.com/horiuchi/))
+* [passport-facebook](https://github.com/jaredhanson/passport-facebook) (by [James Roland Cabresos](https://github.com/staticfunction/))
* [passport-strategy](https://github.com/jaredhanson/passport-strategy) (by [Lior Mualem](https://github.com/liorm))
* [pathwatcher](http://atom.github.io/node-pathwatcher/) (by [vvakame](https://github.com/vvakame))
* [Parallel.js](https://github.com/adambom/parallel.js) (by [Josh Baldwin](https://github.com/jbaldwin))
@@ -277,13 +294,16 @@ All definitions files include a header with the author and editors, so at some p
* [Persona](http://www.mozilla.org/en-US/persona) (by [James Frasca](https://github.com/Nycto))
* [PhantomJS](http://phantomjs.org) (by [Jed Hunsaker](https://github.com/jedhunsaker))
* [PhoneGap](http://phonegap.com) (by [Boris Yankov](https://github.com/borisyankov))
+* [Physijs](http://chandlerprall.github.io/Physijs/) (by [gyoh_k](https://github.com/gyohk))
* [PixiJS](https://github.com/GoodBoyDigital/pixi.js) (by [Pedro Casaubon](https://github.com/xperiments))
* [Platform](https://github.com/bestiejs/platform.js) (by [Jake Hickman](https://github.com/JakeH))
* [PouchDB](http://pouchdb.com) (by [Bill Sears](https://github.com/MrBigDog2U/))
* [PreloadJS](http://www.createjs.com/#!/PreloadJS) (by [Pedro Ferreira](https://bitbucket.org/drk4))
* [ProgressJs](http://usablica.github.io/progress.js/) (by [Shunsuke Ohtani](https://github.com/zaneli))
+* [promise-pool](https://github.com/vilic/promise-pool) (by [VILIC VANE](https://github.com/vilic))
* [Q](https://github.com/kriskowal/q) (by Barrie Nemetchek, Andrew Gaspar)
* [Q-io](https://github.com/kriskowal/q-io) (by [Bart van der Schoor](https://github.com/Bartvds))
+* [q-retry](https://github.com/vilic/q-retry) (by [VILIC VANE](https://github.com/vilic))
* [QUnit](http://qunitjs.com/) (by [Diullei Gomes](https://github.com/Diullei))
* [Raven.js](https://github.com/getsentry/raven-js) (by [Santi Albo](https://github.com/santialbo))
* [Recaptcha.js](https://www.google.com/recaptcha) (by [Brent Jenkins](https://github.com/brentj73))
@@ -304,9 +324,11 @@ All definitions files include a header with the author and editors, so at some p
* [Semver](https://github.com/isaacs/node-semver) (by [Bart van der Schoor](https://github.com/Bartvds))
* [Sencha Touch](http://www.sencha.com/products/touch/) (by [Brian Kotek](https://github.com/brian428))
* [SharePoint](http://sptypescript.codeplex.com) (by [Stanislav Vyshchepan](http://gandjustas.blogspot.ru) and [Andrey Markeev](http://markeev.com))
+* [ShellJS](http://shelljs.org) (by [Niklas Mollenhauer](https://github.com/nikeee))
* [SignalR](http://www.asp.net/signalr) (by [Boris Yankov](https://github.com/borisyankov))
* [simple-cw-node](https://github.com/astronaughts/simple-cw-node) (by [vvakame](https://github.com/vvakame))
* [Sinon](http://sinonjs.org/) (by [William Sears](https://github.com/mrbigdog2u))
+* [SIPml](http://sipml5.org/) (by [Adriaan Groenenboom](https://github.com/chookies))
* [sjcl](http://crypto.stanford.edu/sjcl/) (by [Eugene Chernyshov](https://github.com/Evgenus))
* [SlickGrid](https://github.com/mleibman/SlickGrid) (by [Josh Baldwin](https://github.com/jbaldwin))
* [smoothie](https://github.com/joewalnes/smoothie) (by [Mike H. Hawley](https://github.com/mikehhawley) and [Drew Noakes](https://drewnoakes.com))
@@ -315,6 +337,7 @@ All definitions files include a header with the author and editors, so at some p
* [SockJS](https://github.com/sockjs/sockjs-client) (by [Emil Ivanov](https://github.com/vladev))
* [sockjs-node](https://github.com/sockjs/sockjs-node) (by [Phil McCloghry-Laing](https://github.com/pmccloghrylaing))
* [SoundJS](http://www.createjs.com/#!/SoundJS) (by [Pedro Ferreira](https://bitbucket.org/drk4))
+* [source-map](https://github.com/mozilla/source-map) (by [Morten Houston Ludvigsen](https://github.com/MortenHoustonLudvigsen))
* [Spin](http://fgnass.github.com/spin.js/) (by [Boris Yankov](https://github.com/borisyankov))
* [sqlite3](https://github.com/mapbox/node-sqlite3) (by [Nick Malaguti](https://github.com/nmalaguti))
* [status-bar](https://github.com/atom/status-bar) (by [vvakame](https://github.com/vvakame))
@@ -360,6 +383,7 @@ All definitions files include a header with the author and editors, so at some p
* [ws](http://einaros.github.io/ws/) (by [Paul Loyd](https://github.com/loyd))
* [x2js](https://code.google.com/p/x2js/) (by [Hiroki Horiuchi](https://github.com/horiuchi/))
* [xml2js](https://github.com/Leonidas-from-XIV/node-xml2js) (by [Michel Salib](https://github.com/michelsalib))
+* [xpath](https://github.com/goto100/xpath) (by [Andrew Bradley](https://github.com/cspotcode))
* [XRegExp](http://xregexp.com/) (by [Bart van der Schoor](https://github.com/Bartvds))
* [YouTube](https://developers.google.com/youtube/) (by [Daz Wilkin](https://github.com/DazWilkin/))
* [YouTube Analytics API](https://developers.google.com/youtube/analytics/) (by [Frank M](https://github.com/sgtfrankieboy))
diff --git a/ace/ace.d.ts.tscparams b/ace/ace.d.ts.tscparams
index e16c76dff..d3f5a12fa 100644
--- a/ace/ace.d.ts.tscparams
+++ b/ace/ace.d.ts.tscparams
@@ -1 +1 @@
-""
+
diff --git a/ace/all-tests.ts.tscparams b/ace/all-tests.ts.tscparams
index e16c76dff..d3f5a12fa 100644
--- a/ace/all-tests.ts.tscparams
+++ b/ace/all-tests.ts.tscparams
@@ -1 +1 @@
-""
+
diff --git a/ace/tests/ace-anchor-tests.ts.tscparams b/ace/tests/ace-anchor-tests.ts.tscparams
index e16c76dff..d3f5a12fa 100644
--- a/ace/tests/ace-anchor-tests.ts.tscparams
+++ b/ace/tests/ace-anchor-tests.ts.tscparams
@@ -1 +1 @@
-""
+
diff --git a/ace/tests/ace-background_tokenizer-tests.ts.tscparams b/ace/tests/ace-background_tokenizer-tests.ts.tscparams
index e16c76dff..d3f5a12fa 100644
--- a/ace/tests/ace-background_tokenizer-tests.ts.tscparams
+++ b/ace/tests/ace-background_tokenizer-tests.ts.tscparams
@@ -1 +1 @@
-""
+
diff --git a/ace/tests/ace-default-tests.ts.tscparams b/ace/tests/ace-default-tests.ts.tscparams
index e16c76dff..d3f5a12fa 100644
--- a/ace/tests/ace-default-tests.ts.tscparams
+++ b/ace/tests/ace-default-tests.ts.tscparams
@@ -1 +1 @@
-""
+
diff --git a/ace/tests/ace-document-tests.ts.tscparams b/ace/tests/ace-document-tests.ts.tscparams
index e16c76dff..d3f5a12fa 100644
--- a/ace/tests/ace-document-tests.ts.tscparams
+++ b/ace/tests/ace-document-tests.ts.tscparams
@@ -1 +1 @@
-""
+
diff --git a/ace/tests/ace-edit_session-tests.ts.tscparams b/ace/tests/ace-edit_session-tests.ts.tscparams
index e16c76dff..d3f5a12fa 100644
--- a/ace/tests/ace-edit_session-tests.ts.tscparams
+++ b/ace/tests/ace-edit_session-tests.ts.tscparams
@@ -1 +1 @@
-""
+
diff --git a/ace/tests/ace-editor1-tests.ts.tscparams b/ace/tests/ace-editor1-tests.ts.tscparams
index e16c76dff..d3f5a12fa 100644
--- a/ace/tests/ace-editor1-tests.ts.tscparams
+++ b/ace/tests/ace-editor1-tests.ts.tscparams
@@ -1 +1 @@
-""
+
diff --git a/ace/tests/ace-editor_highlight_selected_word-tests.ts.tscparams b/ace/tests/ace-editor_highlight_selected_word-tests.ts.tscparams
index e16c76dff..d3f5a12fa 100644
--- a/ace/tests/ace-editor_highlight_selected_word-tests.ts.tscparams
+++ b/ace/tests/ace-editor_highlight_selected_word-tests.ts.tscparams
@@ -1 +1 @@
-""
+
diff --git a/ace/tests/ace-editor_navigation-tests.ts.tscparams b/ace/tests/ace-editor_navigation-tests.ts.tscparams
index e16c76dff..d3f5a12fa 100644
--- a/ace/tests/ace-editor_navigation-tests.ts.tscparams
+++ b/ace/tests/ace-editor_navigation-tests.ts.tscparams
@@ -1 +1 @@
-""
+
diff --git a/ace/tests/ace-editor_text_edit-tests.ts.tscparams b/ace/tests/ace-editor_text_edit-tests.ts.tscparams
index e16c76dff..d3f5a12fa 100644
--- a/ace/tests/ace-editor_text_edit-tests.ts.tscparams
+++ b/ace/tests/ace-editor_text_edit-tests.ts.tscparams
@@ -1 +1 @@
-""
+
diff --git a/ace/tests/ace-multi_select-tests.ts.tscparams b/ace/tests/ace-multi_select-tests.ts.tscparams
index e16c76dff..d3f5a12fa 100644
--- a/ace/tests/ace-multi_select-tests.ts.tscparams
+++ b/ace/tests/ace-multi_select-tests.ts.tscparams
@@ -1 +1 @@
-""
+
diff --git a/ace/tests/ace-placeholder-tests.ts.tscparams b/ace/tests/ace-placeholder-tests.ts.tscparams
index e16c76dff..d3f5a12fa 100644
--- a/ace/tests/ace-placeholder-tests.ts.tscparams
+++ b/ace/tests/ace-placeholder-tests.ts.tscparams
@@ -1 +1 @@
-""
+
diff --git a/ace/tests/ace-range-tests.ts.tscparams b/ace/tests/ace-range-tests.ts.tscparams
index e16c76dff..d3f5a12fa 100644
--- a/ace/tests/ace-range-tests.ts.tscparams
+++ b/ace/tests/ace-range-tests.ts.tscparams
@@ -1 +1 @@
-""
+
diff --git a/ace/tests/ace-range_list-tests.ts.tscparams b/ace/tests/ace-range_list-tests.ts.tscparams
index e16c76dff..d3f5a12fa 100644
--- a/ace/tests/ace-range_list-tests.ts.tscparams
+++ b/ace/tests/ace-range_list-tests.ts.tscparams
@@ -1 +1 @@
-""
+
diff --git a/ace/tests/ace-search-tests.ts.tscparams b/ace/tests/ace-search-tests.ts.tscparams
index e16c76dff..d3f5a12fa 100644
--- a/ace/tests/ace-search-tests.ts.tscparams
+++ b/ace/tests/ace-search-tests.ts.tscparams
@@ -1 +1 @@
-""
+
diff --git a/ace/tests/ace-selection-tests.ts.tscparams b/ace/tests/ace-selection-tests.ts.tscparams
index e16c76dff..d3f5a12fa 100644
--- a/ace/tests/ace-selection-tests.ts.tscparams
+++ b/ace/tests/ace-selection-tests.ts.tscparams
@@ -1 +1 @@
-""
+
diff --git a/ace/tests/ace-token_iterator-tests.ts.tscparams b/ace/tests/ace-token_iterator-tests.ts.tscparams
index e16c76dff..d3f5a12fa 100644
--- a/ace/tests/ace-token_iterator-tests.ts.tscparams
+++ b/ace/tests/ace-token_iterator-tests.ts.tscparams
@@ -1 +1 @@
-""
+
diff --git a/ace/tests/ace-virtual_renderer-tests.ts.tscparams b/ace/tests/ace-virtual_renderer-tests.ts.tscparams
index e16c76dff..d3f5a12fa 100644
--- a/ace/tests/ace-virtual_renderer-tests.ts.tscparams
+++ b/ace/tests/ace-virtual_renderer-tests.ts.tscparams
@@ -1 +1 @@
-""
+
diff --git a/amcharts/AmCharts.d.ts.tscparams b/amcharts/AmCharts.d.ts.tscparams
index e16c76dff..d3f5a12fa 100644
--- a/amcharts/AmCharts.d.ts.tscparams
+++ b/amcharts/AmCharts.d.ts.tscparams
@@ -1 +1 @@
-""
+
diff --git a/amplifyjs/amplifyjs-tests.ts.tscparams b/amplifyjs/amplifyjs-tests.ts.tscparams
index e16c76dff..d3f5a12fa 100644
--- a/amplifyjs/amplifyjs-tests.ts.tscparams
+++ b/amplifyjs/amplifyjs-tests.ts.tscparams
@@ -1 +1 @@
-""
+
diff --git a/amplifyjs/amplifyjs.d.ts.tscparams b/amplifyjs/amplifyjs.d.ts.tscparams
index e16c76dff..d3f5a12fa 100644
--- a/amplifyjs/amplifyjs.d.ts.tscparams
+++ b/amplifyjs/amplifyjs.d.ts.tscparams
@@ -1 +1 @@
-""
+
diff --git a/angular-spinner/angular-spinner-tests.ts b/angular-spinner/angular-spinner-tests.ts
new file mode 100644
index 000000000..cb50a9c37
--- /dev/null
+++ b/angular-spinner/angular-spinner-tests.ts
@@ -0,0 +1,12 @@
+///
+
+var myApp = angular.module('testModule');
+
+module AngularSpinnerTest {
+ var app = angular.module("angularSpinnerTest", ["angular-spinner"]);
+
+ app.config(['usSpinnerService', function(usSpinnerService: ISpinnerService) {
+ usSpinnerService.spin('key1');
+ usSpinnerService.stop('key2');
+ }]);
+}
diff --git a/angular-spinner/angular-spinner.d.ts b/angular-spinner/angular-spinner.d.ts
new file mode 100644
index 000000000..99784d38f
--- /dev/null
+++ b/angular-spinner/angular-spinner.d.ts
@@ -0,0 +1,26 @@
+// Type definitions for angular-spinner.js 0.5.1
+// Project: https://github.com/urish/angular-spinner
+// Definitions by: Marcin Biegała
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+///
+
+/**
+* SpinnerService
+* see https://github.com/urish/angular-spinner
+*/
+interface ISpinnerService {
+ /**
+ * Start selected spinner
+ *
+ * @param spinner key
+ */
+ spin(key: string): void;
+
+ /**
+ * Stop selected spinner
+ *
+ * @param spinner key
+ */
+ stop(key: string): void;
+}
diff --git a/angular-translate/angular-translate.d.ts b/angular-translate/angular-translate.d.ts
index 313ef8635..4b8da8449 100644
--- a/angular-translate/angular-translate.d.ts
+++ b/angular-translate/angular-translate.d.ts
@@ -33,13 +33,14 @@ declare module ng.translate {
}
interface ITranslateService {
- (key: string, ...params: string[]): ng.IPromise;
+ (translationId: string, interpolateParams?: any, interpolationId?: string): ng.IPromise;
+ (translationId: string[], interpolateParams?: any, interpolationId?: string): ng.IPromise<{ [key: string]: string }>;
cloakClassName(): string;
cloakClassName(name: string): ITranslateProvider;
fallbackLanguage(langKey?: string): string;
fallbackLanguage(langKey?: string[]): string;
instant(translationId: string, interpolateParams?: any, interpolationId?: string): string;
- instant(translationId: string[], interpolateParams?: any, interpolationId?: string): string;
+ instant(translationId: string[], interpolateParams?: any, interpolationId?: string): { [key: string]: string };
isPostCompilingEnabled(): boolean;
preferredLanguage(): string;
proposedLanguage(): string;
diff --git a/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts b/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts
index 8ed8be859..608591b58 100644
--- a/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts
+++ b/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts
@@ -118,7 +118,7 @@ testApp.config((
});
testApp.controller('TestCtrl', (
- $scope: ng.IScope,
+ $scope: ng.ui.bootstrap.IModalScope,
$log: ng.ILogService,
$modal: ng.ui.bootstrap.IModalService,
$modalStack: ng.ui.bootstrap.IModalStackService,
@@ -147,9 +147,9 @@ testApp.controller('TestCtrl', (
$log.log('modal opened');
});
- modalInstance.result.then(closeResult=> {
+ modalInstance.result.then((closeResult:any)=> {
$log.log('modal closed', closeResult);
- }, dismissResult=> {
+ }, (dismissResult:any)=> {
$log.log('modal dismissed', dismissResult);
});
diff --git a/angular-ui-bootstrap/angular-ui-bootstrap.d.ts b/angular-ui-bootstrap/angular-ui-bootstrap.d.ts
index 2d792d1b1..ad90dc9db 100644
--- a/angular-ui-bootstrap/angular-ui-bootstrap.d.ts
+++ b/angular-ui-bootstrap/angular-ui-bootstrap.d.ts
@@ -1,4 +1,4 @@
-// Type definitions for Angular UI Bootstrap 0.10.0
+// Type definitions for Angular UI Bootstrap 0.11.0
// Project: https://github.com/angular-ui/bootstrap
// Definitions by: Brian Surowiec
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -198,6 +198,22 @@ declare module ng.ui.bootstrap {
opened: ng.IPromise;
}
+ interface IModalScope extends ng.IScope {
+ /**
+ * Those methods make it easy to close a modal window without a need to create a dedicated controller
+ */
+
+ /**
+ * Dismiss the dialog without assigning a value to the promise output
+ */
+ $dismiss(reason?: any): void;
+
+ /**
+ * Close the dialog resolving the promise to the given value
+ */
+ $close(result?: any): void;
+ }
+
interface IModalSettings {
/**
* a path to a template representing modal's content
@@ -211,9 +227,9 @@ declare module ng.ui.bootstrap {
/**
* a scope instance to be used for the modal's content (actually the $modal service is going to create a child scope of a provided scope).
- * Defaults to `$rootScope`
+ * Defaults to `$rootScope`.
*/
- scope?: any;
+ scope?: IModalScope;
/**
* a controller for a modal instance - it can initialize scope used by modal.
@@ -246,6 +262,16 @@ declare module ng.ui.bootstrap {
* additional CSS class(es) to be added to a modal window template
*/
windowClass?: string;
+
+ /**
+ * optional size of modal window. Allowed values: 'sm' (small) or 'lg' (large). Requires Bootstrap 3.1.0 or later
+ */
+ size?: string;
+
+ /**
+ * a path to a template overriding modal's window template
+ */
+ windowTemplateUrl?: string;
}
interface IModalStackService {
diff --git a/angular-ui/angular-ui-router.d.ts b/angular-ui/angular-ui-router.d.ts
index 081d35723..005bf8b90 100644
--- a/angular-ui/angular-ui-router.d.ts
+++ b/angular-ui/angular-ui-router.d.ts
@@ -11,8 +11,9 @@ declare module ng.ui {
name?: string;
template?: any;
templateUrl?: any;
- templateProvider?: () => string;
+ templateProvider?: any;
controller?: any;
+ controllerAs?: string;
controllerProvider?: any;
resolve?: {};
url?: string;
diff --git a/angularjs/angular-tests.ts b/angularjs/angular-tests.ts
index a1577856e..ad1eef90c 100644
--- a/angularjs/angular-tests.ts
+++ b/angularjs/angular-tests.ts
@@ -231,11 +231,11 @@ foo.then((x) => {
}).then((x) => {
// Object is inferred here
x.a = 123;
- //Try a promise
+ //Try a promise
var y: ng.IPromise;
- return y;
+ return y;
}).then((x) => {
- // x is infered to be a number, which is the resolved value of a promise
+ // x is infered to be a number, which is the resolved value of a promise
x.toFixed();
});
@@ -281,252 +281,375 @@ test_IAttributes({
$attr: {}
});
+class SampleDirective implements ng.IDirective {
+ public restrict = 'A';
+ name = 'doh';
+
+ compile(templateElement: ng.IAugmentedJQuery) {
+ return {
+ post: this.link
+ };
+ }
+
+ static instance():ng.IDirective {
+ return new SampleDirective();
+ }
+
+ link(scope: ng.IScope) {
+
+ }
+}
+
+class SampleDirective2 implements ng.IDirective {
+ public restrict = 'EAC';
+
+ compile(templateElement: ng.IAugmentedJQuery) {
+ return {
+ pre: this.link
+ };
+ }
+
+ static instance():ng.IDirective {
+ return new SampleDirective2();
+ }
+
+ link(scope: ng.IScope) {
+
+ }
+}
+
+angular.module('SameplDirective', []).directive('sampleDirective', SampleDirective.instance).directive('sameplDirective2', SampleDirective2.instance);
+
// test from https://docs.angularjs.org/guide/directive
angular.module('docsSimpleDirective', [])
- .controller('Controller', ['$scope', function($scope: any) {
- $scope.customer = {
- name: 'Naomi',
- address: '1600 Amphitheatre'
- };
- }])
- .directive('myCustomer', function() {
- return {
- template: 'Name: {{customer.name}} Address: {{customer.address}}'
- };
- });
+ .controller('Controller', ['$scope', function($scope: any) {
+ $scope.customer = {
+ name: 'Naomi',
+ address: '1600 Amphitheatre'
+ };
+ }])
+ .directive('myCustomer', function() {
+ return {
+ template: 'Name: {{customer.name}} Address: {{customer.address}}'
+ };
+ });
angular.module('docsTemplateUrlDirective', [])
- .controller('Controller', ['$scope', function($scope: any) {
- $scope.customer = {
- name: 'Naomi',
- address: '1600 Amphitheatre'
- };
- }])
- .directive('myCustomer', function() {
- return {
- templateUrl: 'my-customer.html'
- };
- });
+ .controller('Controller', ['$scope', function($scope: any) {
+ $scope.customer = {
+ name: 'Naomi',
+ address: '1600 Amphitheatre'
+ };
+ }])
+ .directive('myCustomer', function() {
+ return {
+ templateUrl: 'my-customer.html'
+ };
+ });
angular.module('docsRestrictDirective', [])
- .controller('Controller', ['$scope', function($scope: any) {
- $scope.customer = {
- name: 'Naomi',
- address: '1600 Amphitheatre'
- };
- }])
- .directive('myCustomer', function() {
- return {
- restrict: 'E',
- templateUrl: 'my-customer.html'
- };
- });
+ .controller('Controller', ['$scope', function($scope: any) {
+ $scope.customer = {
+ name: 'Naomi',
+ address: '1600 Amphitheatre'
+ };
+ }])
+ .directive('myCustomer', function() {
+ return {
+ restrict: 'E',
+ templateUrl: 'my-customer.html'
+ };
+ });
angular.module('docsScopeProblemExample', [])
- .controller('NaomiController', ['$scope', function($scope: any) {
- $scope.customer = {
- name: 'Naomi',
- address: '1600 Amphitheatre'
- };
- }])
- .controller('IgorController', ['$scope', function($scope: any) {
- $scope.customer = {
- name: 'Igor',
- address: '123 Somewhere'
- };
- }])
- .directive('myCustomer', function() {
- return {
- restrict: 'E',
- templateUrl: 'my-customer.html'
- };
- });
+ .controller('NaomiController', ['$scope', function($scope: any) {
+ $scope.customer = {
+ name: 'Naomi',
+ address: '1600 Amphitheatre'
+ };
+ }])
+ .controller('IgorController', ['$scope', function($scope: any) {
+ $scope.customer = {
+ name: 'Igor',
+ address: '123 Somewhere'
+ };
+ }])
+ .directive('myCustomer', function() {
+ return {
+ restrict: 'E',
+ templateUrl: 'my-customer.html'
+ };
+ });
angular.module('docsIsolateScopeDirective', [])
- .controller('Controller', ['$scope', function($scope: any) {
- $scope.naomi = { name: 'Naomi', address: '1600 Amphitheatre' };
- $scope.igor = { name: 'Igor', address: '123 Somewhere' };
- }])
- .directive('myCustomer', function() {
- return {
- restrict: 'E',
- scope: {
- customerInfo: '=info'
- },
- templateUrl: 'my-customer-iso.html'
- };
- });
+ .controller('Controller', ['$scope', function($scope: any) {
+ $scope.naomi = { name: 'Naomi', address: '1600 Amphitheatre' };
+ $scope.igor = { name: 'Igor', address: '123 Somewhere' };
+ }])
+ .directive('myCustomer', function() {
+ return {
+ restrict: 'E',
+ scope: {
+ customerInfo: '=info'
+ },
+ templateUrl: 'my-customer-iso.html'
+ };
+ });
angular.module('docsIsolationExample', [])
- .controller('Controller', ['$scope', function($scope: any) {
- $scope.naomi = { name: 'Naomi', address: '1600 Amphitheatre' };
- $scope.vojta = { name: 'Vojta', address: '3456 Somewhere Else' };
- }])
- .directive('myCustomer', function() {
- return {
- restrict: 'E',
- scope: {
- customerInfo: '=info'
- },
- templateUrl: 'my-customer-plus-vojta.html'
- };
- });
+ .controller('Controller', ['$scope', function($scope: any) {
+ $scope.naomi = { name: 'Naomi', address: '1600 Amphitheatre' };
+ $scope.vojta = { name: 'Vojta', address: '3456 Somewhere Else' };
+ }])
+ .directive('myCustomer', function() {
+ return {
+ restrict: 'E',
+ scope: {
+ customerInfo: '=info'
+ },
+ templateUrl: 'my-customer-plus-vojta.html'
+ };
+ });
angular.module('docsTimeDirective', [])
- .controller('Controller', ['$scope', function($scope: any) {
- $scope.format = 'M/d/yy h:mm:ss a';
- }])
- .directive('myCurrentTime', ['$interval', 'dateFilter', function($interval: any, dateFilter: any): ng.IDirective {
+ .controller('Controller', ['$scope', function($scope: any) {
+ $scope.format = 'M/d/yy h:mm:ss a';
+ }])
+ .directive('myCurrentTime', ['$interval', 'dateFilter', function($interval: any, dateFilter: any) {
- return {
- link: function(scope: any, element: any, attrs: any) {
- var format: any,
- timeoutId: any;
+ return {
+ link: function(scope: ng.IScope, element: ng.IAugmentedJQuery, attrs:ng.IAttributes) {
+ var format: any,
+ timeoutId: any;
- function updateTime() {
- element.text(dateFilter(new Date(), format));
- }
+ function updateTime() {
+ element.text(dateFilter(new Date(), format));
+ }
- scope.$watch(attrs.myCurrentTime, function (value: any) {
- format = value;
- updateTime();
- });
+ scope.$watch(attrs['myCurrentTime'], function (value: any) {
+ format = value;
+ updateTime();
+ });
- element.on('$destroy', function () {
- $interval.cancel(timeoutId);
- });
+ element.on('$destroy', function () {
+ $interval.cancel(timeoutId);
+ });
- // start the UI update process; save the timeoutId for canceling
- timeoutId = $interval(function () {
- updateTime(); // update DOM
- }, 1000);
- }
- };
- }]);
+ // start the UI update process; save the timeoutId for canceling
+ timeoutId = $interval(function () {
+ updateTime(); // update DOM
+ }, 1000);
+ }
+ };
+ }]);
angular.module('docsTransclusionDirective', [])
- .controller('Controller', ['$scope', function($scope: any) {
- $scope.name = 'Tobias';
- }])
- .directive('myDialog', function() {
- return {
- restrict: 'E',
- transclude: true,
- templateUrl: 'my-dialog.html'
- };
- });
+ .controller('Controller', ['$scope', function($scope: any) {
+ $scope.name = 'Tobias';
+ }])
+ .directive('myDialog', function() {
+ return {
+ restrict: 'E',
+ transclude: true,
+ templateUrl: 'my-dialog.html'
+ };
+ });
angular.module('docsTransclusionExample', [])
- .controller('Controller', ['$scope', function($scope: any) {
- $scope.name = 'Tobias';
- }])
- .directive('myDialog', function() {
- return {
- restrict: 'E',
- transclude: true,
- scope: {},
- templateUrl: 'my-dialog.html',
- link: function (scope: any, element: any) {
- scope.name = 'Jeff';
- }
- };
- });
+ .controller('Controller', ['$scope', function($scope: any) {
+ $scope.name = 'Tobias';
+ }])
+ .directive('myDialog', function() {
+ return {
+ restrict: 'E',
+ transclude: true,
+ scope: {},
+ templateUrl: 'my-dialog.html',
+ link: function (scope: ng.IScope, element: ng.IAugmentedJQuery) {
+ scope['name'] = 'Jeff';
+ }
+ };
+ });
angular.module('docsIsoFnBindExample', [])
- .controller('Controller', ['$scope', '$timeout', function($scope: any, $timeout: any) {
- $scope.name = 'Tobias';
- $scope.hideDialog = function () {
- $scope.dialogIsHidden = true;
- $timeout(function () {
- $scope.dialogIsHidden = false;
- }, 2000);
- };
- }])
- .directive('myDialog', function() {
- return {
- restrict: 'E',
- transclude: true,
- scope: {
- 'close': '&onClose'
- },
- templateUrl: 'my-dialog-close.html'
- };
- });
+ .controller('Controller', ['$scope', '$timeout', function($scope: any, $timeout: any) {
+ $scope.name = 'Tobias';
+ $scope.hideDialog = function () {
+ $scope.dialogIsHidden = true;
+ $timeout(function () {
+ $scope.dialogIsHidden = false;
+ }, 2000);
+ };
+ }])
+ .directive('myDialog', function() {
+ return {
+ restrict: 'E',
+ transclude: true,
+ scope: {
+ 'close': '&onClose'
+ },
+ templateUrl: 'my-dialog-close.html'
+ };
+ });
angular.module('dragModule', [])
- .directive('myDraggable', ['$document', function($document: any) {
- return function(scope: any, element: any, attr: any) {
- var startX = 0, startY = 0, x = 0, y = 0;
+ .directive('myDraggable', ['$document', function($document: any) {
+ return function(scope: any, element: any, attr: any) {
+ var startX = 0, startY = 0, x = 0, y = 0;
- element.css({
- position: 'relative',
- border: '1px solid red',
- backgroundColor: 'lightgrey',
- cursor: 'pointer'
- });
+ element.css({
+ position: 'relative',
+ border: '1px solid red',
+ backgroundColor: 'lightgrey',
+ cursor: 'pointer'
+ });
- element.on('mousedown', function(event: any) {
- // Prevent default dragging of selected content
- event.preventDefault();
- startX = event.pageX - x;
- startY = event.pageY - y;
- $document.on('mousemove', mousemove);
- $document.on('mouseup', mouseup);
- });
+ element.on('mousedown', function(event: any) {
+ // Prevent default dragging of selected content
+ event.preventDefault();
+ startX = event.pageX - x;
+ startY = event.pageY - y;
+ $document.on('mousemove', mousemove);
+ $document.on('mouseup', mouseup);
+ });
- function mousemove(event: any) {
- y = event.pageY - startY;
- x = event.pageX - startX;
- element.css({
- top: y + 'px',
- left: x + 'px'
- });
- }
+ function mousemove(event: any) {
+ y = event.pageY - startY;
+ x = event.pageX - startX;
+ element.css({
+ top: y + 'px',
+ left: x + 'px'
+ });
+ }
- function mouseup() {
- $document.off('mousemove', mousemove);
- $document.off('mouseup', mouseup);
- }
- };
- }]);
+ function mouseup() {
+ $document.off('mousemove', mousemove);
+ $document.off('mouseup', mouseup);
+ }
+ };
+ }]);
angular.module('docsTabsExample', [])
- .directive('myTabs', function() {
- return {
- restrict: 'E',
- transclude: true,
- scope: {},
- controller: function($scope: any) {
- var panes: any = $scope.panes = [];
+ .directive('myTabs', function() {
+ return {
+ restrict: 'E',
+ transclude: true,
+ scope: {},
+ controller: function($scope: ng.IScope) {
+ var panes: any = $scope['panes'] = [];
- $scope.select = function(pane: any) {
- angular.forEach(panes, function(pane: any) {
- pane.selected = false;
- });
- pane.selected = true;
- };
+ $scope['select'] = function(pane: any) {
+ angular.forEach(panes, function(pane: any) {
+ pane.selected = false;
+ });
+ pane.selected = true;
+ };
- this.addPane = function(pane: any) {
- if (panes.length === 0) {
- $scope.select(pane);
- }
- panes.push(pane);
- };
- },
- templateUrl: 'my-tabs.html'
- };
- })
- .directive('myPane', function() {
- return {
- require: '^myTabs',
- restrict: 'E',
- transclude: true,
- scope: {
- title: '@'
- },
- link: function(scope, element, attrs, tabsCtrl) {
- tabsCtrl.addPane(scope);
- },
- templateUrl: 'my-pane.html'
- };
- });
+ this.addPane = function(pane: any) {
+ if (panes.length === 0) {
+ $scope['select'](pane);
+ }
+ panes.push(pane);
+ };
+ },
+ templateUrl: 'my-tabs.html'
+ };
+ })
+ .directive('myPane', function() {
+ return {
+ require: '^myTabs',
+ restrict: 'E',
+ transclude: true,
+ scope: {
+ title: '@'
+ },
+ link: function(scope: ng.IScope, element: ng.IAugmentedJQuery, attrs: ng.IAttributes, tabsCtrl: any) {
+ tabsCtrl.addPane(scope);
+ },
+ templateUrl: 'my-pane.html'
+ };
+ });
+
+interface copyExampleUser {
+ name?: string;
+ email?: string;
+ gender?: string;
+}
+
+interface copyExampleScope {
+
+ user: copyExampleUser;
+ master: copyExampleUser;
+ update: (copyExampleUser: copyExampleUser) => any;
+ reset: () => any;
+}
+
+angular.module('copyExample', [])
+ .controller('ExampleController', ['$scope', function ($scope: copyExampleScope) {
+ $scope.master = { };
+
+ $scope.update = function (user) {
+ // Example with 1 argument
+ $scope.master = angular.copy(user);
+ };
+
+ $scope.reset = function () {
+ // Example with 2 arguments
+ angular.copy($scope.master, $scope.user);
+ };
+
+ $scope.reset();
+ }]);
+
+module locationTests {
+
+ var $location: ng.ILocationService;
+
+ /*
+ * From https://docs.angularjs.org/api/ng/service/$location
+ */
+
+ // given url http://example.com/#/some/path?foo=bar&baz=xoxo
+ var searchObject = $location.search();
+ // => {foo: 'bar', baz: 'xoxo'}
+
+
+ // set foo to 'yipee'
+ $location.search('foo', 'yipee');
+ // => $location
+
+ // set foo to 5
+ $location.search('foo', 5);
+ // => $location
+
+ /*
+ * From: https://docs.angularjs.org/guide/$location
+ */
+
+ // in browser with HTML5 history support:
+ // open http://example.com/#!/a -> rewrite to http://example.com/a
+ // (replacing the http://example.com/#!/a history record)
+ $location.path() == '/a'
+
+ $location.path('/foo');
+ $location.absUrl() == 'http://example.com/foo'
+
+ $location.search() == {}
+ $location.search({ a: 'b', c: true });
+ $location.absUrl() == 'http://example.com/foo?a=b&c'
+
+ $location.path('/new').search('x=y');
+ $location.url() == 'new?x=y'
+ $location.absUrl() == 'http://example.com/new?x=y'
+
+ // in browser without html5 history support:
+ // open http://example.com/new?x=y -> redirect to http://example.com/#!/new?x=y
+ // (again replacing the http://example.com/new?x=y history item)
+ $location.path() == '/new'
+ $location.search() == { x: 'y' }
+
+ $location.path('/foo/bar');
+ $location.path() == '/foo/bar'
+ $location.url() == '/foo/bar?x=y'
+ $location.absUrl() == 'http://example.com/#!/foo/bar?x=y'
+}
\ No newline at end of file
diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts
index e447985fb..bd6bd01cb 100755
--- a/angularjs/angular.d.ts
+++ b/angularjs/angular.d.ts
@@ -1,4 +1,4 @@
-// Type definitions for Angular JS 1.2+
+// Type definitions for Angular JS 1.3+
// Project: http://angularjs.org
// Definitions by: Diego Vilar
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -20,7 +20,7 @@ declare module ng {
// not directly implemented, but ensures that constructed class implements $get
interface IServiceProviderClass {
- new(...args: any[]): IServiceProvider;
+ new (...args: any[]): IServiceProvider;
}
interface IServiceProviderFactory {
@@ -38,11 +38,134 @@ declare module ng {
///////////////////////////////////////////////////////////////////////////
interface IAngularStatic {
bind(context: any, fn: Function, ...args: any[]): Function;
- bootstrap(element: string, modules?: any[]): auto.IInjectorService;
- bootstrap(element: JQuery, modules?: any[]): auto.IInjectorService;
- bootstrap(element: Element, modules?: any[]): auto.IInjectorService;
- bootstrap(element: Document, modules?: any[]): auto.IInjectorService;
- copy(source: any, destination?: any): any;
+
+ /**
+ * Use this function to manually start up angular application.
+ *
+ * @param element DOM element which is the root of angular application.
+ * @param modules An array of modules to load into the application.
+ * Each item in the array should be the name of a predefined module or a (DI annotated)
+ * function that will be invoked by the injector as a run block.
+ */
+ bootstrap(element: string, modules?: string): auto.IInjectorService;
+ /**
+ * Use this function to manually start up angular application.
+ *
+ * @param element DOM element which is the root of angular application.
+ * @param modules An array of modules to load into the application.
+ * Each item in the array should be the name of a predefined module or a (DI annotated)
+ * function that will be invoked by the injector as a run block.
+ */
+ bootstrap(element: string, modules?: Function): auto.IInjectorService;
+ /**
+ * Use this function to manually start up angular application.
+ *
+ * @param element DOM element which is the root of angular application.
+ * @param modules An array of modules to load into the application.
+ * Each item in the array should be the name of a predefined module or a (DI annotated)
+ * function that will be invoked by the injector as a run block.
+ */
+ bootstrap(element: string, modules?: string[]): auto.IInjectorService;
+ /**
+ * Use this function to manually start up angular application.
+ *
+ * @param element DOM element which is the root of angular application.
+ * @param modules An array of modules to load into the application.
+ * Each item in the array should be the name of a predefined module or a (DI annotated)
+ * function that will be invoked by the injector as a run block.
+ */
+ bootstrap(element: JQuery, modules?: string): auto.IInjectorService;
+ /**
+ * Use this function to manually start up angular application.
+ *
+ * @param element DOM element which is the root of angular application.
+ * @param modules An array of modules to load into the application.
+ * Each item in the array should be the name of a predefined module or a (DI annotated)
+ * function that will be invoked by the injector as a run block.
+ */
+ bootstrap(element: JQuery, modules?: Function): auto.IInjectorService;
+ /**
+ * Use this function to manually start up angular application.
+ *
+ * @param element DOM element which is the root of angular application.
+ * @param modules An array of modules to load into the application.
+ * Each item in the array should be the name of a predefined module or a (DI annotated)
+ * function that will be invoked by the injector as a run block.
+ */
+ bootstrap(element: JQuery, modules?: string[]): auto.IInjectorService;
+ /**
+ * Use this function to manually start up angular application.
+ *
+ * @param element DOM element which is the root of angular application.
+ * @param modules An array of modules to load into the application.
+ * Each item in the array should be the name of a predefined module or a (DI annotated)
+ * function that will be invoked by the injector as a run block.
+ */
+ bootstrap(element: Element, modules?: string): auto.IInjectorService;
+ /**
+ * Use this function to manually start up angular application.
+ *
+ * @param element DOM element which is the root of angular application.
+ * @param modules An array of modules to load into the application.
+ * Each item in the array should be the name of a predefined module or a (DI annotated)
+ * function that will be invoked by the injector as a run block.
+ */
+ bootstrap(element: Element, modules?: Function): auto.IInjectorService;
+ /**
+ * Use this function to manually start up angular application.
+ *
+ * @param element DOM element which is the root of angular application.
+ * @param modules An array of modules to load into the application.
+ * Each item in the array should be the name of a predefined module or a (DI annotated)
+ * function that will be invoked by the injector as a run block.
+ */
+ bootstrap(element: Element, modules?: string[]): auto.IInjectorService;
+ /**
+ * Use this function to manually start up angular application.
+ *
+ * @param element DOM element which is the root of angular application.
+ * @param modules An array of modules to load into the application.
+ * Each item in the array should be the name of a predefined module or a (DI annotated)
+ * function that will be invoked by the injector as a run block.
+ */
+ bootstrap(element: Document, modules?: string): auto.IInjectorService;
+ /**
+ * Use this function to manually start up angular application.
+ *
+ * @param element DOM element which is the root of angular application.
+ * @param modules An array of modules to load into the application.
+ * Each item in the array should be the name of a predefined module or a (DI annotated)
+ * function that will be invoked by the injector as a run block.
+ */
+ bootstrap(element: Document, modules?: Function): auto.IInjectorService;
+ /**
+ * Use this function to manually start up angular application.
+ *
+ * @param element DOM element which is the root of angular application.
+ * @param modules An array of modules to load into the application.
+ * Each item in the array should be the name of a predefined module or a (DI annotated)
+ * function that will be invoked by the injector as a run block.
+ */
+ bootstrap(element: Document, modules?: string[]): auto.IInjectorService;
+
+ /**
+ * Creates a deep copy of source, which should be an object or an array.
+ *
+ * - If no destination is supplied, a copy of the object or array is created.
+ * - If a destination is provided, all of its elements (for array) or properties (for objects) are deleted and then all elements/properties from the source are copied to it.
+ * - If source is not an object or array (inc. null and undefined), source is returned.
+ * - If source is identical to 'destination' an exception will be thrown.
+ *
+ * @param source The source that will be used to make a copy. Can be any type, including primitives, null, and undefined.
+ * @param destination Destination into which the source is copied. If provided, must be of the same type as source.
+ */
+ copy(source: T, destination?: T): T;
+
+ /**
+ * Wraps a raw DOM element or HTML string as a jQuery element.
+ *
+ * If jQuery is available, angular.element is an alias for the jQuery function. If jQuery is not available, angular.element delegates to Angular's built-in subset of jQuery, called "jQuery lite" or "jqLite."
+ */
element: IAugmentedJQueryStatic;
equals(value1: any, value2: any): boolean;
extend(destination: any, ...sources: any[]): any;
@@ -164,8 +287,20 @@ declare module ng {
* @param controllerConstructor Controller constructor fn (optionally decorated with DI annotations in the array notation).
*/
controller(name: string, inlineAnnotatedConstructor: any[]): IModule;
- controller(object : Object): IModule;
+ controller(object: Object): IModule;
+ /**
+ * Register a new directive with the compiler.
+ *
+ * @param name Name of the directive in camel-case (i.e. ngBind which will match as ng-bind)
+ * @param directiveFactory An injectable directive factory function.
+ */
directive(name: string, directiveFactory: IDirectiveFactory): IModule;
+ /**
+ * Register a new directive with the compiler.
+ *
+ * @param name Name of the directive in camel-case (i.e. ngBind which will match as ng-bind)
+ * @param directiveFactory An injectable directive factory function.
+ */
directive(name: string, inlineAnnotatedFunction: any[]): IModule;
directive(object: Object): IModule;
/**
@@ -245,7 +380,7 @@ declare module ng {
// The observer function will be invoked once during the next $digest
// following compilation. The observer is then invoked whenever the
// interpolated value changes.
- $observe(name: string, fn:(value?:any)=>any): Function;
+ $observe(name: string, fn: (value?: any) => any): Function;
// A map of DOM element attribute names to the normalized name. This is needed
// to do reverse lookup from normalized name back to actual name.
@@ -267,12 +402,16 @@ declare module ng {
$dirty: boolean;
$valid: boolean;
$invalid: boolean;
+ $submitted: boolean;
$error: any;
$addControl(control: ng.INgModelController): void;
$removeControl(control: ng.INgModelController): void;
$setValidity(validationErrorKey: string, isValid: boolean, control: ng.INgModelController): void;
$setDirty(): void;
$setPristine(): void;
+ $commitViewValue(): void;
+ $rollbackViewValue(): void;
+ $setSubmitted(): void;
}
///////////////////////////////////////////////////////////////////////////
@@ -285,6 +424,13 @@ declare module ng {
// Documentation states viewValue and modelValue to be a string but other
// types do work and it's common to use them.
$setViewValue(value: any): void;
+ $validate(): void;
+ $setTouched(): void;
+ $setUntouched(): void;
+ $rollbackViewValue(): void;
+ $commitViewValue(revalidate?: boolean): void;
+ $isEmpty(value: any): boolean;
+
$viewValue: any;
$modelValue: any;
@@ -293,12 +439,24 @@ declare module ng {
$formatters: IModelFormatter[];
$viewChangeListeners: IModelViewChangeListener[];
$error: any;
+ $name: string;
+
+ $touched: boolean;
+ $untouched: boolean;
+
+ $validators: IModelValidators;
+ $asyncValidators: IModelValidators;
+
$pristine: boolean;
$dirty: boolean;
$valid: boolean;
$invalid: boolean;
}
+ interface IModelValidators {
+ [index: string]: (...args: any[]) => boolean;
+ }
+
interface IModelParser {
(value: any): any;
}
@@ -311,11 +469,11 @@ declare module ng {
(): void;
}
- ///////////////////////////////////////////////////////////////////////////
- // Scope
- // see http://docs.angularjs.org/api/ng.$rootScope.Scope
- ///////////////////////////////////////////////////////////////////////////
- interface IScope {
+ /**
+ * $rootScope - $rootScopeProvider - service in module ng
+ * see https://docs.angularjs.org/api/ng/type/$rootScope.Scope and https://docs.angularjs.org/api/ng/service/$rootScope
+ */
+ interface IRootScopeService {
$apply(): any;
$apply(exp: string): any;
$apply(exp: (scope: IScope) => any): any;
@@ -325,17 +483,23 @@ declare module ng {
$digest(): void;
$emit(name: string, ...args: any[]): IAngularEvent;
- // Documentation says exp is optional, but actual implementaton counts on it
- $eval(expression: string, args?: Object): any;
- $eval(expression: (scope: IScope) => any, args?: Object): any;
+ $eval(expression?: string, args?: Object): any;
+ $eval(expression?: (scope: IScope) => any, args?: Object): any;
- // Documentation says exp is optional, but actual implementaton counts on it
- $evalAsync(expression: string): void;
- $evalAsync(expression: (scope: IScope) => any): void;
+ $evalAsync(expression?: string): void;
+ $evalAsync(expression?: (scope: IScope) => any): void;
// Defaults to false by the implementation checking strategy
$new(isolate?: boolean): IScope;
+ /**
+ * Listens on events of a given type. See $emit for discussion of event life cycle.
+ *
+ * The event listener function format is: function(event, args...).
+ *
+ * @param name Event name to listen on.
+ * @param listener Function to call when the event is emitted.
+ */
$on(name: string, listener: (event: IAngularEvent, ...args: any[]) => any): Function;
$watch(watchExpression: string, listener?: string, objectEquality?: boolean): Function;
@@ -347,28 +511,49 @@ declare module ng {
$watchCollection(watchExpression: (scope: IScope) => any, listener: (newValue: any, oldValue: any, scope: IScope) => any): Function;
$watchGroup(watchExpressions: any[], listener: (newValue: any, oldValue: any, scope: IScope) => any): Function;
- $watchGroup(watchExpressions: {(scope: IScope) : any}[], listener: (newValue: any, oldValue: any, scope: IScope) => any): Function;
+ $watchGroup(watchExpressions: { (scope: IScope): any }[], listener: (newValue: any, oldValue: any, scope: IScope) => any): Function;
$parent: IScope;
$root: IRootScopeService;
+ this: IRootScopeService;
- $id: string;
+ $id: number;
// Hidden members
$$isolateBindings: any;
$$phase: any;
}
- interface IAngularEvent {
- targetScope: IScope;
- currentScope: IScope;
- name: string;
- preventDefault: Function;
- defaultPrevented: boolean;
+ interface IScope extends IRootScopeService {
+ [index: string]: any;
+ }
- // Available only events that were $emit-ted
+ interface IAngularEvent {
+ /**
+ * the scope on which the event was $emit-ed or $broadcast-ed.
+ */
+ targetScope: IScope;
+ /**
+ * the scope that is currently handling the event. Once the event propagates through the scope hierarchy, this property is set to null.
+ */
+ currentScope: IScope;
+ /**
+ * name of the event.
+ */
+ name: string;
+ /**
+ * calling stopPropagation function will cancel further event propagation (available only for events that were $emit-ed).
+ */
stopPropagation?: Function;
+ /**
+ * calling preventDefault sets defaultPrevented flag to true.
+ */
+ preventDefault: Function;
+ /**
+ * true if preventDefault was called.
+ */
+ defaultPrevented: boolean;
}
///////////////////////////////////////////////////////////////////////////
@@ -517,25 +702,79 @@ declare module ng {
assign(context: any, value: any): any;
}
- ///////////////////////////////////////////////////////////////////////////
- // LocationService
- // see http://docs.angularjs.org/api/ng.$location
- // see http://docs.angularjs.org/api/ng.$locationProvider
- // see http://docs.angularjs.org/guide/dev_guide.services.$location
- ///////////////////////////////////////////////////////////////////////////
+ /**
+ * $location - $locationProvider - service in module ng
+ * see https://docs.angularjs.org/api/ng/service/$location
+ */
interface ILocationService {
absUrl(): string;
hash(): string;
hash(newHash: string): ILocationService;
host(): string;
+
+ /**
+ * Return path of current url
+ */
path(): string;
- path(newPath: string): ILocationService;
+
+ /**
+ * Change path when called with parameter and return $location.
+ * Note: Path should always begin with forward slash (/), this method will add the forward slash if it is missing.
+ *
+ * @param path New path
+ */
+ path(path: string): ILocationService;
+
port(): number;
protocol(): string;
replace(): ILocationService;
+
+ /**
+ * Return search part (as object) of current url
+ */
search(): any;
- search(parametersMap: any): ILocationService;
- search(parameter: string, parameterValue: any): ILocationService;
+
+ /**
+ * Change search part when called with parameter and return $location.
+ *
+ * @param search When called with a single argument the method acts as a setter, setting the search component of $location to the specified value.
+ *
+ * If the argument is a hash object containing an array of values, these values will be encoded as duplicate search parameters in the url.
+ */
+ search(search: any): ILocationService;
+
+ /**
+ * Change search part when called with parameter and return $location.
+ *
+ * @param search New search params
+ * @param paramValue If search is a string or a Number, then paramValue will override only a single search property. If paramValue is null, the property specified via the first argument will be deleted.
+ */
+ search(search: string, paramValue: string): ILocationService;
+
+ /**
+ * Change search part when called with parameter and return $location.
+ *
+ * @param search New search params
+ * @param paramValue If search is a string or a Number, then paramValue will override only a single search property. If paramValue is null, the property specified via the first argument will be deleted.
+ */
+ search(search: string, paramValue: number): ILocationService;
+
+ /**
+ * Change search part when called with parameter and return $location.
+ *
+ * @param search New search params
+ * @param paramValue If paramValue is an array, it will override the property of the search component of $location specified via the first argument.
+ */
+ search(search: string, paramValue: string[]): ILocationService;
+
+ /**
+ * Change search part when called with parameter and return $location.
+ *
+ * @param search New search params
+ * @param paramValue If paramValue is true, the property specified via the first argument will be added with no value nor trailing equal sign.
+ */
+ search(search: string, paramValue: boolean): ILocationService;
+
url(): string;
url(url: string): ILocationService;
}
@@ -626,22 +865,50 @@ declare module ng {
}
interface IPromise {
+ /**
+ * Regardless of when the promise was or will be resolved or rejected, then calls one of the success or error callbacks asynchronously as soon as the result is available. The callbacks are called with a single argument: the result or rejection reason. Additionally, the notify callback may be called zero or more times to provide a progress indication, before the promise is resolved or rejected.
+ *
+ * This method returns a new promise which is resolved or rejected via the return value of the successCallback, errorCallback. It also notifies via the return value of the notifyCallback method. The promise can not be resolved or rejected from the notifyCallback method.
+ */
then(successCallback: (promiseValue: T) => IHttpPromise, errorCallback?: (reason: any) => any, notifyCallback?: (state: any) => any): IPromise;
+ /**
+ * Regardless of when the promise was or will be resolved or rejected, then calls one of the success or error callbacks asynchronously as soon as the result is available. The callbacks are called with a single argument: the result or rejection reason. Additionally, the notify callback may be called zero or more times to provide a progress indication, before the promise is resolved or rejected.
+ *
+ * This method returns a new promise which is resolved or rejected via the return value of the successCallback, errorCallback. It also notifies via the return value of the notifyCallback method. The promise can not be resolved or rejected from the notifyCallback method.
+ */
then(successCallback: (promiseValue: T) => IPromise, errorCallback?: (reason: any) => any, notifyCallback?: (state: any) => any): IPromise;
+ /**
+ * Regardless of when the promise was or will be resolved or rejected, then calls one of the success or error callbacks asynchronously as soon as the result is available. The callbacks are called with a single argument: the result or rejection reason. Additionally, the notify callback may be called zero or more times to provide a progress indication, before the promise is resolved or rejected.
+ *
+ * This method returns a new promise which is resolved or rejected via the return value of the successCallback, errorCallback. It also notifies via the return value of the notifyCallback method. The promise can not be resolved or rejected from the notifyCallback method.
+ */
then(successCallback: (promiseValue: T) => TResult, errorCallback?: (reason: any) => TResult, notifyCallback?: (state: any) => any): IPromise;
-
+ /**
+ * Shorthand for promise.then(null, errorCallback)
+ */
catch(onRejected: (reason: any) => IHttpPromise): IPromise;
+ /**
+ * Shorthand for promise.then(null, errorCallback)
+ */
catch(onRejected: (reason: any) => IPromise): IPromise;
+ /**
+ * Shorthand for promise.then(null, errorCallback)
+ */
catch(onRejected: (reason: any) => TResult): IPromise;
- finally(finallyCallback: ()=>any):IPromise;
+ /**
+ * Allows you to observe either the fulfillment or rejection of a promise, but to do so without modifying the final value. This is useful to release resources or do some clean-up that needs to be done whether the promise was rejected or resolved. See the full specification for more information.
+ *
+ * Because finally is a reserved word in JavaScript and reserved keywords are not supported as property names by ES3, you'll need to invoke the method like promise['finally'](callback) to make your code IE8 and Android 2.x compatible.
+ */
+ finally(finallyCallback: () => any): IPromise;
}
interface IDeferred {
resolve(value?: T): void;
reject(reason?: any): void;
- notify(state?:any): void;
+ notify(state?: any): void;
promise: IPromise;
}
@@ -670,7 +937,7 @@ declare module ng {
// Methods bellow are not documented
info(): any;
- get (cacheId: string): ICacheObject;
+ get(cacheId: string): ICacheObject;
}
interface ICacheObject {
@@ -682,7 +949,7 @@ declare module ng {
//capacity: number;
};
put(key: string, value?: any): void;
- get (key: string): any;
+ get(key: string): any;
remove(key: string): void;
removeAll(): void;
destroy(): void;
@@ -962,12 +1229,6 @@ declare module ng {
///////////////////////////////////////////////////////////////////////////
interface ITemplateCacheService extends ICacheObject {}
- ///////////////////////////////////////////////////////////////////////////
- // RootScopeService
- // see http://docs.angularjs.org/api/ng.$rootScope
- ///////////////////////////////////////////////////////////////////////////
- interface IRootScopeService extends IScope {}
-
///////////////////////////////////////////////////////////////////////////
// SCEService
// see http://docs.angularjs.org/api/ng.$sce
@@ -1031,22 +1292,34 @@ declare module ng {
(...args: any[]): IDirective;
}
-
- interface IDirective{
- compile?:
- (templateElement: IAugmentedJQuery,
- templateAttributes: IAttributes,
- transclude: ITranscludeFunction
- ) => any;
- controller?: any;
- controllerAs?: string;
- link?:
- (scope: IScope,
+ interface IDirectiveLinkFn {
+ (
+ scope: IScope,
instanceElement: IAugmentedJQuery,
instanceAttributes: IAttributes,
controller: any,
transclude: ITranscludeFunction
- ) => void;
+ ): void;
+ }
+
+ interface IDirectivePrePost {
+ pre?: IDirectiveLinkFn;
+ post?: IDirectiveLinkFn;
+ }
+
+ interface IDirectiveCompileFn {
+ (
+ templateElement: IAugmentedJQuery,
+ templateAttributes: IAttributes,
+ transclude: ITranscludeFunction
+ ): IDirectivePrePost;
+ }
+
+ interface IDirective {
+ compile?: IDirectiveCompileFn;
+ controller?: any;
+ controllerAs?: string;
+ link?: IDirectiveLinkFn;
name?: string;
priority?: number;
replace?: boolean;
@@ -1059,12 +1332,12 @@ declare module ng {
transclude?: any;
}
- ///////////////////////////////////////////////////////////////////////////
- // angular.element
- // when calling angular.element, angular returns a jQuery object,
- // augmented with additional methods like e.g. scope.
- // see: http://docs.angularjs.org/api/angular.element
- ///////////////////////////////////////////////////////////////////////////
+ /**
+ * angular.element
+ * when calling angular.element, angular returns a jQuery object,
+ * augmented with additional methods like e.g. scope.
+ * see: http://docs.angularjs.org/api/angular.element
+ */
interface IAugmentedJQueryStatic extends JQueryStatic {
(selector: string, context?: any): IAugmentedJQuery;
(element: Element): IAugmentedJQuery;
diff --git a/angularjs/legacy/angular-1.0-tests.ts.tscparams b/angularjs/legacy/angular-1.0-tests.ts.tscparams
index e16c76dff..d3f5a12fa 100644
--- a/angularjs/legacy/angular-1.0-tests.ts.tscparams
+++ b/angularjs/legacy/angular-1.0-tests.ts.tscparams
@@ -1 +1 @@
-""
+
diff --git a/angularjs/legacy/angular-1.2-tests.ts b/angularjs/legacy/angular-1.2-tests.ts
new file mode 100644
index 000000000..d0f60609a
--- /dev/null
+++ b/angularjs/legacy/angular-1.2-tests.ts
@@ -0,0 +1,571 @@
+///
+
+// issue: https://github.com/borisyankov/DefinitelyTyped/issues/369
+// https://github.com/witoldsz/angular-http-auth/blob/master/src/angular-http-auth.js
+/**
+ * @license HTTP Auth Interceptor Module for AngularJS
+ * (c) 2012 Witold Szczerba
+ * License: MIT
+ */
+
+class AuthService {
+ /**
+ * Holds all the requests which failed due to 401 response,
+ * so they can be re-requested in future, once login is completed.
+ */
+ buffer: { config: ng.IRequestConfig; deferred: ng.IDeferred; }[] = [];
+
+ /**
+ * Required by HTTP interceptor.
+ * Function is attached to provider to be invisible for regular users of this service.
+ */
+ pushToBuffer = function(config: ng.IRequestConfig, deferred: ng.IDeferred) {
+ this.buffer.push({
+ config: config,
+ deferred: deferred
+ });
+ }
+
+ $get = [
+ '$rootScope', '$injector', function($rootScope: ng.IScope, $injector: ng.auto.IInjectorService) {
+ var $http: ng.IHttpService; //initialized later because of circular dependency problem
+ function retry(config: ng.IRequestConfig, deferred: ng.IDeferred) {
+ $http = $http || $injector.get('$http');
+ $http(config).then(function (response) {
+ deferred.resolve(response);
+ });
+ }
+ function retryAll() {
+ for (var i = 0; i < this.buffer.length; ++i) {
+ retry(this.buffer[i].config, this.buffer[i].deferred);
+ }
+ this.buffer = [];
+ }
+
+ return {
+ loginConfirmed: function () {
+ $rootScope.$broadcast('event:auth-loginConfirmed');
+ retryAll();
+ }
+ }
+ }
+ ];
+}
+
+angular.module('http-auth-interceptor', [])
+
+ .provider('authService', AuthService)
+
+/**
+ * $http interceptor.
+ * On 401 response - it stores the request and broadcasts 'event:angular-auth-loginRequired'.
+ */
+ .config(['$httpProvider', 'authServiceProvider', function ($httpProvider: ng.IHttpProvider, authServiceProvider: any) {
+
+ var interceptor = ['$rootScope', '$q', function ($rootScope: ng.IScope, $q: ng.IQService) {
+ function success(response: ng.IHttpPromiseCallbackArg) {
+ return response;
+ }
+
+ function error(response: ng.IHttpPromiseCallbackArg) {
+ if (response.status === 401) {
+ var deferred = $q.defer();
+ authServiceProvider.pushToBuffer(response.config, deferred);
+ $rootScope.$broadcast('event:auth-loginRequired');
+ return deferred.promise;
+ }
+ // otherwise
+ return $q.reject(response);
+ }
+
+ return function (promise: ng.IHttpPromise) {
+ return promise.then(success, error);
+ }
+
+ }];
+ $httpProvider.responseInterceptors.push(interceptor);
+ }]);
+
+
+module HttpAndRegularPromiseTests {
+ interface Person {
+ firstName: string;
+ lastName: string;
+ }
+
+ interface ExpectedResponse extends Person { }
+
+ interface SomeControllerScope extends ng.IScope {
+ person: Person;
+ theAnswer: number;
+ letters: string[];
+ snack: string;
+ nothing?: string;
+ }
+
+ var someController: Function = ($scope: SomeControllerScope, $http: ng.IHttpService, $q: ng.IQService) => {
+ $http.get("http://somewhere/some/resource")
+ .success((data: ExpectedResponse) => {
+ $scope.person = data;
+ });
+
+ $http.get("http://somewhere/some/resource")
+ .then((response: ng.IHttpPromiseCallbackArg) => {
+ // typing lost, so something like
+ // var i: number = response.data
+ // would type check
+ $scope.person = response.data;
+ });
+
+ $http.get("http://somewhere/some/resource")
+ .then((response: ng.IHttpPromiseCallbackArg) => {
+ // typing lost, so something like
+ // var i: number = response.data
+ // would NOT type check
+ $scope.person = response.data;
+ });
+
+ var aPromise: ng.IPromise = $q.when({ firstName: "Jack", lastName: "Sparrow" });
+ aPromise.then((person: Person) => {
+ $scope.person = person;
+ });
+
+ var bPromise: ng.IPromise = $q.when(42);
+ bPromise.then((answer: number) => {
+ $scope.theAnswer = answer;
+ });
+
+ var cPromise: ng.IPromise = $q.when(["a", "b", "c"]);
+ cPromise.then((letters: string[]) => {
+ $scope.letters = letters;
+ });
+
+ // When $q.when is passed an IPromise, it returns an IPromise
+ var dPromise: ng.IPromise = $q.when($q.when("ALBATROSS!"));
+ dPromise.then((snack: string) => {
+ $scope.snack = snack;
+ });
+
+ // $q.when may be called without arguments
+ var ePromise: ng.IPromise = $q.when();
+ ePromise.then(() => {
+ $scope.nothing = "really nothing";
+ });
+ }
+
+ // Test that we can pass around a type-checked success/error Promise Callback
+ var anotherController: Function = ($scope: SomeControllerScope, $http:
+ ng.IHttpService, $q: ng.IQService) => {
+
+ var buildFooData: Function = () => 42;
+
+ var doFoo: Function = (callback: ng.IHttpPromiseCallback) => {
+ $http.get('/foo', buildFooData())
+ .success(callback);
+ }
+
+ doFoo((data: any) => console.log(data));
+ }
+}
+
+// Test for AngularJS Syntax
+
+module My.Namespace {
+ export var x: any; // need to export something for module to kick in
+}
+
+// IModule Registering Test
+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', ['$scope', function ($scope: ng.IScope) { }])
+mod.directive(My.Namespace);
+mod.factory('name', function ($scope: ng.IScope) { })
+mod.factory('name', ['$scope', function ($scope: ng.IScope) { }])
+mod.factory(My.Namespace);
+mod.filter('name', function ($scope: ng.IScope) { })
+mod.filter('name', ['$scope', function ($scope: ng.IScope) { }])
+mod.filter(My.Namespace);
+mod.provider('name', function ($scope: ng.IScope) { return { $get: () => { } } })
+mod.provider('name', TestProvider);
+mod.provider('name', ['$scope', function ($scope: ng.IScope) { }])
+mod.provider(My.Namespace);
+mod.service('name', function ($scope: ng.IScope) { })
+mod.service('name', ['$scope', function ($scope: ng.IScope) { }])
+mod.service(My.Namespace);
+mod.constant('name', 23);
+mod.constant('name', "23");
+mod.constant(My.Namespace);
+mod.value('name', 23);
+mod.value('name', "23");
+mod.value(My.Namespace);
+
+class TestProvider implements ng.IServiceProvider {
+ constructor(private $scope: ng.IScope) {
+ }
+
+ $get() {
+ }
+}
+
+// Promise signature tests
+var foo: ng.IPromise;
+foo.then((x) => {
+ // x is inferred to be a number
+ return "asdf";
+}).then((x) => {
+ // x is inferred to be string
+ x.length;
+ return 123;
+}).then((x) => {
+ // x is infered to be a number
+ x.toFixed();
+ return;
+}).then((x) => {
+ // x is infered to be void
+ // Typescript will prevent you to actually use x as a local variable
+ // Try object:
+ return { a: 123 };
+}).then((x) => {
+ // Object is inferred here
+ x.a = 123;
+ //Try a promise
+ var y: ng.IPromise;
+ return y;
+}).then((x) => {
+ // x is infered to be a number, which is the resolved value of a promise
+ x.toFixed();
+});
+
+
+var httpFoo: ng.IHttpPromise;
+httpFoo.then((x) => {
+ // When returning a promise the generic type must be inferred.
+ var innerPromise : ng.IPromise;
+ return innerPromise;
+}).then((x) => {
+ // must still be number.
+ x.toFixed();
+});
+
+
+function test_angular_forEach() {
+ var values: { [key: string]: string } = { name: 'misko', gender: 'male' };
+ var log: string[] = [];
+ angular.forEach(values, function (value, key) {
+ this.push(key + ': ' + value);
+ }, log);
+ //expect(log).toEqual(['name: misko', 'gender: male']);
+}
+
+// angular.element() tests
+var element = angular.element("div.myApp");
+var scope: ng.IScope = element.scope();
+var isolateScope: ng.IScope = element.isolateScope();
+
+
+
+function test_IAttributes(attributes: ng.IAttributes){
+ return attributes;
+}
+
+test_IAttributes({
+ $addClass: function (classVal){},
+ $removeClass: function(classVal){},
+ $set: function(key, value){},
+ $observe: function(name, fn){
+ return fn;
+ },
+ $attr: {}
+});
+
+class SampleDirective implements ng.IDirective {
+ public restrict = 'A';
+ name = 'doh';
+
+ compile(templateElement: ng.IAugmentedJQuery) {
+ return {
+ post: this.link
+ };
+ }
+
+ static instance():ng.IDirective {
+ return new SampleDirective();
+ }
+
+ link(scope: ng.IScope) {
+
+ }
+}
+
+class SampleDirective2 implements ng.IDirective {
+ public restrict = 'EAC';
+
+ compile(templateElement: ng.IAugmentedJQuery) {
+ return {
+ pre: this.link
+ };
+ }
+
+ static instance():ng.IDirective {
+ return new SampleDirective2();
+ }
+
+ link(scope: ng.IScope) {
+
+ }
+}
+
+angular.module('SameplDirective', []).directive('sampleDirective', SampleDirective.instance).directive('sameplDirective2', SampleDirective2.instance);
+
+// test from https://docs.angularjs.org/guide/directive
+angular.module('docsSimpleDirective', [])
+ .controller('Controller', ['$scope', function($scope: any) {
+ $scope.customer = {
+ name: 'Naomi',
+ address: '1600 Amphitheatre'
+ };
+ }])
+ .directive('myCustomer', function() {
+ return {
+ template: 'Name: {{customer.name}} Address: {{customer.address}}'
+ };
+ });
+
+angular.module('docsTemplateUrlDirective', [])
+ .controller('Controller', ['$scope', function($scope: any) {
+ $scope.customer = {
+ name: 'Naomi',
+ address: '1600 Amphitheatre'
+ };
+ }])
+ .directive('myCustomer', function() {
+ return {
+ templateUrl: 'my-customer.html'
+ };
+ });
+
+angular.module('docsRestrictDirective', [])
+ .controller('Controller', ['$scope', function($scope: any) {
+ $scope.customer = {
+ name: 'Naomi',
+ address: '1600 Amphitheatre'
+ };
+ }])
+ .directive('myCustomer', function() {
+ return {
+ restrict: 'E',
+ templateUrl: 'my-customer.html'
+ };
+ });
+
+angular.module('docsScopeProblemExample', [])
+ .controller('NaomiController', ['$scope', function($scope: any) {
+ $scope.customer = {
+ name: 'Naomi',
+ address: '1600 Amphitheatre'
+ };
+ }])
+ .controller('IgorController', ['$scope', function($scope: any) {
+ $scope.customer = {
+ name: 'Igor',
+ address: '123 Somewhere'
+ };
+ }])
+ .directive('myCustomer', function() {
+ return {
+ restrict: 'E',
+ templateUrl: 'my-customer.html'
+ };
+ });
+
+angular.module('docsIsolateScopeDirective', [])
+ .controller('Controller', ['$scope', function($scope: any) {
+ $scope.naomi = { name: 'Naomi', address: '1600 Amphitheatre' };
+ $scope.igor = { name: 'Igor', address: '123 Somewhere' };
+ }])
+ .directive('myCustomer', function() {
+ return {
+ restrict: 'E',
+ scope: {
+ customerInfo: '=info'
+ },
+ templateUrl: 'my-customer-iso.html'
+ };
+ });
+
+angular.module('docsIsolationExample', [])
+ .controller('Controller', ['$scope', function($scope: any) {
+ $scope.naomi = { name: 'Naomi', address: '1600 Amphitheatre' };
+ $scope.vojta = { name: 'Vojta', address: '3456 Somewhere Else' };
+ }])
+ .directive('myCustomer', function() {
+ return {
+ restrict: 'E',
+ scope: {
+ customerInfo: '=info'
+ },
+ templateUrl: 'my-customer-plus-vojta.html'
+ };
+ });
+
+angular.module('docsTimeDirective', [])
+ .controller('Controller', ['$scope', function($scope: any) {
+ $scope.format = 'M/d/yy h:mm:ss a';
+ }])
+ .directive('myCurrentTime', ['$interval', 'dateFilter', function($interval: any, dateFilter: any) {
+
+ return {
+ link: function(scope: ng.IScope, element: ng.IAugmentedJQuery, attrs:ng.IAttributes) {
+ var format: any,
+ timeoutId: any;
+
+ function updateTime() {
+ element.text(dateFilter(new Date(), format));
+ }
+
+ scope.$watch(attrs['myCurrentTime'], function (value: any) {
+ format = value;
+ updateTime();
+ });
+
+ element.on('$destroy', function () {
+ $interval.cancel(timeoutId);
+ });
+
+ // start the UI update process; save the timeoutId for canceling
+ timeoutId = $interval(function () {
+ updateTime(); // update DOM
+ }, 1000);
+ }
+ };
+ }]);
+
+angular.module('docsTransclusionDirective', [])
+ .controller('Controller', ['$scope', function($scope: any) {
+ $scope.name = 'Tobias';
+ }])
+ .directive('myDialog', function() {
+ return {
+ restrict: 'E',
+ transclude: true,
+ templateUrl: 'my-dialog.html'
+ };
+ });
+
+angular.module('docsTransclusionExample', [])
+ .controller('Controller', ['$scope', function($scope: any) {
+ $scope.name = 'Tobias';
+ }])
+ .directive('myDialog', function() {
+ return {
+ restrict: 'E',
+ transclude: true,
+ scope: {},
+ templateUrl: 'my-dialog.html',
+ link: function (scope: ng.IScope, element: ng.IAugmentedJQuery) {
+ scope['name'] = 'Jeff';
+ }
+ };
+ });
+
+angular.module('docsIsoFnBindExample', [])
+ .controller('Controller', ['$scope', '$timeout', function($scope: any, $timeout: any) {
+ $scope.name = 'Tobias';
+ $scope.hideDialog = function () {
+ $scope.dialogIsHidden = true;
+ $timeout(function () {
+ $scope.dialogIsHidden = false;
+ }, 2000);
+ };
+ }])
+ .directive('myDialog', function() {
+ return {
+ restrict: 'E',
+ transclude: true,
+ scope: {
+ 'close': '&onClose'
+ },
+ templateUrl: 'my-dialog-close.html'
+ };
+ });
+
+angular.module('dragModule', [])
+ .directive('myDraggable', ['$document', function($document: any) {
+ return function(scope: any, element: any, attr: any) {
+ var startX = 0, startY = 0, x = 0, y = 0;
+
+ element.css({
+ position: 'relative',
+ border: '1px solid red',
+ backgroundColor: 'lightgrey',
+ cursor: 'pointer'
+ });
+
+ element.on('mousedown', function(event: any) {
+ // Prevent default dragging of selected content
+ event.preventDefault();
+ startX = event.pageX - x;
+ startY = event.pageY - y;
+ $document.on('mousemove', mousemove);
+ $document.on('mouseup', mouseup);
+ });
+
+ function mousemove(event: any) {
+ y = event.pageY - startY;
+ x = event.pageX - startX;
+ element.css({
+ top: y + 'px',
+ left: x + 'px'
+ });
+ }
+
+ function mouseup() {
+ $document.off('mousemove', mousemove);
+ $document.off('mouseup', mouseup);
+ }
+ };
+ }]);
+
+angular.module('docsTabsExample', [])
+ .directive('myTabs', function() {
+ return {
+ restrict: 'E',
+ transclude: true,
+ scope: {},
+ controller: function($scope: ng.IScope) {
+ var panes: any = $scope['panes'] = [];
+
+ $scope['select'] = function(pane: any) {
+ angular.forEach(panes, function(pane: any) {
+ pane.selected = false;
+ });
+ pane.selected = true;
+ };
+
+ this.addPane = function(pane: any) {
+ if (panes.length === 0) {
+ $scope['select'](pane);
+ }
+ panes.push(pane);
+ };
+ },
+ templateUrl: 'my-tabs.html'
+ };
+ })
+ .directive('myPane', function() {
+ return {
+ require: '^myTabs',
+ restrict: 'E',
+ transclude: true,
+ scope: {
+ title: '@'
+ },
+ link: function(scope: ng.IScope, element: ng.IAugmentedJQuery, attrs: ng.IAttributes, tabsCtrl: any) {
+ tabsCtrl.addPane(scope);
+ },
+ templateUrl: 'my-pane.html'
+ };
+ });
diff --git a/angularjs/legacy/angular-1.2.d.ts b/angularjs/legacy/angular-1.2.d.ts
new file mode 100644
index 000000000..a1a4cb15b
--- /dev/null
+++ b/angularjs/legacy/angular-1.2.d.ts
@@ -0,0 +1,1182 @@
+// Type definitions for Angular JS 1.2+
+// Project: http://angularjs.org
+// Definitions by: Diego Vilar
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+
+///
+
+declare var angular: ng.IAngularStatic;
+
+// Support for painless dependency injection
+interface Function {
+ $inject?: string[];
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// ng module (angular.js)
+///////////////////////////////////////////////////////////////////////////////
+declare module ng {
+
+ // not directly implemented, but ensures that constructed class implements $get
+ interface IServiceProviderClass {
+ new(...args: any[]): IServiceProvider;
+ }
+
+ interface IServiceProviderFactory {
+ (...args: any[]): IServiceProvider;
+ }
+
+ // All service providers extend this interface
+ interface IServiceProvider {
+ $get: any;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // AngularStatic
+ // see http://docs.angularjs.org/api
+ ///////////////////////////////////////////////////////////////////////////
+ interface IAngularStatic {
+ bind(context: any, fn: Function, ...args: any[]): Function;
+ bootstrap(element: string, modules?: any[]): auto.IInjectorService;
+ bootstrap(element: JQuery, modules?: any[]): auto.IInjectorService;
+ bootstrap(element: Element, modules?: any[]): auto.IInjectorService;
+ bootstrap(element: Document, modules?: any[]): auto.IInjectorService;
+ copy(source: any, destination?: any): any;
+ element: IAugmentedJQueryStatic;
+ equals(value1: any, value2: any): boolean;
+ extend(destination: any, ...sources: any[]): any;
+
+ /**
+ * Invokes the iterator function once for each item in obj collection, which can be either an object or an array. The iterator function is invoked with iterator(value, key), where value is the value of an object property or an array element and key is the object property key or array element index. Specifying a context for the function is optional.
+ *
+ * It is worth noting that .forEach does not iterate over inherited properties because it filters using the hasOwnProperty method.
+ *
+ * @param obj Object to iterate over.
+ * @param iterator Iterator function.
+ * @param context Object to become context (this) for the iterator function.
+ */
+ forEach(obj: T[], iterator: (value: T, key: number) => any, context?: any): any;
+ /**
+ * Invokes the iterator function once for each item in obj collection, which can be either an object or an array. The iterator function is invoked with iterator(value, key), where value is the value of an object property or an array element and key is the object property key or array element index. Specifying a context for the function is optional.
+ *
+ * It is worth noting that .forEach does not iterate over inherited properties because it filters using the hasOwnProperty method.
+ *
+ * @param obj Object to iterate over.
+ * @param iterator Iterator function.
+ * @param context Object to become context (this) for the iterator function.
+ */
+ forEach(obj: { [index: string]: T; }, iterator: (value: T, key: string) => any, context?: any): any;
+ /**
+ * Invokes the iterator function once for each item in obj collection, which can be either an object or an array. The iterator function is invoked with iterator(value, key), where value is the value of an object property or an array element and key is the object property key or array element index. Specifying a context for the function is optional.
+ *
+ * It is worth noting that .forEach does not iterate over inherited properties because it filters using the hasOwnProperty method.
+ *
+ * @param obj Object to iterate over.
+ * @param iterator Iterator function.
+ * @param context Object to become context (this) for the iterator function.
+ */
+ forEach(obj: any, iterator: (value: any, key: any) => any, context?: any): any;
+
+ fromJson(json: string): any;
+ identity(arg?: any): any;
+ injector(modules?: any[]): auto.IInjectorService;
+ isArray(value: any): boolean;
+ isDate(value: any): boolean;
+ isDefined(value: any): boolean;
+ isElement(value: any): boolean;
+ isFunction(value: any): boolean;
+ isNumber(value: any): boolean;
+ isObject(value: any): boolean;
+ isString(value: any): boolean;
+ isUndefined(value: any): boolean;
+ lowercase(str: string): string;
+
+ /**
+ * The angular.module is a global place for creating, registering and retrieving Angular modules. All modules (angular core or 3rd party) that should be available to an application must be registered using this mechanism.
+ *
+ * When passed two or more arguments, a new module is created. If passed only one argument, an existing module (the name passed as the first argument to module) is retrieved.
+ *
+ * @param name The name of the module to create or retrieve.
+ * @param requires The names of modules this module depends on. If specified then new module is being created. If unspecified then the module is being retrieved for further configuration.
+ * @param configFn Optional configuration function for the module.
+ */
+ module(
+ name: string,
+ requires?: string[],
+ configFn?: Function): IModule;
+
+ noop(...args: any[]): void;
+ toJson(obj: any, pretty?: boolean): string;
+ uppercase(str: string): string;
+ version: {
+ full: string;
+ major: number;
+ minor: number;
+ dot: number;
+ codename: string;
+ };
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Module
+ // see http://docs.angularjs.org/api/angular.Module
+ ///////////////////////////////////////////////////////////////////////////
+ interface IModule {
+ animation(name: string, animationFactory: Function): IModule;
+ animation(name: string, inlineAnnotatedFunction: any[]): IModule;
+ animation(object: Object): IModule;
+ /**
+ * Use this method to register work which needs to be performed on module loading.
+ *
+ * @param configFn Execute this function on module load. Useful for service configuration.
+ */
+ config(configFn: Function): IModule;
+ /**
+ * Use this method to register work which needs to be performed on module loading.
+ *
+ * @param inlineAnnotatedFunction Execute this function on module load. Useful for service configuration.
+ */
+ config(inlineAnnotatedFunction: any[]): IModule;
+ /**
+ * Register a constant service, such as a string, a number, an array, an object or a function, with the $injector. Unlike value it can be injected into a module configuration function (see config) and it cannot be overridden by an Angular decorator.
+ *
+ * @param name The name of the constant.
+ * @param value The constant value.
+ */
+ constant(name: string, value: any): IModule;
+ constant(object: Object): IModule;
+ /**
+ * The $controller service is used by Angular to create new controllers.
+ *
+ * This provider allows controller registration via the register method.
+ *
+ * @param name Controller name, or an object map of controllers where the keys are the names and the values are the constructors.
+ * @param controllerConstructor Controller constructor fn (optionally decorated with DI annotations in the array notation).
+ */
+ controller(name: string, controllerConstructor: Function): IModule;
+ /**
+ * The $controller service is used by Angular to create new controllers.
+ *
+ * This provider allows controller registration via the register method.
+ *
+ * @param name Controller name, or an object map of controllers where the keys are the names and the values are the constructors.
+ * @param controllerConstructor Controller constructor fn (optionally decorated with DI annotations in the array notation).
+ */
+ controller(name: string, inlineAnnotatedConstructor: any[]): IModule;
+ controller(object : Object): IModule;
+ directive(name: string, directiveFactory: IDirectiveFactory): IModule;
+ directive(name: string, inlineAnnotatedFunction: any[]): IModule;
+ directive(object: Object): IModule;
+ /**
+ * Register a service factory, which will be called to return the service instance. This is short for registering a service where its provider consists of only a $get property, which is the given service factory function. You should use $provide.factory(getFn) if you do not need to configure your service in a provider.
+ *
+ * @param name The name of the instance.
+ * @param $getFn The $getFn for the instance creation. Internally this is a short hand for $provide.provider(name, {$get: $getFn}).
+ */
+ factory(name: string, $getFn: Function): IModule;
+ /**
+ * Register a service factory, which will be called to return the service instance. This is short for registering a service where its provider consists of only a $get property, which is the given service factory function. You should use $provide.factory(getFn) if you do not need to configure your service in a provider.
+ *
+ * @param name The name of the instance.
+ * @param inlineAnnotatedFunction The $getFn for the instance creation. Internally this is a short hand for $provide.provider(name, {$get: $getFn}).
+ */
+ factory(name: string, inlineAnnotatedFunction: any[]): IModule;
+ factory(object: Object): IModule;
+ filter(name: string, filterFactoryFunction: Function): IModule;
+ filter(name: string, inlineAnnotatedFunction: any[]): IModule;
+ filter(object: Object): IModule;
+ provider(name: string, serviceProviderFactory: IServiceProviderFactory): IModule;
+ provider(name: string, serviceProviderConstructor: IServiceProviderClass): IModule;
+ provider(name: string, inlineAnnotatedConstructor: any[]): IModule;
+ provider(name: string, providerObject: IServiceProvider): IModule;
+ provider(object: Object): IModule;
+ /**
+ * Run blocks are the closest thing in Angular to the main method. A run block is the code which needs to run to kickstart the application. It is executed after all of the service have been configured and the injector has been created. Run blocks typically contain code which is hard to unit-test, and for this reason should be declared in isolated modules, so that they can be ignored in the unit-tests.
+ */
+ run(initializationFunction: Function): IModule;
+ /**
+ * Run blocks are the closest thing in Angular to the main method. A run block is the code which needs to run to kickstart the application. It is executed after all of the service have been configured and the injector has been created. Run blocks typically contain code which is hard to unit-test, and for this reason should be declared in isolated modules, so that they can be ignored in the unit-tests.
+ */
+ run(inlineAnnotatedFunction: any[]): IModule;
+ service(name: string, serviceConstructor: Function): IModule;
+ service(name: string, inlineAnnotatedConstructor: any[]): IModule;
+ service(object: Object): IModule;
+ /**
+ * Register a value service with the $injector, such as a string, a number, an array, an object or a function. This is short for registering a service where its provider's $get property is a factory function that takes no arguments and returns the value service.
+
+ Value services are similar to constant services, except that they cannot be injected into a module configuration function (see config) but they can be overridden by an Angular decorator.
+ *
+ * @param name The name of the instance.
+ * @param value The value.
+ */
+ value(name: string, value: any): IModule;
+ value(object: Object): IModule;
+
+ // Properties
+ name: string;
+ requires: string[];
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Attributes
+ // see http://docs.angularjs.org/api/ng.$compile.directive.Attributes
+ ///////////////////////////////////////////////////////////////////////////
+ interface IAttributes {
+ // this is necessary to be able to access the scoped attributes. it's not very elegant
+ // because you have to use attrs['foo'] instead of attrs.foo but I don't know of a better way
+ // this should really be limited to return string but it creates this problem: http://stackoverflow.com/q/17201854/165656
+ [name: string]: any;
+
+ // Adds the CSS class value specified by the classVal parameter to the
+ // element. If animations are enabled then an animation will be triggered
+ // for the class addition.
+ $addClass(classVal: string): void;
+
+ // Removes the CSS class value specified by the classVal parameter from the
+ // element. If animations are enabled then an animation will be triggered for
+ // the class removal.
+ $removeClass(classVal: string): void;
+
+ // Set DOM element attribute value.
+ $set(key: string, value: any): void;
+
+ // Observes an interpolated attribute.
+ // The observer function will be invoked once during the next $digest
+ // following compilation. The observer is then invoked whenever the
+ // interpolated value changes.
+ $observe(name: string, fn:(value?:any)=>any): Function;
+
+ // A map of DOM element attribute names to the normalized name. This is needed
+ // to do reverse lookup from normalized name back to actual name.
+ $attr: Object;
+ }
+
+ /**
+ * form.FormController - type in module ng
+ * see https://docs.angularjs.org/api/ng/type/form.FormController
+ */
+ interface IFormController {
+
+ /**
+ * Indexer which should return ng.INgModelController for most properties but cannot because of "All named properties must be assignable to string indexer type" constraint - see https://github.com/Microsoft/TypeScript/issues/272
+ */
+ [name: string]: any;
+
+ $pristine: boolean;
+ $dirty: boolean;
+ $valid: boolean;
+ $invalid: boolean;
+ $error: any;
+ $addControl(control: ng.INgModelController): void;
+ $removeControl(control: ng.INgModelController): void;
+ $setValidity(validationErrorKey: string, isValid: boolean, control: ng.INgModelController): void;
+ $setDirty(): void;
+ $setPristine(): void;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // NgModelController
+ // see http://docs.angularjs.org/api/ng.directive:ngModel.NgModelController
+ ///////////////////////////////////////////////////////////////////////////
+ interface INgModelController {
+ $render(): void;
+ $setValidity(validationErrorKey: string, isValid: boolean): void;
+ // Documentation states viewValue and modelValue to be a string but other
+ // types do work and it's common to use them.
+ $setViewValue(value: any): void;
+ $viewValue: any;
+
+ $modelValue: any;
+
+ $parsers: IModelParser[];
+ $formatters: IModelFormatter[];
+ $viewChangeListeners: IModelViewChangeListener[];
+ $error: any;
+ $pristine: boolean;
+ $dirty: boolean;
+ $valid: boolean;
+ $invalid: boolean;
+ }
+
+ interface IModelParser {
+ (value: any): any;
+ }
+
+ interface IModelFormatter {
+ (value: any): any;
+ }
+
+ interface IModelViewChangeListener {
+ (): void;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Scope and RootScope
+ // see https://docs.angularjs.org/api/ng/type/$rootScope.Scope and http://docs.angularjs.org/api/ng.$rootScope
+ ///////////////////////////////////////////////////////////////////////////
+ interface IRootScopeService {
+ $apply(): any;
+ $apply(exp: string): any;
+ $apply(exp: (scope: IScope) => any): any;
+
+ $broadcast(name: string, ...args: any[]): IAngularEvent;
+ $destroy(): void;
+ $digest(): void;
+ $emit(name: string, ...args: any[]): IAngularEvent;
+
+ // Documentation says exp is optional, but actual implementaton counts on it
+ $eval(expression: string, args?: Object): any;
+ $eval(expression: (scope: IScope) => any, args?: Object): any;
+
+ // Documentation says exp is optional, but actual implementaton counts on it
+ $evalAsync(expression: string): void;
+ $evalAsync(expression: (scope: IScope) => any): void;
+
+ // Defaults to false by the implementation checking strategy
+ $new(isolate?: boolean): IScope;
+
+ $on(name: string, listener: (event: IAngularEvent, ...args: any[]) => any): Function;
+
+ $watch(watchExpression: string, listener?: string, objectEquality?: boolean): Function;
+ $watch(watchExpression: string, listener?: (newValue: any, oldValue: any, scope: IScope) => any, objectEquality?: boolean): Function;
+ $watch(watchExpression: (scope: IScope) => any, listener?: string, objectEquality?: boolean): Function;
+ $watch(watchExpression: (scope: IScope) => any, listener?: (newValue: any, oldValue: any, scope: IScope) => any, objectEquality?: boolean): Function;
+
+ $watchCollection(watchExpression: string, listener: (newValue: any, oldValue: any, scope: IScope) => any): Function;
+ $watchCollection(watchExpression: (scope: IScope) => any, listener: (newValue: any, oldValue: any, scope: IScope) => any): Function;
+
+ $watchGroup(watchExpressions: any[], listener: (newValue: any, oldValue: any, scope: IScope) => any): Function;
+ $watchGroup(watchExpressions: {(scope: IScope) : any}[], listener: (newValue: any, oldValue: any, scope: IScope) => any): Function;
+
+ $parent: IScope;
+
+ $root: IRootScopeService;
+ this: IRootScopeService;
+
+ $id: string;
+
+ // Hidden members
+ $$isolateBindings: any;
+ $$phase: any;
+ }
+
+ interface IScope extends IRootScopeService {
+ [index: string]: any;
+ }
+
+ interface IAngularEvent {
+ targetScope: IScope;
+ currentScope: IScope;
+ name: string;
+ preventDefault: Function;
+ defaultPrevented: boolean;
+
+ // Available only events that were $emit-ted
+ stopPropagation?: Function;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // WindowService
+ // see http://docs.angularjs.org/api/ng.$window
+ ///////////////////////////////////////////////////////////////////////////
+ interface IWindowService extends Window {
+ [key: string]: any;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // BrowserService
+ // TODO undocumented, so we need to get it from the source code
+ ///////////////////////////////////////////////////////////////////////////
+ interface IBrowserService {
+ [key: string]: any;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // TimeoutService
+ // see http://docs.angularjs.org/api/ng.$timeout
+ ///////////////////////////////////////////////////////////////////////////
+ interface ITimeoutService {
+ (func: Function, delay?: number, invokeApply?: boolean): IPromise;
+ cancel(promise: IPromise): boolean;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // IntervalService
+ // see http://docs.angularjs.org/api/ng.$interval
+ ///////////////////////////////////////////////////////////////////////////
+ interface IIntervalService {
+ (func: Function, delay: number, count?: number, invokeApply?: boolean): IPromise;
+ cancel(promise: IPromise): boolean;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // FilterService
+ // see http://docs.angularjs.org/api/ng.$filter
+ // see http://docs.angularjs.org/api/ng.$filterProvider
+ ///////////////////////////////////////////////////////////////////////////
+ interface IFilterService {
+ (name: string): Function;
+ }
+
+ interface IFilterProvider extends IServiceProvider {
+ register(name: string, filterFactory: Function): IServiceProvider;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // LocaleService
+ // see http://docs.angularjs.org/api/ng.$locale
+ ///////////////////////////////////////////////////////////////////////////
+ interface ILocaleService {
+ id: string;
+
+ // These are not documented
+ // Check angular's i18n files for exemples
+ NUMBER_FORMATS: ILocaleNumberFormatDescriptor;
+ DATETIME_FORMATS: ILocaleDateTimeFormatDescriptor;
+ pluralCat: (num: any) => string;
+ }
+
+ interface ILocaleNumberFormatDescriptor {
+ DECIMAL_SEP: string;
+ GROUP_SEP: string;
+ PATTERNS: ILocaleNumberPatternDescriptor[];
+ CURRENCY_SYM: string;
+ }
+
+ interface ILocaleNumberPatternDescriptor {
+ minInt: number;
+ minFrac: number;
+ maxFrac: number;
+ posPre: string;
+ posSuf: string;
+ negPre: string;
+ negSuf: string;
+ gSize: number;
+ lgSize: number;
+ }
+
+ interface ILocaleDateTimeFormatDescriptor {
+ MONTH: string[];
+ SHORTMONTH: string[];
+ DAY: string[];
+ SHORTDAY: string[];
+ AMPMS: string[];
+ medium: string;
+ short: string;
+ fullDate: string;
+ longDate: string;
+ mediumDate: string;
+ shortDate: string;
+ mediumTime: string;
+ shortTime: string;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // LogService
+ // see http://docs.angularjs.org/api/ng.$log
+ // see http://docs.angularjs.org/api/ng.$logProvider
+ ///////////////////////////////////////////////////////////////////////////
+ interface ILogService {
+ debug: ILogCall;
+ error: ILogCall;
+ info: ILogCall;
+ log: ILogCall;
+ warn: ILogCall;
+ }
+
+ interface ILogProvider {
+ debugEnabled(enabled: boolean): ILogProvider;
+ debugEnabled(): boolean;
+ }
+
+ // We define this as separete interface so we can reopen it later for
+ // the ngMock module.
+ interface ILogCall {
+ (...args: any[]): void;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // ParseService
+ // see http://docs.angularjs.org/api/ng.$parse
+ // see http://docs.angularjs.org/api/ng.$parseProvider
+ ///////////////////////////////////////////////////////////////////////////
+ interface IParseService {
+ (expression: string): ICompiledExpression;
+ }
+
+ interface IParseProvider {
+ logPromiseWarnings(): boolean;
+ logPromiseWarnings(value: boolean): IParseProvider;
+
+ unwrapPromises(): boolean;
+ unwrapPromises(value: boolean): IParseProvider;
+ }
+
+ interface ICompiledExpression {
+ (context: any, locals?: any): any;
+
+ // If value is not provided, undefined is gonna be used since the implementation
+ // does not check the parameter. Let's force a value for consistency. If consumer
+ // whants to undefine it, pass the undefined value explicitly.
+ assign(context: any, value: any): any;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // LocationService
+ // see http://docs.angularjs.org/api/ng.$location
+ // see http://docs.angularjs.org/api/ng.$locationProvider
+ // see http://docs.angularjs.org/guide/dev_guide.services.$location
+ ///////////////////////////////////////////////////////////////////////////
+ interface ILocationService {
+ absUrl(): string;
+ hash(): string;
+ hash(newHash: string): ILocationService;
+ host(): string;
+ path(): string;
+ path(newPath: string): ILocationService;
+ port(): number;
+ protocol(): string;
+ replace(): ILocationService;
+ search(): any;
+ search(parametersMap: any): ILocationService;
+ search(parameter: string, parameterValue: any): ILocationService;
+ url(): string;
+ url(url: string): ILocationService;
+ }
+
+ interface ILocationProvider extends IServiceProvider {
+ hashPrefix(): string;
+ hashPrefix(prefix: string): ILocationProvider;
+ html5Mode(): boolean;
+
+ // Documentation states that parameter is string, but
+ // implementation tests it as boolean, which makes more sense
+ // since this is a toggler
+ html5Mode(active: boolean): ILocationProvider;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // DocumentService
+ // see http://docs.angularjs.org/api/ng.$document
+ ///////////////////////////////////////////////////////////////////////////
+ interface IDocumentService extends IAugmentedJQuery {}
+
+ ///////////////////////////////////////////////////////////////////////////
+ // ExceptionHandlerService
+ // see http://docs.angularjs.org/api/ng.$exceptionHandler
+ ///////////////////////////////////////////////////////////////////////////
+ interface IExceptionHandlerService {
+ (exception: Error, cause?: string): void;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // RootElementService
+ // see http://docs.angularjs.org/api/ng.$rootElement
+ ///////////////////////////////////////////////////////////////////////////
+ interface IRootElementService extends JQuery {}
+
+ /**
+ * $q - service in module ng
+ * A promise/deferred implementation inspired by Kris Kowal's Q.
+ * See http://docs.angularjs.org/api/ng/service/$q
+ */
+ interface IQService {
+ /**
+ * Combines multiple promises into a single promise that is resolved when all of the input promises are resolved.
+ *
+ * Returns a single promise that will be resolved with an array/hash of values, each value corresponding to the promise at the same index/key in the promises array/hash. If any of the promises is resolved with a rejection, this resulting promise will be rejected with the same rejection value.
+ *
+ * @param promises An array or hash of promises.
+ */
+ all(promises: IPromise[]): IPromise;
+ /**
+ * Combines multiple promises into a single promise that is resolved when all of the input promises are resolved.
+ *
+ * Returns a single promise that will be resolved with an array/hash of values, each value corresponding to the promise at the same index/key in the promises array/hash. If any of the promises is resolved with a rejection, this resulting promise will be rejected with the same rejection value.
+ *
+ * @param promises An array or hash of promises.
+ */
+ all(promises: { [id: string]: IPromise; }): IPromise<{ [id: string]: any }>;
+ /**
+ * Creates a Deferred object which represents a task which will finish in the future.
+ */
+ defer(): IDeferred;
+ /**
+ * Creates a promise that is resolved as rejected with the specified reason. This api should be used to forward rejection in a chain of promises. If you are dealing with the last promise in a promise chain, you don't need to worry about it.
+ *
+ * When comparing deferreds/promises to the familiar behavior of try/catch/throw, think of reject as the throw keyword in JavaScript. This also means that if you "catch" an error via a promise error callback and you want to forward the error to the promise derived from the current promise, you have to "rethrow" the error by returning a rejection constructed via reject.
+ *
+ * @param reason Constant, message, exception or an object representing the rejection reason.
+ */
+ reject(reason?: any): IPromise;
+ /**
+ * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted.
+ *
+ * @param value Value or a promise
+ */
+ when(value: IPromise): IPromise;
+ /**
+ * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted.
+ *
+ * @param value Value or a promise
+ */
+ when(value: T): IPromise;
+ /**
+ * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted.
+ *
+ * @param value Value or a promise
+ */
+ when(): IPromise;
+ }
+
+ interface IPromise {
+ then(successCallback: (promiseValue: T) => IHttpPromise, errorCallback?: (reason: any) => any, notifyCallback?: (state: any) => any): IPromise;
+ then(successCallback: (promiseValue: T) => IPromise, errorCallback?: (reason: any) => any, notifyCallback?: (state: any) => any): IPromise;
+ then(successCallback: (promiseValue: T) => TResult, errorCallback?: (reason: any) => TResult, notifyCallback?: (state: any) => any): IPromise;
+
+
+ catch(onRejected: (reason: any) => IHttpPromise): IPromise;
+ catch(onRejected: (reason: any) => IPromise): IPromise;
+ catch(onRejected: (reason: any) => TResult): IPromise;
+
+ finally(finallyCallback: ()=>any):IPromise;
+ }
+
+ interface IDeferred {
+ resolve(value?: T): void;
+ reject(reason?: any): void;
+ notify(state?:any): void;
+ promise: IPromise;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // AnchorScrollService
+ // see http://docs.angularjs.org/api/ng.$anchorScroll
+ ///////////////////////////////////////////////////////////////////////////
+ interface IAnchorScrollService {
+ (): void;
+ }
+
+ interface IAnchorScrollProvider extends IServiceProvider {
+ disableAutoScrolling(): void;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // CacheFactoryService
+ // see http://docs.angularjs.org/api/ng.$cacheFactory
+ ///////////////////////////////////////////////////////////////////////////
+ interface ICacheFactoryService {
+ // Lets not foce the optionsMap to have the capacity member. Even though
+ // it's the ONLY option considered by the implementation today, a consumer
+ // might find it useful to associate some other options to the cache object.
+ //(cacheId: string, optionsMap?: { capacity: number; }): CacheObject;
+ (cacheId: string, optionsMap?: { capacity: number; }): ICacheObject;
+
+ // Methods bellow are not documented
+ info(): any;
+ get (cacheId: string): ICacheObject;
+ }
+
+ interface ICacheObject {
+ info(): {
+ id: string;
+ size: number;
+
+ // Not garanteed to have, since it's a non-mandatory option
+ //capacity: number;
+ };
+ put(key: string, value?: any): void;
+ get (key: string): any;
+ remove(key: string): void;
+ removeAll(): void;
+ destroy(): void;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // CompileService
+ // see http://docs.angularjs.org/api/ng.$compile
+ // see http://docs.angularjs.org/api/ng.$compileProvider
+ ///////////////////////////////////////////////////////////////////////////
+ interface ICompileService {
+ (element: string, transclude?: ITranscludeFunction, maxPriority?: number): ITemplateLinkingFunction;
+ (element: Element, transclude?: ITranscludeFunction, maxPriority?: number): ITemplateLinkingFunction;
+ (element: JQuery, transclude?: ITranscludeFunction, maxPriority?: number): ITemplateLinkingFunction;
+ }
+
+ interface ICompileProvider extends IServiceProvider {
+ directive(name: string, directiveFactory: Function): ICompileProvider;
+
+ // Undocumented, but it is there...
+ directive(directivesMap: any): ICompileProvider;
+
+ aHrefSanitizationWhitelist(): RegExp;
+ aHrefSanitizationWhitelist(regexp: RegExp): ICompileProvider;
+
+ imgSrcSanitizationWhitelist(): RegExp;
+ imgSrcSanitizationWhitelist(regexp: RegExp): ICompileProvider;
+ }
+
+ interface ICloneAttachFunction {
+ // Let's hint but not force cloneAttachFn's signature
+ (clonedElement?: JQuery, scope?: IScope): any;
+ }
+
+ // This corresponds to the "publicLinkFn" returned by $compile.
+ interface ITemplateLinkingFunction {
+ (scope: IScope, cloneAttachFn?: ICloneAttachFunction): IAugmentedJQuery;
+ }
+
+ // This corresponds to $transclude (and also the transclude function passed to link).
+ interface ITranscludeFunction {
+ // If the scope is provided, then the cloneAttachFn must be as well.
+ (scope: IScope, cloneAttachFn: ICloneAttachFunction): IAugmentedJQuery;
+ // If one argument is provided, then it's assumed to be the cloneAttachFn.
+ (cloneAttachFn?: ICloneAttachFunction): IAugmentedJQuery;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // ControllerService
+ // see http://docs.angularjs.org/api/ng.$controller
+ // see http://docs.angularjs.org/api/ng.$controllerProvider
+ ///////////////////////////////////////////////////////////////////////////
+ interface IControllerService {
+ // Although the documentation doesn't state this, locals are optional
+ (controllerConstructor: Function, locals?: any): any;
+ (controllerName: string, locals?: any): any;
+ }
+
+ interface IControllerProvider extends IServiceProvider {
+ register(name: string, controllerConstructor: Function): void;
+ register(name: string, dependencyAnnotatedConstructor: any[]): void;
+ }
+
+ /**
+ * HttpService
+ * see http://docs.angularjs.org/api/ng/service/$http
+ */
+ interface IHttpService {
+ /**
+ * Object describing the request to be made and how it should be processed.
+ */
+ (config: IRequestConfig): IHttpPromise;
+
+ /**
+ * Shortcut method to perform GET request.
+ *
+ * @param url Relative or absolute URL specifying the destination of the request
+ * @param config Optional configuration object
+ */
+ get(url: string, config?: IRequestShortcutConfig): IHttpPromise;
+
+ /**
+ * Shortcut method to perform DELETE request.
+ *
+ * @param url Relative or absolute URL specifying the destination of the request
+ * @param config Optional configuration object
+ */
+ delete(url: string, config?: IRequestShortcutConfig): IHttpPromise;
+
+ /**
+ * Shortcut method to perform HEAD request.
+ *
+ * @param url Relative or absolute URL specifying the destination of the request
+ * @param config Optional configuration object
+ */
+ head(url: string, config?: IRequestShortcutConfig): IHttpPromise;
+
+ /**
+ * Shortcut method to perform JSONP request.
+ *
+ * @param url Relative or absolute URL specifying the destination of the request
+ * @param config Optional configuration object
+ */
+ jsonp(url: string, config?: IRequestShortcutConfig): IHttpPromise;
+
+ /**
+ * Shortcut method to perform POST request.
+ *
+ * @param url Relative or absolute URL specifying the destination of the request
+ * @param data Request content
+ * @param config Optional configuration object
+ */
+ post(url: string, data: any, config?: IRequestShortcutConfig): IHttpPromise;
+
+ /**
+ * Shortcut method to perform PUT request.
+ *
+ * @param url Relative or absolute URL specifying the destination of the request
+ * @param data Request content
+ * @param config Optional configuration object
+ */
+ put(url: string, data: any, config?: IRequestShortcutConfig): IHttpPromise;
+
+ /**
+ * Runtime equivalent of the $httpProvider.defaults property. Allows configuration of default headers, withCredentials as well as request and response transformations.
+ */
+ defaults: IRequestConfig;
+
+ /**
+ * Array of config objects for currently pending requests. This is primarily meant to be used for debugging purposes.
+ */
+ pendingRequests: any[];
+ }
+
+ /**
+ * Object describing the request to be made and how it should be processed.
+ * see http://docs.angularjs.org/api/ng/service/$http#usage
+ */
+ interface IRequestShortcutConfig {
+ /**
+ * {Object.}
+ * Map of strings or objects which will be turned to ?key1=value1&key2=value2 after the url. If the value is not a string, it will be JSONified.
+ */
+ params?: any;
+
+ /**
+ * Map of strings or functions which return strings representing HTTP headers to send to the server. If the return value of a function is null, the header will not be sent.
+ */
+ headers?: any;
+
+ /**
+ * Name of HTTP header to populate with the XSRF token.
+ */
+ xsrfHeaderName?: string;
+
+ /**
+ * Name of cookie containing the XSRF token.
+ */
+ xsrfCookieName?: string;
+
+ /**
+ * {boolean|Cache}
+ * If true, a default $http cache will be used to cache the GET request, otherwise if a cache instance built with $cacheFactory, this cache will be used for caching.
+ */
+ cache?: any;
+
+ /**
+ * whether to to set the withCredentials flag on the XHR object. See [requests with credentials]https://developer.mozilla.org/en/http_access_control#section_5 for more information.
+ */
+ withCredentials?: boolean;
+
+ /**
+ * {string|Object}
+ * Data to be sent as the request message data.
+ */
+ data?: any;
+
+ /**
+ * {function(data, headersGetter)|Array.}
+ * Transform function or an array of such functions. The transform function takes the http request body and headers and returns its transformed (typically serialized) version.
+ */
+ transformRequest?: any;
+
+ /**
+ * {function(data, headersGetter)|Array.}
+ * Transform function or an array of such functions. The transform function takes the http response body and headers and returns its transformed (typically deserialized) version.
+ */
+ transformResponse?: any;
+
+ /**
+ * {number|Promise}
+ * Timeout in milliseconds, or promise that should abort the request when resolved.
+ */
+ timeout?: any;
+
+ /**
+ * See requestType.
+ */
+ responseType?: string;
+ }
+
+ /**
+ * Object describing the request to be made and how it should be processed.
+ * see http://docs.angularjs.org/api/ng/service/$http#usage
+ */
+ interface IRequestConfig extends IRequestShortcutConfig {
+ /**
+ * HTTP method (e.g. 'GET', 'POST', etc)
+ */
+ method: string;
+ /**
+ * Absolute or relative URL of the resource that is being requested.
+ */
+ url: string;
+ }
+
+ interface IHttpPromiseCallback {
+ (data: T, status: number, headers: (headerName: string) => string, config: IRequestConfig): void;
+ }
+
+ interface IHttpPromiseCallbackArg {
+ data?: T;
+ status?: number;
+ headers?: (headerName: string) => string;
+ config?: IRequestConfig;
+ statusText?: string;
+ }
+
+ interface IHttpPromise extends IPromise {
+ success(callback: IHttpPromiseCallback): IHttpPromise;
+ error(callback: IHttpPromiseCallback): IHttpPromise;
+ then(successCallback: (response: IHttpPromiseCallbackArg) => IPromise, errorCallback?: (response: IHttpPromiseCallbackArg) => any): IPromise;
+ then(successCallback: (response: IHttpPromiseCallbackArg) => TResult, errorCallback?: (response: IHttpPromiseCallbackArg) => any): IPromise;
+ }
+
+ interface IHttpProvider extends IServiceProvider {
+ defaults: IRequestConfig;
+ interceptors: any[];
+ responseInterceptors: any[];
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // HttpBackendService
+ // see http://docs.angularjs.org/api/ng.$httpBackend
+ // You should never need to use this service directly.
+ ///////////////////////////////////////////////////////////////////////////
+ interface IHttpBackendService {
+ // XXX Perhaps define callback signature in the future
+ (method: string, url: string, post?: any, callback?: Function, headers?: any, timeout?: number, withCredentials?: boolean): void;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // InterpolateService
+ // see http://docs.angularjs.org/api/ng.$interpolate
+ // see http://docs.angularjs.org/api/ng.$interpolateProvider
+ ///////////////////////////////////////////////////////////////////////////
+ interface IInterpolateService {
+ (text: string, mustHaveExpression?: boolean): IInterpolationFunction;
+ endSymbol(): string;
+ startSymbol(): string;
+ }
+
+ interface IInterpolationFunction {
+ (context: any): string;
+ }
+
+ interface IInterpolateProvider extends IServiceProvider {
+ startSymbol(): string;
+ startSymbol(value: string): IInterpolateProvider;
+ endSymbol(): string;
+ endSymbol(value: string): IInterpolateProvider;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // TemplateCacheService
+ // see http://docs.angularjs.org/api/ng.$templateCache
+ ///////////////////////////////////////////////////////////////////////////
+ interface ITemplateCacheService extends ICacheObject {}
+
+ ///////////////////////////////////////////////////////////////////////////
+ // SCEService
+ // see http://docs.angularjs.org/api/ng.$sce
+ ///////////////////////////////////////////////////////////////////////////
+ interface ISCEService {
+ getTrusted(type: string, mayBeTrusted: any): any;
+ getTrustedCss(value: any): any;
+ getTrustedHtml(value: any): any;
+ getTrustedJs(value: any): any;
+ getTrustedResourceUrl(value: any): any;
+ getTrustedUrl(value: any): any;
+ parse(type: string, expression: string): (context: any, locals: any) => any;
+ parseAsCss(expression: string): (context: any, locals: any) => any;
+ parseAsHtml(expression: string): (context: any, locals: any) => any;
+ parseAsJs(expression: string): (context: any, locals: any) => any;
+ parseAsResourceUrl(expression: string): (context: any, locals: any) => any;
+ parseAsUrl(expression: string): (context: any, locals: any) => any;
+ trustAs(type: string, value: any): any;
+ trustAsHtml(value: any): any;
+ trustAsJs(value: any): any;
+ trustAsResourceUrl(value: any): any;
+ trustAsUrl(value: any): any;
+ isEnabled(): boolean;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // SCEProvider
+ // see http://docs.angularjs.org/api/ng.$sceProvider
+ ///////////////////////////////////////////////////////////////////////////
+ interface ISCEProvider extends IServiceProvider {
+ enabled(value: boolean): void;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // SCEDelegateService
+ // see http://docs.angularjs.org/api/ng.$sceDelegate
+ ///////////////////////////////////////////////////////////////////////////
+ interface ISCEDelegateService {
+ getTrusted(type: string, mayBeTrusted: any): any;
+ trustAs(type: string, value: any): any;
+ valueOf(value: any): any;
+ }
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ // SCEDelegateProvider
+ // see http://docs.angularjs.org/api/ng.$sceDelegateProvider
+ ///////////////////////////////////////////////////////////////////////////
+ interface ISCEDelegateProvider extends IServiceProvider {
+ resourceUrlBlacklist(blacklist: any[]): void;
+ resourceUrlWhitelist(whitelist: any[]): void;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Directive
+ // see http://docs.angularjs.org/api/ng.$compileProvider#directive
+ // and http://docs.angularjs.org/guide/directive
+ ///////////////////////////////////////////////////////////////////////////
+
+ interface IDirectiveFactory {
+ (...args: any[]): IDirective;
+ }
+
+ interface IDirectiveLinkFn {
+ (
+ scope: IScope,
+ instanceElement: IAugmentedJQuery,
+ instanceAttributes: IAttributes,
+ controller: any,
+ transclude: ITranscludeFunction
+ ): void;
+ }
+
+ interface IDirectivePrePost {
+ pre?: IDirectiveLinkFn;
+ post?: IDirectiveLinkFn;
+ }
+
+ interface IDirectiveCompileFn {
+ (
+ templateElement: IAugmentedJQuery,
+ templateAttributes: IAttributes,
+ transclude: ITranscludeFunction
+ ): IDirectivePrePost;
+ }
+
+ interface IDirective {
+ compile?: IDirectiveCompileFn;
+ controller?: any;
+ controllerAs?: string;
+ link?: IDirectiveLinkFn;
+ name?: string;
+ priority?: number;
+ replace?: boolean;
+ require?: any;
+ restrict?: string;
+ scope?: any;
+ template?: any;
+ templateUrl?: any;
+ terminal?: boolean;
+ transclude?: any;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // angular.element
+ // when calling angular.element, angular returns a jQuery object,
+ // augmented with additional methods like e.g. scope.
+ // see: http://docs.angularjs.org/api/angular.element
+ ///////////////////////////////////////////////////////////////////////////
+ interface IAugmentedJQueryStatic extends JQueryStatic {
+ (selector: string, context?: any): IAugmentedJQuery;
+ (element: Element): IAugmentedJQuery;
+ (object: {}): IAugmentedJQuery;
+ (elementArray: Element[]): IAugmentedJQuery;
+ (object: JQuery): IAugmentedJQuery;
+ (func: Function): IAugmentedJQuery;
+ (array: any[]): IAugmentedJQuery;
+ (): IAugmentedJQuery;
+ }
+
+ interface IAugmentedJQuery extends JQuery {
+ // TODO: events, how to define?
+ //$destroy
+
+ find(selector: string): IAugmentedJQuery;
+ find(element: any): IAugmentedJQuery;
+ find(obj: JQuery): IAugmentedJQuery;
+
+ controller(name: string): any;
+ injector(): any;
+ scope(): IScope;
+ isolateScope(): IScope;
+
+ inheritedData(key: string, value: any): JQuery;
+ inheritedData(obj: { [key: string]: any; }): JQuery;
+ inheritedData(key?: string): any;
+ }
+
+ ///////////////////////////////////////////////////////////////////////
+ // AnimateService
+ // see http://docs.angularjs.org/api/ng.$animate
+ ///////////////////////////////////////////////////////////////////////
+ interface IAnimateService {
+ addClass(element: JQuery, className: string, done?: Function): void;
+ enter(element: JQuery, parent: JQuery, after: JQuery, done?: Function): void;
+ leave(element: JQuery, done?: Function): void;
+ move(element: JQuery, parent: JQuery, after: JQuery, done?: Function): void;
+ removeClass(element: JQuery, className: string, done?: Function): void;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // AUTO module (angular.js)
+ ///////////////////////////////////////////////////////////////////////////
+ export module auto {
+
+ ///////////////////////////////////////////////////////////////////////
+ // InjectorService
+ // see http://docs.angularjs.org/api/AUTO.$injector
+ ///////////////////////////////////////////////////////////////////////
+ interface IInjectorService {
+ annotate(fn: Function): string[];
+ annotate(inlineAnnotatedFunction: any[]): string[];
+ get(name: string): any;
+ has(name: string): boolean;
+ instantiate(typeConstructor: Function, locals?: any): any;
+ invoke(inlineAnnotatedFunction: any[]): any;
+ invoke(func: Function, context?: any, locals?: any): any;
+ }
+
+ ///////////////////////////////////////////////////////////////////////
+ // ProvideService
+ // see http://docs.angularjs.org/api/AUTO.$provide
+ ///////////////////////////////////////////////////////////////////////
+ interface IProvideService {
+ // Documentation says it returns the registered instance, but actual
+ // implementation does not return anything.
+ // constant(name: string, value: any): any;
+ /**
+ * Register a constant service, such as a string, a number, an array, an object or a function, with the $injector. Unlike value it can be injected into a module configuration function (see config) and it cannot be overridden by an Angular decorator.
+ *
+ * @param name The name of the constant.
+ * @param value The constant value.
+ */
+ constant(name: string, value: any): void;
+
+ /**
+ * Register a service decorator with the $injector. A service decorator intercepts the creation of a service, allowing it to override or modify the behaviour of the service. The object returned by the decorator may be the original service, or a new service object which replaces or wraps and delegates to the original service.
+ *
+ * @param name The name of the service to decorate.
+ * @param decorator This function will be invoked when the service needs to be instantiated and should return the decorated service instance. The function is called using the injector.invoke method and is therefore fully injectable. Local injection arguments:
+ *
+ * $delegate - The original service instance, which can be monkey patched, configured, decorated or delegated to.
+ */
+ decorator(name: string, decorator: Function): void;
+ /**
+ * Register a service decorator with the $injector. A service decorator intercepts the creation of a service, allowing it to override or modify the behaviour of the service. The object returned by the decorator may be the original service, or a new service object which replaces or wraps and delegates to the original service.
+ *
+ * @param name The name of the service to decorate.
+ * @param inlineAnnotatedFunction This function will be invoked when the service needs to be instantiated and should return the decorated service instance. The function is called using the injector.invoke method and is therefore fully injectable. Local injection arguments:
+ *
+ * $delegate - The original service instance, which can be monkey patched, configured, decorated or delegated to.
+ */
+ decorator(name: string, inlineAnnotatedFunction: any[]): void;
+ factory(name: string, serviceFactoryFunction: Function): ng.IServiceProvider;
+ factory(name: string, inlineAnnotatedFunction: any[]): ng.IServiceProvider;
+ provider(name: string, provider: ng.IServiceProvider): ng.IServiceProvider;
+ provider(name: string, serviceProviderConstructor: Function): ng.IServiceProvider;
+ service(name: string, constructor: Function): ng.IServiceProvider;
+ value(name: string, value: any): ng.IServiceProvider;
+ }
+
+ }
+}
diff --git a/angularjs/legacy/angular-scenario-1.0.d.ts.tscparams b/angularjs/legacy/angular-scenario-1.0.d.ts.tscparams
index e16c76dff..d3f5a12fa 100644
--- a/angularjs/legacy/angular-scenario-1.0.d.ts.tscparams
+++ b/angularjs/legacy/angular-scenario-1.0.d.ts.tscparams
@@ -1 +1 @@
-""
+
diff --git a/asciify/asciify.ts.tscparams b/asciify/asciify.ts.tscparams
index 64dbb84a5..d68b297cb 100644
--- a/asciify/asciify.ts.tscparams
+++ b/asciify/asciify.ts.tscparams
@@ -1 +1 @@
-"--noImplicitAny --module commonjs"
\ No newline at end of file
+--noImplicitAny --module commonjs
diff --git a/async/async-tests.ts b/async/async-tests.ts
index 9b0c8e7ee..9a563276a 100644
--- a/async/async-tests.ts
+++ b/async/async-tests.ts
@@ -26,10 +26,11 @@ async.map(data, asyncProcess, function (err, results) {
var openFiles = ['file1', 'file2'];
var saveFile = function () { }
-async.forEach(openFiles, saveFile, function (err) { });
+async.each(openFiles, saveFile, function (err) { });
+async.eachSeries(openFiles, saveFile, function (err) { });
var documents, requestApi;
-async.forEachLimit(documents, 20, requestApi, function (err) { });
+async.eachLimit(documents, 20, requestApi, function (err) { });
async.map(['file1', 'file2', 'file3'], fs.stat, function (err, results) { });
diff --git a/async/async-tests.ts.tscparams b/async/async-tests.ts.tscparams
index e16c76dff..d3f5a12fa 100644
--- a/async/async-tests.ts.tscparams
+++ b/async/async-tests.ts.tscparams
@@ -1 +1 @@
-""
+
diff --git a/async/async.d.ts b/async/async.d.ts
index d1d592629..994ed1799 100644
--- a/async/async.d.ts
+++ b/async/async.d.ts
@@ -34,9 +34,9 @@ interface AsyncQueue {
interface Async {
// Collections
- 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;
+ each(arr: T[], iterator: AsyncIterator, callback: AsyncMultipleResultsCallback): void;
+ eachSeries(arr: T[], iterator: AsyncIterator, callback: AsyncMultipleResultsCallback): void;
+ eachLimit(arr: T[], limit: number, iterator: AsyncIterator, callback: AsyncMultipleResultsCallback): void;
map(arr: T[], iterator: AsyncIterator, callback: AsyncMultipleResultsCallback): any;
mapSeries(arr: T[], iterator: AsyncIterator, callback: AsyncMultipleResultsCallback): any;
filter(arr: T[], iterator: AsyncIterator, callback: AsyncMultipleResultsCallback): any;
diff --git a/atom/atom-tests.ts.tscparams b/atom/atom-tests.ts.tscparams
index 5f84b9777..6331805a5 100644
--- a/atom/atom-tests.ts.tscparams
+++ b/atom/atom-tests.ts.tscparams
@@ -1 +1 @@
---noImplicitAny --module commonjs --target es5
+--noImplicitAny --module commonjs --target es5
diff --git a/atom/atom.d.ts b/atom/atom.d.ts
index 00f55ef02..96b7c849d 100644
--- a/atom/atom.d.ts
+++ b/atom/atom.d.ts
@@ -497,6 +497,35 @@ declare module AtomCore {
screenRangeChanged():any;
}
+ interface IDecorationParams {
+ id?: number;
+ class: string;
+ type: any /* string or string[] */;
+ }
+
+ interface IDecorationStatic {
+ isType(decorationParams:IDecorationParams, type:any /* string or string[] */):boolean;
+ new (marker:IDisplayBufferMarker, displayBuffer:IDisplayBuffer, params: IDecorationParams): IDecoration;
+ }
+
+ interface IDecoration extends Emissary.IEmitter {
+ marker: IDisplayBufferMarker;
+ displayBuffer: IDisplayBuffer;
+ params: IDecorationParams
+ id: number;
+ flashQueue: any[];
+ isDestroyed: boolean;
+
+ destroy():void;
+ update(newParams:IDecorationParams):void;
+ getMarker():IDisplayBufferMarker;
+ getParams():IDecorationParams;
+ isType(type:string):boolean;
+ matchesPattern(decorationPattern:{[key:string]:IDecorationParams;}):boolean;
+ flash(klass:string, duration?:number):void;
+ consumeNextFlash():any;
+ }
+
interface IEditor {
// Serializable.includeInto(Editor);
// Delegator.includeInto(Editor);
@@ -509,6 +538,8 @@ declare module AtomCore {
cursors:ICursor[];
selections: ISelection[];
suppressSelectionMerging:boolean;
+ updateBatchDepth: number;
+ selectionFlashDuration: number;
softTabs: boolean;
displayBuffer: IDisplayBuffer;
@@ -522,6 +553,8 @@ declare module AtomCore {
subscriptionsByObject: any; /* WeakMap */
subscriptions: Emissary.ISubscription[];
+ mini: any;
+
serializeParams():{id:number; softTabs:boolean; scrollTop:number; scrollLeft:number; displayBuffer:any;};
deserializeParams(params:any):any;
subscribeToBuffer():void;
@@ -532,10 +565,7 @@ declare module AtomCore {
getTitle():string;
getLongTitle():string;
setVisible(visible:boolean):void;
- setScrollTop(scrollTop:any):void;
- getScrollTop():number;
- setScrollLeft(scrollLeft:any):void;
- getScrollLeft():number;
+ setMini(mini:any):void;
setEditorWidthInChars(editorWidthInChars:any):void;
getSoftWrapColumn():number;
getSoftTabs():boolean;
@@ -545,6 +575,7 @@ declare module AtomCore {
getTabText():string;
getTabLength():number;
setTabLength(tabLength:any):void;
+ usesSoftTabs():boolean;
clipBufferPosition(bufferPosition:any):void;
clipBufferRange(range:any):void;
indentationForBufferRow(bufferRow:any):void;
@@ -553,6 +584,7 @@ declare module AtomCore {
buildIndentString(number:any):string;
save():void;
saveAs(filePath:any):void;
+ copyPathToClipboard():void;
getPath():string;
getText():string;
setText(text:any):void;
@@ -572,6 +604,7 @@ declare module AtomCore {
scanInBufferRange():any;
backwardsScanInBufferRange():any;
isModified():boolean;
+ isEmpty():boolean;
shouldPromptToSave():boolean;
screenPositionForBufferPosition(bufferPosition:any, options?:any):TextBuffer.IPoint;
bufferPositionForScreenPosition(screenPosition:any, options?:any):TextBuffer.IPoint;
@@ -589,15 +622,19 @@ declare module AtomCore {
bufferRangeForScopeAtCursor(selector:string):any;
tokenForBufferPosition(bufferPosition:any):IToken;
getCursorScopes():string[];
+ logCursorScope():void;
insertText(text:string, options?:any):TextBuffer.IRange[];
insertNewline():TextBuffer.IRange[];
insertNewlineBelow():TextBuffer.IRange[];
insertNewlineAbove():any;
indent(options?:any):any;
backspace():any[];
- backspaceToBeginningOfWord():any[];
- backspaceToBeginningOfLine():any[];
+ // deprecated backspaceToBeginningOfWord():any[];
+ // deprecated backspaceToBeginningOfLine():any[];
+ deleteToBeginningOfWord():any[];
+ deleteToBeginningOfLine():any[];
delete():any[];
+ deleteToEndOfLine():any[];
deleteToEndOfWord():any[];
deleteLine():TextBuffer.IRange[];
indentSelectedRows():TextBuffer.IRange[][];
@@ -620,6 +657,7 @@ declare module AtomCore {
foldBufferRow(bufferRow:any):any;
unfoldBufferRow(bufferRow:any):any;
isFoldableAtBufferRow(bufferRow:any):boolean;
+ isFoldableAtScreenRow(screenRow:any):boolean;
createFold(startRow:any, endRow:any):IFold;
destroyFoldWithId(id:any):any;
destroyFoldsIntersectingBufferRange(bufferRange:any):any;
@@ -633,9 +671,12 @@ declare module AtomCore {
moveLineUp():ISelection[];
moveLineDown():ISelection[];
duplicateLines():any[][];
- duplicateLine():any[][];
+ // duprecated duplicateLine():any[][];
mutateSelectedText(fn:(selection:ISelection)=>any):any;
replaceSelectedText(options:any, fn:(selection:string)=>any):any;
+ decorationsForScreenRowRange(startScreenRow:any, endScreenRow:any):{[id:number]: IDecoration[]};
+ decorateMarker(marker:IDisplayBufferMarker, decorationParams: {type:string; class: string;}):IDecoration;
+ decorationForId(id:number):IDecoration;
getMarker(id:number):IDisplayBufferMarker;
getMarkers():IDisplayBufferMarker[];
findMarkers(...args:any[]):IDisplayBufferMarker[];
@@ -659,6 +700,7 @@ declare module AtomCore {
removeSelection(selection:ISelection):any;
clearSelections():boolean;
consolidateSelections():boolean;
+ selectionScreenRangeChanged(selection:any):void;
getSelections():ISelection[];
getSelection(index?:number):ISelection;
getLastSelection():ISelection;
@@ -694,7 +736,16 @@ declare module AtomCore {
moveCursorToBeginningOfNextWord():void;
moveCursorToPreviousWordBoundary():void;
moveCursorToNextWordBoundary():void;
+ moveCursorToBeginningOfNextParagraph():void;
+ moveCursorToBeginningOfPreviousParagraph():void;
+ scrollToCursorPosition(options:any):any;
+ pageUp():void;
+ pageDown():void;
+ selectPageUp():void;
+ selectPageDown():void;
+ getRowsPerPage():number;
moveCursors(fn:(cursor:ICursor)=>any):any;
+ cursorMoved(event:any):void;
selectToScreenPosition(position:TextBuffer.IPoint):any;
selectRight():ISelection[];
selectLeft():ISelection[];
@@ -720,6 +771,8 @@ declare module AtomCore {
selectToEndOfWord():ISelection[];
selectToBeginningOfNextWord():ISelection[];
selectWord():ISelection[];
+ selectToBeginningOfNextParagraph():ISelection[];
+ selectToBeginningOfPreviousParagraph():ISelection[];
selectMarker(marker:any):any;
mergeCursors():number[];
expandSelectionsForward():any;
@@ -731,16 +784,63 @@ declare module AtomCore {
setGrammar(grammer:IGrammar):void;
reloadGrammar():any;
shouldAutoIndent():boolean;
+ shouldShowInvisibles():boolean;
+ updateInvisibles():void;
transact(fn:Function):any;
beginTransaction():ITransaction;
commitTransaction():any;
abortTransaction():any[];
inspect():string;
logScreenLines(start:number, end:number):any[];
+ handleTokenization():void;
handleGrammarChange():void;
handleMarkerCreated(marker:any):any;
getSelectionMarkerAttributes():{type: string; editorId: number; invalidate: string; };
- // joinLine():any; // deprecated
+ getVerticalScrollMargin():number;
+ setVerticalScrollMargin(verticalScrollMargin:number):void;
+ getHorizontalScrollMargin():number;
+ setHorizontalScrollMargin(horizontalScrollMargin:number):void;
+ getLineHeightInPixels():number;
+ setLineHeightInPixels(lineHeightInPixels:number):void;
+ batchCharacterMeasurement(fn:Function):void;
+ getScopedCharWidth(scopeNames:any, char:any):any;
+ setScopedCharWidth(scopeNames:any, char:any, width:any):any;
+ getScopedCharWidths(scopeNames:any):any;
+ clearScopedCharWidths():any;
+ getDefaultCharWidth():number;
+ setDefaultCharWidth(defaultCharWidth:number):void;
+ setHeight(height:number):void;
+ getHeight():number;
+ getClientHeight():number;
+ setWidth(width:number):void;
+ getWidth():number;
+ getScrollTop():number;
+ setScrollTop(scrollTop:number):void;
+ getScrollBottom():number;
+ setScrollBottom(scrollBottom:number):void;
+ getScrollLeft():number;
+ setScrollLeft(scrollLeft:number):void;
+ getScrollRight():number;
+ setScrollRight(scrollRight:number):void;
+ getScrollHeight():number;
+ getScrollWidth():number;
+ getVisibleRowRange():number;
+ intersectsVisibleRowRange(startRow:any, endRow:any):any;
+ selectionIntersectsVisibleRowRange(selection:any):any;
+ pixelPositionForScreenPosition(screenPosition:any):any;
+ pixelPositionForBufferPosition(bufferPosition:any):any;
+ screenPositionForPixelPosition(pixelPosition:any):any;
+ pixelRectForScreenRange(screenRange:any):any;
+ scrollToScreenRange(screenRange:any, options:any):any;
+ scrollToScreenPosition(screenPosition:any, options:any):any;
+ scrollToBufferPosition(bufferPosition:any, options:any):any;
+ horizontallyScrollable():any;
+ verticallyScrollable():any;
+ getHorizontalScrollbarHeight():any;
+ setHorizontalScrollbarHeight(height:any):any;
+ getVerticalScrollbarWidth():any;
+ setVerticalScrollbarWidth(width:any):any;
+ // deprecated joinLine():any;
}
interface IGrammar {
diff --git a/azure-mobile-services-client/AzureMobileServicesClient-tests.ts.tscparams b/azure-mobile-services-client/AzureMobileServicesClient-tests.ts.tscparams
index e16c76dff..d3f5a12fa 100644
--- a/azure-mobile-services-client/AzureMobileServicesClient-tests.ts.tscparams
+++ b/azure-mobile-services-client/AzureMobileServicesClient-tests.ts.tscparams
@@ -1 +1 @@
-""
+
diff --git a/backbone-relational/backbone-relational-tests.ts.tscparams b/backbone-relational/backbone-relational-tests.ts.tscparams
index e16c76dff..d3f5a12fa 100644
--- a/backbone-relational/backbone-relational-tests.ts.tscparams
+++ b/backbone-relational/backbone-relational-tests.ts.tscparams
@@ -1 +1 @@
-""
+
diff --git a/backbone-relational/backbone-relational.d.ts.tscparams b/backbone-relational/backbone-relational.d.ts.tscparams
index e16c76dff..d3f5a12fa 100644
--- a/backbone-relational/backbone-relational.d.ts.tscparams
+++ b/backbone-relational/backbone-relational.d.ts.tscparams
@@ -1 +1 @@
-""
+
diff --git a/backbone/backbone.d.ts b/backbone/backbone.d.ts
index 3aeeb7d90..270b949aa 100644
--- a/backbone/backbone.d.ts
+++ b/backbone/backbone.d.ts
@@ -215,12 +215,10 @@ declare module Backbone {
any(iterator: (element: TModel, index: number) => boolean, context?: any): boolean;
collect(iterator: (element: TModel, index: number, context?: any) => any[], context?: any): any[];
chain(): any;
- compact(): TModel[];
contains(value: any): boolean;
countBy(iterator: (element: TModel, index: number) => any): _.Dictionary;
countBy(attribute: string): _.Dictionary;
detect(iterator: (item: any) => boolean, context?: any): any; // ???
- difference(...model: TModel[]): TModel[];
drop(): TModel;
drop(n: number): TModel[];
each(iterator: (element: TModel, index: number, list?: any) => void, context?: any): any;
@@ -229,7 +227,6 @@ declare module Backbone {
find(iterator: (element: TModel, index: number) => boolean, context?: any): TModel;
first(): TModel;
first(n: number): TModel[];
- flatten(shallow?: boolean): TModel[];
foldl(iterator: (memo: any, element: TModel, index: number) => any, initialMemo: any, context?: any): any;
forEach(iterator: (element: TModel, index: number, list?: any) => void, context?: any): any;
groupBy(iterator: (element: TModel, index: number) => string, context?: any): _.Dictionary;
@@ -239,7 +236,6 @@ declare module Backbone {
initial(): TModel;
initial(n: number): TModel[];
inject(iterator: (memo: any, element: TModel, index: number) => any, initialMemo: any, context?: any): any;
- intersection(...model: TModel[]): TModel[];
isEmpty(object: any): boolean;
invoke(methodName: string, arguments?: any[]): any;
last(): TModel;
@@ -248,7 +244,6 @@ declare module Backbone {
map(iterator: (element: TModel, index: number, context?: any) => any[], context?: any): any[];
max(iterator?: (element: TModel, index: number) => any, context?: any): TModel;
min(iterator?: (element: TModel, index: number) => any, context?: any): TModel;
- object(...values: any[]): any[];
reduce(iterator: (memo: any, element: TModel, index: number) => any, initialMemo: any, context?: any): any;
select(iterator: any, context?: any): any[];
size(): number;
@@ -257,8 +252,6 @@ declare module Backbone {
sortBy(iterator: (element: TModel, index: number) => number, context?: any): TModel[];
sortBy(attribute: string, context?: any): TModel[];
sortedIndex(element: TModel, iterator?: (element: TModel, index: number) => number): number;
- range(stop: number, step?: number): any;
- range(start: number, stop: number, step?: number): any;
reduceRight(iterator: (memo: any, element: TModel, index: number) => any, initialMemo: any, context?: any): any[];
reject(iterator: (element: TModel, index: number) => boolean, context?: any): TModel[];
rest(): TModel;
@@ -266,10 +259,7 @@ declare module Backbone {
tail(): TModel;
tail(n: number): TModel[];
toArray(): any[];
- union(...model: TModel[]): TModel[];
- uniq(isSorted?: boolean, iterator?: (element: TModel, index: number) => boolean): TModel[];
without(...values: any[]): TModel[];
- zip(...model: TModel[]): TModel[];
}
class Router extends Events {
@@ -349,7 +339,6 @@ declare module Backbone {
model: TModel;
collection: Collection;
//template: (json, options?) => string;
- make(tagName: string, attrs?: any, opts?: any): View;
setElement(element: HTMLElement, delegate?: boolean): View;
setElement(element: JQuery, delegate?: boolean): View;
id: string;
diff --git a/backgrid/backgrid-tests.ts.tscparams b/backgrid/backgrid-tests.ts.tscparams
index e85b4ac55..d45eb7650 100644
--- a/backgrid/backgrid-tests.ts.tscparams
+++ b/backgrid/backgrid-tests.ts.tscparams
@@ -1 +1 @@
---target ES5
\ No newline at end of file
+--target ES5
diff --git a/backgrid/backgrid.d.ts.tscparams b/backgrid/backgrid.d.ts.tscparams
index e16c76dff..d3f5a12fa 100644
--- a/backgrid/backgrid.d.ts.tscparams
+++ b/backgrid/backgrid.d.ts.tscparams
@@ -1 +1 @@
-""
+
diff --git a/bigint/bigint.d.ts b/bigint/bigint.d.ts
index 61543b1c6..b70f20fa4 100644
--- a/bigint/bigint.d.ts
+++ b/bigint/bigint.d.ts
@@ -13,233 +13,359 @@ declare module BigInt {
export function setRandom(random: IRandom): void;
- // bigInt add(x,y)
- // return (x+y) for bigInts x and y.
+ /**
+ * bigInt add(x,y)
+ * return (x+y) for bigInts x and y.
+ */
export function add(x: BigInt, y: BigInt): BigInt;
- // bigInt addInt(x,n)
- // return (x+n) where x is a bigInt and n is an integer.
+ /**
+ * bigInt addInt(x,n)
+ * return (x+n) where x is a bigInt and n is an integer.
+ */
export function addInt(x: BigInt, n: number): BigInt;
- // string bigInt2str(x,base)
- // return a string form of bigInt x in a given base, with 2 <= base <= 95
- export function bigInt2str(x: BigInt, base: number): string;
- export function bigInt2str(x: BigInt, base: string): string;
+ interface bigInt2str_T {
+ /**
+ * string bigInt2str(x,base)
+ * return a string form of bigInt x in a given base, with 2 <= base <= 95
+ */
+ (x: BigInt, base: T): string;
+ }
- // int bitSize(x)
- // return how many bits long the bigInt x is, not counting leading zeros
+ interface bigInt2strSignature extends bigInt2str_T, bigInt2str_T{
+ }
+
+ export var bigInt2str: bigInt2strSignature;
+
+ /**
+ * int bitSize(x)
+ * return how many bits long the bigInt x is, not counting leading zeros
+ */
export function bitSize(x: BigInt): number;
- // bigInt dup(x)
- // return a copy of bigInt x
+ /**
+ * bigInt dup(x)
+ * return a copy of bigInt x
+ */
export function dup(x: BigInt): BigInt;
- // boolean equals(x,y)
- // is the bigInt x equal to the bigint y?
+ /**
+ * boolean equals(x,y)
+ * is the bigInt x equal to the bigint y?
+ */
export function equals(x: BigInt, y: BigInt): boolean;
- // boolean equalsInt(x,y)
- // is bigint x equal to integer y?
+ /**
+ * boolean equalsInt(x,y)
+ * is bigint x equal to integer y?
+ */
export function equalsInt(x: BigInt, y: number): boolean;
- // bigInt expand(x,n)
- // return a copy of x with at least n elements, adding leading zeros if needed
+ /**
+ * bigInt expand(x,n)
+ * return a copy of x with at least n elements, adding leading zeros if needed
+ */
export function expand(value: BigInt, n: number): BigInt;
- // Array findPrimes(n)
- // return array of all primes less than integer n
+ /**
+ * Array findPrimes(n)
+ * return array of all primes less than integer n
+ */
export function findPrimes(n: number): number[];
- // bigInt GCD(x,y)
- // return greatest common divisor of bigInts x and y (each with same number of elements).
+ /**
+ * bigInt GCD(x,y)
+ * return greatest common divisor of bigInts x and y (each with same number of elements).
+ */
export function GCD(x: BigInt, y: BigInt): BigInt;
- // boolean greater(x,y)
- // is x>y? (x and y are nonnegative bigInts)
+ /**
+ * boolean greater(x,y)
+ * is x>y? (x and y are nonnegative bigInts)
+ */
export function greater(x: BigInt, y: BigInt): boolean;
- // boolean greaterShift(x,y,shift)
- // is (x <<(shift*bpe)) > y?
+ /**
+ * boolean greaterShift(x,y,shift)
+ * is (x <<(shift*bpe)) > y?
+ */
export function greaterShift(x: BigInt, y: BigInt, shift: number): boolean;
- // bigInt int2bigInt(t,n,m)
- // return a bigInt equal to integer t, with at least n bits and m array elements
+ /**
+ * bigInt int2bigInt(t,n,m)
+ * return a bigInt equal to integer t, with at least n bits and m array elements
+ */
export function int2bigInt(t: number, n?: number, m?: number): BigInt;
- // bigInt inverseMod(x,n)
- // return (x**(-1) mod n) for bigInts x and n. If no inverse exists, it returns null
+ /**
+ * bigInt inverseMod(x,n)
+ * return (x**(-1) mod n) for bigInts x and n. If no inverse exists, it returns null
+ */
export function inverseMod(x: BigInt, n: BigInt): BigInt;
- // int inverseModInt(x,n)
- // return x**(-1) mod n, for integers x and n. Return 0 if there is no inverse
+ /**
+ * int inverseModInt(x,n)
+ * return x**(-1) mod n, for integers x and n. Return 0 if there is no inverse
+ */
export function inverseModInt(x: number, n: number): BigInt;
- // boolean isZero(x)
- // is the bigInt x equal to zero?
+ /**
+ * boolean isZero(x)
+ * is the bigInt x equal to zero?
+ */
export function isZero(x: BigInt): boolean;
- // boolean millerRabin(x,b)
- // does one round of Miller-Rabin base integer b say that bigInt x is possibly prime? (b is bigInt, 1=1). If s=1, then the most significant of those n bits is set to 1.
+ /**
+ * bigInt randBigInt(n,s)
+ * return an n-bit random BigInt (n>=1). If s=1, then the most significant of those n bits is set to 1.
+ */
export function randBigInt(n: number, s: number): BigInt;
- // bigInt randTruePrime(k)
- // return a new, random, k-bit, true prime bigInt using Maurer's algorithm.
+ /**
+ * bigInt randTruePrime(k)
+ * return a new, random, k-bit, true prime bigInt using Maurer's algorithm.
+ */
export function randTruePrime(k: number): BigInt;
- // bigInt randProbPrime(k)
- // return a new, random, k-bit, probable prime bigInt (probability it's composite less than 2^-80).
+ /**
+ * bigInt randProbPrime(k)
+ * return a new, random, k-bit, probable prime bigInt (probability it's composite less than 2^-80).
+ */
export function randProbPrime(k: number): BigInt;
- // bigInt str2bigInt(s,b,n,m)
- // return a bigInt for number represented in string s in base b with at least n bits and m array elements
- export function str2bigInt(s: string, b: number, n?: number, m?: number): BigInt;
- export function str2bigInt(s: string, b: string, n?: number, m?: number): BigInt;
+ interface str2bigInt_T {
+ /**
+ * bigInt str2bigInt(s,b,n,m)
+ * return a bigInt for number represented in string s in base b with at least n bits and m array elements
+ */
+ (s: string, b: T, n?: number, m?: number): BigInt;
+ }
- // bigInt sub(x,y)
- // return (x-y) for bigInts x and y. Negative answers will be 2s complement
+ interface str2bigIntSignature extends str2bigInt_T, str2bigInt_T {
+ }
+
+ export var str2bigInt: str2bigIntSignature;
+
+ /**
+ * bigInt sub(x,y)
+ * return (x-y) for bigInts x and y. Negative answers will be 2s complement
+ */
export function sub(x: BigInt, y: BigInt): BigInt;
- // bigInt trim(x,k)
- // return a copy of x with exactly k leading zero elements
+ /**
+ * bigInt trim(x,k)
+ * return a copy of x with exactly k leading zero elements
+ */
export function trim(x: BigInt, k: number): BigInt;
- // void addInt_(x,n)
- // do x=x+n where x is a bigInt and n is an integer
+ /**
+ * void addInt_(x,n)
+ * do x=x+n where x is a bigInt and n is an integer
+ */
export function addInt_(x: BigInt, n: number): void;
- // void add_(x,y)
- // do x=x+y for bigInts x and y
+ /**
+ * void add_(x,y)
+ * do x=x+y for bigInts x and y
+ */
export function add_(x: BigInt, y: BigInt): void;
- // void copy_(x,y)
- // do x=y on bigInts x and y
+ /**
+ * void copy_(x,y)
+ * do x=y on bigInts x and y
+ */
export function copy_(x: BigInt, y: BigInt): void;
- // void copyInt_(x,n)
- // do x=n on bigInt x and integer n
+ /**
+ * void copyInt_(x,n)
+ * do x=n on bigInt x and integer n
+ */
export function copyInt_(x: BigInt, n: number): number;
- // void GCD_(x,y)
- // set x to the greatest common divisor of bigInts x and y, (y is destroyed). (This never overflows its array).
+ /**
+ * void GCD_(x,y)
+ * set x to the greatest common divisor of bigInts x and y, (y is destroyed). (This never overflows its array).
+ */
export function GCD_(x: BigInt, y: BigInt): void;
- // boolean inverseMod_(x,n)
- // do x=x**(-1) mod n, for bigInts x and n. Returns 1 (0) if inverse does (doesn't) exist
+ /**
+ * boolean inverseMod_(x,n)
+ * do x=x**(-1) mod n, for bigInts x and n. Returns 1 (0) if inverse does (doesn't) exist
+ */
export function inverseMod_(x: BigInt, n: BigInt): boolean;
- // void mod_(x,n)
- // do x=x mod n for bigInts x and n. (This never overflows its array).
+ /**
+ * void mod_(x,n)
+ * do x=x mod n for bigInts x and n. (This never overflows its array).
+ */
export function mod_(x: BigInt, n: BigInt): void;
- // void mult_(x,y)
- // do x=x*y for bigInts x and y.
+ /**
+ * void mult_(x,y)
+ * do x=x*y for bigInts x and y.
+ */
export function mult_(x: BigInt, y: BigInt): void;
- // void multMod_(x,y,n)
- // do x=x*y mod n for bigInts x,y,n.
+ /**
+ * void multMod_(x,y,n)
+ * do x=x*y mod n for bigInts x,y,n.
+ */
export function multMod_(x: BigInt, y: BigInt, n: BigInt): void;
- // void powMod_(x,y,n)
- // do x=x**y mod n, where x,y,n are bigInts (n is odd) and ** is exponentiation. 0**0=1.
+ /**
+ * void powMod_(x,y,n)
+ * do x=x**y mod n, where x,y,n are bigInts (n is odd) and ** is exponentiation. 0**0=1.
+ */
export function powMod_(x: BigInt, y: BigInt, n: BigInt): void;
- // void randBigInt_(b,n,s)
- // do b = an n-bit random BigInt. if s=1, then nth bit (most significant bit) is set to 1. n>=1.
+ /**
+ * void randBigInt_(b,n,s)
+ * do b = an n-bit random BigInt. if s=1, then nth bit (most significant bit) is set to 1. n>=1.
+ */
export function randBigInt_(b: BigInt, n: number, s: number): void;
- // void randTruePrime_(ans,k)
- // do ans = a random k-bit true random prime (not just probable prime) with 1 in the msb.
+ /**
+ * void randTruePrime_(ans,k)
+ * do ans = a random k-bit true random prime (not just probable prime) with 1 in the msb.
+ */
export function randTruePrime_(ans: BigInt, k: number): void;
- // void sub_(x,y)
- // do x=x-y for bigInts x and y. Negative answers will be 2s complement.
+ /**
+ * void sub_(x,y)
+ * do x=x-y for bigInts x and y. Negative answers will be 2s complement.
+ */
export function sub_(x: BigInt, y: BigInt): void;
- // void addShift_(x,y,ys)
- // do x=x+(y<<(ys*bpe))
+ /**
+ * void addShift_(x,y,ys)
+ * do x=x+(y<<(ys*bpe))
+ */
export function addShift_(x: BigInt, y: BigInt, ys: number): void;
- // void carry_(x)
- // do carries and borrows so each element of the bigInt x fits in bpe bits.
+ /**
+ * void carry_(x)
+ * do carries and borrows so each element of the bigInt x fits in bpe bits.
+ */
export function carry_(x: BigInt): void;
- // void divide_(x,y,q,r)
- // divide x by y giving quotient q and remainder r
+ /**
+ * void divide_(x,y,q,r)
+ * divide x by y giving quotient q and remainder r
+ */
export function divide_(x: BigInt, y: BigInt, q: BigInt, r: BigInt): void;
- // int divInt_(x,n)
- // do x=floor(x/n) for bigInt x and integer n, and return the remainder. (This never overflows its array).
+ /**
+ * int divInt_(x,n)
+ * do x=floor(x/n) for bigInt x and integer n, and return the remainder. (This never overflows its array).
+ */
export function divInt_(x: BigInt, n: number): number;
- // void eGCD_(x,y,d,a,b)
- // sets a,b,d to positive bigInts such that d = GCD_(x,y) = a*x-b*y
+ /**
+ * void eGCD_(x,y,d,a,b)
+ * sets a,b,d to positive bigInts such that d = GCD_(x,y) = a*x-b*y
+ */
export function eGCD_(x: BigInt, y: BigInt, d: BigInt, a: BigInt, b: BigInt): void;
- // void halve_(x)
- // do x=floor(|x|/2)*sgn(x) for bigInt x in 2's complement. (This never overflows its array).
+ /**
+ * void halve_(x)
+ * do x=floor(|x|/2)*sgn(x) for bigInt x in 2's complement. (This never overflows its array).
+ */
export function halve_(x: BigInt): void;
- // void leftShift_(x,n)
- // left shift bigInt x by n bits. n
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+///
+///
+///
+///
+///
+declare module Validators {
+ class LettersOnlyValidator implements Validation.IStringValidator {
+ public isAcceptable(s: string): boolean;
+ public tagName: string;
+ }
+ class ZipCodeValidator implements Validation.IStringValidator {
+ public isAcceptable(s: string): boolean;
+ public tagName: string;
+ }
+ class EmailValidator implements Validation.IStringValidator {
+ public isAcceptable(s: string): boolean;
+ public tagName: string;
+ }
+ class UrlValidator implements Validation.IStringValidator {
+ public isAcceptable(s: string): boolean;
+ public tagName: string;
+ }
+ class RequiredValidator implements Validation.IStringValidator {
+ public isAcceptable(s: string): boolean;
+ public tagName: string;
+ }
+ class DateValidator implements Validation.IStringValidator {
+ public isAcceptable(s: string): boolean;
+ public tagName: string;
+ }
+ class DateISOValidator implements Validation.IStringValidator {
+ public isAcceptable(s: string): boolean;
+ public tagName: string;
+ }
+ class NumberValidator implements Validation.IStringValidator {
+ public isAcceptable(s: string): boolean;
+ public tagName: string;
+ }
+ class DigitValidator implements Validation.IStringValidator {
+ public isAcceptable(s: string): boolean;
+ public tagName: string;
+ }
+ class SignedDigitValidator implements Validation.IStringValidator {
+ public isAcceptable(s: string): boolean;
+ public tagName: string;
+ }
+ class MinLengthValidator implements Validation.IStringValidator {
+ public MinLength: number;
+ constructor(MinLength?: number);
+ public isAcceptable(s: string): boolean;
+ public tagName: string;
+ }
+ class MaxLengthValidator implements Validation.IStringValidator {
+ public MaxLength: number;
+ constructor(MaxLength?: number);
+ public isAcceptable(s: string): boolean;
+ public tagName: string;
+ }
+ class RangeLengthValidator implements Validation.IStringValidator {
+ public RangeLength: number[];
+ constructor(RangeLength?: number[]);
+ public isAcceptable(s: string): boolean;
+ public MinLength : number;
+ public MaxLength : number;
+ public tagName: string;
+ }
+ class MinValidator implements Validation.IPropertyValidator {
+ public Min: number;
+ constructor(Min?: number);
+ public isAcceptable(s: any): boolean;
+ public tagName: string;
+ }
+ class MaxValidator implements Validation.IPropertyValidator {
+ public Max: number;
+ constructor(Max?: number);
+ public isAcceptable(s: any): boolean;
+ public tagName: string;
+ }
+ class RangeValidator implements Validation.IPropertyValidator {
+ public Range: number[];
+ constructor(Range?: number[]);
+ public isAcceptable(s: any): boolean;
+ public Min : number;
+ public Max : number;
+ public tagName: string;
+ }
+ class StepValidator implements Validation.IPropertyValidator {
+ public Step: string;
+ constructor(Step?: string);
+ public isAcceptable(s: any): boolean;
+ public tagName: string;
+ }
+ class PatternValidator implements Validation.IStringValidator {
+ public Pattern: string;
+ constructor(Pattern?: string);
+ public isAcceptable(s: string): boolean;
+ public tagName: string;
+ }
+ class ContainsValidator implements Validation.IAsyncPropertyValidator {
+ public Options: Q.Promise;
+ constructor(Options: Q.Promise);
+ public isAcceptable(s: string): Q.Promise;
+ public isAsync: boolean;
+ public tagName: string;
+ }
+}
+declare module "node-validators" {export = Validators;}
diff --git a/business-rules-engine/Utils.d.ts b/business-rules-engine/Utils.d.ts
new file mode 100644
index 000000000..bea120c63
--- /dev/null
+++ b/business-rules-engine/Utils.d.ts
@@ -0,0 +1,15 @@
+// Type definitions for business-rules-engine - v1.0.20
+// Project: https://github.com/rsamec/form
+// Definitions by: Roman Samec
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+///
+declare module Utils {
+ class StringFce {
+ static format(s: string, args: any): string;
+ }
+ class NumberFce {
+ static GetNegDigits(value: string): number;
+ }
+}
+declare module "node-utils" {export = Utils;}
diff --git a/business-rules-engine/Validation.d.ts b/business-rules-engine/Validation.d.ts
new file mode 100644
index 000000000..dfd6e786f
--- /dev/null
+++ b/business-rules-engine/Validation.d.ts
@@ -0,0 +1,241 @@
+// Type definitions for business-rules-engine - v1.0.20
+// Project: https://github.com/rsamec/form
+// Definitions by: Roman Samec
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+///
+///
+declare module Validation {
+ interface IErrorCustomMessage {
+ (config: any, args: any): string;
+ }
+ interface IPropertyValidator {
+ isAcceptable(s: any): boolean;
+ customMessage?: IErrorCustomMessage;
+ tagName?: string;
+ }
+ interface IStringValidator extends IPropertyValidator {
+ isAcceptable(s: string): boolean;
+ }
+ interface IAsyncPropertyValidator {
+ isAcceptable(s: any): Q.Promise;
+ customMessage?: IErrorCustomMessage;
+ isAsync: boolean;
+ tagName?: string;
+ }
+ interface IAsyncStringPropertyValidator extends IAsyncPropertyValidator {
+ isAcceptable(s: string): Q.Promise;
+ }
+ enum CompareOperator {
+ LessThan = 0,
+ LessThanEqual = 1,
+ Equal = 2,
+ NotEqual = 3,
+ GreaterThanEqual = 4,
+ GreaterThan = 5,
+ }
+ interface IError {
+ HasError: boolean;
+ ErrorMessage: string;
+ TranslateArgs?: IErrorTranslateArgs;
+ }
+ interface IErrorTranslateArgs {
+ TranslateId: string;
+ MessageArgs: any;
+ CustomMessage?: IErrorCustomMessage;
+ }
+ interface IOptional {
+ (): boolean;
+ }
+ interface IValidationFailure extends IError {
+ IsAsync: boolean;
+ Error: IError;
+ }
+ interface IValidationResult {
+ Name: string;
+ Add(validationResult: IValidationResult): void;
+ Remove(index: number): void;
+ Children: IValidationResult[];
+ HasErrors: boolean;
+ HasErrorsDirty: boolean;
+ ErrorMessage: string;
+ ErrorCount: number;
+ Optional?: IOptional;
+ TranslateArgs?: IErrorTranslateArgs[];
+ }
+ interface IValidate {
+ (args: IError): void;
+ }
+ interface IAsyncValidate {
+ (args: IError): Q.Promise;
+ }
+ interface IValidatorFce {
+ Name: string;
+ ValidationFce?: IValidate;
+ AsyncValidationFce?: IAsyncValidate;
+ }
+ interface IValidator {
+ Validate(context: any): IValidationFailure;
+ ValidateAsync(context: any): Q.Promise;
+ Error: IError;
+ }
+ interface IAbstractValidator {
+ RuleFor(prop: string, validator: IPropertyValidator): any;
+ ValidationFor(prop: string, validatorFce: IValidatorFce): any;
+ Validation(validatorFce: IValidatorFce): any;
+ ValidatorFor(prop: string, validator: IAbstractValidator): any;
+ CreateRule(name: string): IAbstractValidationRule;
+ CreateAbstractRule(name: string): IAbstractValidationRule;
+ CreateAbstractListRule(name: string): IAbstractValidationRule;
+ ForList: boolean;
+ }
+ interface IAbstractValidationRule {
+ Validate(context: T): IValidationResult;
+ ValidateAsync(context: T): Q.Promise;
+ ValidateAll(context: T): Q.Promise;
+ ValidateProperty(context: T, propName: string): void;
+ ValidationResult: IValidationResult;
+ Rules: {
+ [name: string]: IPropertyValidationRule;
+ };
+ Validators: {
+ [name: string]: IValidator;
+ };
+ Children: {
+ [name: string]: IAbstractValidationRule;
+ };
+ }
+ interface IPropertyValidationRule {
+ Validators: {
+ [name: string]: any;
+ };
+ Validate(context: IValidationContext): IValidationFailure[];
+ ValidateAsync(context: IValidationContext): Q.Promise;
+ }
+ interface IValidationContext {
+ Value: string;
+ Key: string;
+ Data: T;
+ }
+ class Error implements IError {
+ public HasError: boolean;
+ public ErrorMessage: string;
+ constructor();
+ }
+ class ValidationFailure implements IError {
+ public Error: IError;
+ public IsAsync: boolean;
+ constructor(Error: IError, IsAsync: boolean);
+ public HasError : boolean;
+ public ErrorMessage : string;
+ public TranslateArgs : IErrorTranslateArgs;
+ }
+ class ValidationResult implements IValidationResult {
+ public Name: string;
+ constructor(Name: string);
+ public IsDirty: boolean;
+ public Children : IValidationResult[];
+ public Add(error: IValidationResult): void;
+ public Remove(index: number): void;
+ public Optional: IOptional;
+ public TranslateArgs: IErrorTranslateArgs[];
+ public HasErrorsDirty : boolean;
+ public HasErrors : boolean;
+ public ErrorCount : number;
+ public ErrorMessage : string;
+ }
+ class CompositeValidationResult implements IValidationResult {
+ public Name: string;
+ public Children: IValidationResult[];
+ constructor(Name: string);
+ public Optional: IOptional;
+ public AddFirst(error: IValidationResult): void;
+ public Add(error: IValidationResult): void;
+ public Remove(index: number): void;
+ public HasErrorsDirty : boolean;
+ public HasErrors : boolean;
+ public ErrorCount : number;
+ public ErrorMessage : string;
+ public TranslateArgs : IErrorTranslateArgs[];
+ public LogErrors(headerMessage?: string): void;
+ public Errors : {
+ [name: string]: IValidationResult;
+ };
+ private FlattenErros;
+ public SetDirty(): void;
+ public SetPristine(): void;
+ private SetDirtyEx(node, dirty);
+ private flattenErrors(node, errorCollection);
+ private traverse(node, indent);
+ }
+ class AbstractValidator implements IAbstractValidator {
+ public Validators: {
+ [name: string]: IPropertyValidator[];
+ };
+ public AbstractValidators: {
+ [name: string]: IAbstractValidator;
+ };
+ public ValidationFunctions: {
+ [name: string]: IValidatorFce[];
+ };
+ public RuleFor(prop: string, validator: IPropertyValidator): void;
+ public ValidationFor(prop: string, fce: IValidatorFce): void;
+ public Validation(fce: IValidatorFce): void;
+ public ValidatorFor(prop: string, validator: IAbstractValidator, forList?: boolean): void;
+ public CreateAbstractRule(name: string): IAbstractValidationRule;
+ public CreateAbstractListRule(name: string): IAbstractValidationRule;
+ public CreateRule(name: string): IAbstractValidationRule;
+ public ForList: boolean;
+ }
+ class MessageLocalization {
+ static customMsg: string;
+ static defaultMessages: {
+ "required": string;
+ "remote": string;
+ "email": string;
+ "url": string;
+ "date": string;
+ "dateISO": string;
+ "number": string;
+ "digits": string;
+ "signedDigits": string;
+ "creditcard": string;
+ "equalTo": string;
+ "maxlength": string;
+ "minlength": string;
+ "rangelength": string;
+ "range": string;
+ "max": string;
+ "min": string;
+ "step": string;
+ "contains": string;
+ "mask": string;
+ "custom": string;
+ };
+ static ValidationMessages: {
+ "required": string;
+ "remote": string;
+ "email": string;
+ "url": string;
+ "date": string;
+ "dateISO": string;
+ "number": string;
+ "digits": string;
+ "signedDigits": string;
+ "creditcard": string;
+ "equalTo": string;
+ "maxlength": string;
+ "minlength": string;
+ "rangelength": string;
+ "range": string;
+ "max": string;
+ "min": string;
+ "step": string;
+ "contains": string;
+ "mask": string;
+ "custom": string;
+ };
+ static GetValidationMessage(validator: any): string;
+ }
+}
+declare module "node-validation" {export = Validation;}
diff --git a/business-rules-engine/business-rules-engine-tests.ts b/business-rules-engine/business-rules-engine-tests.ts
new file mode 100644
index 000000000..5695c3b7f
--- /dev/null
+++ b/business-rules-engine/business-rules-engine-tests.ts
@@ -0,0 +1,32 @@
+///
+///
+///
+///
+///
+
+export interface IPerson{
+ Checked:boolean;
+ FirstName:string;
+ LastName:string;
+ Email:string;
+}
+
+
+//create custom composite validator
+var personValidator = new Validation.AbstractValidator();
+
+//create field validators
+var required = new Validators.RequiredValidator();
+var email = new Validators.EmailValidator();
+var maxLength = new Validators.MaxLengthValidator();
+maxLength.MaxLength = 15;
+
+
+personValidator.RuleFor("FirstName", required);
+personValidator.RuleFor("FirstName", maxLength);
+
+personValidator.RuleFor("LastName", required);
+personValidator.RuleFor("LastName", maxLength);
+
+personValidator.RuleFor("Email", required);
+personValidator.RuleFor("Email", email);
diff --git a/business-rules-engine/business-rules-engine.d.ts b/business-rules-engine/business-rules-engine.d.ts
new file mode 100644
index 000000000..7c17714cc
--- /dev/null
+++ b/business-rules-engine/business-rules-engine.d.ts
@@ -0,0 +1,242 @@
+// Type definitions for business-rules-engine - v1.0.20
+// Project: https://github.com/rsamec/form
+// Definitions by: Roman Samec
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+// Source: typings/business-rules-engine/Validation.d.ts
+///
+///
+declare module Validation {
+ interface IErrorCustomMessage {
+ (config: any, args: any): string;
+ }
+ interface IPropertyValidator {
+ isAcceptable(s: any): boolean;
+ customMessage?: IErrorCustomMessage;
+ tagName?: string;
+ }
+ interface IStringValidator extends IPropertyValidator {
+ isAcceptable(s: string): boolean;
+ }
+ interface IAsyncPropertyValidator {
+ isAcceptable(s: any): Q.Promise;
+ customMessage?: IErrorCustomMessage;
+ isAsync: boolean;
+ tagName?: string;
+ }
+ interface IAsyncStringPropertyValidator extends IAsyncPropertyValidator {
+ isAcceptable(s: string): Q.Promise;
+ }
+ enum CompareOperator {
+ LessThan = 0,
+ LessThanEqual = 1,
+ Equal = 2,
+ NotEqual = 3,
+ GreaterThanEqual = 4,
+ GreaterThan = 5,
+ }
+ interface IError {
+ HasError: boolean;
+ ErrorMessage: string;
+ TranslateArgs?: IErrorTranslateArgs;
+ }
+ interface IErrorTranslateArgs {
+ TranslateId: string;
+ MessageArgs: any;
+ CustomMessage?: IErrorCustomMessage;
+ }
+ interface IOptional {
+ (): boolean;
+ }
+ interface IValidationFailure extends IError {
+ IsAsync: boolean;
+ Error: IError;
+ }
+ interface IValidationResult {
+ Name: string;
+ Add(validationResult: IValidationResult): void;
+ Remove(index: number): void;
+ Children: IValidationResult[];
+ HasErrors: boolean;
+ HasErrorsDirty: boolean;
+ ErrorMessage: string;
+ ErrorCount: number;
+ Optional?: IOptional;
+ TranslateArgs?: IErrorTranslateArgs[];
+ }
+ interface IValidate {
+ (args: IError): void;
+ }
+ interface IAsyncValidate {
+ (args: IError): Q.Promise;
+ }
+ interface IValidatorFce {
+ Name: string;
+ ValidationFce?: IValidate;
+ AsyncValidationFce?: IAsyncValidate;
+ }
+ interface IValidator {
+ Validate(context: any): IValidationFailure;
+ ValidateAsync(context: any): Q.Promise;
+ Error: IError;
+ }
+ interface IAbstractValidator {
+ RuleFor(prop: string, validator: IPropertyValidator): any;
+ ValidationFor(prop: string, validatorFce: IValidatorFce): any;
+ Validation(validatorFce: IValidatorFce): any;
+ ValidatorFor(prop: string, validator: IAbstractValidator): any;
+ CreateRule(name: string): IAbstractValidationRule;
+ CreateAbstractRule(name: string): IAbstractValidationRule;
+ CreateAbstractListRule(name: string): IAbstractValidationRule;
+ ForList: boolean;
+ }
+ interface IAbstractValidationRule {
+ Validate(context: T): IValidationResult;
+ ValidateAsync(context: T): Q.Promise;
+ ValidateAll(context: T): Q.Promise;
+ ValidateProperty(context: T, propName: string): void;
+ ValidationResult: IValidationResult;
+ Rules: {
+ [name: string]: IPropertyValidationRule;
+ };
+ Validators: {
+ [name: string]: IValidator;
+ };
+ Children: {
+ [name: string]: IAbstractValidationRule;
+ };
+ }
+ interface IPropertyValidationRule {
+ Validators: {
+ [name: string]: any;
+ };
+ Validate(context: IValidationContext): IValidationFailure[];
+ ValidateAsync(context: IValidationContext): Q.Promise;
+ }
+ interface IValidationContext {
+ Value: string;
+ Key: string;
+ Data: T;
+ }
+ class Error implements IError {
+ public HasError: boolean;
+ public ErrorMessage: string;
+ constructor();
+ }
+ class ValidationFailure implements IError {
+ public Error: IError;
+ public IsAsync: boolean;
+ constructor(Error: IError, IsAsync: boolean);
+ public HasError : boolean;
+ public ErrorMessage : string;
+ public TranslateArgs : IErrorTranslateArgs;
+ }
+ class ValidationResult implements IValidationResult {
+ public Name: string;
+ constructor(Name: string);
+ public IsDirty: boolean;
+ public Children : IValidationResult[];
+ public Add(error: IValidationResult): void;
+ public Remove(index: number): void;
+ public Optional: IOptional;
+ public TranslateArgs: IErrorTranslateArgs[];
+ public HasErrorsDirty : boolean;
+ public HasErrors : boolean;
+ public ErrorCount : number;
+ public ErrorMessage : string;
+ }
+ class CompositeValidationResult implements IValidationResult {
+ public Name: string;
+ public Children: IValidationResult[];
+ constructor(Name: string);
+ public Optional: IOptional;
+ public AddFirst(error: IValidationResult): void;
+ public Add(error: IValidationResult): void;
+ public Remove(index: number): void;
+ public HasErrorsDirty : boolean;
+ public HasErrors : boolean;
+ public ErrorCount : number;
+ public ErrorMessage : string;
+ public TranslateArgs : IErrorTranslateArgs[];
+ public LogErrors(headerMessage?: string): void;
+ public Errors : {
+ [name: string]: IValidationResult;
+ };
+ private FlattenErros;
+ public SetDirty(): void;
+ public SetPristine(): void;
+ private SetDirtyEx(node, dirty);
+ private flattenErrors(node, errorCollection);
+ private traverse(node, indent);
+ }
+ class AbstractValidator implements IAbstractValidator {
+ public Validators: {
+ [name: string]: IPropertyValidator[];
+ };
+ public AbstractValidators: {
+ [name: string]: IAbstractValidator;
+ };
+ public ValidationFunctions: {
+ [name: string]: IValidatorFce[];
+ };
+ public RuleFor(prop: string, validator: IPropertyValidator): void;
+ public ValidationFor(prop: string, fce: IValidatorFce): void;
+ public Validation(fce: IValidatorFce): void;
+ public ValidatorFor(prop: string, validator: IAbstractValidator, forList?: boolean): void;
+ public CreateAbstractRule(name: string): IAbstractValidationRule;
+ public CreateAbstractListRule(name: string): IAbstractValidationRule;
+ public CreateRule(name: string): IAbstractValidationRule;
+ public ForList: boolean;
+ }
+ class MessageLocalization {
+ static customMsg: string;
+ static defaultMessages: {
+ "required": string;
+ "remote": string;
+ "email": string;
+ "url": string;
+ "date": string;
+ "dateISO": string;
+ "number": string;
+ "digits": string;
+ "signedDigits": string;
+ "creditcard": string;
+ "equalTo": string;
+ "maxlength": string;
+ "minlength": string;
+ "rangelength": string;
+ "range": string;
+ "max": string;
+ "min": string;
+ "step": string;
+ "contains": string;
+ "mask": string;
+ "custom": string;
+ };
+ static ValidationMessages: {
+ "required": string;
+ "remote": string;
+ "email": string;
+ "url": string;
+ "date": string;
+ "dateISO": string;
+ "number": string;
+ "digits": string;
+ "signedDigits": string;
+ "creditcard": string;
+ "equalTo": string;
+ "maxlength": string;
+ "minlength": string;
+ "rangelength": string;
+ "range": string;
+ "max": string;
+ "min": string;
+ "step": string;
+ "contains": string;
+ "mask": string;
+ "custom": string;
+ };
+ static GetValidationMessage(validator: any): string;
+ }
+}
+declare module "business-rule-engine" {export = Validation;}
diff --git a/camljs/camljs-tests.ts.tscparams b/camljs/camljs-tests.ts.tscparams
index e16c76dff..d3f5a12fa 100644
--- a/camljs/camljs-tests.ts.tscparams
+++ b/camljs/camljs-tests.ts.tscparams
@@ -1 +1 @@
-""
+
diff --git a/camljs/camljs.d.ts.tscparams b/camljs/camljs.d.ts.tscparams
index e16c76dff..d3f5a12fa 100644
--- a/camljs/camljs.d.ts.tscparams
+++ b/camljs/camljs.d.ts.tscparams
@@ -1 +1 @@
-""
+
diff --git a/chai-fuzzy/chai-fuzzy.d.ts.tscparams b/chai-fuzzy/chai-fuzzy.d.ts.tscparams
index e16c76dff..d3f5a12fa 100644
--- a/chai-fuzzy/chai-fuzzy.d.ts.tscparams
+++ b/chai-fuzzy/chai-fuzzy.d.ts.tscparams
@@ -1 +1 @@
-""
+
diff --git a/chai-jquery/chai-jquery-tests.ts.tscparams b/chai-jquery/chai-jquery-tests.ts.tscparams
index e16c76dff..d3f5a12fa 100644
--- a/chai-jquery/chai-jquery-tests.ts.tscparams
+++ b/chai-jquery/chai-jquery-tests.ts.tscparams
@@ -1 +1 @@
-""
+
diff --git a/chai/chai-tests.ts.tscparams b/chai/chai-tests.ts.tscparams
index e16c76dff..d3f5a12fa 100644
--- a/chai/chai-tests.ts.tscparams
+++ b/chai/chai-tests.ts.tscparams
@@ -1 +1 @@
-""
+
diff --git a/chroma-js/chroma-js-tests.ts b/chroma-js/chroma-js-tests.ts
new file mode 100644
index 000000000..3240ac11f
--- /dev/null
+++ b/chroma-js/chroma-js-tests.ts
@@ -0,0 +1,120 @@
+///
+
+function test_chroma() {
+ chroma("red");
+ chroma("#ff0000");
+ chroma("#f00");
+ chroma("FF0000");
+ chroma(255, 0, 0);
+ chroma([255, 0, 0]);
+ chroma(0, 1, 0.5, 'hsl');
+ chroma([0, 1, 0.5], 'hsl');
+ chroma(0, 1, 1, 'hsv');
+ chroma("rgb(255,0,0)");
+ chroma("rgb(100%,0%,0%)");
+ chroma("hsl(0,100%,50%)");
+ chroma(53.24, 80.09, 67.20, 'lab');
+ chroma(53.24, 104.55, 40, 'lch');
+ chroma(1, 0, 0, 'gl');
+
+ chroma.hex("#ff0000");
+ chroma.hex("red");
+ chroma.hex("rgb(255, 0, 0)");
+
+ chroma.rgb(255, 0, 0);
+ chroma.hsl(0, 1, 0.5);
+ chroma.hsv(120, 0.5, 0.5);
+ chroma.lab(53.24, 80.09, 67.20);
+ chroma.lch(53.24, 104.55, 40);
+ chroma.gl(1, 0, 0);
+
+ chroma.interpolate('white', 'black', 0) // #ffffff
+ chroma.interpolate('white', 'black', 1) // #000000
+ chroma.interpolate('white', 'black', 0.5) // #7f7f7f
+ chroma.interpolate('white', 'black', 0.5, 'hsv') // #808080
+ chroma.interpolate('white', 'black', 0.5, 'lab') // #777777
+
+ chroma.interpolate('rgba(0,0,0,0)', 'rgba(255,0,0,1)', 0.5).css() //"rgba(127.5,0,0,0.5)"
+
+ var bezInterpolator = chroma.interpolate.bezier(['white', 'yellow', 'red', 'black']);
+ bezInterpolator(0).hex() // #ffffff
+ bezInterpolator(0.33).hex() // #ffcc67
+ bezInterpolator(0.66).hex() // #b65f1a
+ bezInterpolator(1).hex() // #000000
+
+ chroma.luminance('black') // 0
+ chroma.luminance('white') // 1
+ chroma.luminance('#ff0000') // 0.2126
+
+ chroma.contrast('white', 'navy') // 16.00 – ok
+ chroma.contrast('white', 'yellow') // 1.07 – not ok!
+}
+
+function test_color() {
+ chroma('red').hex() // "#FF0000""
+ chroma('red').rgb() // [255, 0, 0]
+ chroma('red').hsv() // [0, 1, 1]
+ chroma('red').hsl() // [0, 1, 0.5]
+ chroma('red').lab() // [53.2407, 80.0924, 67.2031]
+ chroma('red').lch() // [53.2407, 104.5517, 39.9990]
+ chroma('red').rgba() // [255, 0, 0, 1]
+ chroma('red').css() // "rgb(255,0,0)"
+ chroma('red').alpha(0.7).css() // "rgba(255,0,0,0.7)"
+ chroma('red').css('hsl') // "hsl(0,100%,50%)"
+ chroma('red').alpha(0.7).css('hsl') // "hsla(0,100%,50%,0.7)"
+ chroma('blue').css('hsla') // "hsla(240,100%,50%,1)"
+
+ var red = chroma('red');
+ red.alpha(0.5);
+ red.css(); // rgba(255,0,0,0.5);
+
+ chroma('red').darken().hex() // #BC0000
+ chroma('red').brighten().hex() // #FF603B
+ chroma('#eecc99').saturate().hex() // #fcc973
+ chroma('red').desaturate().hex() // #ec3d23
+
+ chroma('black').luminance() // 0
+ chroma('white').luminance() // 1
+ chroma('red').luminance() // 0.2126
+}
+
+function test_scale() {
+ var scale = chroma.scale(['lightyellow', 'navy']);
+ scale(0.5); // #7F7FB0
+
+ chroma.scale('RdYlBu');
+
+ var col = scale(0.5);
+ col.hex(); // #7F7FB0
+ col.rgb(); // [127.5, 127.5, 176]
+
+ scale = chroma.scale(['lightyellow', 'navy']).out('hex');
+ scale(0.5); // "#7F7FB0"
+
+ var scale = chroma.scale(['lightyellow', 'navy']);
+ scale.mode('hsv')(0.5); // #54C08A
+ scale.mode('hsl')(0.5); // #31FF98
+ scale.mode('lab')(0.5); // #967CB2
+ scale.mode('lch')(0.5); // #D26662
+
+ var scale = chroma.scale(['lightyellow', 'navy']).domain([0, 400]);
+ scale(200); // #7F7FB0
+
+ var scale = chroma.scale(['lightyellow', 'navy']).domain([0, 100, 200, 300, 400]);
+ scale(98); // #7F7FB0
+ scale(99); // #7F7FB0
+ scale(100); // #AAAAC0
+ scale(101); // #AAAAC0
+
+ chroma.scale(['#eee', '#900']).domain([0, 400], 7);
+ chroma.scale(['#eee', '#900']).domain([1, 1000000], 7, 'log');
+ chroma.scale(['#eee', '#900']).domain([1, 1000000], 5, 'quantiles');
+ chroma.scale(['#eee', '#900']).domain([1, 1000000], 5, 'k-means');
+ chroma.scale(['white', 'red']).domain([0, 100], 4).domain() // [0, 25, 50, 75, 100]
+
+ chroma.scale().range(['lightyellow', 'navy']);
+
+ chroma.scale(['lightyellow', 'navy']).correctLightness(true);
+
+ chroma.scale('RdYlGn').domain([0,1], 5).colors()
+}
diff --git a/chroma-js/chroma-js.d.ts b/chroma-js/chroma-js.d.ts
new file mode 100644
index 000000000..94b32ae81
--- /dev/null
+++ b/chroma-js/chroma-js.d.ts
@@ -0,0 +1,317 @@
+// Type definitions for Chroma.js v0.5.6
+// Project: https://github.com/gka/chroma.js
+// Definitions by: Sebastian Brückner
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+/**
+ * Chroma.js is a tiny library for all kinds of color conversions and color scales.
+ */
+declare module Chroma {
+
+ export interface ChromaStatic {
+ /**
+ * Creates a color from a string representation (as supported in CSS).
+ *
+ * @param color The string to convert to a color.
+ * @return the color object.
+ */
+ (color: string): Color;
+
+ /**
+ * Create a color in the specified color space using a, b and c as values.
+ *
+ * @param a
+ * @param b
+ * @param c
+ * @param colorSpace The color space to use (one of "rgb", "hsl", "hsv", "lab", "lch", "gl"). Defaults to "rgb".
+ * @return the color object.
+ */
+ (a: number, b: number, c: number, colorSpace?: string): Color;
+
+ /**
+ * Create a color in the specified color space using values.
+ *
+ * @param values An array of values (e.g. [r, g, b, a?]).
+ * @param colorSpace The color space to use (one of "rgb", "hsl", "hsv", "lab", "lch", "gl"). Defaults to "rgb".
+ * @return the color object.
+ */
+ (values: number[], colorSpace?: string): Color;
+
+ /**
+ * Create a color in the specified color space using a, b and c as values.
+ *
+ * @param a
+ * @param b
+ * @param c
+ * @param colorSpace The color space to use (one of "rgb", "hsl", "hsv", "lab", "lch", "gl"). Defaults to "rgb".
+ * @return the color object.
+ */
+ color(a: number, b: number, c: number, colorSpace?: string): Color;
+
+ /**
+ * Calculate the contrast ratio of two colors.
+ *
+ * @param color1 The first color.
+ * @param color2 The second color.
+ * @return the contrast ratio.
+ */
+ contrast(color1: Color, color2: Color): number;
+ /**
+ * Calculate the contrast ratio of two colors.
+ *
+ * @param color1 The first color.
+ * @param color2 The second color.
+ * @return the contrast ratio.
+ */
+ contrast(color1: Color, color2: string): number;
+ /**
+ * Calculate the contrast ratio of two colors.
+ *
+ * @param color1 The first color.
+ * @param color2 The second color.
+ * @return the contrast ratio.
+ */
+ contrast(color1: string, color2: Color): number;
+ /**
+ * Calculate the contrast ratio of two colors.
+ *
+ * @param color1 The first color.
+ * @param color2 The second color.
+ * @return the contrast ratio.
+ */
+ contrast(color1: string, color2: string): number;
+
+ /**
+ * Create a color from a hex or string representation (as supported in CSS).
+ *
+ * This is an alias of chroma.hex().
+ *
+ * @param color The string to convert to a color.
+ * @return the color object.
+ */
+ css(color: string): Color;
+
+ /**
+ * Create a color from a hex or string representation (as supported in CSS).
+ *
+ * This is an alias of chroma.css().
+ *
+ * @param color The string to convert to a color.
+ * @return the color object.
+ */
+ hex(color: string): Color;
+
+ rgb(red: number, green: number, blue: number, alpha?: number): Color;
+ hsl(hue: number, saturation: number, lightness: number, alpha?: number): Color;
+ hsv(hue: number, saturation: number, value: number, alpha?: number): Color;
+ lab(lightness: number, a: number, b: number, alpha?: number): Color;
+ lch(lightness: number, chroma: number, hue: number, alpha?: number): Color;
+ gl(red: number, green: number, blue: number, alpha?: number): Color;
+
+ interpolate: InterpolateFunction;
+ mix: InterpolateFunction;
+
+ luminance(color: Color): number;
+ luminance(color: string): number;
+
+ /**
+ * Creates a color scale using a pre-defined color scale.
+ *
+ * @param name The name of the color scale.
+ * @return the resulting color scale.
+ */
+ scale(name: string): Scale;
+
+ /**
+ * Creates a color scale function from the given set of colors.
+ *
+ * @param colors An Array of at least two color names or hex values.
+ * @return the resulting color scale.
+ */
+ scale(colors?: string[]): Scale;
+
+ scales: PredefinedScales;
+ }
+
+ interface InterpolateFunction {
+ (color1: Color, color2: Color, f: number, mode?: string): Color;
+ (color1: Color, color2: string, f: number, mode?: string): Color;
+ (color1: string, color2: Color, f: number, mode?: string): Color;
+ (color1: string, color2: string, f: number, mode?: string): Color;
+
+ bezier(colors: any[]): (t: number) => Color;
+ }
+
+ interface PredefinedScales {
+ [key: string]: Scale;
+
+ cool: Scale;
+ hot: Scale;
+ }
+
+ export interface Color {
+ /**
+ * Creates a color from a string representation (as supported in CSS).
+ *
+ * @param color The string to convert to a color.
+ */
+ new(color: string): Color;
+
+ /**
+ * Create a color in the specified color space using a, b and c as values.
+ *
+ * @param a
+ * @param b
+ * @param c
+ * @param colorSpace The color space to use (one of "rgb", "hsl", "hsv", "lab", "lch", "gl"). Defaults to "rgb".
+ */
+ new(a: number, b: number, c: number, colorSpace?: string): Color;
+
+ /**
+ * Create a color in the specified color space using a, b and c as color values and alpha as the alpha value.
+ *
+ * @param a
+ * @param b
+ * @param c
+ * @param alpha The alpha value of the color.
+ * @param colorSpace The color space to use (one of "rgb", "hsl", "hsv", "lab", "lch", "gl"). Defaults to "rgb".
+ */
+ new(a: number, b: number, c: number, alpha: number, colorSpace?: string): Color;
+
+ /**
+ * Create a color in the specified color space using values.
+ *
+ * @param values An array of values (e.g. [r, g, b, a?]).
+ * @param colorSpace The color space to use (one of "rgb", "hsl", "hsv", "lab", "lch", "gl"). Defaults to "rgb".
+ */
+ new(values: number[], colorSpace: string): Color;
+
+ /**
+ * Convert this color to CSS hex representation.
+ *
+ * @return this color's hex representation.
+ */
+ hex(): string;
+
+ /**
+ * @return the relative luminance of the color, which is a value between 0 (black) and 1 (white).
+ */
+ luminance(): number;
+
+ /**
+ * @return the X11 name of this color or its hex value if it does not have a name.
+ */
+ name(): string;
+
+ /**
+ * @return the alpha value of the color.
+ */
+ alpha(): number;
+
+ /**
+ * Set the alpha value.
+ *
+ * @param alpha The alpha value.
+ * @return this
+ */
+ alpha(alpha: number): Color;
+
+ css(mode?: string): string;
+
+ interpolate(color: Color, f: number, mode?: string): Color;
+ interpolate(color: string, f: number, mode?: string): Color;
+
+ premultiply(): Color;
+
+ rgb(): number[];
+ rgba(): number[];
+ hsl(): number[];
+ hsv(): number[];
+ lab(): number[];
+ lch(): number[];
+ hsi(): number[];
+ gl(): number[];
+
+ darken(amount?: number): Color;
+ darker(amount: number): Color;
+ brighten(amount?: number): Color;
+ brighter(amount: number): Color;
+ saturate(amount?: number): Color;
+ desaturate(amount?: number): Color;
+
+ toString(): string;
+ }
+
+ export interface Scale {
+ /**
+ * Interpolate a color using the currently set range and domain.
+ *
+ * @param value The value to use for interpolation.
+ * @return the interpolated hex color OR a Color object (depending on the mode set on this Scale).
+ */
+ (value: number): any;
+
+ /**
+ * Retreive all possible colors generated by this scale if it has distinct classes.
+ *
+ * @param mode The output mode to use. Must be one of Color's getters. Defaults to "hex".
+ * @return an array of colors in the type specified by mode.
+ */
+ colors(mode?: string): any[];
+
+ correctLightness(): boolean;
+
+ /**
+ * Enable or disable automatic lightness correction of this scale.
+ *
+ * @param Whether to enable or disable automatic lightness correction.
+ * @return this
+ */
+ correctLightness(enable: boolean): Scale;
+
+ /**
+ * Get the current domain.
+ *
+ * @return The current domain.
+ */
+ domain(): number[];
+
+ /**
+ * Set the domain.
+ *
+ * @param domain An Array of at least two numbers (min and max).
+ * @param classes The number of fixed classes to create between min and max.
+ * @param mode The scale to use. Examples: log, quantiles, k-means.
+ * @return this
+ */
+ domain(domain: number[], classes?: number, mode?: string): Scale;
+
+ /**
+ * Specify in which color space the colors should be interpolated. Defaults to "rgb".
+ * You can use any of the following spaces: rgb, hsv, hsl, lab, lch
+ *
+ * @param colorSpace The color space to use for interpolation.
+ * @return this
+ */
+ mode(colorSpace: string): Scale;
+
+ /**
+ * Set the output mode of this Scale.
+ *
+ * @param mode The output mode to use. Must be one of Color's getters.
+ * @return this
+ */
+ out(mode: string): Scale;
+
+ /**
+ * Set the color range after initialization.
+ *
+ * @param colors An Array of at least two color names or hex values.
+ * @return this
+ */
+ range(colors: string[]): Scale;
+ }
+
+}
+
+declare var chroma: Chroma.ChromaStatic;
diff --git a/chrome/chrome-app-tests.ts.tscparams b/chrome/chrome-app-tests.ts.tscparams
index e16c76dff..d3f5a12fa 100644
--- a/chrome/chrome-app-tests.ts.tscparams
+++ b/chrome/chrome-app-tests.ts.tscparams
@@ -1 +1 @@
-""
+
diff --git a/chrome/chrome-app.d.ts.tscparams b/chrome/chrome-app.d.ts.tscparams
index e16c76dff..d3f5a12fa 100644
--- a/chrome/chrome-app.d.ts.tscparams
+++ b/chrome/chrome-app.d.ts.tscparams
@@ -1 +1 @@
-""
+
diff --git a/chrome/chrome-tests.ts.tscparams b/chrome/chrome-tests.ts.tscparams
index e16c76dff..d3f5a12fa 100644
--- a/chrome/chrome-tests.ts.tscparams
+++ b/chrome/chrome-tests.ts.tscparams
@@ -1 +1 @@
-""
+
diff --git a/chrome/chrome.d.ts b/chrome/chrome.d.ts
index 23ee0d916..df655e2b8 100755
--- a/chrome/chrome.d.ts
+++ b/chrome/chrome.d.ts
@@ -3,6 +3,8 @@
// Definitions by: Matthew Kimber , otiai10
// Definitions: https://github.com/borisyankov/DefinitelyTyped
+///
+
////////////////////
// Alarms
////////////////////
@@ -294,6 +296,7 @@ declare module chrome.contextMenus {
pageUrl: string;
linkUrl?: string;
parentMenuItemId?: any;
+ srcUrl?: string;
}
interface CreateProperties {
@@ -537,6 +540,14 @@ declare module chrome.declarativeWebRequest {
var onRequest: RequestedEvent;
}
+////////////////////
+// DesktopCapture
+////////////////////
+declare module chrome.desktopCapture {
+ export function chooseDesktopMedia(sources: string[], targetTab?: chrome.tabs.Tab, callback?: (streamId: string) => void): void;
+ export function cancelChooseDesktopMedia(desktopMediaRequestId: number): void;
+}
+
////////////////////
// Dev Tools - Inspected Window
////////////////////
@@ -1745,6 +1756,27 @@ declare module chrome.socket {
export function getNetworkList(callback: (result: NetworkInterface[]) => void): void;
}
+////////////////////
+// TabCapture
+////////////////////
+declare module chrome.tabCapture {
+ interface CaptureInfo {
+ tabId: number;
+ status: string;
+ fullscreen: boolean;
+ }
+
+ interface CaptureOptions {
+ audio?: boolean;
+ video?: boolean;
+ audioConstraints?: MediaTrackConstraints;
+ videoConstraints?: MediaTrackConstraints;
+ }
+
+ export function capture(options: CaptureOptions, callback: (stream: LocalMediaStream) => void): void;
+ export function getCapturedTabs(callback: (result: CaptureInfo[]) => void): void;
+}
+
////////////////////
// Tabs
////////////////////
@@ -2198,13 +2230,19 @@ declare module chrome.webRequest {
username: string;
password: string;
}
-
+
+ interface HttpHeader {
+ name: string;
+ value?: string;
+ binaryValue?: ArrayBuffer;
+ }
+
interface BlockingResponse {
cancel?: boolean;
redirectUrl?: string;
- responseHeaders?: Object;
+ responseHeaders?: HttpHeader[];
authCredentials?: AuthCredentials;
- requestHeaders?: Object;
+ requestHeaders?: HttpHeader[];
}
interface RequestFilter {
@@ -2224,7 +2262,7 @@ declare module chrome.webRequest {
ip?: string;
statusLine?: string;
frameId: number;
- responseHeaders?: Object;
+ responseHeaders?: HttpHeader[];
parentFrameId: number;
fromCache: boolean;
url: string;
@@ -2243,7 +2281,7 @@ declare module chrome.webRequest {
statusLine?: string;
frameId: number;
requestId: string;
- responseHeaders: Object;
+ responseHeaders?: HttpHeader[];
type: string;
method: string;
}
@@ -2253,7 +2291,7 @@ declare module chrome.webRequest {
ip?: string;
statusLine?: string;
frameId: number;
- responseHeaders?: Object;
+ responseHeaders?: HttpHeader[];
parentFrameId: number;
fromCache: boolean;
url: string;
@@ -2275,7 +2313,7 @@ declare module chrome.webRequest {
statusLine?: string;
frameId: number;
challenger: Challenger;
- responseHeaders: Object;
+ responseHeaders?: HttpHeader[];
isProxy: boolean;
realm?: string;
parentFrameId: number;
@@ -2294,7 +2332,7 @@ declare module chrome.webRequest {
timeStamp: number;
frameId: number;
requestId: number;
- requestHeaders?: Object;
+ requestHeaders?: HttpHeader[];
type: string;
method: string;
}
@@ -2318,7 +2356,7 @@ declare module chrome.webRequest {
ip?: string;
statusLine?: string;
frameId: number;
- responseHeaders?: Object;
+ responseHeaders?: HttpHeader[];
parentFrameId: number;
fromCache: boolean;
url: string;
@@ -2336,7 +2374,7 @@ declare module chrome.webRequest {
timeStamp: number;
frameId: number;
requestId: string;
- requestHeaders: Object;
+ requestHeaders?: HttpHeader[];
type: string;
method: string;
}
diff --git a/convert-source-map/convert-source-map-tests.ts.tscparams b/convert-source-map/convert-source-map-tests.ts.tscparams
index e16c76dff..d3f5a12fa 100644
--- a/convert-source-map/convert-source-map-tests.ts.tscparams
+++ b/convert-source-map/convert-source-map-tests.ts.tscparams
@@ -1 +1 @@
-""
+
diff --git a/convert-source-map/convert-source-map.d.ts.tscparams b/convert-source-map/convert-source-map.d.ts.tscparams
index e16c76dff..d3f5a12fa 100644
--- a/convert-source-map/convert-source-map.d.ts.tscparams
+++ b/convert-source-map/convert-source-map.d.ts.tscparams
@@ -1 +1 @@
-""
+
diff --git a/crossroads/crossroads-tests.ts.tscparams b/crossroads/crossroads-tests.ts.tscparams
index e16c76dff..d3f5a12fa 100644
--- a/crossroads/crossroads-tests.ts.tscparams
+++ b/crossroads/crossroads-tests.ts.tscparams
@@ -1 +1 @@
-""
+
diff --git a/crossroads/crossroads.d.ts.tscparams b/crossroads/crossroads.d.ts.tscparams
index e16c76dff..d3f5a12fa 100644
--- a/crossroads/crossroads.d.ts.tscparams
+++ b/crossroads/crossroads.d.ts.tscparams
@@ -1 +1 @@
-""
+
diff --git a/csurf/csurf.d.ts b/csurf/csurf.d.ts
new file mode 100644
index 000000000..cc78f9599
--- /dev/null
+++ b/csurf/csurf.d.ts
@@ -0,0 +1,30 @@
+// Type definitions for csurf
+// Project: https://www.npmjs.org/package/csurf
+// Definitions by: Hiroki Horiuchi
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+///
+
+declare module Express {
+ export interface Request {
+ csrfToken(): string;
+ }
+}
+
+declare module "csurf" {
+ import express = require('express');
+
+ function csurf(options?: {
+ value?: (req: express.Request) => string;
+ cookie?: csurf.CookieOptions;
+ }): express.RequestHandler;
+
+ module csurf {
+ export interface CookieOptions extends express.CookieOptions {
+ key: string;
+ }
+ }
+
+ export = csurf;
+}
+
diff --git a/d3/d3-tests.ts.tscparams b/d3/d3-tests.ts.tscparams
index e16c76dff..d3f5a12fa 100644
--- a/d3/d3-tests.ts.tscparams
+++ b/d3/d3-tests.ts.tscparams
@@ -1 +1 @@
-""
+
diff --git a/d3/d3.d.ts b/d3/d3.d.ts
old mode 100755
new mode 100644
index 0354bc264..158462aa3
--- a/d3/d3.d.ts
+++ b/d3/d3.d.ts
@@ -243,7 +243,7 @@ declare module D3 {
*
* @param map Array of objects to get the values from
*/
- values(map: any[]): any[];
+ values(map: any): any[];
/**
* List the key-value entries of an associative array.
*
@@ -417,7 +417,7 @@ declare module D3 {
/*
* The array of built-in interpolator factories
*/
- interpolators: Array;
+ interpolators: Transition.InterpolateFactory[];
/**
* Layouts
*/
@@ -525,11 +525,11 @@ declare module D3 {
/**
* gets the mouse position relative to a specified container.
*/
- mouse(container: any): Array;
+ mouse(container: any): number[];
/**
* gets the touch positions relative to a specified container.
*/
- touches(container: any): Array>;
+ touches(container: any): number[][];
/**
* If the specified value is a function, returns the specified value.
@@ -538,10 +538,12 @@ declare module D3 {
functor(value: (p : R) => T): (p : R) => T;
functor(value: T): (p : any) => T;
- map(object?: any): Map;
- set(array?: Array