Merge pull request #2 from borisyankov/master

Merge changes from borisyankov
This commit is contained in:
Christiaan Rakowski
2015-08-29 18:27:45 +02:00
585 changed files with 126156 additions and 19688 deletions
+113 -28
View File
@@ -13,9 +13,11 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](amcharts/AmCharts.d.ts) [amCharts](http://www.amcharts.com) by [aleksey-bykov](https://github.com/aleksey-bykov)
* [:link:](amplifyjs/amplifyjs.d.ts) [AmplifyJs](http://amplifyjs.com) by [Jonas Eriksson](https://github.com/joeriks)
* [:link:](amqp-rpc/amqp-rpc.d.ts) [amqp-rpc](https://github.com/demchenkoe/node-amqp-rpc) by [Wonshik Kim](https://github.com/wokim)
* [:link:](angular2/router.d.ts) [Angular](http://angular.io) by [angular team](https://github.com/angular)
* [:link:](amqplib/amqplib.d.ts) [amqplib 0.3.x](https://github.com/squaremo/amqp.node) by [Michael Nahkies](https://github.com/mnahkies)
* [:link:](angular2/angular2.d.ts) [Angular](http://angular.io) by [angular team](https://github.com/angular)
* [:link:](angular2/router.d.ts) [Angular](http://angular.io) by [angular team](https://github.com/angular)
* [:link:](angular-file-upload/angular-file-upload.d.ts) [Angular File Upload](https://github.com/danialfarid/ng-file-upload) by [John Reilly](https://github.com/johnnyreilly)
* [:link:](ng-file-upload/ng-file-upload.d.ts) [Angular File Upload](https://github.com/danialfarid/ng-file-upload) by [John Reilly](https://github.com/johnnyreilly)
* [:link:](angular-growl-v2/angular-growl-v2.d.ts) [Angular Growl 2 v.0.7.3](http://janstevens.github.io/angular-growl-2) by [Tadeusz Hucal](https://github.com/mkp05)
* [:link:](angularjs/angular.d.ts) [Angular JS](http://angularjs.org) by [Diego Vilar](http://github.com/diegovilar)
* [:link:](angularjs/angular-animate.d.ts) [Angular JS (ngAnimate module)](http://angularjs.org) by [Michel Salib](https://github.com/michelsalib), [Adi Dahiya](https://github.com/adidahiya), [Raphael Schweizer](https://github.com/rasch), [Cody Schaaf](https://github.com/codyschaaf)
@@ -29,18 +31,22 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](angular-material/angular-material.d.ts) [Angular Material (angular.material module)](https://github.com/angular/material) by [Matt Traynham](https://github.com/mtraynham)
* [:link:](angular-protractor/angular-protractor.d.ts) [Angular Protractor](https://github.com/angular/protractor) by [Bill Armstrong](https://github.com/BillArmstrong)
* [:link:](angular-scenario/angular-scenario.d.ts) [Angular Scenario Testing (ngScenario module)](http://angularjs.org) by [RomanoLindano](https://github.com/RomanoLindano)
* [:link:](angular-toasty/angular-toasty.d.ts) [Angular Toasty](https://github.com/invertase/angular-toasty) by [Dominik Muench](https://github.com/muenchdo)
* [:link:](angular-translate/angular-translate.d.ts) [Angular Translate (pascalprecht.translate module)](https://github.com/PascalPrecht/angular-translate) by [Michel Salib](https://github.com/michelsalib)
* [:link:](angular-ui-bootstrap/angular-ui-bootstrap.d.ts) [Angular UI Bootstrap](https://github.com/angular-ui/bootstrap) by [Brian Surowiec](https://github.com/xt0rted)
* [:link:](angular-wizard/angular-wizard.d.ts) [Angular Wizard](https://github.com/mgonto/angular-wizard) by [Marko Jurisic](https://github.com/mjurisic)
* [:link:](angular-bootstrap-lightbox/angular-bootstrap-lightbox.d.ts) [angular-bootstrap-lightbox](https://github.com/compact/angular-bootstrap-lightbox) by [Roland Zwaga](https://github.com/rolandzwaga)
* [:link:](angular-dynamic-locale/angular-dynamic-locale.d.ts) [angular-dynamic-locale](https://github.com/lgalfaso/angular-dynamic-locale) by [Stephen Lautier](https://github.com/stephenlautier)
* [:link:](angular-formly/angular-formly.d.ts) [angular-formly](https://github.com/formly-js/angular-formly) by [Scott Hatcher](https://github.com/scatcher)
* [:link:](angular-hotkeys/angular-hotkeys.d.ts) [angular-hotkeys](https://github.com/chieffancypants/angular-hotkeys) by [Jason Zhao](https://github.com/jlz27), [Stefan Steinhart](https://github.com/reppners)
* [:link:](angular-http-auth/angular-http-auth.d.ts) [angular-http-auth](https://github.com/witoldsz/angular-http-auth) by [vvakame](https://github.com/vvakame)
* [:link:](angular-jwt/angular-jwt.d.ts) [angular-jwt](https://github.com/auth0/angular-jwt) by [Reto Rezzonico](https://github.com/rerezz)
* [:link:](angular-local-storage/angular-local-storage.d.ts) [angular-local-storage](https://github.com/grevory/angular-local-storage) by [Ken Fukuyama](https://github.com/kenfdev)
* [:link:](angular-localForage/angular-localForage.d.ts) [angular-localForage](https://github.com/ocombe/angular-localForage) by [Stefan Steinhart](https://github.com/reppners)
* [:link:](angular-notifications/angular-notifications.d.ts) [angular-notifications](https://github.com/DerekRies/angular-notifications) by [Tomasz Ducin](https://github.com/ducin/DefinitelyTyped)
* [:link:](angular-notify/angular-notify.d.ts) [angular-notify](https://github.com/cgross/angular-notify) by [Suwato](https://github.com/Suwato/DefinitelyTyped)
* [:link:](angular-scroll/angular-scroll.d.ts) [angular-scroll](https://github.com/oblador/angular-scroll) by [Sam Herrmann](https://github.com/samherrmann)
* [:link:](angular-signalr-hub/angular-signalr-hub.d.ts) [angular-signalr-hub](https://github.com/JustMaier/angular-signalr-hub) by [Adam Santaniello](https://github.com/AdamSantaniello)
* [:link:](angular-spinner/angular-spinner.d.ts) [angular-spinner.js](https://github.com/urish/angular-spinner) by [Marcin Biegała](https://github.com/Biegal)
* [:link:](angular-storage/angular-storage.d.ts) [angular-storage](https://github.com/auth0/angular-storage) by [Matthew DeKrey](https://github.com/mdekrey)
* [:link:](angular.throttle/angular.throttle.d.ts) [angular.throttle](https://github.com/BaggersIO/angular.throttle) by [Stefan Steinhart](https://github.com/reppners)
@@ -50,6 +56,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](rx-angular/rx.angular.d.ts) [angularjs extensions to rxjs](http://reactivex.io) by [Mick Delaney](https://github.com/mickdelaney)
* [:link:](angularjs-toaster/angularjs-toaster.d.ts) [angularjs-toaster](https://github.com/jirikavi/AngularJS-Toaster) by [Ben Tesser](https://github.com/btesser)
* [:link:](angularLocalStorage/angularLocalStorage.d.ts) [AngularLocalStorage](https://github.com/agrublev/angularLocalStorage) by [Horiuchi_H](https://github.com/horiuchi)
* [:link:](angulartics/angulartics.d.ts) [Angulartics](http://luisfarzati.github.io/angulartics) by [Steven Fan](https://github.com/stevenfan)
* [:link:](animation-frame/animation-frame.d.ts) [animation-frame](https://github.com/kof/animation-frame) by [Qinfeng Chen](https://github.com/qinfchen)
* [:link:](ansi-styles/ansi-styles.d.ts) [ansi-styles](https://github.com/sindresorhus/ansi-styles) by [bryn austin bellomy](https://github.com/brynbellomy)
* [:link:](ansicolors/ansicolors.d.ts) [ansicolors](https://github.com/thlorenz/ansicolors) by [rogierschouten](https://github.com/rogierschouten)
@@ -77,7 +84,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](auth0/auth0.d.ts) [Auth0.js](http://auth0.com) by [Robert McLaws](https://github.com/advancedrei)
* [:link:](auth0.lock/auth0.lock.d.ts) [Auth0Widget.js](http://auth0.com) by [Robert McLaws](https://github.com/advancedrei)
* [:link:](auth0.widget/auth0.widget.d.ts) [Auth0Widget.js](http://auth0.com) by [Robert McLaws](https://github.com/advancedrei)
* [:link:](autobahn/autobahn.d.ts) [AutobahnJS](http://autobahn.ws/js) by [Elad Zelingher](https://github.com/darkl)
* [:link:](autobahn/autobahn.d.ts) [AutobahnJS](http://autobahn.ws/js) by [Elad Zelingher](https://github.com/darkl), [Andy Hawkins](https://github.com/a904guy/,http://a904guy.com/,http://www.bmbsqd.com)
* [:link:](autoprefixer-core/autoprefixer-core.d.ts) [Autoprefixer Core](https://github.com/postcss/autoprefixer-core) by [Asana](https://asana.com)
* [:link:](aws-sdk/aws-sdk.d.ts) [aws-sdk](https://github.com/aws/aws-sdk-js) by [midknight41](https://github.com/midknight41)
* [:link:](axios/axios.d.ts) [axios](https://github.com/mzabriskie/axios) by [Marcel Buesing](https://github.com/marcelbuesing)
@@ -89,7 +96,9 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](backbone.paginator/backbone.paginator.d.ts) [backbone.paginator](https://github.com/backbone-paginator/backbone.paginator) by [Nyamazing](https://github.com/Nyamazing)
* [:link:](backbone.radio/backbone.radio.d.ts) [Backbone.Radio](https://github.com/marionettejs/backbone.radio) by [Peter Palotas](https://github.com/alphaleonis)
* [:link:](backgrid/backgrid.d.ts) [Backgrid](http://backgridjs.com) by [Jeremy Lujan](https://github.com/jlujan)
* [:link:](baconjs/baconjs.d.ts) [Bacon.js](https://baconjs.github.io) by [Alexander Matsievsky](https://github.com/alexander-matsievsky)
* [:link:](bardjs/bardjs.d.ts) [bardjs](https://github.com/wardbell/bardjs) by [Andrew Archibald](https://github.com/TepigMC)
* [:link:](batch-stream/batch-stream.d.ts) [batch-stream](https://github.com/segmentio/batch-stream) by [Nicholas Penree](http://github.com/drudge)
* [:link:](bcrypt/bcrypt.d.ts) [bcrypt](https://www.npmjs.org/package/bcrypt) by [Peter Harris](https://github.com/codeanimal)
* [:link:](bgiframe/typescript.bgiframe.d.ts) [bgiframe](https://github.com/sumegizoltan/BgiFrame) by [Zoltan Sumegi](https://github.com/sumegizoltan)
* [:link:](big.js/big.js.d.ts) [big.js](https://github.com/MikeMcl/big.js) by [Steve Ognibene](https://github.com/nycdotnet)
@@ -102,7 +111,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](blueimp-md5/blueimp-md5.d.ts) [blueimp-md5](https://github.com/blueimp/JavaScript-MD5) by [Ray Martone](https://github.com/rmartone)
* [:link:](body-parser/body-parser.d.ts) [body-parser](http://expressjs.com) by [Santi Albo](https://github.com/santialbo), [VILIC VANE](https://vilic.info), [Jonathan Häberle](https://github.com/dreampulse)
* [:link:](boom/boom.d.ts) [boom](http://github.com/hapijs/boom) by [Igor Rogatty](http://github.com/rogatty)
* [:link:](bootbox/bootbox.d.ts) [Bootbox](https://github.com/makeusabrew/bootbox) by [Vincent Bortone](https://github.com/vbortone), [Kon Pik](https://github.com/konpikwastaken), [Anup Kattel](https://github.com/kanup)
* [:link:](bootbox/bootbox.d.ts) [Bootbox](https://github.com/makeusabrew/bootbox) by [Vincent Bortone](https://github.com/vbortone), [Kon Pik](https://github.com/konpikwastaken), [Anup Kattel](https://github.com/kanup), [Dominik Schroeter](https://github.com/icereed)
* [:link:](bootstrap/bootstrap.d.ts) [Bootstrap](http://twitter.github.com/bootstrap) by [Boris Yankov](https://github.com/borisyankov)
* [:link:](bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker.d.ts) [Bootstrap datetimepicker v3](http://eonasdan.github.io/bootstrap-datetimepicker) by [Jesica N. Fera](https://github.com/bayitajesi)
* [:link:](bootstrap-touchspin/bootstrap-touchspin.d.ts) [Bootstrap TouchSpin](http://www.virtuosoft.eu/code/bootstrap-touchspin) by [Albin Sunnanbo](https://github.com/albinsunnanbo)
@@ -110,8 +119,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](bootstrap-slider/bootstrap-slider.d.ts) [bootstrap-slider.js](https://github.com/seiyria/bootstrap-slider) by [Daniel Beckwith](https://github.com/dbeckwith)
* [:link:](bootstrap.datepicker/bootstrap.datepicker.d.ts) [bootstrap.datepicker](https://github.com/eternicode/bootstrap-datepicker) by [Boris Yankov](https://github.com/borisyankov)
* [:link:](bootstrap.paginator/bootstrap.paginator.d.ts) [bootstrap.paginator](https://github.com/lyonlai/bootstrap-paginator) by [derikwhittaker](https://github.com/derikwhittaker)
* [:link:](bootstrap.timepicker/bootstrap.timepicker.d.ts) [bootstrap.timepicker](https://github.com/jdewit/bootstrap-timepicker) by [derikwhittaker](https://github.com/derikwhittaker)
* [:link:](box2d/box2dweb.d.ts) [bootstrap.timepicker](http://code.google.com/p/box2dweb) by [jbaldwin](https://github.com/jbaldwin)
* [:link:](bootstrap.timepicker/bootstrap.timepicker.d.ts) [bootstrap.timepicker](https://github.com/jdewit/bootstrap-timepicker) by [derikwhittaker](https://github.com/derikwhittaker)
* [:link:](breeze/breeze.d.ts) [Breeze 1.5.x](http://www.breezejs.com) by [Boris Yankov](https://github.com/borisyankov), [IdeaBlade](https://github.com/IdeaBlade/Breeze)
* [:link:](browser-harness/browser-harness.d.ts) [Browser Harness](https://github.com/scriby/browser-harness) by [Chris Scribner](https://github.com/scriby)
* [:link:](browser-sync/browser-sync.d.ts) [browser-sync](http://www.browsersync.io) by [Asana](https://asana.com)
@@ -123,8 +132,10 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](bufferstream/bufferstream.d.ts) [bufferstream](https://github.com/dodo/node-bufferstream) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](bunyan-prettystream/bunyan-prettystream.d.ts) [bunyan-prettystream](https://www.npmjs.com/package/bunyan-prettystream) by [Jason Swearingen](https://github.com/jasonswearingen), [Vadim Macagon](https://github.com/enlight)
* [:link:](business-rules-engine/business-rules-engine.d.ts) [business-rules-engine](https://github.com/rsamec/form) by [Roman Samec](https://github.com/rsamec)
* [:link:](dw-bxslider-4/dw-bxslider-4.d.ts) [bxSlider](https://github.com/stevenwanderski/bxslider-4) by [Piotr Sałkowski](https://github.com/namerci)
* [:link:](byline/byline.d.ts) [byline](https://github.com/jahewson/node-byline) by [Stefan Steinhart](https://github.com/reppners)
* [:link:](calq/calq.d.ts) [calq](https://calq.io/docs/client/javascript/reference) by [Eirik Hoem](https://github.com/eirikhm)
* [:link:](camel-case/camel-case.d.ts) [camel-case](https://github.com/blakeembrey/camel-case) by [Sam Saint-Pettersen](https://github.com/stpettersens)
* [:link:](camljs/camljs.d.ts) [camljs](http://camljs.codeplex.com) by [Andrey Markeev](http://markeev.com)
* [:link:](canvasjs/canvasjs.d.ts) [CanvasJS](http://canvasjs.com) by [Mark Overholt](https://github.com/mover5)
* [:link:](casperjs/casperjs.d.ts) [CasperJS](http://casperjs.org) by [Jed Mao](https://github.com/jedmao)
@@ -163,8 +174,10 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](compression/compression.d.ts) [compression](https://github.com/expressjs/compression) by [Santi Albo](https://github.com/santialbo)
* [:link:](configstore/configstore.d.ts) [configstore](https://github.com/yeoman/configstore) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](connect-flash/connect-flash.d.ts) [connect-flash](https://github.com/jaredhanson/connect-flash) by [Andreas Gassmann](https://github.com/AndreasGassmann)
* [:link:](connect-modrewrite/connect-modrewrite.d.ts) [connect-modrewrite](https://github.com/tinganho/connect-modrewrite) by [Tingan Ho](https://github.com/tinganho)
* [:link:](connect-slashes/connect-slashes.d.ts) [connect-slashes](https://github.com/avinoamr/connect-slashes) by [Sam Herrmann](https://github.com/samherrmann)
* [:link:](consolidate/consolidate.d.ts) [consolidate](https://github.com/visionmedia/consolidate.js) by [Carlos Ballesteros Velasco](https://github.com/soywiz)
* [:link:](constant-case/constant-case.d.ts) [constant-case](https://github.com/blakeembrey/constant-case) by [Sam Saint-Pettersen](https://github.com/stpettersens)
* [:link:](content-type/content-type.d.ts) [content-type](https://github.com/deoxxa/content-type) by [Pine Mizune](https://github.com/pine613)
* [:link:](contextjs/contextjs.d.ts) [contextjs](https://github.com/jakiestfu/Context.js) by [Kern Handa](https://github.com/kernhanda)
* [:link:](convert-source-map/convert-source-map.d.ts) [convert-source-map](https://github.com/thlorenz/convert-source-map) by [Andrew Gaspar](https://github.com/AndrewGaspar)
@@ -173,6 +186,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](cookiejs/cookiejs.d.ts) [cookie.js](https://github.com/js-coder/cookie.js) by [Boltmade](https://github.com/Boltmade)
* [:link:](cordova-ionic/plugins/keyboard.d.ts) [Cordova Keyboard plugin](https://github.com/driftyco/ionic-plugins-keyboard) by [Hendrik Maus](https://github.com/hendrikmaus)
* [:link:](cordovarduino/cordovarduino.d.ts) [Cordovarduino plugin](https://github.com/stereolux/cordovarduino) by [Hendrik Maus](https://github.com/hendrikmaus)
* [:link:](core-js/core-js.d.ts) [core-js](https://github.com/zloirock/core-js) by [Ron Buckton](http://github.com/rbuckton)
* [:link:](cors/cors.d.ts) [cors](https://github.com/troygoode/node-cors) by [Mihhail Lapushkin](https://github.com/mihhail-lapushkin)
* [:link:](couchbase/couchbase.d.ts) [Couchbase Couchnode](https://github.com/couchbase/couchnode) by [Basarat Ali Syed](https://github.com/basarat)
* [:link:](createjs/createjs.d.ts) [CreateJS](http://www.createjs.com) by [Pedro Ferreira](https://bitbucket.org/drk4), [Chris Smith](https://github.com/evilangelist), [Satoru Kimura](https://github.com/gyohk)
* [:link:](cron/cron.d.ts) [cron](https://www.npmjs.com/package/cron) by [Hiroki Horiuchi](https://github.com/horiuchi)
@@ -192,6 +207,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](dagre/dagre.d.ts) [dagre](https://github.com/cpettitt/dagre) by [Qinfeng Chen](https://github.com/qinfchen)
* [:link:](dagre-d3/dagre-d3.d.ts) [dagre-d3.core.js](https://github.com/cpettitt/dagre-d3) by [Mark Wong Siang Kai](https://github.com/markwongsk)
* [:link:](dat-gui/dat-gui.d.ts) [dat.GUI](https://github.com/dataarts/dat.gui) by [Satoru Kimura](https://github.com/gyohk)
* [:link:](data-driven/data-driven.d.ts) [data-driven.js](https://github.com/fluentsoftware/data-driven) by [Adam Babcock](https://github.com/mrhen)
* [:link:](DataStream.js/DataStream.js.d.ts) [DataStream.js](https://github.com/kig/DataStream.js) by [Tat](https://github.com/tatchx)
* [:link:](date.format.js/date.format.d.ts) [Date Format](http://blog.stevenlevithan.com/archives/date-time-format) by [Rob Stutton](https://github.com/balrob)
* [:link:](datejs/datejs.d.ts) [DateJS](http://www.datejs.com) by [David Khristepher Santos](http://github.com/rupertavery)
@@ -209,6 +225,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](dhtmlxscheduler/dhtmlxscheduler.d.ts) [dhtmlxScheduler](http://dhtmlx.com/docs/products/dhtmlxScheduler) by [Maksim Kozhukh](http://github.com/mkozhukh)
* [:link:](di-lite/di-lite.d.ts) [di-lite](https://github.com/NickQiZhu/di.js) by [Timothy Morris](https://github.com/dcrusader)
* [:link:](diff/diff.d.ts) [diff](https://github.com/kpdecker/jsdiff) by [vvakame](https://github.com/vvakame)
* [:link:](diff-match-patch/diff-match-patch.d.ts) [diff-match-patch](https://www.npmjs.com/package/diff-match-patch) by [Asana](https://asana.com)
* [:link:](docCookies/docCookies.d.ts) [docCookies](https://developer.mozilla.org/en-US/docs/Web/API/document.cookie) by [Jon Egerton](https://github.com/jonegerton)
* [:link:](dock-spawn/dock-spawn.d.ts) [Dock Spawn](http://dockspawn.com) by [Drew Noakes](https://drewnoakes.com)
* [:link:](documentdb/documentdb.d.ts) [DocumentDB](https://github.com/Azure/azure-documentdb-node) by [Noel Abrahams](https://github.com/NoelAbrahams), [Brett Gutstein](https://github.com/brettferdosi)
@@ -218,11 +235,13 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](domready/domready.d.ts) [domready](https://github.com/ded/domready) by [Christian Holm Nielsen](https://github.com/dotnetnerd)
* [:link:](donna/donna.d.ts) [donna](https://github.com/atom/donna) by [vvakame](https://github.com/vvakame)
* [:link:](dot/dot.d.ts) [doT](https://github.com/olado/doT) by [ZombieHunter](https://github.com/ZombieHunter)
* [:link:](dot-case/dot-case.d.ts) [dot-case](https://github.com/blakeembrey/dot-case) by [Sam Saint-Pettersen](https://github.com/stpettersens)
* [:link:](dotdotdot/dotdotdot.d.ts) [dotdotdot](http://dotdotdot.frebsite.nl) by [Milan Jaros](https://github.com/milanjaros)
* [:link:](doublearray/doublearray.d.ts) [doublearray](https://github.com/takuyaa/doublearray) by [MIZUSHIMA Junki](https://github.com/mzsm)
* [:link:](dragula/dragula.d.ts) [dragula](http://bevacqua.github.io/dragula) by [Paul Welter](https://github.com/pwelter34)
* [:link:](drop/drop.d.ts) [Drop](http://github.hubspot.com/drop) by [Adi Dahiya](https://github.com/adidahiya)
* [:link:](dropboxjs/dropboxjs.d.ts) [dropbox-js](https://github.com/dropbox/dropbox-js) by [Steve Fenton](https://github.com/Steve-Fenton), [Pedro Casaubon](https://github.com/xperiments)
* [:link:](dropzone/dropzone.d.ts) [Dropzone](http://www.dropzonejs.com) by [Natan Vivo](https://github.com/nvivo)
* [:link:](dropzone/dropzone.d.ts) [Dropzone](http://www.dropzonejs.com) by [Natan Vivo](https://github.com/nvivo), [Andy Hawkins](https://github.com/a904guy/,http://a904guy.com/,http://www.bmbsqd.com)
* [:link:](dsv/dsv.d.ts) [dsv](https://www.npmjs.com/package/dsv) by [Jason Swearingen](https://jasonswearingen.github.io)
* [:link:](dts-bundle/dts-bundle.d.ts) [dts-bundle](https://github.com/TypeStrong/dts-bundle) by [Asana](https://asana.com)
* [:link:](durandal/durandal.d.ts) [Durandal](http://durandaljs.com) by [Blue Spire](https://github.com/BlueSpire)
@@ -240,6 +259,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](ejs-locals/ejs-locals.d.ts) [ejs-locals](https://github.com/randometc/ejs-locals) by [jt000](https://github.com/jt000)
* [:link:](jquery.elang/jquery.elang.d.ts) [eLang](https://github.com/sumegizoltan/ELang) by [Zoltan Sumegi](https://github.com/sumegizoltan)
* [:link:](github-electron/github-electron.d.ts) [Electron (shared between main and rederer processes)](http://electron.atom.io) by [jedmao](https://github.com/jedmao)
* [:link:](github-electron/electron-prebuilt.d.ts) [electron-prebuilt](https://github.com/mafintosh/electron-prebuilt) by [rhysd](https://github.com/rhysd)
* [:link:](element-resize-event/element-resize-event.d.ts) [element-resize-event](https://github.com/KyleAMathews/element-resize-event) by [Rogier Schouten](https://github.com/rogierschouten)
* [:link:](elm/elm.d.ts) [Elm](http://elm-lang.org) by [Dénes Harmath](https://github.com/thSoft)
* [:link:](ember/ember.d.ts) [Ember.js](http://emberjs.com) by [Jed Mao](https://github.com/jedmao)
@@ -249,16 +269,20 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](epiceditor/epiceditor.d.ts) [EpicEditor](http://epiceditor.com) by [Boris Yankov](https://github.com/borisyankov)
* [:link:](eq.js/eq.js.d.ts) [eq.js](https://github.com/Snugug/eq.js) by [Stephen Lautier](https://github.com/stephenlautier)
* [:link:](errorhandler/errorhandler.d.ts) [errorhandler](https://github.com/expressjs/errorhandler) by [Santi Albo](https://github.com/santialbo)
* [:link:](es6-collections/es6-collections.d.ts) [es6-collections](https://github.com/WebReflection/es6-collections) by [Ron Buckton](http://github.com/rbuckton)
* [:link:](es6-promise/es6-promise.d.ts) [es6-promise](https://github.com/jakearchibald/ES6-Promise) by [François de Campredon](https://github.com/fdecampredon), [vvakame](https://github.com/vvakame)
* [:link:](es6-shim/es6-shim.d.ts) [es6-shim](https://github.com/paulmillr/es6-shim) by [Ron Buckton](http://github.com/rbuckton)
* [:link:](escape-latex/escape-latex.d.ts) [escape-latex](https://github.com/dangmai/escape-latex) by [Oliver Schneider](https://github.com/olsio)
* [:link:](esprima/esprima.d.ts) [Esprima](http://esprima.org) by [teppeis](https://github.com/teppeis), [RReverser](https://github.com/RReverser)
* [:link:](estree/flow.d.ts) [ESTree AST extensions for Facebook Flow](https://github.com/estree/estree) by [RReverser](https://github.com/RReverser)
* [:link:](estree/estree.d.ts) [ESTree AST specification](https://github.com/estree/estree) by [RReverser](https://github.com/RReverser)
* [:link:](event-kit/event-kit.d.ts) [event-kit](https://github.com/atom/event-kit) by [Vadim Macagon](https://github.com/enlight)
* [:link:](event-loop-lag/event-loop-lag.d.ts) [event-loop-lag](https://github.com/pebble/event-loop-lag) by [Rogier Schouten](https://github.com/rogierschouten)
* [:link:](eventemitter2/eventemitter2.d.ts) [EventEmitter2](https://github.com/asyncly/EventEmitter2) by [ryiwamoto](https://github.com/ryiwamoto)
* [:link:](eventemitter3/eventemitter3.d.ts) [EventEmitter3](https://github.com/primus/eventemitter3) by [Yuichi Murata](https://github.com/mrk21)
* [:link:](evernote/evernote.d.ts) [evernote v](https://www.npmjs.com/package/evernote) by [Zachary Collins](https://github.com/corps)
* [:link:](exit/exit.d.ts) [exit](https://github.com/cowboy/node-exit) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](expect.js/expect.js.d.ts) [expect.js](https://github.com/LearnBoost/expect.js) by [Teppei Sato](https://github.com/teppeis)
* [:link:](expect.js/expect.js.d.ts) [expect.js](https://github.com/Automattic/expect.js) by [Teppei Sato](https://github.com/teppeis)
* [:link:](expectations/expectations.d.ts) [expectations.js](https://github.com/spmason/expectations) by [vvakame](https://github.com/vvakame)
* [:link:](express/express.d.ts) [Express 4.x](http://expressjs.com) by [Boris Yankov](https://github.com/borisyankov)
* [:link:](express-debug/express-debug.d.ts) [express-debug](https://github.com/devoidfury/express-debug) by [Federico Bond](https://github.com/federicobond)
@@ -273,6 +297,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](eyes/eyes.d.ts) [eyes](https://github.com/cloudhead/eyes.js) by [bryn austin bellomy](https://github.com/brynbellomy)
* [:link:](fabricjs/fabricjs.d.ts) [FabricJS](http://fabricjs.com) by [Oliver Klemencic](https://github.com/oklemencic), [Joseph Livecchi](https://github.com/joewashear007)
* [:link:](fbsdk/fbsdk.d.ts) [Facebook Javascript SDK](https://developers.facebook.com/docs/javascript) by [Joshua Strobl](https://github.com/JoshStrobl)
* [:link:](famous/famous.d.ts) [Famous Engine](http://famous.org) by [Boris Vasilenko](https://github.com/borisvasilenko)
* [:link:](fancybox/fancybox.d.ts) [fancyBox](https://github.com/fancyapps/fancyBox) by [Boris Yankov](https://github.com/borisyankov)
* [:link:](farbtastic/farbtastic.d.ts) [Farbtastic: jQuery Color Wheel](http://mattfarina.github.io/farbtastic) by [Matt Brooks](https://github.com/EnableSoftware)
* [:link:](fast-stats/fast-stats.d.ts) [fast-stats](https://github.com/bluesmoon/node-faststats) by [Rogier Schouten](https://github.com/rogierschouten)
@@ -288,6 +313,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](fingerprintjs/fingerprint.d.ts) [fingerprintjs](https://github.com/Valve/fingerprintjs) by [Shunsuke Ohtani](https://github.com/zaneli)
* [:link:](state-machine/state-machine.d.ts) [Finite State Machine](https://github.com/jakesgordon/javascript-state-machine) by [Boris Yankov](https://github.com/borisyankov), [Maarten Docter](https://github.com/mdocter), [William Sears](https://github.com/MrBigDog2U)
* [:link:](firebase/firebase.d.ts) [Firebase API](https://www.firebase.com/docs/javascript/firebase) by [Vincent Botone](https://github.com/vbortone), [Shin1 Kashimura](https://github.com/in-async)
* [:link:](firebase-client/firebase-client.d.ts) [Firebase Client](https://www.github.com/jpstevens/firebase-client) by [Andrew Breen](https://github.com/fpsscarecrow)
* [:link:](firebase/firebase-simplelogin.d.ts) [Firebase Simple Login](https://www.firebase.com/docs/security/simple-login-overview.html) by [Wilker Lucio](http://github.com/wilkerlucio)
* [:link:](first-mate/first-mate.d.ts) [first-mate](https://github.com/atom/first-mate) by [Vadim Macagon](https://github.com/enlight)
* [:link:](flexSlider/flexSlider.d.ts) [FlexSlider 2 jquery plugin](https://github.com/woothemes/FlexSlider) by [Diullei Gomes](https://github.com/diullei)
@@ -318,6 +344,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](geojson/geojson.d.ts) [GeoJSON Format Specification](http://geojson.org) by [Jacob Bruun](https://github.com/cobster)
* [:link:](geometry-dom/geometry-dom.d.ts) [Geometry Format Specification](http://www.w3.org/TR/geometry-1) by [Toshiya Nakakura](https://github.com/nakakura)
* [:link:](giraffe/giraffe.d.ts) [Giraffe](https://github.com/barc/backbone.giraffe) by [Matt McCray](https://github.com/darthapo)
* [:link:](git-config/git-config.d.ts) [git-config](https://github.com/eugeneware/git-config) by [Sam Saint-Pettersen](https://github.com/stpettersens)
* [:link:](gl-matrix/gl-matrix.d.ts) [gl-matrix](https://github.com/toji/gl-matrix) by [Tat](https://github.com/tatchx)
* [:link:](gldatepicker/gldatepicker.d.ts) [glDatePicker](http://glad.github.com/glDatePicker) by [Dániel Tar](https://github.com/qcz)
* [:link:](glidejs/glidejs.d.ts) [Glide.js](http://glide.jedrzejchalubek.com) by [Milan Jaros](https://github.com/milanjaros)
@@ -350,6 +377,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](gsap/Core.d.ts) [GSAP](http://greensock.com) by [VILIC VANE](https://vilic.github.io)
* [:link:](gulp/gulp.d.ts) [Gulp v3.8.x](http://gulpjs.com) by [Drew Noakes](https://drewnoakes.com)
* [:link:](gulp-autoprefixer/gulp-autoprefixer.d.ts) [gulp-autoprefixer](https://github.com/sindresorhus/gulp-autoprefixer) by [Asana](https://asana.com)
* [:link:](gulp-cached/gulp-cached.d.ts) [gulp-cached](https://github.com/wearefractal/gulp-cached) by [Thomas Corbière](https://github.com/tomc974)
* [:link:](gulp-concat/gulp-concat.d.ts) [gulp-concat](http://github.com/wearefractal/gulp-concat) by [Keita Kagurazaka](https://github.com/k-kagurazaka)
* [:link:](gulp-rev/gulp-rev.d.ts) [gulp-csso](https://github.com/sindresorhus/gulp-rev) by [Tanguy Krotoff](https://github.com/tkrotoff)
* [:link:](gulp-csso/gulp-csso.d.ts) [gulp-csso](https://github.com/ben-eb/gulp-csso) by [Tanguy Krotoff](https://github.com/tkrotoff)
@@ -361,20 +389,23 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](gulp-istanbul/gulp-istanbul.d.ts) [gulp-istanbul](https://github.com/SBoudrias/gulp-istanbul) by [Asana](https://asana.com)
* [:link:](gulp-jasmine-browser/gulp-jasmine-browser.d.ts) [gulp-jasmine-browser](https://github.com/jasmine/gulp-jasmine-browser) by [Tanguy Krotoff](https://github.com/tkrotoff)
* [:link:](gulp-less/gulp-less.d.ts) [gulp-less](https://github.com/plus3network/gulp-less) by [Keita Kagurazaka](https://github.com/k-kagurazaka)
* [:link:](gulp-load-plugins/gulp-load-plugins.d.ts) [gulp-load-plugins](https://github.com/jackfranklin/gulp-load-plugins) by [Joe Skeen](http://github.com/joeskeen)
* [:link:](gulp-minify-css/gulp-minify-css.d.ts) [gulp-minify-css](https://github.com/jonathanepollack/gulp-minify-css) by [Keita Kagurazaka](https://github.com/k-kagurazaka)
* [:link:](gulp-minify-html/gulp-minify-html.d.ts) [gulp-minify-html](https://github.com/murphydanger/gulp-minify-html) by [Tanguy Krotoff](https://github.com/tkrotoff)
* [:link:](gulp-mocha/gulp-mocha.d.ts) [gulp-mocha](https://github.com/sindresorhus/gulp-mocha) by [Asana](https://asana.com)
* [:link:](gulp-protractor/gulp-protractor.d.ts) [gulp-protractor](https://github.com/mllrsohn/gulp-protractor) by [Tanguy Krotoff](https://github.com/tkrotoff)
* [:link:](gulp-remember/gulp-remember.d.ts) [gulp-remember](https://github.com/ahaurw01/gulp-remember) by [Thomas Corbière](https://github.com/tomc974)
* [:link:](gulp-rename/gulp-rename.d.ts) [gulp-rename](https://github.com/hparra/gulp-rename) by [Asana](https://asana.com)
* [:link:](gulp-replace/gulp-replace.d.ts) [gulp-replace](https://github.com/lazd/gulp-replace) by [Asana](https://asana.com)
* [:link:](gulp-rev-replace/gulp-rev-replace.d.ts) [gulp-rev-replace](https://github.com/jamesknelson/gulp-rev-replace) by [Tanguy Krotoff](https://github.com/tkrotoff)
* [:link:](gulp-ruby-sass/gulp-ruby-sass.d.ts) [gulp-ruby-sass](https://github.com/sindresorhus/gulp-ruby-sass) by [Agnislav Onufrijchuk](https://github.com/agnislav)
* [:link:](gulp-sass/gulp-sass.d.ts) [gulp-sass](https://github.com/dlmanning/gulp-sass) by [Asana](https://asana.com)
* [:link:](gulp-size/gulp-size.d.ts) [gulp-size](https://github.com/sindresorhus/gulp-size) by [Tanguy Krotoff](https://github.com/tkrotoff)
* [:link:](gulp-sourcemaps/gulp-sourcemaps.d.ts) [gulp-sourcemaps](https://github.com/floridoo/gulp-sourcemaps) by [Asana](https://asana.com)
* [:link:](gulp-tsd/gulp-tsd.d.ts) [gulp-tsd](https://github.com/moznion/gulp-tsd) by [Keita Kagurazaka](https://github.com/k-kagurazaka)
* [:link:](gulp-tslint/gulp-tslint.d.ts) [gulp-tslint](https://github.com/panuhorsmalahti/gulp-tslint) by [Asana](https://asana.com)
* [:link:](gulp-typedoc/gulp-typedoc.d.ts) [gulp-typedoc](https://github.com/rogierschouten/gulp-typedoc) by [Asana](https://asana.com)
* [:link:](gulp-typescript/gulp-typescript.d.ts) [gulp-typescript](https://github.com/ivogabe/gulp-typescript) by [Asana](https://asana.com)
* [:link:](gulp-typescript/gulp-typescript.d.ts) [gulp-typescript](https://github.com/ivogabe/gulp-typescript) by [Asana](https://asana.com), [Thomas Corbière](https://github.com/tomc974)
* [:link:](gulp-uglify/gulp-uglify.d.ts) [gulp-uglify](https://github.com/terinjokes/gulp-uglify) by [Christopher Haws](https://github.com/ChristopherHaws)
* [:link:](gulp-useref/gulp-useref.d.ts) [gulp-useref](https://github.com/jonkemp/gulp-useref) by [Tanguy Krotoff](https://github.com/tkrotoff)
* [:link:](gulp-util/gulp-util.d.ts) [gulp-util v3.0.x](https://github.com/gulpjs/gulp-util) by [jedmao](https://github.com/jedmao)
@@ -384,7 +415,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](hapi/hapi.d.ts) [hapi](http://github.com/spumko/hapi) by [Jason Swearingen](http://github.com/jasonswearingen)
* [:link:](hasher/hasher.d.ts) [Hasher.js](https://github.com/millermedeiros/hasher) by [flyfishMT](https://github.com/flyfishMT)
* [:link:](hashids/hashids.d.ts) [Hashids.js 1.x](https://github.com/ivanakimov/hashids.node.js) by [Paulo Cesar](https://github.com/pocesar)
* [:link:](hashmap/hashmap.d.ts) [HashMap](https://github.com/flesler/hashmap) by [Rafał Wrzeszcz](http://wrzasq.pl)
* [:link:](hashmap/hashmap.d.ts) [HashMap](https://github.com/flesler/hashmap) by [Rafał Wrzeszcz](http://wrzasq.pl), [Vasya Aksyonov](https://github.com/outring)
* [:link:](he/he.d.ts) [he](https://github.com/mathiasbynens/he) by [Simon Edwards](https://github.com/sedwards2009)
* [:link:](Headroom/headroom.d.ts) [headroom.js](http://wicky.nillia.ms/headroom.js) by [Jakub Olek](https://github.com/hakubo)
* [:link:](heap/heap.d.ts) [heap](https://github.com/qiao/heap.js) by [Ryan McNamara](https://github.com/ryan10132)
@@ -400,19 +431,20 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](html2canvas/html2canvas.d.ts) [html2canvas.js](https://github.com/niklasvh/html2canvas) by [Richard Hepburn](https://github.com/rwhepburn)
* [:link:](htmlparser2/htmlparser2.d.ts) [htmlparser2 v3.7.x](https://github.com/fb55/htmlparser2) by [James Roland Cabresos](https://github.com/staticfunction)
* [:link:](htmltojsx/htmltojsx.d.ts) [htmltojsx](https://www.npmjs.com/package/htmltojsx) by [Basarat Ali Syed](https://github.com/basarat)
* [:link:](statuses/statuses.d.ts) [http-errors](https://github.com/jshttp/statuses) by [Tanguy Krotoff](https://github.com/tkrotoff)
* [:link:](http-errors/http-errors.d.ts) [http-errors](https://github.com/jshttp/http-errors) by [Tanguy Krotoff](https://github.com/tkrotoff)
* [:link:](statuses/statuses.d.ts) [http-errors](https://github.com/jshttp/statuses) by [Tanguy Krotoff](https://github.com/tkrotoff)
* [:link:](http-status/http-status.d.ts) [http-status](https://github.com/wdavidw/node-http-status) by [Michael Zabka](https://github.com/misak113)
* [:link:](http-string-parser/http-string-parser.d.ts) [http-string-parser](https://github.com/apiaryio/http-string-parser) by [MIZUNE Pine](https://github.com/pine613)
* [:link:](humane/humane.d.ts) [Humane](http://wavded.github.com/humane-js) by [jmvrbanac](https://github.com/jmvrbanac)
* [:link:](hypertext-application-language/hypertext-application-language.d.ts) [Hypertext Application Language Draft 6](https://tools.ietf.org/html/draft-kelly-json-hal-06) by [Maks3w](https://github.com/maks3w)
* [:link:](i18n-node/i18n-node.d.ts) [i18n-node](https://github.com/mashpie/i18n-node) by [Maxime LUCE](https://github.com/SomaticIT)
* [:link:](i18next/i18next.d.ts) [i18next](http://i18next.com) by [Maarten Docter](https://github.com/mdocter)
* [:link:](ng-i18next/ng-i18next.d.ts) [i18next](https://github.com/i18next/ng-i18next) by [Cyril Schumacher](https://github.com/cyrilschumacher)
* [:link:](i18next/i18next.d.ts) [i18next](http://i18next.com) by [Maarten Docter](https://github.com/mdocter)
* [:link:](iban/iban.d.ts) [iban.js](https://github.com/arhs/iban.js) by [Cyril Schumacher](https://github.com/cyrilschumacher)
* [:link:](icheck/icheck.d.ts) [iCheck](http://damirfoy.com/iCheck) by [Dániel Tar](https://github.com/qcz)
* [:link:](imagemagick/imagemagick.d.ts) [imagemagick](http://github.com/rsms/node-imagemagick) by [Carlos Ballesteros Velasco](https://github.com/soywiz)
* [:link:](imagemagick-native/imagemagick-native.d.ts) [imagemagick-native](https://www.npmjs.org/package/imagemagick-native) by [Hiroki Horiuchi](https://github.com/horiuchi)
* [:link:](imagesloaded/imagesloaded.d.ts) [imagesLoaded](https://github.com/desandro/imagesloaded) by [Chris Charabaruk](http://github.com/coldacid)
* [:link:](imap/imap.d.ts) [imap](https://www.npmjs.com/package/imap) by [Peter Snider](https://github.com/psnider)
* [:link:](imgur-rest-api/imgur-rest-api.d.ts) [Imgur REST API v3](https://api.imgur.com) by [Luke William Westby](http://github.com/lukewestby)
* [:link:](impress/impress.d.ts) [Impress.js](https://github.com/bartaz/impress.js) by [Boris Yankov](https://github.com/borisyankov)
@@ -423,13 +455,17 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](interactjs/interact.d.ts) [Interacting for interact.js](https://github.com/taye/interact.js) by [Douglas Eichelberger](https://github.com/dduugg), [Adi Dahiya](https://github.com/adidahiya), [Tom Hasner](https://github.com/thasner)
* [:link:](intercomjs/intercom.d.ts) [intercom.js](https://github.com/diy/intercom.js) by [spencerwi](http://github.com/spencerwi)
* [:link:](inversify/inversify.d.ts) [inversify](https://github.com/inversify/InversifyJS) by [inversify](https://github.com/inversify)
* [:link:](ionic/ionic.d.ts) [Ionic](http://ionicframework.com) by [Spencer Williams](https://github.com/spencerwi)
* [:link:](cordova-ionic/cordova-ionic.d.ts) [Ionic Cordova plugins](https://github.com/driftyco) by [Hendrik Maus](https://github.com/hendrikmaus)
* [:link:](irc/irc.d.ts) [irc](https://github.com/martynsmith/node-irc) by [phillips1012](https://github.com/phillips1012)
* [:link:](is-lower-case/is-lower-case.d.ts) [is-lower-case](https://github.com/blakeembrey/is-lower-case) by [Sam Saint-Pettersen](https://github.com/stpettersens)
* [:link:](is-upper-case/is-upper-case.d.ts) [is-upper-case](https://github.com/blakeembrey/is-upper-case) by [Sam Saint-Pettersen](https://github.com/stpettersens)
* [:link:](is_js/is_js.d.ts) [is.js](http://arasatasaygin.github.io/is.js) by [Rodrigo Cabral](https://github.com/cabralRodrigo)
* [:link:](iscroll/iscroll.d.ts) [iScroll](http://cubiq.org/iscroll-4) by [Boris Yankov](https://github.com/borisyankov), [Christiaan Rakowski](https://github.com/csrakowski)
* [:link:](iscroll/iscroll-5.d.ts) [iScroll 5](http://cubiq.org/iscroll-5-ready-for-beta-test) by [Christiaan Rakowski](https://github.com/csrakowski)
* [:link:](iscroll/iscroll-lite.d.ts) [iScroll Lite](http://cubiq.org/iscroll-4) by [Boris Yankov](https://github.com/borisyankov), [Christiaan Rakowski](https://github.com/csrakowski)
* [:link:](iscroll/iscroll-5-lite.d.ts) [iScroll Lite 5](http://cubiq.org/iscroll-5-ready-for-beta-test) by [Christiaan Rakowski](https://github.com/csrakowski)
* [:link:](iso8601-localizer/iso8601-localizer.d.ts) [ISO8601-Localizer](https://github.com/avielfedida/ISO8601-Localizer) by [Aviel Fedida](https://github.com/avielfedida)
* [:link:](ix.js/ix.d.ts) [IxJS 1.0.6 / ix.js](https://github.com/Reactive-Extensions/IxJS) by [Igor Oleinikov](https://github.com/Igorbek)
* [:link:](ix.js/l2o.d.ts) [IxJS 1.0.6 / l2o.js](https://github.com/Reactive-Extensions/IxJS) by [Igor Oleinikov](https://github.com/Igorbek)
* [:link:](jake/jake.d.ts) [jake](https://github.com/mde/jake) by [Kon](http://phyzkit.net)
@@ -450,7 +486,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](jjve/jjve.d.ts) [JJVE](https://github.com/silas/jjve) by [Wim Looman](https://github.com/Nemo157)
* [:link:](joData/joData.d.ts) [joData](https://github.com/mccow002/joData) by [Chris Wrench](https://github.com/cgwrench)
* [:link:](johnny-five/johnny-five.d.ts) [johnny-five](https://github.com/rwaldron/johnny-five) by [Toshiya Nakakura](https://github.com/nakakura)
* [:link:](joi/joi.d.ts) [joi](https://github.com/spumko/joi) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](joi/joi.d.ts) [joi](https://github.com/spumko/joi) by [Bart van der Schoor](https://github.com/Bartvds), [Laurence Dougal Myers](https://github.com/laurence-myers)
* [:link:](jointjs/jointjs.d.ts) [Joint JS](http://www.jointjs.com) by [Aidan Reel](http://github.com/areel), [David Durman](http://github.com/DavidDurman), [Ewout Van Gossum](https://github.com/DenEwout)
* [:link:](jqrangeslider/jqrangeslider.d.ts) [jQRangeSlider](http://ghusse.github.com/jQRangeSlider) by [Dániel Tar](https://github.com/qcz)
* [:link:](jquery/jquery.d.ts) [jQuery 1.10.x / 2.0.x](http://jquery.com) by [Boris Yankov](https://github.com/borisyankov), [Christian Hoffmeister](https://github.com/choffmeister), [Steve Fenton](https://github.com/Steve-Fenton), [Diullei Gomes](https://github.com/Diullei), [Tass Iliopoulos](https://github.com/tasoili), [Jason Swearingen](https://github.com/jasons-novaleaf), [Sean Hill](https://github.com/seanski), [Guus Goossens](https://github.com/Guuz), [Kelly Summerlin](https://github.com/ksummerlin), [Basarat Ali Syed](https://github.com/basarat), [Nicholas Wolverson](https://github.com/nwolverson), [Derek Cicerone](https://github.com/derekcicerone), [Andrew Gaspar](https://github.com/AndrewGaspar), [James Harrison Fisher](https://github.com/jameshfisher), [Seikichi Kondo](https://github.com/seikichi), [Benjamin Jackman](https://github.com/benjaminjackman), [Poul Sorensen](https://github.com/s093294), [Josh Strobl](https://github.com/JoshStrobl), [John Reilly](https://github.com/johnnyreilly), [Dick van den Brink](https://github.com/DickvdBrink)
@@ -464,6 +500,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](jquery.fileupload/jquery.fileupload.d.ts) [jQuery File Upload Plugin](https://github.com/blueimp/jQuery-File-Upload) by [Rob Alarcon](https://github.com/rob-alarcon)
* [:link:](jquery.joyride/jquery.joyride.d.ts) [jQuery JoyRide Plugin](https://github.com/zurb/joyride) by [Vincent Bortone](https://github.com/vbortone)
* [:link:](jqgrid/jqgrid.d.ts) [jQuery jqgrid Plugin](https://github.com/tonytomov/jqGrid) by [Lokesh Peta](https://github.com/lokeshpeta)
* [:link:](jquery-knob/jquery-knob.d.ts) [jQuery Knob](http://anthonyterrien.com/knob) by [Iain Buchanan](https://github.com/iain8)
* [:link:](jquerymobile/jquerymobile.d.ts) [jQuery Mobile](http://jquerymobile.com) by [Boris Yankov](https://github.com/borisyankov)
* [:link:](jquery.notifyBar/jquery.notifyBar.d.ts) [jQuery Notify Bar](http://www.whoop.ee/posts/2013-04-05-the-resurrection-of-jquery-notify-bar) by [Shunsuke Ohtani](https://github.com/zaneli)
* [:link:](jquery.base64/jquery.base64.d.ts) [jQuery Plugin - base64 codec](https://github.com/yatt/jquery.base64) by [Shinya Mochizuki](https://github.com/enrapt-mochizuki)
@@ -504,7 +541,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](jquery.jsignature/jquery.jsignature.d.ts) [jQuery.jsignature v2](https://github.com/willowsystems/jSignature) by [Patrick Magee](https://github.com/pjmagee)
* [:link:](jquery-jsonrpcclient/jquery-jsonrpcclient.d.ts) [jquery.jsonrpc](https://github.com/Textalk/jquery.jsonrpcclient.js) by [Maksim Karelov](https://github.com/Ty3uK)
* [:link:](jquery.noty/jquery.noty.d.ts) [jQuery.noty](http://needim.github.io/noty) by [Aaron King](https://github.com/kingdango)
* [:link:](jquery.payment/jquery.payment.d.ts) [jQuery.payment](https://github.com/stripe/jquery.payment) by [Eric J. Smith](https://github.com/ejsmith)
* [:link:](jquery.payment/jquery.payment.d.ts) [jQuery.payment](https://github.com/stripe/jquery.payment) by [Eric J. Smith](https://github.com/ejsmith), [John Rutherford](https://github.com/johnrutherford)
* [:link:](jquery.pjax.falsandtru/jquery.pjax.d.ts) [jquery.pjax.ts by falsandtru](https://github.com/falsandtru/jquery.pjax.js) by [新ゝ月 NewNotMoon](http://new.not-moon.net)
* [:link:](jquery.placeholder/jquery.placeholder.d.ts) [jquery.placeholder.js](https://github.com/mathiasbynens/jquery-placeholder) by [Peter Gill](https://github.com/majorsilence), [Neil Culver](https://github.com/EnableSoftware)
* [:link:](jquery.pnotify/jquery.pnotify.d.ts) [jquery.pnotify 2.x](https://github.com/sciactive/pnotify) by [David Sichau](https://github.com/DavidSichau)
@@ -522,6 +559,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](jquery.total-storage/jquery.total-storage.d.ts) [jQueryTotalStorage](https://github.com/Upstatement/jquery-total-storage) by [Jeremy Brooks](https://github.com/JeremyCBrooks)
* [:link:](jqueryui/jqueryui.d.ts) [jQueryUI](http://jqueryui.com) by [Boris Yankov](https://github.com/borisyankov), [John Reilly](https://github.com/johnnyreilly)
* [:link:](js-cookie/js-cookie.d.ts) [js-cookie](https://github.com/js-cookie/js-cookie) by [Theodore Brown](https://github.com/theodorejb)
* [:link:](ua-parser-js/ua-parser-js.d.ts) [js-cookie](https://github.com/faisalman/ua-parser-js) by [Viktor Miroshnikov](https://github.com/superduper)
* [:link:](js-fixtures/fixtures.d.ts) [js-fixtures](https://github.com/badunk/js-fixtures) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid)
* [:link:](js-git/js-git.d.ts) [js-git](https://github.com/creationix/js-git) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](js-signals/js-signals.d.ts) [JS-Signals](http://millermedeiros.github.io/js-signals) by [Diullei Gomes](https://github.com/diullei)
@@ -560,6 +598,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](kafka-node/kafka-node.d.ts) [kafka-node](https://github.com/SOHU-Co/kafka-node) by [Daniel Imrie-Situnayake](https://github.com/dansitu)
* [:link:](karma/karma.d.ts) [karma](https://github.com/karma-runner/karma) by [Tanguy Krotoff](https://github.com/tkrotoff)
* [:link:](karma-jasmine/karma-jasmine.d.ts) [karma-jasmine plugin](https://github.com/karma-runner/karma-jasmine) by [Michel Salib](https://github.com/michelsalib)
* [:link:](katex/katex.d.ts) [KaTeX v.0.5.0](http://khan.github.io/KaTeX) by [Michael Randolph](https://github.com/mrand01)
* [:link:](kendo-ui/kendo-ui.d.ts) [Kendo UI Professional](http://www.telerik.com/kendo-ui) by [Telerik](https://github.com/telerik)
* [:link:](keyboardjs/keyboardjs.d.ts) [KeyboardJS](https://github.com/RobertWHurst/KeyboardJS) by [Vincent Bortone](https://github.com/vbortone)
* [:link:](keymaster/keymaster.d.ts) [keymaster](https://github.com/madrobby/keymaster) by [Martin W. Kirst](https://github.com/nitram509)
@@ -593,6 +632,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](ladda/ladda.d.ts) [Ladda](https://github.com/hakimel/Ladda) by [Danil Flores](https://github.com/dflor003), [Michael Lee](https://github.com/leemicw)
* [:link:](later/later.d.ts) [LaterJS](http://bunkat.github.io/later) by [Jason D Dryhurst-Smith](http://jasonds.co.uk)
* [:link:](lazy.js/lazy.js.d.ts) [Lazy.js](https://github.com/dtao/lazy.js) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](lazypipe/lazypipe.d.ts) [lazypipe](https://github.com/OverZealous/lazypipe) by [Thomas Corbière](https://github.com/tomc974)
* [:link:](leaflet/leaflet.d.ts) [Leaflet.js](https://github.com/Leaflet/Leaflet) by [Vladimir Zotov](https://github.com/rgripper)
* [:link:](leaflet-label/leaflet-label.d.ts) [Leaflet.label](https://github.com/Leaflet/Leaflet.label) by [Wim Looman](https://github.com/Nemo157)
* [:link:](jquery.leanModal/jquery.leanModal.d.ts) [leanModal.js](http://leanmodal.finelysliced.com.au) by [FinelySliced](https://github.com/FinelySliced)
@@ -605,7 +645,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](linq/linq.jquery.d.ts) [linq.jquery (from linq.js)](http://linqjs.codeplex.com) by [neuecc](http://www.codeplex.com/site/users/view/neuecc)
* [:link:](linq/linq.d.ts) [linq.js](http://linqjs.codeplex.com) by [Marcin Najder](https://github.com/marcinnajder), [Sebastiaan Dammann](https://github.com/Sebazzz)
* [:link:](jquery.livestampjs/jquery.livestampjs.d.ts) [Livestamp.js](http://mattbradley.github.com/livestampjs) by [Vincent Bortone](https://github.com/vbortone)
* [:link:](lodash/lodash.d.ts) [Lo-Dash](http://lodash.com) by [Brian Zengel](https://github.com/bczengel)
* [:link:](lodash/lodash.d.ts) [Lo-Dash](http://lodash.com) by [Brian Zengel](https://github.com/bczengel), [Ilya Mochalov](https://github.com/chrootsu)
* [:link:](lockfile/lockfile.d.ts) [lockfile](https://github.com/isaacs/lockfile) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](log4javascript/log4javascript.d.ts) [log4javascript](http://log4javascript.org) by [Markus Wagner](https://github.com/Ritzlgrmft)
* [:link:](log4js/log4js.d.ts) [log4js](https://github.com/nomiddlename/log4js-node) by [Kentaro Okuno](http://github.com/armorik83)
@@ -618,13 +658,17 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](long/long.d.ts) [Long.js](https://github.com/dcodeIO/Long.js) by [Peter Kooijmans](https://github.com/peterkooijmans)
* [:link:](lory.js/lory.js.d.ts) [lory](https://github.com/meandmax/lory) by [kubosho](https://github.com/kubosho)
* [:link:](lovefield/lovefield.d.ts) [Lovefield](http://google.github.io/lovefield) by [freshp86](https://github.com/freshp86)
* [:link:](lower-case/lower-case.d.ts) [lower-case](https://github.com/blakeembrey/lower-case) by [Sam Saint-Pettersen](https://github.com/stpettersens)
* [:link:](lower-case-first/lower-case-first.d.ts) [lower-case-first](https://github.com/blakeembrey/lower-case-first) by [Sam Saint-Pettersen](https://github.com/stpettersens)
* [:link:](lru-cache/lru-cache.d.ts) [lru-cache](https://github.com/isaacs/node-lru-cache) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](lscache/lscache.d.ts) [lscache](https://github.com/pamelafox/lscache) by [Chris Martinez](https://github.com/Chris-Martinezz)
* [:link:](luaparse/luaparse.d.ts) [luaparse](https://github.com/oxyc/luaparse) by [Sam Saint-Pettersen](https://github.com/stpettersens)
* [:link:](lunr/lunr.d.ts) [lunr.js](https://github.com/olivernn/lunr.js) by [Sebastian Lenz](https://github.com/sebastian-lenz)
* [:link:](lz-string/lz-string.d.ts) [lz-string](https://github.com/pieroxy/lz-string) by [Roman Nikitin](https://github.com/M0ns1gn0r)
* [:link:](magic-number/magic-number.d.ts) [magic-number](https://github.com/stpettersens/node-magic-number) by [Sam Saint-Pettersen](https://github.com/stpettersens)
* [:link:](magicsuggest/magicsuggest.d.ts) [MagicSuggest](http://nicolasbize.com/magicsuggest) by [Leonardo Chaia](http://github.com/leonardochaia)
* [:link:](mailcheck/mailcheck.d.ts) [Mailcheck](https://github.com/mailcheck/mailcheck) by [Paulo Cesar](http://github.com/pocesar)
* [:link:](maildev/maildev.d.ts) [maildev](https://github.com/djfarrelly/maildev) by [Cyril Schumacher](https://github.com/cyrilschumacher)
* [:link:](main-bower-files/main-bower-files.d.ts) [main-bower-files](https://github.com/ck86/main-bower-files) by [Keita Kagurazaka](https://github.com/k-kagurazaka)
* [:link:](maker.js/makerjs.d.ts) [Maker.js](https://github.com/Microsoft/maker.js) by [Dan Marshall](https://github.com/danmarshall)
* [:link:](mandrill-api/mandrill-api.d.ts) [Mandrill API 1.x](http://mandrill.com) by [Paulo Cesar](https://github.com/pocesar)
@@ -646,10 +690,10 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](messenger/messenger.d.ts) [Messenger.js](https://github.com/HubSpot/messenger) by [Derek Cicerone](https://github.com/derekcicerone)
* [:link:](meteor/meteor.d.ts) [Meteor](http://www.meteor.com) by [Dave Allen](https://github.com/fullflavedave)
* [:link:](method-override/method-override.d.ts) [method-override](https://github.com/expressjs/method-override) by [Santi Albo](https://github.com/santialbo)
* [:link:](metismenu/metismenu.d.ts) [metisMenu](http://github.com/onokumus/metisMenu) by [onokums](https://github.com/onokumus)
* [:link:](microsoft-ajax/microsoft.ajax.d.ts) [Microsoft ASP.NET Ajax client side library](http://msdn.microsoft.com/en-us/library/ee341002(v=vs.100).aspx) by [Patrick Magee](https://github.com/pjmagee)
* [:link:](xrm/xrm.d.ts) [Microsoft Dynamics xRM API](http://www.microsoft.com/en-us/download/details.aspx?id=44567) by [David Berry](https://github.com/6ix4our), [Matt Ngan](https://github.com/mattngan)
* [:link:](xrm/xrm-6.d.ts) [Microsoft Dynamics xRM API v6](http://msdn.microsoft.com/en-us/library/gg328255.aspx) by [David Berry](https://github.com/6ix4our)
* [:link:](xrm/clientglobalcontext.d.ts) [Microsoft Dynamics xRM ClientGlobalContext.js.aspx](http://msdn.microsoft.com/en-us/library/gg328255.aspx) by [David Berry](https://github.com/6ix4our)
* [:link:](jquery-validation-unobtrusive/jquery-validation-unobtrusive.d.ts) [Microsoft jQuery Unobtrusive Validation](http://aspnetwebstack.codeplex.com) by [Matt Brooks](https://github.com/EnableSoftware)
* [:link:](microsoft-live-connect/microsoft-live-connect.d.ts) [Microsoft Live Connect](http://msdn.microsoft.com/en-us/library/live/hh243643.aspx) by [John Vilk](https://github.com/jvilk)
* [:link:](xrm/parature.d.ts) [Microsoft Parature extentions to Xrm.Page - available for CRM Online Only](http://msdn.microsoft.com/en-us/library/gg328255.aspx) by [David Berry](https://github.com/6ix4our)
@@ -672,15 +716,16 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](mkdirp/mkdirp.d.ts) [mkdirp](http://github.com/substack/node-mkdirp) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](mkpath/mkpath.d.ts) [mkpath](https://www.npmjs.com/package/mkpath) by [Jared Klopper](https://github.com/optical)
* [:link:](mobile-detect/mobile-detect.d.ts) [mobile-detect](http://hgoebl.github.io/mobile-detect.js) by [Martin McWhorter](https://github.com/martinmcwhorter)
* [:link:](mocha/mocha.d.ts) [mocha](http://mochajs.org) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid), [otiai10](https://github.com/otiai10), [jt000](https://github.com/jt000), [Vadim Macagon](https://github.com/enlight)
* [:link:](mocha/mocha-node.d.ts) [mocha](http://mochajs.org) by [Vadim Macagon](https://github.com/enlight), [vvakame](https://github.com/vvakame)
* [:link:](mocha/mocha.d.ts) [mocha](http://mochajs.org) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid), [otiai10](https://github.com/otiai10), [jt000](https://github.com/jt000), [Vadim Macagon](https://github.com/enlight)
* [:link:](mocha-phantomjs/mocha-phantomjs.d.ts) [mocha-phantomjs](http://metaskills.net/mocha-phantomjs) by [Erik Schierboom](https://github.com/ErikSchierboom)
* [:link:](mock-fs/mock-fs.d.ts) [mock-fs](https://github.com/tschaub/mock-fs) by [Wim Looman](https://github.com/Nemo157)
* [:link:](mockery/mockery.d.ts) [mockery](https://github.com/mfncooper/mockery) by [jt000](https://github.com/jt000)
* [:link:](modernizr/modernizr.d.ts) [Modernizr](http://modernizr.com) by [Boris Yankov](https://github.com/borisyankov), [Theodore Brown](https://github.com/theodorejb)
* [:link:](moment-timezone/moment-timezone.d.ts) [moment-timezone.js](http://momentjs.com/timezone) by [Michel Salib](https://github.com/michelsalib)
* [:link:](moment/moment-node.d.ts) [Moment.js](https://github.com/timrwood/moment) by [Michael Lakerveld](https://github.com/Lakerfield), [Aaron King](https://github.com/kingdango), [Hiroki Horiuchi](https://github.com/horiuchi), [Dick van den Brink](https://github.com/DickvdBrink), [Adi Dahiya](https://github.com/adidahiya)
* [:link:](moment/moment.d.ts) [Moment.js](https://github.com/timrwood/moment) by [Michael Lakerveld](https://github.com/Lakerfield), [Aaron King](https://github.com/kingdango), [Hiroki Horiuchi](https://github.com/horiuchi), [Dick van den Brink](https://github.com/DickvdBrink), [Adi Dahiya](https://github.com/adidahiya)
* [:link:](moment/moment-node.d.ts) [Moment.js](https://github.com/timrwood/moment) by [Michael Lakerveld](https://github.com/Lakerfield), [Aaron King](https://github.com/kingdango), [Hiroki Horiuchi](https://github.com/horiuchi), [Dick van den Brink](https://github.com/DickvdBrink), [Adi Dahiya](https://github.com/adidahiya), [Matt Brooks](https://github.com/EnableSoftware)
* [:link:](moment/moment.d.ts) [Moment.js](https://github.com/timrwood/moment) by [Michael Lakerveld](https://github.com/Lakerfield), [Aaron King](https://github.com/kingdango), [Hiroki Horiuchi](https://github.com/horiuchi), [Dick van den Brink](https://github.com/DickvdBrink), [Adi Dahiya](https://github.com/adidahiya), [Matt Brooks](https://github.com/EnableSoftware)
* [:link:](moment-range/moment-range.d.ts) [Moment.js](https://github.com/gf3/moment-range) by [Bart van den Burg](https://github.com/Burgov), [Wilgert Velinga](https://github.com/wilgert)
* [:link:](mongodb/mongodb.d.ts) [MongoDB](https://github.com/mongodb/node-mongodb-native) by [Boris Yankov](https://github.com/borisyankov)
* [:link:](mongoose/mongoose.d.ts) [Mongoose](http://mongoosejs.com) by [horiuchi](https://github.com/horiuchi)
* [:link:](mongoose-mock/mongoose-mock.d.ts) [mongoose-mock](https://github.com/JohanObrink/mongoose-mock) by [jt000](https://github.com/jt000)
@@ -705,8 +750,10 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](nedb/nedb.d.ts) [NeDB](https://github.com/louischatriot/nedb) by [Stefan Steinhart](https://github.com/reppners)
* [:link:](needle/needle.d.ts) [needle](https://github.com/tomas/needle) by [San Chen](https://github.com/bigsan)
* [:link:](nexpect/nexpect.d.ts) [nexpect](https://github.com/nodejitsu/nexpect) by [vvakame](http://github.com/vvakame)
* [:link:](ng-command/ng-command.d.ts) [ng-command](https://github.com/stephenlautier/ng-command) by [Stephen Lautier](https://github.com/stephenlautier)
* [:link:](ng-grid/ng-grid.d.ts) [ng-grid](http://angular-ui.github.io/ng-grid) by [Ken Smith](https://github.com/smithkl42), [Roland Zwaga](https://github.com/rolandzwaga), [Kent Cooper](https://github.com/kentcooper)
* [:link:](angular-idle/angular-idle.d.ts) [ng-idle](http://hackedbychinese.github.io/ng-idle) by [mthamil](https://github.com/mthamil)
* [:link:](ngkookies/ngkookies.d.ts) [ngKookes](https://github.com/voronianski/ngKookies) by [Martin McWhorter](https://github.com/martinmcwhorter)
* [:link:](ngprogress/ngprogress.d.ts) [ngProgress](http://victorbjelkholm.github.io/ngProgress) by [Martin McWhorter](https://github.com/martinmcwhorter)
* [:link:](ngprogress-lite/ngprogress-lite.d.ts) [ngprogress-lite](https://github.com/voronianski/ngprogress-lite) by [Luke Forder](https://github.com/LukeForder)
* [:link:](nightmare/nightmare.d.ts) [Nightmare](https://github.com/segmentio/nightmare) by [horiuchi](https://github.com/horiuchi)
@@ -722,22 +769,24 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](node-fibers/node-fibers.d.ts) [node-fibers](https://github.com/laverdet/node-fibers) by [Cary Haynie](https://github.com/caryhaynie)
* [:link:](node-form/node-form.d.ts) [node-form](https://github.com/rsamec/form) by [Roman Samec](https://github.com/rsamec)
* [:link:](node-gcm/node-gcm.d.ts) [node-gcm](https://www.npmjs.org/package/node-gcm) by [Hiroki Horiuchi](https://github.com/horiuchi)
* [:link:](node-getopt/node-getopt.d.ts) [node-getopt](https://github.com/jiangmiao/node-getopt) by [Karl.M.Cauchy](https://github.com/kcauchy)
* [:link:](node-git/node-git.d.ts) [node-git](https://github.com/christkv/node-git) by [vvakame](https://github.com/vvakame)
* [:link:](ip/ip.d.ts) [node-ip](https://github.com/indutny/node-ip) by [Peter Harris](https://github.com/codeanimal)
* [:link:](multiparty/multiparty.d.ts) [node-multiparty](https://github.com/andrewrk/node-multiparty) by [Ken Fukuyama](https://github.com/kenfdev)
* [:link:](mysql/mysql.d.ts) [node-mysql](https://github.com/felixge/node-mysql) by [William Johnston](https://github.com/wjohnsto)
* [:link:](node-mysql-wrapper/node-mysql-wrapper.d.ts) [node-mysql-wrapper](https://github.com/kataras/node-mysql-wrapper) by [Makis Maropoulos](https://github.com/kataras)
* [:link:](node-persist/node-persist.d.ts) [node-persist](https://github.com/simonlast/node-persist) by [Spencer Williams](http://spencerwi.com)
* [:link:](node-polyglot/node-polyglot.d.ts) [node-polyglot](https://github.com/airbnb/polyglot.js) by [Tim Jackson-Kiely](https://github.com/timjk)
* [:link:](promptly/promptly.d.ts) [node-promptly](https://github.com/IndigoUnited/node-promptly) by [Dan Spencer](https://github.com/danrspencer)
* [:link:](radius/radius.d.ts) [node-radius](https://github.com/retailnext/node-radius) by [Peter Harris](https://github.com/codeanimal)
* [:link:](node-schedule/node-schedule.d.ts) [node-schedule](https://github.com/tejasmanohar/node-schedule) by [Cyril Schumacher](https://github.com/cyrilschumacher)
* [:link:](stack-trace/stack-trace.d.ts) [node-stack-trace](https://github.com/felixge/node-stack-trace) by [Exceptionless](https://github.com/exceptionless)
* [:link:](node-uuid/node-uuid.d.ts) [node-uuid.js](https://github.com/broofa/node-uuid) by [Jeff May](https://github.com/jeffmay)
* [:link:](node-webkit/node-webkit.d.ts) [node-webkit](https://github.com/rogerwang/node-webkit) by [Pedro Casaubon](https://github.com/xperiments)
* [:link:](xml2js/xml2js.d.ts) [node-xml2js](https://github.com/Leonidas-from-XIV/node-xml2js) by [Michel Salib](https://github.com/michelsalib), [Jason McNeil](https://github.com/jasonrm)
* [:link:](node/node.d.ts) [Node.js](http://nodejs.org) by [Microsoft TypeScript](http://typescriptlang.org), [DefinitelyTyped](https://github.com/borisyankov/DefinitelyTyped)
* [:link:](_debugger/_debugger.d.ts) [Node.js debugger API](http://nodejs.org) by [Basarat Ali Syed](https://github.com/basarat)
* [:link:](restify/restify.d.ts) [node.js REST framework](https://github.com/mcavage/node-restify) by [Bret Little](https://github.com/blittle)
* [:link:](acl/acl-redisBackend.d.ts) [node_acl](https://github.com/optimalbits/node_acl) by [Qubo](https://github.com/tkQubo)
* [:link:](acl/acl-mongodbBackend.d.ts) [node_acl](https://github.com/optimalbits/node_acl) by [Qubo](https://github.com/tkQubo)
* [:link:](acl/acl.d.ts) [node_acl](https://github.com/optimalbits/node_acl) by [Qubo](https://github.com/tkQubo)
* [:link:](mdns/mdns.d.ts) [node_mdns](https://github.com/agnat/node_mdns) by [Stefan Steinhart](https://github.com/reppners)
* [:link:](node_redis/node_redis.d.ts) [node_redis](https://github.com/mranney/node_redis) by [Boris Yankov](https://github.com/borisyankov)
@@ -745,14 +794,15 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](nodemailer/nodemailer-types.d.ts) [Nodemailer](https://github.com/andris9/Nodemailer) by [Rogier Schouten](https://github.com/rogierschouten)
* [:link:](nodemailer/nodemailer.d.ts) [Nodemailer](https://github.com/andris9/Nodemailer) by [Rogier Schouten](https://github.com/rogierschouten)
* [:link:](nodemailer-direct-transport/nodemailer-direct-transport.d.ts) [nodemailer-direct-transport](https://github.com/andris9/nodemailer-direct-transport) by [Rogier Schouten](https://github.com/rogierschouten)
* [:link:](nodemailer-pickup-transport/nodemailer-pickup-transport.d.ts) [nodemailer-pickup-transport](https://www.npmjs.com/package/nodemailer-pickup-transport) by [Peter Snider](https://github.com/psnider)
* [:link:](nodemailer-smtp-pool/nodemailer-smtp-pool.d.ts) [nodemailer-smtp-pool](https://github.com/andris9/nodemailer-smtp-pool) by [Rogier Schouten](https://github.com/rogierschouten)
* [:link:](nodemailer-smtp-transport/nodemailer-smtp-transport.d.ts) [nodemailer-smtp-transport](https://github.com/andris9/nodemailer-smtp-transport) by [Rogier Schouten](https://github.com/rogierschouten)
* [:link:](nodeunit/nodeunit.d.ts) [nodeunit](https://github.com/caolan/nodeunit) by [Jeff Goddard](https://github.com/jedigo)
* [:link:](nomnom/nomnom.d.ts) [nomnom](https://github.com/harthur/nomnom) by [Paul Vick](https://github.com/panopticoncentral)
* [:link:](nopt/nopt.d.ts) [nopt](https://github.com/npm/nopt) by [jbondc](https://github.com/jbondc)
* [:link:](notify/notify.d.ts) [Notify.js](https://github.com/jpillora/notifyjs) by [Xiaohan Zhang](https://github.com/hellochar)
* [:link:](notifyjs/notifyjs.d.ts) [notify.js](https://github.com/alexgibson/notify.js) by [soundTricker](https://github.com/soundTricker)
* [:link:](nouislider/nouislider.d.ts) [nouislider](https://github.com/leongersen/noUiSlider) by [Corey Jepperson](https://github.com/acoreyj)
* [:link:](notify/notify.d.ts) [Notify.js](https://github.com/jpillora/notifyjs) by [Xiaohan Zhang](https://github.com/hellochar)
* [:link:](nouislider/nouislider.d.ts) [nouislider](https://github.com/leongersen/noUiSlider) by [Patrick Davies](https://github.com/bleuarg)
* [:link:](wnumb/wnumb.d.ts) [nouislider](https://github.com/leongersen/wnumb) by [Corey Jepperson](https://github.com/acoreyj)
* [:link:](noVNC/noVNC.d.ts) [noVNC](https://github.com/kanaka/noVNC) by [Ken Smith](https://github.com/smithkl42)
* [:link:](npm/npm.d.ts) [npm](https://github.com/npm/npm) by [Maxime LUCE](https://github.com/SomaticIT)
@@ -770,21 +820,28 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](openlayers/openlayers.d.ts) [OpenLayers](http://openlayers.org) by [Wouter Goedhart](https://github.com/woutergd)
* [:link:](opn/opn.d.ts) [opn](https://github.com/sindresorhus/opn) by [Shinnosuke Watanabe](https://github.com/shinnn)
* [:link:](optimist/optimist.d.ts) [optimist](https://github.com/substack/node-optimist) by [Carlos Ballesteros Velasco](https://github.com/soywiz)
* [:link:](owlcarousel/owlcarousel.d.ts) [OwlCarousel v.1.3.3](https://github.com/OwlFonk/OwlCarousel) by [Damian Piątkowski](https://github.com/dpiatkowski)
* [:link:](packery/packery.d.ts) [Packery](http://packery.metafizzy.co) by [Piraveen Kamalathas from Kilix](https://github.com/piraveen)
* [:link:](page/page.d.ts) [page](http://visionmedia.github.io/page.js) by [Alan Norbauer](http://alan.norbauer.com)
* [:link:](papaparse/papaparse.d.ts) [PapaParse](https://github.com/mholt/PapaParse) by [Pedro Flemming](https://github.com/torpedro)
* [:link:](parallel/parallel.d.ts) [parallel.js](http://adambom.github.io/parallel.js) by [Josh Baldwin](https://github.com/jbaldwin)
* [:link:](param-case/param-case.d.ts) [param-case](https://github.com/blakeembrey/param-case) by [Sam Saint-Pettersen](https://github.com/stpettersens)
* [:link:](parse/parse.d.ts) [Parse](https://parse.com) by [Ullisen Media Group](http://ullisenmedia.com)
* [:link:](parsimmon/parsimmon.d.ts) [Parsimmon](https://github.com/jneen/parsimmon) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](pascal-case/pascal-case.d.ts) [pascal-case](https://github.com/blakeembrey/pascal-case) by [Sam Saint-Pettersen](https://github.com/stpettersens)
* [:link:](passport/passport.d.ts) [Passport](http://passportjs.org) by [Horiuchi_H](https://github.com/horiuchi)
* [:link:](passport-strategy/passport-strategy.d.ts) [Passport Strategy module](https://github.com/jaredhanson/passport-strategy) by [Lior Mualem](https://github.com/liorm)
* [:link:](passport-twitter/passport-twitter.d.ts) [passport-facebook](https://github.com/jaredhanson/passport-facebook) by [James Roland Cabresos](https://github.com/staticfunction)
* [:link:](passport-facebook/passport-facebook.d.ts) [passport-facebook](https://github.com/jaredhanson/passport-facebook) by [James Roland Cabresos](https://github.com/staticfunction)
* [:link:](passport-google-oauth/passport-google-oauth.d.ts) [passport-facebook](https://github.com/jaredhanson/passport-facebook) by [James Roland Cabresos](https://github.com/staticfunction)
* [:link:](passport-facebook/passport-facebook.d.ts) [passport-facebook](https://github.com/jaredhanson/passport-facebook) by [James Roland Cabresos](https://github.com/staticfunction)
* [:link:](passport-facebook-token/passport-facebook-token.d.ts) [passport-facebook-token](https://github.com/drudge/passport-facebook-token) by [Ray Martone](https://github.com/rmartone)
* [:link:](passport-local/passport-local.d.ts) [passport-local](https://github.com/jaredhanson/passport-local) by [Maxime LUCE](https://github.com/SomaticIT)
* [:link:](path-case/path-case.d.ts) [path-case](https://github.com/blakeembrey/path-case) by [Sam Saint-Pettersen](https://github.com/stpettersens)
* [:link:](path-exists/path-exists.d.ts) [path-exists](https://github.com/sindresorhus/path-exists) by [Shogo Iwano](https://github.com/shiwano)
* [:link:](path-to-regexp/path-to-regexp.d.ts) [path-to-regexp](https://github.com/pillarjs/path-to-regexp) by [xica](https://github.com/xica)
* [:link:](pathjs/pathjs.d.ts) [Pathjs](https://github.com/mtrpcic/pathjs) by [Lokesh Peta](https://github.com/lokeshpeta)
* [:link:](pathwatcher/pathwatcher.d.ts) [pathwatcher](https://github.com/atom/node-pathwatcher) by [vvakame](https://github.com/vvakame)
* [:link:](PayPal-Cordova-Plugin/PayPal-Cordova-Plugin.d.ts) [PayPal-Cordova-Plugin](https://github.com/paypal/PayPal-Cordova-Plugin) by [Justin Unterreiner](https://github.com/Justin-Credible)
* [:link:](pdf/pdf.d.ts) [PDF.js](https://github.com/mozilla/pdf.js) by [Josh Baldwin](https://github.com/jbaldwin)
* [:link:](pdfkit/pdfkit.d.ts) [Pdfkit](http://pdfkit.org) by [Eric Hillah](https://github.com/erichillah)
* [:link:](peerjs/peerjs.d.ts) [PeerJS](http://peerjs.com) by [Toshiya Nakakura](https://github.com/nakakura)
@@ -795,12 +852,14 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](phantom/phantom.d.ts) [PhantomJS bridge for NodeJS](https://github.com/sgentle/phantomjs-node) by [horiuchi](https://github.com/horiuchi)
* [:link:](phantomjs/phantomjs.d.ts) [PhantomJS v1.9.0 API](https://github.com/ariya/phantomjs/wiki/API-Reference) by [Jed Hunsaker](https://github.com/jedhunsaker), [Mike Keesey](https://github.com/keesey)
* [:link:](phonegap/phonegap.d.ts) [PhoneGap](http://phonegap.com) by [Boris Yankov](https://github.com/borisyankov), [Dick van den Brink](https://github.com/DickvdBrink)
* [:link:](photonui/photonui.d.ts) [PhotonUI](https://github.com/wanadev/PhotonUI) by [Florent Poujol](https://github.com/florentpoujol)
* [:link:](photoswipe/photoswipe.d.ts) [PhotoSwipe](http://photoswipe.com) by [Xiaohan Zhang](https://github.com/hellochar)
* [:link:](physijs/physijs.d.ts) [Physijs](http://chandlerprall.github.io/Physijs) by [Satoru Kimura](https://github.com/gyohk)
* [:link:](pickadate/pickadate.d.ts) [pickadate.js](https://github.com/amsul/pickadate.js) by [Theodore Brown](https://github.com/theodorejb)
* [:link:](pikaday/pikaday.d.ts) [pikaday](https://github.com/dbushell/Pikaday) by [Rudolph Gottesheim](http://midnight-design.at)
* [:link:](piwik-tracker/piwik-tracker.d.ts) [PiwikTracker](https://www.npmjs.com/package/piwik-tracker) by [Guilherme Bernal](https://github.com/lbguilherme)
* [:link:](pixi/pixi.d.ts) [PIXI](https://github.com/GoodBoyDigital/pixi.js) by [xperiments](http://github.com/xperiments)
* [:link:](pixi-spine/pixi-spine.d.ts) [pixi-spine](https://github.com/pixijs/pixi-spine) by [martijncroezen](https://github.com/pixijs/pixi-typescript)
* [:link:](pixi.js/pixi.js.d.ts) [Pixi.js](https://github.com/GoodBoyDigital/pixi.js) by [clark-stevenson](https://github.com/pixijs/pixi-typescript)
* [:link:](platform/platform.d.ts) [Platform](https://github.com/bestiejs/platform.js) by [Jake Hickman](https://github.com/JakeH)
* [:link:](playerframework/playerFramework.d.ts) [Player Framework (MMPPF)](https://playerframework.codeplex.com) by [Ricardo Sabino](https://github.com/ricardosabino)
* [:link:](pleasejs/please.d.ts) [PleaseJS](http://www.checkman.io/please) by [Toshiya Nakakura](https://github.com/nakakura)
@@ -812,6 +871,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](polyline/polyline.d.ts) [Polyline](https://github.com/mapbox/polyline) by [Arseniy Maximov](https://github.com/Kern0)
* [:link:](polymer/polymer.d.ts) [polymer](https://github.com/Polymer/polymer) by [Louis Grignon](https://github.com/lgrignon), [Suguru Inatomi](https://github.com/laco0416)
* [:link:](popcorn/popcorn.d.ts) [Popcorn](https://github.com/mozilla/popcorn-js) by [grapswiz](https://github.com/grapswiz)
* [:link:](postal/postal.d.ts) [Postal](https://github.com/postaljs/postal.js) by [Lokesh Peta](https://github.com/lokeshpeta), [Paul Jolly](https://github.com/myitcv)
* [:link:](pouchDB/pouch.d.ts) [Pouch](http://pouchdb.com) by [Bill Sears](https://github.com/MrBigDog2U)
* [:link:](power-assert/power-assert.d.ts) [power-assert](https://github.com/twada/power-assert) by [vvakame](https://github.com/vvakame)
* [:link:](power-assert-formatter/power-assert-formatter.d.ts) [power-assert-formatter](https://github.com/twada/power-assert-formatter) by [vvakame](https://github.com/vvakame)
@@ -843,12 +903,15 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](raygun4js/raygun4js.d.ts) [raygun4js](https://github.com/MindscapeHQ/raygun4js) by [Brian Surowiec](https://github.com/xt0rted)
* [:link:](react/react.d.ts) [React (external module)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com)
* [:link:](react/react-global.d.ts) [React (internal module)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com)
* [:link:](react-dnd/react-dnd.d.ts) [React DnD](https://github.com/gaearon/react-dnd) by [Asana](https://asana.com)
* [:link:](react-router/react-router.d.ts) [React Router](https://github.com/rackt/react-router) by [Yuichi Murata](https://github.com/mrk21), [Václav Ostrožlík](https://github.com/vasek17)
* [:link:](react-swf/react-swf.d.ts) [react-swf](https://github.com/syranide/react-swf) by [Stepan Mikhaylyuk](https://github.com/stepancar)
* [:link:](react/react-addons.d.ts) [ReactWithAddons (external module)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com)
* [:link:](react/react-addons-global.d.ts) [ReactWithAddons (internal module)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com)
* [:link:](readdir-stream/readdir-stream.d.ts) [readdir-stream](https://github.com/logicalparadox/readdir-stream) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](recursive-readdir/recursive-readdir.d.ts) [recursive-readdir](https://github.com/jergason/recursive-readdir) by [Elisée Maurer](https://github.com/elisee)
* [:link:](redis/redis.d.ts) [redis](https://github.com/mranney/node_redis) by [Carlos Ballesteros Velasco](https://github.com/soywiz), [Peter Harris](https://github.com/CodeAnimal)
* [:link:](redux/redux.d.ts) [Redux](https://github.com/rackt/redux) by [William Buchwalter](https://github.com/wbuchwalter), [Vincent Prouillet](https://github.com/Keats)
* [:link:](ref/ref.d.ts) [ref](https://github.com/TooTallNate/ref) by [Paul Loyd](https://github.com/loyd)
* [:link:](ref-array/ref-array.d.ts) [ref-array](https://github.com/TooTallNate/ref-array) by [Paul Loyd](https://github.com/loyd)
* [:link:](ref-struct/ref-struct.d.ts) [ref-struct](https://github.com/TooTallNate/ref-struct) by [Paul Loyd](https://github.com/loyd)
@@ -856,6 +919,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](request/request.d.ts) [request](https://github.com/mikeal/request) by [Carlos Ballesteros Velasco](https://github.com/soywiz), [bonnici](https://github.com/bonnici), [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](request-promise/request-promise.d.ts) [request-promise](https://www.npmjs.com/package/request-promise) by [Christopher Glantschnig](https://github.com/cglantschnig)
* [:link:](requirejs/require.d.ts) [RequireJS](http://requirejs.org) by [Josh Baldwin](https://github.com/jbaldwin)
* [:link:](resemblejs/resemblejs.d.ts) [Resemble.js](http://huddle.github.io/Resemble.js) by [Tim Perry](https://github.com/pimterry)
* [:link:](response-time/response-time.d.ts) [response-time](https://github.com/expressjs/response-time) by [Uros Smolnik](https://github.com/urossmolnik)
* [:link:](rest/rest.d.ts) [rest.js](https://github.com/cujojs/rest) by [Wim Looman](https://github.com/Nemo157)
* [:link:](restangular/restangular.d.ts) [Restangular](https://github.com/mgonto/restangular) by [Boris Yankov](https://github.com/borisyankov)
@@ -867,6 +931,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](rivets/rivets.d.ts) [rivets](http://rivetsjs.com) by [Trevor Baron](https://github.com/TrevorDev)
* [:link:](route-recognizer/route-recognizer.d.ts) [route-recognizer](https://github.com/tildeio/route-recognizer) by [Dave Keen](http://www.keendevelopment.ch)
* [:link:](routie/routie.d.ts) [routie](https://github.com/jgallen23/routie) by [Adilson](https://github.com/Adilson)
* [:link:](rsmq/rsmq.d.ts) [rsmq](http://smrchy.github.io/rsmq) by [Qubo](https://github.com/MugeSo)
* [:link:](rsmq-worker/rsmq-worker.d.ts) [rsmq-worker](http://smrchy.github.io/rsmq/rsmq-worker) by [Qubo](https://github.com/MugeSo)
* [:link:](rtree/rtree.d.ts) [rtree](https://github.com/leaflet-extras/RTree) by [Omede Firouz](https://github.com/oefirouz)
* [:link:](run-sequence/run-sequence.d.ts) [run-sequence](https://github.com/OverZealous/run-sequence) by [Keita Kagurazaka](https://github.com/k-kagurazaka)
* [:link:](rx/rx.d.ts) [RxJS](http://rx.codeplex.com) by [gsino](http://www.codeplex.com/site/users/view/gsino), [Igor Oleinikov](https://github.com/Igorbek)
@@ -897,11 +963,14 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](selenium-webdriver/selenium-webdriver.d.ts) [Selenium WebDriverJS](https://code.google.com/p/selenium) by [Bill Armstrong](https://github.com/BillArmstrong)
* [:link:](semver/semver.d.ts) [semver](https://github.com/isaacs/node-semver) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](sendgrid/sendgrid.d.ts) [sendgrid](https://github.com/sendgrid/sendgrid-nodejs) by [Maxime LUCE](https://github.com/SomaticIT)
* [:link:](sentence-case/sentence-case.d.ts) [sentence-case](https://github.com/blakeembrey/sentence-case) by [Sam Saint-Pettersen](https://github.com/stpettersens)
* [:link:](sequelize/sequelize.d.ts) [Sequelize 2.0.0 dev13](http://sequelizejs.com) by [samuelneff](https://github.com/samuelneff), [Peter Harris](https://github.com/codeanimal)
* [:link:](sequelize-fixtures/sequelize-fixtures.d.ts) [Sequelize-Fixtures](https://github.com/domasx2/sequelize-fixtures) by [Christian Schwarz](https://github.com/cschwarz)
* [:link:](on-headers/on-headers.d.ts) [serve-favicon](https://github.com/jshttp/on-headers) by [John Jeffery](https://github.com/jjeffery)
* [:link:](serve-favicon/serve-favicon.d.ts) [serve-favicon](https://github.com/expressjs/serve-favicon) by [Uros Smolnik](https://github.com/urossmolnik)
* [:link:](serve-static/serve-static.d.ts) [serve-static](https://github.com/expressjs/serve-static) by [Uros Smolnik](https://github.com/urossmolnik)
* [:link:](sharedworker/SharedWorker.d.ts) [SharedWorker](http://www.w3.org/TR/workers) by [Toshiya Nakakura](https://github.com/nakakura)
* [:link:](sharepoint/SharePoint.d.ts) [SharePoint 2010 and 2013](http://sptypescript.codeplex.com) by [Stanislav Vyshchepan](http://blog.gandjustas.ru), [Andrey Markeev](http://markeev.com)
* [:link:](shelljs/shelljs.d.ts) [ShellJS](http://shelljs.org) by [Niklas Mollenhauer](https://github.com/nikeee)
* [:link:](shortid/shortid.d.ts) [shortid](https://github.com/dylang/shortid) by [Sam Saint-Pettersen](https://github.com/stpettersens)
* [:link:](should-promised/should-promised.d.ts) [should-promised](https://github.com/shouldjs/promised) by [Yaroslav Admin](https://github.com/devoto13)
@@ -915,6 +984,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](jquery.simplemodal/jquery.simplemodal.d.ts) [SimpleModal](http://www.ericmmartin.com/projects/simplemodal) by [Friedrich von Never](https://github.com/ForNeVeR)
* [:link:](sinon/sinon.d.ts) [Sinon](http://sinonjs.org) by [William Sears](https://github.com/mrbigdog2u)
* [:link:](sinon-chai/sinon-chai.d.ts) [sinon-chai](https://github.com/domenic/sinon-chai) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid), [Jed Mao](https://github.com/jedmao)
* [:link:](sinon-chrome/sinon-chrome.d.ts) [Sinon-Chrome](https://github.com/vitalets/sinon-chrome) by [Tim Perry](https://github.com/pimterry)
* [:link:](sipml/sipml.d.ts) [SIPml5](http://sipml5.org) by [A. Groenenboom](https://github.com/chookies)
* [:link:](sjcl/sjcl.d.ts) [sjcl](http://crypto.stanford.edu/sjcl) by [Eugene Chernyshov](https://github.com/Evgenus)
* [:link:](skyway/skyway.d.ts) [SkyWay](http://nttcom.github.io/skyway) by [Toshiya Nakakura](https://github.com/nakakura)
@@ -923,9 +993,10 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](slickgrid/slick.headerbuttons.d.ts) [SlickGrid HeaderButtons Plugin](https://github.com/mleibman/SlickGrid) by [Derek Cicerone](https://github.com/derekcicerone)
* [:link:](slickgrid/slick.rowselectionmodel.d.ts) [SlickGrid RowSelectionModel Plugin](https://github.com/mleibman/SlickGrid) by [Derek Cicerone](https://github.com/derekcicerone)
* [:link:](smoothie/smoothie.d.ts) [Smoothie Charts](https://github.com/joewalnes/smoothie) by [Drew Noakes](https://drewnoakes.com), [Mike H. Hawley](https://github.com/mikehhawley)
* [:link:](snake-case/snake-case.d.ts) [snake-case](https://github.com/blakeembrey/snake-case) by [Sam Saint-Pettersen](https://github.com/stpettersens)
* [:link:](snapsvg/snapsvg.d.ts) [Snap-SVG](https://github.com/adobe-webplatform/Snap.svg) by [Lars Klein](https://github.com/lhk)
* [:link:](socket.io/socket.io.d.ts) [socket.io](http://socket.io) by [PROGRE](https://github.com/progre)
* [:link:](socket.io-client/socket.io-client.d.ts) [socket.io-client](http://socket.io) by [PROGRE](https://github.com/progre)
* [:link:](socket.io/socket.io.d.ts) [socket.io](http://socket.io) by [PROGRE](https://github.com/progre), [Damian Connolly](https://github.com/divillysausages)
* [:link:](socket.io-client/socket.io-client.d.ts) [socket.io-client](http://socket.io) by [PROGRE](https://github.com/progre), [Damian Connolly](https://github.com/divillysausages)
* [:link:](sockjs/sockjs.d.ts) [SockJS 0.3.x](https://github.com/sockjs/sockjs-client) by [Emil Ivanov](https://github.com/vladev)
* [:link:](sockjs-node/sockjs-node.d.ts) [sockjs-node 0.3.x](https://github.com/sockjs/sockjs-node) by [Phil McCloghry-Laing](https://github.com/pmccloghrylaing)
* [:link:](soundjs/soundjs.d.ts) [SoundJS](http://www.createjs.com/#!/SoundJS) by [Pedro Ferreira](https://bitbucket.org/drk4)
@@ -937,7 +1008,6 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](split/split.d.ts) [split](https://github.com/dominictarr/split) by [Marcin Porębski](https://github.com/marcinporebski)
* [:link:](sprintf-js/sprintf-js.d.ts) [sprintf-js](https://www.npmjs.com/package/sprintf-js) by [Jason Swearingen](https://jasonswearingen.github.io)
* [:link:](sprintf/sprintf.d.ts) [sprintff](https://github.com/maritz/node-sprintff) by [Carlos Ballesteros Velasco](https://github.com/soywiz)
* [:link:](sharepoint/SharePoint.d.ts) [sptypescript](http://sptypescript.codeplex.com) by [Stanislav Vyshchepan](http://gandjustas.blogspot.ru), [Andrey Markeev](http://markeev.com)
* [:link:](sqlite3/sqlite3.d.ts) [sqlite3](https://github.com/mapbox/node-sqlite3) by [Nick Malaguti](https://github.com/nmalaguti)
* [:link:](squirejs/squirejs.d.ts) [Squire](https://github.com/iammerrick/Squire.js) by [Bradley Ayers](https://github.com/bradleyayers)
* [:link:](stack-mapper/stack-mapper.d.ts) [stack-mapper](https://github.com/thlorenz/stack-mapper) by [Rogier Schouten](https://github.com/rogierschouten)
@@ -964,22 +1034,27 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](svg2png/svg2png.d.ts) [svg2png node package](https://github.com/domenic/svg2png) by [hans windhoff](https://github.com/hansrwindhoff)
* [:link:](svgjs.draggable/svgjs.draggable.d.ts) [svgjs.draggable](http://www.svgjs.com) by [Luigi Trabacchin](https://github.com/LiFeleSs)
* [:link:](swag/swag.d.ts) [swag](https://github.com/elving/swag) by [Shogo Iwano](https://github.com/shiwano)
* [:link:](swap-case/swap-case.d.ts) [swap-case](https://github.com/blakeembrey/swap-case) by [Sam Saint-Pettersen](https://github.com/stpettersens)
* [:link:](sweetalert/sweetalert.d.ts) [SweetAlert](https://github.com/t4t5/sweetalert) by [Markus Peloso](https://github.com/ToastHawaii)
* [:link:](swfobject/swfobject.d.ts) [swfobject](https://code.google.com/p/swfobject) by [rou](https://github.com/rou)
* [:link:](swig/swig.d.ts) [swig](http://github.com/paularmstrong/swig) by [Peter Harris](https://github.com/CodeAnimal), [Carlos Ballesteros Velasco](https://github.com/soywiz)
* [:link:](swig-email-templates/swig-email-templates.d.ts) [swig-email-templates](https://github.com/andrewrk/swig-email-templates) by [Adam Babcock](https://github.com/mrhen)
* [:link:](swipe/swipe.d.ts) [Swipe](https://github.com/thebird/Swipe) by [Andrey Kurdyumov](https://github.com/kant2002)
* [:link:](swiper/swiper.d.ts) [Swiper](https://github.com/nolimits4web/Swiper) by [Sebastián Galiano](https://github.com/sgaliano)
* [:link:](swipeview/swipeview.d.ts) [SwipeView](http://cubiq.org/swipeview) by [Boris Yankov](https://github.com/borisyankov)
* [:link:](switchery/switchery.d.ts) [switchery](https://github.com/abpetkov/switchery) by [Bruno Grieder](https://github.com/bgrieder)
* [:link:](swiz/swiz.d.ts) [swiz](https://github.com/racker/node-swiz) by [Jeff Goddard](https://github.com/jedigo)
* [:link:](systemjs/systemjs.d.ts) [System.js](https://github.com/systemjs/systemjs) by [Ludovic HENIN](https://github.com/ludohenin), [Nathan Walker](https://github.com/NathanWalker)
* [:link:](tabtab/tabtab.d.ts) [tabtab](https://github.com/mklabs/node-tabtab) by [Vojtěch Habarta](https://github.com/vojtechhabarta)
* [:link:](tape/tape.d.ts) [tape](https://github.com/substack/tape) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](tar/tar.d.ts) [tar](https://github.com/npm/node-tar) by [Maxime LUCE](https://github.com/SomaticIT)
* [:link:](tcomb/tcomb.d.ts) [tcomb](http://gcanti.github.io/tcomb/guide/index.html) by [Hans Windhoff](https://github.com/hansrwindhoff)
* [:link:](tea-merge/tea-merge.d.ts) [tea-merge](https://github.com/qualiancy/tea-merge) by [Mihhail Lapushkin](https://github.com/mihhail-lapushkin)
* [:link:](tedious/tedious.d.ts) [tedious](https://pekim.github.io/tedious) by [Rogier Schouten](https://github.com/rogierschouten)
* [:link:](tedious-connection-pool/tedious-connection-pool.d.ts) [tedious-connection-pool](https://github.com/pekim/tedious-connection-pool) by [Cyprien Autexier](https://github.com/sandorfr)
* [:link:](teechart/teechart.d.ts) [TeeChart](http://www.steema.com) by [Steema Software](https://steema.com)
* [:link:](tether/tether.d.ts) [Tether](http://github.hubspot.com/tether) by [Adi Dahiya](https://github.com/adidahiya)
* [:link:](tether-shepherd/tether-shepherd.d.ts) [Tether-Shepherd](http://github.hubspot.com/shepherd) by [Matt Gibbs](https://github.com/mtgibbs)
* [:link:](text-buffer/text-buffer.d.ts) [text-buffer](https://github.com/atom/text-buffer) by [vvakame](https://github.com/vvakame)
* [:link:](text-encoding/text-encoding.d.ts) [text-encoding](https://github.com/inexorabletash/text-encoding) by [MIZUNE Pine](https://github.com/pine613)
* [:link:](github-electron/github-electron-main.d.ts) [the Electron 0.25.2 main process](http://electron.atom.io) by [jedmao](https://github.com/jedmao)
@@ -995,9 +1070,11 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](threejs/three-renderpass.d.ts) [three.js (RenderPass.js)](https://github.com/mrdoob/three.js/blob/r68/examples/js/postprocessing/RenderPass.js) by [Satoru Kimura](https://github.com/gyohk)
* [:link:](threejs/three-shaderpass.d.ts) [three.js (ShaderPass.js)](https://github.com/mrdoob/three.js/blob/r68/examples/js/postprocessing/ShaderPass.js) by [Satoru Kimura](https://github.com/gyohk)
* [:link:](threejs/three-trackballcontrols.d.ts) [three.js (TrackballControls.js)](https://github.com/mrdoob/three.js/blob/master/examples/js/controls/TrackballControls.js) by [Satoru Kimura](https://github.com/gyohk)
* [:link:](threejs/three-transformcontrols.d.ts) [three.js (TransformControls.js)](https://github.com/mrdoob/three.js/blob/master/examples/js/controls/TransformControls.js) by [Stefan Profanter](https://github.com/Pro)
* [:link:](threejs/three-vrcontrols.d.ts) [three.js (VRControls.js)](https://github.com/mrdoob/three.js/blob/master/examples/js/controls/VRControls.js) by [Toshiya Nakakura](https://github.com/nakakura)
* [:link:](threejs/three-vreffect.d.ts) [three.js (VREffect.js)](https://github.com/mrdoob/three.js/blob/master/examples/js/effects/VREffect.js) by [Toshiya Nakakura](https://github.com/nakakura)
* [:link:](threejs/three.d.ts) [three.js r71](http://mrdoob.github.com/three.js) by [Kon](http://phyzkit.net), [Satoru Kimura](https://github.com/gyohk)
* [:link:](thrift/thrift.d.ts) [thrift](https://www.npmjs.com/package/thrift) by [Zachary Collins](https://github.com/corps)
* [:link:](through/through.d.ts) [through](https://github.com/dominictarr/through) by [Andrew Gaspar](https://github.com/AndrewGaspar)
* [:link:](through2/through2.d.ts) [through2 v](https://github.com/rvagg/through2) by [Bart van der Schoor](https://github.com/Bartvds), [jedmao](https://github.com/jedmao)
* [:link:](timelinejs/timelinejs.d.ts) [timelinejs](https://github.com/NUKnightLab/TimelineJS) by [Roland Zwaga](https://github.com/rolandzwaga)
@@ -1008,9 +1085,11 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](titanium/titanium.d.ts) [Titanium Mobile](http://www.appcelerator.com) by [Craig Younkins](https://github.com/cyounkins)
* [:link:](title-case/title-case.d.ts) [title-case](https://github.com/blakeembrey/title-case) by [Sam Saint-Pettersen](https://github.com/stpettersens)
* [:link:](tmp/tmp.d.ts) [tmp](https://www.npmjs.com/package/tmp) by [Jared Klopper](https://github.com/optical)
* [:link:](to-title-case-gouch/to-title-case-gouch.d.ts) [to-title-case](https://github.com/gouch/to-title-case) by [Sam Saint-Pettersen](https://github.com/stpettersens)
* [:link:](toastr/toastr.d.ts) [Toastr](https://github.com/CodeSeven/toastr) by [Boris Yankov](https://github.com/borisyankov)
* [:link:](sencha_touch/SenchaTouch.d.ts) [Touch](http://www.sencha.com/products/touch) by [Brian Kotek](https://github.com/brian428)
* [:link:](traceback/traceback.d.ts) [Traceback](http://github.com/iriscouch/traceback) by [Michael Zabka](https://github.com/misak113)
* [:link:](traverson/traverson.d.ts) [Traverson](https://github.com/basti1302/traverson) by [Marcin Porębski](https://github.com/marcinporebski)
* [:link:](trunk8/trunk8.d.ts) [trunk8](https://github.com/rviscomi/trunk8) by [Blake Niemyjski](https://github.com/niemyjski)
* [:link:](tsmonad/tsmonad.d.ts) [TsMonad](https://github.com/cbowdon/TsMonad) by [Chris Bowdon](https://github.com/cbowdon)
* [:link:](tspromise/tspromise.d.ts) [tspromise](https://github.com/soywiz/tspromise) by [Carlos Ballesteros Velasco](https://github.com/soywiz)
@@ -1024,11 +1103,15 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](type-detect/type-detect.d.ts) [type-detect](https://github.com/chaijs/type-detect) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](type-name/type-name.d.ts) [type-name](https://github.com/twada/type-name) by [OKUNOKENTARO](https://github.com/armorik83)
* [:link:](typeahead/typeahead.d.ts) [typeahead.js](http://twitter.github.io/typeahead.js) by [Ivaylo Gochkov](https://github.com/igochkov), [Gidon Junge](https://github.com/gjunge)
* [:link:](webfontloader/webfontloader.d.ts) [typekit-webfontloader](https://github.com/typekit/webfontloader) by [doskallemaskin](https://github.com/doskallemaskin)
* [:link:](typescript/typescript.d.ts) [TypeScript API](http://www.typescriptlang.org) by [Microsoft TypeScript](http://typescriptlang.org)
* [:link:](typescript-deferred/typescript-deferred.d.ts) [typescript-deferred](https://github.com/DirtyHairy/typescript-deferred) by [Christian Speckner](https://github.com/DirtyHairy)
* [:link:](typescript-services/typescriptServices.d.ts) [TypeScript-Services](https://www.npmjs.org/package/typescript-services) by [Basarat Ali Syed](http://github.com/basarat)
* [:link:](unity-webapi/unity-webapi.d.ts) [Ubuntu Unity Web API](https://launchpad.net/libunity-webapps) by [John Vrbanac](jhttps://github.com/jmvrbanac)
* [:link:](ui-grid/ui-grid.d.ts) [ui-grid](http://www.ui-grid.info) by [Ben Tesser](https://github.com/btesser)
* [:link:](umbraco/umbraco-resources.d.ts) [Umbraco](https://github.com/umbraco) by [DeCareSystemsIreland](https://github.com/DeCareSystemsIreland)
* [:link:](umbraco/umbraco-services.d.ts) [Umbraco](https://github.com/umbraco) by [DeCareSystemsIreland](https://github.com/DeCareSystemsIreland)
* [:link:](umbraco/umbraco.d.ts) [Umbraco](https://github.com/umbraco) by [DeCareSystemsIreland](https://github.com/DeCareSystemsIreland)
* [:link:](underscore/underscore.d.ts) [Underscore](http://underscorejs.org) by [Boris Yankov](https://github.com/borisyankov), [Josh Baldwin](https://github.com/jbaldwin)
* [:link:](underscore-ko/underscore-ko.d.ts) [Underscore-ko 1.2.2 with underscore](https://github.com/kamranayub/UnderscoreKO) by [Maurits Elbers](https://github.com/MagicMau)
* [:link:](underscore.string/underscore.string.d.ts) [underscore.string](https://github.com/epeli/underscore.string) by [Ry Racherbaumer](http://github.com/rygine)
@@ -1042,12 +1125,14 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](js-url/js-url.d.ts) [url](https://github.com/websanova/js-url) by [MIZUNE Pine](https://github.com/pine613)
* [:link:](urlrouter/urlrouter.d.ts) [urlrouter](https://github.com/fengmk2/urlrouter) by [soywiz](https://github.com/soywiz)
* [:link:](urlsafe-base64/urlsafe-base64.d.ts) [urlsafe-base64](https://github.com/RGBboy/urlsafe-base64) by [Tanguy Krotoff](https://github.com/tkrotoff)
* [:link:](usage/usage.d.ts) [usage](https://github.com/arunoda/node-usage) by [Pascal Vomhoff](https://github.com/pvomhoff)
* [:link:](UUID/UUID.d.ts) [UUID.js core](https://github.com/LiosK/UUID.js) by [Jason Jarrett](https://github.com/staxmanade)
* [:link:](valerie/valerie.d.ts) [valerie](https://github.com/davewatts/valerie) by [Howard Richards](https://github.com/conficient)
* [:link:](validator/validator.d.ts) [validator.js](https://github.com/chriso/validator.js) by [tgfjt](https://github.com/tgfjt)
* [:link:](vega/vega.d.ts) [Vega](http://trifacta.github.io/vega) by [Tom Crockett](http://github.com/pelotom)
* [:link:](velocity-animate/velocity-animate.d.ts) [Velocity](http://velocityjs.org) by [Greg Smith](https://github.com/smrq)
* [:link:](vex-js/vex-js.d.ts) [Vex](https://github.com/HubSpot/vex) by [Greg Cohan](https://github.com/gdcohan)
* [:link:](vexflow/vexflow.d.ts) [VexFlow](http://vexflow.com) by [Roman Quiring](https://github.com/rquiring)
* [:link:](victor/victor.d.ts) [Victor.js](http://victorjs.org) by [Ivane Gegia](https://twitter.com/ivanegegia)
* [:link:](videojs/videojs.d.ts) [Video.js](https://github.com/zencoder/video-js) by [Vincent Bortone](https://github.com/vbortone)
* [:link:](vimeo/froogaloop.d.ts) [Vimeo](http://developer.vimeo.com/player/js-api) by [Daz Wilkin](https://github.com/DazWilkin)
@@ -1056,11 +1141,11 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](vinyl-source-stream/vinyl-source-stream.d.ts) [vinyl-source-stream](https://github.com/hughsk/vinyl-source-stream) by [Asana](https://asana.com)
* [:link:](virtual-dom/virtual-dom.d.ts) [virtual-dom](https://github.com/Matt-Esch/virtual-dom) by [Christopher Brown](https://github.com/chbrown)
* [:link:](vortex-web-client/vortex-web-client.d.ts) [Vortex Web 1.2.0p1](http://www.prismtech.com/vortex/vortex-web) by [Stefan Profanter](https://github.com/Pro)
* [:link:](vso-node-api/vso-node-api.d.ts) [vso-node-api](https://github.com/Microsoft/vso-node-api) by [Teddy Ward](https://github.com/teddyward)
* [:link:](vue/vue.d.ts) [vuejs](https://github.com/yyx990803/vue) by [odangosan](https://github.com/odangosan)
* [:link:](watch/watch.d.ts) [watch](https://github.com/mikeal/watch) by [Carlos Ballesteros Velasco](https://github.com/soywiz)
* [:link:](jquery.watermark/jquery.watermark.d.ts) [Watermark plugin for jQuery](http://jquery-watermark.googlecode.com) by [Anwar Javed](https://github.com/anwarjaved)
* [:link:](webaudioapi/waa.d.ts) [Web Audio API](http://www.w3.org/TR/webaudio) by [Baruch Berger](https://github.com/bbss), [Kon](http://phyzkit.net), [kubosho](https://github.com/kubosho)
* [:link:](webaudioapi/waa-nightly.d.ts) [Web Audio API (nightly)](http://www.w3.org/TR/2012/WD-webaudio-20120802) by [Baruch Berger](https://github.com/bbss)
* [:link:](webmidi/webmidi.d.ts) [Web MIDI API](http://www.w3.org/TR/webmidi) by [Toshiya Nakakura](https://github.com/nakakura)
* [:link:](webspeechapi/webspeechapi.d.ts) [Web Speech API](https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html) by [SaschaNaz](https://github.com/saschanaz)
* [:link:](webcola/webcola.d.ts) [webcola](https://github.com/tgdwyer/WebCola) by [Qinfeng Chen](https://github.com/qinfchen)
@@ -1104,7 +1189,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](node_zeromq/zmq.d.ts) [ZeroMQ Node](https://github.com/JustinTulloss/zeromq.node) by [Dave McKeown](http://github.com/davemckeown)
* [:link:](zip.js/zip.js.d.ts) [zip.js 2.x](https://github.com/gildas-lormeau/zip.js) by [Louis Grignon](https://github.com/lgrignon)
* [:link:](scroller/easyscroller.d.ts) [Zynga EasyScroller](https://github.com/zynga/scroller) by [Boris Yankov](https://github.com/borisyankov)
* [:link:](zynga-scroller/zynga-scroller.d.ts) [Zynga Scroller](http://zynga.github.com/scroller) by [Marcelo Haskell Camargo](https://github.com/haskellcamargo)
* [:link:](scroller/scroller.d.ts) [Zynga Scroller](https://github.com/zynga/scroller) by [Boris Yankov](https://github.com/borisyankov)
* [:link:](zynga-scroller/zynga-scroller.d.ts) [Zynga Scroller](http://zynga.github.com/scroller) by [Marcelo Haskell Camargo](https://github.com/haskellcamargo)
* [:link:](viewporter/viewporter.d.ts) [Zynga Viewporter](https://github.com/zynga/viewporter) by [Boris Yankov](https://github.com/borisyankov)
@@ -0,0 +1,115 @@
/// <reference path="PayPal-Cordova-Plugin.d.ts"/>
var item: PayPalItem;
item = new PayPalItem("name", 10, "25.00", "USD");
item = new PayPalItem("name", 10, "25.00", "USD", null);
item = new PayPalItem("name", 10, "25.00", "USD", "SKU_ID");
var item_name: string = item.name;
var item_quantity: number = item.quantity;
var item_price: string = item.price;
var item_currency: string = item.currency;
var item_sku: string = item.sku;
var paymentDetails: PayPalPaymentDetails;
paymentDetails = new PayPalPaymentDetails("10.50", "2.50", "1.25");
var paymentDetails_subtotal: string = paymentDetails.subtotal;
var paymentDetails_shipping: string = paymentDetails.shipping;
var paymentDetails_tax: string = paymentDetails.tax;
var shippingAddress: PayPalShippingAddress;
shippingAddress = new PayPalShippingAddress("name", "line1", "line2", "city", "state", "postalCode", "countryCode");
var shippingAddress_recipientName: string = shippingAddress.recipientName;
var shippingAddress_line1: string = shippingAddress.line1;
var shippingAddress_line2: string = shippingAddress.line2;
var shippingAddress_city: string = shippingAddress.city;
var shippingAddress_state: string = shippingAddress.state;
var shippingAddress_postalCode: string = shippingAddress.postalCode;
var shippingAddress_countryCode: string = shippingAddress.countryCode;
var payment: PayPalPayment;
payment = new PayPalPayment("10.00", "USD", "description", "Auth");
payment = new PayPalPayment("10.00", "USD", "description", "Auth", paymentDetails);
var payment_amount: string = payment.amount;
var payment_currency: string = payment.currency;
var payment_shortDescription: string = payment.shortDescription;
var payment_intent: string = payment.intent;
var payment_details: PayPalPaymentDetails = payment.details;
var payment_invoiceNumber: string = payment.invoiceNumber;
var payment_custom: string = payment.custom;
var payment_softDescriptor: string = payment.softDescriptor;
var payment_bnCode: string = payment.bnCode;
var payment_items: PayPalItem[] = [item, item, item];
var payment_shippingAddress: PayPalShippingAddress = shippingAddress;
var configOptions: PayPalConfigurationOptions = {
defaultUserEmail: "email",
defaultUserPhoneCountryCode: "countryCode",
defaultUserPhoneNumber: "phoneNumber",
merchantName: "merchantName",
merchantPrivacyPolicyURL: "merchantPrivacyPolicyURL",
merchantUserAgreementURL: "merchantUserAgreementURL",
acceptCreditCards: true,
payPalShippingAddressOption: 10,
rememberUser: true,
languageOrLocale: "languageOrLocal",
disableBlurWhenBackgrounding: true,
presentingInPopover: true,
forceDefaultsInSandbox: true,
sandboxUserPassword: "sandboxUserPassword",
sandboxUserPin: "sandboxUserPin"
};
var config: PayPalConfiguration;
config = new PayPalConfiguration();
config = new PayPalConfiguration(null);
config = new PayPalConfiguration(configOptions);
var config_defaultUserEmail: string = config.defaultUserEmail;
var config_defaultUserPhoneCountryCode: string = config.defaultUserPhoneCountryCode;
var config_defaultUserPhoneNumber: string = config.defaultUserPhoneNumber;
var config_merchantName: string = config.merchantName;
var config_merchantPrivacyPolicyURL: string = config.merchantPrivacyPolicyURL;
var config_merchantUserAgreementURL: string = config.merchantUserAgreementURL;
var config_acceptCreditCards: boolean = config.acceptCreditCards;
var config_payPalShippingAddressOption: number = config.payPalShippingAddressOption;
var config_rememberUser: boolean = config.rememberUser;
var config_languageOrLocale: string = config.languageOrLocale;
var config_disableBlurWhenBackgrounding: boolean = config.disableBlurWhenBackgrounding;
var config_presentingInPopover: boolean = config.presentingInPopover;
var config_forceDefaultsInSandbox: boolean = config.forceDefaultsInSandbox;
var config_sandboxUserPasword: string = config.sandboxUserPassword;
var config_sandboxUserPin: string = config.sandboxUserPin;
var clientIds: PayPalCordovaPlugin.PayPalClientIds = {
PayPalEnvironmentProduction: "",
PayPalEnvironmentSandbox: ""
};
var apiModule: PayPalCordovaPlugin.PayPalMobileStatic = PayPalMobile;
apiModule.version((result: string) => {});
apiModule.init(clientIds, () => {});
apiModule.prepareToRender("environment", config, () => {});
apiModule.renderSinglePaymentUI(payment, (result: any) => {}, (cancelReason: string) => {});
apiModule.applicationCorrelationIDForEnvironment("environment", (applicationCorrelationId: string) => {});
apiModule.clientMetadataID((clientMetadataId: string) => {});
apiModule.renderFuturePaymentUI((result: any) => {}, (cancelReason: string) => {});
apiModule.renderProfileSharingUI(["openid", "profile", "email"], (result: any) => {}, (cancelReason: string) => {});
+615
View File
@@ -0,0 +1,615 @@
// Type definitions for PayPal-Cordova-Plugin 3.1.10
// Project: https://github.com/paypal/PayPal-Cordova-Plugin
// Definitions by: Justin Unterreiner <https://github.com/Justin-Credible>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
//#region paypal-mobile-js-helper.js
/**
* The PayPalItem class defines an optional itemization for a payment.
*
* @see https://developer.paypal.com/docs/api/#item-object for more details.
*/
declare class PayPalItem {
/**
* @param name Name of the item. 127 characters max.
* @param quantity Number of units. 10 characters max.
* @param price Unit price for this item 10 characters max.
* May be negative for "coupon" etc.
* @param currency ISO standard currency code.
* @param sku The stock keeping unit for this item. 50 characters max (optional).
*/
constructor(name: string, quantity: number, price: string, currency: string, sku?: string);
/**
* Name of the item. 127 characters max.
*/
name: string;
/**
* Number of units. 10 characters max.
*/
quantity: number;
/**
* Unit price for this item 10 characters max.
* May be negative for "coupon" etc.
*/
price: string;
/**
* ISO standard currency code.
*/
currency: string;
/**
* The stock keeping unit for this item. 50 characters max (optional).
*/
sku: string;
}
/**
* The PayPalPaymentDetails class defines optional amount details.
*
* @see https://developer.paypal.com/webapps/developer/docs/api/#details-object for more details.
*/
declare class PayPalPaymentDetails {
/**
* @param subtotal Sub-total (amount) of items being paid for. 10 characters max with support for 2 decimal places.
* @param shipping Amount charged for shipping. 10 characters max with support for 2 decimal places.
* @param tax Amount charged for tax. 10 characters max with support for 2 decimal places.
*/
constructor(subtotal: string, shipping: string, tax: string);
/**
* Sub-total (amount) of items being paid for. 10 characters max with support for 2 decimal places.
*/
subtotal: string;
/**
* Amount charged for shipping. 10 characters max with support for 2 decimal places.
*/
shipping: string;
/**
* Amount charged for tax. 10 characters max with support for 2 decimal places.
*/
tax: string;
}
/**
* Convenience constructor. Returns a PayPalPayment with the specified amount, currency code, and short description.
*/
declare class PayPalPayment {
/**
* @param amount The amount of the payment.
* @param currencyCode The ISO 4217 currency for the payment.
* @param shortDescription A short descripton of the payment.
* @param intent • "Sale" for an immediate payment.
* • "Auth" for payment authorization only, to be captured separately at a later time.
* • "Order" for taking an order, with authorization and capture to be done separately at a later time.
* @param details PayPalPaymentDetails object (optional).
*/
constructor(amount: string, currency: string, shortDescription: string, intent: string, details?: PayPalPaymentDetails);
/**
* The amount of the payment.
*/
amount: string;
/**
* The ISO 4217 currency for the payment.
*/
currency: string;
/**
* A short descripton of the payment.
*/
shortDescription: string;
/**
* • "Sale" for an immediate payment.
* • "Auth" for payment authorization only, to be captured separately at a later time.
* • "Order" for taking an order, with authorization and capture to be done separately at a later time.
*/
intent: string;
/**
* PayPalPaymentDetails object (optional).
*/
details: PayPalPaymentDetails;
/**
* Optional invoice number, for your tracking purposes. (up to 256 characters).
*/
invoiceNumber: string;
/**
* Optional text, for your tracking purposes. (up to 256 characters).
*/
custom: string;
/**
* Optional text which will appear on the customer's credit card statement. (up to 22 characters).
*/
softDescriptor: string;
/**
* Optional Build Notation code ("BN code"), obtained from partnerprogram@paypal.com, for your tracking purposes.
*/
bnCode: string;
/**
* Optional array of PayPalItem objects.
* @see PayPalItem
* @note If you provide one or more items, be sure that the various prices correctly sum to the payment `amount` or to `paymentDetails.subtotal`.
*/
items: PayPalItem[];
/**
* Optional customer shipping address, if your app wishes to provide this to the SDK.
* @note make sure to set `payPalShippingAddressOption` in PayPalConfiguration to 1 or 3.
*/
shippingAddress: PayPalShippingAddress;
}
declare class PayPalShippingAddress {
/**
* @param recipientName Name of the recipient at this address. 50 characters max.
* @param line1 Line 1 of the address (e.g., Number, street, etc). 100 characters max.
* @param line2 Line 2 of the address (e.g., Suite, apt #, etc). 100 characters max. Optional.
* @param city City name. 50 characters max.
* @param state 2-letter code for US states, and the equivalent for other countries. 100 characters max. Required in certain countries.
* @param postalCode ZIP code or equivalent is usually required for countries that have them. 20 characters max. Required in certain countries.
* @param countryCode 2-letter country code. 2 characters max.
*/
constructor(recipientName: string, line1: string, line2: string, city: string, state: string, postalCode: string, countryCode: string);
/**
* Name of the recipient at this address. 50 characters max.
*/
recipientName: string;
/**
* Line 1 of the address (e.g., Number, street, etc). 100 characters max.
*/
line1: string;
/**
* Line 2 of the address (e.g., Suite, apt #, etc). 100 characters max. Optional.
*/
line2: string;
/**
* City name. 50 characters max.
*/
city: string;
/**
* 2-letter code for US states, and the equivalent for other countries. 100 characters max. Required in certain countries.
*/
state: string;
/**
* ZIP code or equivalent is usually required for countries that have them. 20 characters max. Required in certain countries.
*/
postalCode: string;
/**
* 2-letter country code. 2 characters max.
*/
countryCode: string;
}
declare class PayPalConfiguration {
/**
* @param options A set of options to use. Any options not specified will assume default values.
*/
constructor(options?: PayPalConfigurationOptions);
/**
* Will be overridden by email used in most recent PayPal login.
*/
defaultUserEmail: string;
/**
* Will be overridden by phone country code used in most recent PayPal login
*/
defaultUserPhoneCountryCode: string;
/**
* Will be overridden by phone number used in most recent PayPal login.
* @note If you set defaultUserPhoneNumber, be sure to also set defaultUserPhoneCountryCode.
*/
defaultUserPhoneNumber: string;
/**
* Your company name, as it should be displayed to the user
* when requesting consent via a PayPalFuturePaymentViewController.
*/
merchantName: string;
/**
* URL of your company's privacy policy, which will be offered to the user
* when requesting consent via a PayPalFuturePaymentViewController.
*/
merchantPrivacyPolicyURL: string;
/**
* URL of your company's user agreement, which will be offered to the user
* when requesting consent via a PayPalFuturePaymentViewController.
*/
merchantUserAgreementURL: string;
/**
* If set to false, the SDK will only support paying with PayPal, not with credit cards.
* This applies only to single payments (via PayPalPaymentViewController).
* Future payments (via PayPalFuturePaymentViewController) always use PayPal.
* Defaults to true.
*/
acceptCreditCards: boolean;
/**
* For single payments, options for the shipping address.
*
* - 0 - PayPalShippingAddressOptionNone: no shipping address applies.
*
* - 1 - PayPalShippingAddressOptionProvided: shipping address will be provided by your app,
* in the shippingAddress property of PayPalPayment.
*
* - 2 - PayPalShippingAddressOptionPayPal: user will choose from shipping addresses on file
* for their PayPal account.
*
* - 3 - PayPalShippingAddressOptionBoth: user will choose from the shipping address provided by your app,
* in the shippingAddress property of PayPalPayment, plus the shipping addresses on file for the user's PayPal account.
*
* Defaults to 0 (PayPalShippingAddressOptionNone).
*/
payPalShippingAddressOption: number;
/**
* If set to true, then if the user pays via their PayPal account,
* the SDK will remember the user's PayPal username or phone number;
* if the user pays via their credit card, then the SDK will remember
* the PayPal Vault token representing the user's credit card.
*
* If set to false, then any previously-remembered username, phone number, or
* credit card token will be erased, and subsequent payment information will
* not be remembered.
*
* Defaults to true.
*/
rememberUser: boolean;
/**
* If not set, or if set to nil, defaults to the device's current language setting.
*
* Can be specified as a language code ("en", "fr", "zh-Hans", etc.) or as a locale ("en_AU", "fr_FR", "zh-Hant_HK", etc.).
* If the library does not contain localized strings for a specified locale, then will fall back to the language. E.g., "es_CO" -> "es".
* If the library does not contain localized strings for a specified language, then will fall back to American English.
*
* If you specify only a language code, and that code matches the device's currently preferred language,
* then the library will attempt to use the device's current region as well.
* E.g., specifying "en" on a device set to "English" and "United Kingdom" will result in "en_GB".
*
* These localizations are currently included:
* da,de,en,en_AU,en_GB,en_SV,es,es_MX,fr,he,it,ja,ko,nb,nl,pl,pt,pt_BR,ru,sv,tr,zh-Hans,zh-Hant_HK,zh-Hant_TW.
*/
languageOrLocale: string;
/**
* Normally, the SDK blurs the screen when the app is backgrounded,
* to obscure credit card or PayPal account details in the iOS-saved screenshot.
* If your app already does its own blurring upon backgrounding, you might choose to disable this.
* Defaults to false.
*/
disableBlurWhenBackgrounding: boolean;
/**
* If you will present the SDK's view controller within a popover, then set this property to true.
* Defaults to false. (iOS only)
*/
presentingInPopover: boolean;
/**
* Sandbox credentials can be difficult to type on a mobile device. Setting this flag to true will
* cause the sandboxUserPassword and sandboxUserPin to always be pre-populated into login fields.
*
* This setting will have no effect if the operation mode is production.
* Defaults to false.
*/
forceDefaultsInSandbox: boolean;
/**
* Password to use for sandbox if 'forceDefaultsInSandbox' is set.
*/
sandboxUserPassword: string;
/**
* PIN to use for sandbox if 'forceDefaultsInSandbox' is set.
*/
sandboxUserPin: string;
}
/**
* Describes the options that can be passed into the PayPalConfiguration class constructor.
*/
interface PayPalConfigurationOptions {
/**
* Will be overridden by email used in most recent PayPal login.
*/
defaultUserEmail?: string;
/**
* Will be overridden by phone country code used in most recent PayPal login
*/
defaultUserPhoneCountryCode?: string;
/**
* Will be overridden by phone number used in most recent PayPal login.
* @note If you set defaultUserPhoneNumber, be sure to also set defaultUserPhoneCountryCode.
*/
defaultUserPhoneNumber?: string;
/**
* Your company name, as it should be displayed to the user
* when requesting consent via a PayPalFuturePaymentViewController.
*/
merchantName?: string;
/**
* URL of your company's privacy policy, which will be offered to the user
* when requesting consent via a PayPalFuturePaymentViewController.
*/
merchantPrivacyPolicyURL?: string;
/**
* URL of your company's user agreement, which will be offered to the user
* when requesting consent via a PayPalFuturePaymentViewController.
*/
merchantUserAgreementURL?: string;
/**
* If set to false, the SDK will only support paying with PayPal, not with credit cards.
* This applies only to single payments (via PayPalPaymentViewController).
* Future payments (via PayPalFuturePaymentViewController) always use PayPal.
* Defaults to true.
*/
acceptCreditCards?: boolean;
/**
* For single payments, options for the shipping address.
*
* - 0 - PayPalShippingAddressOptionNone?: no shipping address applies.
*
* - 1 - PayPalShippingAddressOptionProvided?: shipping address will be provided by your app,
* in the shippingAddress property of PayPalPayment.
*
* - 2 - PayPalShippingAddressOptionPayPal?: user will choose from shipping addresses on file
* for their PayPal account.
*
* - 3 - PayPalShippingAddressOptionBoth?: user will choose from the shipping address provided by your app,
* in the shippingAddress property of PayPalPayment, plus the shipping addresses on file for the user's PayPal account.
*
* Defaults to 0 (PayPalShippingAddressOptionNone).
*/
payPalShippingAddressOption?: number;
/**
* If set to true, then if the user pays via their PayPal account,
* the SDK will remember the user's PayPal username or phone number;
* if the user pays via their credit card, then the SDK will remember
* the PayPal Vault token representing the user's credit card.
*
* If set to false, then any previously-remembered username, phone number, or
* credit card token will be erased, and subsequent payment information will
* not be remembered.
*
* Defaults to true.
*/
rememberUser?: boolean;
/**
* If not set, or if set to nil, defaults to the device's current language setting.
*
* Can be specified as a language code ("en", "fr", "zh-Hans", etc.) or as a locale ("en_AU", "fr_FR", "zh-Hant_HK", etc.).
* If the library does not contain localized strings for a specified locale, then will fall back to the language. E.g., "es_CO" -> "es".
* If the library does not contain localized strings for a specified language, then will fall back to American English.
*
* If you specify only a language code, and that code matches the device's currently preferred language,
* then the library will attempt to use the device's current region as well.
* E.g., specifying "en" on a device set to "English" and "United Kingdom" will result in "en_GB".
*
* These localizations are currently included:
* da,de,en,en_AU,en_GB,en_SV,es,es_MX,fr,he,it,ja,ko,nb,nl,pl,pt,pt_BR,ru,sv,tr,zh-Hans,zh-Hant_HK,zh-Hant_TW.
*/
languageOrLocale?: string;
/**
* Normally, the SDK blurs the screen when the app is backgrounded,
* to obscure credit card or PayPal account details in the iOS-saved screenshot.
* If your app already does its own blurring upon backgrounding, you might choose to disable this.
* Defaults to false.
*/
disableBlurWhenBackgrounding?: boolean;
/**
* If you will present the SDK's view controller within a popover, then set this property to true.
* Defaults to false. (iOS only)
*/
presentingInPopover?: boolean;
/**
* Sandbox credentials can be difficult to type on a mobile device. Setting this flag to true will
* cause the sandboxUserPassword and sandboxUserPin to always be pre-populated into login fields.
*
* This setting will have no effect if the operation mode is production.
* Defaults to false.
*/
forceDefaultsInSandbox?: boolean;
/**
* Password to use for sandbox if 'forceDefaultsInSandbox' is set.
*/
sandboxUserPassword?: string;
/**
* PIN to use for sandbox if 'forceDefaultsInSandbox' is set.
*/
sandboxUserPin?: string;
}
//#endregion
//#region cdv-plugin-paypal-mobile-sdk.js
declare module PayPalCordovaPlugin {
export interface PayPalClientIds {
PayPalEnvironmentProduction: string;
PayPalEnvironmentSandbox: string;
}
/**
* Represents the portion of an object that is common to all responses.
*/
export interface BaseResult {
client: Client;
response_type: string;
}
/**
* Represents the client portion of the response.
*/
export interface Client {
paypal_sdk_version: string;
environment: string;
platform: string;
product_name: string;
}
/**
* Represents the response for a successful callback from renderSinglePaymentUI().
*/
export interface SinglePaymentResult extends BaseResult {
response: {
intent: string;
id: string;
state: string;
authorization_id: string;
create_time: string;
};
}
/**
* Represents the response for a successful callback from renderFuturePaymentUI().
*/
export interface FuturePaymentResult extends BaseResult {
response: {
code: string;
};
}
export interface PayPalMobileStatic {
/**
* Retrieve the version of the PayPal iOS SDK library. Useful when contacting support.
*
* @param completionCallback a callback function accepting a string
*/
version(completionCallback: (result: string) => void): void;
/**
* You MUST call this method to initialize the PayPal Mobile SDK.
*
* The PayPal Mobile SDK can operate in different environments to facilitate development and testing.
*
* @param clientIdsForEnvironments set of client ids for environments
* Example: var clientIdsForEnvironments = {
* PayPalEnvironmentProduction : @"my-client-id-for-Production",
* PayPalEnvironmentSandbox : @"my-client-id-for-Sandbox"
* }
* @param completionCallback a callback function on success
*/
init(clientIdsForEnvironments: PayPalCordovaPlugin.PayPalClientIds, completionCallback: () => void): void;
/**
* You must preconnect to PayPal to prepare the device for processing payments.
* This improves the user experience, by making the presentation of the
* UI faster. The preconnect is valid for a limited time, so
* the recommended time to preconnect is on page load.
*
* @param environment available options are "PayPalEnvironmentNoNetwork", "PayPalEnvironmentProduction" and "PayPalEnvironmentSandbox"
* @param configuration PayPalConfiguration object, for Future Payments merchantName, merchantPrivacyPolicyURL
* and merchantUserAgreementURL must be set be set
* @param completionCallback a callback function on success
*/
prepareToRender(environment: string, configuration: PayPalConfiguration, completionCallback: () => void): void;
/**
* Start PayPal UI to collect payment from the user.
* See https://developer.paypal.com/webapps/developer/docs/integration/mobile/ios-integration-guide/
* for more documentation of the params.
*
* @param payment PayPalPayment object
* @param completionCallback a callback function accepting a js object, called when the user has completed payment
* @param cancelCallback a callback function accepting a reason string, called when the user cancels the payment
*/
renderSinglePaymentUI(payment: PayPalPayment, completionCallback: (result: PayPalCordovaPlugin.SinglePaymentResult) => void, cancelCallback: (cancelReason: string) => void): void;
/**
* @deprecated
* Once a user has consented to future payments, when the user subsequently initiates a PayPal payment
* from their device to be completed by your server, PayPal uses a Correlation ID to verify that the
* payment is originating from a valid, user-consented device+application.
* This helps reduce fraud and decrease declines.
* This method MUST be called prior to initiating a pre-consented payment (a "future payment") from a mobile device.
* Pass the result to your server, to include in the payment request sent to PayPal.
* Do not otherwise cache or store this value.
*
* @param environment available options are "PayPalEnvironmentNoNetwork", "PayPalEnvironmentProduction" and "PayPalEnvironmentSandbox"
* @param callback applicationCorrelationID Your server will send this to PayPal in a 'Paypal-Application-Correlation-Id' header.
*/
applicationCorrelationIDForEnvironment(environment: string, completionCallback: (applicationCorrelationId: string) => void): void;
/**
* Once a user has consented to future payments, when the user subsequently initiates a PayPal payment
* from their device to be completed by your server, PayPal uses a Correlation ID to verify that the
* payment is originating from a valid, user-consented device+application.
* This helps reduce fraud and decrease declines.
* This method MUST be called prior to initiating a pre-consented payment (a "future payment") from a mobile device.
* Pass the result to your server, to include in the payment request sent to PayPal.
* Do not otherwise cache or store this value.
*
* @param callback clientMetadataID Your server will send this to PayPal in a 'PayPal-Client-Metadata-Id' header.
*/
clientMetadataID(completionCallback: (clientMetadataId: string) => void): void;
/**
* Please Read Docs on Future Payments at https://github.com/paypal/PayPal-iOS-SDK#future-payments
*
* @param completionCallback a callback function accepting a js object with future payment authorization
* @param cancelCallback a callback function accepting a reason string, called when the user canceled without agreement
*/
renderFuturePaymentUI(completionCallback: (result: PayPalCordovaPlugin.FuturePaymentResult) => void, cancelCallback: (cancelReason: string) => void): void;
/**
* Please Read Docs on Profile Sharing at https://github.com/paypal/PayPal-iOS-SDK#profile-sharing
*
* @param scopes scopes Set of requested scope-values. Accepted scopes are: openid, profile, address, email, phone, futurepayments and paypalattributes
* See https://developer.paypal.com/docs/integration/direct/identity/attributes/ for more details
* @param completionCallback a callback function accepting a js object with future payment authorization
* @param cancelCallback a callback function accepting a reason string, called when the user canceled without agreement
*/
renderProfileSharingUI(scopes: string[], completionCallback: (result: any) => void, cancelCallback: (cancelReason: string) => void): void;
}
}
declare var PayPalMobile: PayPalCordovaPlugin.PayPalMobileStatic;
//#endregion
+10
View File
@@ -0,0 +1,10 @@
/// <reference path="_debugger.d.ts"/>
import _debugger = require("_debugger");
var {Client} = _debugger;
var client = new Client();
client.connect(8888, 'localhost');
client.listbreakpoints((err, res) => {
});
+135
View File
@@ -0,0 +1,135 @@
// Type definitions for Node.js debugger API
// Project: http://nodejs.org/
// Definitions by: Basarat Ali Syed <https://github.com/basarat>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts"/>
declare module NodeJS {
export module _debugger {
export interface Packet {
raw: string;
headers: string[];
body: Message;
}
export interface Message {
seq: number;
type: string;
}
export interface RequestInfo {
command: string;
arguments: any;
}
export interface Request extends Message, RequestInfo {
}
export interface Event extends Message {
event: string;
body?: any;
}
export interface Response extends Message {
request_seq: number;
success: boolean;
/** Contains error message if success === false. */
message?: string;
/** Contains message body if success === true. */
body?: any;
}
export interface BreakpointMessageBody {
type: string;
target: number;
line: number;
}
export class Protocol {
res: Packet;
state: string;
execute(data: string): void;
serialize(rq: Request): string;
onResponse: (pkt: Packet) => void;
}
export var NO_FRAME: number;
export var port: number;
export interface ScriptDesc {
name: string;
id: number;
isNative?: boolean;
handle?: number;
type: string;
lineOffset?: number;
columnOffset?: number;
lineCount?: number;
}
export interface Breakpoint {
id: number;
scriptId: number;
script: ScriptDesc;
line: number;
condition?: string;
scriptReq?: string;
}
export interface RequestHandler {
(err: boolean, body: Message, res: Packet): void;
request_seq?: number;
}
export interface ResponseBodyHandler {
(err: boolean, body?: any): void;
request_seq?: number;
}
export interface ExceptionInfo {
text: string;
}
export interface BreakResponse {
script?: ScriptDesc;
exception?: ExceptionInfo;
sourceLine: number;
sourceLineText: string;
sourceColumn: number;
}
export function SourceInfo(body: BreakResponse): string;
export interface ClientInstance extends EventEmitter {
protocol: Protocol;
scripts: ScriptDesc[];
handles: ScriptDesc[];
breakpoints: Breakpoint[];
currentSourceLine: number;
currentSourceColumn: number;
currentSourceLineText: string;
currentFrame: number;
currentScript: string;
connect(port: number, host: string): void;
req(req: any, cb: RequestHandler): void;
reqFrameEval(code: string, frame: number, cb: RequestHandler): void;
mirrorObject(obj: any, depth: number, cb: ResponseBodyHandler): void;
setBreakpoint(rq: BreakpointMessageBody, cb: RequestHandler): void;
clearBreakpoint(rq: Request, cb: RequestHandler): void;
listbreakpoints(cb: RequestHandler): void;
reqSource(from: number, to: number, cb: RequestHandler): void;
reqScripts(cb: any): void;
reqContinue(cb: RequestHandler): void;
}
export var Client : {
new (): ClientInstance
}
}
}
declare module "_debugger"{
export = NodeJS._debugger;
}
+13 -1
View File
@@ -47,7 +47,19 @@ interface AccWizardOptions {
nextText: string;
/**
* @summary Text for back button
* @summary Text for back button.
* @type {string}
*/
backText: string;
/**
* @summary HTML input type for next button. (default: "submit")
* @type {string}
*/
nextType: string;
/**
* @summary HTML input type for back button. (default: "reset")
* @type {string}
*/
backType: string;
+3 -1
View File
@@ -18,7 +18,9 @@ declare module AceAjax {
bindKey:any;
exec:Function;
exec: Function;
readOnly?: boolean;
}
export interface CommandManager {
+1 -1
View File
@@ -14,7 +14,7 @@ var string: string;
// acorn
string = acorn.version;
program = acorn.parse('code');
program = acorn.parse('code', {range: true, onToken: tokens, onComment: comments});
program = acorn.parse('code', {ranges: true, onToken: tokens, onComment: comments});
program = acorn.parse('code', {
ranges: true,
onToken: (token) => tokens.push(token),
+1
View File
@@ -29,6 +29,7 @@ interface amplifyDecoders {
interface amplifyAjaxSettings extends JQueryAjaxSettings {
cache?: any;
dataMap?: {} | ((data: any) => {});
decoder?: any /* string or amplifyDecoder */;
}
-1
View File
@@ -1 +0,0 @@
+21
View File
@@ -0,0 +1,21 @@
/// <reference path="amqplib.d.ts" />
import amqp = require("amqplib");
var msg = "Hello World";
amqp.connect("amqp://localhost")
.then(connection => {
return connection.createChannel()
.tap(channel => channel.checkQueue("myQueue"))
.then(channel => channel.sendToQueue("myQueue", new Buffer(msg)))
.ensure(() => connection.close());
});
amqp.connect("amqp://localhost")
.then(connection => {
return connection.createChannel()
.tap(channel => channel.checkQueue("myQueue"))
.then(channel => channel.consume("myQueue", newMsg => console.log("New Message: " + newMsg.content.toString())))
.ensure(() => connection.close());
});
+144
View File
@@ -0,0 +1,144 @@
// Type definitions for amqplib 0.3.x
// Project: https://github.com/squaremo/amqp.node
// Definitions by: Michael Nahkies <https://github.com/mnahkies>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../when/when.d.ts" />
/// <reference path="../node/node.d.ts" />
declare module "amqplib" {
import events = require("events");
import when = require("when");
interface Connection extends events.EventEmitter {
close(): when.Promise<void>;
createChannel(): when.Promise<Channel>;
createConfirmChannel(): when.Promise<Channel>;
}
module Replies {
interface Empty {
}
interface AssertQueue {
queue: string;
messageCount: number;
consumerCount: number;
}
interface DeleteQueue {
messageCount: number;
}
interface AssertExchange {
exchange: string;
}
interface Consume {
consumerTag: string;
}
}
module Options {
interface AssertQueue {
exclusive?: boolean;
durable?: boolean;
autoDelete?: boolean;
arguments?: any;
messageTtl?: number;
expires?: number;
deadLetterExchange?: string;
maxLength?: number;
}
interface DeleteQueue {
ifUnused?: boolean;
ifEmpty?: boolean;
}
interface AssertExchange {
durable?: boolean;
internal?: boolean;
autoDelete?: boolean;
alternateExchange?: string;
arguments?: any;
}
interface DeleteExchange {
ifUnused?: boolean;
}
interface Publish {
expiration?: string;
userId?: string;
CC?: string | string[];
mandatory?: boolean;
persistent?: boolean;
deliveryMode?: boolean | number;
BCC?: string | string[];
contentType?: string;
contentEncoding?: string;
headers?: Object;
priority?: number;
correlationId?: string;
replyTo?: string;
messageId?: string;
timestamp?: number;
type?: string;
appId?: string;
}
interface Consume {
consumerTag?: string;
noLocal?: boolean;
noAck?: boolean;
exclusive?: boolean;
priority?: number;
arguments?: Object;
}
interface Get {
noAck?: boolean;
}
}
interface Message {
content: Buffer;
fields: Object;
properties: Object;
}
interface Channel extends events.EventEmitter {
close(): when.Promise<void>;
assertQueue(queue: string, options?: Options.AssertQueue): when.Promise<Replies.AssertQueue>;
checkQueue(queue: string): when.Promise<Replies.AssertQueue>;
deleteQueue(queue: string, options?: Options.DeleteQueue): when.Promise<Replies.DeleteQueue>;
purgeQueue(queue: string): when.Promise<Replies.DeleteQueue>;
bindQueue(queue: string, source: string, pattern: string, args?: any): when.Promise<Replies.Empty>;
unbindQueue(queue: string, source: string, pattern: string, args?: any): when.Promise<Replies.Empty>;
assertExchange(exchange: string, type: string, options?: Options.AssertExchange): when.Promise<Replies.AssertExchange>;
checkExchange(exchange: string): when.Promise<Replies.Empty>;
deleteExchange(exchange: string, options?: Options.DeleteExchange): when.Promise<Replies.Empty>;
bindExchange(destination: string, source: string, pattern: string, args?: any): when.Promise<Replies.Empty>;
unbindExchange(destination: string, source: string, pattern: string, args?: any): when.Promise<Replies.Empty>;
publish(exchange: string, routingKey: string, content: Buffer, options?: Options.Publish): boolean;
sendToQueue(queue: string, content: Buffer, options?: Options.Publish): boolean;
consume(queue: string, onMessage: (msg: Message) => any, options?: Options.Consume): when.Promise<Replies.Consume>;
cancel(consumerTag: string): when.Promise<Replies.Empty>;
get(queue: string, options?: Options.Get): when.Promise<Message | boolean>;
ack(message: Message, allUpTo?: boolean): void;
ackAll(): void;
nack(message: Message, allUpTo?: boolean, requeue?: boolean): void;
nackAll(requeue?: boolean): void;
reject(message: Message, requeue?: boolean): void;
prefetch(count: number, global?: boolean): when.Promise<Replies.Empty>;
recover(): when.Promise<Replies.Empty>;
}
function connect(url: string, socketOptions?: any): when.Promise<Connection>;
}
+2 -26
View File
@@ -3,30 +3,6 @@
// Definitions by: John Reilly <https://github.com/johnnyreilly>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
/// <reference path="../ng-file-upload/ng-file-upload.d.ts" />
declare module angular.angularFileUpload {
interface IUploadService {
http<T>(config: IRequestConfig): IUploadPromise<T>;
upload<T>(config: IFileUploadConfig): IUploadPromise<T>;
}
interface IUploadPromise<T> extends IHttpPromise<T> {
abort(): IUploadPromise<T>;
progress(callback: IHttpPromiseCallback<T>): IUploadPromise<T>;
xhr(callback: IHttpPromiseCallback<T>): IUploadPromise<T>;
}
interface IFileUploadConfig extends IRequestConfig {
file: File;
fileName?: string;
}
interface IFileProgressEvent extends ProgressEvent {
config: IFileUploadConfig;
}
}
// THIS FILE WILL REMOVE IF angular-file-upload.d.ts incoming.
+108
View File
@@ -0,0 +1,108 @@
/// <reference path="angular-formly.d.ts" />
var app = angular.module('app', ['formly']);
interface IScope extends ng.IScope {
to: { label: string; }
}
class FormConfig {
constructor(formlyConfig: AngularFormly.IFormlyConfig, formlyValidationMessages: AngularFormly.IValidationMessages) {
formlyConfig.setWrapper({
name: 'validation',
types: ['input', 'customInput'],
templateUrl: 'my-messages.html'
});
formlyValidationMessages.addStringMessage('required', 'This field is required');
formlyConfig.setType({
name: 'customInput',
extends: 'input'
});
}
}
class AppController {
fields: AngularFormly.IFieldConfigurationObject[];
constructor() {
var vm = this;
vm.fields = [
{
key: 'firstName',
type: 'customInput',
templateOptions: {
required: true,
label: 'First Name',
foo: 'hi'
}
},
{
key: 'email',
type: 'input',
templateOptions: {
label: 'Email',
required: true,
type: 'email',
maxlength: 10,
minlength: 6,
placeholder: 'example@example.com'
}
},
{
key: 'ip',
type: 'input',
validators: {
ipAddress: {
expression: function(viewValue, modelValue) {
var value = modelValue || viewValue;
return /(\d{1,3}\.){3}\d{1,3}/.test(value);
},
message: '$viewValue + " is not a valid IP Address"'
}
},
templateOptions: {
label: 'IP Address',
required: true,
type: 'text',
placeholder: '127.0.0.1',
},
validation: {
messages: {
required: function($viewValue: any, $modelValue: any, scope: AngularFormly.ITemplateScope) {
return scope.to.label + ' is required'
}
}
}
},
{
key: 'mac',
type: 'input',
templateOptions: {
label: 'MAC Address',
required: true,
placeholder: '49-8A-BD-4E-00-1D',
pattern: '([0-9A-F]{2}[:-]){5}([0-9A-F]{2})'
}
},
{
type: 'checkbox',
key: 'checked',
templateOptions: {
label: 'Check this'
}
},
{
key: 'checked2',
type: 'checkbox',
wrapper: null,
templateOptions: {
label: 'no wrapper here...'
}
}
]
}
}
app.controller("AppController", AppController);
+574
View File
@@ -0,0 +1,574 @@
// Type definitions for angular-formly 6.18.0
// Project: https://github.com/formly-js/angular-formly
// Definitions by: Scott Hatcher <https://github.com/scatcher>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare module 'AngularFormly' {
export = AngularFormly;
}
declare module AngularFormly {
interface IFieldGroup {
data?: Object;
className?: string;
elementAttributes?: { [key: string]: string };
fieldGroup: IFieldConfigurationObject[];
form?: Object;
hide?: boolean;
hideExpression?: string | IExpresssionFunction;
key?: string | number;
model?: string | Object;
options?: IFormOptionsAPI
}
interface IFormOptionsAPI {
data?: Object;
fieldTransform?: Function;
formState?: Object;
removeChromeAutoComplete?: boolean;
resetModel?: Function;
templateManipulators?: ITemplateManipulators;
updateInitialValue?: Function;
wrapper?: string | string[];
}
/**
* see http://docs.angular-formly.com/docs/formly-expressions#expressionproperties-validators--messages
*/
interface IExpresssionFunction {
($viewValue: any, $modelValue: any, scope: ITemplateScope): any;
}
interface IModelOptions {
updateOn?: string;
debounce?: number;
allowInvalid?: boolean;
getterSetter?: string;
timezone?: string;
}
interface ITemplateManipulator {
(template: string | HTMLElement, options: Object, scope: ITemplateScope): string | HTMLElement;
}
interface ITemplateManipulators {
preWrapper?: ITemplateManipulator[];
postWrapper?: ITemplateManipulator[];
}
/**
* see http://docs.angular-formly.com/docs/ngmodelattrstemplatemanipulator
*/
interface ITemplateOptions {
// both attribute or regular attribute
disabled?: boolean;
maxlength?: number;
minlength?: number;
pattern?: string;
required?: boolean;
//attribute only
max?: number;
min?: number;
placeholder?: number | string;
tabindex?: number;
type?: string;
//expression types
onBlur?: string;
onChange?: string;
onClick?: string;
onFocus?: string;
onKeydown?: string;
onKeypress?: string;
onKeyup?: string;
//Bootstrap types
label?: string;
description?: string;
[key: string]: any;
}
/**
* see http://docs.angular-formly.com/docs/field-configuration-object#validators-object
*/
interface IValidator {
expression: string | IExpresssionFunction;
message?: string | IExpresssionFunction;
}
/**
* An object which has at least two properties called expression and listener. The watch.expression
* is added to the formly-form directive's scope (to allow it to run even when hide is true). You
* can specify a type ($watchCollection or $watchGroup) via the watcher.type property (defaults to
* $watch) and whether you want it to be a deep watch via the watcher.deep property (defaults to false).
*
* see http://docs.angular-formly.com/docs/field-configuration-object#watcher-objectarray-of-watches
*/
interface IWatcher {
deep?: boolean; //Defaults to false
expression?: string | { (field: string, scope: ITemplateScope): boolean };
listener: (field: string, newValue: any, oldValue: any, scope: ITemplateScope, stopWatching: Function) => void;
type?: string; //Defaults to $watch but can be set to $watchCollection or $watchGroup
}
// see http://docs.angular-formly.com/docs/field-configuration-object
interface IFieldConfigurationObject {
/**
* Added in 6.18.0
*
* Demo
* see http://angular-formly.com/#/example/other/unique-value-async-validation
*/
asyncValidators?: {
[key: string]: string | IExpresssionFunction | IValidator;
}
/**
* This is a great way to add custom behavior to a specific field. It is injectable with the $scope of the
* field, and anything else you have in your injector.
*
* see http://docs.angular-formly.com/docs/field-configuration-object#controller-controller-name-as-string--controller-f
*/
controller?: string | Function;
/**
* This is reserved for the developer. You have our guarantee to be able to use this and not worry about
* future versions of formly overriding your usage and preventing you from upgrading :-)
*
* see http://docs.angular-formly.com/docs/field-configuration-object#data-object
*/
data?: Object;
/**
* Use defaultValue to initialize it the model. If this is provided and the value of the
* model at compile-time is undefined, then the value of the model will be assigned to defaultValue.
*
* see http://docs.angular-formly.com/docs/field-configuration-object#defaultvalue-any
*/
defaultValue?: any;
/**
* You can specify your own class that will be applied to the formly-field directive (or ng-form of
* a fieldGroup).
*
* see http://docs.angular-formly.com/docs/field-configuration-object#classname-string
*/
className?: string;
elementAttributes?: string;
/**
* An object where the key is a property to be set on the main field config and the value is an
* expression used to assign that property. The value is a formly expressions. The returned value is
* wrapped in $q.when so you can return a promise from your function :-)
*
* see http://docs.angular-formly.com/docs/field-configuration-object#expressionproperties-object
*/
expressionProperties?: {
[key: string]: string | IExpresssionFunction | IValidator;
}
/**
* Uses ng-if. Whether to hide the field. Defaults to false. If you wish this to be conditional, use
* hideExpression. See below.
*
* see http://docs.angular-formly.com/docs/field-configuration-object#hide-boolean
*/
hide?: boolean
/**
* This is similar to expressionProperties with a slight difference. You should (hopefully) never
* notice the difference with the most common use case. This is available due to limitations with
* expressionProperties and ng-if not working together very nicely.
*
* see http://docs.angular-formly.com/docs/field-configuration-object#hideexpression-string--function
*/
hideExpression?: string | IExpresssionFunction;
/**
* This allows you to specify the id of your field (which will be used for its name as well unless
* a name is provided). Note, you can also override the id generation code using the formlyConfig
* extra called getFieldId.
*
* AVOID THIS
* If you don't have to do this, don't. Specifying IDs makes it harder to re-use things and it's
* just extra work. Part of the beauty that angular-formly provides is the fact that you don't need
* to concern yourself with making sure that this is unique.
*
* see http://docs.angular-formly.com/docs/field-configuration-object#id-string
*/
id?: string;
initialValue?: any;
/**
* Can be set instead of type or template to use a custom html template form field. Works
* just like a directive templateUrl and uses the $templateCache
*
* see http://docs.angular-formly.com/docs/field-configuration-object#key-string
*/
key?: string | number;
/**
* This allows you to specify a link function. It is invoked after your template has finished compiling.
* You are passed the normal arguments for a normal link function.
*
* see http://docs.angular-formly.com/docs/field-configuration-object#link-link-function
*/
link?: ng.IDirectiveLinkFn;
/**
* By default, the model passed to the formly-field directive is the same as the model passed to the
* formly-form. However, if the field has a model specified, then it is used for that field (and that
* field only). In addition, a deep watch is added to the formly-field directive's scope to run the
* expressionProperties when the specified model changes.
*
* Note, the formly-form directive will allow you to specify a string which is an (almost) formly
* expression which allows you to define the model as relative to the scope of the form.
*
* see http://docs.angular-formly.com/docs/field-configuration-object#model-object--string
*/
model?: Object | string;
/**
* Allows you to take advantage of ng-model-options directive. Formly's built-in templateManipulator (see
* below) will add this attribute to your ng-model element automatically if this property exists. Note,
* if you use the getter/setter option, formly's templateManipulator will change the value of ng-model
* to options.value which is a getterSetter that formly adds to field options.
*
* see http://docs.angular-formly.com/docs/field-configuration-object#modeloptions
*/
modelOptions?: IModelOptions;
/**
* If you wish to, you can specify a specific name for your ng-model. This is useful if you're posting
* the form to a server using techniques of yester-year.
*
* AVOID THIS
* If you don't have to do this, don't. It's just extra work. Part of the beauty that angular-formly
* provides is the fact that you don't need to concern yourself with stuff like this.
*
* see http://docs.angular-formly.com/docs/field-configuration-object#name-string
*/
name?: string;
/**
* This is used by ngModelAttrsTemplateManipulator to automatically add attributes to the ng-model element
* of field templates. You will likely not use this often. This object is a little complex, but extremely
* powerful. It's best to explain this api via an example. For more information, see the guide on ngModelAttrs.
*
* see http://docs.angular-formly.com/docs/field-configuration-object#ngmodelattrs-object
*/
ngModelAttrs?: {
attribute?: any;
bound?: any;
expression?: any;
value?: any;
};
/**
* Used to tell angular-formly to not attempt to add the formControl property to your object. This is useful
* for things like validation, but not necessary if your "field" doesn't use ng-model (if it's just a horizontal
* line for example). Defaults to undefined.
*
* see http://docs.angular-formly.com/docs/field-configuration-object#noformcontrol-boolean
*/
noFormControl?: boolean;
/**
* Allows you to specify extra types to get options from. Duplicate options are overridden in later priority
* (index 1 will override index 0 properties). Also, these are applied after the type's defaultOptions and
* hence will override any duplicates of those properties as well.
*
* see http://docs.angular-formly.com/docs/field-configuration-object#optionstypes-string--array-of-strings
*/
optionsTypes?: string | string[];
/**
* Can be set instead of type or templateUrl to use a custom html
* template form field. Recommended to be used with one-liners mostly
* (like a directive), or if you're using webpack with the ability to require templates :-)
*
* If a function is passed, it is invoked with the field configuration object and can return
* either a string for the template or a promise that resolves to a string.
*
* see http://docs.angular-formly.com/docs/field-configuration-object#template-string--function
*/
template?: string | { (fieldConfiguration: IFieldConfigurationObject): string | ng.IPromise<string> };
/**
* Allows you to specify custom template manipulators for this specific field. (use defaultOptions in a
* type configuration if you want it to apply to all fields of a certain type).
*
* see http://docs.angular-formly.com/docs/field-configuration-object#templatemanipulator-object-of-arrays-of-functions
*/
templateManipulators?: ITemplateManipulators;
/**
* This is reserved for the templates. Any template-specific options go in here. Look at your specific
* template implementation to know the options required for this.
*
* see http://docs.angular-formly.com/docs/field-configuration-object#templateoptions-object
*/
templateOptions?: ITemplateOptions;
/**
* Can be set instead of type or template to use a custom html template form field. Works
* just like a directive templateUrl and uses the $templateCache
*
* see http://docs.angular-formly.com/docs/field-configuration-object#templateurl-string--function
*/
templateUrl?: string | { (fieldConfiguration: IFieldConfigurationObject): string | ng.IPromise<string> };
/**
* The type of field to be rendered. This is the recommended method
* for defining fields. Types must be pre-defined using formlyConfig.
*
* see http://docs.angular-formly.com/docs/field-configuration-object#type-string
*/
type?: string;
/**
* An object with a few useful properties mostly handy when used in combination with ng-messages
*/
validation?: {
/**
* This is set by angular-formly. This is a boolean indicating whether an error message should be shown. Because
* you generally only want to show error messages when the user has interacted with a specific field, this value
* is set to true based on this rule: field invalid && (field touched || validation.show) (with slight difference
* for pre-angular 1.3 because it doesn't have touched support).
*/
errorExistsAndShouldBeVisible?: boolean;
/**
* A map of Formly Expressions mapped to message names. This is really useful when you're using ng-messages
* like in this example.
*/
messages?: {
[key: string]: IExpresssionFunction | string;
}
/**
* A boolean you as the developer can set to specify to force options.validation.errorExistsAndShouldBeVisible
* to be set to true when there are $errors. This is useful when you're trying to call the user's attention to
* some fields for some reason.
*/
show?: boolean;
}
/**
* An object where the keys are the name of the validator and the values are Formly Expressions;
*
* Async Validation
* All function validators can return true/false/Promise. A validator passes if it returns true or a promise
* that is resolved. A validator fails if it returns false or a promise that is rejected.
*
* see http://docs.angular-formly.com/docs/field-configuration-object#validators-object
*/
validators?: {
[key: string]: string | IExpresssionFunction | IValidator;
}
/**
* This is a getter/setter function for the value that your field is representing. Useful when using getterSetter: true
* in the modelOptions (in fact, if you don't disable the ngModelAttrsTemplateManipulator that comes built-in with formly,
* it will automagically change your field's ng-model attribute to use options.value.
*
* see http://docs.angular-formly.com/docs/field-configuration-object#value-gettersetter-function
*/
value?(): any; //Getter
value?(val: any): void; //Setter
/**
* An object which has at least two properties called expression and listener. The watch.expression is added
* to the formly-form directive's scope (to allow it to run even when hide is true). You can specify a type
* ($watchCollection or $watchGroup) via the watcher.type property (defaults to $watch) and whether you want
* it to be a deep watch via the watcher.deep property (defaults to false).
*
* see http://docs.angular-formly.com/docs/field-configuration-object#watcher-objectarray-of-watches
*/
watcher?: IWatcher | IWatcher[];
/**
* This makes reference to setWrapper in formlyConfig. It is expected to be the name of the wrapper. If
* given an array, the formly field template will be wrapped by the first wrapper, then the second, then
* the third, etc. You can also specify these as part of a type (which is the recommended approach).
* Specifying this property will override the wrappers for the type for this field.
*
* http://docs.angular-formly.com/docs/field-configuration-object#wrapper-string--array-of-strings
*/
wrapper?: string | string[];
//ALL PROPERTIES BELOW ARE ADDED (So you should not be setting them yourself.)
/**
* This is the NgModelController for the field. It provides you with awesome stuff like $errors :-)
*
* see http://docs.angular-formly.com/docs/field-configuration-object#formcontrol-ngmodelcontroller
*/
formControl?: ng.IFormController | ng.IFormController[];
/**
* Will reset the field's model and the field control to the last initialValue. This is used by the
* formly-form's options.resetModel function.
*
* see http://docs.angular-formly.com/docs/field-configuration-object#resetmodel-function
*/
resetModel?: () => void;
/**
* It is not likely that you'll ever want to invoke this function. It simply runs the expressionProperties expressions.
* It is used internally and you shouldn't have to use it, but you can if you want to, and any breaking changes to the
* way it works will result in a major version change, so you can rely on its api.
*
* see http://docs.angular-formly.com/docs/field-configuration-object#runexpressions-function
*/
runExpressions?: () => void;
/**
* Will reset the field's initialValue to the current state of the model. Useful if you load the model asynchronously.
* Invoke this when the model gets set. This is used by the formly-form's options.updateInitialValue function.
*
* see http://docs.angular-formly.com/docs/field-configuration-object#updateinitialvalue-function
*/
updateInitialValue?: () => void;
}
/**
*
*
* see http://docs.angular-formly.com/docs/custom-templates#section-formlyconfig-settype-options
*/
interface ITypeOptions {
apiCheck?: { [key: string]: Function };
apiCheckFunction?: string; //'throw' or 'warn
apiCheckInstance?: any;
apiCheckOptions?: Object;
defaultOptions?: IFieldConfigurationObject | Function;
controller?: Function | string | any[];
data?: Object;
extends?: string;
link?: ng.IDirectiveLinkFn;
overwriteOk?: boolean;
name: string;
template?: Function | string;
templateUrl?: Function | string;
validateOptions?: Function;
wrapper?: string | string[];
}
interface IWrapperOptions {
apiCheck?: { [key: string]: Function };
apiCheckFunction?: string; //'throw' or 'warn
apiCheckInstance?: any;
apiCheckOptions?: Object;
overwriteOk?: boolean;
name?: string;
template?: string;
templateUrl?: string;
types?: string[];
validateOptions?: Function;
}
interface IFormlyConfig {
setType(typeOptions: ITypeOptions): void;
setWrapper(wrapperOptions: IWrapperOptions): void;
}
interface ITemplateScopeOptions {
formControl: ng.IFormController | ng.IFormController[];
templateOptions: ITemplateOptions;
validation: Object;
}
/**
* see http://docs.angular-formly.com/docs/custom-templates#templates-scope
*/
interface ITemplateScope {
options: ITemplateScopeOptions;
//Shortcut to options.formControl
fc: ng.IFormController | ng.IFormController[];
//all the fields for the form
fields: IFieldConfigurationObject[];
//the form controller the field is in
form: any;
//The object passed as options.formState to the formly-form directive. Use this to share state between fields.
formState: Object;
//The id of the field. You shouldn't have to use this.
id: string;
//The index of the field the form is on (in ng-repeat)
index: number;
//the model of the form (or the model specified by the field if it was specified).
model: Object | string;
//Shortcut to options.validation.errorExistsAndShouldBeVisible
showError: boolean;
//Shortcut to options.templateOptions
to: ITemplateOptions;
}
/**
* see http://docs.angular-formly.com/docs/formlyvalidationmessages#addtemplateoptionvaluemessage
*/
interface IValidationMessages {
addTemplateOptionValueMessage(name: string, prop: string, prefix: string, suffix: string, alternate: string): void;
addStringMessage(name: string, string: string): void;
messages: { [key: string]: ($viewValue: any, $modelValue: any, scope: ITemplateScope) => string };
}
}
@@ -124,3 +124,18 @@ $localForage.iterate(function (value, key) {
}
}).then(function (data) {
});
$localForage.bind($rootScope, 'key').then(function(data) {
});
$localForage.bind($rootScope, {key: 'key'}).then(function(data) {
});
$localForage.bind($rootScope, {key: 'key', defaultValue: 'defaultValue'}).then(function(data) {
});
$localForage.bind($rootScope, {key: 'key', scopeKey: 'scopeKey'}).then(function(data) {
});
$localForage.bind($rootScope, {key: 'key', name: 'name'}).then(function(data) {
});
+5 -5
View File
@@ -46,14 +46,14 @@ declare module angular.localForage {
iterate<T>(iteratorCallback:(value:string | number, key:string)=>T):angular.IPromise<T>;
bind($scope:ng.IScope, key:string):void;
bind($scope:ng.IScope, key:string):angular.IPromise<any>;
bind($scope:ng.IScope, config:{
key:string;
defaultValue:any;
scopeKey:string;
name:string;
}):void;
defaultValue?:any;
scopeKey?:string;
name?:string;
}):angular.IPromise<any>;
unbind($scope:ng.IScope, key:string, scopeKey?:string):void;
+1
View File
@@ -122,6 +122,7 @@ declare module angular.material {
theme(theme: string): T;
hideDelay(delay: number): T;
position(position: string): T;
parent(parent?: string|Element|JQuery): T; // default: root node
}
interface ISimpleToastPreset extends IToastPreset<ISimpleToastPreset> {
@@ -0,0 +1,12 @@
/// <reference path="angular-notifications.d.ts" />
var myapp = angular.module("myapp", ["notifications"]);
myapp.controller("MyController", ["$scope", "notifications",
function ($scope:ng.IScope, notifications:angular.notifications.INotificationFactory) { // <-- Inject notifications
var userData = {'some': 'data', 'optional': true};
notifications.info("Something happened", "here is the content of what happened", userData);
}
]);
+82
View File
@@ -0,0 +1,82 @@
// Type definitions for angular-notifications
// Project: https://github.com/DerekRies/angular-notifications
// Definitions by: Tomasz Ducin <https://github.com/ducin/DefinitelyTyped>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare module angular.notifications {
interface IAnimation {
duration: number;
enabled: boolean;
}
interface ISettings {
info: IAnimation;
warning: IAnimation;
error: IAnimation;
success: IAnimation;
progress: IAnimation;
custom: IAnimation;
details: boolean;
localStorage: boolean;
html5Mode: boolean;
html5DefaultIcon: string;
}
interface INotification {
type: string;
image: string;
icon: string;
title: string;
content: string;
timestamp: string;
userData: string;
}
interface INotificationFactory extends angular.IModule {
/* ========== SETTINGS RELATED METHODS =============*/
disableHtml5Mode(): void;
disableType(notificationType: string): void;
enableHtml5Mode(): void;
enableType(notificationType: string): void;
getSettings(): ISettings;
toggleType(notificationType: string): void;
toggleHtml5Mode(): void;
requestHtml5ModePermissions(): boolean;
/* ============ QUERYING RELATED METHODS ============*/
getAll(): Array<INotification>;
getQueue(): Array<INotification>;
/* ============== NOTIFICATION METHODS ==============*/
info(title: string): INotification;
info(title: string, content: string): INotification;
info(title: string, content: string, userData: any): INotification;
error(title: string): INotification;
error(title: string, content: string): INotification;
error(title: string, content: string, userData: any): INotification;
success(title: string): INotification;
success(title: string, content: string): INotification;
success(title: string, content: string, userData: any): INotification;
warning(title: string): INotification;
warning(title: string, content: string): INotification;
warning(title: string, content: string, userData: any): INotification;
awesomeNotify(type: string, icon: string, title: string, content: string, userData: any): INotification;
notify(image: string, title: string, content: string, userData: any): INotification;
makeNotification(type: string, image: string, icon: string, title: string, content: string, userData: any): INotification;
/* ============ PERSISTENCE METHODS ============ */
save(): void;
restore(): void;
clear(): void;
}
}
@@ -186,4 +186,23 @@ var combination2 = Predicate.and([combination1, predicate2]);
var predicate = new Predicate("FirstName", "John")
.or(new Predicate("LastName", '!=', "Doe"))
.and(new Predicate("Age", '>', 10));
.and(new Predicate("Age", '>', 10));
users = odataResourceClass.odata()
.withInlineCount()
.query();
var countResult = odataResourceClass.odata().count();
var total = countResult.result;
var usersSelect1 = odataResourceClass.odata()
.select('name', 'user');
var usersSelect2 = odataResourceClass.odata()
.select(['name', 'user']);
+16 -5
View File
@@ -264,6 +264,12 @@ declare module OData {
(queryString: string, success: () => any, error: () => any): T[];
(queryString: string, success: () => any, error: () => any, isSingleElement?: boolean, forceSingleElement?: boolean): T;
}
interface ICountResult{
result: number;
$promise: angular.IPromise<any>;
}
class Provider<T> {
private callback;
private filters;
@@ -273,14 +279,19 @@ declare module OData {
private expandables;
constructor(callback: ProviderCallback<T>);
filter(operand1: any, operand2?: any, operand3?: any): Provider<T>;
orderBy(arg1: any, arg2?: any): Provider<T>;
orderBy(arg1: string, arg2?: string): Provider<T>;
take(amount: number): Provider<T>;
skip(amount: number): Provider<T>;
private execute();
query(success?: any, error?: any): T[];
single(success?: any, error?: any): T;
get(data: any, success?: any, error?: any): T;
expand(params: any, otherParam1?: any, otherParam2?: any, otherParam3?: any, otherParam4?: any, otherParam5?: any, otherParam6?: any, otherParam7?: any): Provider<T>;
query(success?: ((p:T[])=>void), error?: (()=>void)): T[];
single(success?: ((p:T)=>void), error?: (()=>void)): T;
get(key: any, success?: ((p:T)=>void), error?: (()=>void)): T;
expand(...params: string[]): Provider<T>;
expand(params: string[]): Provider<T>;
select(...params: string[]): Provider<T>;
select(params: string[]): Provider<T>;
count(success?: (result: ICountResult) => any, error?: () => any):ICountResult;
withInlineCount(): Provider<T>;
}
interface ValueFactory {
@@ -374,7 +374,7 @@ function TestElementArrayFinder() {
var b: boolean = elementArrayFinder.isPending();
var locator: webdriver.Locator = elementArrayFinder.locator();
var findersArray: protractor.ElementFinder[] = elementArrayFinder.asElementFinders_();
var findersArrayPromise: protractor.promise.Promise<protractor.ElementFinder[]> = elementArrayFinder.asElementFinders_();
var driverElementArray: webdriver.WebElement[] = elementArrayFinder.getWebElements();
var elementFinder: protractor.ElementFinder = elementArrayFinder.get(42);
+16 -2
View File
@@ -927,7 +927,7 @@ declare module protractor {
* @return {Array.<ElementFinder>} Return a promise, which resolves to a list
* of ElementFinders specified by the locator.
*/
asElementFinders_(): ElementFinder[];
asElementFinders_(): webdriver.promise.Promise<ElementFinder[]>;
/**
* Create a shallow copy of ElementArrayFinder.
@@ -1228,7 +1228,21 @@ declare module protractor {
row(index: number): LocatorWithColumn;
}
interface IProtractorLocatorStrategy extends webdriver.ILocatorStrategy {
interface IProtractorLocatorStrategy {
/**
* webdriver's By is an enum of locator functions, so we must set it to
* a prototype before inheriting from it.
*/
className: typeof webdriver.By.className;
css: typeof webdriver.By.css;
id: typeof webdriver.By.id;
linkText: typeof webdriver.By.linkText;
js: typeof webdriver.By.js;
name: typeof webdriver.By.name;
partialLinkText: typeof webdriver.By.partialLinkText;
tagName: typeof webdriver.By.tagName;
xpath: typeof webdriver.By.xpath;
/**
* Add a locator to this instance of ProtractorBy. This locator can then be
* used with element(by.locatorName(args)).
@@ -0,0 +1,77 @@
/// <reference path='angular-signalr-hub.d.ts' />
/// <reference path='../angularjs/angular.d.ts' />
angular
.module('app', ['SignalR'])
.factory('Employees', ngSignalrTest.EmployeesFactory);
module ngSignalrTest {
export class EmployeesFactory {
static $inject = ['$rootScope', 'Hub', '$timeout'];
private hub: ngSignalr.Hub;
public all: Array<Employee>;
constructor($rootScope: ng.IRootScopeService, Hub: ngSignalr.HubFactory, $timeout: ng.ITimeoutService) {
// declaring the hub connection
this.hub = new Hub('employee', {
// client-side methods
listeners: {
'lockEmployee': (id: number) => {
var employee = this.find(id);
employee.Locked = true;
$rootScope.$apply();
},
'unlockEmployee': (id: number) => {
var employee = this.find(id);
employee.Locked = false;
$rootScope.$apply();
}
},
// server-side methods
methods: ['lock', 'unlock'],
// query params sent on initial connection
queryParams:{
'token': 'exampletoken'
},
// handle connection error
errorHandler: (message: string) => {
console.error(message);
},
stateChanged: (state: SignalRStateChange) => {
// your code here
}
});
}
private find(id: number) {
for (var i = 0; i < this.all.length; i++) {
if (this.all[i].Id === id) return this.all[i];
}
return null;
}
public edit = (employee: Employee) => {
employee.Edit = true;
this.hub.invoke('lock', employee.Id);
};
public done = (employee: Employee) => {
employee.Edit = false;
this.hub.invoke('unlock', employee.Id);
}
}
interface Employee {
Id: number;
Name: string;
Email: string;
Salary: number;
Edit: boolean;
Locked: boolean;
}
}
+73
View File
@@ -0,0 +1,73 @@
// Type definitions for angular-signalr-hub v1.5.0
// Project: https://github.com/JustMaier/angular-signalr-hub
// Definitions by: Adam Santaniello <https://github.com/AdamSantaniello>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path='../signalr/signalr.d.ts' />
declare module ngSignalr {
interface HubFactory {
/**
* Creates a new Hub connection
*/
new(hubName: string, options: HubOptions) : Hub
}
class Hub {
hubName: string;
connection: SignalR;
proxy: HubProxy;
on(event: string, fn: ((...args: any[]) => void)): void;
invoke(method: string, ...args: any[]): JQueryDeferred<any>;
disconnect(): void;
connect(): JQueryPromise<any>;
}
interface HubOptions {
/**
* Collection of client side callbacks
*/
listeners?: { [index: string] : (...args: any[]) => void };
/**
* String array of server side methods which the client can call
*/
methods?: Array<string>;
/**
* Sets the root path for the SignalR web service
*/
rootPath?: string;
/**
* Object representing additional query params to be sent on connection
*/
queryParams?: { [index: string] : string };
/**
* Function to handle hub connection errors
*/
errorHandler?: (error: string) => void;
/**
* Enable/disable logging
*/
logging?: boolean;
/**
* Use a shared global connection or create a new one just for this hub, defaults to true
*/
useSharedConnection?: boolean;
/**
* Sets transport method (e.g 'longPolling' or ['webSockets', 'longPolling'] )
*/
transport?: any;
/**
* Function to handle hub connection state changed event
*/
stateChanged?: (state: SignalRStateChange) => void;
}
}
+76
View File
@@ -0,0 +1,76 @@
/// <reference path="angular-toasty.d.ts" />
interface AngularToastyTestControllerScope extends ng.IScope {
button:string;
options:toasty.IToastyConfig;
runToasts(): void;
runQuickToasts(): void;
newToast(): void;
clearToasts(): void;
}
class AngularToastyTestController {
static $inject = ['$scope', 'toasty'];
constructor($scope:AngularToastyTestControllerScope, toasty:toasty.IToastyService) {
var options: toasty.IToastyConfig = {
title: 'Toast It!',
msg: 'Mmmm, tasties...',
showClose: true,
clickToClose: false,
timeout: 5000,
sound: true,
html: false,
shake: false,
theme: 'bootstrap',
onAdd: function () {
console.log('Toasty ' + this.id + ' has been added!', this);
},
onRemove: function () {
console.log('Toasty ' + this.id + ' has been removed!', this);
},
onClick: function () {
console.log('Toasty ' + this.id + ' has been clicked!', this);
}
};
$scope.runToasts = function () {
toasty(options);
toasty.default(options);
toasty.info(options);
toasty.success(options);
toasty.wait(options);
toasty.error(options);
toasty.warning(options);
};
$scope.runQuickToasts = function () {
var title = 'Toast it!'
toasty(title);
toasty.default(title);
toasty.info(title);
toasty.success(title);
toasty.wait(title);
toasty.error(title);
toasty.warning(title);
};
$scope.clearToasts = function () {
toasty.clear();
};
}
};
angular
.module('main', ['angular-toasty'])
.config(['toastyConfigProvider', (toastyConfigProvider:toasty.IToastyConfigProvider) => {
toastyConfigProvider.setConfig({
title: 'global',
limit: 10,
sound: false,
shake: true
});
}])
.controller('MainController', AngularToastyTestController);
+251
View File
@@ -0,0 +1,251 @@
// Type definitions for Angular Toasty v1.0.2
// Project: https://github.com/invertase/angular-toasty
// Definitions by: Dominik Muench <https://github.com/muenchdo>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare module toasty {
interface IToastyService {
/**
* Create a toast with the given options and type.
* @param options
* @param type
*/
(options: IToastyConfig, type?: string): void;
/**
* Create a default "quick toast" with the given title.
* @param title
*/
(title: string|number): void;
/**
* Create a default toast with the given options.
* @param options
*/
default(options: IToastyConfig): void;
/**
* Create a default "quick toast" with the given title.
* @param title
*/
default(title: string|number): void;
/**
* Create an info toast with the given options.
* @param options
*/
info(options: IToastyConfig): void;
/**
* Create an info "quick toast" with the given title.
* @param title
*/
info(title: string|number): void;
/**
* Create a wait toast with the given options.
* @param options
*/
wait(options: IToastyConfig): void;
/**
* Create a wait "quick toast" with the given title.
* @param title
*/
wait(title: string|number): void;
/**
* Create a success toast with the given options.
* @param options
*/
success(options: IToastyConfig): void;
/**
* Create a success "quick toast" with the given title.
* @param title
*/
success(title: string|number): void;
/**
* Create an error toast with the given options.
* @param options
*/
error(options: IToastyConfig): void;
/**
* Create an error "quick toast" with the given title.
* @param title
*/
error(title: string|number): void;
/**
* Create a warning toast with the given options.
* @param options
*/
warning(options: IToastyConfig): void;
/**
* Create a warning "quick toast" with the given title.
* @param title
*/
warning(title: string|number): void;
/**
* Clear toast(s).
* @param id Optional ID to clear a specific toast.
*/
clear(id?: number): void;
/**
* Get the global config.
*/
getGlobalConfig(): IGlobalConfig;
}
interface IToastyConfig {
/**
* The toast's title.
*/
title: string;
/**
* The toast's message.
*/
msg?: string;
/**
* Whether to show the 'X' icon to close the toast.
*/
showClose?: boolean;
/**
* Whether clicking the toast closes it.
*/
clickToClose?: boolean;
/**
* How long (in milliseconds) the toast shows before it's removed. Set to false to disable.
*/
timeout?: number;
/**
* Whether to play a sound when a toast is added.
*/
sound?: boolean;
/**
* Whether HTML is allowed in toasts.
*/
html?: boolean;
/**
* Whether to shake the toasts.
*/
shake?: boolean;
/**
* What theme to use.
* - 'default'
* - 'material'
* - 'bootstrap'
*/
theme?: string;
/**
* The toast's type:
* - 'default'
* - 'info'
* - 'success'
* - 'wait'
* - 'error'
* - 'warning'
*/
type?: string;
/**
* Add event handler.
*/
onAdd?: Function;
/**
* Remove event handler.
*/
onRemove?: Function;
/**
* Click event handler.
*/
onClick?: Function;
}
interface IGlobalConfig {
/**
* Maximum number of toasts to show at once.
*/
limit?: number;
/**
* The toast's title.
*/
title?: string;
/**
* The toast's message.
*/
msg?: string;
/**
* Whether to show the 'X' icon to close the toast.
*/
showClose?: boolean;
/**
* Whether clicking the toast closes it.
*/
clickToClose?: boolean;
/**
* The window position where the toast pops up.
*
*/
position?: string;
/**
* How long (in miliseconds) the toast shows before it's removed. Set to false to disable.
*/
timeout?: number|boolean;
/**
* Whether to play a sound when a toast is added.
*/
sound?: boolean;
/**
* Whether HTML is allowed in toast.
*/
html?: boolean;
/**
* Whether to shake the toast.
*/
shake?: boolean;
/**
* What theme to use.
* - 'default'
* - 'material'
* - 'bootstrap'
*/
theme?: string;
}
interface IToastyConfigProvider {
setConfig(override: IGlobalConfig): void;
$get(): IGlobalConfig;
}
}
@@ -2,6 +2,14 @@
var app = angular.module('at', ['pascalprecht.translate']);
app.factory('customLoader', ($q:angular.IQService) => {
return (options:any) => {
var dfd:angular.IDeferred<string> = $q.defer();
dfd.resolve('whatever you wanted to translate, I simply know nothing about the language with the key ' + options.key);
return dfd.promise;
}
});
app.config(($translateProvider: angular.translate.ITranslateProvider) => {
$translateProvider.translations('en', {
TITLE: 'Hello',
@@ -16,6 +24,8 @@ app.config(($translateProvider: angular.translate.ITranslateProvider) => {
BUTTON_LANG_DE: 'deutsch'
});
$translateProvider.preferredLanguage('en');
$translateProvider.useLoader('customLoader');
});
interface Scope extends ng.IScope {
+2 -2
View File
@@ -13,7 +13,7 @@ declare module "angular-translate" {
declare module angular.translate {
interface ITranslationTable {
[key: string]: string;
[key: string]: any;
}
interface ILanguageKeyAlias {
@@ -93,7 +93,7 @@ declare module angular.translate {
storageKey(key: string): void; // JeroMiya - the library should probably return ITranslateProvider but it doesn't here
useUrlLoader(url: string): ITranslateProvider;
useStaticFilesLoader(options: IStaticFilesLoaderOptions): ITranslateProvider;
useLoader(loaderFactory: string, options: any): ITranslateProvider;
useLoader(loaderFactory: string, options?: any): ITranslateProvider;
useLocalStorage(): ITranslateProvider;
useCookieStorage(): ITranslateProvider;
useStorage(storageFactory: any): ITranslateProvider;
@@ -7,6 +7,7 @@ testApp.config((
$buttonConfig: ng.ui.bootstrap.IButtonConfig,
$datepickerConfig: ng.ui.bootstrap.IDatepickerConfig,
$datepickerPopupConfig: ng.ui.bootstrap.IDatepickerPopupConfig,
$modalProvider: ng.ui.bootstrap.IModalProvider,
$paginationConfig: ng.ui.bootstrap.IPaginationConfig,
$pagerConfig: ng.ui.bootstrap.IPagerConfig,
$progressConfig: ng.ui.bootstrap.IProgressConfig,
@@ -30,19 +31,25 @@ testApp.config((
/**
* $datepickerConfig tests
*/
$datepickerConfig.dayFormat = 'd';
$datepickerConfig.dayHeaderFormat = 'E';
$datepickerConfig.dayTitleFormat = 'dd-MM-yyyy';
$datepickerConfig.datepickerMode = 'month';
$datepickerConfig.formatDay = 'd';
$datepickerConfig.formatDayHeader = 'E';
$datepickerConfig.formatDayTitle = 'dd-MM-yyyy';
$datepickerConfig.formatMonth = 'M';
$datepickerConfig.formatMonthTitle = 'yy';
$datepickerConfig.formatYear = 'y';
$datepickerConfig.maxDate = '1389586124979';
$datepickerConfig.maxMode = 'month';
$datepickerConfig.minDate = '1389586124979';
$datepickerConfig.monthFormat = 'M';
$datepickerConfig.monthTitleFormat = 'yy';
$datepickerConfig.minMode = 'month';
$datepickerConfig.shortcutPropagation = true;
$datepickerConfig.showWeeks = false;
$datepickerConfig.startingDay = 1;
$datepickerConfig.yearFormat = 'y';
$datepickerConfig.yearRange = 10;
/**
* $datepickerPopupConfig tests
*/
@@ -51,9 +58,18 @@ testApp.config((
$datepickerPopupConfig.clearText = 'Reset Selection';
$datepickerPopupConfig.closeOnDateSelection = false;
$datepickerPopupConfig.closeText = 'Finished';
$datepickerPopupConfig.dateFormat = 'dd-MM-yyyy';
$datepickerPopupConfig.datepickerPopup = 'dd-MM-yyyy';
$datepickerPopupConfig.datepickerPopupTemplateUrl = 'template.html';
$datepickerPopupConfig.datepickerTemplateUrl = 'template.html';
$datepickerPopupConfig.html5Types.date = 'MM-dd-yyyy';
$datepickerPopupConfig.onOpenFocus = false;
$datepickerPopupConfig.showButtonBar = false;
$datepickerPopupConfig.toggleWeeksText = 'Show Weeks';
/**
* $modalProvider tests
*/
$modalProvider.options.animation = false;
/**
@@ -64,9 +80,13 @@ testApp.config((
$paginationConfig.firstText = 'First Page';
$paginationConfig.itemsPerPage = 25;
$paginationConfig.lastText = 'Last Page';
$paginationConfig.maxSize = 13;
$paginationConfig.numPages = 13;
$paginationConfig.nextText = 'Next Page';
$paginationConfig.previousText = 'Previous Page';
$paginationConfig.rotate = false;
$paginationConfig.templateUrl = 'template.html';
$paginationConfig.totalItems = 13;
/**
@@ -91,6 +111,7 @@ testApp.config((
$ratingConfig.max = 10;
$ratingConfig.stateOff = 'rating-state-off';
$ratingConfig.stateOn = 'rating-state-on';
$ratingConfig.titles = ['1', '2', '3', '4', '5'];
/**
@@ -102,6 +123,8 @@ testApp.config((
$timepickerConfig.mousewheel = false;
$timepickerConfig.readonlyInput = true;
$timepickerConfig.showMeridian = false;
$timepickerConfig.arrowkeys = false;
$timepickerConfig.showSpinners = false;
/**
* $tooltipProvider tests
@@ -110,7 +133,9 @@ testApp.config((
placement: 'bottom',
animation: false,
popupDelay: 1000,
appendtoBody: true
appendToBody: true,
trigger: 'mouseenter hover',
useContentExp: true,
});
$tooltipProvider.setTriggers({
'customOpenTrigger': 'customCloseTrigger'
@@ -129,10 +154,14 @@ testApp.controller('TestCtrl', (
* test the $modal service
*/
var modalInstance = $modal.open({
animation: false,
backdrop: 'static',
backdropClass: 'modal-backdrop-test',
bindToController: true,
controller: 'ModalTestCtrl',
controllerAs: 'vm',
keyboard: true,
openedClass: 'modal-open my-modal',
resolve: {
items: ()=> {
return [1, 2, 3, 4, 5];
@@ -141,7 +170,6 @@ testApp.controller('TestCtrl', (
scope: $scope,
template: "<div>i'm a template!</div>",
templateUrl: '/templates/modal.html',
backdropClass: 'modal-backdrop-test',
windowClass: 'modal-test'
});
@@ -149,12 +177,23 @@ testApp.controller('TestCtrl', (
$log.log('modal opened');
});
modalInstance.rendered.then(() => {
$log.log('modal rendered');
});
modalInstance.result.then((closeResult:any)=> {
$log.log('modal closed', closeResult);
}, (dismissResult:any)=> {
$log.log('modal dismissed', dismissResult);
});
$modal.open({
backdrop: 'static'
});
$modal.open({
templateUrl: () => '/templates/modal.html'
});
/**
* test the $modalStack service
+157 -69
View File
@@ -1,4 +1,4 @@
// Type definitions for Angular UI Bootstrap 0.11.0
// Type definitions for Angular UI Bootstrap 0.13.3
// Project: https://github.com/angular-ui/bootstrap
// Definitions by: Brian Surowiec <https://github.com/xt0rted>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -36,42 +36,63 @@ declare module angular.ui.bootstrap {
*
* @default 'dd'
*/
dayFormat?: string;
formatDay?: string;
/**
* Format of month in year.
*
* @default 'MMM'
*/
monthFormat?: string;
formatMonth?: string;
/**
* Format of year in year range.
*
* @default 'yyyy'
*/
yearFormat?: string;
formatYear?: string;
/**
* Format of day in week header.
*
* @default 'EEE'
*/
dayHeaderFormat?: string;
formatDayHeader?: string;
/**
* Format of title when selecting day.
*
* @default 'MMM yyyy'
*/
dayTitleFormat?: string;
formatDayTitle?: string;
/**
* Format of title when selecting month.
*
* @default 'yyyy'
*/
monthTitleFormat?: string;
formatMonthTitle?: string;
/**
* Current mode of the datepicker (day|month|year). Can be used to initialize datepicker to specific mode.
*
* @default 'day'
*/
datepickerMode?: string;
/**
* Set a lower limit for mode.
*
* @default 'day'
*/
minMode?: string;
/**
* Set an upper limit for mode.
*
* @default 'year'
*/
maxMode?: string;
/**
* Whether to display week numbers.
@@ -107,6 +128,13 @@ declare module angular.ui.bootstrap {
* @default null
*/
maxDate?: any;
/**
* An option to disable or enable shortcut's event propagation
*
* @default false
*/
shortcutPropagation?: boolean;
}
interface IDatepickerPopupConfig {
@@ -115,7 +143,30 @@ declare module angular.ui.bootstrap {
*
* @default 'yyyy-MM-dd'
*/
dateFormat?: string;
datepickerPopup?: string;
/**
* Allows overriding of default template of the popup.
*
* @default 'template/datepicker/popup.html'
*/
datepickerPopupTemplateUrl?: string;
/**
* Allows overriding of default template of the datepicker used in popup.
*
* @default 'template/datepicker/popup.html'
*/
datepickerTemplateUrl?: string;
/**
* Allows overriding of the default format for html5 date inputs.
*/
html5Types?: {
date?: string;
'datetime-local'?: string;
month?: string;
};
/**
* The text to display for the current day button.
@@ -124,13 +175,6 @@ declare module angular.ui.bootstrap {
*/
currentText?: string;
/**
* The text to display for the toggling week numbers button.
*
* @default 'Weeks'
*/
toggleWeeksText?: string;
/**
* The text to display for the clear button.
*
@@ -165,9 +209,23 @@ declare module angular.ui.bootstrap {
* @default true
*/
showButtonBar?: boolean;
/**
* Whether to focus the datepicker popup upon opening.
*
* @default true
*/
onOpenFocus?: boolean;
}
interface IModalProvider {
/**
* Default options all modals will use.
*/
options: IModalSettings;
}
interface IModalService {
/**
* @param {IModalSettings} options
@@ -178,47 +236,52 @@ declare module angular.ui.bootstrap {
interface IModalServiceInstance {
/**
* a method that can be used to close a modal, passing a result
* A method that can be used to close a modal, passing a result. If `preventDefault` is called on the `modal.closing` event then the modal will remain open.
*/
close(result?: any): void;
/**
* a method that can be used to dismiss a modal, passing a reason
* A method that can be used to dismiss a modal, passing a reason. If `preventDefault` is called on the `modal.closing` event then the modal will remain open.
*/
dismiss(reason?: any): void;
/**
* a promise that is resolved when a modal is closed and rejected when a modal is dismissed
* A promise that is resolved when a modal is closed and rejected when a modal is dismissed.
*/
result: angular.IPromise<any>;
/**
* a promise that is resolved when a modal gets opened after downloading content's template and resolving all variables
* A promise that is resolved when a modal gets opened after downloading content's template and resolving all variables.
*/
opened: angular.IPromise<any>;
/**
* A promise that is resolved when a modal is rendered.
*/
rendered: angular.IPromise<any>;
}
interface IModalScope extends angular.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. If `preventDefault` is called on the `modal.closing` event then the modal will remain open.
*
* @returns true if the modal was closed; otherwise false
*/
$dismiss(reason?: any): boolean;
/**
* Dismiss the dialog without assigning a value to the promise output
* Close the dialog resolving the promise to the given value. If `preventDefault` is called on the `modal.closing` event then the modal will remain open.
*
* @returns true if the modal was closed; otherwise false
*/
$dismiss(reason?: any): void;
/**
* Close the dialog resolving the promise to the given value
*/
$close(result?: any): void;
$close(result?: any): boolean;
}
interface IModalSettings {
/**
* a path to a template representing modal's content
*/
templateUrl?: string;
templateUrl?: string | (() => string);
/**
* inline template representing the modal's content
@@ -243,11 +306,25 @@ declare module angular.ui.bootstrap {
*/
controllerAs?: string;
/**
* When used with controllerAs and set to true, it will bind the controller properties onto the $scope directly.
*
* @default false
*/
bindToController?: boolean;
/**
* members that will be resolved and passed to the controller as locals; it is equivalent of the `resolve` property for AngularJS routes
*/
resolve?: any;
/**
* Set to false to disable animations on new modal/backdrop. Does not toggle animations for modals/backdrops that are already displayed.
*
* @default true
*/
animation?: boolean;
/**
* controls the presence of a backdrop
* Allowed values:
@@ -257,10 +334,12 @@ declare module angular.ui.bootstrap {
*
* @default true
*/
backdrop?: any;
backdrop?: boolean | string;
/**
* indicates whether the dialog should be closable by hitting the ESC key, defaults to true
* indicates whether the dialog should be closable by hitting the ESC key
*
* @default true
*/
keyboard?: boolean;
@@ -275,7 +354,7 @@ declare module angular.ui.bootstrap {
windowClass?: string;
/**
* optional size of modal window. Allowed values: 'sm' (small) or 'lg' (large). Requires Bootstrap 3.1.0 or later
* Optional suffix of modal window class. The value used is appended to the `modal-` class, i.e. a value of `sm` gives `modal-sm`.
*/
size?: string;
@@ -283,6 +362,13 @@ declare module angular.ui.bootstrap {
* a path to a template overriding modal's window template
*/
windowTemplateUrl?: string;
/**
* The class added to the body element when the modal is opened.
*
* @default 'model-open'
*/
openedClass?: string;
}
interface IModalStackService {
@@ -319,11 +405,6 @@ declare module angular.ui.bootstrap {
interface IPaginationConfig {
/**
* Current page number. First page is 1.
*/
page?: number;
/**
* Total number of items in all pages.
*/
@@ -357,13 +438,6 @@ declare module angular.ui.bootstrap {
*/
rotate?: boolean;
/**
* An optional expression called when a page is selected having the page number as argument.
*
* @default null
*/
onSelectPage?(page: number): void;
/**
* Whether to display Previous / Next buttons.
*
@@ -405,6 +479,13 @@ declare module angular.ui.bootstrap {
* @default 'Last'
*/
lastText?: string;
/**
* Override the template for the component with a custom provided template.
*
* @default 'template/pagination/pagination.html'
*/
templateUrl?: string;
}
interface IPagerConfig {
@@ -415,16 +496,6 @@ declare module angular.ui.bootstrap {
*/
align?: boolean;
/**
* Current page number. First page is 1.
*/
page?: number;
/**
* Total number of items in all pages.
*/
totalItems?: number;
/**
* Maximum number of items per page. A value less than one indicates all items on one page.
*
@@ -432,20 +503,6 @@ declare module angular.ui.bootstrap {
*/
itemsPerPage?: number;
/**
* An optional expression assigned the total number of pages to display.
*
* @default angular.noop
*/
numPages?: number;
/**
* An optional expression called when a page is selected having the page number as argument.
*
* @default null
*/
onSelectPage?(page: number): void;
/**
* Text for Previous button.
*
@@ -520,6 +577,13 @@ declare module angular.ui.bootstrap {
* @default: null
*/
stateOff?: string;
/**
* An array of strings defining titles for all icons.
*
* @default: ["one", "two", "three", "four", "five"]
*/
titles?: Array<string>;
}
@@ -565,6 +629,20 @@ declare module angular.ui.bootstrap {
* @default true
*/
mousewheel?: boolean;
/**
* Whether the user can use up/down arrowkeys inside the hours & minutes input to increase or decrease it's values.
*
* @default true
*/
arrowkeys?: boolean;
/**
* Shows spinner arrows above and below the inputs.
*
* @default true
*/
showSpinners?: boolean;
}
@@ -577,7 +655,7 @@ declare module angular.ui.bootstrap {
placement?: string;
/**
* Should it fade in and out?
* Should the modal fade in and out?
*
* @default true
*/
@@ -598,11 +676,18 @@ declare module angular.ui.bootstrap {
appendToBody?: boolean;
/**
* Determines the default open triggers for tooltips and popovers
* What should trigger a show of the tooltip? Supports a space separated list of event names.
*
* @default 'mouseenter' for tooltip, 'click' for popover
*/
trigger?: string;
/**
* Should an expression on the scope be used to load the content?
*
* @default false
*/
useContentExp?: boolean;
}
interface ITooltipProvider {
@@ -618,6 +703,9 @@ declare module angular.ui.bootstrap {
}
/**
* WARNING: $transition is now deprecated. Use $animate from ngAnimate instead.
*/
interface ITransitionService {
/**
* The browser specific animation event name.
+62 -3
View File
@@ -14,12 +14,28 @@ myApp.config((
var matcher: ng.ui.IUrlMatcher = $urlMatcherFactory.compile("/foo/:bar?param1");
$urlMatcherFactory.caseInsensitive(false);
var isCaseInsensitive = $urlMatcherFactory.caseInsensitive();
$urlMatcherFactory.defaultSquashPolicy("nosquash");
$urlMatcherFactory.strictMode(true);
var isStrictMode = $urlMatcherFactory.strictMode();
$urlMatcherFactory.type("myType2", {
encode: function (item: any) { return item; },
decode: function (item: any) { return item; },
is: function (item: any) { return true; }
});
$urlMatcherFactory.type("fullType", {
decode: (val) => parseInt(val, 10),
encode: (val) => val && val.toString(),
equals: (a, b) => this.is(a) && a === b,
is: (val) => angular.isNumber(val) && isFinite(val) && val % 1 === 0,
pattern: /\d+/
});
var obj: Object = matcher.exec('/user/bob', { x:'1', q:'hello' });
var concat: ng.ui.IUrlMatcher = matcher.concat('/test');
var str: string = matcher.format({ id:'bob', q:'yes' });
@@ -50,7 +66,7 @@ myApp.config((
.state('state1.list', {
url: "/list",
templateUrl: "partials/state1.list.html",
controller: function ($scope: MyAppScope) {
controller: function ($scope: MyAppScope) {
$scope.items = ["A", "List", "Of", "Items"];
}
})
@@ -61,7 +77,7 @@ myApp.config((
.state('state2.list', {
url: "/list",
templateUrl: "partials/state2.list.html",
controller: function ($scope: MyAppScope) {
controller: function ($scope: MyAppScope) {
$scope.things = ["A", "Set", "Of", "Things"];
}
})
@@ -70,7 +86,14 @@ myApp.config((
url: "/list",
templateUrl: "partials/state3.list.html",
controller: function ($scope: MyAppScope) {
$scope.things = ["A", "Set", "Of", "Things"];
$scope.things = ["A", "Set", "Of", "Things"];
}
})
.state('state4', {
url: "/state4",
templateUrl: function($stateParams: ng.ui.IStateParamsService){
//Logic could go here based on $stateParams
return "partials/state4.html";
}
})
.state('index', {
@@ -148,6 +171,10 @@ class UrlLocatorTestService implements IUrlLocatorTestService {
this.$state.get("myState");
this.$state.get();
this.$state.reload();
// Accesses the currently resolved values for the current state
// http://stackoverflow.com/questions/28026620/is-there-a-way-to-access-resolved-state-dependencies-besides-injecting-them-into/28027023#28027023
var resolvedValues = this.$state.$current.locals.globals;
}
}
@@ -166,3 +193,35 @@ module UiViewScrollProviderTests {
$uiViewScrollProvider.useAnchorScroll();
}]);
}
interface ITestUserService {
isLoggedIn: () => boolean;
handleLogin: () => ng.IPromise<{}>;
}
module UrlRouterProviderTests {
var app = angular.module("urlRouterProviderTests", ["ui.router"]);
app.config(($urlRouterProvider: ng.ui.IUrlRouterProvider) => {
// Prevent $urlRouter from automatically intercepting URL changes;
// this allows you to configure custom behavior in between
// location changes and route synchronization:
$urlRouterProvider.deferIntercept();
}).run(($rootScope: ng.IRootScopeService, $urlRouter: ng.ui.IUrlRouterService, UserService: ITestUserService) => {
$rootScope.$on('$locationChangeSuccess', e => {
// UserService is an example service for managing user state
if (UserService.isLoggedIn()) return;
// Prevent $urlRouter's default handler from firing
e.preventDefault();
UserService.handleLogin().then(() => {
// Once the user has logged in, sync the current URL to the router:
$urlRouter.sync();
});
});
// Configures $urlRouter's listener *after* your custom listener
$urlRouter.listen();
});
}
+134 -7
View File
@@ -5,6 +5,12 @@
/// <reference path="../angularjs/angular.d.ts" />
// Support for AMD require
declare module 'angular-ui-router' {
var _: string;
export = _;
}
declare module angular.ui {
interface IState {
@@ -16,7 +22,7 @@ declare module angular.ui {
/**
* String URL path to template file OR Function, returns URL path string
*/
templateUrl?: string | {(): string};
templateUrl?: string | {(params: IStateParamsService): string};
/**
* Function, returns HTML content string
*/
@@ -53,12 +59,12 @@ declare module angular.ui {
abstract?: boolean;
/**
* Callback function for when a state is entered. Good way to trigger an action or dispatch an event, such as opening a dialog.
* If minifying your scripts, make sure to explictly annotate this function, because it won't be automatically annotated by your build tools.
* If minifying your scripts, make sure to explicitly annotate this function, because it won't be automatically annotated by your build tools.
*/
onEnter?: Function|(string|Function)[];
/**
* Callback functions for when a state is entered and exited. Good way to trigger an action or dispatch an event, such as opening a dialog.
* If minifying your scripts, make sure to explictly annotate this function, because it won't be automatically annotated by your build tools.
* If minifying your scripts, make sure to explicitly annotate this function, because it won't be automatically annotated by your build tools.
*/
onExit?: Function|(string|Function)[];
/**
@@ -66,7 +72,7 @@ declare module angular.ui {
*/
data?: any;
/**
* Boolean (default true). If false will not retrigger the same state just because a search/query parameter has changed. Useful for when you'd like to modify $location.search() without triggering a reload.
* Boolean (default true). If false will not re-trigger the same state just because a search/query parameter has changed. Useful for when you'd like to modify $location.search() without triggering a reload.
*/
reloadOnSearch?: boolean;
}
@@ -85,12 +91,70 @@ declare module angular.ui {
}
interface IUrlMatcherFactory {
/**
* Creates a UrlMatcher for the specified pattern.
*
* @param pattern {string} The URL pattern.
*
* @returns {IUrlMatcher} The UrlMatcher.
*/
compile(pattern: string): IUrlMatcher;
/**
* Returns true if the specified object is a UrlMatcher, or false otherwise.
*
* @param o {any} The object to perform the type check against.
*
* @returns {boolean} Returns true if the object matches the IUrlMatcher interface, by implementing all the same methods.
*/
isMatcher(o: any): boolean;
type(name: string, definition: any, definitionFn?: any): any;
caseInsensitive(value: boolean): void;
/**
* Returns a type definition for the specified name
*
* @param name {string} The type definition name
*
* @returns {IType} The type definition
*/
type(name: string): IType;
/**
* Registers a custom Type object that can be used to generate URLs with typed parameters.
*
* @param {IType} definition The type definition.
* @param {any[]} inlineAnnotedDefinitionFn A function that is injected before the app runtime starts. The result of this function is merged into the existing definition.
*
* @returns {IUrlMatcherFactory} Returns $urlMatcherFactoryProvider.
*/
type(name: string, definition: IType, inlineAnnotedDefinitionFn?: any[]): IUrlMatcherFactory;
/**
* Registers a custom Type object that can be used to generate URLs with typed parameters.
*
* @param {IType} definition The type definition.
* @param {any[]} inlineAnnotedDefinitionFn A function that is injected before the app runtime starts. The result of this function is merged into the existing definition.
*
* @returns {IUrlMatcherFactory} Returns $urlMatcherFactoryProvider.
*/
type(name: string, definition: IType, definitionFn?: (...args:any[]) => IType): IUrlMatcherFactory;
/**
* Defines whether URL matching should be case sensitive (the default behavior), or not.
*
* @param value {boolean} false to match URL in a case sensitive manner; otherwise true;
*
* @returns {boolean} the current value of caseInsensitive
*/
caseInsensitive(value?: boolean): boolean;
/**
* Sets the default behavior when generating or matching URLs with default parameter values
*
* @param value {string} A string that defines the default parameter URL squashing behavior. nosquash: When generating an href with a default parameter value, do not squash the parameter value from the URL slash: When generating an href with a default parameter value, squash (remove) the parameter value, and, if the parameter is surrounded by slashes, squash (remove) one slash from the URL any other string, e.g. "~": When generating an href with a default parameter value, squash (remove) the parameter value from the URL and replace it with this string.
*/
defaultSquashPolicy(value: string): void;
strictMode(value: boolean): void;
/**
* Defines whether URLs should match trailing slashes, or not (the default behavior).
*
* @param value {boolean} false to match trailing slashes in URLs, otherwise true.
*
* @returns {boolean} the current value of strictMode
*/
strictMode(value?: boolean): boolean;
}
interface IUrlRouterProvider extends angular.IServiceProvider {
@@ -108,6 +172,14 @@ declare module angular.ui {
otherwise(path: string): IUrlRouterProvider;
rule(handler: Function): IUrlRouterProvider;
rule(handler: any[]): IUrlRouterProvider;
/**
* Disables (or enables) deferring location change interception.
*
* If you wish to customize the behavior of syncing the URL (for example, if you wish to defer a transition but maintain the current URL), call this method at configuration time. Then, at run time, call $urlRouter.listen() after you have configured your own $locationChangeSuccess event handler.
*
* @param {boolean} defer Indicates whether to defer location change interception. Passing no parameter is equivalent to true.
*/
deferIntercept(defer?: boolean): void;
}
interface IStateOptions {
@@ -168,6 +240,17 @@ declare module angular.ui {
current: IState;
params: IStateParamsService;
reload(): void;
$current: IResolvedState;
}
interface IResolvedState {
locals: {
/**
* Currently resolved "resolve" values from the current state
*/
globals: { [key: string]: any; };
};
}
interface IStateParamsService {
@@ -186,6 +269,7 @@ declare module angular.ui {
*
*/
sync(): void;
listen(): void;
}
interface IUiViewScrollProvider {
@@ -195,4 +279,47 @@ declare module angular.ui {
*/
useAnchorScroll(): void;
}
interface IType {
/**
* Converts a parameter value (from URL string or transition param) to a custom/native value.
*
* @param val {string} The URL parameter value to decode.
* @param key {string} The name of the parameter in which val is stored. Can be used for meta-programming of Type objects.
*
* @returns {any} Returns a custom representation of the URL parameter value.
*/
decode(val: string, key: string): any;
/**
* Encodes a custom/native type value to a string that can be embedded in a URL. Note that the return value does not need to be URL-safe (i.e. passed through encodeURIComponent()), it only needs to be a representation of val that has been coerced to a string.
*
* @param val {any} The value to encode.
* @param key {string} The name of the parameter in which val is stored. Can be used for meta-programming of Type objects.
*
* @returns {string} Returns a string representation of val that can be encoded in a URL.
*/
encode(val: any, key: string): string;
/**
* Determines whether two decoded values are equivalent.
*
* @param a {any} A value to compare against.
* @param b {any} A value to compare against.
*
* @returns {boolean} Returns true if the values are equivalent/equal, otherwise false.
*/
equals? (a: any, b: any): boolean;
/**
* Detects whether a value is of a particular type. Accepts a native (decoded) value and determines whether it matches the current Type object.
*
* @param val {any} The value to check.
* @param key {any} Optional. If the type check is happening in the context of a specific UrlMatcher object, this is the name of the parameter in which val is stored. Can be used for meta-programming of Type objects.
*
* @returns {boolean} Returns true if the value matches the type, otherwise false.
*/
is(val: any, key: string): boolean;
/**
* The regular expression pattern used to match values of this type when coming from a substring of a URL.
*/
pattern?: RegExp;
}
}
@@ -0,0 +1,93 @@
/// <reference path="angular-ui-scroll.d.ts" />
var myApp = angular.module('application', ['ui.scroll', 'ui.scroll.jqlite']);
module application {
interface IItem {
id: number;
content: string;
}
class DatasourceTest implements ng.ui.IScrollDatasource<IItem> {
get(index: number, count: number, success: (results: IItem[]) => void): void {
var ret = new Array<IItem>();
for (var i=0; i < count; i++) {
ret.push({id: i, content: 'item ' + i.toString()});
}
success(ret);
}
}
function factory(): any {
return DatasourceTest;
}
myApp.factory('DatasourceTest', factory);
// demo/examples/adapter
myApp.controller('mainController', ['$scope', 'DatasourceTest', function($scope: ng.IScope, datasource: DatasourceTest) {
var firstListAdapter: ng.ui.IScrollAdapter, secondListAdapter: ng.ui.IScrollAdapter;
$scope['datasource'] = datasource;
$scope['updateList1'] = (): void => {
firstListAdapter.applyUpdates( (item: IItem, scope: ng.IRepeatScope) => {
return item.content += ' *';
})
};
$scope['removeFromList1'] = (): void => {
firstListAdapter.applyUpdates( (item: IItem, scope: ng.IRepeatScope) => {
if (scope.$index % 2 === 0) {
return []
}
})
};
var idList1: number = 1000;
$scope['addToList1'] = (): void => {
firstListAdapter.applyUpdates((item: IItem, scope: ng.IRepeatScope) => {
var newItem: IItem;
newItem = void 0;
if (scope.$index === 2) {
newItem = {
id: idList1,
content: 'a new one #' + idList1
};
idList1++;
return [item, newItem];
}
});
};
$scope['updateList2'] = (): void => {
secondListAdapter.applyUpdates((item: IItem, scope: ng.IRepeatScope) => {
return item.content += ' *';
});
};
$scope['removeFromList2'] = (): void => {
secondListAdapter.applyUpdates((item: IItem, scope: ng.IRepeatScope) => {
if (scope.$index % 2 !== 0) {
return [];
}
});
};
var idList2: number = 2000;
$scope['addToList2'] = (): void => {
secondListAdapter.applyUpdates((item: IItem, scope: ng.IRepeatScope) => {
var newItem: IItem;
newItem = void 0;
if (scope.$index === 4) {
newItem = {
id: idList2,
content: 'a new one #' + idList1
};
idList2++;
return [item, newItem];
}
});
};
}]);
}
+85
View File
@@ -0,0 +1,85 @@
// Type definitions for Angular JS 1.3.1+ (ui.scroll module)
// Project: https://github.com/angular-ui/ui-scroll
// Definitions by: Mark Nadig <https://github.com/marknadig>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare module angular.ui {
interface IScrollDatasource<T> {
/**
* The datasource object implements methods and properties to be used by the directive to access the data
*
* @param index indicates the first data row requested
*
* @param count indicates number of data rows requested
*
* @param success function to call when the data are retrieved. The implementation of the service has to call
* this function when the data are retrieved and pass it an array of the items retrieved. If no items are
* retrieved, an empty array has to be passed.
*
* Important: Make sure to respect the index and count parameters of the request. The array passed to the
* success method should have exactly count elements unless it hit eof/bof
*/
get(index: number, count: number, success: (results: Array<T>) => any): void;
}
interface IScrollAdapter {
/**
* a boolean value indicating whether there are any pending load requests.
*/
isLoading: boolean;
/**
* a reference to the item currently in the topmost visible position.
*/
topVisible: any;
/**
* a reference to the DOM element currently in the topmost visible position.
*/
topVisibleElement: ng.IAugmentedJQueryStatic;
/**
* a reference to the scope created for the item currently in the topmost visible position.
*/
topVisibleScope: ng.IRepeatScope;
/**
* calling this method reinitializes and reloads the scroller content.
*/
reload(): void;
/**
* Replaces the item in the buffer at the given index with the new items.
*
* @param index provides position of the item to be affected in the dataset (not in the buffer). If the item with
* the given index currently is not in the buffer no updates will be applied. $index property of the item $scope
* can be used to access the index value for a given item
*
* @param newItems is an array of items to replace the affected item. If the array is empty ([]) the item will
* be deleted, otherwise the items in the array replace the item. If the newItem array contains the old item,
* the old item stays in place.
*/
applyUpdates(index: number, newItems: any[]): void;
/**
* Replaces the item in the buffer at the given index with the new items.
*
* @param updater is a function to be applied to every item currently in the buffer. The function will receive
* 3 parameters: item, scope, and element. Here item is the item to be affected, scope is the item $scope, and
* element is the html element for the item. The return value of the function should be an array of items.
* Similarly to the newItem parameter (see above), if the array is empty([]), the item is deleted, otherwise
* the item is replaced by the items in the array. If the return value is not an array, the item remains
* unaffected, unless some updates were made to the item in the updater function. This can be thought of as
* in place update.
*/
applyUpdates(updater: (item: any, scope: ng.IRepeatScope) => any): void;
/**
* Adds new items after the last item in the buffer
*
* @param newItems provides an array of items to be appended.
*/
append(newItems: any[]): void;
/**
* Adds new items before the first item in the buffer
*
* @param newItems provides an array of items to be prepended.
*/
prepend(newItems: any[]): void;
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+13 -8
View File
@@ -1,8 +1,7 @@
/// <reference path="angular2.d.ts"/>
/// <reference path="router.d.ts"/>
// Use Typescript 1.4 style imports
import ng = require("angular2/angular2");
import {Component, View, Directive, bootstrap, bind, NgFor, NgIf} from "angular2/angular2";
class Service {
@@ -15,15 +14,15 @@ class Cmp {
static annotations: any[];
}
Cmp.annotations = [
ng.Component({
Component({
selector: 'cmp',
injectables: [Service, ng.bind(Service2).toValue(null)]
injectables: [Service, bind(Service2).toValue(null)]
}),
ng.View({
View({
template: '{{greeting}} world!',
directives: [ng.NgFor, ng.NgIf]
directives: [NgFor, NgIf]
}),
ng.Directive({
Directive({
selector: '[tooltip]',
properties: [
'text: tooltip'
@@ -35,4 +34,10 @@ Cmp.annotations = [
})
];
ng.bootstrap(Cmp);
@Component({selector: 'cmp2'})
@View({templateUrl: '/index.html'})
class Cmp2 {
}
bootstrap(Cmp);
+1
View File
@@ -0,0 +1 @@
--experimentalDecorators --target ES5
+3279 -3641
View File
File diff suppressed because it is too large Load Diff
+469
View File
@@ -0,0 +1,469 @@
// Type definitions for Angular v2.0.0-alpha.34
// Project: http://angular.io/
// Definitions by: angular team <https://github.com/angular/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// ***********************************************************
// This file is generated by the Angular build process.
// Please do not create manual edits or send pull requests
// modifying this file.
// ***********************************************************
///<reference path="./angular2-2.0.0-alpha.34.d.ts"/>
/**
* @module
* @description
* Maps application URLs into application states, to support deep-linking and navigation.
*/
declare module ng {
/**
* # Router
* The router is responsible for mapping URLs to components.
*
* You can see the state of the router by inspecting the read-only field `router.navigating`.
* This may be useful for showing a spinner, for instance.
*
* ## Concepts
* Routers and component instances have a 1:1 correspondence.
*
* The router holds reference to a number of "outlets." An outlet is a placeholder that the
* router dynamically fills in depending on the current URL.
*
* When the router navigates from a URL, it must first recognizes it and serialize it into an
* `Instruction`.
* The router uses the `RouteRegistry` to get an `Instruction`.
*/
class Router {
navigating: boolean;
lastNavigationAttempt: string;
registry: RouteRegistry;
parent: Router;
hostComponent: any;
/**
* Constructs a child router. You probably don't need to use this unless you're writing a reusable
* component.
*/
childRouter(hostComponent: any): Router;
/**
* Register an object to notify of route changes. You probably don't need to use this unless
* you're writing a reusable component.
*/
registerOutlet(outlet: RouterOutlet): Promise<boolean>;
/**
* Dynamically update the routing configuration and trigger a navigation.
*
* # Usage
*
* ```
* router.config([
* { 'path': '/', 'component': IndexComp },
* { 'path': '/user/:id', 'component': UserComp },
* ]);
* ```
*/
config(definitions: List<RouteDefinition>): Promise<any>;
/**
* Navigate to a URL. Returns a promise that resolves when navigation is complete.
*
* If the given URL begins with a `/`, router will navigate absolutely.
* If the given URL does not begin with `/`, the router will navigate relative to this component.
*/
navigate(url: string, _skipLocationChange?: boolean): Promise<any>;
/**
* Updates this router and all descendant routers according to the given instruction
*/
commit(instruction: Instruction, _skipLocationChange?: boolean): Promise<any>;
/**
* Subscribe to URL updates from the router
*/
subscribe(onNext: (value: any) => void): void;
/**
* Removes the contents of this router's outlet and all descendant outlets
*/
deactivate(instruction: Instruction): Promise<any>;
/**
* Given a URL, returns an instruction representing the component graph
*/
recognize(url: string): Promise<Instruction>;
/**
* Navigates to either the last URL successfully navigated to, or the last URL requested if the
* router has yet to successfully navigate.
*/
renavigate(): Promise<any>;
/**
* Generate a URL from a component name and optional map of parameters. The URL is relative to the
* app's base href.
*/
generate(linkParams: List<any>): string;
}
class RootRouter extends Router {
commit(instruction: Instruction, _skipLocationChange?: boolean): Promise<any>;
}
/**
* A router outlet is a placeholder that Angular dynamically fills based on the application's route.
*
* ## Use
*
* ```
* <router-outlet></router-outlet>
* ```
*/
class RouterOutlet {
childRouter: Router;
/**
* Given an instruction, update the contents of this outlet.
*/
commit(instruction: Instruction): Promise<any>;
/**
* Called by Router during recognition phase
*/
canDeactivate(nextInstruction: Instruction): Promise<boolean>;
/**
* Called by Router during recognition phase
*/
canReuse(nextInstruction: Instruction): Promise<boolean>;
deactivate(nextInstruction: Instruction): Promise<any>;
}
/**
* The RouterLink directive lets you link to specific parts of your app.
*
* Consider the following route configuration:
*
* ```
* @RouteConfig([
* { path: '/user', component: UserCmp, as: 'user' }
* ]);
* class MyComp {}
* ```
*
* When linking to this `user` route, you can write:
*
* ```
* <a [router-link]="['./user']">link to user component</a>
* ```
*
* RouterLink expects the value to be an array of route names, followed by the params
* for that level of routing. For instance `['/team', {teamId: 1}, 'user', {userId: 2}]`
* means that we want to generate a link for the `team` route with params `{teamId: 1}`,
* and with a child route `user` with params `{userId: 2}`.
*
* The first route name should be prepended with `/`, `./`, or `../`.
* If the route begins with `/`, the router will look up the route from the root of the app.
* If the route begins with `./`, the router will instead look in the current component's
* children for the route. And if the route begins with `../`, the router will look at the
* current component's parent.
*/
class RouterLink {
visibleHref: string;
routeParams: void;
onClick(): boolean;
}
class RouteParams {
params: StringMap<string, string>;
get(param: string): string;
}
/**
* The RouteRegistry holds route configurations for each component in an Angular app.
* It is responsible for creating Instructions from URLs, and generating URLs based on route and
* parameters.
*/
class RouteRegistry {
/**
* Given a component and a configuration object, add the route to this registry
*/
config(parentComponent: any, config: RouteDefinition, isRootLevelRoute?: boolean): void;
/**
* Reads the annotations of a component and configures the registry based on them
*/
configFromComponent(component: any, isRootComponent?: boolean): void;
/**
* Given a URL and a parent component, return the most specific instruction for navigating
* the application into the state specified by the url
*/
recognize(url: string, parentComponent: any): Promise<Instruction>;
/**
* Given a normalized list with component names and params like: `['user', {id: 3 }]`
* generates a url with a leading slash relative to the provided `parentComponent`.
*/
generate(linkParams: List<any>, parentComponent: any): string;
}
class LocationStrategy {
path(): string;
pushState(ctx: any, title: string, url: string): void;
forward(): void;
back(): void;
onPopState(fn: (_: any) => any): void;
getBaseHref(): string;
}
class HashLocationStrategy extends LocationStrategy {
onPopState(fn: EventListener): void;
getBaseHref(): string;
path(): string;
pushState(state: any, title: string, url: string): void;
forward(): void;
back(): void;
}
class HTML5LocationStrategy extends LocationStrategy {
onPopState(fn: EventListener): void;
getBaseHref(): string;
path(): string;
pushState(state: any, title: string, url: string): void;
forward(): void;
back(): void;
}
/**
* This is the service that an application developer will directly interact with.
*
* Responsible for normalizing the URL against the application's base href.
* A normalized URL is absolute from the URL host, includes the application's base href, and has no
* trailing slash:
* - `/my/app/user/123` is normalized
* - `my/app/user/123` **is not** normalized
* - `/my/app/user/123/` **is not** normalized
*/
class Location {
path(): string;
normalize(url: string): string;
normalizeAbsolutely(url: string): string;
go(url: string): void;
forward(): void;
back(): void;
subscribe(onNext: (value: any) => void, onThrow?: (exception: any) => void, onReturn?: () => void): void;
}
const appBaseHrefToken : OpaqueToken ;
/**
* Responsible for performing each step of navigation.
* "Steps" are conceptually similar to "middleware"
*/
class Pipeline {
steps: List<Function>;
process(instruction: Instruction): Promise<any>;
}
/**
* Defines route lifecycle method [onActivate]
*/
interface OnActivate {
onActivate(nextInstruction: Instruction, prevInstruction: Instruction): any;
}
/**
* Defines route lifecycle method [onDeactivate]
*/
interface OnDeactivate {
onDeactivate(nextInstruction: Instruction, prevInstruction: Instruction): any;
}
/**
* Defines route lifecycle method [onReuse]
*/
interface OnReuse {
onReuse(nextInstruction: Instruction, prevInstruction: Instruction): any;
}
/**
* Defines route lifecycle method [canDeactivate]
*/
interface CanDeactivate {
canDeactivate(nextInstruction: Instruction, prevInstruction: Instruction): any;
}
/**
* Defines route lifecycle method [canReuse]
*/
interface CanReuse {
canReuse(nextInstruction: Instruction, prevInstruction: Instruction): any;
}
var CanActivate : (hook: (next: Instruction, prev: Instruction) => Promise<boolean>| boolean) => ClassDecorator ;
/**
* An `Instruction` represents the component hierarchy of the application based on a given route
*/
class Instruction {
accumulatedUrl: string;
reuse: boolean;
specificity: number;
component: any;
capturedUrl: string;
child: Instruction;
params(): StringMap<string, string>;
}
const routerDirectives : List<any> ;
var routerInjectables : List<any> ;
class Route implements RouteDefinition {
path: string;
component: Type;
as: string;
loader: Function;
redirectTo: string;
}
class Redirect implements RouteDefinition {
path: string;
redirectTo: string;
as: string;
}
class AsyncRoute implements RouteDefinition {
path: string;
loader: Function;
as: string;
}
interface RouteDefinition {
path: string;
component?: Type | ComponentDefinition;
loader?: Function;
redirectTo?: string;
as?: string;
}
var RouteConfig : (configs: List<RouteDefinition>) => ClassDecorator ;
interface ComponentDefinition {
type: string;
loader?: Function;
component?: Type;
}
}
declare module "angular2/router" {
export = ng;
}
+689
View File
@@ -0,0 +1,689 @@
// Type definitions for Angular v2.0.0-alpha.35
// Project: http://angular.io/
// Definitions by: angular team <https://github.com/angular/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// ***********************************************************
// This file is generated by the Angular build process.
// Please do not create manual edits or send pull requests
// modifying this file.
// ***********************************************************
// angular2/router depends transitively on these libraries.
// If you don't have them installed you can install them using TSD
// https://github.com/DefinitelyTyped/tsd
///<reference path="./angular2.d.ts"/>
/**
* @module
* @description
* Maps application URLs into application states, to support deep-linking and navigation.
*/
declare module ngRouter {
/**
* # Router
* The router is responsible for mapping URLs to components.
*
* You can see the state of the router by inspecting the read-only field `router.navigating`.
* This may be useful for showing a spinner, for instance.
*
* ## Concepts
* Routers and component instances have a 1:1 correspondence.
*
* The router holds reference to a number of "outlets." An outlet is a placeholder that the
* router dynamically fills in depending on the current URL.
*
* When the router navigates from a URL, it must first recognizes it and serialize it into an
* `Instruction`.
* The router uses the `RouteRegistry` to get an `Instruction`.
*/
class Router {
navigating: boolean;
lastNavigationAttempt: string;
registry: RouteRegistry;
parent: Router;
hostComponent: any;
/**
* Constructs a child router. You probably don't need to use this unless you're writing a reusable
* component.
*/
childRouter(hostComponent: any): Router;
/**
* Register an object to notify of route changes. You probably don't need to use this unless
* you're writing a reusable component.
*/
registerOutlet(outlet: RouterOutlet): Promise<boolean>;
/**
* Dynamically update the routing configuration and trigger a navigation.
*
* # Usage
*
* ```
* router.config([
* { 'path': '/', 'component': IndexComp },
* { 'path': '/user/:id', 'component': UserComp },
* ]);
* ```
*/
config(definitions: List<RouteDefinition>): Promise<any>;
/**
* Navigate to a URL. Returns a promise that resolves when navigation is complete.
*
* If the given URL begins with a `/`, router will navigate absolutely.
* If the given URL does not begin with `/`, the router will navigate relative to this component.
*/
navigate(url: string, _skipLocationChange?: boolean): Promise<any>;
/**
* Navigate via the provided instruction. Returns a promise that resolves when navigation is
* complete.
*/
navigateInstruction(instruction: Instruction, _skipLocationChange?: boolean): Promise<any>;
/**
* Updates this router and all descendant routers according to the given instruction
*/
commit(instruction: Instruction, _skipLocationChange?: boolean): Promise<any>;
/**
* Subscribe to URL updates from the router
*/
subscribe(onNext: (value: any) => void): void;
/**
* Removes the contents of this router's outlet and all descendant outlets
*/
deactivate(instruction: Instruction): Promise<any>;
/**
* Given a URL, returns an instruction representing the component graph
*/
recognize(url: string): Promise<Instruction>;
/**
* Navigates to either the last URL successfully navigated to, or the last URL requested if the
* router has yet to successfully navigate.
*/
renavigate(): Promise<any>;
/**
* Generate a URL from a component name and optional map of parameters. The URL is relative to the
* app's base href.
*/
generate(linkParams: List<any>): Instruction;
}
class RootRouter extends Router {
commit(instruction: Instruction, _skipLocationChange?: boolean): Promise<any>;
}
/**
* A router outlet is a placeholder that Angular dynamically fills based on the application's route.
*
* ## Use
*
* ```
* <router-outlet></router-outlet>
* ```
*/
class RouterOutlet {
childRouter: Router;
name: string;
/**
* Given an instruction, update the contents of this outlet.
*/
commit(instruction: Instruction): Promise<any>;
/**
* Called by Router during recognition phase
*/
canDeactivate(nextInstruction: Instruction): Promise<boolean>;
/**
* Called by Router during recognition phase
*/
canReuse(nextInstruction: Instruction): Promise<boolean>;
deactivate(nextInstruction: Instruction): Promise<any>;
}
/**
* The RouterLink directive lets you link to specific parts of your app.
*
* Consider the following route configuration:
*
* ```
* @RouteConfig([
* { path: '/user', component: UserCmp, as: 'user' }
* ]);
* class MyComp {}
* ```
*
* When linking to this `user` route, you can write:
*
* ```
* <a [router-link]="['./user']">link to user component</a>
* ```
*
* RouterLink expects the value to be an array of route names, followed by the params
* for that level of routing. For instance `['/team', {teamId: 1}, 'user', {userId: 2}]`
* means that we want to generate a link for the `team` route with params `{teamId: 1}`,
* and with a child route `user` with params `{userId: 2}`.
*
* The first route name should be prepended with `/`, `./`, or `../`.
* If the route begins with `/`, the router will look up the route from the root of the app.
* If the route begins with `./`, the router will instead look in the current component's
* children for the route. And if the route begins with `../`, the router will look at the
* current component's parent.
*/
class RouterLink {
visibleHref: string;
routeParams: void;
onClick(): boolean;
}
class RouteParams {
params: StringMap<string, string>;
get(param: string): string;
}
/**
* The RouteRegistry holds route configurations for each component in an Angular app.
* It is responsible for creating Instructions from URLs, and generating URLs based on route and
* parameters.
*/
class RouteRegistry {
/**
* Given a component and a configuration object, add the route to this registry
*/
config(parentComponent: any, config: RouteDefinition): void;
/**
* Reads the annotations of a component and configures the registry based on them
*/
configFromComponent(component: any): void;
/**
* Given a URL and a parent component, return the most specific instruction for navigating
* the application into the state specified by the url
*/
recognize(url: string, parentComponent: any): Promise<Instruction>;
/**
* Given a normalized list with component names and params like: `['user', {id: 3 }]`
* generates a url with a leading slash relative to the provided `parentComponent`.
*/
generate(linkParams: List<any>, parentComponent: any): Instruction;
}
class LocationStrategy {
path(): string;
pushState(ctx: any, title: string, url: string): void;
forward(): void;
back(): void;
onPopState(fn: (_: any) => any): void;
getBaseHref(): string;
}
class HashLocationStrategy extends LocationStrategy {
onPopState(fn: EventListener): void;
getBaseHref(): string;
path(): string;
pushState(state: any, title: string, url: string): void;
forward(): void;
back(): void;
}
class HTML5LocationStrategy extends LocationStrategy {
onPopState(fn: EventListener): void;
getBaseHref(): string;
path(): string;
pushState(state: any, title: string, url: string): void;
forward(): void;
back(): void;
}
/**
* This is the service that an application developer will directly interact with.
*
* Responsible for normalizing the URL against the application's base href.
* A normalized URL is absolute from the URL host, includes the application's base href, and has no
* trailing slash:
* - `/my/app/user/123` is normalized
* - `my/app/user/123` **is not** normalized
* - `/my/app/user/123/` **is not** normalized
*/
class Location {
path(): string;
normalize(url: string): string;
normalizeAbsolutely(url: string): string;
go(url: string): void;
forward(): void;
back(): void;
subscribe(onNext: (value: any) => void, onThrow?: (exception: any) => void, onReturn?: () => void): void;
}
const APP_BASE_HREF : OpaqueToken ;
/**
* Responsible for performing each step of navigation.
* "Steps" are conceptually similar to "middleware"
*/
class Pipeline {
steps: List<Function>;
process(instruction: Instruction): Promise<any>;
}
/**
* Defines route lifecycle method [onActivate], which is called by the router at the end of a
* successful route navigation.
*
* For a single component's navigation, only one of either [onActivate] or [onReuse] will be called,
* depending on the result of [canReuse].
*
* If `onActivate` returns a promise, the route change will wait until the promise settles to
* instantiate and activate child components.
*
* ## Example
* ```
* @Directive({
* selector: 'my-cmp'
* })
* class MyCmp implements OnActivate {
* onActivate(next, prev) {
* this.log = 'Finished navigating from ' + prev.urlPath + ' to ' + next.urlPath;
* }
* }
* ```
*/
interface OnActivate {
onActivate(nextInstruction: ComponentInstruction, prevInstruction: ComponentInstruction): any;
}
/**
* Defines route lifecycle method [onDeactivate], which is called by the router before destroying
* a component as part of a route change.
*
* If `onDeactivate` returns a promise, the route change will wait until the promise settles.
*
* ## Example
* ```
* @Directive({
* selector: 'my-cmp'
* })
* class MyCmp implements CanReuse, OnReuse {
* canReuse() {
* return true;
* }
*
* onReuse(next, prev) {
* this.params = next.params;
* }
* }
* ```
*/
interface OnDeactivate {
onDeactivate(nextInstruction: ComponentInstruction, prevInstruction: ComponentInstruction): any;
}
/**
* Defines route lifecycle method [onReuse], which is called by the router at the end of a
* successful route navigation when [canReuse] is implemented and returns or resolves to true.
*
* For a single component's navigation, only one of either [onActivate] or [onReuse] will be called,
* depending on the result of [canReuse].
*
* ## Example
* ```
* @Directive({
* selector: 'my-cmp'
* })
* class MyCmp implements CanReuse, OnReuse {
* canReuse() {
* return true;
* }
*
* onReuse(next, prev) {
* this.params = next.params;
* }
* }
* ```
*/
interface OnReuse {
onReuse(nextInstruction: ComponentInstruction, prevInstruction: ComponentInstruction): any;
}
/**
* Defines route lifecycle method [canDeactivate], which is called by the router to determine
* if a component can be removed as part of a navigation.
*
* If `canDeactivate` returns or resolves to `false`, the navigation is cancelled.
*
* If `canDeactivate` throws or rejects, the navigation is also cancelled.
*
* ## Example
* ```
* @Directive({
* selector: 'my-cmp'
* })
* class MyCmp implements CanDeactivate {
* canDeactivate(next, prev) {
* return askUserIfTheyAreSureTheyWantToQuit();
* }
* }
* ```
*/
interface CanDeactivate {
canDeactivate(nextInstruction: ComponentInstruction, prevInstruction: ComponentInstruction): any;
}
/**
* Defines route lifecycle method [canReuse], which is called by the router to determine whether a
* component should be reused across routes, or whether to destroy and instantiate a new component.
*
* If `canReuse` returns or resolves to `true`, the component instance will be reused.
*
* If `canReuse` throws or rejects, the navigation will be cancelled.
*
* ## Example
* ```
* @Directive({
* selector: 'my-cmp'
* })
* class MyCmp implements CanReuse, OnReuse {
* canReuse(next, prev) {
* return next.params.id == prev.params.id;
* }
*
* onReuse(next, prev) {
* this.id = next.params.id;
* }
* }
* ```
*/
interface CanReuse {
canReuse(nextInstruction: ComponentInstruction, prevInstruction: ComponentInstruction): any;
}
/**
* Defines route lifecycle method [canActivate], which is called by the router to determine
* if a component can be instantiated as part of a navigation.
*
* Note that unlike other lifecycle hooks, this one uses an annotation rather than an interface.
* This is because [canActivate] is called before the component is instantiated.
*
* If `canActivate` returns or resolves to `false`, the navigation is cancelled.
*
* If `canActivate` throws or rejects, the navigation is also cancelled.
*
* ## Example
* ```
* @Directive({
* selector: 'control-panel-cmp'
* })
* @CanActivate(() => checkIfUserIsLoggedIn())
* class ControlPanelCmp {
* // ...
* }
* ```
*/
var CanActivate : (hook: (next: ComponentInstruction, prev: ComponentInstruction) => Promise<boolean>| boolean) =>
ClassDecorator ;
/**
* `Instruction` is a tree of `ComponentInstructions`, with all the information needed
* to transition each component in the app to a given route, including all auxiliary routes.
*
* This is a public API.
*/
class Instruction {
component: ComponentInstruction;
child: Instruction;
auxInstruction: StringMap<string, Instruction>;
replaceChild(child: Instruction): Instruction;
}
/**
* A `ComponentInstruction` represents the route state for a single component. An `Instruction` is
* composed of a tree of these `ComponentInstruction`s.
*
* `ComponentInstructions` is a public API. Instances of `ComponentInstruction` are passed
* to route lifecycle hooks, like {@link CanActivate}.
*/
class ComponentInstruction {
reuse: boolean;
urlPath: string;
urlParams: List<string>;
params: StringMap<string, any>;
componentType: void;
resolveComponentType(): Promise<Type>;
specificity: void;
terminal: void;
routeData(): Object;
}
class Url {
path: string;
child: Url;
auxiliary: List<Url>;
params: StringMap<string, any>;
toString(): string;
segmentToString(): string;
}
class OpaqueToken {
toString(): string;
}
/**
* Runtime representation of a type.
*
* In JavaScript a Type is a constructor function.
*/
interface Type extends Function {
new(args: any): any;
}
const routerDirectives : List<any> ;
var routerInjectables : List<any> ;
class Route implements RouteDefinition {
data: any;
path: string;
component: Type;
as: string;
loader: Function;
redirectTo: string;
}
class Redirect implements RouteDefinition {
path: string;
redirectTo: string;
as: string;
loader: Function;
data: any;
}
class AuxRoute implements RouteDefinition {
data: any;
path: string;
component: Type;
as: string;
loader: Function;
redirectTo: string;
}
class AsyncRoute implements RouteDefinition {
data: any;
path: string;
loader: Function;
as: string;
}
interface RouteDefinition {
path: string;
component?: Type | ComponentDefinition;
loader?: Function;
redirectTo?: string;
as?: string;
data?: any;
}
const ROUTE_DATA : OpaqueToken ;
var RouteConfig : (configs: List<RouteDefinition>) => ClassDecorator ;
interface ComponentDefinition {
type: string;
loader?: Function;
component?: Type;
}
}
declare module "angular2/router" {
export = ngRouter;
}
+421 -191
View File
@@ -1,4 +1,4 @@
// Type definitions for Angular v2.0.0-alpha.31
// Type definitions for Angular v2.0.0-alpha.35
// Project: http://angular.io/
// Definitions by: angular team <https://github.com/angular/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -8,130 +8,72 @@
// Please do not create manual edits or send pull requests
// modifying this file.
// ***********************************************************
// angular2/router depends transitively on these libraries.
// If you don't have them installed you can install them using TSD
// https://github.com/DefinitelyTyped/tsd
///<reference path="./angular2.d.ts"/>
/**
* @module
* @description
* Maps application URLs into application states, to support deep-linking and navigation.
*/
declare module ng {
interface List<T> extends Array<T> {}
interface Map<K,V> {}
interface StringMap<K,V> extends Map<K,V> {}
export class Instruction {
// "capturedUrl" is the part of the URL captured by this instruction
// "accumulatedUrl" is the part of the URL captured by this instruction and all children
accumulatedUrl: string;
reuse: boolean;
specificity: number;
private _params: StringMap<string, string>;
constructor (component: any, capturedUrl: string,
_recognizer: PathRecognizer, child: Instruction);
params(): StringMap<string, string>;
}
class TouchMap {
map: StringMap<string, string>;
keys: StringMap<string, boolean>;
constructor(map: StringMap<string, any>);
get(key: string): string;
getUnused(): StringMap<string, any>;
}
export class Segment {
name: string;
regex: string;
generate(params: TouchMap): string;
}
export class PathRecognizer {
segments: List<Segment>;
regex: RegExp;
specificity: number;
terminal: boolean;
path: string;
handler: RouteHandler;
constructor(path: string, handler: RouteHandler);
parseParams(url: string): StringMap<string, string>;
generate(params: StringMap<string, any>): string;
resolveComponentType(): Promise<any>;
}
export interface RouteHandler {
componentType: Function;
resolveComponentType(): Promise<any>;
}
declare module ngRouter {
/**
* # Router
* The router is responsible for mapping URLs to components.
*
*
* You can see the state of the router by inspecting the read-only field `router.navigating`.
* This may be useful for showing a spinner, for instance.
*
*
* ## Concepts
* Routers and component instances have a 1:1 correspondence.
*
*
* The router holds reference to a number of "outlets." An outlet is a placeholder that the
* router dynamically fills in depending on the current URL.
*
*
* When the router navigates from a URL, it must first recognizes it and serialize it into an
* `Instruction`.
* The router uses the `RouteRegistry` to get an `Instruction`.
*/
class Router {
navigating: boolean;
lastNavigationAttempt: string;
registry: RouteRegistry;
parent: Router;
hostComponent: any;
/**
* Constructs a child router. You probably don't need to use this unless you're writing a reusable
* component.
*/
childRouter(hostComponent: any): Router;
/**
* Register an object to notify of route changes. You probably don't need to use this unless
* you're writing a reusable component.
*/
registerOutlet(outlet: RouterOutlet): Promise<boolean>;
/**
* Dynamically update the routing configuration and trigger a navigation.
*
*
* # Usage
*
* ```
* router.config({ 'path': '/', 'component': IndexCmp});
* ```
*
* Or:
*
*
* ```
* router.config([
* { 'path': '/', 'component': IndexComp },
@@ -139,120 +81,129 @@ declare module ng {
* ]);
* ```
*/
config(config: StringMap<string, any>| List<StringMap<string, any>>): Promise<any>;
config(definitions: List<RouteDefinition>): Promise<any>;
/**
* Navigate to a URL. Returns a promise that resolves when navigation is complete.
*
*
* If the given URL begins with a `/`, router will navigate absolutely.
* If the given URL does not begin with `/`, the router will navigate relative to this component.
*/
navigate(url: string): Promise<any>;
navigate(url: string, _skipLocationChange?: boolean): Promise<any>;
/**
* Navigate via the provided instruction. Returns a promise that resolves when navigation is
* complete.
*/
navigateInstruction(instruction: Instruction, _skipLocationChange?: boolean): Promise<any>;
/**
* Updates this router and all descendant routers according to the given instruction
*/
commit(instruction: Instruction): Promise<any>;
commit(instruction: Instruction, _skipLocationChange?: boolean): Promise<any>;
/**
* Subscribe to URL updates from the router
*/
subscribe(onNext: any): void;
subscribe(onNext: (value: any) => void): void;
/**
* Removes the contents of this router's outlet and all descendant outlets
*/
deactivate(instruction: Instruction): Promise<any>;
/**
* Given a URL, returns an instruction representing the component graph
*/
recognize(url: string): Promise<Instruction>;
/**
* Navigates to either the last URL successfully navigated to, or the last URL requested if the
* router has yet to successfully navigate.
*/
renavigate(): Promise<any>;
/**
* Generate a URL from a component name and optional map of parameters. The URL is relative to the
* app's base href.
*/
generate(linkParams: List<any>): string;
generate(linkParams: List<any>): Instruction;
}
class RootRouter extends Router {
commit(instruction: any): Promise<any>;
commit(instruction: Instruction, _skipLocationChange?: boolean): Promise<any>;
}
/**
* A router outlet is a placeholder that Angular dynamically fills based on the application's route.
*
*
* ## Use
*
*
* ```
* <router-outlet></router-outlet>
* ```
*/
class RouterOutlet {
childRouter: Router;
name: string;
/**
* Given an instruction, update the contents of this outlet.
*/
commit(instruction: Instruction): Promise<any>;
/**
* Called by Router during recognition phase
*/
canDeactivate(nextInstruction: Instruction): Promise<boolean>;
/**
* Called by Router during recognition phase
*/
canReuse(nextInstruction: Instruction): Promise<boolean>;
deactivate(nextInstruction: Instruction): Promise<any>;
}
/**
* The RouterLink directive lets you link to specific parts of your app.
*
*
* Consider the following route configuration:
*
*
* ```
* @RouteConfig({
* path: '/user', component: UserCmp, as: 'user'
* });
* @RouteConfig([
* { path: '/user', component: UserCmp, as: 'user' }
* ]);
* class MyComp {}
* ```
*
*
* When linking to this `user` route, you can write:
*
*
* ```
* <a [router-link]="['./user']">link to user component</a>
* ```
*
*
* RouterLink expects the value to be an array of route names, followed by the params
* for that level of routing. For instance `['/team', {teamId: 1}, 'user', {userId: 2}]`
* means that we want to generate a link for the `team` route with params `{teamId: 1}`,
* and with a child route `user` with params `{userId: 2}`.
*
*
* The first route name should be prepended with `/`, `./`, or `../`.
* If the route begins with `/`, the router will look up the route from the root of the app.
* If the route begins with `./`, the router will instead look in the current component's
@@ -260,21 +211,21 @@ declare module ng {
* current component's parent.
*/
class RouterLink {
visibleHref: string;
routeParams: void;
onClick(): boolean;
}
class RouteParams {
params: StringMap<string, string>;
get(param: string): string;
}
/**
* The RouteRegistry holds route configurations for each component in an Angular app.
@@ -282,83 +233,83 @@ declare module ng {
* parameters.
*/
class RouteRegistry {
/**
* Given a component and a configuration object, add the route to this registry
*/
config(parentComponent: any, config: StringMap<string, any>): void;
config(parentComponent: any, config: RouteDefinition): void;
/**
* Reads the annotations of a component and configures the registry based on them
*/
configFromComponent(component: any): void;
/**
* Given a URL and a parent component, return the most specific instruction for navigating
* the application into the state specified by the url
*/
recognize(url: string, parentComponent: any): Promise<Instruction>;
/**
* Given a normalized list with component names and params like: `['user', {id: 3 }]`
* generates a url with a leading slash relative to the provided `parentComponent`.
*/
generate(linkParams: List<any>, parentComponent: any): string;
generate(linkParams: List<any>, parentComponent: any): Instruction;
}
class LocationStrategy {
path(): string;
pushState(ctx: any, title: string, url: string): void;
forward(): void;
back(): void;
onPopState(fn: any): void;
onPopState(fn: (_: any) => any): void;
getBaseHref(): string;
}
class HashLocationStrategy extends LocationStrategy {
onPopState(fn: EventListener): void;
getBaseHref(): string;
path(): string;
pushState(state: any, title: string, url: string): void;
forward(): void;
back(): void;
}
class HTML5LocationStrategy extends LocationStrategy {
onPopState(fn: EventListener): void;
getBaseHref(): string;
path(): string;
pushState(state: any, title: string, url: string): void;
forward(): void;
back(): void;
}
/**
* This is the service that an application developer will directly interact with.
*
*
* Responsible for normalizing the URL against the application's base href.
* A normalized URL is absolute from the URL host, includes the application's base href, and has no
* trailing slash:
@@ -367,93 +318,372 @@ declare module ng {
* - `/my/app/user/123/` **is not** normalized
*/
class Location {
path(): string;
normalize(url: string): string;
normalizeAbsolutely(url: string): string;
go(url: string): void;
forward(): void;
back(): void;
subscribe(onNext: any, onThrow?: any, onReturn?: any): void;
subscribe(onNext: (value: any) => void, onThrow?: (exception: any) => void, onReturn?: () => void): void;
}
var appBaseHrefToken : OpaqueToken ;
const APP_BASE_HREF : OpaqueToken ;
/**
* Responsible for performing each step of navigation.
* "Steps" are conceptually similar to "middleware"
*/
class Pipeline {
steps: List<Function>;
process(instruction: Instruction): Promise<any>;
}
/**
* Defines route lifecycle method [onActivate]
* Defines route lifecycle method [onActivate], which is called by the router at the end of a
* successful route navigation.
*
* For a single component's navigation, only one of either [onActivate] or [onReuse] will be called,
* depending on the result of [canReuse].
*
* If `onActivate` returns a promise, the route change will wait until the promise settles to
* instantiate and activate child components.
*
* ## Example
* ```
* @Directive({
* selector: 'my-cmp'
* })
* class MyCmp implements OnActivate {
* onActivate(next, prev) {
* this.log = 'Finished navigating from ' + prev.urlPath + ' to ' + next.urlPath;
* }
* }
* ```
*/
interface OnActivate {
onActivate(nextInstruction: Instruction, prevInstruction: Instruction): any;
onActivate(nextInstruction: ComponentInstruction, prevInstruction: ComponentInstruction): any;
}
/**
* Defines route lifecycle method [onDeactivate]
* Defines route lifecycle method [onDeactivate], which is called by the router before destroying
* a component as part of a route change.
*
* If `onDeactivate` returns a promise, the route change will wait until the promise settles.
*
* ## Example
* ```
* @Directive({
* selector: 'my-cmp'
* })
* class MyCmp implements CanReuse, OnReuse {
* canReuse() {
* return true;
* }
*
* onReuse(next, prev) {
* this.params = next.params;
* }
* }
* ```
*/
interface OnDeactivate {
onDeactivate(nextInstruction: Instruction, prevInstruction: Instruction): any;
onDeactivate(nextInstruction: ComponentInstruction, prevInstruction: ComponentInstruction): any;
}
/**
* Defines route lifecycle method [onReuse]
* Defines route lifecycle method [onReuse], which is called by the router at the end of a
* successful route navigation when [canReuse] is implemented and returns or resolves to true.
*
* For a single component's navigation, only one of either [onActivate] or [onReuse] will be called,
* depending on the result of [canReuse].
*
* ## Example
* ```
* @Directive({
* selector: 'my-cmp'
* })
* class MyCmp implements CanReuse, OnReuse {
* canReuse() {
* return true;
* }
*
* onReuse(next, prev) {
* this.params = next.params;
* }
* }
* ```
*/
interface OnReuse {
onReuse(nextInstruction: Instruction, prevInstruction: Instruction): any;
onReuse(nextInstruction: ComponentInstruction, prevInstruction: ComponentInstruction): any;
}
/**
* Defines route lifecycle method [canDeactivate]
* Defines route lifecycle method [canDeactivate], which is called by the router to determine
* if a component can be removed as part of a navigation.
*
* If `canDeactivate` returns or resolves to `false`, the navigation is cancelled.
*
* If `canDeactivate` throws or rejects, the navigation is also cancelled.
*
* ## Example
* ```
* @Directive({
* selector: 'my-cmp'
* })
* class MyCmp implements CanDeactivate {
* canDeactivate(next, prev) {
* return askUserIfTheyAreSureTheyWantToQuit();
* }
* }
* ```
*/
interface CanDeactivate {
canDeactivate(nextInstruction: Instruction, prevInstruction: Instruction): any;
canDeactivate(nextInstruction: ComponentInstruction, prevInstruction: ComponentInstruction): any;
}
/**
* Defines route lifecycle method [canReuse]
* Defines route lifecycle method [canReuse], which is called by the router to determine whether a
* component should be reused across routes, or whether to destroy and instantiate a new component.
*
* If `canReuse` returns or resolves to `true`, the component instance will be reused.
*
* If `canReuse` throws or rejects, the navigation will be cancelled.
*
* ## Example
* ```
* @Directive({
* selector: 'my-cmp'
* })
* class MyCmp implements CanReuse, OnReuse {
* canReuse(next, prev) {
* return next.params.id == prev.params.id;
* }
*
* onReuse(next, prev) {
* this.id = next.params.id;
* }
* }
* ```
*/
interface CanReuse {
canReuse(nextInstruction: Instruction, prevInstruction: Instruction): any;
canReuse(nextInstruction: ComponentInstruction, prevInstruction: ComponentInstruction): any;
}
var CanActivate:any;
/**
* Defines route lifecycle method [canActivate], which is called by the router to determine
* if a component can be instantiated as part of a navigation.
*
* Note that unlike other lifecycle hooks, this one uses an annotation rather than an interface.
* This is because [canActivate] is called before the component is instantiated.
*
* If `canActivate` returns or resolves to `false`, the navigation is cancelled.
*
* If `canActivate` throws or rejects, the navigation is also cancelled.
*
* ## Example
* ```
* @Directive({
* selector: 'control-panel-cmp'
* })
* @CanActivate(() => checkIfUserIsLoggedIn())
* class ControlPanelCmp {
* // ...
* }
* ```
*/
var CanActivate : (hook: (next: ComponentInstruction, prev: ComponentInstruction) => Promise<boolean>| boolean) =>
ClassDecorator ;
var routerDirectives : List<any> ;
/**
* `Instruction` is a tree of `ComponentInstructions`, with all the information needed
* to transition each component in the app to a given route, including all auxiliary routes.
*
* This is a public API.
*/
class Instruction {
component: ComponentInstruction;
child: Instruction;
auxInstruction: StringMap<string, Instruction>;
replaceChild(child: Instruction): Instruction;
}
/**
* A `ComponentInstruction` represents the route state for a single component. An `Instruction` is
* composed of a tree of these `ComponentInstruction`s.
*
* `ComponentInstructions` is a public API. Instances of `ComponentInstruction` are passed
* to route lifecycle hooks, like {@link CanActivate}.
*/
class ComponentInstruction {
reuse: boolean;
urlPath: string;
urlParams: List<string>;
params: StringMap<string, any>;
componentType: void;
resolveComponentType(): Promise<Type>;
specificity: void;
terminal: void;
routeData(): Object;
}
class Url {
path: string;
child: Url;
auxiliary: List<Url>;
params: StringMap<string, any>;
toString(): string;
segmentToString(): string;
}
class OpaqueToken {
toString(): string;
}
/**
* Runtime representation of a type.
*
* In JavaScript a Type is a constructor function.
*/
interface Type extends Function {
new(args: any): any;
}
const routerDirectives : List<any> ;
var routerInjectables : List<any> ;
var RouteConfig:any;
class Route implements RouteDefinition {
data: any;
path: string;
component: Type;
as: string;
loader: Function;
redirectTo: string;
}
class Redirect implements RouteDefinition {
path: string;
redirectTo: string;
as: string;
loader: Function;
data: any;
}
class AuxRoute implements RouteDefinition {
data: any;
path: string;
component: Type;
as: string;
loader: Function;
redirectTo: string;
}
class AsyncRoute implements RouteDefinition {
data: any;
path: string;
loader: Function;
as: string;
}
interface RouteDefinition {
path: string;
component?: Type | ComponentDefinition;
loader?: Function;
redirectTo?: string;
as?: string;
data?: any;
}
const ROUTE_DATA : OpaqueToken ;
var RouteConfig : (configs: List<RouteDefinition>) => ClassDecorator ;
interface ComponentDefinition {
type: string;
loader?: Function;
component?: Type;
}
}
declare module "angular2/router" {
export = ng;
export = ngRouter;
}
+100 -2
View File
@@ -126,18 +126,35 @@ requestHandler = httpBackendService.expect('GET', /test.local/, function (data:
requestHandler = httpBackendService.expect('GET', /test.local/, { key: 'value' });
requestHandler = httpBackendService.expect('GET', /test.local/, { key: 'value' }, { header: 'value' });
requestHandler = httpBackendService.expect('GET', /test.local/, { key: 'value' }, function (headers: Object): boolean { return true; });
requestHandler = httpBackendService.expect('GET', (url: string) => { return true; });
requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, 'response data');
requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, 'response data', { header: 'value' });
requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, 'response data', function (headers: Object): boolean { return true; });
requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, /response data/);
requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, /response data/, { header: 'value' });
requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, /response data/, function (headers: Object): boolean { return true; });
requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, function (data: string): boolean { return true; });
requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, function (data: string): boolean { return true; }, { header: 'value' });
requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, function (data: string): boolean { return true; }, function (headers: Object): boolean { return true; });
requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, { key: 'value' });
requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, { key: 'value' }, { header: 'value' });
requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, { key: 'value' }, function (headers: Object): boolean { return true; });
requestHandler = httpBackendService.expectDELETE('http://test.local');
requestHandler = httpBackendService.expectDELETE('http://test.local', { header: 'value' });
requestHandler = httpBackendService.expectDELETE(/test.local/, { header: 'value' });
requestHandler = httpBackendService.expectDELETE((url: string) => { return true; }, { header: 'value' });
requestHandler = httpBackendService.expectGET('http://test.local');
requestHandler = httpBackendService.expectGET('http://test.local', { header: 'value' });
requestHandler = httpBackendService.expectGET(/test.local/, { header: 'value' });
requestHandler = httpBackendService.expectGET((url: string) => { return true; }, { header: 'value' });
requestHandler = httpBackendService.expectHEAD('http://test.local');
requestHandler = httpBackendService.expectHEAD('http://test.local', { header: 'value' });
requestHandler = httpBackendService.expectHEAD(/test.local/, { header: 'value' });
requestHandler = httpBackendService.expectHEAD((url: string) => { return true; }, { header: 'value' });
requestHandler = httpBackendService.expectJSONP('http://test.local');
requestHandler = httpBackendService.expectJSONP(/test.local/);
requestHandler = httpBackendService.expectJSONP((url: string) => { return true; });
requestHandler = httpBackendService.expectPATCH('http://test.local');
requestHandler = httpBackendService.expectPATCH('http://test.local', 'response data');
@@ -157,6 +174,15 @@ requestHandler = httpBackendService.expectPATCH(/test.local/, function (data: st
requestHandler = httpBackendService.expectPATCH(/test.local/, function (data: string): boolean { return true; }, { header: 'value' });
requestHandler = httpBackendService.expectPATCH(/test.local/, { key: 'value' });
requestHandler = httpBackendService.expectPATCH(/test.local/, { key: 'value' }, { header: 'value' });
requestHandler = httpBackendService.expectPATCH((url: string) => { return true; });
requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }, 'response data');
requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }, 'response data', { header: 'value' });
requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }, /response data/);
requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }, /response data/, { header: 'value' });
requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }, function (data: string): boolean { return true; });
requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }, function (data: string): boolean { return true; }, { header: 'value' });
requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }, { key: 'value' });
requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }, { key: 'value' }, { header: 'value' });
requestHandler = httpBackendService.expectPOST('http://test.local');
requestHandler = httpBackendService.expectPOST('http://test.local', 'response data');
@@ -176,6 +202,15 @@ requestHandler = httpBackendService.expectPOST(/test.local/, function (data: str
requestHandler = httpBackendService.expectPOST(/test.local/, function (data: string): boolean { return true; }, { header: 'value' });
requestHandler = httpBackendService.expectPOST(/test.local/, { key: 'value' });
requestHandler = httpBackendService.expectPOST(/test.local/, { key: 'value' }, { header: 'value' });
requestHandler = httpBackendService.expectPOST((url: string) => { return true; });
requestHandler = httpBackendService.expectPOST((url: string) => { return true; }, 'response data');
requestHandler = httpBackendService.expectPOST((url: string) => { return true; }, 'response data', { header: 'value' });
requestHandler = httpBackendService.expectPOST((url: string) => { return true; }, /response data/);
requestHandler = httpBackendService.expectPOST((url: string) => { return true; }, /response data/, { header: 'value' });
requestHandler = httpBackendService.expectPOST((url: string) => { return true; }, function (data: string): boolean { return true; });
requestHandler = httpBackendService.expectPOST((url: string) => { return true; }, function (data: string): boolean { return true; }, { header: 'value' });
requestHandler = httpBackendService.expectPOST((url: string) => { return true; }, { key: 'value' });
requestHandler = httpBackendService.expectPOST((url: string) => { return true; }, { key: 'value' }, { header: 'value' });
requestHandler = httpBackendService.expectPUT('http://test.local');
requestHandler = httpBackendService.expectPUT('http://test.local', 'response data');
@@ -195,6 +230,15 @@ requestHandler = httpBackendService.expectPUT(/test.local/, function (data: stri
requestHandler = httpBackendService.expectPUT(/test.local/, function (data: string): boolean { return true; }, { header: 'value' });
requestHandler = httpBackendService.expectPUT(/test.local/, { key: 'value' });
requestHandler = httpBackendService.expectPUT(/test.local/, { key: 'value' }, { header: 'value' });
requestHandler = httpBackendService.expectPUT((url: string) => { return true; });
requestHandler = httpBackendService.expectPUT((url: string) => { return true; }, 'response data');
requestHandler = httpBackendService.expectPUT((url: string) => { return true; }, 'response data', { header: 'value' });
requestHandler = httpBackendService.expectPUT((url: string) => { return true; }, /response data/);
requestHandler = httpBackendService.expectPUT((url: string) => { return true; }, /response data/, { header: 'value' });
requestHandler = httpBackendService.expectPUT((url: string) => { return true; }, function (data: string): boolean { return true; });
requestHandler = httpBackendService.expectPUT((url: string) => { return true; }, function (data: string): boolean { return true; }, { header: 'value' });
requestHandler = httpBackendService.expectPUT((url: string) => { return true; }, { key: 'value' });
requestHandler = httpBackendService.expectPUT((url: string) => { return true; }, { key: 'value' }, { header: 'value' });
requestHandler = httpBackendService.when('GET', 'http://test.local');
requestHandler = httpBackendService.when('GET', 'http://test.local', 'response data');
@@ -222,18 +266,35 @@ requestHandler = httpBackendService.when('GET', /test.local/, function (data: st
requestHandler = httpBackendService.when('GET', /test.local/, { key: 'value' });
requestHandler = httpBackendService.when('GET', /test.local/, { key: 'value' }, { header: 'value' });
requestHandler = httpBackendService.when('GET', /test.local/, { key: 'value' }, function (headers: Object): boolean { return true; });
requestHandler = httpBackendService.when('GET', (url: string) => { return true; });
requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, 'response data');
requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, 'response data', { header: 'value' });
requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, 'response data', function (headers: Object): boolean { return true; });
requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, /response data/);
requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, /response data/, { header: 'value' });
requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, /response data/, function (headers: Object): boolean { return true; });
requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, function (data: string): boolean { return true; });
requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, function (data: string): boolean { return true; }, { header: 'value' });
requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, function (data: string): boolean { return true; }, function (headers: Object): boolean { return true; });
requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, { key: 'value' });
requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, { key: 'value' }, { header: 'value' });
requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, { key: 'value' }, function (headers: Object): boolean { return true; });
requestHandler = httpBackendService.whenDELETE('http://test.local');
requestHandler = httpBackendService.whenDELETE('http://test.local', { header: 'value' });
requestHandler = httpBackendService.whenDELETE(/test.local/, { header: 'value' });
requestHandler = httpBackendService.whenDELETE((url: string) => { return true; }, { header: 'value' });
requestHandler = httpBackendService.whenGET('http://test.local');
requestHandler = httpBackendService.whenGET('http://test.local', { header: 'value' });
requestHandler = httpBackendService.whenGET(/test.local/, { header: 'value' });
requestHandler = httpBackendService.whenGET((url: string) => { return true; }, { header: 'value' });
requestHandler = httpBackendService.whenHEAD('http://test.local');
requestHandler = httpBackendService.whenHEAD('http://test.local', { header: 'value' });
requestHandler = httpBackendService.whenHEAD(/test.local/, { header: 'value' });
requestHandler = httpBackendService.whenHEAD((url: string) => { return true; }, { header: 'value' });
requestHandler = httpBackendService.whenJSONP('http://test.local');
requestHandler = httpBackendService.whenJSONP(/test.local/);
requestHandler = httpBackendService.whenJSONP((url: string) => { return true; });
requestHandler = httpBackendService.whenPATCH('http://test.local');
requestHandler = httpBackendService.whenPATCH('http://test.local', 'response data');
@@ -253,6 +314,15 @@ requestHandler = httpBackendService.whenPATCH(/test.local/, function (data: stri
requestHandler = httpBackendService.whenPATCH(/test.local/, function (data: string): boolean { return true; }, { header: 'value' });
requestHandler = httpBackendService.whenPATCH(/test.local/, { key: 'value' });
requestHandler = httpBackendService.whenPATCH(/test.local/, { key: 'value' }, { header: 'value' });
requestHandler = httpBackendService.whenPATCH((url: string) => { return true; });
requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }, 'response data');
requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }, 'response data', { header: 'value' });
requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }, /response data/);
requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }, /response data/, { header: 'value' });
requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }, function (data: string): boolean { return true; });
requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }, function (data: string): boolean { return true; }, { header: 'value' });
requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }, { key: 'value' });
requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }, { key: 'value' }, { header: 'value' });
requestHandler = httpBackendService.whenPOST('http://test.local');
requestHandler = httpBackendService.whenPOST('http://test.local', 'response data');
@@ -272,6 +342,15 @@ requestHandler = httpBackendService.whenPOST(/test.local/, function (data: strin
requestHandler = httpBackendService.whenPOST(/test.local/, function (data: string): boolean { return true; }, { header: 'value' });
requestHandler = httpBackendService.whenPOST(/test.local/, { key: 'value' });
requestHandler = httpBackendService.whenPOST(/test.local/, { key: 'value' }, { header: 'value' });
requestHandler = httpBackendService.whenPOST((url: string) => { return true; });
requestHandler = httpBackendService.whenPOST((url: string) => { return true; }, 'response data');
requestHandler = httpBackendService.whenPOST((url: string) => { return true; }, 'response data', { header: 'value' });
requestHandler = httpBackendService.whenPOST((url: string) => { return true; }, /response data/);
requestHandler = httpBackendService.whenPOST((url: string) => { return true; }, /response data/, { header: 'value' });
requestHandler = httpBackendService.whenPOST((url: string) => { return true; }, function (data: string): boolean { return true; });
requestHandler = httpBackendService.whenPOST((url: string) => { return true; }, function (data: string): boolean { return true; }, { header: 'value' });
requestHandler = httpBackendService.whenPOST((url: string) => { return true; }, { key: 'value' });
requestHandler = httpBackendService.whenPOST((url: string) => { return true; }, { key: 'value' }, { header: 'value' });
requestHandler = httpBackendService.whenPUT('http://test.local');
requestHandler = httpBackendService.whenPUT('http://test.local', 'response data');
@@ -291,15 +370,34 @@ requestHandler = httpBackendService.whenPUT(/test.local/, function (data: string
requestHandler = httpBackendService.whenPUT(/test.local/, function (data: string): boolean { return true; }, { header: 'value' });
requestHandler = httpBackendService.whenPUT(/test.local/, { key: 'value' });
requestHandler = httpBackendService.whenPUT(/test.local/, { key: 'value' }, { header: 'value' });
requestHandler = httpBackendService.whenPUT((url: string) => { return true; });
requestHandler = httpBackendService.whenPUT((url: string) => { return true; }, 'response data');
requestHandler = httpBackendService.whenPUT((url: string) => { return true; }, 'response data', { header: 'value' });
requestHandler = httpBackendService.whenPUT((url: string) => { return true; }, /response data/);
requestHandler = httpBackendService.whenPUT((url: string) => { return true; }, /response data/, { header: 'value' });
requestHandler = httpBackendService.whenPUT((url: string) => { return true; }, function (data: string): boolean { return true; });
requestHandler = httpBackendService.whenPUT((url: string) => { return true; }, function (data: string): boolean { return true; }, { header: 'value' });
requestHandler = httpBackendService.whenPUT((url: string) => { return true; }, { key: 'value' });
requestHandler = httpBackendService.whenPUT((url: string) => { return true; }, { key: 'value' }, { header: 'value' });
///////////////////////////////////////
// IRequestHandler
///////////////////////////////////////
var expectedData = { key: 'value'};
requestHandler.passThrough();
requestHandler.respond(function () { });
requestHandler.passThrough().passThrough();
requestHandler.respond((method, url, data, headers) => [404, 'data', { header: 'value' }, 'responseText']);
requestHandler.respond((method, url, data, headers) => [404, 'data', { header: 'value' }, 'responseText']).respond({});
requestHandler.respond((method, url, data, headers) => { return [404, { key: 'value' }, { header: 'value' }, 'responseText']; });
requestHandler.respond('data');
requestHandler.respond('data').respond({});
requestHandler.respond(expectedData);
requestHandler.respond({ key: 'value' });
requestHandler.respond({ key: 'value' }, { header: 'value' });
requestHandler.respond(404);
requestHandler.respond({ key: 'value' }, { header: 'value' }, 'responseText');
requestHandler.respond(404, 'data');
requestHandler.respond(404, 'data').respond({});
requestHandler.respond(404, { key: 'value' });
requestHandler.respond(404, { key: 'value' }, { header: 'value' });
requestHandler.respond(404, { key: 'value' }, { header: 'value' }, 'responseText');
+182 -110
View File
@@ -1,6 +1,6 @@
// Type definitions for Angular JS 1.3 (ngMock, ngMockE2E module)
// Project: http://angularjs.org
// Definitions by: Diego Vilar <http://github.com/diegovilar>
// Definitions by: Diego Vilar <http://github.com/diegovilar>, Tony Curtis <http://github.com/daltin>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="angular.d.ts" />
@@ -97,137 +97,208 @@ declare module angular {
// see https://docs.angularjs.org/api/ngMock/service/$httpBackend
///////////////////////////////////////////////////////////////////////////
interface IHttpBackendService {
/**
* Flushes all pending requests using the trained responses.
* @param count Number of responses to flush (in the order they arrived). If undefined, all pending requests will be flushed.
*/
flush(count?: number): void;
/**
* Resets all request expectations, but preserves all backend definitions.
*/
resetExpectations(): void;
/**
* Verifies that all of the requests defined via the expect api were made. If any of the requests were not made, verifyNoOutstandingExpectation throws an exception.
*/
verifyNoOutstandingExpectation(): void;
/**
* Verifies that there are no outstanding requests that need to be flushed.
*/
verifyNoOutstandingRequest(): void;
expect(method: string, url: string, data?: string, headers?: Object): mock.IRequestHandler;
expect(method: string, url: string, data?: string, headers?: (object: Object) => boolean): mock.IRequestHandler;
expect(method: string, url: string, data?: RegExp, headers?: Object): mock.IRequestHandler;
expect(method: string, url: string, data?: RegExp, headers?: (object: Object) => boolean): mock.IRequestHandler;
expect(method: string, url: string, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
expect(method: string, url: string, data?: (data: string) => boolean, headers?: (object: Object) => boolean): mock.IRequestHandler;
expect(method: string, url: string, data?: Object, headers?: Object): mock.IRequestHandler;
expect(method: string, url: string, data?: Object, headers?: (object: Object) => boolean): mock.IRequestHandler;
expect(method: string, url: RegExp, data?: string, headers?: Object): mock.IRequestHandler;
expect(method: string, url: RegExp, data?: string, headers?: (object: Object) => boolean): mock.IRequestHandler;
expect(method: string, url: RegExp, data?: RegExp, headers?: Object): mock.IRequestHandler;
expect(method: string, url: RegExp, data?: RegExp, headers?: (object: Object) => boolean): mock.IRequestHandler;
expect(method: string, url: RegExp, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
expect(method: string, url: RegExp, data?: (data: string) => boolean, headers?: (object: Object) => boolean): mock.IRequestHandler;
expect(method: string, url: RegExp, data?: Object, headers?: Object): mock.IRequestHandler;
expect(method: string, url: RegExp, data?: Object, headers?: (object: Object) => boolean): mock.IRequestHandler;
/**
* Creates a new request expectation.
* Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false.
* Returns an object with respond method that controls how a matched request is handled.
* @param method HTTP method.
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
* @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation.
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation.
*/
expect(method: string, url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean)) :mock.IRequestHandler;
expectDELETE(url: string, headers?: Object): mock.IRequestHandler;
expectDELETE(url: RegExp, headers?: Object): mock.IRequestHandler;
expectGET(url: string, headers?: Object): mock.IRequestHandler;
expectGET(url: RegExp, headers?: Object): mock.IRequestHandler;
expectHEAD(url: string, headers?: Object): mock.IRequestHandler;
expectHEAD(url: RegExp, headers?: Object): mock.IRequestHandler;
expectJSONP(url: string): mock.IRequestHandler;
expectJSONP(url: RegExp): mock.IRequestHandler;
/**
* Creates a new request expectation for DELETE requests.
* Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false.
* Returns an object with respond method that controls how a matched request is handled.
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url is as expected.
* @param headers HTTP headers object to be compared with the HTTP headers in the request.
*/
expectDELETE(url: string | RegExp | ((url: string) => boolean), headers?: Object): mock.IRequestHandler;
expectPATCH(url: string, data?: string, headers?: Object): mock.IRequestHandler;
expectPATCH(url: string, data?: RegExp, headers?: Object): mock.IRequestHandler;
expectPATCH(url: string, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
expectPATCH(url: string, data?: Object, headers?: Object): mock.IRequestHandler;
expectPATCH(url: RegExp, data?: string, headers?: Object): mock.IRequestHandler;
expectPATCH(url: RegExp, data?: RegExp, headers?: Object): mock.IRequestHandler;
expectPATCH(url: RegExp, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
expectPATCH(url: RegExp, data?: Object, headers?: Object): mock.IRequestHandler;
/**
* Creates a new request expectation for GET requests.
* Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false.
* Returns an object with respond method that controls how a matched request is handled.
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
* @param headers HTTP headers object to be compared with the HTTP headers in the request.
*/
expectGET(url: string | RegExp | ((url: string) => boolean), headers?: Object): mock.IRequestHandler;
expectPOST(url: string, data?: string, headers?: Object): mock.IRequestHandler;
expectPOST(url: string, data?: RegExp, headers?: Object): mock.IRequestHandler;
expectPOST(url: string, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
expectPOST(url: string, data?: Object, headers?: Object): mock.IRequestHandler;
expectPOST(url: RegExp, data?: string, headers?: Object): mock.IRequestHandler;
expectPOST(url: RegExp, data?: RegExp, headers?: Object): mock.IRequestHandler;
expectPOST(url: RegExp, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
expectPOST(url: RegExp, data?: Object, headers?: Object): mock.IRequestHandler;
/**
* Creates a new request expectation for HEAD requests.
* Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false.
* Returns an object with respond method that controls how a matched request is handled.
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
* @param headers HTTP headers object to be compared with the HTTP headers in the request.
*/
expectHEAD(url: string | RegExp | ((url: string) => boolean), headers?: Object): mock.IRequestHandler;
/**
* Creates a new request expectation for JSONP requests.
* Throws a preformatted error if expectation(s) don't match supplied string, regular expression, or if function returns false.
* Returns an object with respond method that controls how a matched request is handled.
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
*/
expectJSONP(url: string | RegExp | ((url: string) => boolean)): mock.IRequestHandler;
expectPUT(url: string, data?: string, headers?: Object): mock.IRequestHandler;
expectPUT(url: string, data?: RegExp, headers?: Object): mock.IRequestHandler;
expectPUT(url: string, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
expectPUT(url: string, data?: Object, headers?: Object): mock.IRequestHandler;
expectPUT(url: RegExp, data?: string, headers?: Object): mock.IRequestHandler;
expectPUT(url: RegExp, data?: RegExp, headers?: Object): mock.IRequestHandler;
expectPUT(url: RegExp, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
expectPUT(url: RegExp, data?: Object, headers?: Object): mock.IRequestHandler;
/**
* Creates a new request expectation for PATCH requests.
* Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false.
* Returns an object with respond method that controls how a matched request is handled.
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
* @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation.
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation.
*/
expectPATCH(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object): mock.IRequestHandler;
when(method: string, url: string, data?: string, headers?: Object): mock.IRequestHandler;
when(method: string, url: string, data?: string, headers?: (object: Object) => boolean): mock.IRequestHandler;
when(method: string, url: string, data?: RegExp, headers?: Object): mock.IRequestHandler;
when(method: string, url: string, data?: RegExp, headers?: (object: Object) => boolean): mock.IRequestHandler;
when(method: string, url: string, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
when(method: string, url: string, data?: (data: string) => boolean, headers?: (object: Object) => boolean): mock.IRequestHandler;
when(method: string, url: string, data?: Object, headers?: Object): mock.IRequestHandler;
when(method: string, url: string, data?: Object, headers?: (object: Object) => boolean): mock.IRequestHandler;
when(method: string, url: RegExp, data?: string, headers?: Object): mock.IRequestHandler;
when(method: string, url: RegExp, data?: string, headers?: (object: Object) => boolean): mock.IRequestHandler;
when(method: string, url: RegExp, data?: RegExp, headers?: Object): mock.IRequestHandler;
when(method: string, url: RegExp, data?: RegExp, headers?: (object: Object) => boolean): mock.IRequestHandler;
when(method: string, url: RegExp, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
when(method: string, url: RegExp, data?: (data: string) => boolean, headers?: (object: Object) => boolean): mock.IRequestHandler;
when(method: string, url: RegExp, data?: Object, headers?: Object): mock.IRequestHandler;
when(method: string, url: RegExp, data?: Object, headers?: (object: Object) => boolean): mock.IRequestHandler;
/**
* Creates a new request expectation for POST requests.
* Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false.
* Returns an object with respond method that controls how a matched request is handled.
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
* @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation.
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation.
*/
expectPOST(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object): mock.IRequestHandler;
whenDELETE(url: string, headers?: Object): mock.IRequestHandler;
whenDELETE(url: string, headers?: (object: Object) => boolean): mock.IRequestHandler;
whenDELETE(url: RegExp, headers?: Object): mock.IRequestHandler;
whenDELETE(url: RegExp, headers?: (object: Object) => boolean): mock.IRequestHandler;
/**
* Creates a new request expectation for PUT requests.
* Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false.
* Returns an object with respond method that controls how a matched request is handled.
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
* @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation.
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation.
*/
expectPUT(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object): mock.IRequestHandler;
whenGET(url: string, headers?: Object): mock.IRequestHandler;
whenGET(url: string, headers?: (object: Object) => boolean): mock.IRequestHandler;
whenGET(url: RegExp, headers?: Object): mock.IRequestHandler;
whenGET(url: RegExp, headers?: (object: Object) => boolean): mock.IRequestHandler;
/**
* Creates a new backend definition.
* Returns an object with respond method that controls how a matched request is handled.
* @param method HTTP method.
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
* @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation.
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation.
*/
when(method: string, url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler;
whenHEAD(url: string, headers?: Object): mock.IRequestHandler;
whenHEAD(url: string, headers?: (object: Object) => boolean): mock.IRequestHandler;
whenHEAD(url: RegExp, headers?: Object): mock.IRequestHandler;
whenHEAD(url: RegExp, headers?: (object: Object) => boolean): mock.IRequestHandler;
/**
* Creates a new backend definition for DELETE requests.
* Returns an object with respond method that controls how a matched request is handled.
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation.
*/
whenDELETE(url: string | RegExp | ((url: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler;
whenJSONP(url: string): mock.IRequestHandler;
whenJSONP(url: RegExp): mock.IRequestHandler;
/**
* Creates a new backend definition for GET requests.
* Returns an object with respond method that controls how a matched request is handled.
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation.
*/
whenGET(url: string | RegExp | ((url: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler;
whenPATCH(url: string, data?: string, headers?: Object): mock.IRequestHandler;
whenPATCH(url: string, data?: RegExp, headers?: Object): mock.IRequestHandler;
whenPATCH(url: string, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
whenPATCH(url: string, data?: Object, headers?: Object): mock.IRequestHandler;
whenPATCH(url: RegExp, data?: string, headers?: Object): mock.IRequestHandler;
whenPATCH(url: RegExp, data?: RegExp, headers?: Object): mock.IRequestHandler;
whenPATCH(url: RegExp, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
whenPATCH(url: RegExp, data?: Object, headers?: Object): mock.IRequestHandler;
/**
* Creates a new backend definition for HEAD requests.
* Returns an object with respond method that controls how a matched request is handled.
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation.
*/
whenHEAD(url: string | RegExp | ((url: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler;
whenPOST(url: string, data?: string, headers?: Object): mock.IRequestHandler;
whenPOST(url: string, data?: RegExp, headers?: Object): mock.IRequestHandler;
whenPOST(url: string, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
whenPOST(url: string, data?: Object, headers?: Object): mock.IRequestHandler;
whenPOST(url: RegExp, data?: string, headers?: Object): mock.IRequestHandler;
whenPOST(url: RegExp, data?: RegExp, headers?: Object): mock.IRequestHandler;
whenPOST(url: RegExp, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
whenPOST(url: RegExp, data?: Object, headers?: Object): mock.IRequestHandler;
/**
* Creates a new backend definition for JSONP requests.
* Returns an object with respond method that controls how a matched request is handled.
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation.
*/
whenJSONP(url: string | RegExp | ((url: string) => boolean)): mock.IRequestHandler;
whenPUT(url: string, data?: string, headers?: Object): mock.IRequestHandler;
whenPUT(url: string, data?: RegExp, headers?: Object): mock.IRequestHandler;
whenPUT(url: string, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
whenPUT(url: string, data?: Object, headers?: Object): mock.IRequestHandler;
whenPUT(url: RegExp, data?: string, headers?: Object): mock.IRequestHandler;
whenPUT(url: RegExp, data?: RegExp, headers?: Object): mock.IRequestHandler;
whenPUT(url: RegExp, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
whenPUT(url: RegExp, data?: Object, headers?: Object): mock.IRequestHandler;
/**
* Creates a new backend definition for PATCH requests.
* Returns an object with respond method that controls how a matched request is handled.
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
* @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation.
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation.
*/
whenPATCH(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler;
/**
* Creates a new backend definition for POST requests.
* Returns an object with respond method that controls how a matched request is handled.
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
* @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation.
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation.
*/
whenPOST(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler;
/**
* Creates a new backend definition for PUT requests.
* Returns an object with respond method that controls how a matched request is handled.
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
* @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation.
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation.
*/
whenPUT(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler;
}
export module mock {
// returned interface by the the mocked HttpBackendService expect/when methods
interface IRequestHandler {
respond(func: Function): void;
respond(status: number, data?: any, headers?: any): void;
respond(data: any, headers?: any): void;
/**
* Controls the response for a matched request using a function to construct the response.
* Returns the RequestHandler object for possible overrides.
* @param func Function that receives the request HTTP method, url, data, and headers and returns an array containing response status (number), data, headers, and status text.
*/
respond(func: ((method: string, url: string, data: string | Object, headers: Object) => [number, string | Object, Object, string])): IRequestHandler;
// Available wehn ngMockE2E is loaded
passThrough(): void;
/**
* Controls the response for a matched request using supplied static data to construct the response.
* Returns the RequestHandler object for possible overrides.
* @param status HTTP status code to add to the response.
* @param data Data to add to the response.
* @param headers Headers object to add to the response.
* @param responseText Response text to add to the response.
*/
respond(status: number, data: string | Object, headers?: Object, responseText?: string): IRequestHandler;
/**
* Controls the response for a matched request using the HTTP status code 200 and supplied static data to construct the response.
* Returns the RequestHandler object for possible overrides.
* @param data Data to add to the response.
* @param headers Headers object to add to the response.
* @param responseText Response text to add to the response.
*/
respond(data: string | Object, headers?: Object, responseText?: string): IRequestHandler;
// Available when ngMockE2E is loaded
/**
* Any request matching a backend definition or expectation with passThrough handler will be passed through to the real backend (an XHR request will be made to the server.)
*/
passThrough(): IRequestHandler;
}
}
@@ -237,5 +308,6 @@ declare module angular {
///////////////////////////////////////////////////////////////////////////////
// functions attached to global object (window)
///////////////////////////////////////////////////////////////////////////////
declare var module: (...modules: any[]) => any;
//Use `angular.mock.module` instead of `module`, as `module` conflicts with commonjs.
//declare var module: (...modules: any[]) => any;
declare var inject: angular.IInjectStatic;
Executable → Regular
+205 -2
View File
@@ -30,7 +30,7 @@ class AuthService {
'$rootScope', '$injector', <any>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<any>) {
$http = $http || $injector.get('$http');
$http = $http || $injector.get<ng.IHttpService>('$http');
$http(config).then(function (response) {
deferred.resolve(response);
});
@@ -242,6 +242,72 @@ foo.then((x) => {
x.toFixed();
});
// $q signature tests
module TestQ {
interface TResult {
a: number;
b: string;
c: boolean;
}
var tResult: TResult;
var promiseTResult: angular.IPromise<TResult>;
var $q: angular.IQService;
var promiseAny: angular.IPromise<any>;
// $q constructor
{
let result: angular.IPromise<TResult>;
result = new $q<TResult>((resolve: (value: TResult) => any) => {});
result = new $q<TResult>((resolve: (value: TResult) => any, reject: (value: any) => any) => {});
result = $q<TResult>((resolve: (value: TResult) => any) => {});
result = $q<TResult>((resolve: (value: TResult) => any, reject: (value: any) => any) => {});
}
// $q.all
{
let result: angular.IPromise<any[]>;
result = $q.all([promiseAny, promiseAny]);
}
{
let result: angular.IPromise<TResult[]>;
result = $q.all<TResult>([promiseAny, promiseAny]);
}
{
let result: angular.IPromise<{[id: string]: any;}>;
result = $q.all({a: promiseAny, b: promiseAny});
}
{
let result: angular.IPromise<{a: number; b: string;}>;
result = $q.all<{a: number; b: string;}>({a: promiseAny, b: promiseAny});
}
// $q.defer
{
let result: angular.IDeferred<TResult>;
result = $q.defer<TResult>();
}
// $q.reject
{
let result: angular.IPromise<any>;
result = $q.reject();
result = $q.reject('');
}
// $q.when
{
let result: angular.IPromise<void>;
result = $q.when();
}
{
let result: angular.IPromise<TResult>;
result = $q.when<TResult>(tResult);
result = $q.when<TResult>(promiseTResult);
}
}
var httpFoo: ng.IHttpPromise<number>;
httpFoo.then((x) => {
@@ -260,6 +326,104 @@ httpFoo.success((data, status, headers, config) => {
hs["content-type"].charAt(1);
});
// Deferred signature tests
module TestDeferred {
var any: any;
interface TResult {
a: number;
b: string;
c: boolean;
}
var tResult: TResult;
var deferred: angular.IDeferred<TResult>;
// deferred.resolve
{
let result: void;
result = <void>deferred.resolve();
result = <void>deferred.resolve(tResult);
}
// deferred.reject
{
let result: void;
result = deferred.reject();
result = deferred.reject(any);
}
// deferred.notify
{
let result: void;
result = deferred.notify();
result = deferred.notify(any);
}
// deferred.promise
{
let result: angular.IPromise<TResult>;
result = deferred.promise;
}
}
// Promise signature tests
module TestPromise {
var result: any;
var any: any;
interface TResult {
a: number;
b: string;
c: boolean;
}
interface TOther {
d: number;
e: string;
f: boolean;
}
var tresult: TResult;
var tresultPromise: ng.IPromise<TResult>;
var tother: TOther;
var totherPromise: ng.IPromise<TOther>;
var promise: angular.IPromise<TResult>;
// promise.then
result = <angular.IPromise<any>>promise.then((result) => any);
result = <angular.IPromise<any>>promise.then((result) => any, (any) => any);
result = <angular.IPromise<any>>promise.then((result) => any, (any) => any, (any) => any);
result = <angular.IPromise<TResult>>promise.then((result) => result);
result = <angular.IPromise<TResult>>promise.then((result) => result, (any) => any);
result = <angular.IPromise<TResult>>promise.then((result) => result, (any) => any, (any) => any);
result = <angular.IPromise<TResult>>promise.then((result) => tresultPromise);
result = <angular.IPromise<TResult>>promise.then((result) => tresultPromise, (any) => any);
result = <angular.IPromise<TResult>>promise.then((result) => tresultPromise, (any) => any, (any) => any);
result = <angular.IPromise<TOther>>promise.then((result) => tother);
result = <angular.IPromise<TOther>>promise.then((result) => tother, (any) => any);
result = <angular.IPromise<TOther>>promise.then((result) => tother, (any) => any, (any) => any);
result = <angular.IPromise<TOther>>promise.then((result) => totherPromise);
result = <angular.IPromise<TOther>>promise.then((result) => totherPromise, (any) => any);
result = <angular.IPromise<TOther>>promise.then((result) => totherPromise, (any) => any, (any) => any);
// promise.catch
result = <angular.IPromise<any>>promise.catch((err) => any);
result = <angular.IPromise<TResult>>promise.catch((err) => tresult);
result = <angular.IPromise<TOther>>promise.catch((err) => tother);
// promise.finally
result = <angular.IPromise<TResult>>promise.finally(() => any);
result = <angular.IPromise<TResult>>promise.finally(() => tresult);
result = <angular.IPromise<TResult>>promise.finally(() => tother);
}
function test_angular_forEach() {
var values: { [key: string]: string } = { name: 'misko', gender: 'male' };
var log: string[] = [];
@@ -275,6 +439,45 @@ var scope: ng.IScope = element.scope();
var isolateScope: ng.IScope = element.isolateScope();
// $timeout signature tests
module TestTimeout {
interface TResult {
a: number;
b: string;
c: boolean;
}
var fnTResult: (...args: any[]) => TResult;
var promiseAny: angular.IPromise<any>;
var $timeout: angular.ITimeoutService;
// $timeout
{
let result: angular.IPromise<any>;
result = $timeout();
}
{
let result: angular.IPromise<void>;
result = $timeout(1);
result = $timeout(1, true);
}
{
let result: angular.IPromise<TResult>;
result = $timeout(fnTResult);
result = $timeout(fnTResult, 1);
result = $timeout(fnTResult, 1, true);
result = $timeout(fnTResult, 1, true, 1);
result = $timeout(fnTResult, 1, true, 1, '');
result = $timeout(fnTResult, 1, true, 1, '', true);
}
// $timeout.cancel
{
let result: boolean;
result = $timeout.cancel();
result = $timeout.cancel(promiseAny);
}
}
function test_IAttributes(attributes: ng.IAttributes){
return attributes;
@@ -285,7 +488,7 @@ test_IAttributes({
$addClass: function (classVal){},
$removeClass: function(classVal){},
$set: function(key, value){},
$observe: function(name, fn){
$observe: function(name: any, fn: any){
return fn;
},
$attr: {}
Vendored Executable → Regular
+27 -22
View File
@@ -237,8 +237,8 @@ declare module angular {
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;
identity<T>(arg?: T): T;
injector(modules?: any[], strictDi?: boolean): auto.IInjectorService;
isArray(value: any): boolean;
isDate(value: any): boolean;
isDefined(value: any): boolean;
@@ -421,9 +421,9 @@ declare module angular {
/**
* Converts an attribute name (e.g. dash/colon/underscore-delimited string, optionally prefixed with x- or data-) to its normalized, camelCase form.
*
*
* Also there is special case for Moz prefix starting with upper case letter.
*
*
* For further information check out the guide on @see https://docs.angularjs.org/guide/directive#matching-directives
*/
$normalize(name: string): void;
@@ -453,7 +453,7 @@ declare module angular {
* following compilation. The observer is then invoked whenever the
* interpolated value changes.
*/
$observe(name: string, fn: (value?: any) => any): Function;
$observe<T>(name: string, fn: (value?: T) => any): Function;
/**
* A map of DOM element attribute names to the normalized name. This is needed
@@ -617,12 +617,12 @@ declare module angular {
$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<T>(watchExpression: string, listener?: (newValue: T, oldValue: T, 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;
$watch<T>(watchExpression: (scope: IScope) => T, listener?: (newValue: T, oldValue: T, 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;
$watchCollection<T>(watchExpression: string, listener: (newValue: T, oldValue: T, scope: IScope) => any): Function;
$watchCollection<T>(watchExpression: (scope: IScope) => T, listener: (newValue: T, oldValue: T, 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;
@@ -725,8 +725,9 @@ declare module angular {
// see http://docs.angularjs.org/api/ng.$timeout
///////////////////////////////////////////////////////////////////////////
interface ITimeoutService {
(func: Function, delay?: number, invokeApply?: boolean): IPromise<any>;
cancel(promise: IPromise<any>): boolean;
(delay?: number, invokeApply?: boolean): IPromise<void>;
<T>(fn: (...args: any[]) => T, delay?: number, invokeApply?: boolean, ...args: any[]): IPromise<T>;
cancel(promise?: IPromise<any>): boolean;
}
///////////////////////////////////////////////////////////////////////////
@@ -862,7 +863,7 @@ declare module angular {
warn: ILogCall;
}
interface ILogProvider {
interface ILogProvider extends IServiceProvider {
debugEnabled(): boolean;
debugEnabled(enabled: boolean): ILogProvider;
}
@@ -996,9 +997,10 @@ declare module angular {
* See http://docs.angularjs.org/api/ng/service/$q
*/
interface IQService {
new (resolver: (resolve: IQResolveReject<any>) => any): IPromise<any>;
new (resolver: (resolve: IQResolveReject<any>, reject: IQResolveReject<any>) => any): IPromise<any>;
new <T>(resolver: (resolve: IQResolveReject<T>) => any): IPromise<T>;
new <T>(resolver: (resolve: IQResolveReject<T>, reject: IQResolveReject<any>) => any): IPromise<T>;
<T>(resolver: (resolve: IQResolveReject<T>) => any): IPromise<T>;
<T>(resolver: (resolve: IQResolveReject<T>, reject: IQResolveReject<any>) => any): IPromise<T>;
/**
* Combines multiple promises into a single promise that is resolved when all of the input promises are resolved.
@@ -1007,7 +1009,7 @@ declare module angular {
*
* @param promises An array of promises.
*/
all(promises: IPromise<any>[]): IPromise<any[]>;
all<T>(promises: IPromise<any>[]): IPromise<T[]>;
/**
* Combines multiple promises into a single promise that is resolved when all of the input promises are resolved.
*
@@ -1016,6 +1018,7 @@ declare module angular {
* @param promises A hash of promises.
*/
all(promises: { [id: string]: IPromise<any>; }): IPromise<{ [id: string]: any; }>;
all<T extends {}>(promises: { [id: string]: IPromise<any>; }): IPromise<T>;
/**
* Creates a Deferred object which represents a task which will finish in the future.
*/
@@ -1060,7 +1063,7 @@ declare module angular {
*
* 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<TResult>(finallyCallback: () => any): IPromise<TResult>;
finally(finallyCallback: () => any): IPromise<T>;
}
interface IDeferred<T> {
@@ -1156,7 +1159,7 @@ declare module angular {
*
* @param key the key of the data to be retrieved
*/
get(key: string): any;
get<T>(key: string): T;
/**
* Removes an entry from the Cache object.
@@ -1227,8 +1230,8 @@ declare module angular {
///////////////////////////////////////////////////////////////////////////
interface IControllerService {
// Although the documentation doesn't state this, locals are optional
(controllerConstructor: Function, locals?: any): any;
(controllerName: string, locals?: any): any;
(controllerConstructor: Function, locals?: any, bindToController?: any): any;
(controllerName: string, locals?: any, bindToController?: any): any;
}
interface IControllerProvider extends IServiceProvider {
@@ -1540,6 +1543,8 @@ declare module angular {
interface ISCEDelegateProvider extends IServiceProvider {
resourceUrlBlacklist(blacklist: any[]): void;
resourceUrlWhitelist(whitelist: any[]): void;
resourceUrlBlacklist(): any[];
resourceUrlWhitelist(): any[];
}
/**
@@ -1585,7 +1590,7 @@ declare module angular {
scope: IScope,
instanceElement: IAugmentedJQuery,
instanceAttributes: IAttributes,
controller: any,
controller: {},
transclude: ITranscludeFunction
): void;
}
@@ -1680,9 +1685,9 @@ declare module angular {
interface IInjectorService {
annotate(fn: Function): string[];
annotate(inlineAnnotatedFunction: any[]): string[];
get(name: string): any;
get<T>(name: string): T;
has(name: string): boolean;
instantiate(typeConstructor: Function, locals?: any): any;
instantiate<T>(typeConstructor: Function, locals?: any): T;
invoke(inlineAnnotatedFunction: any[]): any;
invoke(func: Function, context?: any, locals?: any): any;
}
+25
View File
@@ -0,0 +1,25 @@
/// <reference path="angulartics.d.ts" />
/// <reference path="../angularjs/angular.d.ts" />
module Analytics {
angular.module("angulartics.app", ["angulartics"])
.config(["$analyticsProvider", ($analyticsProvider: Angulartics.IAnalyticsServiceProvider) => {
angulartics.waitForVendorApi("location", 1000, (message: string) => {
console.log(message);
});
$analyticsProvider.virtualPageviews(false);
$analyticsProvider.firstPageview(false);
$analyticsProvider.withAutoBase(true);
$analyticsProvider.developerMode(true);
$analyticsProvider.registerEventTrack((action: string, properties?: any) => {
console.log(action);
});
$analyticsProvider.registerPageTrack((path: string, locationObj: ng.ILocationService) => {
console.log("viewed " + path);
});
}]);
}
+39
View File
@@ -0,0 +1,39 @@
// Type definitions for Angulartics v0.19.2
// Project: http://luisfarzati.github.io/angulartics/
// Definitions by: Steven Fan <https://github.com/stevenfan>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
interface Angulartics {
waitForVendorApi(objectName: string, delay: number, containsField?: any, registerFn?: any, onTimeout?: boolean): void;
}
declare module Angulartics {
interface IAnalyticsService {
eventTrack(eventName: string, properties?: any): any;
pageTrack(path: string, location?: ng.ILocationService): any;
setAlias(alias: string): any;
setUsername(username: string): any;
setUserProperties(properties: any): any;
setSuperProperties(properties: any): any;
}
interface IAnalyticsServiceProvider extends angular.IServiceProvider {
virtualPageviews(value: boolean): void;
firstPageview(value: boolean): void;
withBase(value: boolean): void;
withAutoBase(value: boolean): void;
developerMode(value: boolean): void;
registerPageTrack(callback: (path: string, location?: ng.ILocationService) => any): void;
registerEventTrack(callback: (eventName: string, properties?: any) => any): void;
registerSetAlias(callback: (alias: string) => any): void
registerSetUsername(callback: (username: string) => any): void
registerSetUserProperties(callback: (userProperties: any) => any): void
registerSetSuperProperties(callback: (superProperties: any) => any): void
}
}
declare var angulartics:Angulartics;
+146
View File
@@ -0,0 +1,146 @@
///<reference path="apn.d.ts"/>
import apn = require("apn");
//Hand made TypeScript tests
//==========================
//Create with a hex string
var device1 = new apn.Device("ca11ab1e");
//Create with a Buffer
var device2 = new apn.Device(new Buffer("ca55e77e"));
//Create the notification
var notification = new apn.Notification();
notification.alert = {
title: "The Title",
body: "This is the body",
};
notification.badge = 5;
//Fluid api
notification.setAlertTitle("The Title")
.setAlertText("This is the body")
.setLaunchImage("LaunchImage");
//Establish the connection
var connection = new apn.Connection({
cert: "path/to/cert.pem",
key: "path/to/cert.pem"
});
//Testing some specialized event listeners
connection.on("error", (error) => {
console.log("push error", error.name, error.message);
});
connection.on("transmissionError", (errorCode, notification, device) => {
console.log("push failed", errorCode, "notification", notification.alert, "device id: ", device.toString());
});
//Send it using hex string
connection.pushNotification(notification, "ba5eba11");
//Send it using Buffer
connection.pushNotification(notification, new Buffer("5ca1ab1e"));
//Send it using Device
connection.pushNotification(notification, device1);
//Connecting to feedback service
var feedbackService = new apn.Feedback({
cert: "path/to/cert.pem",
key: "path/to/cert.pem",
interval: 0
});
feedbackService.on("error", (error:Error) => {
console.log("push feedback error", error.name, error.message);
});
function processFeedbackData(device:apn.Device, time:number) {
}
feedbackService.on("feedback", (feedbackData) => {
feedbackData.forEach((data) => {
processFeedbackData(data.device, data.time);
})
});
feedbackService.start();
//Original examples from apn package
//==================================
//sending-to-multiple-devices.js
//------------------------------
var tokens = ["<insert token here>", "<insert token here>"];
if(tokens[0] === "<insert token here>") {
console.log("Please set token to a valid device token for the push notification service");
process.exit();
}
// Create a connection to the service using mostly default parameters.
var service = new apn.connection({ production: false });
service.on("connected", function() {
console.log("Connected");
});
service.on("transmitted", function(notification, device) {
console.log("Notification transmitted to:" + device.token.toString("hex"));
});
service.on("transmissionError", function(errCode, notification, device) {
console.error("Notification caused error: " + errCode + " for device ", device, notification);
if (errCode === 8) {
console.log("A error code of 8 indicates that the device token is invalid. This could be for a number of reasons - are you using the correct environment? i.e. Production vs. Sandbox");
}
});
service.on("timeout", function () {
console.log("Connection Timeout");
});
service.on("disconnected", function() {
console.log("Disconnected from APNS");
});
service.on("socketError", console.error);
// If you plan on sending identical paylods to many devices you can do something like this.
function pushNotificationToMany() {
console.log("Sending the same notification each of the devices with one call to pushNotification.");
var note = new apn.notification();
note.setAlertText("Hello, from node-apn!");
note.badge = 1;
service.pushNotification(note, tokens);
}
pushNotificationToMany();
// If you have a list of devices for which you want to send a customised notification you can create one and send it to and individual device.
function pushSomeNotifications() {
console.log("Sending a tailored notification to %d devices", tokens.length);
tokens.forEach(function(token, i) {
var note = new apn.notification();
note.setAlertText("Hello, from node-apn! You are number: " + i);
note.badge = i;
service.pushNotification(note, token);
});
}
pushSomeNotifications();
//feedback.js
//-----------
function handleFeedback(feedbackData:apn.FeedbackData[]) {
feedbackData.forEach(function(feedbackItem) {
console.log("Device: " + feedbackItem.device.toString() + " has been unreachable, since: " + feedbackItem.time);
});
}
// Setup a connection to the feedback service using a custom interval (10 seconds)
var feedback = new apn.feedback({ production: false, interval: 10 });
feedback.on("feedback", handleFeedback);
feedback.on("feedbackError", console.error);
+364
View File
@@ -0,0 +1,364 @@
// Type definitions for node-apn
// Project: https://github.com/argon/node-apn
// Definitions by: Zenorbi <https://github.com/zenorbi>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
///<reference path="../node/node.d.ts"/>
declare module "apn" {
import events = require("events");
import net = require("net");
export interface ConnectionOptions {
/**
* The filename of the connection certificate to load from disk, or a Buffer/String containing the certificate data. (Defaults to: `cert.pem`)
*/
cert?:string|Buffer;
/**
* The filename of the connection key to load from disk, or a Buffer/String containing the key data. (Defaults to: `key.pem`)
*/
key?:string|Buffer;
/**
* An array of trusted certificates. Each element should contain either a filename to load, or a Buffer/String (in PEM format) to be used directly. If this is omitted several well known "root" CAs will be used. - You may need to use this as some environments don't include the CA used by Apple (entrust_2048).
*/
ca?:(string|Buffer)[];
/**
* File path for private key, certificate and CA certs in PFX or PKCS12 format, or a Buffer containing the PFX data. If supplied will always be used instead of certificate and key above.
*/
pfx?:string|Buffer;
/**
* The passphrase for the connection key, if required
*/
passphrase?:string;
/**
* Specifies which environment to connect to: Production (if true) or Sandbox - The hostname will be set automatically. (Defaults to NODE_ENV == "production", i.e. false unless the NODE_ENV environment variable is set accordingly)
*/
production?:boolean;
/**
* Enable when you are using a VoIP certificate to enable paylods up to 4096 bytes.
*/
voip?:boolean;
/**
* Gateway port (Defaults to: `2195`)
*/
port?:number;
/**
* Reject Unauthorized property to be passed through to tls.connect() (Defaults to `true`)
*/
rejectUnauthorized?:boolean;
/**
* Number of notifications to cache for error purposes (See "Handling Errors" below, (Defaults to: `1000`)
*/
cacheLength?:number;
/**
* Whether the cache should grow in response to messages being lost after errors. (Will still emit a 'cacheTooSmall' event) (Defaults to: `true`)
*/
autoAdjustCache?:boolean;
/**
* The maximum number of connections to create for sending messages. (Defaults to: `1`)
*/
maxConnections?:number;
/**
* The duration of time the module should wait, in milliseconds, when trying to establish a connection to Apple before failing. 0 = Disabled. {Defaults to: `10000`}
*/
connectTimeout?:number;
/**
* The duration the socket should stay alive with no activity in milliseconds. 0 = Disabled. (Defaults to: `3600000` - 1h)
*/
connectionTimeout?:number;
/**
* The maximum number of connection failures that will be tolerated before `apn` will "terminate". (Defaults to: 10)
*/
connectionRetryLimit?:number;
/**
* Whether to buffer notifications and resend them after failure. (Defaults to: `true`)
*/
buffersNotifications?:number;
/**
* Whether to aggresively empty the notification buffer while connected - if set to true node-apn may enter a tight loop under heavy load while delivering notifications. (Defaults to: `false`)
*/
fastMode?:boolean;
}
export class Connection extends events.EventEmitter {
constructor(options:ConnectionOptions);
/**
* This is the business end of the module. Create a `Notification` object and pass it in, along with a single recipient or an array of them and node-apn will take care of the rest, delivering the notification to each recipient.
*
* A "recipient" is either a `Device` object, a `String`, or a `Buffer` containing the device token. `Device` objects are used internally and will be created if necessary. Where applicable, all events will return a `Device` regardless of the type passed to this method.
*/
pushNotification(notification:Notification, recipient:Device|string|Buffer|(Device|string|Buffer)[]):void;
/**
* Used to manually adjust the "cacheLength" property in the options. This is ideal if you choose to use the `cacheTooSmall` event to tweak your environment. It is safe for increasing and reducing cache size.
*/
setCacheLength(newLength:number):void;
/**
* Indicate to node-apn that when the queue of pending notifications is fully drained that it should close all open connections. This will mean that if there are no other pending resources (open sockets, running timers, etc.) the application will terminate. If notifications are pushed after the connection has completely shutdown a new connection will be established and, if applicable, `shutdown` will need to be called again.
*/
shutdown():void;
/**
* Emitted when an error occurs during initialisation of the module, usually due to a problem with the keys and certificates.
*/
on(event: "error", listener: (error:Error) => void):Connection;
/**
* Emitted when the connection socket experiences an error. This may be useful for debugging but no action should be necessary.
*/
on(event: "socketError", listener: (error:Error) => void):Connection;
/**
* Emitted when a notification has been sent to Apple - not a guarantee that it has been accepted by Apple, an error relating to it may occur later on. A notification may also be "transmitted" several times if a preceding notification caused an error requiring retransmission.
*/
on(event: "transmitted", listener: (notification:Notification, decive:Device) => void):Connection;
/**
* Emitted when all pending notifications have been transmitted to Apple and the pending queue is empty. This may be called more than once if a notification error occurs and notifications must be re-sent.
*/
on(event: "completed", listener: () => void):Connection;
/**
* Emitted when Apple returns a notification as invalid but the notification has already been expunged from the cache - usually due to high throughput and indicates that notifications will be getting lost. The parameter is an estimate of how many notifications have been lost. You should experiment with increasing the cache size or enabling ```autoAdjustCache``` if you see this frequently.
*
* **Note**: With ```autoAdjustCache``` enabled this event will still be emitted when an adjustment is triggered.
*/
on(event: "cacheTooSmall", listener: (sizeDifference:number) => void):Connection;
/**
* Emitted when a connection to Apple is successfully established. The parameter indicates the number of open connections. No action is required as the connection is managed internally.
*/
on(event: "connected", listener: (openSockets:net.Socket[]) => void):Connection;
/**
* Emitted when the connection to Apple has been closed, this could be for numerous reasons, for example an error has occurred or the connection has timed out. The parameter is the same as for `connected` and again, no action is required.
*/
on(event: "disconnected", listener: (openSockets:net.Socket[]) => void):Connection;
/**
* Emitted when the connectionTimeout option has been specified and no activity has occurred on a socket for a specified duration. The socket will be closed immediately after this event and a `disconnected` event will also be emitted.
*/
on(event: "timeout", listener: () => void):Connection;
/**
* Emitted when a message has been received from Apple stating that a notification was invalid or if an internal error occurred before that notification could be pushed to Apple. If the notification is still in the cache it will be passed as the second argument, otherwise null. Where possible the associated `Device` object will be passed as a third parameter, however in cases where the token supplied to the module cannot be parsed into a `Buffer` the supplied value will be returned.
* Error codes smaller than 512 correspond to those returned by Apple as per their [docs][errors]. Other errors are applicable to `node-apn` itself. Definitions can be found in `lib/errors.js`.
*/
on(event: "transmissionError", listener: (errorCode:number, notification:Notification, device:Device|Buffer) => void):Connection;
on(event: string, listener: Function):Connection;
}
export interface NotificationAlertOptions {
title?:string;
body:string;
"title-loc-key"?:string;
"title-loc-args"?:string[];
"action-loc-key"?:string;
"loc-key"?:string;
"loc-args"?:string[];
"launch-image"?:string;
}
export class Notification {
/**
* The maximum number of retries which should be performed when sending a notification if an error occurs. A value of 0 will only allow one attempt at sending (0 retries). Set to -1 to disable (default).
*/
public retryLimit:number;
/**
* The UNIX timestamp representing when the notification should expire. This does not contribute to the 2048 byte payload size limit. An expiry of 0 indicates that the notification expires immediately.
*/
public expiry:number;
/**
* From Apple's Documentation, Provide one of the following values:
*
* - 10 - The push message is sent immediately. (Default)
* > The push notification must trigger an alert, sound, or badge on the device. It is an error use this priority for a push that contains only the content-available key.
* - 5 - The push message is sent at a time that conserves power on the device receiving it.
*/
public priority:number;
/**
* The encoding to use when transmitting the notification to APNS, defaults to `utf8`. `utf16le` is also possible but as each character is represented by a minimum of 2 bytes, will at least halve the possible payload size. If in doubt leave as default.
*/
public encoding:string;
/**
* This object represents the root JSON object that you can add custom information for your application to. The properties below will only be added to the payload (under `aps`) when the notification is prepared for sending.
*/
public payload:any;
/**
* The value to specify for `payload.aps.badge`
*/
public badge:number;
/**
* The value to specify for `payload.aps.sound`
*/
public sound:string;
/**
* The value to specify for `payload.aps.alert` can be either a `String` or an `Object` as outlined by the payload documentation.
*/
public alert:string|NotificationAlertOptions;
/**
* Setting this to true will specify "content-available" in the payload when it is compiled.
*/
public newsstandAvailable:boolean;
/**
* Setting this to true will specify "content-available" in the payload when it is compiled.
*/
public contentAvailable:boolean;
/**
* The value to specify for the `mdm` field where applicable.
*/
public mdm:string|Object;
/**
* The value to specify for `payload.aps['url-args']`. This used for Safari Push NOtifications and should be an array of values in accordance with the Web Payload Documentation.
*/
public urlArgs:string[];
/**
* When this parameter is set and `notification#trim()` is called it will attempt to truncate the string at the nearest space.
*/
public truncateAtWordEnd:boolean;
/**
* You can optionally pass in an object representing the payload, or configure properties on the returned object.
*/
constructor(payload?:any);
/**
* Set the `aps.alert` text body. This will use the most space-efficient means.
*/
setAlertText(alertText:string):Notification;
/**
* Set the `title` property of the `aps.alert` object - used with Safari Push Notifications
*/
setAlertTitle(alertTitle:string):Notification;
/**
* Set the `action` property of the `aps.alert` object - used with Safari Push Notifications
*/
setAlertAction(alertAction:string):Notification;
/**
* Set the `action-loc-key` property of the `aps.alert` object.
*/
setActionLocKey(key:string):Notification;
/**
* Set the `loc-key` property of the `aps.alert` object.
*/
setLocKey(key:string):Notification;
/**
* Set the `loc-args` property of the `aps.alert` object.
*/
setLocArgs(args:string[]):Notification;
/**
* Set the `launch-image` property of the `aps.alert` object.
*/
setLaunchImage(image:string):Notification;
/**
* Set the `mdm` property on the payload.
*/
setMDM(mdm:string|Object):Notification;
/**
* Set the `content-available` property of the `aps` object.
*/
setNewsstandAvailable(available:boolean):Notification;
/**
* Set the `content-available` property of the `aps` object.
*/
setContentAvailable(available:boolean):Notification;
/**
* Set the `url-args` property of the `aps` object.
*/
setUrlArgs(urlArgs:string[]):Notification;
/**
* Attempt to automatically trim the notification alert text body to meet the payload size limit of 2048 bytes.
*/
trim():number;
}
export class Device {
public token:Buffer;
/**
* `deviceToken` can be a `Buffer` or a `String` containing a "hex" representation of the token. Throws an error if the deviceToken supplied is invalid.
*/
constructor(deviceToken:string|Buffer);
}
export interface FeedbackOptions {
/**
* The filename of the connection certificate to load from disk, or a Buffer/String containing the certificate data. (Defaults to: `cert.pem`)
*/
cert?:string|Buffer;
/**
* The filename of the connection key to load from disk, or a Buffer/String containing the key data. (Defaults to: `key.pem`)
*/
key?:string|Buffer;
/**
* An array of trusted certificates. Each element should contain either a filename to load, or a Buffer/String (in PEM format) to be used directly. If this is omitted several well known "root" CAs will be used. - You may need to use this as some environments don't include the CA used by Apple (entrust_2048).
*/
ca?:(string|Buffer)[];
/**
* File path for private key, certificate and CA certs in PFX or PKCS12 format, or a Buffer containing the PFX data. If supplied will be used instead of certificate and key above.
*/
pfx?:string|Buffer;
/**
* The passphrase for the connection key, if required
*/
passphrase?:string;
/**
* Specifies which environment to connect to: Production (if true) or Sandbox - The hostname will be set automatically. (Defaults to NODE_ENV == "production", i.e. false unless the NODE_ENV environment variable is set accordingly)
*/
production?:boolean;
/**
* Feedback server port (Defaults to: `2196`)
*/
port?:number;
/**
* Sets the behaviour for triggering the `feedback` event. When `true` the event will be triggered once per connection with an array of timestamp and device token tuples. Otherwise a `feedback` event will be emitted once per token received. (Defaults to: true)
*/
batchFeedback?:boolean;
/**
* The maximum number of tokens to pass when emitting the event - a value of 0 will cause all tokens to be passed after connection is reset. After this number of tokens are received the `feedback` event will be emitted. (Only applies when `batchFeedback` is enabled)
*/
batchSize?:number;
/**
* How often to automatically poll the feedback service. Set to `0` to disable. (Defaults to: `3600`)
*/
interval?:number;
}
export interface FeedbackData {
time:number;
device:Device;
}
/**
* Connection to the Apple Push Notification Feedback Service and if `interval` isn't disabled automatically begins polling the service. Many of the options are the same as `apn.Connection()`
*/
export class Feedback {
constructor(options:FeedbackOptions);
/**
* Trigger a query of the feedback service. If `interval` is non-zero then this method will be called automatically.
*/
start():void;
/**
* You can cancel the interval by calling `feedback.cancel()`. If you do not wish to have the service automatically queried then set `interval` to 0 and use `feedback.start()` to manually invoke it one time.
*/
cancel():void;
/**
* Emitted when an error occurs initialising the module. Usually caused by failing to load the certificates.
*/
on(event: "error", listener: (error:Error) => void):Feedback;
/**
* Emitted when an error occurs receiving or processing the feedback and in the case of a socket error occurring. These errors are usually informational and node-apn will automatically recover.
*/
on(event: "feedbackError", listener: (error:Error) => void):Feedback;
/**
* Emitted when data has been received from the feedback service, typically once per connection. `feedbackData` is an array of objects, each containing the `time` returned by the server (epoch time) and the `device` a `Buffer` containing the device token.
*/
on(event: "feedback", listener: (feedbackData:FeedbackData[]) => void):Feedback;
on(event: string, listener: Function):Feedback;
}
export enum Errors {
"noErrorsEncountered"= 0,
"processingError"= 1,
"missingDeviceToken"= 2,
"missingTopic"= 3,
"missingPayload"= 4,
"invalidTokenSize"= 5,
"invalidTopicSize"= 6,
"invalidPayloadSize"= 7,
"invalidToken"= 8,
"apnsShutdown"= 10,
"none"= 255,
"retryLimitExceeded"= 512,
"moduleInitialisationFailed"= 513,
"connectionRetryLimitExceeded"= 514, // When a connection is unable to be established. Usually because of a network / SSL error this will be emitted
"connectionTerminated"= 515
}
//Lowercase aliases
export {Connection as connection};
export {Device as device};
export {Errors as error};
export {Feedback as feedback};
export {Notification as notification};
}
+36 -4
View File
@@ -4,21 +4,25 @@
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface AutoCollectConsole {
constructor(client: Client): AutoCollectConsole;
enable(isEnabled: boolean): void;
isInitialized(): boolean;
}
interface AutoCollectExceptions {
constructor(client:Client): AutoCollectExceptions;
isInitialized(): boolean;
enable(isEnabled:boolean): void;
}
interface AutoCollectPerformance {
constructor(client: Client): AutoCollectPerformance;
enable(isEnabled: boolean): void;
isInitialized(): boolean;
}
interface AutoCollectRequests {
constructor(client: Client): AutoCollectRequests;
enable(isEnabled: boolean): void;
isInitialized(): boolean;
}
@@ -85,14 +89,17 @@ declare module ContractsModule {
sampleRate: string;
internalSdkVersion: string;
internalAgentVersion: string;
constructor(): ContextTagKeys;
}
interface Domain {
ver: number;
properties: any;
constructor(): Domain;
}
interface Data<TDomain extends ContractsModule.Domain> {
baseType: string;
baseData: TDomain;
constructor(): Data<TDomain>;
}
interface Envelope {
ver: number;
@@ -112,18 +119,21 @@ declare module ContractsModule {
[key: string]: string;
};
data: Data<Domain>;
constructor(): Envelope;
}
interface EventData extends ContractsModule.Domain {
ver: number;
name: string;
properties: any;
measurements: any;
constructor(): EventData;
}
interface MessageData extends ContractsModule.Domain {
ver: number;
message: string;
severityLevel: ContractsModule.SeverityLevel;
properties: any;
constructor(): MessageData;
}
interface ExceptionData extends ContractsModule.Domain {
ver: number;
@@ -134,6 +144,7 @@ declare module ContractsModule {
crashThreadId: number;
properties: any;
measurements: any;
constructor(): ExceptionData;
}
interface StackFrame {
level: number;
@@ -141,6 +152,7 @@ declare module ContractsModule {
assembly: string;
fileName: string;
line: number;
constructor(): StackFrame;
}
interface ExceptionDetails {
id: number;
@@ -150,6 +162,7 @@ declare module ContractsModule {
hasFullStack: boolean;
stack: string;
parsedStack: StackFrame[];
constructor(): ExceptionDetails;
}
interface DataPoint {
name: string;
@@ -159,11 +172,13 @@ declare module ContractsModule {
min: number;
max: number;
stdDev: number;
constructor(): DataPoint;
}
interface MetricData extends ContractsModule.Domain {
ver: number;
metrics: DataPoint[];
properties: any;
constructor(): MetricData;
}
interface PageViewData extends ContractsModule.EventData {
ver: number;
@@ -172,6 +187,7 @@ declare module ContractsModule {
duration: string;
properties: any;
measurements: any;
constructor(): PageViewData;
}
interface PageViewPerfData extends ContractsModule.PageViewData {
ver: number;
@@ -185,6 +201,7 @@ declare module ContractsModule {
domProcessing: string;
properties: any;
measurements: any;
constructor(): PageViewPerfData;
}
interface RemoteDependencyData extends ContractsModule.Domain {
ver: number;
@@ -202,6 +219,7 @@ declare module ContractsModule {
commandName: string;
dependencyTypeName: string;
properties: any;
constructor(): RemoteDependencyData;
}
interface AjaxCallData extends ContractsModule.PageViewData {
ver: number;
@@ -218,6 +236,7 @@ declare module ContractsModule {
success: boolean;
properties: any;
measurements: any;
constructor(): AjaxCallData;
}
interface RequestData extends ContractsModule.Domain {
ver: number;
@@ -231,10 +250,12 @@ declare module ContractsModule {
url: string;
properties: any;
measurements: any;
constructor(): RequestData;
}
interface SessionStateData extends ContractsModule.Domain {
ver: number;
state: ContractsModule.SessionState;
constructor(): SessionStateData;
}
interface PerformanceCounterData extends ContractsModule.Domain {
ver: number;
@@ -248,6 +269,7 @@ declare module ContractsModule {
stdDev: number;
value: number;
properties: any;
constructor(): PerformanceCounterData;
}
}
@@ -309,10 +331,14 @@ interface Client {
* Log a numeric value that is not associated with a specific event. Typically used to send regular reports of performance indicators.
* To send a single measurement, use just the first two parameters. If you take measurements very frequently, you can reduce the
* telemetry bandwidth by aggregating multiple measurements and sending the resulting average at intervals.
* @param name A string that identifies the metric.
* @param value The value of the metric
* @param name A string that identifies the metric.
* @param value The value of the metric
* @param count the number of samples used to get this value
* @param min the min sample for this set
* @param max the max sample for this set
* @param stdDev the standard deviation of the set
*/
trackMetric(name: string, value: number): void;
trackMetric(name: string, value: number, count?:number, min?: number, max?: number, stdDev?: number): void;
trackRequest(request: any /* http.ServerRequest */, response: any /* http.ServerResponse */, properties?: {
[key: string]: string;
}): void;
@@ -381,10 +407,16 @@ declare class ApplicationInsights {
private static _performance;
private static _requests;
private static _isStarted;
/**
* Initializes a client with the given instrumentation key, if this is not specified, the value will be
* read from the environment variable APPINSIGHTS_INSTRUMENTATIONKEY
* @returns {ApplicationInsights/Client} a new client
*/
static getClient(instrumentationKey?: string): Client;
/**
* Initializes the default client of the client and sets the default configuration
* @param instrumentationKey the instrumentation key to use. Optional, if this is not specified, the value will be
* read from the environment variable APPINSIGHTS_INSTRUMENTATION_KEY
* read from the environment variable APPINSIGHTS_INSTRUMENTATIONKEY
* @returns {ApplicationInsights} this interface
*/
static setup(instrumentationKey?: string): typeof ApplicationInsights;
+121 -16
View File
@@ -5,8 +5,19 @@ var fs, path;
function callback() {}
async.map(['file1', 'file2', 'file3'], fs.stat, function (err, results) { });
async.mapSeries(['file1', 'file2', 'file3'], fs.stat, function (err, results) { });
async.mapLimit(['file1', 'file2', 'file3'], 2, fs.stat, function (err, results) { });
async.filter(['file1', 'file2', 'file3'], path.exists, function (results) { });
async.filterSeries(['file1', 'file2', 'file3'], path.exists, function (results) { });
async.filterLimit(['file1', 'file2', 'file3'], 2, path.exists, function (results) { });
async.select(['file1', 'file2', 'file3'], path.exists, function (results) { });
async.selectSeries(['file1', 'file2', 'file3'], path.exists, function (results) { });
async.selectLimit(['file1', 'file2', 'file3'], 2, path.exists, function (results) { });
async.reject(['file1', 'file2', 'file3'], path.exists, function (results) { });
async.rejectSeries(['file1', 'file2', 'file3'], path.exists, function (results) { });
async.rejectLimit(['file1', 'file2', 'file3'], 2, path.exists, function (results) { });
async.parallel([
function () { },
@@ -25,6 +36,11 @@ async.map(data, asyncProcess, function (err, results) {
});
var openFiles = ['file1', 'file2'];
var openFilesObj = {
file1: "fileOne",
file2: "fileTwo"
}
var saveFile = function () { }
async.each(openFiles, saveFile, function (err) { });
async.eachSeries(openFiles, saveFile, function (err) { });
@@ -32,18 +48,34 @@ async.eachSeries(openFiles, saveFile, function (err) { });
var documents, requestApi;
async.eachLimit(documents, 20, requestApi, function (err) { });
async.map(['file1', 'file2', 'file3'], fs.stat, function (err, results) { });
async.filter(['file1', 'file2', 'file3'], path.exists, function (results) { });
// forEachOf* functions. May accept array or object.
function forEachOfIterator(item, key, forEachOfIteratorCallback) {
console.log("ForEach: item=" + item + ", key=" + key);
forEachOfIteratorCallback();
}
async.forEachOf(openFiles, forEachOfIterator, function (err) { });
async.forEachOf(openFilesObj, forEachOfIterator, function (err) { });
async.forEachOfSeries(openFiles, forEachOfIterator, function (err) { });
async.forEachOfSeries(openFilesObj, forEachOfIterator, function (err) { });
async.forEachOfLimit(openFiles, 2, forEachOfIterator, function (err) { });
async.forEachOfLimit(openFilesObj, 2, forEachOfIterator, function (err) { });
var process;
async.reduce([1, 2, 3], 0, function (memo, item, callback) {
var numArray = [1, 2, 3];
function reducer(memo, item, callback) {
process.nextTick(function () {
callback(null, memo + item)
});
}, function (err, result) { });
}
async.reduce(numArray, 0, reducer, function (err, result) { });
async.inject(numArray, 0, reducer, function (err, result) { });
async.foldl(numArray, 0, reducer, function (err, result) { });
async.reduceRight(numArray, 0, reducer, function (err, result) { });
async.foldr(numArray, 0, reducer, function (err, result) { });
async.detect(['file1', 'file2', 'file3'], path.exists, function (result) { });
async.detectSeries(['file1', 'file2', 'file3'], path.exists, function (result) { });
async.detectLimit(['file1', 'file2', 'file3'], 2, path.exists, function (result) { });
async.sortBy(['file1', 'file2', 'file3'], function (file, callback) {
fs.stat(file, function (err, stats) {
@@ -52,10 +84,18 @@ async.sortBy(['file1', 'file2', 'file3'], function (file, callback) {
}, function (err, results) { });
async.some(['file1', 'file2', 'file3'], path.exists, function (result) { });
async.someLimit(['file1', 'file2', 'file3'], 2, path.exists, function (result) { });
async.any(['file1', 'file2', 'file3'], path.exists, function (result) { });
async.every(['file1', 'file2', 'file3'], path.exists, function (result) { });
async.everyLimit(['file1', 'file2', 'file3'], 2, path.exists, function (result) { });
async.all(['file1', 'file2', 'file3'], path.exists, function (result) { });
async.concat(['dir1', 'dir2', 'dir3'], fs.readdir, function (err, files) { });
async.concatSeries(['dir1', 'dir2', 'dir3'], fs.readdir, function (err, files) { });
// Control Flow //
async.series([
function (callback) {
@@ -77,7 +117,6 @@ async.series<string>([
],
function (err, results) { });
async.series({
one: function (callback) {
setTimeout(function () {
@@ -173,21 +212,47 @@ async.parallel<number>({
}, 100);
},
},
function (err, results) { });
function (err, results) { });
var count = 0;
async.whilst(
function () { return count < 5; },
function (callback) {
count++;
setTimeout(callback, 1000);
async.parallelLimit({
one: function (callback) {
setTimeout(function () {
callback(null, 1);
}, 200);
},
function (err) { }
two: function (callback) {
setTimeout(function () {
callback(null, 2);
}, 100);
},
},
2,
function (err, results) { }
);
function whileFn(callback) {
count++;
setTimeout(callback, 1000);
}
function whileTest() { return count < 5; }
var count = 0;
async.whilst(whileTest, whileFn, function (err) { });
async.until(whileTest, whileFn, function (err) { });
async.doWhilst(whileFn, whileTest, function (err) { });
async.doUntil(whileFn, whileTest, function (err) { });
async.during(function (testCallback) { testCallback(new Error(), false); }, function (callback) { callback() }, function (error) { console.log(error) });
async.doDuring(function (callback) { callback() }, function (testCallback) { testCallback(new Error(), false); }, function (error) { console.log(error) });
async.forever(function (errBack) {
errBack(new Error("Not going on forever."));
},
function (error) {
console.log(error);
}
);
async.waterfall([
function (callback) {
callback(null, 'one', 'two');
@@ -279,6 +344,26 @@ q2.unshift(['task3', 'task4', 'task5'], function (error) {
console.log('Finished tasks');
});
// create a cargo object with payload 2
var cargo = async.cargo(function (tasks, callback) {
for (var i = 0; i < tasks.length; i++) {
console.log('hello ' + tasks[i].name);
}
callback();
}, 2);
// add some items
cargo.push({ name: 'foo' }, function (err) {
console.log('finished processing foo');
});
cargo.push({ name: 'bar' }, function (err) {
console.log('finished processing bar');
});
cargo.push({ name: 'baz' }, function (err) {
console.log('finished processing baz');
});
var filename = '';
async.auto({
get_data: function (callback) { },
@@ -291,6 +376,9 @@ async.auto({
email_link: ['write_file', <any>function (callback, results) { }]
});
async.retry(3, function (callback, results) { }, function (err, result) { });
async.retry({ times: 3, interval: 200 }, function (callback, results) { }, function (err, result) { });
async.parallel([
function (callback) { },
@@ -336,3 +424,20 @@ var slow_fn = function (name, callback) {
};
var fn = async.memoize(slow_fn);
fn('some name', function () {});
async.unmemoize(fn);
async.ensureAsync(function () { });
async.constant(42);
async.asyncify(function () { });
async.log(function (name, callback) {
setTimeout(function () {
callback(null, 'hello ' + name);
}, 0);
}, "world"
);
async.dir(function (name, callback) {
setTimeout(function () {
callback(null, { hello: name });
}, 1000);
}, "world");
+162 -129
View File
@@ -1,132 +1,165 @@
// Type definitions for Async 0.9.2
// Project: https://github.com/caolan/async
// Type definitions for Async 1.4.2
// Project: https://github.com/caolan/async
// Definitions by: Boris Yankov <https://github.com/borisyankov/>, Arseniy Maximov <https://github.com/kern0>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface Dictionary<T> { [key: string]: T; }
// Common interface between Arrays and Array-like objects
interface List<T> {
[index: number]: T;
length: number;
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface Dictionary<T> { [key: string]: T; }
interface ErrorCallback { (err?: Error): void; }
interface AsyncResultCallback<T> { (err: Error, result: T): void; }
interface AsyncResultArrayCallback<T> { (err: Error, results: T[]): void; }
interface AsyncResultObjectCallback<T> { (err: Error, results: Dictionary<T>): void; }
interface AsyncFunction<T> { (callback: (err: Error, result?: T) => void): void; }
interface AsyncIterator<T> { (item: T, callback: ErrorCallback): void; }
interface AsyncForEachOfIterator<T> { (item: T, key: number, callback: ErrorCallback): void; }
interface AsyncResultIterator<T, R> { (item: T, callback: AsyncResultCallback<R>): void; }
interface AsyncMemoIterator<T, R> { (memo: R, item: T, callback: AsyncResultCallback<R>): void; }
interface AsyncBooleanIterator<T> { (item: T, callback: (truthValue: boolean) => void): void; }
interface AsyncWorker<T> { (task: T, callback: ErrorCallback): void; }
interface AsyncVoidFunction { (callback: ErrorCallback): void; }
interface AsyncQueue<T> {
length(): number;
started: boolean;
running(): number;
idle(): boolean;
concurrency: number;
push(task: T, callback?: ErrorCallback): void;
push(task: T[], callback?: ErrorCallback): void;
unshift(task: T, callback?: ErrorCallback): void;
unshift(task: T[], callback?: ErrorCallback): void;
saturated: () => any;
empty: () => any;
drain: () => any;
paused: boolean;
pause(): void
resume(): void;
kill(): void;
}
interface ErrorCallback { (err?: Error): void; }
interface AsyncResultCallback<T> { (err: Error, result: T): void; }
interface AsyncResultArrayCallback<T> { (err: Error, results: T[]): void; }
interface AsyncResultObjectCallback<T> { (err: Error, results: Dictionary<T>): void; }
interface AsyncIterator<T> { (item: T, callback: ErrorCallback): void; }
interface AsyncForEachOfIterator<T> { (item: T, index: number, callback: ErrorCallback): void; }
interface AsyncResultIterator<T, R> { (item: T, callback: AsyncResultCallback<R>): void; }
interface AsyncMemoIterator<T, R> { (memo: R, item: T, callback: AsyncResultCallback<R>): void; }
interface AsyncWorker<T> { (task: T, callback: ErrorCallback): void; }
interface AsyncFunction<T> { (callback: AsyncResultCallback<T>): void; }
interface AsyncVoidFunction { (callback: ErrorCallback): void; }
interface AsyncQueue<T> {
length(): number;
concurrency: number;
started: boolean;
paused: boolean;
push(task: T, callback?: ErrorCallback): void;
push(task: T[], callback?: ErrorCallback): void;
unshift(task: T, callback?: ErrorCallback): void;
unshift(task: T[], callback?: ErrorCallback): void;
saturated: () => any;
empty: () => any;
drain: () => any;
running(): number;
idle(): boolean;
pause(): void;
resume(): void;
kill(): void;
}
interface AsyncPriorityQueue<T> {
length(): number;
concurrency: number;
started: boolean;
paused: boolean;
push(task: T, priority: number, callback?: AsyncResultArrayCallback<T>): void;
push(task: T[], priority: number, callback?: AsyncResultArrayCallback<T>): void;
saturated: () => any;
empty: () => any;
drain: () => any;
running(): number;
idle(): boolean;
pause(): void;
resume(): void;
kill(): void;
}
interface Async {
// Collections
each<T>(arr: T[], iterator: AsyncIterator<T>, callback: ErrorCallback): void;
eachSeries<T>(arr: T[], iterator: AsyncIterator<T>, callback: ErrorCallback): void;
eachLimit<T>(arr: T[], limit: number, iterator: AsyncIterator<T>, callback: ErrorCallback): void;
forEachOf<T>(obj: List<T>, iterator: AsyncForEachOfIterator<T>, callback: ErrorCallback): void;
forEachOfSeries<T>(obj: List<T>, iterator: AsyncForEachOfIterator<T>, callback: ErrorCallback): void;
forEachOfLimit<T>(obj: List<T>, limit: number, iterator: AsyncForEachOfIterator<T>, callback: ErrorCallback): void;
map<T, R>(arr: T[], iterator: AsyncResultIterator<T, R>, callback: AsyncResultArrayCallback<R>): any;
mapSeries<T, R>(arr: T[], iterator: AsyncResultIterator<T, R>, callback: AsyncResultArrayCallback<R>): any;
mapLimit<T, R>(arr: T[], limit: number, iterator: AsyncResultIterator<T, R>, callback: AsyncResultArrayCallback<R>): any;
filter<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback: (results: T[]) => any): any;
select<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback: (results: T[]) => any): any;
filterSeries<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback: (results: T[]) => any): any;
selectSeries<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback: (results: T[]) => any): any;
reject<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback: (results: T[]) => any): any;
rejectSeries<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback: (results: T[]) => any): any;
reduce<T, R>(arr: T[], memo: R, iterator: AsyncMemoIterator<T, R>, callback: AsyncResultCallback<R>): any;
inject<T, R>(arr: T[], memo: R, iterator: AsyncMemoIterator<T, R>, callback: AsyncResultCallback<R>): any;
foldl<T, R>(arr: T[], memo: R, iterator: AsyncMemoIterator<T, R>, callback: AsyncResultCallback<R>): any;
reduceRight<T, R>(arr: T[], memo: R, iterator: AsyncMemoIterator<T, R>, callback: AsyncResultCallback<R>): any;
foldr<T, R>(arr: T[], memo: R, iterator: AsyncMemoIterator<T, R>, callback: AsyncResultCallback<R>): any;
detect<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback: AsyncResultArrayCallback<T>): any;
detectSeries<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback: AsyncResultArrayCallback<T>): any;
sortBy<T, V>(arr: T[], iterator: AsyncResultIterator<T, V>, callback: AsyncResultArrayCallback<T>): any;
some<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback: AsyncResultArrayCallback<T>): any;
any<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback: AsyncResultArrayCallback<T>): any;
every<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback: (result: boolean) => any): any;
all<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback: (result: boolean) => any): any;
concat<T, R>(arr: T[], iterator: AsyncResultIterator<T, R[]>, callback: AsyncResultArrayCallback<R>): any;
concatSeries<T, R>(arr: T[], iterator: AsyncResultIterator<T, R[]>, callback: AsyncResultArrayCallback<R>): any;
// Control Flow
series<T>(tasks: Array<AsyncFunction<T>>, callback?: AsyncResultArrayCallback<T>): void;
series<T>(tasks: Dictionary<AsyncFunction<T>>, callback?: AsyncResultObjectCallback<T>): void;
parallel<T>(tasks: Array<AsyncFunction<T>>, callback?: AsyncResultArrayCallback<T>): void;
parallel<T>(tasks: Dictionary<AsyncFunction<T>>, callback?: AsyncResultObjectCallback<T>): void;
parallelLimit<T>(tasks: Array<AsyncFunction<T>>, limit: number, callback?: AsyncResultArrayCallback<T>): void;
parallelLimit<T>(tasks: Dictionary<AsyncFunction<T>>, limit: number, callback?: AsyncResultObjectCallback<T>): void;
whilst(test: () => boolean, fn: AsyncVoidFunction, callback: (err: any) => void): void;
doWhilst(fn: AsyncVoidFunction, test: () => boolean, callback: (err: any) => void): void;
until(test: () => boolean, fn: AsyncVoidFunction, callback: (err: any) => void): void;
doUntil(fn: AsyncVoidFunction, test: () => boolean, callback: (err: any) => void): void;
waterfall(tasks: Function[], callback?: (err: any, ...arguments: any[]) => void): void;
queue<T>(worker: AsyncWorker<T>, concurrency: number): AsyncQueue<T>;
priorityQueue<T>(worker: AsyncWorker<T>, concurrency: number): AsyncPriorityQueue<T>;
auto(tasks: any, callback?: AsyncResultArrayCallback<any>): void;
iterator(tasks: Function[]): Function;
apply(fn: Function, ...arguments: any[]): AsyncFunction<any>;
nextTick(callback: Function): void;
times<R> (n: number, iterator: AsyncResultIterator<number, R>, callback: AsyncResultArrayCallback<R>): void;
timesSeries<R> (n: number, iterator: AsyncResultIterator<number, R>, callback: AsyncResultArrayCallback<R>): void;
// Utils
memoize(fn: Function, hasher?: Function): Function;
unmemoize(fn: Function): Function;
log(fn: Function, ...arguments: any[]): void;
dir(fn: Function, ...arguments: any[]): void;
noConflict(): Async;
}
declare var async: Async;
declare module "async" {
export = async;
}
interface AsyncPriorityQueue<T> {
length(): number;
concurrency: number;
started: boolean;
paused: boolean;
push(task: T, priority: number, callback?: AsyncResultArrayCallback<T>): void;
push(task: T[], priority: number, callback?: AsyncResultArrayCallback<T>): void;
saturated: () => any;
empty: () => any;
drain: () => any;
running(): number;
idle(): boolean;
pause(): void;
resume(): void;
kill(): void;
}
interface AsyncCargo {
length(): number;
payload: number;
push(task: any, callback? : Function): void;
push(task: any[], callback? : Function): void;
saturated(): void;
empty(): void;
drain(): void;
idle(): boolean;
pause(): void;
resume(): void;
kill(): void;
}
interface Async {
// Collections
each<T>(arr: T[], iterator: AsyncIterator<T>, callback?: ErrorCallback): void;
eachSeries<T>(arr: T[], iterator: AsyncIterator<T>, callback?: ErrorCallback): void;
eachLimit<T>(arr: T[], limit: number, iterator: AsyncIterator<T>, callback?: ErrorCallback): void;
forEachOf(obj: any, iterator: (item: any, key: [string|number], callback?: ErrorCallback) => void, callback: ErrorCallback): void;
forEachOf<T>(obj: T[], iterator: AsyncForEachOfIterator<T>, callback?: ErrorCallback): void;
forEachOfSeries(obj: any, iterator: (item: any, key: [string|number], callback?: ErrorCallback) => void, callback: ErrorCallback): void;
forEachOfSeries<T>(obj: T[], iterator: AsyncForEachOfIterator<T>, callback?: ErrorCallback): void;
forEachOfLimit(obj: any, limit: number, iterator: (item: any, key: [string|number], callback?: ErrorCallback) => void, callback: ErrorCallback): void;
forEachOfLimit<T>(obj: T[], limit: number, iterator: AsyncForEachOfIterator<T>, callback?: ErrorCallback): void;
map<T, R>(arr: T[], iterator: AsyncResultIterator<T, R>, callback?: AsyncResultArrayCallback<R>): any;
mapSeries<T, R>(arr: T[], iterator: AsyncResultIterator<T, R>, callback?: AsyncResultArrayCallback<R>): any;
mapLimit<T, R>(arr: T[], limit: number, iterator: AsyncResultIterator<T, R>, callback?: AsyncResultArrayCallback<R>): any;
filter<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback?: (results: T[]) => any): any;
select<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback?: (results: T[]) => any): any;
filterSeries<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback?: (results: T[]) => any): any;
selectSeries<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback?: (results: T[]) => any): any;
filterLimit<T>(arr: T[], limit: number, iterator: AsyncResultIterator<T, boolean>, callback?: (results: T[]) => any): any;
selectLimit<T>(arr: T[], limit: number, iterator: AsyncResultIterator<T, boolean>, callback?: (results: T[]) => any): any;
reject<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback?: (results: T[]) => any): any;
rejectSeries<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback?: (results: T[]) => any): any;
rejectLimit<T>(arr: T[], limit: number, iterator: AsyncResultIterator<T, boolean>, callback?: (results: T[]) => any): any;
reduce<T, R>(arr: T[], memo: R, iterator: AsyncMemoIterator<T, R>, callback?: AsyncResultCallback<R>): any;
inject<T, R>(arr: T[], memo: R, iterator: AsyncMemoIterator<T, R>, callback?: AsyncResultCallback<R>): any;
foldl<T, R>(arr: T[], memo: R, iterator: AsyncMemoIterator<T, R>, callback?: AsyncResultCallback<R>): any;
reduceRight<T, R>(arr: T[], memo: R, iterator: AsyncMemoIterator<T, R>, callback: AsyncResultCallback<R>): any;
foldr<T, R>(arr: T[], memo: R, iterator: AsyncMemoIterator<T, R>, callback: AsyncResultCallback<R>): any;
detect<T>(arr: T[], iterator: AsyncBooleanIterator<T>, callback?: (result: T) => void): any;
detectSeries<T>(arr: T[], iterator: AsyncBooleanIterator<T>, callback?: (result: T) => void): any;
detectLimit<T>(arr: T[], limit: number, iterator: AsyncBooleanIterator<T>, callback?: (result: T) => void): any;
sortBy<T, V>(arr: T[], iterator: AsyncResultIterator<T, V>, callback?: AsyncResultArrayCallback<T>): any;
some<T>(arr: T[], iterator: AsyncBooleanIterator<T>, callback?: (result: boolean) => void): any;
someLimit<T>(arr: T[], limit: number, iterator: AsyncBooleanIterator<T>, callback?: (result: boolean) => void): any;
any<T>(arr: T[], iterator: AsyncBooleanIterator<T>, callback?: (result: boolean) => void): any;
every<T>(arr: T[], iterator: AsyncBooleanIterator<T>, callback?: (result: boolean) => any): any;
everyLimit<T>(arr: T[], limit: number, iterator: AsyncBooleanIterator<T>, callback?: (result: boolean) => any): any;
all<T>(arr: T[], iterator: AsyncBooleanIterator<T>, callback?: (result: boolean) => any): any;
concat<T, R>(arr: T[], iterator: AsyncResultIterator<T, R[]>, callback?: AsyncResultArrayCallback<R>): any;
concatSeries<T, R>(arr: T[], iterator: AsyncResultIterator<T, R[]>, callback?: AsyncResultArrayCallback<R>): any;
// Control Flow
series<T>(tasks: AsyncFunction<T>[], callback?: AsyncResultArrayCallback<T>): void;
series<T>(tasks: Dictionary<AsyncFunction<T>>, callback?: AsyncResultObjectCallback<T>): void;
parallel<T>(tasks: Array<AsyncFunction<T>>, callback?: AsyncResultArrayCallback<T>): void;
parallel<T>(tasks: Dictionary<AsyncFunction<T>>, callback?: AsyncResultObjectCallback<T>): void;
parallelLimit<T>(tasks: Array<AsyncFunction<T>>, limit: number, callback?: AsyncResultArrayCallback<T>): void;
parallelLimit<T>(tasks: Dictionary<AsyncFunction<T>>, limit: number, callback?: AsyncResultObjectCallback<T>): void;
whilst(test: () => boolean, fn: AsyncVoidFunction, callback: (err: any) => void): void;
doWhilst(fn: AsyncVoidFunction, test: () => boolean, callback: (err: any) => void): void;
until(test: () => boolean, fn: AsyncVoidFunction, callback: (err: any) => void): void;
doUntil(fn: AsyncVoidFunction, test: () => boolean, callback: (err: any) => void): void;
during(test: (testCallback : (error: Error, truth: boolean) => void) => void, fn: AsyncVoidFunction, callback: (err: any) => void): void;
doDuring(fn: AsyncVoidFunction, test: (testCallback: (error: Error, truth: boolean) => void) => void, callback: (err: any) => void): void;
forever(next: (errCallback : (err: Error) => void) => void, errBack: (err: Error) => void) : void;
waterfall(tasks: Function[], callback?: (err: Error, result: any) => void): void;
compose(...fns: Function[]): void;
seq(...fns: Function[]): void;
applyEach(fns: Function[], argsAndCallback: any[]): void; // applyEach(fns, args..., callback). TS does not support ... for a middle argument. Callback is optional.
applyEachSeries(fns: Function[], argsAndCallback: any[]): void; // applyEachSeries(fns, args..., callback). TS does not support ... for a middle argument. Callback is optional.
queue<T>(worker: AsyncWorker<T>, concurrency?: number): AsyncQueue<T>;
priorityQueue<T>(worker: AsyncWorker<T>, concurrency: number): AsyncPriorityQueue<T>;
cargo(worker : (tasks: any[], callback : ErrorCallback) => void, payload? : number) : AsyncCargo;
auto(tasks: any, callback?: (error: Error, results: any) => void): void;
retry<T>(opts: number, task: (callback : AsyncResultCallback<T>, results: any) => void, callback: (error: Error, results: any) => void): void;
retry<T>(opts: { times: number, interval: number }, task: (callback: AsyncResultCallback<T>, results : any) => void, callback: (error: Error, results: any) => void): void;
iterator(tasks: Function[]): Function;
apply(fn: Function, ...arguments: any[]): AsyncFunction<any>;
nextTick(callback: Function): void;
setImmediate(callback: Function): void;
times<T> (n: number, iterator: AsyncResultIterator<number, T>, callback: AsyncResultArrayCallback<T>): void;
timesSeries<T>(n: number, iterator: AsyncResultIterator<number, T>, callback: AsyncResultArrayCallback<T>): void;
timesLimit<T>(n: number, limit: number, iterator: AsyncResultIterator<number, T>, callback: AsyncResultArrayCallback<T>): void;
// Utils
memoize(fn: Function, hasher?: Function): Function;
unmemoize(fn: Function): Function;
ensureAsync(fn: (... argsAndCallback: any[]) => void): Function;
constant(...values: any[]): Function;
asyncify(fn: Function): Function;
wrapSync(fn: Function): Function;
log(fn: Function, ...arguments: any[]): void;
dir(fn: Function, ...arguments: any[]): void;
noConflict(): Async;
}
declare var async: Async;
declare module "async" {
export = async;
}
+1 -5
View File
@@ -1,10 +1,6 @@
/// <reference path="./atom-keymap.d.ts" />
import atomKeymap = require('atom-keymap');
var KeymapManager = atomKeymap.KeymapManager;
type ICompleteMatchEvent = AtomKeymap.ICompleteMatchEvent;
// The import and type aliasing above can be done more concisely in TypeScript 1.5+:
//import { KeymapManager, ICompleteMatchEvent } from "atom-keymap";
import { KeymapManager, ICompleteMatchEvent } from "atom-keymap";
var manager = new KeymapManager();
manager.add('some/unique/path', {
+1
View File
@@ -27,6 +27,7 @@ interface Auth0LockOptions {
forceJSONP?: boolean;
gravatar?: boolean;
integratedWindowsLogin?: boolean;
icon?: string;
loginAfterSignup?: boolean;
popup?: boolean;
popupOptions?: Auth0LockPopupOptions;
+1 -1
View File
@@ -33,7 +33,7 @@ interface Auth0Static {
interface Auth0ClientOptions {
clientID: string;
callbackURL: string;
callbackOnLoactionHash?: boolean;
callbackOnLocationHash?: boolean;
domain: string;
forceJSONP?: boolean;
}
+17
View File
@@ -0,0 +1,17 @@
/// <reference path="auto-launch.d.ts" />
import AutoLaunch = require('auto-launch');
var a1 = new AutoLaunch({
name: 'Foo',
});
var a2 = new AutoLaunch({
name: 'Foo',
path: '/Applications/Foo.app',
isHidden: true,
});
a1.enable();
a2.disable();
var enabled: boolean = a1.isEnabled();
+41
View File
@@ -0,0 +1,41 @@
// Type definitions for auto-launch 0.1.18
// Project: https://github.com/Teamwork/node-auto-launch
// Definitions by: rhysd <https://github.com/rhysd>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface AutoLaunchOption {
/**
* Application name.
*/
name: string;
/**
* Hidden on launch or not. Default is false.
*/
isHidden?: boolean;
/**
* Path to application directory.
* Default is process.execPath.
*/
path?: string;
}
declare class AutoLaunch {
constructor(opts: AutoLaunchOption);
/**
* Enables to launch at start up
*/
enable(callback?: (err: Error) => void): void;
/**
* Disables to launch at start up
*/
disable(callback?: (err: Error) => void): void;
/**
* Returns if auto start up is enabled
*/
isEnabled(callback?: (err: Error) => void): boolean;
}
declare module "auto-launch" {
var al: typeof AutoLaunch;
export = al;
}
+3 -1
View File
@@ -1,5 +1,7 @@
/// <reference path="autobahn.d.ts"/>
import autobahn = require("autobahn");
class MyClass {
add2Count: number = 0;
session: autobahn.Session;
@@ -44,4 +46,4 @@ function test_client() {
};
connection.open();
}
}
+153 -148
View File
@@ -1,195 +1,200 @@
// Type definitions for AutobahnJS v0.9.6
// Type definitions for AutobahnJS v0.9.6
// Project: http://autobahn.ws/js/
// Definitions by: Elad Zelingher <https://github.com/darkl/>
// Definitions by: Elad Zelingher <https://github.com/darkl/>, Andy Hawkins <https://github.com/a904guy/,http://a904guy.com/,http://www.bmbsqd.com>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../when/when.d.ts" />
declare module autobahn {
export class Session {
id: number;
realm: string;
isOpen: boolean;
features: any;
caller_disclose_me: boolean;
publisher_disclose_me: boolean;
subscriptions: ISubscription[][];
registrations: IRegistration[];
export class Session {
id: number;
realm: string;
isOpen: boolean;
features: any;
caller_disclose_me: boolean;
publisher_disclose_me: boolean;
subscriptions: ISubscription[][];
registrations: IRegistration[];
constructor(transport: ITransport, defer: DeferFactory, challenge: OnChallengeHandler);
constructor(transport: ITransport, defer: DeferFactory, challenge: OnChallengeHandler);
join(realm: string, authmethods: string[], authid: string): void;
join(realm: string, authmethods: string[], authid: string): void;
leave(reason: string, message: string): void;
leave(reason: string, message: string): void;
call<TResult>(procedure: string, args?: any[], kwargs?: any, options?: ICallOptions): When.Promise<TResult>;
call<TResult>(procedure: string, args?: any[], kwargs?: any, options?: ICallOptions): When.Promise<TResult>;
publish(topic: string, args?: any[], kwargs?: any, options?: IPublishOptions): When.Promise<IPublication>;
publish(topic: string, args?: any[], kwargs?: any, options?: IPublishOptions): When.Promise<IPublication>;
subscribe(topic: string, handler: SubscribeHandler, options?: ISubscribeOptions): When.Promise<ISubscription>;
subscribe(topic: string, handler: SubscribeHandler, options?: ISubscribeOptions): When.Promise<ISubscription>;
register(procedure: string, endpoint: RegisterEndpoint, options?: IRegisterOptions): When.Promise<IRegistration>;
register(procedure: string, endpoint: RegisterEndpoint, options?: IRegisterOptions): When.Promise<IRegistration>;
unsubscribe(subscription: ISubscription): When.Promise<any>;
unsubscribe(subscription: ISubscription): When.Promise<any>;
unregister(registration: IRegistration): When.Promise<any>;
unregister(registration: IRegistration): When.Promise<any>;
prefix(prefix: string, uri: string): void;
prefix(prefix: string, uri: string): void;
resolve(curie: string): string;
resolve(curie: string): string;
onjoin: (roleFeatures: any) => void;
onleave: (reason: string, details: any) => void;
}
onjoin: (roleFeatures: any) => void;
onleave: (reason: string, details: any) => void;
}
interface IInvocation {
caller?: number;
progress?: boolean;
procedure: string;
}
interface IInvocation {
caller?: number;
progress?: boolean;
procedure: string;
}
interface IEvent {
publication: number;
publisher?: number;
topic: string;
}
interface IEvent {
publication: number;
publisher?: number;
topic: string;
}
interface IResult {
args: any[];
kwargs: any;
}
interface IResult {
args: any[];
kwargs: any;
}
interface IError {
error: string;
args: any[];
kwargs: any;
}
interface IError {
error: string;
args: any[];
kwargs: any;
}
type SubscribeHandler = (args?: any[], kwargs?: any, details?: IEvent) => void;
type SubscribeHandler = (args?: any[], kwargs?: any, details?: IEvent) => void;
interface ISubscription {
topic: string;
handler: SubscribeHandler;
options: ISubscribeOptions;
session: Session;
id: number;
active: boolean;
unsubscribe(): When.Promise<any>;
}
interface ISubscription {
topic: string;
handler: SubscribeHandler;
options: ISubscribeOptions;
session: Session;
id: number;
active: boolean;
unsubscribe(): When.Promise<any>;
}
type RegisterEndpoint = (args?: any[], kwargs?: any, details?: IInvocation) => void;
type RegisterEndpoint = (args?: any[], kwargs?: any, details?: IInvocation) => void;
interface IRegistration {
procedure: string;
endpoint: RegisterEndpoint;
options: IRegisterOptions;
session: Session;
id: number;
active: boolean;
unregister(): When.Promise<any>;
}
interface IRegistration {
procedure: string;
endpoint: RegisterEndpoint;
options: IRegisterOptions;
session: Session;
id: number;
active: boolean;
unregister(): When.Promise<any>;
}
interface IPublication {
id: number;
}
interface IPublication {
id: number;
}
interface ICallOptions {
timeout?: number;
receive_progress?: boolean;
disclose_me?: boolean;
}
interface ICallOptions {
timeout?: number;
receive_progress?: boolean;
disclose_me?: boolean;
}
interface IPublishOptions {
exclude?: number[];
eligible?: number[];
disclose_me? : Boolean;
}
interface IPublishOptions {
exclude?: number[];
eligible?: number[];
disclose_me? : Boolean;
}
interface ISubscribeOptions {
match? : string;
}
interface ISubscribeOptions {
match? : string;
}
interface IRegisterOptions {
disclose_caller?: boolean;
}
interface IRegisterOptions {
disclose_caller?: boolean;
}
export class Connection {
constructor(options?: IConnectionOptions);
export class Connection {
constructor(options?: IConnectionOptions);
open(): void;
open(): void;
close(reason: string, message: string): void;
close(reason: string, message: string): void;
onopen: (session: Session, details: any) => void;
onclose: (reason: string, details: any) => boolean;
}
onopen: (session: Session, details: any) => void;
onclose: (reason: string, details: any) => boolean;
}
interface ITransportDefinition {
url?: string;
protocols?: string[];
type: string;
}
interface ITransportDefinition {
url?: string;
protocols?: string[];
type: string;
}
type DeferFactory = () => any;
type DeferFactory = () => any;
type OnChallengeHandler = (session: Session, method: string, extra: any) => When.Promise<string>;
type OnChallengeHandler = (session: Session, method: string, extra: any) => When.Promise<string>;
interface IConnectionOptions {
use_es6_promises?: boolean;
// use explicit deferred factory, e.g. jQuery.Deferred or Q.defer
use_deferred?: DeferFactory;
transports?: ITransportDefinition[];
retry_if_unreachable?: boolean;
max_retries?: number;
initial_retry_delay?: number;
max_retry_delay?: number;
retry_delay_growth?: number;
retry_delay_jitter?: number;
url?: string;
protocols?: string[];
onchallenge?: (session: Session, method: string, extra: any) => OnChallengeHandler;
realm?: string;
authmethods?: string[];
authid?: string;
}
interface IConnectionOptions {
use_es6_promises?: boolean;
// use explicit deferred factory, e.g. jQuery.Deferred or Q.defer
use_deferred?: DeferFactory;
transports?: ITransportDefinition[];
retry_if_unreachable?: boolean;
max_retries?: number;
initial_retry_delay?: number;
max_retry_delay?: number;
retry_delay_growth?: number;
retry_delay_jitter?: number;
url?: string;
protocols?: string[];
onchallenge?: (session: Session, method: string, extra: any) => OnChallengeHandler;
realm?: string;
authmethods?: string[];
authid?: string;
}
interface ICloseEventDetails {
wasClean: boolean;
reason: string;
code: number;
}
interface ICloseEventDetails {
wasClean: boolean;
reason: string;
code: number;
}
interface ITransport {
onopen: () => void;
onmessage: (message: any[]) => void;
onclose: (details: ICloseEventDetails) => void;
interface ITransport {
onopen: () => void;
onmessage: (message: any[]) => void;
onclose: (details: ICloseEventDetails) => void;
send(message: any[]): void;
close(errorCode: number, reason?: string): void;
}
send(message: any[]): void;
close(errorCode: number, reason?: string): void;
}
interface ITransportFactory {
//constructor(options: any);
type: string;
create(): ITransport;
}
interface ITransportFactory {
//constructor(options: any);
type: string;
create(): ITransport;
}
interface ITransports {
register(name: string, factory: any): void;
isRegistered(name: string): boolean;
get(name: string): any;
list(): any[];
}
interface ITransports {
register(name: string, factory: any): void;
isRegistered(name: string): boolean;
get(name: string): any;
list(): any[];
}
interface ILog {
debug(...args: any[]): void;
}
interface ILog {
debug(...args: any[]): void;
}
interface IUtil {
assert(condition: boolean, message: string): void;
}
interface IUtil {
assert(condition: boolean, message: string): void;
}
var util: IUtil;
var log: ILog;
var transports: ITransports;
}
var util: IUtil;
var log: ILog;
var transports: ITransports;
}
declare module "autobahn" {
export = autobahn;
}
@@ -1 +0,0 @@
+1
View File
@@ -11,6 +11,7 @@ declare module Backbone {
interface LayoutOptions<TModel extends Model> extends ViewOptions<TModel> {
template?: string;
views?: { [viewName: string]: View<TModel> };
}
interface LayoutManagerOptions {
+11 -13
View File
@@ -148,7 +148,7 @@ declare module Backbone {
unset(attribute: string, options?: Silenceable): Model;
validate(attributes: any, options?: any): any;
private _validate(attrs: any, options: any): boolean;
private _validate(attributes: any, options: any): boolean;
// mixins from underscore
@@ -173,8 +173,8 @@ declare module Backbone {
models: TModel[];
length: number;
constructor(models?: TModel[], options?: any);
initialize(models?: TModel[], options?: any): void;
constructor(models?: TModel[] | Object[], options?: any);
initialize(models?: TModel[] | Object[], options?: any): void;
fetch(options?: CollectionFetchOptions): JQueryXHR;
@@ -187,9 +187,7 @@ declare module Backbone {
/**
* Get a model from a collection, specified by an id, a cid, or by passing in a model.
**/
get(id: number): TModel;
get(id: string): TModel;
get(id: Model): TModel;
get(id: number|string|Model): TModel;
create(attributes: any, options?: ModelSaveOptions): TModel;
pluck(attribute: string): any[];
push(model: TModel, options?: AddOptions): TModel;
@@ -201,10 +199,10 @@ declare module Backbone {
shift(options?: Silenceable): TModel;
sort(options?: Silenceable): Collection<TModel>;
unshift(model: TModel, options?: AddOptions): TModel;
where(properies: any): TModel[];
where(properties: any): TModel[];
findWhere(properties: any): TModel;
private _prepareModel(attrs?: any, options?: any): any;
private _prepareModel(attributes?: any, options?: any): any;
private _removeReference(model: TModel): void;
private _onModelEvent(event: string, model: TModel, collection: Collection<TModel>, options: any): void;
@@ -247,6 +245,7 @@ declare module Backbone {
select(iterator: any, context?: any): any[];
size(): number;
shuffle(): any[];
slice(min: number, max?: number): TModel[];
some(iterator: (element: TModel, index: number) => boolean, context?: any): boolean;
sortBy(iterator: (element: TModel, index: number) => number, context?: any): TModel[];
sortBy(attribute: string, context?: any): TModel[];
@@ -277,8 +276,7 @@ declare module Backbone {
constructor(options?: RouterOptions);
initialize(options?: RouterOptions): void;
route(route: string, name: string, callback?: Function): Router;
route(route: RegExp, name: string, callback?: Function): Router;
route(route: string|RegExp, name: string, callback?: Function): Router;
navigate(fragment: string, options?: NavigateOptions): Router;
navigate(fragment: string, trigger?: boolean): Router;
@@ -311,7 +309,8 @@ declare module Backbone {
interface ViewOptions<TModel extends Model> {
model?: TModel;
collection?: Backbone.Collection<TModel>;
// TODO: quickfix, this can't be fixed easy. The collection does not need to have the same model as the parent view.
collection?: Backbone.Collection<any>;
el?: any;
id?: string;
className?: string;
@@ -340,8 +339,7 @@ declare module Backbone {
model: TModel;
collection: Collection<TModel>;
//template: (json, options?) => string;
setElement(element: HTMLElement, delegate?: boolean): View<TModel>;
setElement(element: JQuery, delegate?: boolean): View<TModel>;
setElement(element: HTMLElement|JQuery, delegate?: boolean): View<TModel>;
id: string;
cid: string;
className: string;
+6 -4
View File
@@ -10,10 +10,10 @@ declare module Backgrid {
interface GridOptions {
columns: Column[];
collection: Backbone.Collection<Backbone.Model>;
header: Header;
body: Body;
row: Row;
footer: Footer;
header?: Header;
body?: Body;
row?: Row;
footer?: Footer;
}
class Header extends Backbone.View<Backbone.Model> {
@@ -109,6 +109,8 @@ declare module Backgrid {
header: any;
tagName: string;
constructor(options: GridOptions);
initialize(options: any);
getSelectedModels(): Backbone.Model[];
insertColumn(...options: any[]): Grid;
+9
View File
@@ -0,0 +1,9 @@
root = true
[*.ts]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
+397 -319
View File
@@ -1,386 +1,464 @@
/// <reference path="./baconjs.d.ts" />
function CreatingStreams() {
$("#my-div").asEventStream("click");
$("#my-div").asEventStream("click", ".more-specific-selector");
$("#my-div").asEventStream("click", (event, args) => args[0]);
$("#my-div").asEventStream("click", ".more-specific-selector", (event, args) => args[0]);
$("#my-div").asEventStream("click");
$("#my-div").asEventStream("click", ".more-specific-selector");
$("#my-div").asEventStream("click", (event, args) => args[0]);
$("#my-div").asEventStream("click", ".more-specific-selector", (event, args) => args[0]);
Bacon.fromPromise($.ajax("https://baconjs.github.io/"));
Bacon.fromPromise(Promise.resolve(1));
Bacon.fromPromise($.ajax("https://baconjs.github.io/"));
Bacon.fromPromise(Promise.resolve(1));
Bacon.fromPromise($.ajax("https://baconjs.github.io/"), true);
Bacon.fromPromise(Promise.resolve(1), false);
Bacon.fromPromise($.ajax("https://baconjs.github.io/"), true);
Bacon.fromPromise(Promise.resolve(1), false);
Bacon.fromPromise($.ajax("https://baconjs.github.io/"), true, (n:string) => {
return [new Bacon.Next(n), new Bacon.Next(() => n), new Bacon.End()];
});
Bacon.fromPromise(Promise.resolve(1), false, n => {
return [new Bacon.Next(n), new Bacon.Next(() => n), new Bacon.End()];
});
Bacon.fromEvent(document.body, "click").onValue(() => {
alert("Bacon!");
});
Bacon.fromEvent(document.body, "click", (event:MouseEvent) => event.clientX).onValue(clientX => {
alert("Bacon!");
});
Bacon.fromEvent(process.stdin, "readable", () => {
alert("Bacon!");
});
// This would create a stream that outputs a single value "Bacon!" and ends after that. The use of setTimeout causes the value to be delayed by 1 second.
Bacon.fromCallback(callback => {
setTimeout(() => {
callback("Bacon!");
}, 1000);
});
// You can also give any number of arguments to `fromCallback`, which will be passed to the function. These arguments can be simple variables, Bacon EventStreams or Properties. For example the following will output "Bacon rules":
Bacon.fromCallback((a, b, callback) => {
callback(a + " " + b);
}, Bacon.constant("bacon"), "rules").log();
{
var fs = require("fs"),
read = Bacon.fromNodeCallback(fs.readFile, "input.txt");
read.onError(error => {
console.log("Reading failed: " + error);
Bacon.fromPromise($.ajax("https://baconjs.github.io/"), true, (n:string) => {
return [new Bacon.Next(n), new Bacon.Next(() => n), new Bacon.End()];
});
read.onValue(value => {
console.log("Read contents: " + value);
Bacon.fromPromise(Promise.resolve(1), false, n => {
return [new Bacon.Next(n), new Bacon.Next(() => n), new Bacon.End()];
});
}
Bacon.once(new Bacon.Error("fail"));
Bacon.fromEvent(document.body, "click").onValue(() => {
alert("Bacon!");
});
Bacon.fromEvent(document.body, "click", (event:MouseEvent) => event.clientX).onValue(clientX => {
alert("Bacon!");
});
Bacon.fromEvent(process.stdin, "readable", () => {
alert("Bacon!");
});
Bacon.fromEvent($("body"), "click").onValue(() => {
alert("Bacon!");
});
// The following would lead to `1,2,3,1,2,3...` to be repeated indefinitely:
Bacon.fromArray([1, new Bacon.Error("")]);
// This would create a stream that outputs a single value "Bacon!" and ends after that. The use of setTimeout causes the value to be delayed by 1 second.
Bacon.fromCallback(callback => {
setTimeout(() => {
callback("Bacon!");
}, 1000);
});
Bacon.repeatedly(10, [1, 2, 3]);
// You can also give any number of arguments to `fromCallback`, which will be passed to the function. These arguments can be simple variables, Bacon EventStreams or Properties. For example the following will output "Bacon rules":
Bacon.fromCallback((a, b, callback) => {
callback(a + " " + b);
}, Bacon.constant("bacon"), "rules").log();
// The following will produce values `0,1,2`.
Bacon.repeat(i => {
if (i < 3) {
return Bacon.once(i);
} else {
return false;
{
var fs = require("fs"),
read = Bacon.fromNodeCallback(fs.readFile, "input.txt");
read.onError(error => {
console.log("Reading failed: " + error);
});
read.onValue(value => {
console.log("Read contents: " + value);
});
}
}).log();
{
var stream = Bacon.fromBinder(sink => {
sink("first value");
sink([new Bacon.Next("2nd"), new Bacon.Next("3rd")]);
sink(new Bacon.Next(() => {
return "This one will be evaluated lazily"
}));
sink(new Bacon.Error("oops, an error"));
sink(new Bacon.End());
return () => {
// unsub functionality here, this one's a no-op
};
});
stream.log();
}
Bacon.once(new Bacon.Error("fail"));
new Bacon.Next("value");
new Bacon.Next(() => "value");
// The following would lead to `1,2,3,1,2,3...` to be repeated indefinitely:
Bacon.fromArray([1, new Bacon.Error("")]);
Bacon.repeatedly(10, [1, 2, 3]);
// The following will produce values `0,1,2`.
Bacon.repeat(i => {
if (i < 3) {
return Bacon.once(i);
} else {
return false;
}
}).log();
{
var stream = Bacon.fromBinder(sink => {
sink("first value");
sink([new Bacon.Next("2nd"), new Bacon.Next("3rd")]);
sink(new Bacon.Next(() => {
return "This one will be evaluated lazily"
}));
sink(new Bacon.Error("oops, an error"));
sink(new Bacon.End());
return () => {
// unsub functionality here, this one's a no-op
};
});
stream.log();
}
new Bacon.Next("value");
new Bacon.Next(() => "value");
}
function CommonMethodsInEventStreamsAndProperties() {
// Converting strings to integers, skipping empty values:
Bacon.once("").flatMap(text => {
return text != "" ? parseInt(text) : Bacon.never();
});
// Converting strings to integers, skipping empty values:
Bacon.once("").flatMap(text => {
return text != "" ? parseInt(text) : Bacon.never();
});
Bacon.sequentially(1, [1, 2, 3]).scan(0, (a, b) => a + b);
Bacon.sequentially(1, [1, 2, 3]).scan(0, (a, b) => a + b);
Bacon.sequentially(1, [1, 2, 3]).diff(0, (a, b) => Math.abs(b - a));
Bacon.sequentially(1, [1, 2, 3]).diff(0, (a, b) => Math.abs(b - a));
// If you have a EventStream `s` with a value sequence `1,2,3,4,5`, the respective values in `s.slidingWindow(2)` would be `[],[1],[1,2],[2,3],[3,4],[4,5]`:
Bacon.fromArray([1, 2, 3, 4, 5]).slidingWindow(2);
// The values of `s.slidingWindow(2,2)`would be `[1,2],[2,3],[3,4],[4,5]`:
Bacon.fromArray([1, 2, 3, 4, 5]).slidingWindow(2, 2);
// If you have a EventStream `s` with a value sequence `1,2,3,4,5`, the respective values in `s.slidingWindow(2)` would be `[],[1],[1,2],[2,3],[3,4],[4,5]`:
Bacon.fromArray([1, 2, 3, 4, 5]).slidingWindow(2);
// The values of `s.slidingWindow(2,2)`would be `[1,2],[2,3],[3,4],[4,5]`:
Bacon.fromArray([1, 2, 3, 4, 5]).slidingWindow(2, 2);
{
var x = Bacon.fromArray([1, 2]), y = Bacon.fromArray([3, 4]);
x.zip(y, (x, y) => x + y);
}
{
var stream = Bacon.fromArray([1, 2]);
stream.log("New event in myStream");
stream.log();
}
Bacon.fromArray([1, 2, 3]).withStateMachine(0, (sum, event) => {
if (event.hasValue()) {
// had to cast to `number` because event:Bacon.Next<number>|Bacon.Error<{}>
return [sum + <number>event.value(), []];
{
var x = Bacon.fromArray([1, 2]), y = Bacon.fromArray([3, 4]);
x.zip(y, (x, y) => x + y);
}
else if (event.isEnd()) {
return [undefined, [new Bacon.Next(sum), event]];
{
var stream = Bacon.fromArray([1, 2]);
stream.log("New event in myStream");
stream.log();
}
else {
return [sum, [event]];
Bacon.fromArray([1, 2, 3]).withStateMachine(0, (sum, event) => {
if (event.hasValue()) {
// had to cast to `number` because event:Bacon.Next<number>|Bacon.Error<{}>
return [sum + <number>event.value(), []];
}
else if (event.isEnd()) {
return [undefined, [new Bacon.Next(sum), event]];
}
else {
return [sum, [event]];
}
});
{
var property = Bacon.fromArray([1, 2, 3]).toProperty(),
who = Bacon.fromArray(["A", "B", "C"]).toProperty();
property.decode({1: "mike", 2: who});
property.decode({1: {type: "mike"}, 2: {type: "other", whoThen: who}});
}
});
{
var property = Bacon.fromArray([1, 2, 3]).toProperty(),
who = Bacon.fromArray(["A", "B", "C"]).toProperty();
property.decode({1: "mike", 2: who});
property.decode({1: {type: "mike"}, 2: {type: "other", whoThen: who}});
}
{
// This is handy for keeping track whether we are currently awaiting an AJAX response:
var ajaxRequest = <Bacon.Observable<Error, JQueryXHR>>{},
ajaxResponse = <Bacon.Observable<Error, JQueryXHR>>{},
showAjaxIndicator = ajaxRequest.awaiting(ajaxResponse);
}
Bacon.fromArray([1, 2, -3, 3]).withHandler(function (event) {
if (event.hasValue() && event.value() < 0) {
this.push(new Bacon.Error("Value below zero"));
return this.push(new Bacon.End());
} else {
return this.push(event);
{
// This is handy for keeping track whether we are currently awaiting an AJAX response:
var ajaxRequest = <Bacon.Observable<Error, JQueryXHR>>{},
ajaxResponse = <Bacon.Observable<Error, JQueryXHR>>{},
showAjaxIndicator = ajaxRequest.awaiting(ajaxResponse);
}
});
{
var src = Bacon.once(1),
obs = src.map(x => -x);
console.log(obs.toString()); // > "Bacon.once(1).map(function)"
Bacon.fromArray([1, 2, -3, 3]).withHandler(function (event) {
if (event.hasValue() && event.value() < 0) {
this.push(new Bacon.Error("Value below zero"));
return this.push(new Bacon.End());
} else {
return this.push(event);
}
});
obs.withDescription(src, "times", -1);
console.log(obs.toString()); // > "Bacon.once(1).times(-1)"
}
{
var src = Bacon.once(1),
obs = src.map(x => -x);
console.log(obs.toString()); // > "Bacon.once(1).map(function)"
{
// Calculator for grouped consecutive values until group is cancelled:
var events = [
{id: 1, type: "add", val: 3},
{id: 2, type: "add", val: -1},
{id: 1, type: "add", val: 2},
{id: 2, type: "cancel"},
{id: 3, type: "add", val: 2},
{id: 3, type: "cancel"},
{id: 1, type: "add", val: 1},
{id: 1, type: "add", val: 2},
{id: 1, type: "cancel"}
],
keyF = (event:{id:number}) => event.id,
limitF = (groupedStream:Bacon.EventStream<string, {id:number; type:string; val?:number}>) => {
var cancel = groupedStream.filter(x => x.type === "cancel").take(1),
adds = groupedStream.filter(x => x.type === "add");
return adds.takeUntil(cancel).map(x => x.val);
};
obs.withDescription(src, "times", -1);
console.log(obs.toString()); // > "Bacon.once(1).times(-1)"
}
Bacon.sequentially(2, events)
.groupBy(keyF, limitF)
.flatMap(groupedStream => groupedStream.fold(0, (acc, x) => acc + x))
.onValue(sum => {
console.log(sum); // returns [-1, 2, 8] in an order
});
}
{
// Calculator for grouped consecutive values until group is cancelled:
var events = [
{id: 1, type: "add", val: 3},
{id: 2, type: "add", val: -1},
{id: 1, type: "add", val: 2},
{id: 2, type: "cancel"},
{id: 3, type: "add", val: 2},
{id: 3, type: "cancel"},
{id: 1, type: "add", val: 1},
{id: 1, type: "add", val: 2},
{id: 1, type: "cancel"}
],
keyF = (event:{id:number}) => event.id,
limitF = (groupedStream:Bacon.EventStream<string, {id:number; type:string; val?:number}>) => {
var cancel = groupedStream.filter(x => x.type === "cancel").take(1),
adds = groupedStream.filter(x => x.type === "add");
return adds.takeUntil(cancel).map(x => x.val);
};
Bacon.sequentially(2, events)
.groupBy(keyF, limitF)
.flatMap(groupedStream => groupedStream.fold(0, (acc, x) => acc + x))
.onValue(sum => {
console.log(sum); // returns [-1, 2, 8] in an order
});
}
}
function EventStream() {
// This creates the stream which doesn't produce any events and never ends:
Bacon.interval(1e1, 0).last();
// This creates the stream which doesn't produce any events and never ends:
Bacon.interval(1e1, 0).last();
Bacon.fromArray([1, 2, 2, 1])
.skipDuplicates().log(); // > returns [1, 2, 1] in an order
Bacon.fromArray([1, 2, 2, 1])
.skipDuplicates().log(); // > returns [1, 2, 1] in an order
// You might get two events containing [1,2,3,4] and [5,6,7] respectively, given that the flush occurs between numbers 4 and 5:
Bacon.fromArray([1, 2, 3, 4, 5, 6, 7]).bufferWithTime(0);
// You might get two events containing [1,2,3,4] and [5,6,7] respectively, given that the flush occurs between numbers 4 and 5:
Bacon.fromArray([1, 2, 3, 4, 5, 6, 7]).bufferWithTime(0);
// Here's an equivalent to `stream.bufferWithTime(10)`:
{
var stream = Bacon.fromArray([1, 2, 3, 4, 5, 6, 7]);
stream.bufferWithTime(f => {
setTimeout(f, 10);
});
}
// Here's an equivalent to `stream.bufferWithTime(10)`:
{
var stream = Bacon.fromArray([1, 2, 3, 4, 5, 6, 7]);
stream.bufferWithTime(f => {
setTimeout(f, 10);
});
}
// You will get output events with values `[1, 2]`, `[3, 4]` and `[5]`.
Bacon.fromArray([1, 2, 3, 4, 5]).bufferWithCount(2);
// You will get output events with values `[1, 2]`, `[3, 4]` and `[5]`.
Bacon.fromArray([1, 2, 3, 4, 5]).bufferWithCount(2);
}
function Property() {
// This creates the property which doesn't produce any events and never ends:
Bacon.interval(1e1, 0).toProperty().last();
// This creates the property which doesn't produce any events and never ends:
Bacon.interval(1e1, 0).toProperty().last();
{
var property = Bacon.fromArray([1, 2, 3, 4, 5]).toProperty();
// If you want to assign your Property to the "disabled" attribute of a JQuery object, you can do this:
property.assign($("#my-button"), "attr", "disabled");
{
var property = Bacon.fromArray([1, 2, 3, 4, 5]).toProperty();
// If you want to assign your Property to the "disabled" attribute of a JQuery object, you can do this:
property.assign($("#my-button"), "attr", "disabled");
// A simpler example would be to toggle the visibility of an element based on a Property:
property.assign($("#my-button"), "toggle");
}
// A simpler example would be to toggle the visibility of an element based on a Property:
property.assign($("#my-button"), "toggle");
}
Bacon.fromArray([1, 2, 2, 1]).toProperty()
.skipDuplicates().log(); // > returns [1, 2, 1] in an order
Bacon.fromArray([1, 2, 2, 1]).toProperty()
.skipDuplicates().log(); // > returns [1, 2, 1] in an order
}
function CombiningMultipleStreamsAndProperties() {
{
var property = Bacon.constant(1),
stream = Bacon.once(2),
constant = 3;
Bacon.combineAsArray(property, stream, constant)
.log(); // > returns [1, 2, 3]
}
{
var property = Bacon.constant(1),
stream = Bacon.once(2),
constant = 3;
Bacon.combineAsArray(property, stream, constant)
.log(); // > returns [1, 2, 3]
}
{
// To calculate the current sum of three numeric Properties, you can do:
var property = Bacon.constant(1),
stream = Bacon.once(2),
constant = 3;
// NOTE: had to explicitly specify the typing for `x:number, y:number, z:number`
Bacon.combineWith((x:number, y:number, z:number) => x + y + z, property, stream, constant);
}
{
// To calculate the current sum of three numeric Properties, you can do:
var property = Bacon.constant(1),
stream = Bacon.once(2),
constant = 3;
// NOTE: had to explicitly specify the typing for `x:number, y:number, z:number`
Bacon.combineWith((x:number, y:number, z:number) => x + y + z, property, stream, constant);
}
{
// Assuming you've got streams or properties named `password`, `username`, `firstname` and `lastname`, you can do:
var password = Bacon.constant("easy"),
username = Bacon.constant("juha"),
firstname = Bacon.constant("juha"),
lastname = Bacon.constant("paananen"),
// NOTE: you should provide `combineTemplate` typing explicitly!
loginInfo = Bacon.combineTemplate<string, {
magicNumber:number; userid:string; passwd:string;
name:{first:string; last:string}
}>({
magicNumber: 3,
userid: username,
passwd: password,
name: {first: firstname, last: lastname}
}).onValue(loginInfo => {
// and your new `loginInfo` property will combine values from all these streams using that template, whenever any of the streams/properties get a new value. It would yield a value:
console.log("`loginInfo` expected", {
magicNumber: 3,
userid: "juha",
passwd: "easy",
name: {first: "juha", last: "paananen"}
});
console.log("`loginInfo` actual", loginInfo);
});
{
// Assuming you've got streams or properties named `password`, `username`, `firstname` and `lastname`, you can do:
var password = Bacon.constant("easy"),
username = Bacon.constant("juha"),
firstname = Bacon.constant("juha"),
lastname = Bacon.constant("paananen"),
// NOTE: you should provide `combineTemplate` typing explicitly!
loginInfo = Bacon.combineTemplate<string, {
magicNumber:number; userid:string; passwd:string;
name:{first:string; last:string}
}>({
magicNumber: 3,
userid: username,
passwd: password,
name: {first: firstname, last: lastname}
}).onValue(loginInfo => {
// and your new `loginInfo` property will combine values from all these streams using that template, whenever any of the streams/properties get a new value. It would yield a value:
console.log("`loginInfo` expected", {
magicNumber: 3,
userid: "juha",
passwd: "easy",
name: {first: "juha", last: "paananen"}
});
console.log("`loginInfo` actual", loginInfo);
});
// Note that all Bacon.combine* methods produce a `Property` instead of an `EventStream`. If you need the result as an `EventStream` you might want to use `property.changes()`:
Bacon.combineWith((firstname, lastname) => `${firstname} ${lastname}`, firstname, lastname).changes();
}
// Note that all Bacon.combine* methods produce a `Property` instead of an `EventStream`. If you need the result as an `EventStream` you might want to use `property.changes()`:
Bacon.combineWith((firstname, lastname) => `${firstname} ${lastname}`, firstname, lastname).changes();
}
{
var x = Bacon.fromArray([1, 2, 3]),
y = Bacon.fromArray([10, 20, 30]),
z = Bacon.fromArray([100, 200, 300]);
Bacon.zipAsArray(x, y, z)
.log(); // > returns values `[1, 10, 100]`, `[2, 20, 200]` and `[3, 30, 300]`
}
{
var x = Bacon.fromArray([1, 2, 3]),
y = Bacon.fromArray([10, 20, 30]),
z = Bacon.fromArray([100, 200, 300]);
Bacon.zipAsArray(x, y, z)
.log(); // > returns values `[1, 10, 100]`, `[2, 20, 200]` and `[3, 30, 300]`
}
// The following example would log the number 3.
// NOTE: had to explicitly specify the typing for `a:number, b:number`
Bacon.onValues(Bacon.constant(1), Bacon.constant(2), (a:number, b:number) => {
console.log(a + b);
});
// The following example would log the number 3.
// NOTE: had to explicitly specify the typing for `a:number, b:number`
Bacon.onValues(Bacon.constant(1), Bacon.constant(2), (a:number, b:number) => {
console.log(a + b);
});
}
function $Event() {
new Bacon.Next("value");
new Bacon.Next(() => "value");
new Bacon.Next("value");
new Bacon.Next(() => "value");
}
function Errors() {
// In case you want to convert (some) value events into Error events, you may use `flatMap` like this:
// NOTE: had to explicitly specify the typing for `flatMap`
Bacon.fromArray([1, 2, 3, 4]).flatMap<number>(x => {
return x > 2 ? new Bacon.Error("too big") : x;
});
// In case you want to convert (some) value events into Error events, you may use `flatMap` like this:
// NOTE: had to explicitly specify the typing for `flatMap`
Bacon.fromArray([1, 2, 3, 4]).flatMap<number>(x => {
return x > 2 ? new Bacon.Error("too big") : x;
});
// Conversely, if you want to convert some Error events into value events, you may use `flatMapError`:
Bacon.fromArray<string, number>([1, 2, 3, 4]).flatMapError<number>(error => {
var isNonCriticalError = (error:string) => Math.random() < .5,
handleNonCriticalError = (error:string) => 42;
return isNonCriticalError(error) ? handleNonCriticalError(error) : new Bacon.Error(error);
});
// Conversely, if you want to convert some Error events into value events, you may use `flatMapError`:
Bacon.fromArray<string, number>([1, 2, 3, 4]).flatMapError<number>(error => {
var isNonCriticalError = (error:string) => Math.random() < .5,
handleNonCriticalError = (error:string) => 42;
return isNonCriticalError(error) ? handleNonCriticalError(error) : new Bacon.Error(error);
});
// Note also that Bacon.js combinators do not catch errors that are thrown. Especially `map` doesn't do so. If you want to map things and wrap caught errors into Error events, you can do the following:
Bacon.fromArray([1, 2, 3, 4]).flatMap(x => {
var dangerousFunction = (x:number) => {
throw new Error("dangerous function!");
};
try {
return dangerousFunction(x);
} catch (e) {
return new Bacon.Error(e);
}
});
// Note also that Bacon.js combinators do not catch errors that are thrown. Especially `map` doesn't do so. If you want to map things and wrap caught errors into Error events, you can do the following:
Bacon.fromArray([1, 2, 3, 4]).flatMap(x => {
var dangerousFunction = (x:number) => {
throw new Error("dangerous function!");
};
try {
return dangerousFunction(x);
} catch (e) {
return new Bacon.Error(e);
}
});
Bacon.once("https://baconjs.github.io/").flatMap(url => {
// `ajaxCall` gives `Error`s on network or server `Error`s.
var ajaxCall = (url:string) => {
return Bacon.fromPromise<JQueryXHR, JQueryXHR>($.ajax(url));
};
return Bacon.retry({
source: () => ajaxCall(url),
retries: 5,
isRetryable: (error:JQueryXHR) => error.status !== 404,
delay: context => 100 // Just use the same delay always
Bacon.once("https://baconjs.github.io/").flatMap(url => {
// `ajaxCall` gives `Error`s on network or server `Error`s.
var ajaxCall = (url:string) => {
return Bacon.fromPromise<JQueryXHR, JQueryXHR>($.ajax(url));
};
return Bacon.retry({
source: () => ajaxCall(url),
retries: 5,
isRetryable: (error:JQueryXHR) => error.status !== 404,
delay: context => 100 // Just use the same delay always
});
});
});
}
function JoinPatterns() {
{
// Consider implementing a game with discrete time ticks. We want to handle key-events synchronized on tick-events, with at most one key event handled per tick. If there are no key events, we want to just process a tick:
var tick = Bacon.interval(1e2, 0),
keyEvent = Bacon.fromEvent(document.body, "click", _ => Date.now()),
handleTick = (_:number) => `timestamp: NONE`,
handleKeyEvent = (timestamp:number) => `timestamp: ${timestamp}`;
Bacon.when(
[tick, keyEvent], (_:number, timestamp:number) => handleKeyEvent(timestamp),
[tick], handleTick
);
// Order is important here. If the [tick] patterns had been written first, this would have been tried first, and preferred at each tick.
}
{
// Consider implementing a game with discrete time ticks. We want to handle key-events synchronized on tick-events, with at most one key event handled per tick. If there are no key events, we want to just process a tick:
var tick = Bacon.interval(1e2, 0),
keyEvent = Bacon.fromEvent(document.body, "click", _ => Date.now()),
handleTick = (_:number) => `timestamp: NONE`,
handleKeyEvent = (timestamp:number) => `timestamp: ${timestamp}`;
Bacon.when(
[tick, keyEvent], (_:number, timestamp:number) => handleKeyEvent(timestamp),
[tick], handleTick
);
// Order is important here. If the [tick] patterns had been written first, this would have been tried first, and preferred at each tick.
}
{
// Join patterns are indeed a generalization of `zip`, and `zip` is equivalent to a single-rule join pattern. The following `Observable`s have the same output:
var a = Bacon.once("a"),
b = Bacon.once("b"),
c = Bacon.once("c"),
f = (a:string, b:string, c:string) => `a = ${a}; b = ${b}; c = ${c}.`;
Bacon.zipWith(f, a, b, c);
Bacon.when([a, b, c], f);
}
{
// The inputs to `Bacon.update` are defined like this:
var initial = 0,
x = Bacon.interval(1e3, 1),
y = Bacon.interval(2e3, 1),
z = Bacon.interval(1.5e3, 1);
// NOTE: had to explicitly specify the typing for `previous:number`
Bacon.update(initial,
[x, y, z], (previous:number, x:number, y:number, z:number) => previous + x + y + z,
[x, y], (previous:number, x:number, y:number) => previous + x + y
);
// As input, each function above will get the previous value of the `result` Property, along with values from the listed Observables. The value returned by the function will be used as the next value of `result`. Just like in `Bacon.when`, only EventStreams will trigger an update, while Properties will be just sampled. So, if you list a single EventStream and several Properties, the value will be updated only when an event occurs in the EventStream.
}
{
// Here's a simple gaming example:
var scoreMultiplier = Bacon.constant(1),
hitUfo = new Bacon.Bus(),
hitMotherShip = new Bacon.Bus(),
score = Bacon.update(0,
[hitUfo, scoreMultiplier], (score:number, _:number, multiplier:number) => score + 100 * multiplier,
[hitMotherShip], (score:number, _:number) => score + 2000
);
// In the example, the `score` property is updated when either `hitUfo` or `hitMotherShip` occur. The `scoreMultiplier` Property is sampled to take multiplier into account when `hitUfo` occurs.
}
{
// Join patterns are indeed a generalization of `zip`, and `zip` is equivalent to a single-rule join pattern. The following `Observable`s have the same output:
var a = Bacon.once("a"),
b = Bacon.once("b"),
c = Bacon.once("c"),
f = (a:string, b:string, c:string) => `a = ${a}; b = ${b}; c = ${c}.`;
Bacon.zipWith(f, a, b, c);
Bacon.when([a, b, c], f);
}
{
// The inputs to `Bacon.update` are defined like this:
var initial = 0,
x = Bacon.interval(1e3, 1),
y = Bacon.interval(2e3, 1),
z = Bacon.interval(1.5e3, 1);
// NOTE: had to explicitly specify the typing for `previous:number`
Bacon.update(initial,
[x, y, z], (previous:number, x:number, y:number, z:number) => previous + x + y + z,
[x, y], (previous:number, x:number, y:number) => previous + x + y
);
// As input, each function above will get the previous value of the `result` Property, along with values from the listed Observables. The value returned by the function will be used as the next value of `result`. Just like in `Bacon.when`, only EventStreams will trigger an update, while Properties will be just sampled. So, if you list a single EventStream and several Properties, the value will be updated only when an event occurs in the EventStream.
}
{
// Here's a simple gaming example:
var scoreMultiplier = Bacon.constant(1),
hitUfo = new Bacon.Bus(),
hitMotherShip = new Bacon.Bus(),
score = Bacon.update(0,
[hitUfo, scoreMultiplier], (score:number, _:number, multiplier:number) => score + 100 * multiplier,
[hitMotherShip], (score:number, _:number) => score + 2000
);
// In the example, the `score` property is updated when either `hitUfo` or `hitMotherShip` occur. The `scoreMultiplier` Property is sampled to take multiplier into account when `hitUfo` occurs.
}
{
// Join patterns as a "chemical machine". A quick way to get some intuition for join patterns is to understand them through an analogy in terms of atoms and molecules. A join pattern can here be regarded as a recipe for a chemical reaction. Lets say we have observables `oxygen`, `carbon` and `hydrogen`, where an event in these spawns an 'atom' of that type into a mixture. We can state reactions:
let oxygen = Bacon.interval(1e3, "O"),
hydrogen = Bacon.interval(2e3, "H"),
carbon = Bacon.interval(1.5e3, "C"),
makeWater = (oxygen:string, hydrogen1:string, hydrogen2:string) => `${hydrogen1}${[hydrogen1, hydrogen2].length}${oxygen}`,
makeCarbonMonoxide = (oxygen:string, carbon:string) => `${carbon}${oxygen}`;
Bacon.when(
[oxygen, hydrogen, hydrogen], makeWater,
[oxygen, carbon], makeCarbonMonoxide
);
// Now, every time a new 'atom' is spawned from one of the observables, this atom is added to the mixture. If at any time there are two hydrogen atoms, and an oxygen atom, the corresponding atoms are *consumed*, and output is produced via `makeWater`. The same semantics apply for the second rule to create carbon monoxide. The rules are tried at each point from top to bottom.
}
}
function JoinPatternsAndProperties() {
{
// Join patterns and properties
//Properties are not part of the synchronization pattern, but are instead just sampled. The following example take three input streams `$price`, `$quantity` and `$total`, e.g. coming from input fields, and defines mutally recursive behaviours in properties `price`, `quantity` and `total` such that
// -- updating price sets total to price * quantity;
// -- updating quantity sets total to price * quantity;
// -- updating total sets price to total / quantity.
let random = (x:number) => Math.round(x * Math.random()),
id = <A>(x:A):A => x;
let $quantity = Bacon.interval<Error, number>(1e3, 10).map(random),
$price = Bacon.interval<Error, number>(2e3, 100).map(random),
$total = Bacon.interval<Error, number>(1.5e3, 1000).map(random);
let quantity = $quantity.toProperty(1),
price = Bacon.when<Error, number, number, number>(
[$price], id,
[$total, quantity], (x, y) => x / y
).toProperty(0),
total = Bacon.when<Error, number, number, number, number>(
[$total], id,
[$price, quantity], (x, y) => x * y,
[price, $quantity], (x, y) => x * y
).toProperty(0);
}
}
function JoinPatternsAndBaconBus() {
{
// Join patterns and `Bacon.Bus`
// The result functions of join patterns are allowed to push values onto a `Bus` that may in turn be in one of its patterns. For instance, an implementation of the dining philosophers problem can be written as follows:
// Availability of chopsticks are implemented using bus.
let chopsticks = [new Bacon.Bus(), new Bacon.Bus(), new Bacon.Bus()],
// Hungry could be any type of observable, but we'll use bus here.
hungry = [new Bacon.Bus(), new Bacon.Bus(), new Bacon.Bus()],
// A philosopher eats for one second, then makes the chopsticks available again by pushing values onto their bus.
eat = (i:number) => () => {
setTimeout(() => {
console.log("done!");
chopsticks[i].push({});
chopsticks[(i + 1) % 3].push({});
}, 1e3);
return `philosopher ${i} eating`;
},
// We use Bacon.when to make sure a hungry philosopher can eat only when both his chopsticks are available.
dining = Bacon.when(
[hungry[0], chopsticks[0], chopsticks[1]], eat(0),
[hungry[1], chopsticks[1], chopsticks[2]], eat(1),
[hungry[2], chopsticks[2], chopsticks[0]], eat(2)
).log("dining");
// Make all chopsticks initially available.
chopsticks[0].push({});
chopsticks[1].push({});
chopsticks[2].push({});
// Make philosophers hungry in some way, in this case we just push to their bus.
for (var i = 0; i < 3; i++) {
hungry[0].push({});
hungry[1].push({});
hungry[2].push({});
}
}
}
+3013 -2626
View File
File diff suppressed because it is too large Load Diff
+7 -7
View File
@@ -39,7 +39,7 @@ module bardTests {
var myService: MyService;
var $rootScope: angular.IRootScopeService;
beforeEach(module(bard.$httpBackend, 'myModule'));
beforeEach(angular.mock.module(bard.$httpBackend, 'myModule'));
beforeEach(inject(function(_myService_: MyService, _$rootScope_: angular.IRootScopeService) {
myService = _myService_;
@@ -63,7 +63,7 @@ module bardTests {
function test_$q() {
var myService: MyService;
beforeEach(module(bard.$q, bard.$httpBackend, 'myModule'));
beforeEach(angular.mock.module(bard.$q, bard.$httpBackend, 'myModule'));
beforeEach(inject(function(_myService_: MyService) {
myService = _myService_;
@@ -139,7 +139,7 @@ module bardTests {
* bard.fakeLogger
*/
function test_fakeLogger() {
beforeEach(module('myModule', bard.fakeLogger));
beforeEach(angular.mock.module('myModule', bard.fakeLogger));
////
beforeEach(bard.appModule('myModule', bard.fakeLogger));
////
@@ -150,7 +150,7 @@ module bardTests {
* bard.fakeRouteHelperProvider
*/
function test_fakeRouteHelperProvider() {
beforeEach(module('myModule', bard.fakeRouteHelperProvider));
beforeEach(angular.mock.module('myModule', bard.fakeRouteHelperProvider));
////
beforeEach(bard.appModule('myModule', bard.fakeRouteHelperProvider));
////
@@ -161,7 +161,7 @@ module bardTests {
* bard.fakeRouteProvider
*/
function test_fakeRouteProvider() {
beforeEach(module('myModule', bard.fakeRouteProvider));
beforeEach(angular.mock.module('myModule', bard.fakeRouteProvider));
////
beforeEach(bard.appModule('myModule', bard.fakeRouteProvider));
////
@@ -172,7 +172,7 @@ module bardTests {
* bard.fakeStateProvider
*/
function test_fakeStateProvider() {
beforeEach(module('myModule', bard.fakeStateProvider));
beforeEach(angular.mock.module('myModule', bard.fakeStateProvider));
////
beforeEach(bard.appModule('myModule', bard.fakeStateProvider));
////
@@ -183,7 +183,7 @@ module bardTests {
* bard.fakeToastr
*/
function test_fakeToastr() {
beforeEach(module('myModule', bard.fakeToastr));
beforeEach(angular.mock.module('myModule', bard.fakeToastr));
////
beforeEach(bard.appModule('myModule', bard.fakeToastr));
////
+1 -14
View File
@@ -9,7 +9,7 @@ declare module Microsoft.Maps.AdvancedShapes {
export class EntityCollection {
constructor(options: EntityCollectionOptions);
constructor(options?: EntityCollectionOptions);
clear(): void;
get(index: number): Entity;
@@ -24,10 +24,6 @@ declare module Microsoft.Maps.AdvancedShapes {
removeAt(index: number): Entity;
setOptions(options: EntityCollectionOptions): void;
toString(): string;
entityAdded: (args: EntityChangeArgs) => any;
entityChanged: (args: EntityChangeArgs) => any;
entityRemoved: (args: EntityChangeArgs) => any;
}
export class Polygon implements Entity {
@@ -43,15 +39,6 @@ declare module Microsoft.Maps.AdvancedShapes {
setLocations(locations: Location[]): void;
setOptions(options: PolylineOptions): void;
toString(): string;
click: (eventArgs: MouseEventArgs) => void;
dbclick: (eventArgs: MouseEventArgs) => void;
entitychanged: (entity: Entity) => void;
mousedown: (eventArgs: MouseEventArgs) => void;
mouseout: (eventArgs: MouseEventArgs) => void;
mouseover: (eventArgs: MouseEventArgs) => void;
mouseup: (eventArgs: MouseEventArgs) => void;
rightclick: (eventArgs: MouseEventArgs) => void;
}
}
-25
View File
@@ -79,10 +79,6 @@ declare module Microsoft.Maps.Directions {
isExactLocation(): boolean;
isViapoint(): boolean;
setOptions(options: WaypointOptions): void;
changed: (args: WaypointEventArgs) => void;
geocoded: (args: WaypointEventArgs) => void;
reverseGeocoded: (args: WaypointEventArgs) => void;
}
export interface DirectionsRenderOptions {
@@ -185,27 +181,6 @@ declare module Microsoft.Maps.Directions {
setMapView(): void;
setRenderOptions(options: DirectionsRenderOptions): void;
setRequestOptions(options: DirectionsRequestOptions): void;
afterRouteSelectorRender: (args: RouteSelectorRenderEventArgs) => void;
afterStepRender: (args: DirectionsStepRenderEventArgs) => void;
afterSummaryRender: (args: RouteSummaryRenderEventArgs) => void;
afterWaypointRender: (args: WaypointRenderEventArgs) => void;
beforeDisambiguationRender: (args: DisambiguationRenderEventArgs) => void;
beforeRouteSelectorRender: (args: RouteSelectorRenderEventArgs) => void;
beforeStepRender: (args: DirectionsStepRenderEventArgs) => void;
beforeSummaryRender: (args: RouteSummaryRenderEventArgs) => void;
beforeWaypointRender: (args: WaypointRenderEventArgs) => void;
directionsError: (args: DirectionsErrorEventArgs) => void;
directionsUpdated: (args: DirectionsEventArgs) => void;
dragDropCompleted: () => void;
itineraryStepClicked: (args: DirectionsStepEventArgs) => void;
mouseEnterRouteSelector: (args: RouteSelectorEventArgs) => void;
mouseEnterStep: (args: DirectionsStepEventArgs) => void;
mouseLeaveRouteSelector: (args: RouteSelectorEventArgs) => void;
mouseLeaveStep: (args: DirectionsStepEventArgs) => void;
routeSelectorClicked: (args: RouteSelectorEventArgs) => void;
waypointAdded: (args: WaypointEventArgs) => void;
waypointRemoved: (args: WaypointEventArgs) => void;
}
export interface DirectionsStepEventArgs {
+22 -22
View File
@@ -6,7 +6,7 @@
/// <reference path="Microsoft.Maps.d.ts"/>
declare module Microsoft.Maps.Search {
export interface Address {
addressLine: string;
adminDistrict: string;
@@ -25,12 +25,12 @@ declare module Microsoft.Maps.Search {
}
export interface GeocodeRequestOptions {
bounds: LocationRect;
callback: (result: GeocodeResult, userData: any) => any;
bounds?: LocationRect;
callback?: (result: GeocodeResult, userData: any) => any;
count: number;
errorCallback: (options: GeocodeRequestOptions) => any;
timeout: number;
userData: any;
errorCallback?: (options: GeocodeRequestOptions) => any;
timeout?: number;
userData?: any;
where:string;
}
@@ -71,15 +71,15 @@ declare module Microsoft.Maps.Search {
}
export interface ReverseGeocodeRequestOptions {
callback: (result: PlaceResult, userData: any) => any;
errorCallback: (options: ReverseGeocodeRequestOptions) => any;
location: Location;
timeout: number;
userData:any;
callback?: (result: PlaceResult, userData: any) => any;
errorCallback?: (options: ReverseGeocodeRequestOptions) => any;
location?: Location;
timeout?: number;
userData?:any;
}
export class SearchManager {
constructor(map: Map);
geocode(request: GeocodeRequestOptions): void;
@@ -104,16 +104,16 @@ declare module Microsoft.Maps.Search {
}
export interface SearchRequestOptions {
callback:(result: SearchResponse, userData: any)=>any;
callback?:(result: SearchResponse, userData: any)=>any;
count: number;
errorCallback:(options: SearchRequestOptions)=>any;
query: string;
startIndex: number;
timeout: number;
entityType: string;
userData: any;
what: string;
where:string;
errorCallback?:(options: SearchRequestOptions)=>any;
query?: string;
startIndex?: number;
timeout?: number;
entityType?: string;
userData?: any;
what?: string;
where?:string;
}
export interface SearchResponse {
@@ -149,4 +149,4 @@ declare module Microsoft.Maps.Search {
website:string;
}
}
}
+15 -18
View File
@@ -11,20 +11,23 @@ declare module Microsoft.Maps.VenueMaps {
eventArgs: MouseEventArgs;
}
export interface PrimitiveResponse {
eventArgs: Primitive;
}
export interface Directory {
addToDOM(div: HTMLElement, sortOrder: DirectorySortOrder, to_group_or_not: DirectoryGrouping): void;
createUIElements(): void;
handleMouseClick(response: MouseResponse): void;
handleMouseOut(response: MouseResponse): void;
handleMouseOver(response: MouseResponse): void;
handleMouseClick(e: (response: MouseResponse) => void): void;
handleMouseClick(e: (response: PrimitiveResponse) => void): void;
handleMouseOut(e: (response: MouseResponse) => void): void;
handleMouseOut(e: (response: PrimitiveResponse) => void): void;
handleMouseOver(e: (response: MouseResponse) => void): void;
handleMouseOver(e: (response: PrimitiveResponse) => void): void;
isInDOM(): boolean;
removeFromDOM(): void;
setHeight(height: number): void;
click: (eventArgs: MouseEventArgs) => any;
mouseOut: (eventArgs: MouseEventArgs) => any;
mouseOver: (eventArgs: MouseEventArgs) => any;
}
export enum DirectoryGrouping {
@@ -67,10 +70,10 @@ declare module Microsoft.Maps.VenueMaps {
}
export interface NearbyVenueOptions {
callback: (maps: Array<VenueMap>) => any;
location: Location;
map: Map;
radius: number;
callback?: (maps: Array<VenueMap>) => any;
location?: Location;
map?: Map;
radius?: number;
}
export interface Polygon {
@@ -116,12 +119,6 @@ declare module Microsoft.Maps.VenueMaps {
hide(): void;
setActiveFloor(floor: string): void;
show(): void;
click: (eventArgs: Primitive) => any;
close: () => any;
footprintclick: (eventArgs: Primitive) => any;
mouseout: (eventArgs: Primitive) => any;
mouseover: (eventArgs: Primitive) => any;
}
export interface VenueMapCreationOptions {
@@ -138,4 +135,4 @@ declare module Microsoft.Maps.VenueMaps {
getNearbyVenues(options: NearbyVenueOptions): void;
}
}
}
+35 -74
View File
@@ -45,7 +45,7 @@ declare module Microsoft.Maps {
getNorth(): number;
getNorthwest(): Location;
getSouth(): number;
getSouthEast(): Location;
getSoutheast(): Location;
getWest(): number;
intersects(rect: LocationRect): boolean;
toString(): string;
@@ -96,7 +96,8 @@ declare module Microsoft.Maps {
export class Map {
constructor(containerElement: HTMLElement, options: MapOptions);
constructor(containerElement: HTMLElement, options?: MapOptions);
constructor(containerElement: HTMLElement, options?: ViewOptions);
entities: EntityCollection;
@@ -137,39 +138,25 @@ declare module Microsoft.Maps {
setMapType(mapTypeId: MapTypeId): void;
setOptions(options: MapOptions): void;
setView(options: ViewOptions): void;
tryLocationToPixel(locations: Array<Location>, reference?: PixelReference): any;
tryPixelToLocation(points: Array<Point>, reference?: PixelReference): any;
click: (eventArgs: MouseEventArgs) => void;
copyrightchanged: () => void;
dblclick: (eventArgs: MouseEventArgs) => void;
imagerychanged: () => void;
keydown: (eventArgs: KeyEventArgs) => void;
keypress: (eventArgs: KeyEventArgs) => void;
keyup: (eventArgs: KeyEventArgs) => void;
maptypechanged: () => void;
mousedown: (eventArgs: MouseEventArgs) => void;
mousemove: (eventArgs: MouseEventArgs) => void;
mouseout: (eventArgs: MouseEventArgs) => void;
mouseover: (eventArgs: MouseEventArgs) => void;
mouseup: (eventArgs: MouseEventArgs) => void;
mousewheel: (eventArgs: MouseEventArgs) => void;
rightlick: (eventArgs: MouseEventArgs) => void;
targetviewchanged: () => void;
tiledownloadcomplete: () => void;
viewchange: () => void;
viewchangeend: () => void;
viewchangestart: () => void;
tryLocationToPixel(locations: Location, reference?: PixelReference): Point;
tryLocationToPixel(locations: Array<Location>, reference?: PixelReference): Array<Point>;
tryPixelToLocation(points: Point, reference?: PixelReference): Location;
tryPixelToLocation(points: Array<Point>, reference?: PixelReference): Array<Location>;
}
export class MapMode {
getDrawShapesInSingleLayer(): boolean;
getShouldClipPolygons(): boolean;
setOptions(options: MapOptions): void;
setOptions(options: MapModeOptions): void;
setViewChangeEndDelay(delay: number): void;
}
export interface MapModeOptions {
shouldClipPolygons?: boolean;
drawShapesInSingleLayer?:boolean;
}
export interface MapOptions {
backgroundColor?: Color;
@@ -272,14 +259,14 @@ declare module Microsoft.Maps {
}
export interface EntityCollectionOptions {
bubble: boolean;
visible: boolean;
zIndex: number;
bubble?: boolean;
visible?: boolean;
zIndex?: number;
}
export class EntityCollection {
constructor(options: EntityCollectionOptions);
constructor(options?: EntityCollectionOptions);
clear(): void;
get(index: number): Entity;
@@ -295,9 +282,6 @@ declare module Microsoft.Maps {
setOptions(options: EntityCollectionOptions): void;
toString(): string;
entityAdded: (args: EntityChangeArgs) => any;
entityChanged: (args: EntityChangeArgs) => any;
entityRemoved: (args: EntityChangeArgs) => any;
}
export class Infobox {
@@ -325,11 +309,6 @@ declare module Microsoft.Maps {
setLocation(location: Location): void;
setOptions(options: InfoboxOptions): void;
toString(): string;
click: (eventArgs: MouseEventArgs) => void;
entitychanged: (entity: Entity) => void;
mouseenter: (eventArgs: MouseEventArgs) => void;
mouseleave: (eventArgs: MouseEventArgs) => void;
}
export interface Action {
@@ -378,15 +357,11 @@ declare module Microsoft.Maps {
setLocations(locations: Array<Location>): void;
setOptions(options: PolylineOptions): void;
toString(): string;
}
click: (eventArgs: MouseEventArgs) => void;
dblclick: (eventArgs: MouseEventArgs) => void;
entitychanged: (entity: Entity) => void;
mousedown: (eventArgs: MouseEventArgs) => void;
mouseout: (eventArgs: MouseEventArgs) => void;
mouseover: (eventArgs: MouseEventArgs) => void;
mouseup: (eventArgs: MouseEventArgs) => void;
rightclick: (eventArgs: MouseEventArgs) => void;
export class Position {
coords: Coordinates;
timestamp: string;
}
export interface PolylineOptions {
@@ -409,20 +384,11 @@ declare module Microsoft.Maps {
setLocations(locations: Location[]): void;
setOptions(options: PolylineOptions): void;
toString(): string;
click: (eventArgs: MouseEventArgs) => void;
dbclick: (eventArgs: MouseEventArgs) => void;
entitychanged: (entity: Entity) => void;
mousedown: (eventArgs: MouseEventArgs) => void;
mouseout: (eventArgs: MouseEventArgs) => void;
mouseover: (eventArgs: MouseEventArgs) => void;
mouseup: (eventArgs: MouseEventArgs) => void;
rightclick: (eventArgs: MouseEventArgs) => void;
}
export interface PolygonOptions {
fillColor?: Color;
infoBox?: Infobox;
infobox?: Infobox;
strokeColor?: Color;
strokeDashArray?: string;
strokeThickness?: number;
@@ -446,18 +412,6 @@ declare module Microsoft.Maps {
setLocation(location: Location): void;
setOptions(options: PushpinOptions): void;
toString(): string;
click: (eventArgs: MouseEventArgs) => void;
dblclick: (eventArgs: MouseEventArgs) => void;
drag: (object: Pushpin) => any;
dragend: (eventArgs: MouseEventArgs) => void;
dragstart: (eventArgs: MouseEventArgs) => void;
entitychanged: (object: { entity: Entity; }) => any;
mousedown: (eventArgs: MouseEventArgs) => void;
mouseout: (eventArgs: MouseEventArgs) => void;
mouseover: (eventArgs: MouseEventArgs) => void;
mouseup: (eventArgs: MouseEventArgs) => void;
rightclick: (eventArgs: MouseEventArgs) => void;
}
export enum EntityState {
@@ -487,13 +441,11 @@ declare module Microsoft.Maps {
constructor(options: TileLayerOptions);
getOpacty(): number;
getOpacity(): number;
getTileSource(projection: string): TileSource;
getZIndex(): number;
setOptions(options: TileLayerOptions): void;
toString(): string;
tiledownloadcomplete: () => void;
}
export class TileSource {
@@ -509,7 +461,7 @@ declare module Microsoft.Maps {
export interface TileSourceOptions {
height?: number;
uriConstructor: string;
uriConstructor: any;
width?: number;
}
@@ -550,9 +502,18 @@ declare module Microsoft.Maps {
removeAccuracyCircle(): void;
}
export interface PositionOptionsErrorCallbackResult {
internalError: PositionError;
errorCode:number;
}
export interface PositionOptions {
enableHighAccuracy?: boolean;
errorCallback?:(result:PositionOptionsErrorCallbackResult)=>void;
}
export interface PositionCircleOptions {
polygonOptions: PolygonOptions;
showOnMap: boolean;
showOnMap?: boolean;
}
export class PositionError {
@@ -567,7 +528,7 @@ declare module Microsoft.Maps {
homeRegion?: string;
}
export function loadModule(moduleKey: string, options: ModuleOptions): void;
export function loadModule(moduleKey: string, options?: ModuleOptions): void;
export function moduleLoaded(moduleKey: string): void;
export function registerModule(moduleKey: string, scriptUrl: string, options?: ModuleOptions): void;
}
+5
View File
@@ -579,6 +579,8 @@ interface ViewPrototype {
route?: any;
url?: string
};
[propertyName: string]: any;
}
/////////////////////////////////////////
@@ -643,6 +645,8 @@ interface ModelPrototype {
destroy?: { url?: string };
update?: { url?: string };
};
[propertyName: string]: string | boolean | Object | Validator;
}
/////////////////////////////////////////
@@ -682,6 +686,7 @@ interface CollectionPrototype {
destroy?: { url?: string };
update?: { url?: string };
};
[propertyName: string]: any;
}
interface Extendable<T> {
+1 -2
View File
@@ -20,8 +20,7 @@ declare class Promise<R> implements Promise.Thenable<R> {
/**
* Create a new promise. The passed in function will receive functions `resolve` and `reject` as its arguments which can be called to seal the fate of the created promise.
*/
constructor(callback: (resolve: (thenable: Promise.Thenable<R>) => void, reject: (error: any) => void) => void);
constructor(callback: (resolve: (result: R) => void, reject: (error: any) => void) => void);
constructor(callback: (resolve: (thenableOrResult: R | Promise.Thenable<R>) => void, reject: (error: any) => void) => void);
/**
* Promises/A+ `.then()` with progress handler. Returns a new promise chained from this promise. The new promise will be rejected or resolved dedefer on the passed `fulfilledHandler`, `rejectedHandler` and the state of this promise.
+5
View File
@@ -144,6 +144,10 @@ var BlueBird: typeof Promise;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
var nodeCallbackFunc = (callback: (err: any, result: string) => void) => {}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
fooThen = fooProm;
barThen = barProm;
@@ -616,6 +620,7 @@ func = Promise.promisify(f, obj);
;
obj = Promise.promisifyAll(obj);
anyProm = Promise.fromNode(callback => nodeCallbackFunc(callback));
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+8 -3
View File
@@ -20,8 +20,7 @@ declare class Promise<R> implements Promise.Thenable<R>, Promise.Inspection<R> {
/**
* Create a new promise. The passed in function will receive functions `resolve` and `reject` as its arguments which can be called to seal the fate of the created promise.
*/
constructor(callback: (resolve: (thenable: Promise.Thenable<R>) => void, reject: (error: any) => void) => void);
constructor(callback: (resolve: (result: R) => void, reject: (error: any) => void) => void);
constructor(callback: (resolve: (thenableOrResult: R | Promise.Thenable<R>) => void, reject: (error: any) => void) => void);
/**
* Promises/A+ `.then()` with progress handler. Returns a new promise chained from this promise. The new promise will be rejected or resolved dedefer on the passed `fulfilledHandler`, `rejectedHandler` and the state of this promise.
@@ -416,7 +415,13 @@ declare class Promise<R> implements Promise.Thenable<R>, Promise.Inspection<R> {
* Note that the original methods on the object are not overwritten but new methods are created with the `Async`-postfix. For example, if you `promisifyAll()` the node.js `fs` object use `fs.statAsync()` to call the promisified `stat` method.
*/
// TODO how to model promisifyAll?
static promisifyAll(target: Object): Object;
static promisifyAll(target: Object, options?: Object): Object;
/**
* Returns a promise that is resolved by a node style callback function.
*/
static fromNode(resolver: (callback: (err: any, result: any) => void) => void): Promise<any>;
/**
* Returns a function that can use `yield` to run asynchronous code synchronously. This feature requires the support of generators which are drafted in the next version of the language. Node version greater than `0.11.2` is required and needs to be executed with the `--harmony-generators` (or `--harmony`) command-line switch.
+1 -1
View File
@@ -6,7 +6,7 @@
/// <reference path="../express/express.d.ts" />
declare module "body-parser" {
import express = require('express');
import * as express from "express";
/**
* bodyParser: use individual json/urlencoded middlewares
+2 -1
View File
@@ -6,7 +6,8 @@
/// <reference path="../node/node.d.ts" />
declare module Boom {
interface BoomError {
export interface BoomError {
data: any;
reformat: () => void;
isBoom: boolean;
+1 -2
View File
@@ -27,14 +27,12 @@ bootbox.prompt("Enter 'ok' to pass test", function (result) {
console.log(result);
});
bootbox.prompt({
title: "Wassup?",
message: "Enter 'ok' to pass test", callback: function (result) {
console.log(result);
}
});
bootbox.prompt({
size: "large",
title: "Wassup?",
message: "Enter 'ok' to pass test", callback: function (result) {
console.log(result);
}
@@ -42,6 +40,7 @@ bootbox.prompt({
bootbox.dialog({
title: "Wassup?",
message: "Test Dialog",
callback: function (result) { }
});
+7 -3
View File
@@ -1,6 +1,6 @@
// Type definitions for Bootbox 4.4.0
// Project: https://github.com/makeusabrew/bootbox
// Definitions by: Vincent Bortone <https://github.com/vbortone/>, Kon Pik <https://github.com/konpikwastaken/>, Anup Kattel <https://github.com/kanup/>
// Definitions by: Vincent Bortone <https://github.com/vbortone/>, Kon Pik <https://github.com/konpikwastaken/>, Anup Kattel <https://github.com/kanup/>, Dominik Schroeter <https://github.com/icereed/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts" />
@@ -28,6 +28,10 @@ interface BootboxButton {
callback?: () => any;
}
interface BootboxButtonMap {
[key: string]: BootboxButton | Function;
}
interface BootboxDialogOptions {
message: string | Element;
title?: string | Element;
@@ -40,7 +44,7 @@ interface BootboxDialogOptions {
animate?: boolean;
className?: string;
size?: string;
buttons?: Object; // complex object where each key is of type BootboxButton
buttons?: BootboxButtonMap; // complex object where each key is of type BootboxButton
}
interface BootboxDefaultOptions {
@@ -69,7 +73,7 @@ interface BootboxStatic {
dialog(options: BootboxDialogOptions): JQuery;
setDefaults(options: BootboxDefaultOptions): void;
hideAll(): void;
addLocale(name: string, values: BootboxLocaleValues): void;
removeLocale(name: string): void;
setLocale(name: string): void;
+18 -11
View File
@@ -1,4 +1,4 @@
// Type definitions for Bootstrap 2.2
// Type definitions for Bootstrap 3.3.5
// Project: http://twitter.github.com/bootstrap/
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -7,7 +7,7 @@
/// <reference path="../jquery/jquery.d.ts"/>
interface ModalOptions {
backdrop?: boolean;
backdrop?: boolean|string;
keyboard?: boolean;
show?: boolean;
remote?: string;
@@ -27,24 +27,28 @@ interface ScrollSpyOptions {
interface TooltipOptions {
animation?: boolean;
html?: boolean;
placement?: any;
placement?: string | Function;
selector?: string;
title?: any;
title?: string | Function;
trigger?: string;
delay?: any;
container?: any;
template?: string;
delay?: number | Object;
container?: string | boolean;
viewport?: string | Function | Object;
}
interface PopoverOptions {
animation?: boolean;
html?: boolean;
placement?: any;
placement?: string | Function;
selector?: string;
trigger?: string;
title?: any;
title?: string | Function;
template?: string;
content?: any;
delay?: any;
container?: any;
delay?: number | Object;
container?: string | boolean;
viewport?: string | Function | Object;
}
interface CollapseOptions {
@@ -55,6 +59,8 @@ interface CollapseOptions {
interface CarouselOptions {
interval?: number;
pause?: string;
wrap?: boolean;
keybord?: boolean;
}
interface TypeaheadOptions {
@@ -68,7 +74,8 @@ interface TypeaheadOptions {
}
interface AffixOptions {
offset?: any;
offset?: number | Function | Object;
target?: any;
}
interface JQuery {
+7
View File
@@ -0,0 +1,7 @@
import Bowser = require('bowser');
Bowser.msedge === true;
Bowser.test(['msie']) === true;
Bowser.a === Bowser.c;
Bowser.osversion > 10;
Bowser.osversion === '10.1A';
+54
View File
@@ -0,0 +1,54 @@
// Type definitions for Bowser 1.x
// Project: https://github.com/ded/bowser
// Definitions by: Paulo Cesar <https://github.com/pocesar>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module 'bowser' {
var def: BowserModule.IBowser;
export = def;
}
declare module BowserModule {
export interface IBowserUA {
msie: boolean;
chrome: boolean;
webkit: boolean;
phantom: boolean;
opera: boolean;
safari: boolean;
android: boolean;
ios: boolean;
webos: boolean;
msedge: boolean;
seamonkey: boolean;
firefox: boolean;
yandexbrowser: boolean;
blackberry: boolean;
tablet: boolean;
mobile: boolean;
silk: boolean;
bada: boolean;
tizen: boolean;
windowsphone: boolean;
firefoxos: boolean;
gecko: boolean;
sailfish: boolean;
chromeBook: boolean;
/** Grade A browser */
a: boolean;
/** Grade C browser */
c: boolean;
/** Grade X browser */
x: boolean;
name: string;
version: string;
osversion: string|number;
}
export interface IBowser extends IBowserUA {
test(browserList: string[]): boolean;
_detect(ua: string): IBowser;
}
}
+1
View File
@@ -459,6 +459,7 @@ declare module breeze {
interface EntityManagerProperties {
serviceName?: string;
dataService?: DataService;
metadataStore?: MetadataStore;
queryOptions?: QueryOptions;
saveOptions?: SaveOptions;
validationOptions?: ValidationOptions;
+2 -2
View File
@@ -1,6 +1,6 @@
/// <reference path="bunyan.d.ts" />
import bunyan = require('bunyan');
import * as bunyan from 'bunyan';
var ringBufferOptions:bunyan.RingBufferOptions = {
limit: 100
@@ -57,7 +57,7 @@ var log = bunyan.createLogger(options);
log.addSerializers(bunyan.stdSerializers);
var child = log.child({name: 'child'});
child.reopenFileStreams();
log.addStream({path: '/dev/null', name: 'stream1'});
log.addStream({path: '/dev/null'});
child.level(bunyan.DEBUG);
child.level('debug');
child.levels(0, bunyan.ERROR);
+5 -6
View File
@@ -6,9 +6,7 @@
/// <reference path="../node/node.d.ts" />
declare module "bunyan" {
import events = require('events');
import EventEmitter = events.EventEmitter;
import WritableStream = NodeJS.WritableStream;
import { EventEmitter } from 'events';
class Logger extends EventEmitter {
constructor(options:LoggerOptions);
@@ -18,6 +16,7 @@ declare module "bunyan" {
child(obj:Object, simple?:boolean):Logger;
reopenFileStreams():void;
level():string|number;
level(value: number | string):void;
levels(name: number | string, value: number | string):void;
@@ -50,8 +49,8 @@ declare module "bunyan" {
interface LoggerOptions {
name: string;
streams?: Stream[];
level?: string;
stream?: WritableStream;
level?: string | number;
stream?: NodeJS.WritableStream;
serializers?: Serializers;
src?: boolean;
}
@@ -64,7 +63,7 @@ declare module "bunyan" {
type?: string;
level?: number | string;
path?: string;
stream?: WritableStream | Stream;
stream?: NodeJS.WritableStream | Stream;
closeOnExit?: boolean;
}
+177 -160
View File
@@ -108,7 +108,7 @@ declare module CanvasJS {
*/
animationEnabled?: boolean;
/**
* While exporting any chart, Chart is used as the default fine name with corresponding extension jpg or png. You can override this name using exportFileName property.
* While exporting any chart, "Chart" is used as the default fine name with corresponding extension "jpg" or "png". You can override this name using exportFileName property.
* Default: Chart
*/
exportFileName?: string;
@@ -126,25 +126,25 @@ declare module CanvasJS {
zoomEnabled?: boolean;
/**
* Sets the theme of the Chart. Various predefined themes are bundled along with the library. User can easily switch these themes by changing theme property to the below mentioned options.
* Default: theme1
* Options: theme1″,”theme2, theme3
* Default: "theme1"
* Options: "theme1","theme2", "theme3"
*/
theme?: string;
/**
* Sets the background color of entire Chart Area. Values can be HTML Color Name, hex code or rgba values
* Default: white
* Example: yellow, #F5DEB3..
* Sets the background color of entire Chart Area. Values can be "HTML Color Name", "hex code" or "rgba values"
* Default: "white"
* Example: "yellow", "#F5DEB3"..
*/
backgroundColor?: string;
/**
* Sets the colorSet of the Chart. Color Set is an array of colors that are used to render data. Various predefined Color Sets are bundled along with the library. You can either choose from the pre-defined Color Sets or define your own Color Set.
* Default: colorset1 or as defined in the selected theme
* Example: colorSet1, colorSet2, colorSet3
* Default: "colorset1" or as defined in the selected theme
* Example: "colorSet1", "colorSet2", "colorSet3"
*/
colorSet?: string;
/**
* CanvasJS allows you to localize various culture / language / country specific elements in the Chart like number formatting style where you can choose which character to use as a decimal separator and as a digit group separator (also referred to as a thousand separator). By default CanvasJS is set to Neutral English Culture en.
* Default: en
* CanvasJS allows you to localize various culture / language / country specific elements in the Chart like number formatting style where you can choose which character to use as a decimal separator and as a digit group separator (also referred to as a thousand separator). By default CanvasJS is set to Neutral English Culture "en".
* Default: "en"
*/
culture?: string;
/**
@@ -190,19 +190,19 @@ declare module CanvasJS {
/**
* Sets the Titles text.
* Default: null
* Example: Chart title
* Example: "Chart title"
*/
text?: string;
/**
* This property lets you align the Chart Title vertically.
* Default: top
* Options: top, center, bottom
* Default: "top"
* Options: "top", "center", "bottom"
*/
verticalAlign?: string;
/**
* This property lets you align the Chart Title horizontally.
* Default: center
* Options: left, right, center
* Default: "center"
* Options: "left", "right", "center"
*/
horizontalAlign?: string;
/**
@@ -213,26 +213,26 @@ declare module CanvasJS {
fontSize?: number;
/**
* Sets the Font Family of Chart Title.
* Default: Calibri, Optima, Candara, Verdana, Geneva, sans-serif
* Example: arial , tahoma, verdana ..
* Default: "Calibri, Optima, Candara, Verdana, Geneva, sans-serif"
* Example: "arial" , "tahoma", "verdana" ..
*/
fontFamily?: string;
/**
* Sets the Font Weight used in the Chart Title.
* Default: bold
* Options: lighter, normal, bold , bolder
* Default: "bold"
* Options: "lighter", "normal", "bold" , "bolder"
*/
fontWeight?: string;
/**
* Sets the font color of Chart Title. The value of fontColor can be a HTML Color Name or hex code .
* Default: #3A3A3A
* Example: red, #FAC003 ..
* Sets the font color of Chart Title. The value of fontColor can be a "HTML Color Name" or "hex" code .
* Default: "#3A3A3A"
* Example: "red", "#FAC003" ..
*/
fontColor?: string;
/**
* Sets the fontStyle of Chart Title. fontStyle can be set to one of the below options.
* Default: normal
* Options: normal, italic , oblique
* Default: "normal"
* Options: "normal", "italic" , "oblique"
*/
fontStyle?: string;
/**
@@ -248,15 +248,15 @@ declare module CanvasJS {
*/
cornerRadius?: number;
/**
* Sets the color of border around Chart Title. Values of borderColor can be HTML Color Name or hex code .
* Default: black
* Example: red, #FF0000 ..
* Sets the color of border around Chart Title. Values of borderColor can be "HTML Color Name" or "hex" code .
* Default: "black"
* Example: "red", "#FF0000" ..
*/
borderColor?: string;
/**
* Sets the background color of Chart Title. Values can be HTML Color Name or hex code.
* Sets the background color of Chart Title. Values can be "HTML Color Name" or "hex" code.
* Default: null
* Example: red, #FF0000 ..
* Example: "red", "#FF0000" ..
*/
backgroundColor?: string;
/**
@@ -274,6 +274,13 @@ declare module CanvasJS {
}
interface ChartLegendOptions {
/**
* Sets the cursor type for legend items.
* Default: "default"
* Examples: "pointer", "crosshair" ..
*/
cursor?: string;
/**
* Sets the font Size of Legend Text in pixels.
* Default: 12
@@ -282,38 +289,38 @@ declare module CanvasJS {
fontSize?: number;
/**
* Sets the Font Family of Legend Text.
* Default: calibri
* Example: arial , tahoma, verdana ..
* Default: "calibri"
* Example: "arial" , "tahoma", "verdana" ..
*/
fontFamily?: string;
/**
* Sets the font color of Legend Text . The value of fontColor can be a HTML Color Name or hex code .
* Default: black
* Example: red, #FAC003 ..
* Sets the font color of Legend Text . The value of fontColor can be a "HTML Color Name" or "hex" code .
* Default: "black"
* Example: "red", "#FAC003" ..
*/
fontColor?: string;
/**
* Sets the Font Weight of Legend Text.
* Default: normal
* Example: lighter, normal, bold , bolder
* Default: "normal"
* Example: "lighter", "normal", "bold" , "bolder"
*/
fontWeight?: string;
/**
* Sets the fontStyle of Legend Text. fontStyle can be set to one of the below options.
* Default: normal
* Example: normal, italic , oblique
* Default: "normal"
* Example: "normal", "italic" , "oblique"
*/
fontStyle?: string;
/**
* This property lets you align the Legend Position vertically.
* Default: bottom
* Example: top, center, bottom
* Default: "bottom"
* Example: "top", "center", "bottom"
*/
verticalAlign?: string;
/**
* This property lets you align the Legend Position horizontally.
* Default: right
* Example: left, right, center
* Default: "right"
* Example: "left", "right", "center"
*/
horizontalAlign?: string;
/**
@@ -373,13 +380,13 @@ declare module CanvasJS {
/**
* Sets the Axis Title.
* Default: null
* Example: Axis X Title
* Example: "Axis X Title"
*/
title?: string;
/**
* Sets the Font Color of Axis Title. The value of titleFontColor can be a HTML Color Name or hex code .
* Default: #666666
* Example: red, #006400 .
* Sets the Font Color of Axis Title. The value of titleFontColor can be a "HTML Color Name" or "hex" code .
* Default: "#666666"
* Example: "red", "#006400" .
*/
titleFontColor?: string;
/**
@@ -390,20 +397,20 @@ declare module CanvasJS {
titleFontSize?: number;
/**
* Sets the Font Family of Axis Title.
* Default: Calibri, Optima, Candara, Verdana, Geneva, sans-serif
* Example: calibri, tahoma, verdana ..
* Default: "Calibri, Optima, Candara, Verdana, Geneva, sans-serif"
* Example: "calibri", "tahoma, "verdana" ..
*/
titleFontFamily?: string;
/**
* Sets the Font Weight used in the Axis Title. It can be set to one of the options below.
* Default: normal
* Options: lighter, normal, bold , bolder
* Default: "normal"
* Options: "lighter", "normal", "bold" , "bolder"
*/
titleFontWeight?: string;
/**
* Sets the Font Style of Axis Title. It can be set to one of the below options.
* Default: normal
* Options: normal, italic , oblique
* Default: "normal"
* Options: "normal", "italic" , "oblique"
*/
titleFontStyle?: string;
/**
@@ -419,9 +426,9 @@ declare module CanvasJS {
*/
labelAngle?: number;
/**
* Sets the Axis Label color. The value of labelFontColor can be a HTML Color Name or hex code .
* Default: grey
* Example: red, #FAC003 ..
* Sets the Axis Label color. The value of labelFontColor can be a "HTML Color Name" or "hex" code .
* Default: "grey"
* Example: "red", "#FAC003" ..
*/
labelFontColor?: string;
/**
@@ -432,32 +439,32 @@ declare module CanvasJS {
labelFontSize?: number;
/**
* Sets the Font Family of Axis labels.
* Default: Calibri, Optima, Candara, Verdana, Geneva, sans-serif
* Example: calibri, tahoma, verdana ..
* Default: "Calibri, Optima, Candara, Verdana, Geneva, sans-serif"
* Example: "calibri", "tahoma", "verdana" ..
*/
labelFontFamily?: string;
/**
* Set the font Weight used in Axis Labels. It can be set to one of the options below.
* Default: normal
* Options: lighter, normal, bold , bolder
* Default: "normal"
* Options: "lighter", "normal", "bold" , "bolder"
*/
labelFontWeight?: string;
/**
* Sets the Font Style of Axis Labels. It can be set to one of the below options.
* Default: normal
* Options: italic, oblique, normal
* Default: "normal"
* Options: "italic", "oblique", "normal"
*/
labelFontStyle?: string;
/**
* A string that prepends all the labels on axisX.
* Default: null
* Example: “$”,”cat..
* Example: "$","cat"..
*/
prefix?: string;
/**
* A string that appends all the labels on axisX.
* Default: null
* Example: “$”,”cat..
* Example: "$","cat"..
*/
suffix?: string;
/**
@@ -483,10 +490,10 @@ declare module CanvasJS {
*/
interval?: number;
/**
* intervalType is the unit of interval property. intervalType is by default set to number and hence you need to specify the interval type (eg week, month, etc) depending on the type of interval you intend to set. If required interval is 3 months, you need to provide interval as 3 and intervalType as month
* Default: Automatically handled when interval property is not set. Defaults to number when you set the interval.
* Option: number”,”millisecond ,second”,” minute, hour, day, month ,year
* Example: for interval as 15 minutes, set interval as 15, and set intervalType as minute,
* intervalType is the unit of interval property. intervalType is by default set to "number" and hence you need to specify the interval type (eg "week", "month", etc) depending on the type of interval you intend to set. If required interval is 3 months, you need to provide interval as 3 and intervalType as "month"
* Default: Automatically handled when interval property is not set. Defaults to "number" when you set the interval.
* Option: "number","millisecond" ,"second"," minute", "hour", "day", "month" ,"year"
* Example: for interval as 15 minutes, set interval as 15, and set intervalType as "minute",
*/
intervalType?: string;
/**
@@ -496,9 +503,9 @@ declare module CanvasJS {
*/
tickLength?: number;
/**
* Sets the color of Tick Marks drawn on the axis. The value of tickColor can be a HTML Color Name or hex code .
* Default: #BBBBBB
* Example: red, #006400.
* Sets the color of Tick Marks drawn on the axis. The value of tickColor can be a "HTML Color Name" or "hex" code .
* Default: "#BBBBBB"
* Example: "red", "#006400".
*/
tickColor?: string;
/**
@@ -508,9 +515,9 @@ declare module CanvasJS {
*/
tickThickness?: number;
/**
* Sets the color of Axis line. Axis line color can be a HTML Color Name or hex code .
* Default: #BBBBBB
* Example: blue”,”#21AB13..
* Sets the color of Axis line. Axis line color can be a "HTML Color Name" or "hex" code .
* Default: "#BBBBBB"
* Example: "blue","#21AB13"..
*/
lineColor?: string;
/**
@@ -520,9 +527,9 @@ declare module CanvasJS {
*/
lineThickness?: string;
/**
* Sets the Interlacing Color that alternates between the set interval. If the interval is not set explicitly, then the auto calculated interval is considered. The value of interlacedColor can be a HTML Color Name or hex code .
* Sets the Interlacing Color that alternates between the set interval. If the interval is not set explicitly, then the auto calculated interval is considered. The value of interlacedColor can be a "HTML Color Name" or "hex" code .
* Default: null
* Example: #F8F1E4, #FEFDDF ….
* Example: "#F8F1E4", "#FEFDDF" ….
*/
interlaceColor?: string;
/**
@@ -532,11 +539,21 @@ declare module CanvasJS {
*/
gridThickness?: number;
/**
* Sets the Color of Grid Lines. Value of gridColor can be a HTML Color Name or hex code .
* Default: #BBBBBB
* Example: red, #FEFDDF ..
* Sets the Color of Grid Lines. Value of gridColor can be a "HTML Color Name" or "hex" code .
* Default: "#BBBBBB"
* Example: "red", "#FEFDDF" ..
*/
gridColor?: string;
/**
* Sets the Interlacing Color that alternates between the set interval.
* If the interval is not set explicitly, then the auto calculated interval is considered.
* The value of interlacedColor can be an "HTML Color Name" or "hex" code.
* Default: null
* Example: "#F8F1E4", "#FEFDDF"
*/
interlacedColor?: string;
/**
* Strip Lines are vertical or horizontal lines used to highlight/mark a certain region on the plot area. You can choose whether to draw a line at a specific position or shade a region on the plot area. Strip Lines are sometimes referred to as trend lines.
* If you want to just mark a certain position on the axis, you can set the value attribute and itll draw a line at that position with the set thickness. If you want to shade a region instead, you need to set startValue and endValue attributes. This will fill the area within the specified range.
@@ -573,32 +590,32 @@ declare module CanvasJS {
thickness?: number;
/**
* Sets the color of the stripLine.
* Default: orange
* Example: green, #23EA23
* Default: "orange"
* Example: "green", "#23EA23"
*/
color?: string;
/**
* Sets the label of the stripLine. These are shown on top of axis labels.
* Default: “” (empty string)
* Example: Threshold, Deaths in 1920
* Default: "" (empty string)
* Example: "Threshold", "Deaths in 1920"
*/
label?: string;
/**
* Sets the background color of stripLines label.
* Default: #eeeeee
* Example: red”,”#fabd76
* Default: "#eeeeee"
* Example: "red","#fabd76"
*/
labelBackgroundColor?: string;
/**
* Sets the font-family of stripLines label. If the first font is not found in the system from the specified font-family list, it tries to use the next font in the list.
* Default: arial
* Example: Arial, Trebuchet MS, Tahoma, sans-serif
* Default: "arial"
* Example: "Arial, Trebuchet MS, Tahoma, sans-serif"
*/
labelFontFamily?: string;
/**
* Sets the font color of label.
* Default: orange
* Example: blue”,”#4135e9
* Default: "orange"
* Example: "blue","#4135e9"
*/
labelFontColor?: string;
/**
@@ -609,14 +626,14 @@ declare module CanvasJS {
labelFontSize?: number;
/**
* Sets the font weight of stripLines label.
* Default: normal
* Example: lighter”,”normal”,”bold”,”bolder
* Default: "normal"
* Example: "lighter","normal","bold","bolder"
*/
labelFontWeight?: string;
/**
* Sets the font style of stripLines label.
* Default: normal
* Example: normal”,”italic”,”oblique
* Default: "normal"
* Example: "normal","italic","oblique"
*/
labelFontStyle?: string;
}
@@ -657,7 +674,7 @@ declare module CanvasJS {
/**
* Sets the border color around Tool Tip. When not set it takes the color of corresponding dataSeries or dataPoint.
* Default: dataSeries color/ dataPoint color
* Example: red, #808080..
* Example: "red", "#808080"..
*/
borderColor?: string;
}
@@ -665,53 +682,53 @@ declare module CanvasJS {
interface ChartDataCommon {
/**
* Sets the dataPoint Name. dataPoint name is shown in various places like toolTip & legend unless overridden.
* Default: Automatically Named (dataPoint 1, dataPoint 2 .. )
* Example: apple, mango ..
* Default: Automatically Named ("dataPoint 1", "dataPoint 2" .. )
* Example: "apple", "mango" ..
*/
name?: string;
/**
* Sets the color of dataSeries. The value of tickColor can be a HTML Color Name or Hex Code.
* Sets the color of dataSeries. The value of tickColor can be a "HTML Color Name" or "Hex Code".
* Default: Automatically set from Theme.
* Example: red, green ..
* Example: "red", "green" ..
*/
color?: string;
/**
* Instead of setting string values for all indexLabels, you can also use keywords like x, y, etc that will automatically show corresponding properties as indexLabel. This will allow you to define indexLabel at the series level once. While setting indexLabel you specify a keyword by enclosing it in flower brackets like {x}, {y}, {color}, etc.
* Range Charts have two indexLabels one for each y value. This requires the use of a special keyword #index to show index label on either sides of the column/bar/area.
* eg: indexLabel: {x}: {y[#index]}
* eg: indexLabel: "{x}: {y[#index]}"
* Important keywords to keep in mind are. {x}, {y}, {name}, {label}.
* Default: null
* Example: {label}, Win, x: {x}, y: {y}
* Example: "{label}", "Win", "x: {x}, y: {y} "
*/
indexLabel?: string;
/**
* Using this property you can define whether to render indexLabel inside or outside the dataPoint.
* Default: outside
* Example: outside, inside
* Using this property you can define whether to render indexLabel "inside" or "outside" the dataPoint.
* Default: "outside"
* Example: "outside", "inside"
*/
indexLabelPlacement?: string;
/**
* Sets the Orientation of indexLabel to horizontal or vertical.
* Default: horizontal
* Options: horizontal, vertical
* Sets the Orientation of indexLabel to "horizontal" or "vertical".
* Default: "horizontal"
* Options: "horizontal", "vertical"
*/
indexLabelOrientation?: string;
/**
* Sets the Background color of Index Labels. The value of indexLabelBackgroundColor can be a HTML Color Name or Hex Code.
* Sets the Background color of Index Labels. The value of indexLabelBackgroundColor can be a "HTML Color Name" or "Hex Code".
* Default: null
* Example: red, #FAC003 ..
* Example: "red", "#FAC003" ..
*/
indexLabelBackgroundColor?: string;
/**
* Sets the Index Labels Font Style. It can be set to one of the below options.
* Default: normal
* Options: italic, oblique, normal
* Default: "normal"
* Options: "italic", "oblique", "normal"
*/
indexLabelFontStyle?: string;
/**
* Sets the Index Labels Font color. The value of IndexLabelFontColor can be a HTML Color Name or Hex Code.
* Default: grey
* Example: red, #FAC003 ..
* Sets the Index Labels Font color. The value of IndexLabelFontColor can be a "HTML Color Name" or "Hex Code".
* Default: "grey"
* Example: "red", "#FAC003" ..
*/
indexLabelFontColor?: string;
/**
@@ -722,24 +739,24 @@ declare module CanvasJS {
indexLabelFontSize?: number;
/**
* Sets the Index Labels Font Family.
* Default: Calibri, Optima, Candara, Verdana, Geneva, sans-serif
* Example: calibri, tahoma, verdana..
* Default: "Calibri, Optima, Candara, Verdana, Geneva, sans-serif"
* Example: "calibri", "tahoma", "verdana"..
*/
indexLabelFontFamily?: string;
/**
* Sets the Index Labels Font Weight. It can be set to one of the below options.
* Default: normal
* Example: lighter, normal ,bold , bolder
* Default: "normal"
* Example: "lighter", "normal" ,"bold" , "bolder"
*/
indexLabelFontWeight?: string;
/**
* Sets the color of line connecting index labels with their dataPoint. It is only applicable for pie and doughnut chart when indexLabelPlacment is outside. The value of indexLineColor can be a HTML Color Name or Hex Code.
* Default: lightgrey
* Example: red, #FAC003 ..
* Sets the color of line connecting index labels with their dataPoint. It is only applicable for pie and doughnut chart when indexLabelPlacment is outside. The value of indexLineColor can be a "HTML Color Name" or "Hex Code".
* Default: "lightgrey"
* Example: "red", "#FAC003" ..
*/
indexLabelLineColor?: string;
/**
* Sets the thickness of line connecting indexLabel with its corresponding dataPoint. It is only applicable for pie and doughnut chart when indexLabelPlacement is set to outside.
* Sets the thickness of line connecting indexLabel with its corresponding dataPoint. It is only applicable for pie and doughnut chart when indexLabelPlacement is set to "outside".
* Default: 2
* Example: 4, 6
*/
@@ -752,14 +769,14 @@ declare module CanvasJS {
/**
* Sets marker type to be rendered at each dataPoint. While markers are helpful in highlighting individual dataPoints, they do not help much when the dataPoints are crowded. In case of large number of dataPoints it is recommended to disable markers in order to improve the appearance and performance of chart.
* Same marker type is also used in legend unless overridden by legendMarkerType property.
* Default: circle
* Options: none, circle, square, triangle and cross
* Default: "circle"
* Options: "none", "circle", "square", "triangle" and "cross"
*/
markerType?: string;
/**
* Sets the color of marker that is displayed on the Chart. Legend Marker for the series uses the same Color as set here unless overridden using legendMarkerColor property.
* Default: dataSeries Color
* Example: red, #008000 ..
* Example: "red", "#008000" ..
*/
markerColor?: string;
/**
@@ -769,9 +786,9 @@ declare module CanvasJS {
*/
markerSize?: number;
/**
* Sets the border color around marker. Value of markerBorderColor can be HTML Color Name or hex code.
* Sets the border color around marker. Value of markerBorderColor can be "HTML Color Name" or "hex code".
* Default: dataSeries color.
* Example: red, #008000 ..
* Example: "red", "#008000" ..
*/
markerBorderColor?: string;
/**
@@ -782,14 +799,14 @@ declare module CanvasJS {
markerBorderThickness?: number;
/**
* Sets the text that describes the dataSeries in legend.
* Default: DataSeries 1, DataSeries 2 ..etc
* Example: 2010, 2011..
* Default: "DataSeries 1", "DataSeries 2" ..etc
* Example: "2010", "2011"..
*/
legendText?: string;
/**
* Sets the Legend Marker to one of the options below. This property is used to override the default marker in legend, which is same as dataSeries Marker Type.
* Default: same as markerType
* Options: circle, square, cross and triangle
* Options: "circle", "square", "cross" and "triangle"
*/
legendMarkerType?: string;
/**
@@ -798,9 +815,9 @@ declare module CanvasJS {
*/
click?: (event: ChartEvent) => void;
/**
* Sets the color of marker that is displayed on legend. This property overrides default Markers Color in Legend, which is same as dataSeries Marker Color. Value of legendMarkerColor can be HTML Color Name or hex code.
* Sets the color of marker that is displayed on legend. This property overrides default Markers Color in Legend, which is same as dataSeries Marker Color. Value of legendMarkerColor can be "HTML Color Name" or "hex code".
* Default: dataSeries marker color
* Example: red, #008000 ..
* Example: "red", "#008000" ..
*/
legendMarkerColor?: string;
/**
@@ -829,39 +846,39 @@ declare module CanvasJS {
visible?: boolean;
/**
* Sets the type of chart to be rendered for corresponding dataSeries. One can choose from the following options.
* Default: column
* Default: "column"
* Options:
* line
* column
* bar
* area
* spline
* splineArea
* stepLine
* scatter
* bubble
* stackedColumn
* stackedBar
* stackedArea
* stackedColumn100
* stackedBar100
* stackedArea100
* pie
* doughnut
* "line"
* "column"
* "bar"
* "area"
* "spline"
* "splineArea"
* "stepLine"
* "scatter"
* "bubble"
* "stackedColumn"
* "stackedBar"
* "stackedArea"
* "stackedColumn100"
* "stackedBar100"
* "stackedArea100"
* "pie"
* "doughnut"
*/
type?: string;
/**
* Setting axisYType lets you choose between primary and secondary Y Axis for a dataSeries to plot against. By choosing secondary Axis you can plot the series against axisY2.
* Setting axisYType lets you choose between primary and secondary Y Axis for a dataSeries to plot against. By choosing "secondary" Axis you can plot the series against axisY2.
* In case of Multi-Series or Combinational Charts, one can assign primary axis to some series and secondary axis to other series.
* This is helpful when dataSeries objects use different unit of measurement or range of data. By default, all series are plotted against primary Y axis.
* Default: primary
* Options: primary, secondary
* Default: "primary"
* Options: "primary", "secondary"
*/
axisYType?: string;
/**
* This defines the data type of x values. Data Type is normally figured out by default based on the object type that is assigned to x. But if you are providing time stamp (which is integer) values instead of Date objects, youll have to explicitly set the xValueType to dateTime.
* This defines the data type of x values. Data Type is normally figured out by default based on the object type that is assigned to x. But if you are providing time stamp (which is integer) values instead of Date objects, youll have to explicitly set the xValueType to "dateTime".
* Default: Automatically Calculated
* Options: number, dateTime
* Options: "number", "dateTime"
*/
xValueType?: string;
/**
@@ -878,8 +895,8 @@ declare module CanvasJS {
zValueFormatString?: string;
/**
* Sets the bevel property, which creates a chiselled effect at the corners of a Column Charts and Bar Charts.
* Default: true
* Example: true, false
* Default: "true"
* Example: "true", "false"
*/
bevelEnabled?: boolean;
/**
@@ -907,8 +924,8 @@ declare module CanvasJS {
showInLegend?: boolean;
/**
* In candle Stick chart, when Closing Price is greater than Opening price, the body is filled with white by default and it can be overridden by risingColor property.
* Default: white
* Options: red, #DD7E86, etc.
* Default: "white"
* Options: "red", "#DD7E86", etc.
*/
risingColor?: string;
/**
@@ -940,7 +957,7 @@ declare module CanvasJS {
/**
* Sets label value of a dataPoint. The value appears next to the dataPoint on axisX Line. If not provided, it takes x value for label.
* Default: x value
* Example: label1, label2..
* Example: "label1", "label2"..
*/
label?: string;
/**
@@ -950,9 +967,9 @@ declare module CanvasJS {
*/
exploded?: boolean;
/**
* Sets the color of marker that is displayed on legend. This property works only with Pie and Doughnut charts. Value of legendMarkerColor can be HTML Color Name or hex code.
* Sets the color of marker that is displayed on legend. This property works only with Pie and Doughnut charts. Value of legendMarkerColor can be "HTML Color Name" or "hex" code.
* Default: dataSeries marker color
* Example: red, #008000..
* Example: "red", "#008000"..
*/
legendMarkerColor?: string;
}
+45 -14
View File
@@ -1,23 +1,54 @@
/// <reference path="chai-as-promised.d.ts" />
/// <reference path="../promises-a-plus/promises-a-plus.d.ts" />
/// <reference path="../q/Q.d.ts" />
import chai = require('chai');
import chaiAsPromised = require('chai-as-promised');
import Q = require('q');
chai.use(chaiAsPromised);
// ReSharper disable WrongExpressionStatement
var promise: any;
chai.expect(promise).to.eventually.equal(3);
chai.expect(promise).to.become(3);
chai.expect(promise).to.be.fulfilled;
chai.expect(promise).to.be.rejected;
chai.expect(promise).to.be.rejectedWith(Error);
chai.expect(promise).to.notify(() => console.log('done'));
// BDD API (expect)
var thenableNum: PromisesAPlus.Thenable<number>;
thenableNum = chai.expect(thenableNum).to.eventually.equal(3);
thenableNum = chai.expect(thenableNum).to.eventually.have.property('foo');
thenableNum = chai.expect(thenableNum).to.become(3);
thenableNum = chai.expect(thenableNum).to.be.fulfilled;
thenableNum = chai.expect(thenableNum).to.be.rejected;
thenableNum = chai.expect(thenableNum).to.be.rejectedWith(Error);
thenableNum = chai.expect(thenableNum).to.notify(() => console.log('done'));
chai.assert.eventually.equal(promise, 4, 'Message');
chai.assert.isFulfilled(promise, "optional message");
chai.assert.becomes(promise, "foo", "optional message");
chai.assert.doesNotBecome(promise, "foo", "optional message");
chai.assert.isRejected(promise, "optional message");
chai.assert.isRejected(promise, Error, "optional message");
chai.assert.isRejected(promise, /error message matcher/, "optional message");
// BDD API (should)
thenableNum = thenableNum.should.be.fulfilled;
thenableNum = thenableNum.should.eventually.deep.equal(3);
thenableNum = thenableNum.should.become(3);
thenableNum = thenableNum.should.be.rejected;
thenableNum = thenableNum.should.be.rejectedWith(Error);
thenableNum = thenableNum.should.eventually.equal(3).notify(() => console.log('done'));
thenableNum = thenableNum.should.be.fulfilled.and.notify(() => console.log('done'));
// Complex examples on https://github.com/domenic/chai-as-promised#working-with-non-promisefriendly-test-runners
thenableNum.should.be.fulfilled.then(function () {
thenableNum.should.equal("after");
}).should.notify(() => console.log('done'));
Q.all([
thenableNum.should.become("happy"),
thenableNum.should.eventually.have.property("fun times"),
thenableNum.should.be.rejectedWith(TypeError, "only joyful types are allowed")
]).should.notify(() => console.log('done'));
// Assert API
var thenableVoid: PromisesAPlus.Thenable<void>;
thenableVoid = chai.assert.eventually.equal(thenableNum, 4, 'Message');
thenableVoid = chai.assert.isFulfilled(thenableNum, "optional message");
thenableVoid = chai.assert.becomes(thenableNum, "foo", "optional message");
thenableVoid = chai.assert.doesNotBecome(thenableNum, "foo", "optional message");
thenableVoid = chai.assert.isRejected(thenableNum, "optional message");
thenableVoid = chai.assert.isRejected(thenableNum, Error, "optional message");
thenableVoid = chai.assert.isRejected(thenableNum, /error message matcher/, "optional message");
// Check that original chai assertions are not broken
var undef: void;
undef = chai.assert.equal(10, 4, 'Message');
+264 -16
View File
@@ -1,9 +1,10 @@
// Type definitions for chai-as-promised
// Project: https://github.com/domenic/chai-as-promised/
// Definitions by: jt000 <https://github.com/jt000>
// Definitions by: jt000 <https://github.com/jt000>, Yuki Kokubun <https://github.com/Kuniwak>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../chai/chai.d.ts" />
/// <reference path="../promises-a-plus/promises-a-plus.d.ts" />
declare module 'chai-as-promised' {
function chaiAsPromised(chai: any, utils: any): void;
@@ -12,25 +13,272 @@ declare module 'chai-as-promised' {
declare module Chai {
interface Assertion {
become(expected: any): Assertion;
fulfilled: Assertion;
rejected: Assertion;
rejectedWith(expected: any): Assertion;
notify(fn: Function): Assertion;
// For BDD API
interface Assertion extends LanguageChains, NumericComparison, TypeComparison {
eventually: PromisedAssertion;
become(expected: any): PromisedAssertion;
fulfilled: PromisedAssertion;
rejected: PromisedAssertion;
rejectedWith(expected: any, message?: string): PromisedAssertion;
notify(fn: Function): PromisedAssertion;
}
interface LanguageChains {
eventually: Assertion;
// Eventually does not have .then(), but PromisedAssertion have.
interface Eventually extends PromisedLanguageChains, PromisedNumericComparison, PromisedTypeComparison {
// From chai-as-promised
become(expected: PromisesAPlus.Thenable<any>): PromisedAssertion;
fulfilled: PromisedAssertion;
rejected: PromisedAssertion;
rejectedWith(expected: any): PromisedAssertion;
notify(fn: Function): PromisedAssertion;
// From chai
not: PromisedAssertion;
deep: PromisedDeep;
a: PromisedTypeComparison;
an: PromisedTypeComparison;
include: PromisedInclude;
contain: PromisedInclude;
ok: PromisedAssertion;
true: PromisedAssertion;
false: PromisedAssertion;
null: PromisedAssertion;
undefined: PromisedAssertion;
exist: PromisedAssertion;
empty: PromisedAssertion;
arguments: PromisedAssertion;
Arguments: PromisedAssertion;
equal: PromisedEqual;
equals: PromisedEqual;
eq: PromisedEqual;
eql: PromisedEqual;
eqls: PromisedEqual;
property: PromisedProperty;
ownProperty: PromisedOwnProperty;
haveOwnProperty: PromisedOwnProperty;
length: PromisedLength;
lengthOf: PromisedLength;
match(regexp: RegExp|string, message?: string): PromisedAssertion;
string(string: string, message?: string): PromisedAssertion;
keys: PromisedKeys;
key(string: string): PromisedAssertion;
throw: PromisedThrow;
throws: PromisedThrow;
Throw: PromisedThrow;
respondTo(method: string, message?: string): PromisedAssertion;
itself: PromisedAssertion;
satisfy(matcher: Function, message?: string): PromisedAssertion;
closeTo(expected: number, delta: number, message?: string): PromisedAssertion;
members: PromisedMembers;
}
interface PromisedAssertion extends Eventually, PromisesAPlus.Thenable<any> {
}
interface PromisedLanguageChains {
eventually: Eventually;
// From chai
to: PromisedAssertion;
be: PromisedAssertion;
been: PromisedAssertion;
is: PromisedAssertion;
that: PromisedAssertion;
which: PromisedAssertion;
and: PromisedAssertion;
has: PromisedAssertion;
have: PromisedAssertion;
with: PromisedAssertion;
at: PromisedAssertion;
of: PromisedAssertion;
same: PromisedAssertion;
}
interface PromisedNumericComparison {
above: PromisedNumberComparer;
gt: PromisedNumberComparer;
greaterThan: PromisedNumberComparer;
least: PromisedNumberComparer;
gte: PromisedNumberComparer;
below: PromisedNumberComparer;
lt: PromisedNumberComparer;
lessThan: PromisedNumberComparer;
most: PromisedNumberComparer;
lte: PromisedNumberComparer;
within(start: number, finish: number, message?: string): PromisedAssertion;
}
interface PromisedNumberComparer {
(value: number, message?: string): PromisedAssertion;
}
interface PromisedTypeComparison {
(type: string, message?: string): PromisedAssertion;
instanceof: PromisedInstanceOf;
instanceOf: PromisedInstanceOf;
}
interface PromisedInstanceOf {
(constructor: Object, message?: string): PromisedAssertion;
}
interface PromisedDeep {
equal: PromisedEqual;
include: PromisedInclude;
property: PromisedProperty;
}
interface PromisedEqual {
(value: any, message?: string): PromisedAssertion;
}
interface PromisedProperty {
(name: string, value?: any, message?: string): PromisedAssertion;
}
interface PromisedOwnProperty {
(name: string, message?: string): PromisedAssertion;
}
interface PromisedLength extends PromisedLanguageChains, PromisedNumericComparison {
(length: number, message?: string): PromisedAssertion;
}
interface PromisedInclude {
(value: Object, message?: string): PromisedAssertion;
(value: string, message?: string): PromisedAssertion;
(value: number, message?: string): PromisedAssertion;
keys: PromisedKeys;
members: PromisedMembers;
}
interface PromisedKeys {
(...keys: string[]): PromisedAssertion;
(keys: any[]): PromisedAssertion;
}
interface PromisedThrow {
(): PromisedAssertion;
(expected: string, message?: string): PromisedAssertion;
(expected: RegExp, message?: string): PromisedAssertion;
(constructor: Error, expected?: string, message?: string): PromisedAssertion;
(constructor: Error, expected?: RegExp, message?: string): PromisedAssertion;
(constructor: Function, expected?: string, message?: string): PromisedAssertion;
(constructor: Function, expected?: RegExp, message?: string): PromisedAssertion;
}
interface PromisedMembers {
(set: any[], message?: string): PromisedAssertion;
}
// For Assert API
interface Assert {
eventually: Assert;
isFulfilled(promise: any, message?: string): void;
becomes(promise: any, expected: any, message?: string): void;
doesNotBecome(promise: any, expected: any, message?: string): void;
isRejected(promise: any, message?: string): void;
isRejected(promise: any, expected: any, message?: string): void;
isRejected(promise: any, match: RegExp, message?: string): void;
eventually: PromisedAssert;
isFulfilled(promise: PromisesAPlus.Thenable<any>, message?: string): PromisesAPlus.Thenable<void>;
becomes(promise: PromisesAPlus.Thenable<any>, expected: any, message?: string): PromisesAPlus.Thenable<void>;
doesNotBecome(promise: PromisesAPlus.Thenable<any>, expected: any, message?: string): PromisesAPlus.Thenable<void>;
isRejected(promise: PromisesAPlus.Thenable<any>, message?: string): PromisesAPlus.Thenable<void>;
isRejected(promise: PromisesAPlus.Thenable<any>, expected: any, message?: string): PromisesAPlus.Thenable<void>;
isRejected(promise: PromisesAPlus.Thenable<any>, match: RegExp, message?: string): PromisesAPlus.Thenable<void>;
notify(fn: Function): PromisesAPlus.Thenable<void>;
}
export interface PromisedAssert {
fail(actual?: any, expected?: any, msg?: string, operator?: string): PromisesAPlus.Thenable<void>;
ok(val: any, msg?: string): PromisesAPlus.Thenable<void>;
notOk(val: any, msg?: string): PromisesAPlus.Thenable<void>;
equal(act: any, exp: any, msg?: string): PromisesAPlus.Thenable<void>;
notEqual(act: any, exp: any, msg?: string): PromisesAPlus.Thenable<void>;
strictEqual(act: any, exp: any, msg?: string): PromisesAPlus.Thenable<void>;
notStrictEqual(act: any, exp: any, msg?: string): PromisesAPlus.Thenable<void>;
deepEqual(act: any, exp: any, msg?: string): PromisesAPlus.Thenable<void>;
notDeepEqual(act: any, exp: any, msg?: string): PromisesAPlus.Thenable<void>;
isTrue(val: any, msg?: string): PromisesAPlus.Thenable<void>;
isFalse(val: any, msg?: string): PromisesAPlus.Thenable<void>;
isNull(val: any, msg?: string): PromisesAPlus.Thenable<void>;
isNotNull(val: any, msg?: string): PromisesAPlus.Thenable<void>;
isUndefined(val: any, msg?: string): PromisesAPlus.Thenable<void>;
isDefined(val: any, msg?: string): PromisesAPlus.Thenable<void>;
isFunction(val: any, msg?: string): PromisesAPlus.Thenable<void>;
isNotFunction(val: any, msg?: string): PromisesAPlus.Thenable<void>;
isObject(val: any, msg?: string): PromisesAPlus.Thenable<void>;
isNotObject(val: any, msg?: string): PromisesAPlus.Thenable<void>;
isArray(val: any, msg?: string): PromisesAPlus.Thenable<void>;
isNotArray(val: any, msg?: string): PromisesAPlus.Thenable<void>;
isString(val: any, msg?: string): PromisesAPlus.Thenable<void>;
isNotString(val: any, msg?: string): PromisesAPlus.Thenable<void>;
isNumber(val: any, msg?: string): PromisesAPlus.Thenable<void>;
isNotNumber(val: any, msg?: string): PromisesAPlus.Thenable<void>;
isBoolean(val: any, msg?: string): PromisesAPlus.Thenable<void>;
isNotBoolean(val: any, msg?: string): PromisesAPlus.Thenable<void>;
typeOf(val: any, type: string, msg?: string): PromisesAPlus.Thenable<void>;
notTypeOf(val: any, type: string, msg?: string): PromisesAPlus.Thenable<void>;
instanceOf(val: any, type: Function, msg?: string): PromisesAPlus.Thenable<void>;
notInstanceOf(val: any, type: Function, msg?: string): PromisesAPlus.Thenable<void>;
include(exp: string, inc: any, msg?: string): PromisesAPlus.Thenable<void>;
include(exp: any[], inc: any, msg?: string): PromisesAPlus.Thenable<void>;
notInclude(exp: string, inc: any, msg?: string): PromisesAPlus.Thenable<void>;
notInclude(exp: any[], inc: any, msg?: string): PromisesAPlus.Thenable<void>;
match(exp: any, re: RegExp, msg?: string): PromisesAPlus.Thenable<void>;
notMatch(exp: any, re: RegExp, msg?: string): PromisesAPlus.Thenable<void>;
property(obj: Object, prop: string, msg?: string): PromisesAPlus.Thenable<void>;
notProperty(obj: Object, prop: string, msg?: string): PromisesAPlus.Thenable<void>;
deepProperty(obj: Object, prop: string, msg?: string): PromisesAPlus.Thenable<void>;
notDeepProperty(obj: Object, prop: string, msg?: string): PromisesAPlus.Thenable<void>;
propertyVal(obj: Object, prop: string, val: any, msg?: string): PromisesAPlus.Thenable<void>;
propertyNotVal(obj: Object, prop: string, val: any, msg?: string): PromisesAPlus.Thenable<void>;
deepPropertyVal(obj: Object, prop: string, val: any, msg?: string): PromisesAPlus.Thenable<void>;
deepPropertyNotVal(obj: Object, prop: string, val: any, msg?: string): PromisesAPlus.Thenable<void>;
lengthOf(exp: any, len: number, msg?: string): PromisesAPlus.Thenable<void>;
//alias frenzy
throw(fn: Function, msg?: string): PromisesAPlus.Thenable<void>;
throw(fn: Function, regExp: RegExp): PromisesAPlus.Thenable<void>;
throw(fn: Function, errType: Function, msg?: string): PromisesAPlus.Thenable<void>;
throw(fn: Function, errType: Function, regExp: RegExp): PromisesAPlus.Thenable<void>;
throws(fn: Function, msg?: string): PromisesAPlus.Thenable<void>;
throws(fn: Function, regExp: RegExp): PromisesAPlus.Thenable<void>;
throws(fn: Function, errType: Function, msg?: string): PromisesAPlus.Thenable<void>;
throws(fn: Function, errType: Function, regExp: RegExp): PromisesAPlus.Thenable<void>;
Throw(fn: Function, msg?: string): PromisesAPlus.Thenable<void>;
Throw(fn: Function, regExp: RegExp): PromisesAPlus.Thenable<void>;
Throw(fn: Function, errType: Function, msg?: string): PromisesAPlus.Thenable<void>;
Throw(fn: Function, errType: Function, regExp: RegExp): PromisesAPlus.Thenable<void>;
doesNotThrow(fn: Function, msg?: string): PromisesAPlus.Thenable<void>;
doesNotThrow(fn: Function, regExp: RegExp): PromisesAPlus.Thenable<void>;
doesNotThrow(fn: Function, errType: Function, msg?: string): PromisesAPlus.Thenable<void>;
doesNotThrow(fn: Function, errType: Function, regExp: RegExp): PromisesAPlus.Thenable<void>;
operator(val: any, operator: string, val2: any, msg?: string): PromisesAPlus.Thenable<void>;
closeTo(act: number, exp: number, delta: number, msg?: string): PromisesAPlus.Thenable<void>;
sameMembers(set1: any[], set2: any[], msg?: string): PromisesAPlus.Thenable<void>;
includeMembers(set1: any[], set2: any[], msg?: string): PromisesAPlus.Thenable<void>;
ifError(val: any, msg?: string): PromisesAPlus.Thenable<void>;
}
}
+1 -1
View File
@@ -115,7 +115,7 @@ function exist() {
should.not.exist(void (0));
}
function arguments() {
function argumentsTest() {
var args = arguments;
expect(args).to.be.arguments;
args.should.be.arguments;
+1 -1
View File
@@ -127,7 +127,7 @@ declare module Chance {
guid(): string;
hash(opts?: Options): string;
n<T>(generator: () => T, count: number, opts?: Options): T[];
normal(opts?: Options): string;
normal(opts?: Options): number;
radio(opts?: Options): string;
rpg(dice: string): number[];
rpg(dice: string, opts?: Options): number[]|number;
+2
View File
@@ -74,6 +74,8 @@ interface Cheerio {
children(selector?: string): Cheerio;
contents(): Cheerio;
each(func: (index: number, element: CheerioElement) => any): Cheerio;
map(func: (index: number, element: CheerioElement) => any): Cheerio;
+144 -104
View File
@@ -1,4 +1,4 @@
/// <reference path="chocolatechipjs.d.ts" />
/// <reference path="../chocolatechipjs/chocolatechipjs.d.ts" />
// ChocolateChipStatic -- DOM creation, etc.
$(function() {
alert('Ready to do stuff!');
@@ -16,7 +16,6 @@ var nodeName = divTag2[0].nodeName;
var version = $.version;
var libraryName = $.libraryName;
var els = $('li');
var listItems = $.slice(els);
var madeEls = $.make('<p>Stuff</p>');
var moreEls = $.html('<p>Stuff</p>');
var oldTag = $('#oldTag');
@@ -44,7 +43,7 @@ $.isInteger(123);
$.isInteger(123.123); // should return false
$.isFloat(123.123); // should return true
var newUuid = $.makeUuid();
$.each(['a', 'b', 'c'], function(ctx, idx) {
$.each(['a', 'b', 'c'], function(ctx: string, idx: number) {
console.log(ctx);
console.log(idx);
});
@@ -103,12 +102,14 @@ $('ul').insert("<li>1</li><li>2</li><li>3</li>", 3);
$('ul').insert("<li>1</li><li>2</li><li>3</li>");
$('ul').html('<li>1</li><li><2/li><li>3</li>');
$('ul').html('');
var listContent = $('ul').html();
$('ul').prepend('<li class="title">The title</li>');
$('ul').append('<li>The Last Item</li>');
var inputName = $('input').attr('name');
$('input').attr('name', 'wobba');
var inputName = $('input').prop('name');
$('input').prop('name', 'wobba');
var inputProperty = $('input').prop('disabled');
$('input[type=checked]').prop('checked', true);
$('input').removeProp('disabled');
$('input').hasAttr('disabled').css('border', 'solid 1px red');
$('input').removeAttr('disabled');
$('article').hasClass('current').css('display', 'block');
@@ -241,109 +242,145 @@ var myPromise = new Promise(function(resolve, reject) {
myPromise.then(function(value) {
// Success:
console.log(value);
},
// Opps! There was a problem:
function(reason) {
console.log(reason);
});
},
// Opps! There was a problem:
function(reason) {
console.log(reason);
});
// Ajax:
$.ajax({
url: "announcement.html",
dataType: "html",
success: function(data) {
// Insert the fragment into the page:
$("#content").html(data);
},
error: function(data) {
$("#content").html("<h4>There was an error while trying to get the file.</h4>");
}
// Fetch API
//===========
// GET:
interface WineObject {
data: Array<WineInterface>;
}
interface WineInterface {
wine: {
name: string;
}
}
fetch('../data/wines.json')
.then($.json)
.then(function<WineObject>(obj: any):any {
$('#message_ajax').empty();
obj.data.forEach(function(wine: any) {
$('#message_ajax').append('<li>' + wine.name + '</li>');
})
});
$.ajax({
url: "me.json",
success: function(data) {
// Before using a JSON object, you need to parse it.
// Here we parse it and assign it to a variable:
var me = JSON.parse(data);
// Here we access the properties of the JSON object:
$("#content").html(me.firstName + " " + me.lastName);
},
error: function(data) {
$('#content').html("<h4>There was an error while trying to get the file.</h4>");
}
});
var myData = {
"name": "Bozo the Clown",
"occupation": "Clown"
};
var mySuccessCallback = function() {
console.log('The post was a success!');
};
var myErrorCallback = function() {
console.log('Ooops! There was a problem posting this.');
};
$.ajax({
url: "/path/to/controller",
method: 'POST',
headers: {
"Content-Type": "application/x-www-form-urlencoded",
"async": true,
"Access-Control-Allow-Origin": "*",
"Accept": "text/plain"
},
data: myData,
success: mySuccessCallback,
error: myErrorCallback
});
$.get('http://my.com/data/stuff.html')
.then(function(response) {
console.log("Success!", response);
}, function(error) {
console.error("Failed!", error);
});
$.get('http://my.com/data/stuff.html')
.then(function(response) {
console.log("Success!", response);
})
.catch(function(error) {
console.error("Failed!", error);
});
$.get('story.json')
.then(JSON.parse)
.then(function(response) {
console.log("Yey JSON!", response);
});
$.getJSON('/data/deserts.json', function(desserts: Array<any>) {
desserts.forEach(function(dessert) {
$('#deserts').append('<li>' + dessert.name + '</li>');
});
});
$.post("updateUser.php",
{ "name": "Joe", "time": "10PM" },
function() {
console.log('The POST was successful.')
},
"json"
);
$.JSONP({ url: 'https://api.github.com/users/yui?callback=?' })
.then(function(users) {
$('.list').append('<li><h3>The name of the library</h3><h4>' + users.data.name + '</h4></li>');
})
.catch(function(err) {
console.log('Unable to get data.')
});
$.JSONP({
url: 'http://www.geonames.org/postalCodeLookupJSON?postalcode=94102&'
// POST:
interface postData {
email: string;
name: string;
msg: string;
}
var formData = $.serialize($('form')[0]);
fetch('../controllers/php-post.php', {
method: 'post',
headers: {
"Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
},
body: formData
})
.then(function(data) {
$('.list').append('<li><h3>My Location</h3><h4>' + data.postalcodes[0].adminName2 + ', ' + data.postalcodes[0].adminName1 + '</h4></li>');
.then($.json)
.then(function<postData>(data: any): any {
if(data.email_check == "valid"){
$("#message_ajax").html("<div class='successMessage'>" + data.email + " is a valid e-mail address. Thank you, " + data.name + ".</div>");
$("#message_ajax").append('<p>' + data.msg + '</p>');
} else {
$("#message_ajax").html("<div class='errorMessage'>Sorry " + data.name + ", " + data.email + " is NOT a valid e-mail address. Try again.</div>");
}
});
// PUT:
interface putData {
base: string;
result: string;
fileName: string;
}
var putData = $('#fileText').val();
fetch('../controllers/php-put.php', {
method: 'put',
headers: {
"Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
},
body: putData
})
.then($.json)
.then(function<putData>(data:any): any {
console.dir(data.base);
$("#message_ajax").append('<p>' + data.result + '</p>');
$("#message_ajax").append('<p>The file name is: ' + data.fileName + '</p>');
})
.catch(function(error:Error) {
console.log(error);
$("#message_ajax").html("<div class='errorMessage'>Sorry, put was not successful.</div>");
});
// DELETE:
interface deleteData {
result: string;
}
var file = $('#fileName').val();
fetch('../controllers/php-delete.php', {
method: 'delete',
headers: {
"Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
},
body: file
})
.then($.json)
.then(function<deleteData>(data: any): any {
$("#message_ajax").html("<div>DELETE was sent to the server successfully.</div>");
$("#message_ajax").append('<p>' + data.result + '</p>');
},
function(data: any) {
console.log('PROBLEM')
console.log(data);
})
.catch(function(error: any) {
$("#message_ajax").html("<div class='errorMessage'>Sorry, 'DELETE' was not successful.</div>");
error.reject();
});
// Timeout:
var formData2 = $.serialize($('form')[0]);
fetch('../controllers/php-post.php', {
method: 'post',
headers: {
"Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
},
body: formData,
// Set timeout:
timeout: 10000
})
.then($.json)
.then(function <postData>(data: any): any {
if (data.email_check == "valid") {
$("#message_ajax").html("<div class='successMessage'>" + data.email + " is a valid e-mail address. Thank you, " + data.name + ".</div>");
$("#message_ajax").append('<p>' + data.msg + '</p>');
} else {
$("#message_ajax").html("<div class='errorMessage'>Sorry " + data.name + ", " + data.email + " is NOT a valid e-mail address. Try again.</div>");
}
})
.catch(function(err) {
console.log('Unable to get data.')
// Catch timeout:
.catch(function(error) {
console.log(error);
});
// $.jsonp:
$.jsonp('https://api.github.com/users/rbiggs/repos?name=chipper', {timeout: 10000})
.then($.json)
.then(function(obj: any): any {
console.log(obj);
obj.data.forEach(function(repo: any): any {
$('#message_ajax').append("<li>" + repo.name + "</li>");
});
})
.catch(function(error: any): any {
$('#message_ajax').append("<li>" + error.message + "</li>")
});
// Templates:
var myTemplate = '<li>Name: [[= data.name]]</li>';
var userInfo = {
@@ -375,13 +412,16 @@ var repeaterTmplate2 = '<li>[[= data.firstName ]], [[= data.lastName]]</li>';
// Pass in the array of persons:
$.template.repeater($('#objectArrayList'), repeaterTmplate2, luminaries.persons);
// Code for declarative repeater:
$.template.data['myRepeater'] = [{ name: "Joe" }, { name: "Sally" }, {name: "Tom" }];
$.template.repeater();
// Pub/Sub:
var arraySubscriber = function(topic: string, data: any) {
var arraySubscriber = function(topic: string, data: any): any {
$('.list').append('<li><h3>' + topic + '</h3><h4>' + data + '</h4></li>');
var newsSubscription = $.subscribe('news/update', arraySubscriber);
};
var newsSubscription = $.subscribe('news/update', arraySubscriber);
$.publish('news/update', 'The New York Stock Exchange rose an unprecedented 1000 points in just three minutes. Analysts and investors are confused and uncertain how to respond.');
$.unsubscribe('news/update');
// Due to being unsubscribed above, this does nothing:
$.publish('news/update', 'We have nothing further to comment at this time.');
+1418 -1323
View File
File diff suppressed because it is too large Load Diff
+52 -4
View File
@@ -60,10 +60,6 @@ function bookmarksExample() {
resizable: false,
height: 140,
modal: true,
overlay: {
backgroundColor: '#000',
opacity: 0.5
},
buttons: {
'Yes, Delete It!': function () {
chrome.bookmarks.remove(String(bookmarkNode.id));
@@ -197,3 +193,55 @@ function proxySettings() {
// clear with a scope set
chrome.proxy.settings.clear({ scope: 'regular' });
}
// https://developer.chrome.com/extensions/examples/api/contentSettings/popup.js
function contentSettings() {
var incognito;
var url;
function settingChanged() {
var type = this.id;
var setting = this.value;
var pattern = /^file:/.test(url) ? url : url.replace(/\/[^\/]*?$/, '/*');
console.log(type+' setting for '+pattern+': '+setting);
// HACK: [type] is not recognised by the docserver's sample crawler, so
// mention an explicit
// type: chrome.contentSettings.cookies.set - See http://crbug.com/299634
chrome.contentSettings[type].set({
'primaryPattern': pattern,
'setting': setting,
'scope': (incognito ? 'incognito_session_only' : 'regular')
});
}
document.addEventListener('DOMContentLoaded', function () {
chrome.tabs.query({active: true, currentWindow: true, url: ['http://*/*', 'https://*/*'] }, function(tabs) {
var current = tabs[0];
incognito = current.incognito;
url = current.url;
var types = ['cookies', 'images', 'javascript', 'location', 'plugins',
'popups', 'notifications', 'fullscreen', 'mouselock',
'microphone', 'camera', 'unsandboxedPlugins',
'automaticDownloads'];
types.forEach(function(type) {
// HACK: [type] is not recognised by the docserver's sample crawler, so
// mention an explicit
// type: chrome.contentSettings.cookies.get - See http://crbug.com/299634
chrome.contentSettings[type] && chrome.contentSettings[type].get({
'primaryUrl': url,
'incognito': incognito
},
function(details) {
var input = <HTMLInputElement>document.getElementById(type);
input.disabled = false;
input.value = details.setting;
});
});
});
var selects = document.querySelectorAll('select');
for (var i = 0; i < selects.length; i++) {
selects[i].addEventListener('change', settingChanged);
}
});
}

Some files were not shown because too many files have changed in this diff Show More