Merge remote-tracking branch 'borisyankov/master'

This commit is contained in:
Martin McWhorter
2015-09-09 18:11:45 +01:00
513 changed files with 63123 additions and 16779 deletions
+97 -24
View File
@@ -14,28 +14,32 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [: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:](amqplib/amqplib.d.ts) [amqplib 0.3.x](https://github.com/squaremo/amqp.node) by [Michael Nahkies](https://github.com/mnahkies)
* [:link:](angular2/router.d.ts) [Angular](http://angular.io) by [angular team](https://github.com/angular)
* [: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:](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-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:](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)
* [:link:](angularjs/angular-cookies.d.ts) [Angular JS (ngCookies module)](http://angularjs.org) by [Diego Vilar](http://github.com/diegovilar), [Anthony Ciccarello](http://github.com/aciccarello)
* [:link:](angularjs/angular-mocks.d.ts) [Angular JS (ngMock, ngMockE2E module)](http://angularjs.org) by [Diego Vilar](http://github.com/diegovilar)
* [:link:](angularjs/angular-mocks.d.ts) [Angular JS (ngMock, ngMockE2E module)](http://angularjs.org) by [Diego Vilar](http://github.com/diegovilar), [Tony Curtis](http://github.com/daltin)
* [:link:](angularjs/angular-resource.d.ts) [Angular JS (ngResource module)](http://angularjs.org) by [Diego Vilar](http://github.com/diegovilar), [Michael Jess](http://github.com/miffels)
* [:link:](angularjs/angular-route.d.ts) [Angular JS (ngRoute module)](http://angularjs.org) by [Jonathan Park](https://github.com/park9140)
* [:link:](angularjs/angular-sanitize.d.ts) [Angular JS (ngSanitize module)](http://angularjs.org) by [Diego Vilar](http://github.com/diegovilar)
* [:link:](angular-ui-router/angular-ui-router.d.ts) [Angular JS (ui.router module)](https://github.com/angular-ui/ui-router) by [Michel Salib](https://github.com/michelsalib)
* [:link:](angular-ui-scroll/angular-ui-scroll.d.ts) [Angular JS (ui.scroll module)](https://github.com/angular-ui/ui-scroll) by [Mark Nadig](https://github.com/marknadig)
* [:link:](angular-meteor/angular-meteor.d.ts) [Angular JS Meteor (angular.meteor module)](https://github.com/Urigo/angular-meteor) by [Peter Grman](https://github.com/pgrm)
* [: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-gettext/angular-gettext.d.ts) [angular-gettext](https://angular-gettext.rocketeer.be) by [Ákos Lukács](https://github.com/AkosLukacs)
* [: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)
@@ -47,6 +51,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [: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-ui-tree/angular-ui-tree.d.ts) [angular-ui-tree](https://github.com/angular-ui-tree/angular-ui-tree) by [Calvin Fernandez](https://github.com/CalvinFernandez)
* [:link:](angular.throttle/angular.throttle.d.ts) [angular.throttle](https://github.com/BaggersIO/angular.throttle) by [Stefan Steinhart](https://github.com/reppners)
* [:link:](angular-ui-sortable/angular-ui-sortable.d.ts) [angular.ui.sortable module](https://github.com/angular-ui/ui-sortable) by [Thodoris Greasidis](https://github.com/thgreasi)
* [:link:](angular-agility/angular-agility.d.ts) [AngularAgility](https://github.com/AngularAgility/AngularAgility) by [Roland Zwaga](https://github.com/rolandzwaga)
@@ -82,6 +87,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:](auto-launch/auto-launch.d.ts) [auto-launch](https://github.com/Teamwork/node-auto-launch) by [rhysd](https://github.com/rhysd)
* [: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)
@@ -119,6 +125,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [: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:](bowser/bowser.d.ts) [Bowser 1.x](https://github.com/ded/bowser) by [Paulo Cesar](https://github.com/pocesar)
* [: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)
@@ -138,7 +145,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [: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)
* [:link:](chai/chai.d.ts) [chai](http://chaijs.com) by [Jed Mao](https://github.com/jedmao), [Bart van der Schoor](https://github.com/Bartvds), [Andrew Brown](https://github.com/AGBrown)
* [:link:](chai-as-promised/chai-as-promised.d.ts) [chai-as-promised](https://github.com/domenic/chai-as-promised) by [jt000](https://github.com/jt000)
* [:link:](chai-as-promised/chai-as-promised.d.ts) [chai-as-promised](https://github.com/domenic/chai-as-promised) by [jt000](https://github.com/jt000), [Yuki Kokubun](https://github.com/Kuniwak)
* [:link:](chai-datetime/chai-datetime.d.ts) [chai-datetime](https://github.com/gaslight/chai-datetime.git) by [Cliff Burger](https://github.com/cliffburger)
* [:link:](chai-fuzzy/chai-fuzzy.d.ts) [chai-fuzzy](http://chaijs.com/plugins/chai-fuzzy) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](chai-http/chai-http.d.ts) [chai-http](https://github.com/chaijs/chai-http) by [Wim Looman](https://github.com/Nemo157)
@@ -163,7 +170,9 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](classnames/classnames.d.ts) [classnames](https://github.com/JedWatson/classnames) by [Dave Keen](http://www.keendevelopment.ch)
* [:link:](cli-color/cli-color.d.ts) [cli-color](https://github.com/medikoo/cli-color) by [Joel Spadin](https://github.com/ChaosinaCan)
* [:link:](clone/clone.d.ts) [clone](https://github.com/pvorb/node-clone) by [Kieran Simpson](https://github.com/kierans/DefinitelyTyped)
* [:link:](codemirror/showhint.d.ts) [CodeMirror](https://github.com/marijnh/CodeMirror) by [jacqt](https://github.com/jacqt)
* [:link:](codemirror/codemirror.d.ts) [CodeMirror](https://github.com/marijnh/CodeMirror) by [mihailik](https://github.com/mihailik)
* [:link:](coffeeify/coffeeify.d.ts) [coffeeify](https://github.com/jnordberg/coffeeify) by [Qubo](https://github.com/tkQubo)
* [:link:](colorbrewer/colorbrewer.d.ts) [colorbrewer](https://github.com/jeanlauliac/colorbrewer) by [Matt Traynham](https://github.com/mtraynham)
* [:link:](colors/colors.d.ts) [Colors.js 0.6.0-1](https://github.com/Marak/colors.js) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](cometd/cometd.d.ts) [CometD](http://cometd.org) by [Derek Cicerone](https://github.com/derekcicerone)
@@ -228,7 +237,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [: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)
* [:link:](dojo/dojo.d.ts) [Dojo](http://dojotoolkit.org) by [Michael Van Sickle](https://github.com/vansimke)
* [:link:](dompurify/dompurify.d.ts) [DOM Purify](https://github.com/cure53/DOMPurify) by [Dave Taylor](http://davetayls.me)
* [:link:](dompurify/dompurify.d.ts) [DOM Purify](https://github.com/cure53/DOMPurify) by [Dave Taylor](http://davetayls.me), [Samira Bazuzi](https://github.com/bazuzi)
* [:link:](domo/domo.d.ts) [Domo](http://domo-js.com) by [Steve Fenton](https://github.com/Steve-Fenton)
* [: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)
@@ -239,7 +248,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [: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), [Andy Hawkins](https://github.com/a904guy/,http://a904guy.com/,http://www.bmbsqd.com)
* [: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), [Vasya Aksyonov](https://github.com/outring)
* [: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)
@@ -249,9 +258,10 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](easy-jsend/easy-jsend.d.ts) [easy-jsend](https://github.com/DeadAlready/easy-jsend) by [Karl Düüna](https://github.com/DeadAlready)
* [:link:](easy-session/easy-session.d.ts) [easy-session](https://github.com/DeadAlready/node-easy-session) by [Karl Düüna](https://github.com/DeadAlready)
* [:link:](easy-table/easy-table.d.ts) [easy-table](https://github.com/eldargab/easy-table) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](easy-xapi-supertest/easy-xapi-supertest.d.ts) [easy-x-headers](https://github.com/DeadAlready/easy-x-headers) by [Karl Düüna](https://github.com/DeadAlready)
* [:link:](easy-x-headers/easy-x-headers.d.ts) [easy-x-headers](https://github.com/DeadAlready/easy-x-headers) by [Karl Düüna](https://github.com/DeadAlready)
* [:link:](easy-xapi-supertest/easy-xapi-supertest.d.ts) [easy-x-headers](https://github.com/DeadAlready/easy-x-headers) by [Karl Düüna](https://github.com/DeadAlready)
* [:link:](easy-xapi/easy-xapi.d.ts) [easy-xapi](https://github.com/DeadAlready/easy-xapi) by [Karl Düüna](https://github.com/DeadAlready)
* [:link:](easy-xapi-utils/easy-xapi-utils.d.ts) [easy-xapi-utils](https://github.com/DeadAlready/easy-xapi-utils) by [Karl Düüna](https://github.com/DeadAlready)
* [:link:](easystarjs/easystarjs.d.ts) [EasyStar.js](http://easystarjs.com) by [Magnus Gustafsson](https://github.com/borundin)
* [:link:](egg.js/egg.js.d.ts) [Egg.js](https://github.com/mikeflynn/egg.js) by [Markus Peloso](https://github.com/ToastHawaii)
* [:link:](ejs-locals/ejs-locals.d.ts) [ejs-locals](https://github.com/randometc/ejs-locals) by [jt000](https://github.com/jt000)
@@ -264,6 +274,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](emissary/emissary.d.ts) [emissary](https://github.com/atom/emissary) by [vvakame](https://github.com/vvakame)
* [:link:](empower/empower.d.ts) [empower](https://github.com/twada/empower) by [vvakame](https://github.com/vvakame)
* [:link:](emscripten/emscripten.d.ts) [Emscripten](http://kripken.github.io/emscripten-site/index.html) by [Kensuke Matsuzaki](https://github.com/zakki)
* [:link:](envify/envify.d.ts) [envify](https://github.com/hughsk/envify) by [Qubo](https://github.com/tkQubo)
* [: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)
@@ -285,6 +296,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [: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)
* [:link:](express-jwt/express-jwt.d.ts) [express-jwt](https://www.npmjs.org/package/express-jwt) by [Wonshik Kim](https://github.com/wokim)
* [:link:](express-less/express-less.d.ts) [express-less](https://www.npmjs.com/package/express-less) by [xyb](https://github.com/xieyubo)
* [:link:](express-myconnection/express-myconnection.d.ts) [express-myconnection](https://www.npmjs.org/package/express-myconnection) by [Michael Ferris](https://github.com/Cellule)
* [:link:](express-partials/express-partials.d.ts) [express-partials](https://github.com/publicclass/express-partials) by [jt000](https://github.com/jt000)
* [:link:](express-session/express-session.d.ts) [express-session](https://www.npmjs.org/package/express-session) by [Hiroki Horiuchi](https://github.com/horiuchi)
@@ -293,13 +305,14 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](extend/extend.d.ts) [extend](https://www.npmjs.com/package/extend) by [Stefan Steinhart](https://github.com/reppners)
* [:link:](extjs/ExtJS.d.ts) [ExtJS](http://www.sencha.com/products/extjs) by [Brian Kotek](https://github.com/brian428)
* [: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:](fabricjs/fabricjs.d.ts) [FabricJS](http://fabricjs.com) by [Oliver Klemencic](https://github.com/oklemencic), [Joseph Livecchi](https://github.com/joewashear007), [Michael Randolph](https://github.com/mrand01)
* [: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)
* [:link:](fastclick/fastclick.d.ts) [FastClick](https://github.com/ftlabs/fastclick) by [Shinnosuke Watanabe](https://github.com/shinnn)
* [:link:](favico.js/favico.js.d.ts) [favico.js](http://lab.ejci.net/favico.js) by [Yu Matsushita](https://github.com/drowse314-dev-ymat)
* [:link:](whatwg-fetch/whatwg-fetch.d.ts) [fetch API](https://github.com/github/fetch) by [Ryan Graham](https://github.com/ryan-codingintrigue)
* [:link:](fhir/fhir.d.ts) [FHIR DSTU2](http://www.hl7.org/fhir/2015May/index.html) by [Artifact Health](www.artifacthealth.com)
* [:link:](fibers/fibers.d.ts) [fibers](https://github.com/laverdet/node-fibers) by [Carlos Ballesteros Velasco](https://github.com/soywiz)
@@ -326,7 +339,11 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](formidable/formidable.d.ts) [Formidable](https://github.com/felixge/node-formidable) by [Wim Looman](https://github.com/Nemo157)
* [:link:](foundation/foundation.d.ts) [Foundation](http://foundation.zurb.com) by [Boris Yankov](https://github.com/borisyankov)
* [:link:](fpsmeter/FPSMeter.d.ts) [FPSmeter](http://darsa.in/fpsmeter) by [Aaron Lampros](http://github.com/alampros)
* [:link:](freedom/freedom-module-env.d.ts) [freedom](https://github.com/freedomjs/freedom) by [Jonathan Pevarnek](https://github.com/jpevarnek)
* [:link:](freedom/freedom-core-env.d.ts) [freedom](https://github.com/freedomjs/freedom) by [Jonathan Pevarnek](https://github.com/jpevarnek)
* [:link:](freedom/freedom.d.ts) [freedom](https://github.com/freedomjs/freedom) by [Jonathan Pevarnek](https://github.com/jpevarnek)
* [:link:](from/from.d.ts) [from](https://github.com/dominictarr/from) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](fs-ext/fs-ext.d.ts) [fs-ext](https://github.com/baudehlo/node-fs-ext) by [Oguzhan Ergin](https://github.com/OguzhanE)
* [:link:](fs-extra/fs-extra.d.ts) [fs-extra](https://github.com/jprichardson/node-fs-extra) by [midknight41](https://github.com/midknight41)
* [:link:](fs-finder/fs-finder.d.ts) [fs-finder](https://github.com/sakren/node-fs-finder) by [Michael Zabka](https://github.com/misak113)
* [:link:](fs-mock/fs-mock.d.ts) [fs-mock](https://github.com/sakren/node-fs-mock) by [Rogier Schouten](https://github.com/rogierschouten)
@@ -375,13 +392,19 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](gsap/TweenLite.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-changed/gulp-changed.d.ts) [gulp-changed](https://github.com/sindresorhus/gulp-changed) by [Thomas Corbière](https://github.com/tomc974)
* [:link:](gulp-coffeeify/gulp-coffeeify.d.ts) [gulp-coffeeify](https://github.com/nariyu/gulp-coffeeify) by [Qubo](https://github.com/tkQubo)
* [: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-csso/gulp-csso.d.ts) [gulp-csso](https://github.com/ben-eb/gulp-csso) by [Tanguy Krotoff](https://github.com/tkrotoff)
* [: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)
* [:link:](gulp-debug/gulp-debug.d.ts) [gulp-debug](https://github.com/sindresorhus/gulp-debug) by [Tanguy Krotoff](https://github.com/tkrotoff)
* [:link:](gulp-dtsm/gulp-dtsm.d.ts) [gulp-dtsm](https://github.com/9joneg/gulp-dtsm) by [Aya Morisawa](https://github.com/AyaMorisawa)
* [:link:](gulp-espower/gulp-espower.d.ts) [gulp-espower](https://github.com/power-assert-js/gulp-espower) by [Qubo](https://github.com/tkQubo)
* [:link:](gulp-flatten/gulp-flatten.d.ts) [gulp-flatten](https://github.com/armed/gulp-flatten) by [Keita Kagurazaka](https://github.com/k-kagurazaka)
* [:link:](gulp-gh-pages/gulp-gh-pages.d.ts) [gulp-gh-pages](https://github.com/rowoot/gulp-gh-pages) by [Asana](https://asana.com)
* [:link:](gulp-if/gulp-if.d.ts) [gulp-if](https://github.com/robrich/gulp-if) by [Asana](https://asana.com)
* [:link:](gulp-help/gulp-help.d.ts) [gulp-help](https://github.com/chmontgomery/gulp-help) by [Qubo](https://github.com/tkQubo)
* [:link:](gulp-if/gulp-if.d.ts) [gulp-if](https://github.com/robrich/gulp-if) by [Asana](https://asana.com), [Joe Skeen](http://github.com/joeskeen)
* [:link:](gulp-inject/gulp-inject.d.ts) [gulp-inject](https://github.com/klei/gulp-inject) by [Keita Kagurazaka](https://github.com/k-kagurazaka)
* [: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)
@@ -390,18 +413,22 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [: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-newer/gulp-newer.d.ts) [gulp-newer](https://github.com/tschaub/gulp-newer) by [Thomas Corbière](https://github.com/tomc974)
* [:link:](gulp-plumber/gulp-plumber.d.ts) [gulp-plumber](https://github.com/floatdrop/gulp-plumber) by [Joe Skeen](http://github.com/joeskeen)
* [: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-sort/gulp-sort.d.ts) [gulp-sort](https://github.com/pgilad/gulp-sort) by [Joe Skeen](http://github.com/joeskeen)
* [: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)
@@ -418,6 +445,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](heatmap.js/heatmap.d.ts) [heatmap.js](https://github.com/pa7/heatmap.js) by [Yang Guan](https://github.com/lookuptable)
* [:link:](hellojs/hellojs.d.ts) [hello.js](http://adodson.com/hello.js) by [Pavel Zika](https://github.com/PavelPZ)
* [:link:](highcharts/highcharts.d.ts) [Highcharts](http://www.highcharts.com) by [Damiano Gambarotto](http://github.com/damianog)
* [:link:](highcharts-ng/highcharts-ng.d.ts) [highcharts-ng](https://github.com/pablojim/highcharts-ng) by [Scott Hatcher](https://github.com/scatcher)
* [:link:](highland/highland.d.ts) [Highland](http://highlandjs.org) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](highlightjs/highlightjs.d.ts) [highlight.js](https://github.com/isagalaev/highlight.js) by [Niklas Mollenhauer](https://github.com/nikeee), [Jeremy Hull](https://github.com/sourrust)
* [:link:](highcharts/highstock.d.ts) [Highstock](http://www.highcharts.com) by [David Deutsch](http://github.com/DavidKDeutsch)
@@ -431,6 +459,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](http-errors/http-errors.d.ts) [http-errors](https://github.com/jshttp/http-errors) 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:](httperr/httperr.d.ts) [httperr](https://github.com/pluma/httperr) by [Troy Gerwien](https://github.com/yortus)
* [: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)
@@ -440,6 +469,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [: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)
@@ -450,6 +480,7 @@ 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)
@@ -516,7 +547,9 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](jquery-handsontable/jquery-handsontable.d.ts) [jquery-handsontable](http://handsontable.com) by [Ted John](https://github.com/intelorca)
* [:link:](jquery.menuaim/jquery.menuaim.d.ts) [jQuery-menu-aim](https://github.com/kamens/jQuery-menu-aim) by [Robert Fonseca-Ensor](http://www.robfe.com)
* [:link:](jquery.pjax/jquery.pjax.d.ts) [jquery-pjax](https://github.com/defunkt/jquery-pjax) by [Junle Li](https://github.com/lijunle)
* [:link:](jquery-urlparam/jquery-urlparam.d.ts) [jquery-urlparam](https://gist.github.com/stpettersens/e1f4478f299b6f4905c1) by [Sam Saint-Pettersen](https://github.com/stpettersens)
* [:link:](jquery.address/jquery.address.d.ts) [jQuery.Address](https://github.com/asual/jquery-address) by [Martin Duparc](https://github.com/martinduparc), [Tim Klingeleers](https://github.com/mardaneus86)
* [:link:](jquery.ajaxfile/jquery.ajaxFile.d.ts) [jquery.ajaxfile](https://github.com/fpellet/jquery.ajaxFile) by [Florent PELLET](https://github.com/fpellet)
* [:link:](jquery.are-you-sure/jquery.are-you-sure.d.ts) [jquery.are-you-sure.js](https://github.com/codedance/jquery.AreYouSure) by [Jon Egerton](https://github.com/jonegerton)
* [:link:](jquery.autosize/jquery.autosize.d.ts) [jquery.autosize](http://www.jacklmoore.com/autosize) by [Aaron T. King](https://github.com/kingdango)
* [:link:](jquery.bbq/jquery.bbq.d.ts) [jquery.bbq](http://benalman.com/projects/jquery-bbq-plugin) by [Adam R. Smith](https://github.com/sunetos)
@@ -535,7 +568,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)
@@ -587,6 +620,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](jstree/jstree.d.ts) [jsTree](http://www.jstree.com) by [Adam Pluciński](https://github.com/adaskothebeast)
* [:link:](jsuri/jsuri.d.ts) [jsUri](https://github.com/derek-watson/jsUri) by [Chris Charabaruk](http://github.com/coldacid)
* [:link:](jszip/jszip.d.ts) [JSZip](http://stuk.github.com/jszip) by [mzeiher](https://github.com/mzeiher)
* [:link:](jug/jug.d.ts) [jug](https://github.com/kaiquewdev/Graph) by [yevt](https://github.com/yevt)
* [:link:](jwplayer/jwplayer.d.ts) [JW Player](http://developer.longtailvideo.com/trac) by [Martin Duparc](https://github.com/martinduparc)
* [:link:](jwt-simple/jwt-simple.d.ts) [jwt-simple](https://github.com/hokaccha/node-jwt-simple) by [Ken Fukuyama](https://github.com/kenfdev)
* [:link:](kafka-node/kafka-node.d.ts) [kafka-node](https://github.com/SOHU-Co/kafka-node) by [Daniel Imrie-Situnayake](https://github.com/dansitu)
@@ -626,6 +660,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)
@@ -661,6 +696,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [: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:](mailparser/mailparser.d.ts) [mailparser](https://www.npmjs.com/package/mailparser) by [Peter Snider](https://github.com/psnider)
* [: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)
@@ -686,7 +723,6 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [: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)
@@ -702,23 +738,23 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](mime/mime.d.ts) [mime](https://github.com/broofa/node-mime) by [Jeff Goddard](https://github.com/jedigo)
* [:link:](minilog/minilog.d.ts) [minilog v2](https://github.com/mixu/minilog) by [Guido](http://guido.io)
* [:link:](minimatch/minimatch.d.ts) [Minimatch](https://github.com/isaacs/minimatch) by [vvakame](https://github.com/vvakame)
* [:link:](minimist/minimist.d.ts) [minimist](https://github.com/substack/minimist) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](minimist/minimist.d.ts) [minimist](https://github.com/substack/minimist) by [Bart van der Schoor](https://github.com/Bartvds), [Necroskillz](https://github.com/Necroskillz)
* [:link:](mithril/mithril.d.ts) [Mithril](http://lhorie.github.io/mithril) by [Leo Horie](https://github.com/lhorie), [Chris Bowdon](https://github.com/cbowdon)
* [:link:](mixpanel/mixpanel.d.ts) [Mixpanel](https://mixpanel.com) by [Knut Eirik Leira Hjelle](https://github.com/hjellek)
* [:link:](mixto/mixto.d.ts) [mixto](https://github.com/atom/mixto) by [vvakame](https://github.com/vvakame)
* [: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-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/mocha-node.d.ts) [mocha](http://mochajs.org) by [Vadim Macagon](https://github.com/enlight), [vvakame](https://github.com/vvakame)
* [: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-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:](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/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)
@@ -746,6 +782,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [: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:](ng-dialog/ng-dialog.d.ts) [ngDialog](https://github.com/likeastore/ngDialog) by [Stephen Lautier](https://github.com/stephenlautier)
* [: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)
@@ -753,6 +791,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](nock/nock.d.ts) [nock](https://github.com/pgte/nock) by [bonnici](https://github.com/bonnici)
* [:link:](node-imap/imap.d.ts) [node imap](https://github.com/mscdex/node-imap) by [Steve Fenton](https://github.com/Steve-Fenton)
* [:link:](node-sass/node-sass.d.ts) [Node Sass](https://github.com/sass/node-sass) by [Asana](https://asana.com)
* [:link:](apn/apn.d.ts) [node-apn](https://github.com/argon/node-apn) by [Zenorbi](https://github.com/zenorbi)
* [:link:](bunyan/bunyan.d.ts) [node-bunyan](https://github.com/trentm/node-bunyan) by [Alex Mikhalev](https://github.com/amikhalev)
* [:link:](bunyan-logentries/bunyan-logentries.d.ts) [node-bunyan-logentries](https://github.com/nemtsov/node-bunyan-logentries) by [Aymeric Beaumet](http://aymericbeaumet.me)
* [:link:](node-calendar/node-calendar.d.ts) [node-calendar](https://www.npmjs.com/package/node-calendar) by [Luzian Zagadinow](https://github.com/luzianz)
@@ -764,12 +803,17 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [: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:](node-jsfl-runner/node-jsfl-runner.d.ts) [node-jsfl-runner](https://www.npmjs.com/package/node-jsfl-runner) by [Michael Randolph](https://github.com/mrand01)
* [: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-notifier/node-notifier.d.ts) [node-notifier](https://github.com/mikaelbr/node-notifier) by [Qubo](https://github.com/tkQubo)
* [: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:](node-slack/node-slack.d.ts) [node-slack](https://github.com/xoxco/node-slack) by [Qubo](https://github.com/tkQubo)
* [: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)
@@ -781,8 +825,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [: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)
* [:link:](each/each.d.ts) [NodeEach](http://www.adaltas.com/projects/node-each) by [Michael Zabka](https://github.com/misak113)
* [:link:](nodemailer/nodemailer.d.ts) [Nodemailer](https://github.com/andris9/Nodemailer) by [Rogier Schouten](https://github.com/rogierschouten)
* [: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)
@@ -790,10 +834,10 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [: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:](notifyjs/notifyjs.d.ts) [notify.js](https://github.com/alexgibson/notify.js) by [soundTricker](https://github.com/soundTricker)
* [: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:](wnumb/wnumb.d.ts) [nouislider](https://github.com/leongersen/wnumb) by [Corey Jepperson](https://github.com/acoreyj)
* [:link:](nouislider/nouislider.d.ts) [nouislider](https://github.com/leongersen/noUiSlider) by [Corey Jepperson](https://github.com/acoreyj)
* [:link:](nouislider/nouislider.d.ts) [nouislider](https://github.com/leongersen/noUiSlider) by [Patrick Davies](https://github.com/bleuarg)
* [: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)
* [:link:](nprogress/NProgress.d.ts) [NProgress](https://github.com/rstacruz/nprogress) by [Judah Gabriel Himango](http://debuggerdotbreak.wordpress.com)
@@ -801,15 +845,19 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](numeraljs/numeraljs.d.ts) [Numeral.js](https://github.com/adamwdraper/Numeral-js) by [Vincent Bortone](https://github.com/vbortone)
* [:link:](object-hash/object-hash.d.ts) [object-hash](https://github.com/puleos/object-hash) by [Michael Zabka](https://github.com/misak113)
* [:link:](object-path/object-path.d.ts) [objectPath v0.9.x](https://github.com/mariocasciaro/object-path) by [Paulo Cesar](https://github.com/pocesar)
* [:link:](oblo-util/oblo-util.d.ts) [oblo-util](https://github.com/Oblosys/oblo-util) by [Martijn Schrage](https://github.com/Oblosys)
* [:link:](oboe/oboe.d.ts) [oboe](https://github.com/jimhigson/oboe.js) by [Jared Klopper](https://github.com/optical)
* [:link:](oclazyload/oclazyload.d.ts) [oc.LazyLoad](https://github.com/ocombe/ocLazyLoad) by [Roland Zwaga](https://github.com/rolandzwaga)
* [:link:](angular-odata-resources/angular-odata-resources.d.ts) [OData Angular Resources](https://github.com/devnixs/ODataAngularResources) by [Raphael ATALLAH](http://raphael.atallah.me)
* [:link:](offline-js/offline-js.d.ts) [Offline](https://github.com/HubSpot/offline) by [Chris Wrench](https://github.com/cgwrench)
* [:link:](on-finished/on-finished.d.ts) [on-finished](https://github.com/jshttp/on-finished) by [Honza Dvorsky](http://github.com/czechboy0)
* [:link:](onsenui/onsenui.d.ts) [Onsen UI](http://onsen.io) by [Fran Dios](https://github.com/frankdiox)
* [:link:](open/open.d.ts) [open](https://github.com/jjrdn/node-open) by [Bart van der Schoor](https://github.com/Bartvds)
* [: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:](orchestrator/orchestrator.d.ts) [Orchestrator](https://github.com/orchestrator/orchestrator) by [Qubo](https://github.com/tkQubo)
* [:link:](os-locale/os-locale.d.ts) [os-locale](https://github.com/sindresorhus/os-locale) by [Aya Morisawa](https://github.com/AyaMorisawa)
* [: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)
@@ -848,7 +896,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [: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)
@@ -868,6 +917,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](preloadjs/preloadjs.d.ts) [PreloadJS](http://www.createjs.com/#!/PreloadJS) by [Pedro Ferreira](https://bitbucket.org/drk4)
* [:link:](prelude-ls/prelude-ls.d.ts) [prelude.ls](http://www.preludels.com) by [Aya Morisawa](https://github.com/AyaMorisawa)
* [:link:](progressjs/progress.d.ts) [ProgressJs](http://usablica.github.io/progress.js) by [Shunsuke Ohtani](https://github.com/zaneli)
* [:link:](project-oxford/project-oxford.d.ts) [project-oxford](https://github.com/felixrieseberg/project-oxford) by [Scott Southwood](https://github.com/scsouthw)
* [:link:](promise-pool/promise-pool.d.ts) [promise-pool](https://github.com/vilic/promise-pool) by [VILIC VANE](https://github.com/vilic)
* [:link:](promises-a-plus/promises-a-plus.d.ts) [promises-a-plus](http://promisesaplus.com) by [Igor Oleinikov](https://github.com/Igorbek)
* [:link:](protobufjs/protobufjs.d.ts) [ProtoBuf.js](https://github.com/dcodeIO/ProtoBuf.js) by [Panu Horsmalahti](https://github.com/panuhorsmalahti)
@@ -894,16 +944,19 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [: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)
* [:link:](ref-union/ref-union.d.ts) [ref-union](https://github.com/TooTallNate/ref-union) by [Paul Loyd](https://github.com/loyd)
* [: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-ip/request-ip.d.ts) [request-ip](https://github.com/pbojinov/request-ip) by [Adam Babcock](https://github.com/mrhen)
* [: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)
@@ -918,6 +971,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 [TANAKA Koichi](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)
@@ -943,16 +998,18 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](screenfull/screenfull.d.ts) [screenfull.js](https://github.com/sindresorhus/screenfull.js) by [Ilia Choly](http://github.com/icholy)
* [:link:](scrolltofixed/scrolltofixed.d.ts) [ScrollToFixed](https://github.com/bigspotteddog/ScrollToFixed) by [Ben Dixon](https://github.com/bmdixon)
* [:link:](seedrandom/seedrandom.d.ts) [seedrandom](https://github.com/davidbau/seedrandom) by [Kern Handa](https://github.com/kernhanda)
* [:link:](segment-analytics/segment-analytics.d.ts) [Segment's analytics.js](https://segment.com/docs/libraries/analytics.js) by [Andrew Fong](https://github.com/fongandrew)
* [:link:](select2/select2.d.ts) [Select2](http://ivaynberg.github.com/select2) by [Boris Yankov](https://github.com/borisyankov)
* [:link:](selectize/selectize.d.ts) [Selectize](https://github.com/brianreavis/selectize.js) by [Adi Dahiya](https://github.com/adidahiya)
* [:link:](selenium-webdriver/selenium-webdriver.d.ts) [Selenium WebDriverJS](https://code.google.com/p/selenium) by [Bill Armstrong](https://github.com/BillArmstrong)
* [:link:](selenium-webdriver/selenium-webdriver.d.ts) [Selenium WebDriverJS](https://code.google.com/p/selenium) by [Bill Armstrong](https://github.com/BillArmstrong), [Yuki Kokubun](https://github.com/Kuniwak)
* [:link:](semaphore/semaphore.d.ts) [semaphore](https://github.com/abrkn/semaphore.js) by [Matt Frantz](https://github.com/mhfrantz)
* [: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/sequelize.d.ts) [Sequelize](http://sequelizejs.com) by [samuelneff](https://github.com/samuelneff), [Peter Harris](https://github.com/codeanimal), [Ivan Drinchev](https://github.com/drinchev)
* [: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:](on-headers/on-headers.d.ts) [serve-favicon](https://github.com/jshttp/on-headers) by [John Jeffery](https://github.com/jjeffery)
* [: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)
@@ -972,6 +1029,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [: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:](ski/ski.d.ts) [ski](https://github.com/jden/ski) by [Aya Morisawa](https://github.com/AyaMorisawa)
* [:link:](skyway/skyway.d.ts) [SkyWay](http://nttcom.github.io/skyway) by [Toshiya Nakakura](https://github.com/nakakura)
* [:link:](slickgrid/SlickGrid.d.ts) [SlickGrid](https://github.com/mleibman/SlickGrid) by [Josh Baldwin](https://github.com/jbaldwin)
* [:link:](slickgrid/slick.autotooltips.d.ts) [SlickGrid AutoToolTips Plugin](https://github.com/mleibman/SlickGrid) by [Ryo Iwamoto](https://github.com/ryiwamoto)
@@ -995,6 +1053,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](sprintf/sprintf.d.ts) [sprintff](https://github.com/maritz/node-sprintff) by [Carlos Ballesteros Velasco](https://github.com/soywiz)
* [: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:](ssh2/ssh2.d.ts) [ssh2](https://github.com/mscdex/ssh2) by [Qubo](https://github.com/tkQubo)
* [:link:](stack-mapper/stack-mapper.d.ts) [stack-mapper](https://github.com/thlorenz/stack-mapper) by [Rogier Schouten](https://github.com/rogierschouten)
* [:link:](stacktrace-js/stacktrace-js.d.ts) [stacktrace.js](https://github.com/stacktracejs/stacktrace.js) by [Exceptionless](https://github.com/exceptionless)
* [:link:](stampit/stampit.d.ts) [stampit](https://github.com/stampit-org/stampit) by [Vasyl Boroviak](https://github.com/koresar)
@@ -1006,7 +1065,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](stream-series/stream-series.d.ts) [stream-series](https://github.com/rschmukler/stream-series) by [Keita Kagurazaka](https://github.com/k-kagurazaka)
* [:link:](stream-to-array/stream-to-array.d.ts) [stream-to-array](https://github.com/stream-utils/stream-to-array) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](streamjs/streamjs.d.ts) [streamjs](http://winterbe.github.io/streamjs) by [Bence Eros](https://github.com/erosb)
* [:link:](stripe/stripe.d.ts) [stripe](https://stripe.com) by [Eric J. Smith](https://github.com/ejsmith)
* [:link:](string_score/string_score.d.ts) [string_score](https://github.com/joshaven/string_score) by [Marcin Porębski](https://github.com/marcinporebski)
* [:link:](stripe/stripe.d.ts) [stripe](https://stripe.com) by [Andy Hawkins](https://github.com/a904guy/,http://a904guy.com), [Eric J. Smith](https://github.com/ejsmith)
* [:link:](stripe-checkout/stripe-checkout.d.ts) [Stripe Checkout](https://stripe.com/checkout) by [Chris Wrench](https://github.com/cgwrench)
* [:link:](stripe/stripe-node.d.ts) [stripe-node](https://github.com/stripe/stripe-node) by [William Johnston](https://github.com/wjohnsto)
* [:link:](strophe/strophe.d.ts) [Strophe.js](http://strophe.im/strophejs) by [David Deutsch](https://github.com/DavidKDeutsch)
@@ -1023,6 +1083,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [: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)
@@ -1038,6 +1099,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [: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)
@@ -1092,6 +1154,10 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [: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:](ui-router-extras/ui-router-extras.d.ts) [UI-Router Extras (ct.ui.router.extras module)](https://github.com/christopherthielen/ui-router-extras) by [Michael Putters](https://github.com/mputters)
* [: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)
@@ -1100,9 +1166,12 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](universal-analytics/universal-analytics.d.ts) [universal-analytics](https://github.com/peaksandpies/universal-analytics) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](unorm/unorm.d.ts) [unorm](https://github.com/walling/unorm) by [Christopher Brown](https://github.com/chbrown)
* [:link:](update-notifier/update-notifier.d.ts) [update-notifier](https://github.com/yeoman/update-notifier) by [vvakame](https://github.com/vvakame)
* [:link:](upper-case/upper-case.d.ts) [upper-case](https://github.com/blakeembrey/upper-case) by [Sam Saint-Pettersen](https://github.com/stpettersens)
* [:link:](upper-case-first/upper-case-first.d.ts) [upper-case-first](https://github.com/blakeembrey/upper-case-first) by [Sam Saint-Pettersen](https://github.com/stpettersens)
* [:link:](uri-templates/uri-templates.d.ts) [uri-templates](https://github.com/geraintluff/uri-templates) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](urijs/URIjs.d.ts) [URI.js](https://github.com/medialize/URI.js) by [RodneyJT](https://github.com/RodneyJT), [Brian Surowiec](https://github.com/xt0rted)
* [:link:](js-url/js-url.d.ts) [url](https://github.com/websanova/js-url) by [MIZUNE Pine](https://github.com/pine613)
* [:link:](url-template/url-template.d.ts) [url-template](https://github.com/bramstein/url-template) by [Marcin Porębski](https://github.com/marcinporebski)
* [: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)
@@ -1117,10 +1186,13 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [: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)
* [:link:](vinyl/vinyl.d.ts) [vinyl](https://github.com/wearefractal/vinyl) by [vvakame](https://github.com/vvakame), [jedmao](https://github.com/jedmao)
* [:link:](vinyl-buffer/vinyl-buffer.d.ts) [vinyl-buffer](https://github.com/hughsk/vinyl-buffer) by [Qubo](https://github.com/tkQubo)
* [:link:](vinyl-fs/vinyl-fs.d.ts) [vinyl-fs](https://github.com/wearefractal/vinyl-fs) by [vvakame](https://github.com/vvakame)
* [:link:](vinyl-paths/vinyl-paths.d.ts) [vinyl-paths](https://github.com/sindresorhus/vinyl-paths) by [Qubo](https://github.com/tkQubo)
* [: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)
@@ -1157,6 +1229,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](xss-filters/xss-filters.d.ts) [Yahoo XSS Filters](https://github.com/yahoo/xss-filters) by [Dave Taylor](http://davetayls.me)
* [:link:](yamljs/yamljs.d.ts) [yamljs](https://github.com/jeremyfa/yaml.js) by [Tim Jonischkat](http://www.tim-jonischkat.de)
* [:link:](yargs/yargs.d.ts) [yargs](https://github.com/chevex/yargs) by [Martin Poelstra](https://github.com/poelstra)
* [:link:](ydn-db/ydn-db.d.ts) [YDN-DB version 1](http://dev.yathit.com/ydn-db/index.html) by [Kyaw Tun](https://github.com/yathit), [Gabriel Monteagudo](https://github.com/gabrielmaldi)
* [:link:](yeoman-generator/yeoman-generator.d.ts) [yeoman-generator](https://github.com/yeoman/generator) by [Kentaro Okuno](http://github.com/armorik83)
* [:link:](yosay/yosay.d.ts) [yosay](https://github.com/yeoman/yosay) by [Kentaro Okuno](http://github.com/armorik83)
* [:link:](youtube/youtube.d.ts) [YouTube](https://developers.google.com/youtube) by [Daz Wilkin](https://github.com/DazWilkin), [Ian Obermiller](http://ianobermiller.com)
+3 -1
View File
@@ -18,7 +18,9 @@ declare module AceAjax {
bindKey:any;
exec:Function;
exec: Function;
readOnly?: boolean;
}
export interface CommandManager {
+1
View File
@@ -29,6 +29,7 @@ interface amplifyDecoders {
interface amplifyAjaxSettings extends JQueryAjaxSettings {
cache?: any;
dataMap?: {} | ((data: any) => {});
decoder?: any /* string or amplifyDecoder */;
}
+61
View File
@@ -0,0 +1,61 @@
/// <reference path="angular-gettext.d.ts" />
module angular_gettext_tests {
// Configuring angular-gettext
// https://angular-gettext.rocketeer.be/dev-guide/configure/
//Setting the language
angular.module('myApp').run(function (gettextCatalog: angular.gettext.gettextCatalog) {
gettextCatalog.setCurrentLanguage('nl');
});
//Highlighting untranslated strings
angular.module('myApp').run(function (gettextCatalog: angular.gettext.gettextCatalog) {
gettextCatalog.debug = true;
});
// Marking strings in JavaScript code as translatable.
// https://angular-gettext.rocketeer.be/dev-guide/annotate-js/
angular.module("myApp").controller("helloController", function (gettext: angular.gettext.gettextFunction) {
var myString = gettext("Hello");
});
//Translating directly in JavaScript.
angular.module("myApp").controller("helloController", function (gettextCatalog: angular.gettext.gettextCatalog) {
var translated: string = gettextCatalog.getString("Hello");
});
angular.module("myApp").controller("helloController", function (gettextCatalog: angular.gettext.gettextCatalog) {
var myString2: string = gettextCatalog.getPlural(3, "Bird", "Birds");
});
angular.module("myApp").controller("helloController", function (gettextCatalog: angular.gettext.gettextCatalog) {
var translated: string = gettextCatalog.getString("Hello {{name}}", { name: "Ruben" });
});
// Setting strings manually
// https://angular-gettext.rocketeer.be/dev-guide/manual-setstrings/
angular.module("myApp").run(function (gettextCatalog: angular.gettext.gettextCatalog) {
// Load the strings automatically during initialization.
gettextCatalog.setStrings("nl", {
"Hello": "Hallo",
"One boat": ["Een boot", "{{$count}} boats"]
});
});
interface helloControllerScope extends ng.IScope {
switchLanguage: (lang: string) => void;
}
// Lazy-loading languages
// https://angular-gettext.rocketeer.be/dev-guide/lazy-loading/
angular.module("myApp").controller("helloController", function ($scope: helloControllerScope, gettextCatalog: angular.gettext.gettextCatalog) {
$scope.switchLanguage = function (lang: string) {
gettextCatalog.setCurrentLanguage(lang);
gettextCatalog.loadRemote("/languages/" + lang + ".json");
};
});
}
+73
View File
@@ -0,0 +1,73 @@
// Type definitions for angular-gettext v2.1.0
// Project: https://angular-gettext.rocketeer.be/
// Definitions by: Ákos Lukács <https://github.com/AkosLukacs>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare module angular.gettext {
interface gettextCatalog {
//////////////
/// Fields ///
//////////////
/** (default: false): Whether or not to prefix untranslated strings with [MISSING]: or a custom prefix. */
debug: boolean;
/** (default: [MISSING]:): Custom prefix for untranslated strings. */
debugPrefix: string;
/** (default: false): Whether or not to wrap all processed text with markers.Example output: [Welcome] */
showTranslatedMarkers: boolean;
/** (default: [): Custom prefix to mark strings that have been run through angular-gettext. */
translatedMarkerPrefix: string;
/** (default: ]): Custom suffix to mark strings that have been run through angular-gettext. */
translatedMarkerSuffix: string;
/** An object of loaded translation strings.Shouldn't be used directly. */
strings: {};
/** The default language, in which you're application is written. This defaults to English and it's generally a bad idea to use anything else: if your language has different pluralization rules you'll end up with incorrect translations. Deprecated
* @deprecreated
*/
baseLanguage: string;
///////////////
/// Methods ///
///////////////
/** Sets the current language and makes sure that all translations get updated correctly. */
setCurrentLanguage(lang: string): void;
/** Returns the current language. */
getCurrentLanguage(): string;
/** Processes an object of string definitions. More details https://angular-gettext.rocketeer.be/dev-guide/manual-setstrings/
* @param language A language code.
* @param strings A dictionary of strings. The format of this dictionary is:
* - Keys: Singular English strings (as defined in the source files)
* - Values: Either a single string for signular-only strings or an array of plural forms.
*/
setStrings(language: string, strings: { [key: string]: string|string[] }): void;
/** Get the correct pluralized (but untranslated) string for the value of n. */
getStringForm(string: string, n: number): string;
/** Translate a string with the given context. Uses Angular.JS interpolation, so something like this will do what you expect:
* var hello = gettextCatalog.getString("Hello {{name}}!", { name: "Ruben" });
* // var hello will be "Hallo Ruben!" in Dutch.
* The context parameter is optional: pass null (or don't pass anything) if you're not using it: this skips interpolation and is a lot faster.
*/
getString(string: string, context?: any): string;
/** Translate a plural string with the given context. */
getPlural(n: number, string: string, stringPlural: string, context?: any): string;
/** Load a set of translation strings from a given URL.This should be a JSON catalog generated with grunt-angular-gettext. More details https://angular-gettext.rocketeer.be/dev-guide/lazy-loading/ */
loadRemote(url: string): ng.IHttpPromise<any>;
}
/** If you have text that should be translated in your JavaScript code, wrap it with a call to a function named gettext. This module provides an injectable function to do so */
interface gettextFunction {
(dummyString: string): string;
}
}
@@ -197,3 +197,12 @@ users = odataResourceClass.odata()
var countResult = odataResourceClass.odata().count();
var total = countResult.result;
var usersSelect1 = odataResourceClass.odata()
.select('name', 'user');
var usersSelect2 = odataResourceClass.odata()
.select(['name', 'user']);
+9 -5
View File
@@ -267,6 +267,7 @@ declare module OData {
interface ICountResult{
result: number;
$promise: angular.IPromise<any>;
}
class Provider<T> {
@@ -278,14 +279,17 @@ 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>;
}
+15 -1
View File
@@ -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)).
+2 -2
View File
@@ -18,7 +18,7 @@ declare module ngSignalr {
connection: SignalR;
proxy: HubProxy;
on(event: string, fn: ((...args: any[]) => void)): void;
on(event: string, fn: (...args: any[]) => void): void;
invoke(method: string, ...args: any[]): JQueryDeferred<any>;
disconnect(): void;
connect(): JQueryPromise<any>;
@@ -70,4 +70,4 @@ declare module ngSignalr {
*/
stateChanged?: (state: SignalRStateChange) => void;
}
}
}
@@ -135,7 +135,7 @@ testApp.config((
popupDelay: 1000,
appendToBody: true,
trigger: 'mouseenter hover',
useContentExp: true
useContentExp: true,
});
$tooltipProvider.setTriggers({
'customOpenTrigger': 'customCloseTrigger'
+3
View File
@@ -5,6 +5,9 @@
/// <reference path="../angularjs/angular.d.ts" />
// Support for AMD require
declare module 'angular-bootstrap' {}
declare module angular.ui.bootstrap {
interface IAccordionConfig {
@@ -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' });
@@ -142,7 +158,9 @@ class UrlLocatorTestService implements IUrlLocatorTestService {
private stateServiceTest() {
this.$state.go("myState");
this.$state.go(this.$state.current);
this.$state.transitionTo("myState");
this.$state.transitionTo(this.$state.current);
if (this.$state.includes("myState") === true) {
//
}
@@ -177,3 +195,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();
});
}
+116 -3
View File
@@ -91,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 {
@@ -114,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 {
@@ -162,8 +228,11 @@ declare module angular.ui {
* @param options Options object.
*/
go(to: string, params?: {}, options?: IStateOptions): angular.IPromise<any>;
go(to: IState, params?: {}, options?: IStateOptions): angular.IPromise<any>;
transitionTo(state: string, params?: {}, updateLocation?: boolean): void;
transitionTo(state: IState, params?: {}, updateLocation?: boolean): void;
transitionTo(state: string, params?: {}, options?: IStateOptions): void;
transitionTo(state: IState, params?: {}, options?: IStateOptions): void;
includes(state: string, params?: {}): boolean;
is(state:string, params?: {}): boolean;
is(state: IState, params?: {}): boolean;
@@ -203,6 +272,7 @@ declare module angular.ui {
*
*/
sync(): void;
listen(): void;
}
interface IUiViewScrollProvider {
@@ -212,4 +282,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;
}
}
+13
View File
@@ -0,0 +1,13 @@
/// <reference path="angular-ui-tree.d.ts" />
var treeNode: AngularUITree.ITreeNode = {
id: 0,
nodes: [],
title: "test"
};
var treeNode2: AngularUITree.ITreeNode = {
id: "0",
nodes: [treeNode],
title: "test2"
};
+15
View File
@@ -0,0 +1,15 @@
// Type definitions for angular-ui-tree v2.8.0
// Project: https://github.com/angular-ui-tree/angular-ui-tree
// Definitions by: Calvin Fernandez <https://github.com/CalvinFernandez>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module AngularUITree {
/**
* Node in list
*/
interface ITreeNode {
id: number | string;
nodes: ITreeNode[];
title: string;
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1 +1 @@
--experimentalDecorators --target ES5
--experimentalDecorators --noImplicitAny --target ES5
+2178 -2820
View File
File diff suppressed because it is too large Load Diff
+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;
}
+689
View File
@@ -0,0 +1,689 @@
// Type definitions for Angular v2.0.0-alpha.36
// 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): Object;
/**
* 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: any;
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 PathLocationStrategy 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: any;
resolveComponentType(): Promise<Type>;
specificity: any;
terminal: any;
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 ROUTE_DATA : OpaqueToken ;
const ROUTER_DIRECTIVES : List<any> ;
const ROUTER_BINDINGS : 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;
}
var RouteConfig : (configs: List<RouteDefinition>) => ClassDecorator ;
interface ComponentDefinition {
type: string;
loader?: Function;
component?: Type;
}
}
declare module "angular2/router" {
export = ngRouter;
}
+256 -36
View File
@@ -1,4 +1,4 @@
// Type definitions for Angular v2.0.0-alpha.34
// Type definitions for Angular v2.0.0-alpha.36
// Project: http://angular.io/
// Definitions by: angular team <https://github.com/angular/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -8,16 +8,22 @@
// 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 {
declare module ngRouter {
/**
* # Router
@@ -87,6 +93,13 @@ declare module ng {
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
*/
@@ -96,7 +109,7 @@ declare module ng {
/**
* Subscribe to URL updates from the router
*/
subscribe(onNext: (value: any) => void): void;
subscribe(onNext: (value: any) => void): Object;
/**
@@ -122,7 +135,7 @@ declare module ng {
* 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 {
@@ -144,6 +157,8 @@ declare module ng {
childRouter: Router;
name: string;
/**
* Given an instruction, update the contents of this outlet.
@@ -199,7 +214,7 @@ declare module ng {
visibleHref: string;
routeParams: void;
routeParams: any;
onClick(): boolean;
}
@@ -223,13 +238,13 @@ declare module ng {
/**
* Given a component and a configuration object, add the route to this registry
*/
config(parentComponent: any, config: RouteDefinition, isRootLevelRoute?: boolean): void;
config(parentComponent: any, config: RouteDefinition): void;
/**
* Reads the annotations of a component and configures the registry based on them
*/
configFromComponent(component: any, isRootComponent?: boolean): void;
configFromComponent(component: any): void;
/**
@@ -243,7 +258,7 @@ declare module ng {
* 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 {
@@ -276,7 +291,7 @@ declare module ng {
back(): void;
}
class HTML5LocationStrategy extends LocationStrategy {
class PathLocationStrategy extends LocationStrategy {
onPopState(fn: EventListener): void;
@@ -319,7 +334,7 @@ declare module ng {
subscribe(onNext: (value: any) => void, onThrow?: (exception: any) => void, onReturn?: () => void): void;
}
const appBaseHrefToken : OpaqueToken ;
const APP_BASE_HREF : OpaqueToken ;
/**
@@ -335,78 +350,260 @@ declare module ng {
/**
* 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 : (hook: (next: Instruction, prev: Instruction) => Promise<boolean>| boolean) => ClassDecorator ;
/**
* An `Instruction` represents the component hierarchy of the application based on a given route
* 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 {
accumulatedUrl: string;
reuse: boolean;
specificity: number;
component: any;
capturedUrl: string;
component: ComponentInstruction;
child: Instruction;
params(): StringMap<string, string>;
auxInstruction: StringMap<string, Instruction>;
replaceChild(child: Instruction): Instruction;
}
const routerDirectives : List<any> ;
/**
* 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: any;
resolveComponentType(): Promise<Type>;
specificity: any;
terminal: any;
routeData(): Object;
}
var routerInjectables : List<any> ;
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 ROUTE_DATA : OpaqueToken ;
const ROUTER_DIRECTIVES : List<any> ;
const ROUTER_BINDINGS : List<any> ;
class Route implements RouteDefinition {
data: any;
path: string;
component: Type;
@@ -425,10 +622,31 @@ declare module ng {
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;
@@ -447,6 +665,8 @@ declare module ng {
redirectTo?: string;
as?: string;
data?: any;
}
var RouteConfig : (configs: List<RouteDefinition>) => ClassDecorator ;
@@ -463,7 +683,7 @@ declare module ng {
}
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');
+187 -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" />
@@ -10,6 +10,11 @@ declare module "angular-mocks/ngMock" {
export = _;
}
declare module "angular-mocks/ngMockE2E" {
var _: string;
export = _;
}
declare module "angular-mocks/ngAnimateMock" {
var _: string;
export = _;
@@ -97,137 +102,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 +313,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;
+177 -28
View File
@@ -244,17 +244,71 @@ foo.then((x) => {
// $q signature tests
module TestQ {
var $q: ng.IQService;
var promise1: ng.IPromise<any>;
var promise2: ng.IPromise<any>;
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
$q.all([promise1, promise2]).then((results: any[]) => {});
$q.all<number>([promise1, promise2]).then((results: number[]) => {});
$q.all({a: promise1, b: promise2}).then((results: {[id: string]: any;}) => {});
$q.all<{a: number; b: string;}>({a: promise1, b: promise2}).then((results: {a: number; b: string;}) => {});
{
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) => {
// When returning a promise the generic type must be inferred.
@@ -273,6 +327,48 @@ httpFoo.success((data, status, headers, config) => {
});
// 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;
@@ -283,34 +379,48 @@ module TestPromise {
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>;
interface IPromiseSuccessCallback<T, U> {
(promiseValue: T): angular.IHttpPromise<U>|angular.IPromise<U>|U|angular.IPromise<void>;
}
var successCallbackAnyFn: IPromiseSuccessCallback<TResult, any>;
var successCallbackTResultFn: IPromiseSuccessCallback<TResult, TResult>;
interface IPromiseErrorCallback<T> {
(error: any): angular.IHttpPromise<T>|angular.IPromise<T>|T;
}
var errorCallbackAnyFn: IPromiseErrorCallback<any>;
var errorCallbackTResultFn: IPromiseErrorCallback<TResult>;
// promise.then
result = <angular.IPromise<any>>promise.then(successCallbackAnyFn);
result = <angular.IPromise<any>>promise.then(successCallbackAnyFn, (any) => any);
result = <angular.IPromise<any>>promise.then(successCallbackAnyFn, (any) => any, (any) => any);
result = <angular.IPromise<TResult>>promise.then<TResult>(successCallbackTResultFn);
result = <angular.IPromise<TResult>>promise.then<TResult>(successCallbackTResultFn, (any) => any);
result = <angular.IPromise<TResult>>promise.then<TResult>(successCallbackTResultFn, (any) => any, (any) => any);
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(errorCallbackAnyFn);
result = <angular.IPromise<TResult>>promise.catch<TResult>(errorCallbackTResultFn);
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<any>>promise.finally(() => any);
result = <angular.IPromise<TResult>>promise.finally<TResult>(() => any);
result = <angular.IPromise<TResult>>promise.finally(() => any);
result = <angular.IPromise<TResult>>promise.finally(() => tresult);
result = <angular.IPromise<TResult>>promise.finally(() => tother);
}
@@ -329,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;
+14 -3
View File
@@ -725,8 +725,9 @@ declare module angular {
// see http://docs.angularjs.org/api/ng.$timeout
///////////////////////////////////////////////////////////////////////////
interface ITimeoutService {
<T>(func: (...args: any[]) => T, delay?: number, invokeApply?: boolean): IPromise<T>;
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;
}
///////////////////////////////////////////////////////////////////////////
@@ -998,6 +999,8 @@ declare module angular {
interface IQService {
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.
@@ -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> {
@@ -1449,6 +1452,14 @@ declare module angular {
interceptors: any[];
useApplyAsync(): boolean;
useApplyAsync(value: boolean): IHttpProvider;
/**
*
* @param {boolean=} value If true, `$http` will return a normal promise without the `success` and `error` methods.
* @returns {boolean|Object} If a value is specified, returns the $httpProvider for chaining.
* otherwise, returns the current configured value.
*/
useLegacyPromiseExtensions(value:boolean) : boolean | IHttpProvider;
}
///////////////////////////////////////////////////////////////////////////
+2 -3
View File
@@ -3,7 +3,7 @@
module Analytics {
angular.module("angulartics.app", ["angulartics"])
.config(["$analyticsProvider", ($analyticsProvider: Angulartics.IAnalyticsServiceProvider) => {
.config(["$analyticsProvider", ($analyticsProvider:angulartics.IAnalyticsServiceProvider) => {
angulartics.waitForVendorApi("location", 1000, (message: string) => {
console.log(message);
});
@@ -17,11 +17,10 @@ module Analytics {
console.log(action);
});
$analyticsProvider.registerPageTrack((path: string, locationObj: ng.ILocationService) => {
$analyticsProvider.registerPageTrack((path:string, locationObj:angular.ILocationService) => {
console.log("viewed " + path);
});
$analyticsProvider.settings.pageTracking.basePath = "/my/base/path";
}]);
}
+7 -8
View File
@@ -4,16 +4,15 @@
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare module angulartics {
interface Angulartics {
waitForVendorApi(objectName: string, delay: number, containsField?: any, registerFn?: any, onTimeout?: boolean): void;
}
declare module Angulartics {
interface IAngularticsStatic {
waitForVendorApi(objectName:string, delay:number, containsField?:any, registerFn?:any, onTimeout?:boolean): void;
}
interface IAnalyticsService {
eventTrack(eventName: string, properties?: any): any;
pageTrack(path: string, location?: ng.ILocationService): any;
pageTrack(path:string, location?:angular.ILocationService): any;
setAlias(alias: string): any;
setUsername(username: string): any;
setUserProperties(properties: any): any;
@@ -27,7 +26,7 @@ declare module Angulartics {
withAutoBase(value: boolean): void;
developerMode(value: boolean): void;
registerPageTrack(callback: (path: string, location?: ng.ILocationService) => any): void;
registerPageTrack(callback:(path:string, location?:angular.ILocationService) => any): void;
registerEventTrack(callback: (eventName: string, properties?: any) => any): void;
registerSetAlias(callback: (alias: string) => any): void
registerSetUsername(callback: (username: string) => any): void
@@ -46,4 +45,4 @@ declare module Angulartics {
}
}
declare var angulartics:Angulartics;
declare var angulartics:angulartics.IAngularticsStatic;
+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;
}
+3 -1
View File
@@ -1,3 +1,5 @@
/// <reference path="./async.d.ts" />
import async = require("async");
async.map(["a", "b", "c"], (item, cb) => cb(null, [item.toUpperCase()]), (err, results) => { });
async.map(["a", "b", "c"], (item, cb) => cb(null, [item.toUpperCase()]), (err, results) => { });
+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;
}
+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 {
+2 -1
View File
@@ -309,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;
+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;
+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));
////
+27
View File
@@ -0,0 +1,27 @@
/// <reference path="better-curry.d.ts" />
import bc = require('better-curry');
bc.flatten([1,2,3,[1,2],['a']]) === [];
bc.MAX_OPTIMIZED = 5;
function fn(...args: number[]): number[] {
return [].concat([1]);
}
function fn2(arg1: string, arg2: any): number {
return parseInt(arg1 + String(arg2)) + 1;
}
bc.predefine(fn, [1,2])() === [];
bc.predefine(fn, [1,2]).__length === 3;
var f = bc.wrap(fn2, {}, 10, true);
f('1', 2) === 3;
var delegate = bc.delegate({}, 'ok');
delegate.access('ok') === delegate;
delegate.getter('getter').setter('setter') === delegate;
delegate.all(['1','2']);
delegate.revoke('adsf').access('asdf');
BetterCurry.wrap(fn2, {}, -1, false).__length === 10;
+50
View File
@@ -0,0 +1,50 @@
// Type definitions for better-curry
// Project: https://github.com/pocesar/js-bettercurry
// Definitions by: Paulo Cesar <https://github.com/pocesar>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare var BetterCurry: BetterCurryModule.BetterCurry;
declare module BetterCurryModule {
export interface DelegateOptions {
as?: string;
len?: number;
args?: any[];
name?: string;
}
export class Delegate<T> {
proto: T;
target: string;
methods: any[];
getters: any[];
setters: any[];
all: (skip?: string[]) => void;
method: (name: string|DelegateOptions) => Delegate<T>;
getter: (name: string|DelegateOptions) => Delegate<T>;
setter: (name: string|DelegateOptions) => Delegate<T>;
access: (name: string|DelegateOptions) => Delegate<T>;
revoke: (name: string) => Delegate<T>;
constructor(proto: T, target: string);
}
export interface OriginalFunctionReminder<T> extends Function {
__length: number;
}
export interface BetterCurry {
predefine: <T extends Function>(fn: T, args: any[], context?: Object, len?: number, checkArguments?: boolean) => OriginalFunctionReminder<T>;
wrap: <T extends Function>(fn: T, context?: Object, len?: number, checkArguments?: boolean) => OriginalFunctionReminder<T>;
flatten: (...args: Array<Array<any>|any>) => any[];
delegate: <T>(proto: T, target: string) => Delegate<T>;
MAX_OPTIMIZED: number;
}
}
declare module 'better-curry' {
var bc: BetterCurryModule.BetterCurry;
export = bc;
}
+2 -2
View File
@@ -6,7 +6,7 @@
declare module BigJsLibrary {
export enum RoundingMode {
export const enum RoundingMode {
RoundTowardsZero = 0,
RoundTowardsNearestAwayFromZero = 1,
RoundTowardsNearestTowardsEven = 2,
@@ -200,4 +200,4 @@ declare module BigJsLibrary {
}
}
declare var Big: BigJsLibrary.BigJS;
declare var Big: BigJsLibrary.BigJS;
+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> {
+35
View File
@@ -0,0 +1,35 @@
/// <reference path="bluebird-retry.d.ts" />
/// <reference path="../bluebird/bluebird.d.ts" />
import Promise = require('bluebird');
import retry = require('bluebird-retry');
function promiseSuccess(text:string) {
return Promise.resolve(text);
};
var count = 0;
function myfunc() {
console.log('myfunc called ' + (++count) + ' times');
if (count < 3) {
throw new Error('i fail the first two times');
} else {
return promiseSuccess('i succeed the third time');
}
}
retry(myfunc)
.done(function(result) { console.log(result); } );
//Options example
function logFail() {
console.log(new Date().toISOString());
throw new Error('bail');
}
var options:retry.Options = {
max_tries: 4,
interval: 500
};
retry(logFail, options);
+24
View File
@@ -0,0 +1,24 @@
// Type definitions for bluebird-retry
// Project: https://github.com/jut-io/bluebird-retry
// Definitions by: Pascal Vomhoff <https://github.com/pvomhoff>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../bluebird/bluebird.d.ts" />
declare module "bluebird-retry" {
import Promise = require('bluebird');
function retry<T>(func:(param:T)=>void, options?:retry.Options):Promise<T>;
module retry {
export interface Options {
interval?:number;
backoff?:number;
max_interval?:number;
timeout?:number;
max_tries?:number;
}
}
export = retry;
}
+230 -7
View File
@@ -1,4 +1,4 @@
/// <reference path="bluebird.d.ts" />
///<reference path="bluebird.d.ts"/>
// Tests by: Bart van der Schoor <https://github.com/Bartvds>
@@ -144,6 +144,10 @@ var BlueBird: typeof Promise;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
var nodeCallbackFunc = (callback: (err: any, result: string) => void) => {}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
fooThen = fooProm;
barThen = barProm;
@@ -365,12 +369,12 @@ fooProm = fooProm.timeout(num, str);
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
fooProm.nodeify();
fooProm = fooProm.nodeify((err: any) => {
fooProm = fooProm.nodeify((err: any) => { });
fooProm = fooProm.nodeify((err: any, foo?: Foo) => { });
});
fooProm = fooProm.nodeify((err: any, foo?: Foo) => {
});
fooProm.nodeify({ spread: true });
fooProm = fooProm.nodeify((err: any) => { }, { spread: true });
fooProm = fooProm.nodeify((err: any, foo?: Foo) => { }, { spread: true });
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -504,6 +508,17 @@ barArrProm = fooProm.map<Foo, Bar>((item: Foo) => {
return bar;
});
barArrProm = fooProm.map<Foo, Bar>((item: Foo, index: number, arrayLength: number) => {
return bar;
}, {
concurrency: 1
});
barArrProm = fooProm.map<Foo, Bar>((item: Foo) => {
return bar;
}, {
concurrency: 1
});
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
barProm = fooProm.reduce<Foo, Bar>((memo: Bar, item: Foo, index: number, arrayLength: number) => {
@@ -522,6 +537,17 @@ fooArrProm = fooArrProm.filter<Foo>((item: Foo) => {
return bool;
});
fooArrProm = fooArrProm.filter<Foo>((item: Foo, index: number, arrayLength: number) => {
return bool;
}, {
concurrency: 1
});
fooArrProm = fooArrProm.filter<Foo>((item: Foo) => {
return bool;
}, {
concurrency: 1
});
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -613,9 +639,39 @@ voidProm = Promise.delay(num);
func = Promise.promisify(f);
func = Promise.promisify(f, obj);
;
obj = Promise.promisifyAll(obj);
anyProm = Promise.fromNode(callback => nodeCallbackFunc(callback));
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
declare var util: any;
function defaultFilter(name: string, func: Function) {
return util.isIdentifier(name) &&
name.charAt(0) !== "_" &&
!util.isClass(func);
}
function DOMPromisifier(originalMethod: Function) {
// return a function
return function promisified() {
var args = [].slice.call(arguments);
// Needed so that the original method can be called with the correct receiver
var self = this;
// which returns a promise
return new Promise(function(resolve, reject) {
args.push(resolve, reject);
originalMethod.apply(self, args);
});
};
}
obj = Promise.promisifyAll(obj, {
suffix: "",
filter: defaultFilter,
promisifier: DOMPromisifier
});
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -704,6 +760,26 @@ barArrProm = Promise.map(fooThenArrThen, (item: Foo, index: number, arrayLength:
return barThen;
});
barArrProm = Promise.map(fooThenArrThen, (item: Foo) => {
return bar;
}, {
concurrency: 1
});
barArrProm = Promise.map(fooThenArrThen, (item: Foo) => {
return barThen;
}, {
concurrency: 1
});
barArrProm = Promise.map(fooThenArrThen, (item: Foo, index: number, arrayLength: number) => {
return bar;
}, {
concurrency: 1
});
barArrProm = Promise.map(fooThenArrThen, (item: Foo, index: number, arrayLength: number) => {
return barThen;
}, {
concurrency: 1
});
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// fooArrThen
@@ -721,6 +797,27 @@ barArrProm = Promise.map(fooArrThen, (item: Foo, index: number, arrayLength: num
return barThen;
});
barArrProm = Promise.map(fooArrThen, (item: Foo) => {
return bar;
}, {
concurrency: 1
});
barArrProm = Promise.map(fooArrThen, (item: Foo) => {
return barThen;
}, {
concurrency: 1
});
barArrProm = Promise.map(fooArrThen, (item: Foo, index: number, arrayLength: number) => {
return bar;
}, {
concurrency: 1
});
barArrProm = Promise.map(fooArrThen, (item: Foo, index: number, arrayLength: number) => {
return barThen;
}, {
concurrency: 1
});
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// fooThenArr
@@ -738,6 +835,27 @@ barArrProm = Promise.map(fooThenArr, (item: Foo, index: number, arrayLength: num
return barThen;
});
barArrProm = Promise.map(fooThenArr, (item: Foo) => {
return bar;
}, {
concurrency: 1
});
barArrProm = Promise.map(fooThenArr, (item: Foo) => {
return barThen;
}, {
concurrency: 1
});
barArrProm = Promise.map(fooThenArr, (item: Foo, index: number, arrayLength: number) => {
return bar;
}, {
concurrency: 1
});
barArrProm = Promise.map(fooThenArr, (item: Foo, index: number, arrayLength: number) => {
return barThen;
}, {
concurrency: 1
});
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// fooArr
@@ -755,6 +873,27 @@ barArrProm = Promise.map(fooArr, (item: Foo, index: number, arrayLength: number)
return barThen;
});
barArrProm = Promise.map(fooArr, (item: Foo) => {
return bar;
}, {
concurrency: 1
});
barArrProm = Promise.map(fooArr, (item: Foo) => {
return barThen;
}, {
concurrency: 1
});
barArrProm = Promise.map(fooArr, (item: Foo, index: number, arrayLength: number) => {
return bar;
}, {
concurrency: 1
});
barArrProm = Promise.map(fooArr, (item: Foo, index: number, arrayLength: number) => {
return barThen;
}, {
concurrency: 1
});
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// reduce()
@@ -848,6 +987,27 @@ fooArrProm = Promise.filter(fooThenArrThen, (item: Foo, index: number, arrayLeng
return boolThen;
});
fooArrProm = Promise.filter(fooThenArrThen, (item: Foo) => {
return bool;
}, {
concurrency: 1
});
fooArrProm = Promise.filter(fooThenArrThen, (item: Foo) => {
return boolThen;
}, {
concurrency: 1
});
fooArrProm = Promise.filter(fooThenArrThen, (item: Foo, index: number, arrayLength: number) => {
return bool;
}, {
concurrency: 1
});
fooArrProm = Promise.filter(fooThenArrThen, (item: Foo, index: number, arrayLength: number) => {
return boolThen;
}, {
concurrency: 1
});
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// fooArrThen
@@ -865,6 +1025,27 @@ fooArrProm = Promise.filter(fooArrThen, (item: Foo, index: number, arrayLength:
return boolThen;
});
fooArrProm = Promise.filter(fooArrThen, (item: Foo) => {
return bool;
}, {
concurrency: 1
});
fooArrProm = Promise.filter(fooArrThen, (item: Foo) => {
return boolThen;
}, {
concurrency: 1
});
fooArrProm = Promise.filter(fooArrThen, (item: Foo, index: number, arrayLength: number) => {
return bool;
}, {
concurrency: 1
});
fooArrProm = Promise.filter(fooArrThen, (item: Foo, index: number, arrayLength: number) => {
return boolThen;
}, {
concurrency: 1
});
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// fooThenArr
@@ -882,6 +1063,27 @@ fooArrProm = Promise.filter(fooThenArr, (item: Foo, index: number, arrayLength:
return boolThen;
});
fooArrProm = Promise.filter(fooThenArr, (item: Foo) => {
return bool;
}, {
concurrency: 1
});
fooArrProm = Promise.filter(fooThenArr, (item: Foo) => {
return boolThen;
}, {
concurrency: 1
});
fooArrProm = Promise.filter(fooThenArr, (item: Foo, index: number, arrayLength: number) => {
return bool;
}, {
concurrency: 1
});
fooArrProm = Promise.filter(fooThenArr, (item: Foo, index: number, arrayLength: number) => {
return boolThen;
}, {
concurrency: 1
});
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// fooArr
@@ -899,4 +1101,25 @@ fooArrProm = Promise.filter(fooArr, (item: Foo, index: number, arrayLength: numb
return boolThen;
});
fooArrProm = Promise.filter(fooArr, (item: Foo) => {
return bool;
}, {
concurrency: 1
});
fooArrProm = Promise.filter(fooArr, (item: Foo) => {
return boolThen;
}, {
concurrency: 1
});
fooArrProm = Promise.filter(fooArr, (item: Foo, index: number, arrayLength: number) => {
return bool;
}, {
concurrency: 1
});
fooArrProm = Promise.filter(fooArr, (item: Foo, index: number, arrayLength: number) => {
return boolThen;
}, {
concurrency: 1
});
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+41 -22
View File
@@ -115,7 +115,7 @@ declare class Promise<R> implements Promise.Thenable<R>, Promise.Inspection<R> {
* Register a node-style callback on this promise. When this promise is is either fulfilled or rejected, the node callback will be called back with the node.js convention where error reason is the first argument and success value is the second argument. The error argument will be `null` in case of success.
* Returns back this promise instead of creating a new one. If the `callback` argument is not a function, this method does not do anything.
*/
nodeify(callback: (err: any, value?: R) => void): Promise<R>;
nodeify(callback: (err: any, value?: R) => void, options?: Promise.SpreadOption): Promise<R>;
nodeify(...sink: any[]): void;
/**
@@ -311,8 +311,8 @@ declare class Promise<R> implements Promise.Thenable<R>, Promise.Inspection<R> {
* Same as calling `Promise.map(thisPromise, mapper)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too.
*/
// TODO type inference from array-resolving promise?
map<Q, U>(mapper: (item: Q, index: number, arrayLength: number) => Promise.Thenable<U>): Promise<U[]>;
map<Q, U>(mapper: (item: Q, index: number, arrayLength: number) => U): Promise<U[]>;
map<Q, U>(mapper: (item: Q, index: number, arrayLength: number) => Promise.Thenable<U>, options?: Promise.ConcurrencyOption): Promise<U[]>;
map<Q, U>(mapper: (item: Q, index: number, arrayLength: number) => U, options?: Promise.ConcurrencyOption): Promise<U[]>;
/**
* Same as calling `Promise.reduce(thisPromise, Function reducer, initialValue)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too.
@@ -325,8 +325,8 @@ declare class Promise<R> implements Promise.Thenable<R>, Promise.Inspection<R> {
* Same as calling ``Promise.filter(thisPromise, filterer)``. With the exception that if this promise is bound to a value, the returned promise is bound to that value too.
*/
// TODO type inference from array-resolving promise?
filter<U>(filterer: (item: U, index: number, arrayLength: number) => Promise.Thenable<boolean>): Promise<U[]>;
filter<U>(filterer: (item: U, index: number, arrayLength: number) => boolean): Promise<U[]>;
filter<U>(filterer: (item: U, index: number, arrayLength: number) => Promise.Thenable<boolean>, options?: Promise.ConcurrencyOption): Promise<U[]>;
filter<U>(filterer: (item: U, index: number, arrayLength: number) => boolean, options?: Promise.ConcurrencyOption): Promise<U[]>;
/**
* Start the chain of promises with `Promise.try`. Any synchronous exceptions will be turned into rejections on the returned promise.
@@ -415,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, options?: Object): Object;
static promisifyAll(target: Object, options?: Promise.PromisifyAllOptions): 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.
@@ -541,20 +547,20 @@ declare class Promise<R> implements Promise.Thenable<R>, Promise.Inspection<R> {
* *The original array is not modified.*
*/
// promise of array with promises of value
static map<R, U>(values: Promise.Thenable<Promise.Thenable<R>[]>, mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable<U>): Promise<U[]>;
static map<R, U>(values: Promise.Thenable<Promise.Thenable<R>[]>, mapper: (item: R, index: number, arrayLength: number) => U): Promise<U[]>;
static map<R, U>(values: Promise.Thenable<Promise.Thenable<R>[]>, mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable<U>, options?: Promise.ConcurrencyOption): Promise<U[]>;
static map<R, U>(values: Promise.Thenable<Promise.Thenable<R>[]>, mapper: (item: R, index: number, arrayLength: number) => U, options?: Promise.ConcurrencyOption): Promise<U[]>;
// promise of array with values
static map<R, U>(values: Promise.Thenable<R[]>, mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable<U>): Promise<U[]>;
static map<R, U>(values: Promise.Thenable<R[]>, mapper: (item: R, index: number, arrayLength: number) => U): Promise<U[]>;
static map<R, U>(values: Promise.Thenable<R[]>, mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable<U>, options?: Promise.ConcurrencyOption): Promise<U[]>;
static map<R, U>(values: Promise.Thenable<R[]>, mapper: (item: R, index: number, arrayLength: number) => U, options?: Promise.ConcurrencyOption): Promise<U[]>;
// array with promises of value
static map<R, U>(values: Promise.Thenable<R>[], mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable<U>): Promise<U[]>;
static map<R, U>(values: Promise.Thenable<R>[], mapper: (item: R, index: number, arrayLength: number) => U): Promise<U[]>;
static map<R, U>(values: Promise.Thenable<R>[], mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable<U>, options?: Promise.ConcurrencyOption): Promise<U[]>;
static map<R, U>(values: Promise.Thenable<R>[], mapper: (item: R, index: number, arrayLength: number) => U, options?: Promise.ConcurrencyOption): Promise<U[]>;
// array with values
static map<R, U>(values: R[], mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable<U>): Promise<U[]>;
static map<R, U>(values: R[], mapper: (item: R, index: number, arrayLength: number) => U): Promise<U[]>;
static map<R, U>(values: R[], mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable<U>, options?: Promise.ConcurrencyOption): Promise<U[]>;
static map<R, U>(values: R[], mapper: (item: R, index: number, arrayLength: number) => U, options?: Promise.ConcurrencyOption): Promise<U[]>;
/**
* Reduce an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `reducer` function with the signature `(total, current, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. If any promise in the input array is rejected the returned promise is rejected as well.
@@ -587,20 +593,20 @@ declare class Promise<R> implements Promise.Thenable<R>, Promise.Inspection<R> {
* *The original array is not modified.
*/
// promise of array with promises of value
static filter<R>(values: Promise.Thenable<Promise.Thenable<R>[]>, filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable<boolean>): Promise<R[]>;
static filter<R>(values: Promise.Thenable<Promise.Thenable<R>[]>, filterer: (item: R, index: number, arrayLength: number) => boolean): Promise<R[]>;
static filter<R>(values: Promise.Thenable<Promise.Thenable<R>[]>, filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable<boolean>, option?: Promise.ConcurrencyOption): Promise<R[]>;
static filter<R>(values: Promise.Thenable<Promise.Thenable<R>[]>, filterer: (item: R, index: number, arrayLength: number) => boolean, option?: Promise.ConcurrencyOption): Promise<R[]>;
// promise of array with values
static filter<R>(values: Promise.Thenable<R[]>, filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable<boolean>): Promise<R[]>;
static filter<R>(values: Promise.Thenable<R[]>, filterer: (item: R, index: number, arrayLength: number) => boolean): Promise<R[]>;
static filter<R>(values: Promise.Thenable<R[]>, filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable<boolean>, option?: Promise.ConcurrencyOption): Promise<R[]>;
static filter<R>(values: Promise.Thenable<R[]>, filterer: (item: R, index: number, arrayLength: number) => boolean, option?: Promise.ConcurrencyOption): Promise<R[]>;
// array with promises of value
static filter<R>(values: Promise.Thenable<R>[], filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable<boolean>): Promise<R[]>;
static filter<R>(values: Promise.Thenable<R>[], filterer: (item: R, index: number, arrayLength: number) => boolean): Promise<R[]>;
static filter<R>(values: Promise.Thenable<R>[], filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable<boolean>, option?: Promise.ConcurrencyOption): Promise<R[]>;
static filter<R>(values: Promise.Thenable<R>[], filterer: (item: R, index: number, arrayLength: number) => boolean, option?: Promise.ConcurrencyOption): Promise<R[]>;
// array with values
static filter<R>(values: R[], filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable<boolean>): Promise<R[]>;
static filter<R>(values: R[], filterer: (item: R, index: number, arrayLength: number) => boolean): Promise<R[]>;
static filter<R>(values: R[], filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable<boolean>, option?: Promise.ConcurrencyOption): Promise<R[]>;
static filter<R>(values: R[], filterer: (item: R, index: number, arrayLength: number) => boolean, option?: Promise.ConcurrencyOption): Promise<R[]>;
}
declare module Promise {
@@ -617,6 +623,19 @@ declare module Promise {
export interface OperationalError extends Error {
}
export interface ConcurrencyOption {
concurrency: number;
}
export interface SpreadOption {
spread: boolean;
}
export interface PromisifyAllOptions {
suffix?: string;
filter?: (name: string, func: Function, target?: any, passesDefaultFilter?: boolean) => boolean;
// The promisifier gets a reference to the original method and should return a function which returns a promise
promisifier?: (originalMethod: Function) => () => Thenable<any> ;
}
// Ideally, we'd define e.g. "export class RangeError extends Error {}",
// but as Error is defined as an interface (not a class), TypeScript doesn't
// allow extending Error, only implementing it.
+7
View File
@@ -137,6 +137,13 @@ interface JQueryEventObject {
value: number|ChangeValue;
}
interface SliderStatics {
new (selector: string, opts: SliderOptions): Slider;
prototype: Slider;
}
declare var Slider: SliderStatics;
/**
* This class is actually not used when using the jQuery version of bootstrap-slider
* The method documentation is still here thouh.
+17 -10
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
@@ -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 {
+9
View File
@@ -0,0 +1,9 @@
/// <reference path="./bowser.d.ts" />
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|number;
osversion: string|number;
}
export interface IBowser extends IBowserUA {
test(browserList: string[]): boolean;
_detect(ua: string): IBowser;
}
}
+13 -7
View File
@@ -11,7 +11,7 @@ function test_dataType() {
var x = typ.parentEnum === <breeze.core.IEnum> breeze.DataType;
var isFalse = breeze.DataType.contains(breeze.DataType.Double);
var dt = breeze.DataType.fromName("Decimal");
}
function test_dataProperty() {
@@ -33,7 +33,7 @@ function test_dataService() {
var em = new breeze.EntityManager({
dataService: ds
});
}
function test_entityAspect() {
@@ -69,7 +69,7 @@ function test_entityAspect() {
var errorsAdded = validationChangeArgs.added;
var errorsCleared = validationChangeArgs.removed;
});
}
function test_entityKey() {
@@ -132,7 +132,7 @@ function test_entityManager() {
serviceName: "breeze/NorthwindIBModel",
metadataStore: metadataStore
});
return new breeze.QueryOptions({
mergeStrategy: null,
fetchStrategy: this.fetchStrategy
@@ -157,7 +157,7 @@ function test_entityManager() {
var cust2 = em1.createEntity("Customer", { companyName: "foo" });
var cust3 = em1.createEntity("foo", { xxx: 3 }, breeze.EntityState.Added);
em1.attachEntity(cust1, breeze.EntityState.Added);
em1.clear();
var em2 = em1.createEmptyCopy();
@@ -246,7 +246,7 @@ function test_entityManager() {
var custType = <breeze.EntityType> em1.metadataStore.getEntityType("Customer");
var orderType = <breeze.EntityType> em1.metadataStore.getEntityType("Order");
if (em1.hasChanges([custType, orderType])) { };
var bundle = em1.exportEntities();
window.localStorage.setItem("myEntityManager", bundle);
var bundleFromStorage = window.localStorage.getItem("myEntityManager");
@@ -434,7 +434,7 @@ function test_entityState() {
return es === breeze.EntityState.Unchanged;
var es = anEntity.entityAspect.entityState;
return es.isUnchangedOrModified();
return es === breeze.EntityState.Unchanged || es === breeze.EntityState.Modified;
}
@@ -443,12 +443,14 @@ function test_entityType() {
var myEntityType: breeze.EntityType;
var dataProperty1: breeze.DataProperty, dataProperty2: breeze.DataProperty, navigationProperty1: breeze.DataProperty;
var em1: breeze.EntityManager;
/* NOTE https://github.com/borisyankov/DefinitelyTyped/pull/5590
var entityManager = new breeze.EntityType({
metadataStore: myMetadataStore,
serviceName: "breeze/NorthwindIBModel",
name: "person",
namespace: "myAppNamespace"
});
*/
myEntityType.addProperty(dataProperty1);
myEntityType.addProperty(dataProperty2);
myEntityType.addProperty(navigationProperty1);
@@ -759,9 +761,11 @@ function test_validator() {
orderType = <breeze.EntityType> em1.metadataStore.getEntityType("Order");
var orderDateProperty = orderType.getProperty("OrderDate");
orderDateProperty.validators.push(breeze.Validator.date());
/* NOTE https://github.com/borisyankov/DefinitelyTyped/pull/5590
var v0 = breeze.Validator.maxLength({ maxLength: 5, displayName: "City" });
v0.validate("adasdfasdf");
var errMessage = v0.getMessage();
*/
custType = <breeze.EntityType> em1.metadataStore.getEntityType("Customer");
var customerIdProperty = custType.getProperty("CustomerID");
customerIdProperty.validators.push(breeze.Validator.guid());
@@ -788,6 +792,7 @@ function test_validator() {
regionProperty.validators.push(breeze.Validator.string());
custType = <breeze.EntityType> em1.metadataStore.getEntityType("Customer");
regionProperty = custType.getProperty("Region");
/* NOTE https://github.com/borisyankov/DefinitelyTyped/pull/5590
regionProperty.validators.push(breeze.Validator.stringLength({ minLength: 2, maxLength: 5 }));
var validator = breeze.Validator.maxLength({ maxLength: 5, displayName: "City" });
var result = validator.validate("asdf");
@@ -796,6 +801,7 @@ function test_validator() {
var errMsg = result.errorMessage;
var context = result.context;
var sameValidator = result.validator;
*/
var valFn = function (v: any) {
if (v == null) return true;
return (v.substr(0,2) === "US");
+1
View File
@@ -459,6 +459,7 @@ declare module breeze {
interface EntityManagerProperties {
serviceName?: string;
dataService?: DataService;
metadataStore?: MetadataStore;
queryOptions?: QueryOptions;
saveOptions?: SaveOptions;
validationOptions?: ValidationOptions;
+4 -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
@@ -40,7 +40,9 @@ var options:bunyan.LoggerOptions = {
type: 'rotating-file',
path: '/tmp/test2.log',
level: bunyan.INFO,
closeOnExit: false
closeOnExit: false,
period: '1d',
count: 3
}, {
type: 'raw',
stream: process.stderr,
+7 -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,8 +63,10 @@ declare module "bunyan" {
type?: string;
level?: number | string;
path?: string;
stream?: WritableStream | Stream;
stream?: NodeJS.WritableStream | Stream;
closeOnExit?: boolean;
period?: string;
count?: number;
}
export var stdSerializers:Serializers;
+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>;
}
}
+308
View File
@@ -0,0 +1,308 @@
// Type definitions for chai 2.0.0
// Project: http://chaijs.com/
// Definitions by: Jed Mao <https://github.com/jedmao/>,
// Bart van der Schoor <https://github.com/Bartvds>,
// Andrew Brown <https://github.com/AGBrown>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module Chai {
interface ChaiStatic {
expect: ExpectStatic;
should(): Should;
/**
* Provides a way to extend the internals of Chai
*/
use(fn: (chai: any, utils: any) => void): any;
assert: AssertStatic;
config: Config;
}
export interface ExpectStatic extends AssertionStatic {
}
export interface AssertStatic extends Assert {
}
export interface AssertionStatic {
(target: any, message?: string): Assertion;
}
interface ShouldAssertion {
equal(value1: any, value2: any, message?: string): void;
Throw: ShouldThrow;
throw: ShouldThrow;
exist(value: any, message?: string): void;
}
interface Should extends ShouldAssertion {
not: ShouldAssertion;
fail(actual: any, expected: any, message?: string, operator?: string): void;
}
interface ShouldThrow {
(actual: Function): void;
(actual: Function, expected: string|RegExp, message?: string): void;
(actual: Function, constructor: Error|Function, expected?: string|RegExp, message?: string): void;
}
interface Assertion extends LanguageChains, NumericComparison, TypeComparison {
not: Assertion;
deep: Deep;
a: TypeComparison;
an: TypeComparison;
include: Include;
contain: Include;
ok: Assertion;
true: Assertion;
false: Assertion;
null: Assertion;
undefined: Assertion;
exist: Assertion;
empty: Assertion;
arguments: Assertion;
Arguments: Assertion;
equal: Equal;
equals: Equal;
eq: Equal;
eql: Equal;
eqls: Equal;
property: Property;
ownProperty: OwnProperty;
haveOwnProperty: OwnProperty;
length: Length;
lengthOf: Length;
match(regexp: RegExp|string, message?: string): Assertion;
string(string: string, message?: string): Assertion;
keys: Keys;
key(string: string): Assertion;
throw: Throw;
throws: Throw;
Throw: Throw;
respondTo(method: string, message?: string): Assertion;
itself: Assertion;
satisfy(matcher: Function, message?: string): Assertion;
closeTo(expected: number, delta: number, message?: string): Assertion;
members: Members;
}
interface LanguageChains {
to: Assertion;
be: Assertion;
been: Assertion;
is: Assertion;
that: Assertion;
which: Assertion;
and: Assertion;
has: Assertion;
have: Assertion;
with: Assertion;
at: Assertion;
of: Assertion;
same: Assertion;
}
interface NumericComparison {
above: NumberComparer;
gt: NumberComparer;
greaterThan: NumberComparer;
least: NumberComparer;
gte: NumberComparer;
below: NumberComparer;
lt: NumberComparer;
lessThan: NumberComparer;
most: NumberComparer;
lte: NumberComparer;
within(start: number, finish: number, message?: string): Assertion;
}
interface NumberComparer {
(value: number, message?: string): Assertion;
}
interface TypeComparison {
(type: string, message?: string): Assertion;
instanceof: InstanceOf;
instanceOf: InstanceOf;
}
interface InstanceOf {
(constructor: Object, message?: string): Assertion;
}
interface Deep {
equal: Equal;
include: Include;
property: Property;
}
interface Equal {
(value: any, message?: string): Assertion;
}
interface Property {
(name: string, value?: any, message?: string): Assertion;
}
interface OwnProperty {
(name: string, message?: string): Assertion;
}
interface Length extends LanguageChains, NumericComparison {
(length: number, message?: string): Assertion;
}
interface Include {
(value: Object, message?: string): Assertion;
(value: string, message?: string): Assertion;
(value: number, message?: string): Assertion;
keys: Keys;
members: Members;
}
interface Keys {
(...keys: string[]): Assertion;
(keys: any[]): Assertion;
}
interface Throw {
(): Assertion;
(expected: string, message?: string): Assertion;
(expected: RegExp, message?: string): Assertion;
(constructor: Error, expected?: string, message?: string): Assertion;
(constructor: Error, expected?: RegExp, message?: string): Assertion;
(constructor: Function, expected?: string, message?: string): Assertion;
(constructor: Function, expected?: RegExp, message?: string): Assertion;
}
interface Members {
(set: any[], message?: string): Assertion;
}
export interface Assert {
/**
* @param expression Expression to test for truthiness.
* @param message Message to display on error.
*/
(expression: any, message?: string): void;
fail(actual?: any, expected?: any, msg?: string, operator?: string): void;
ok(val: any, msg?: string): void;
notOk(val: any, msg?: string): void;
equal(act: any, exp: any, msg?: string): void;
notEqual(act: any, exp: any, msg?: string): void;
strictEqual(act: any, exp: any, msg?: string): void;
notStrictEqual(act: any, exp: any, msg?: string): void;
deepEqual(act: any, exp: any, msg?: string): void;
notDeepEqual(act: any, exp: any, msg?: string): void;
isTrue(val: any, msg?: string): void;
isFalse(val: any, msg?: string): void;
isNull(val: any, msg?: string): void;
isNotNull(val: any, msg?: string): void;
isUndefined(val: any, msg?: string): void;
isDefined(val: any, msg?: string): void;
isFunction(val: any, msg?: string): void;
isNotFunction(val: any, msg?: string): void;
isObject(val: any, msg?: string): void;
isNotObject(val: any, msg?: string): void;
isArray(val: any, msg?: string): void;
isNotArray(val: any, msg?: string): void;
isString(val: any, msg?: string): void;
isNotString(val: any, msg?: string): void;
isNumber(val: any, msg?: string): void;
isNotNumber(val: any, msg?: string): void;
isBoolean(val: any, msg?: string): void;
isNotBoolean(val: any, msg?: string): void;
typeOf(val: any, type: string, msg?: string): void;
notTypeOf(val: any, type: string, msg?: string): void;
instanceOf(val: any, type: Function, msg?: string): void;
notInstanceOf(val: any, type: Function, msg?: string): void;
include(exp: string, inc: any, msg?: string): void;
include(exp: any[], inc: any, msg?: string): void;
notInclude(exp: string, inc: any, msg?: string): void;
notInclude(exp: any[], inc: any, msg?: string): void;
match(exp: any, re: RegExp, msg?: string): void;
notMatch(exp: any, re: RegExp, msg?: string): void;
property(obj: Object, prop: string, msg?: string): void;
notProperty(obj: Object, prop: string, msg?: string): void;
deepProperty(obj: Object, prop: string, msg?: string): void;
notDeepProperty(obj: Object, prop: string, msg?: string): void;
propertyVal(obj: Object, prop: string, val: any, msg?: string): void;
propertyNotVal(obj: Object, prop: string, val: any, msg?: string): void;
deepPropertyVal(obj: Object, prop: string, val: any, msg?: string): void;
deepPropertyNotVal(obj: Object, prop: string, val: any, msg?: string): void;
lengthOf(exp: any, len: number, msg?: string): void;
//alias frenzy
throw(fn: Function, msg?: string): void;
throw(fn: Function, regExp: RegExp): void;
throw(fn: Function, errType: Function, msg?: string): void;
throw(fn: Function, errType: Function, regExp: RegExp): void;
throws(fn: Function, msg?: string): void;
throws(fn: Function, regExp: RegExp): void;
throws(fn: Function, errType: Function, msg?: string): void;
throws(fn: Function, errType: Function, regExp: RegExp): void;
Throw(fn: Function, msg?: string): void;
Throw(fn: Function, regExp: RegExp): void;
Throw(fn: Function, errType: Function, msg?: string): void;
Throw(fn: Function, errType: Function, regExp: RegExp): void;
doesNotThrow(fn: Function, msg?: string): void;
doesNotThrow(fn: Function, regExp: RegExp): void;
doesNotThrow(fn: Function, errType: Function, msg?: string): void;
doesNotThrow(fn: Function, errType: Function, regExp: RegExp): void;
operator(val: any, operator: string, val2: any, msg?: string): void;
closeTo(act: number, exp: number, delta: number, msg?: string): void;
sameMembers(set1: any[], set2: any[], msg?: string): void;
includeMembers(set1: any[], set2: any[], msg?: string): void;
ifError(val: any, msg?: string): void;
}
export interface Config {
includeStack: boolean;
}
export class AssertionError {
constructor(message: string, _props?: any, ssf?: Function);
name: string;
message: string;
showDiff: boolean;
stack: string;
}
}
declare var chai: Chai.ChaiStatic;
declare module "chai" {
export = chai;
}
interface Object {
should: Chai.Assertion;
}
+248 -42
View File
@@ -31,6 +31,16 @@ function fail() {
err(() => {
should.fail('foo', 'bar', 'should fail', 'equal');
}, 'expected fail to throw an AssertionError');
err(() => {
expect.fail('foo', 'bar');
}, 'expected fail to throw an AssertionError');
err(() => {
expect.fail('foo', 'bar', 'should fail');
}, 'expected fail to throw an AssertionError');
err(() => {
expect.fail('foo', 'bar', 'should fail', 'equal');
}, 'expected fail to throw an AssertionError');
}
// ReSharper disable once InconsistentNaming
@@ -107,11 +117,20 @@ function _undefined() {
}, 'expected \'\' to be undefined');
}
function _NaN() {
expect(NaN).to.be.NaN;
expect(12).to.be.not.NaN;
expect("NaN").to.be.not.NaN;
(NaN).should.be.NaN;
(12).should.be.not.NaN;
("NaN").should.be.not.NaN;
}
function exist() {
var foo = 'bar';
expect(foo).to.exist;
should.exist(foo);
expect(void(0)).to.not.exist;
expect(void (0)).to.not.exist;
should.not.exist(void (0));
}
@@ -128,8 +147,8 @@ function argumentsTest() {
}
function equal() {
expect(undefined).to.equal(void(0));
should.equal(undefined, void(0));
expect(undefined).to.equal(void (0));
should.equal(undefined, void (0));
}
function _typeof() {
@@ -372,6 +391,9 @@ function match() {
expect('foobar').to.not.match(/^bar/);
'foobar'.should.not.match(/^bar/);
expect('foobar').matches(/^foo/);
'foobar'.should.not.matches(/^bar/);
err(() => {
expect('foobar').to.match(/^bar/i, 'blah');
'foobar'.should.match(/^bar/i, 'blah');
@@ -490,8 +512,8 @@ function deepEqual3() {
function deepInclude() {
expect(['foo', 'bar']).to.deep.include(['bar', 'foo']);
['foo', 'bar'].should.deep.include(['bar', 'foo']);
expect(['foo', 'bar']).not.to.deep.equal(['foo', 'baz' ]);
['foo', 'bar'].should.not.deep.equal(['foo', 'baz' ]);
expect(['foo', 'bar']).not.to.deep.equal(['foo', 'baz']);
['foo', 'bar'].should.not.deep.equal(['foo', 'baz']);
}
class FakeArgs {
@@ -670,6 +692,20 @@ function ownProperty() {
}, 'blah: expected { length: 12 } to not have own property \'length\'');
}
function ownPropertyDescriptor() {
expect('test').to.have.ownPropertyDescriptor('length');
expect('test').to.have.ownPropertyDescriptor('length', { enumerable: false, configurable: false, writable: false, value: 4 });
expect('test').not.to.have.ownPropertyDescriptor('length', { enumerable: false, configurable: false, writable: false, value: 3 });
expect('test').to.haveOwnPropertyDescriptor('length').to.have.property('enumerable', false);
expect('test').to.haveOwnPropertyDescriptor('length').to.contain.keys('value');
'test'.should.have.ownPropertyDescriptor('length');
'test'.should.have.ownPropertyDescriptor('length', { enumerable: false, configurable: false, writable: false, value: 4 });
'test'.should.not.have.ownPropertyDescriptor('length', { enumerable: false, configurable: false, writable: false, value: 3 });
'test'.should.haveOwnPropertyDescriptor('length').to.have.property('enumerable', false);
'test'.should.haveOwnPropertyDescriptor('length').to.contain.keys('value');
}
function string() {
expect('foobar').to.have.string('bar');
'foobar'.should.have.string('bar');
@@ -707,6 +743,10 @@ function include() {
['foo', 'bar'].should.not.include('baz');
expect(['foo', 'bar']).to.not.include(1);
['foo', 'bar'].should.not.include(1);
// alias
expect(['foo', 'bar']).includes('foo');
['foo', 'bar'].should.includes('foo');
err(() => {
expect(['foo']).to.include('bar', 'blah');
@@ -732,6 +772,14 @@ function keys() {
({ foo: 1, bar: 2, baz: 3 }).should.contain.keys('bar', 'foo');
expect({ foo: 1, bar: 2, baz: 3 }).to.contain.keys('baz');
({ foo: 1, bar: 2, baz: 3 }).should.contain.keys('baz');
// alias
expect({ foo: 1, bar: 2, baz: 3 }).contains.keys('baz');
expect({ foo: 1, bar: 2 }).to.have.all.keys(['foo', 'bar']);
expect({ foo: 1, bar: 2 }).to.have.any.keys(['foo', 'bar']);
({ foo: 1, bar: 2, baz: 3 }).should.contain.all.keys('baz');
({ foo: 1, bar: 2, baz: 3 }).should.contain.any.keys('baz');
expect({ foo: 1, bar: 2 }).to.contain.keys('foo');
({ foo: 1, bar: 2 }).should.contain.keys('foo');
@@ -830,7 +878,28 @@ function chaining() {
tea.should.be.a('object').and.have.property('name', 'chai');
}
class PoorlyConstructedError {}
function exxtensible() {
expect({}).to.be.extensible;
expect(Object.preventExtensions({})).to.be.not.extensible;
({}).should.be.extensible;
Object.preventExtensions({}).should.not.be.extensible;
}
function sealed() {
expect({}).to.be.not.sealed;
expect(Object.seal({})).to.be.sealed;
({}).should.be.not.sealed;
Object.seal({}).should.be.sealed;
}
function frozen() {
expect({}).to.be.not.frozen;
expect(Object.freeze({})).to.be.frozen;
({}).should.be.not.frozen;
Object.freeze({}).should.be.frozen;
}
class PoorlyConstructedError { }
function _throw() {
// See GH-45: some poorly-constructed custom errors don't have useful names
// on either their constructor or their constructor prototype, but instead
@@ -1023,34 +1092,44 @@ function _throw() {
}, 'blah: expected [Function] to throw error including \'hello\' but got \'testing\'');
}
function use(){
function use() {
// ReSharper disable once InconsistentNaming
chai.use((_chai) => {
_chai.can.use.any();
_chai.can.use.any();
});
}
class Klass {
val: number;
constructor() { this.val = 0; }
bar() { }
static baz() { }
}
function respondTo() {
var bar = {};
var obj = new Klass();
expect(Foo).to.respondTo('bar');
Foo.should.respondTo('bar');
expect(Foo).to.not.respondTo('foo');
Foo.should.not.respondTo('foo');
expect(Foo).itself.to.respondTo('func');
expect(Foo).itself.not.to.respondTo('bar');
expect(Klass).to.respondTo('bar');
expect(obj).respondsTo('bar');
Klass.should.respondTo('bar');
Klass.should.respondsTo('bar');
expect(Klass).to.not.respondTo('foo');
Klass.should.not.respondTo('foo');
expect(Klass).itself.to.respondTo('func');
expect(Klass).itself.not.to.respondTo('bar');
expect(bar).to.respondTo('foo');
bar.should.respondTo('foo');
expect(obj).not.to.respondTo('foo');
obj.should.not.respondTo('foo');
err(() => {
expect(Foo).to.respondTo('baz', 'constructor');
Foo.should.respondTo('baz', 'constructor');
}, /^(constructor: expected)(.*)(\[Function: Foo\])(.*)(to respond to \'baz\')$/);
expect(Klass).to.respondTo('baz', 'constructor');
Klass.should.respondTo('baz', 'constructor');
}, /^(constructor: expected)(.*)(\[Function: Klass\])(.*)(to respond to \'baz\')$/);
err(() => {
expect(bar).to.respondTo('baz', 'object');
bar.should.respondTo('baz', 'object');
expect(obj).to.respondTo('baz', 'object');
obj.should.respondTo('baz', 'object');
}, /^(object: expected)(.*)(\{ foo: \[Function\] \}|\{ Object \()(.*)(to respond to \'baz\')$/);
}
@@ -1116,6 +1195,23 @@ function sameMembers() {
[5, 4].should.not.have.same.members([6, 3]);
expect([5, 4]).to.not.have.same.members([5, 4, 2]);
[5, 4].should.not.have.same.members([5, 4, 2]);
assert.sameMembers([5, 4], [4, 5]);
}
function sameDeepMembers() {
expect([{ id: 5 }, { id: 4 }]).to.have.same.deep.members([{ id: 4 }, { id: 5 }]);
[{ id: 5 }, { id: 4 }].should.have.same.deep.members([{ id: 4 }, { id: 5 }]);
expect([{ id: 5 }, { id: 4 }]).to.have.same.members([{ id: 5 }, { id: 4 }]);
[{ id: 5 }, { id: 4 }].should.have.same.members([{ id: 5 }, { id: 4 }]);
expect([{ id: 5 }, { id: 4 }]).to.not.have.same.members([]);
[{ id: 5 }, { id: 4 }].should.not.have.same.members([]);
expect([{ id: 5 }, { id: 4 }]).to.not.have.same.members([{ id: 6 }, { id: 3 }]);
[{ id: 5 }, { id: 4 }].should.not.have.same.members([{ id: 6 }, { id: 3 }]);
expect([{ id: 5 }, { id: 4 }]).to.not.have.same.members([{ id: 5 }, { id: 4 }, { id: 2 }]);
[{ id: 5 }, { id: 4 }].should.not.have.same.members([{ id: 5 }, { id: 4 }, { id: 2 }]);
assert.sameDeepMembers([{ id: 5 }, { id: 4 }], [{ id: 4 }, { id: 5 }]);
}
function members() {
@@ -1127,16 +1223,48 @@ function members() {
expect([5, 4]).not.members([5, 4, 2]);
}
function increaseDecreaseChange() {
var obj = { val: 10 };
var inc = () => { obj.val++; };
var dec = () => { obj.val--; };
var same = () => { };
expect(inc).to.increase(obj, "val");
expect(inc).increases(obj, "val");
expect(inc).to.change(obj, "val");
expect(dec).to.decrease(obj, "val");
expect(dec).decreases(obj, "val");
expect(dec).to.change(obj, "val");
expect(dec).changes(obj, "val");
expect(inc).to.not.decrease(obj, "val");
expect(dec).to.not.increase(obj, "val");
expect(same).to.not.increase(obj, "val");
expect(same).to.not.decrease(obj, "val");
expect(same).to.not.change(obj, "val");
inc.should.increase(obj, "val");
inc.should.change(obj, "val");
dec.should.decrease(obj, "val");
dec.should.change(obj, "val");
inc.should.not.decrease(obj, "val");
dec.should.not.increase(obj, "val");
same.should.not.change(obj, "val");
}
//tdd
declare function suite(description: string, action: Function):void;
declare function test(description: string, action: Function):void;
declare function suite(description: string, action: Function): void;
declare function test(description: string, action: Function): void;
interface FieldObj {
field: any;
}
class CrashyObject {
inspect (): void {
inspect(): void {
throw new Error('Arg\'s inspect() called even though the test passed');
}
}
@@ -1172,6 +1300,9 @@ suite('assert', () => {
assert.ok(true);
assert.ok(1);
assert.ok('test');
assert.isOk(true);
assert.isOk(1);
assert.isOk('test');
err(() => {
assert.ok(false);
@@ -1186,6 +1317,27 @@ suite('assert', () => {
}, 'expected \'\' to be truthy');
});
test('notOk', () => {
assert.notOk(false);
assert.notOk(0);
assert.notOk('');
assert.isNotOk(false);
assert.isNotOk(0);
assert.isNotOk('');
err(() => {
assert.notOk(true);
}, 'expected true to be falsy');
err(() => {
assert.notOk(1);
}, 'expected 1 to be falsy');
err(() => {
assert.notOk('test');
}, 'expected \'test\' to be falsy');
});
test('isFalse', () => {
assert.isFalse(false);
@@ -1199,7 +1351,7 @@ suite('assert', () => {
});
test('equal', () => {
assert.equal(void(0), undefined);
assert.equal(void (0), undefined);
});
test('typeof / notTypeOf', () => {
@@ -1288,19 +1440,19 @@ suite('assert', () => {
});
test('deepEqual', () => {
assert.deepEqual({tea: 'chai'}, {tea: 'chai'});
assert.deepEqual({ tea: 'chai' }, { tea: 'chai' });
err(() => {
assert.deepEqual({tea: 'chai'}, {tea: 'black'});
assert.deepEqual({ tea: 'chai' }, { tea: 'black' });
}, 'expected { tea: \'chai\' } to deeply equal { tea: \'black\' }');
var obja = Object.create({ tea: 'chai' })
, objb = Object.create({ tea: 'chai' });
, objb = Object.create({ tea: 'chai' });
assert.deepEqual(obja, objb);
var obj1 = Object.create({tea: 'chai'})
, obj2 = Object.create({tea: 'black'});
var obj1 = Object.create({ tea: 'chai' })
, obj2 = Object.create({ tea: 'black' });
err(() => {
assert.deepEqual(obj1, obj2);
@@ -1309,13 +1461,13 @@ suite('assert', () => {
test('deepEqual (ordering)', () => {
var a = { a: 'b', c: 'd' }
, b = { c: 'd', a: 'b' };
, b = { c: 'd', a: 'b' };
assert.deepEqual(a, b);
});
test('deepEqual (circular)', () => {
var circularObject:any = {}
, secondCircularObject:any = {};
var circularObject: any = {}
, secondCircularObject: any = {};
circularObject.field = circularObject;
secondCircularObject.field = secondCircularObject;
@@ -1328,15 +1480,15 @@ suite('assert', () => {
});
test('notDeepEqual', () => {
assert.notDeepEqual({tea: 'jasmine'}, {tea: 'chai'});
assert.notDeepEqual({ tea: 'jasmine' }, { tea: 'chai' });
err(() => {
assert.notDeepEqual({tea: 'chai'}, {tea: 'chai'});
assert.notDeepEqual({ tea: 'chai' }, { tea: 'chai' });
}, 'expected { tea: \'chai\' } to not deeply equal { tea: \'chai\' }');
});
test('notDeepEqual (circular)', () => {
var circularObject:any = {}
, secondCircularObject:any = { tea: 'jasmine' };
var circularObject: any = {}
, secondCircularObject: any = { tea: 'jasmine' };
circularObject.field = circularObject;
secondCircularObject.field = secondCircularObject;
@@ -1380,6 +1532,22 @@ suite('assert', () => {
}, 'expected undefined to not equal undefined');
});
test('isNaN', () => {
assert.isNaN(NaN);
err(() => {
assert.isNaN(12);
}, 'expected 12 to be NaN');
});
test('isNotNaN', () => {
assert.isNotNaN(12);
err(() => {
assert.isNotNaN(NaN);
}, 'expected NaN to not NaN');
});
test('isFunction', () => {
var func = () => {
};
@@ -1431,7 +1599,7 @@ suite('assert', () => {
test('isNotString', () => {
assert.isNotString(3);
assert.isNotString([ 'hello' ]);
assert.isNotString(['hello']);
err(() => {
assert.isNotString('hello');
@@ -1449,7 +1617,7 @@ suite('assert', () => {
test('isNotNumber', () => {
assert.isNotNumber('hello');
assert.isNotNumber([ 5 ]);
assert.isNotNumber([5]);
err(() => {
assert.isNotNumber(4);
@@ -1479,7 +1647,7 @@ suite('assert', () => {
test('include', () => {
assert.include('foobar', 'bar');
assert.include([ 1, 2, 3], 3);
assert.include([1, 2, 3], 3);
err(() => {
assert.include('foobar', 'baz');
@@ -1492,7 +1660,7 @@ suite('assert', () => {
test('notInclude', () => {
assert.notInclude('foobar', 'baz');
assert.notInclude([ 1, 2, 3 ], 4);
assert.notInclude([1, 2, 3], 4);
err(() => {
assert.notInclude('foobar', 'bar');
@@ -1739,4 +1907,42 @@ suite('assert', () => {
}, 'expected [ 1, 54 ] to have the same members as [ 6, 1, 54 ]');
});
test('isAbove', () => {
assert.isAbove(10, 5);
err(() => {
assert.isAbove(1, 5);
}, 'expected 1 to be above 5');
err(() => {
assert.isAbove(5, 5);
}, 'expected 5 to be above 5');
});
test('isBelow', () => {
assert.isBelow(5, 10);
err(() => {
assert.isBelow(5, 1);
}, 'expected 5 to be above 1');
err(() => {
assert.isBelow(5, 5);
}, 'expected 5 to be below 5');
});
test('extensible', () => { assert.extensible({}); });
test('isExtensible', () => { assert.isExtensible({}); });
test('notExtensible', () => { assert.notExtensible(Object.preventExtensions({})); });
test('isNotExtensible', () => { assert.isNotExtensible(Object.preventExtensions({})); });
test('sealed', () => { assert.sealed(Object.seal({})); });
test('isSealed', () => { assert.isSealed(Object.seal({})); });
test('notSealed', () => { assert.notSealed({}); });
test('isNotSealed', () => { assert.isNotSealed({}); });
test('frozen', () => { assert.frozen(Object.freeze({})); });
test('isFrozen', () => { assert.isFrozen(Object.freeze({})); });
test('notFrozen', () => { assert.notFrozen({}); });
test('isNotFrozen', () => { assert.isNotFrozen({}); });
});
+87 -7
View File
@@ -1,10 +1,13 @@
// Type definitions for chai 2.0.0
// Type definitions for chai 3.2.0
// Project: http://chaijs.com/
// Definitions by: Jed Mao <https://github.com/jedmao/>,
// Bart van der Schoor <https://github.com/Bartvds>,
// Andrew Brown <https://github.com/AGBrown>
// Andrew Brown <https://github.com/AGBrown>,
// Olivier Chevet <https://github.com/olivr70>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// <reference path="../assertion-error/assertion-error.d.ts"/>
declare module Chai {
interface ChaiStatic {
@@ -16,9 +19,11 @@ declare module Chai {
use(fn: (chai: any, utils: any) => void): any;
assert: AssertStatic;
config: Config;
AssertionError: AssertionError;
}
export interface ExpectStatic extends AssertionStatic {
fail(actual?: any, expected?: any, message?: string, operator?: string): void;
}
export interface AssertStatic extends Assert {
@@ -49,15 +54,20 @@ declare module Chai {
interface Assertion extends LanguageChains, NumericComparison, TypeComparison {
not: Assertion;
deep: Deep;
any: KeyFilter;
all: KeyFilter;
a: TypeComparison;
an: TypeComparison;
include: Include;
includes: Include;
contain: Include;
contains: Include;
ok: Assertion;
true: Assertion;
false: Assertion;
null: Assertion;
undefined: Assertion;
NaN: Assertion;
exist: Assertion;
empty: Assertion;
arguments: Assertion;
@@ -70,20 +80,35 @@ declare module Chai {
property: Property;
ownProperty: OwnProperty;
haveOwnProperty: OwnProperty;
ownPropertyDescriptor: OwnPropertyDescriptor;
haveOwnPropertyDescriptor: OwnPropertyDescriptor;
length: Length;
lengthOf: Length;
match(regexp: RegExp|string, message?: string): Assertion;
match: Match;
matches: Match;
string(string: string, message?: string): Assertion;
keys: Keys;
key(string: string): Assertion;
throw: Throw;
throws: Throw;
Throw: Throw;
respondTo(method: string, message?: string): Assertion;
respondTo: RespondTo;
respondsTo: RespondTo;
itself: Assertion;
satisfy(matcher: Function, message?: string): Assertion;
satisfy: Satisfy;
satisfies: Satisfy;
closeTo(expected: number, delta: number, message?: string): Assertion;
members: Members;
increase: PropertyChange;
increases: PropertyChange;
decrease: PropertyChange;
decreases: PropertyChange;
change: PropertyChange;
changes: PropertyChange;
extensible: Assertion;
sealed: Assertion;
frozen: Assertion;
}
interface LanguageChains {
@@ -134,6 +159,11 @@ declare module Chai {
equal: Equal;
include: Include;
property: Property;
members: Members;
}
interface KeyFilter {
keys: Keys;
}
interface Equal {
@@ -148,6 +178,11 @@ declare module Chai {
(name: string, message?: string): Assertion;
}
interface OwnPropertyDescriptor {
(name: string, descriptor: PropertyDescriptor, message?: string): Assertion;
(name: string, message?: string): Assertion;
}
interface Length extends LanguageChains, NumericComparison {
(length: number, message?: string): Assertion;
}
@@ -158,11 +193,18 @@ declare module Chai {
(value: number, message?: string): Assertion;
keys: Keys;
members: Members;
any: KeyFilter;
all: KeyFilter;
}
interface Match {
(regexp: RegExp|string, message?: string): Assertion;
}
interface Keys {
(...keys: string[]): Assertion;
(keys: any[]): Assertion;
(keys: Object): Assertion;
}
interface Throw {
@@ -175,10 +217,22 @@ declare module Chai {
(constructor: Function, expected?: RegExp, message?: string): Assertion;
}
interface RespondTo {
(method: string, message?: string): Assertion;
}
interface Satisfy {
(matcher: Function, message?: string): Assertion;
}
interface Members {
(set: any[], message?: string): Assertion;
}
interface PropertyChange {
(object: Object, prop: string, msg?: string): Assertion;
}
export interface Assert {
/**
* @param expression Expression to test for truthiness.
@@ -189,7 +243,9 @@ declare module Chai {
fail(actual?: any, expected?: any, msg?: string, operator?: string): void;
ok(val: any, msg?: string): void;
isOk(val: any, msg?: string): void;
notOk(val: any, msg?: string): void;
isNotOk(val: any, msg?: string): void;
equal(act: any, exp: any, msg?: string): void;
notEqual(act: any, exp: any, msg?: string): void;
@@ -209,6 +265,12 @@ declare module Chai {
isUndefined(val: any, msg?: string): void;
isDefined(val: any, msg?: string): void;
isNaN(val: any, msg?: string): void;
isNotNaN(val: any, msg?: string): void;
isAbove(val: number, abv: number, msg?: string): void;
isBelow(val: number, blw: number, msg?: string): void;
isFunction(val: any, msg?: string): void;
isNotFunction(val: any, msg?: string): void;
@@ -279,9 +341,27 @@ declare module Chai {
closeTo(act: number, exp: number, delta: number, msg?: string): void;
sameMembers(set1: any[], set2: any[], msg?: string): void;
includeMembers(set1: any[], set2: any[], msg?: string): void;
sameDeepMembers(set1: any[], set2: any[], msg?: string): void;
includeMembers(superset: any[], subset: any[], msg?: string): void;
ifError(val: any, msg?: string): void;
isExtensible(obj: {}, msg?: string): void;
extensible(obj: {}, msg?: string): void;
isNotExtensible(obj: {}, msg?: string): void;
notExtensible(obj: {}, msg?: string): void;
isSealed(obj: {}, msg?: string): void;
sealed(obj: {}, msg?: string): void;
isNotSealed(obj: {}, msg?: string): void;
notSealed(obj: {}, msg?: string): void;
isFrozen(obj: Object, msg?: string): void;
frozen(obj: Object, msg?: string): void;
isNotFrozen(obj: Object, msg?: string): void;
notFrozen(obj: Object, msg?: string): void;
}
export interface Config {
@@ -305,4 +385,4 @@ declare module "chai" {
interface Object {
should: Chai.Assertion;
}
}
+281 -52
View File
@@ -1,65 +1,294 @@
/// <reference path="cheerio.d.ts" />
import cheerio = require("cheerio");
import * as cheerio from 'cheerio';
var $ = cheerio.load("<html></html>");
var $el = $('selector');
var $multiEl = $('seletor', 'selector', 'selector');
/*
* LOADING
*/
let html =
`<ul id="fruits">
<li class="orange">Apple</li>
<li class="class">Orange</li>
<li class="pear">Pear</li>
<input type="text" />
</ul>`;
$el.addClass("class").addClass("test");
$el.hasClass("test");
$el.removeClass("class").removeClass("test");
// Preferred Method
var $ = cheerio.load(html);
// Directly load element
cheerio(html);
cheerio('ul', html);
cheerio('li', 'ul', html);
$el.attr('class');
$el.attr('class', 'test');
$el.removeAttr("class").removeAttr("test");
$el.find("ul").find("> li");
$el.parent().parent();
$el.next().next();
$el.prev().prev();
$el.siblings().siblings();
$el.children().children();
$el.children("li").children("a");
$el.children().each((index, element) => {
return $(element).find('t');
$ = cheerio.load(html, {
normalizeWhitespace: true,
xmlMode: true
});
$el.children().map((index, element) => {
return $(element).find('t');
$ = cheerio.load(html, {
normalizeWhitespace: true,
xmlMode: true,
decodeEntities: true,
lowerCaseTags: true,
lowerCaseAttributeNames: true,
recognizeCDATA: true,
recognizeSelfClosing: true
});
$el.children().filter((index) => {
return $el.children().eq(index).find('t').length >= 0;
});
/**
* Selectors
*/
var $el = $('.class');
var $multiEl = $('selector', 'selector', 'selector');
$el.filter('span').filter('li');
/**
* Attributes
*/
$el.first().last().find('t');
$('div').eq(0).find('b');
$('#id').append("test html", "other html").find('a');
$('#id').prepend("test html", "other html").find('a');
$('#id').after("test html", "other html").find('a');
$('#id').before("test html", "other html").find('a');
$el.remove('div').remove('a');
$('#id').replaceWith('some html').parent();
$('#id').empty().parent();
$el.html();
$el.html("<html></html>").find('div');
$el.text();
$el.text('some text');
$el.toArray();
$el.clone().find('a').parent();
$.root().find('a');
// attr
$el.attr('id');
$el.attr('id', 'favorite').html();
// data
$el.data();
$el.data('apple-color');
$el.data('kind', 'mac');
// val
$('input[type="text"]').val();
$('input[type="text"]').val('test').html();
// removeAttr
$el.removeAttr('class').html();
// hasClass, addClass, removeClass, toggleClass
$el.addClass('class').addClass('test');
$el.hasClass('test');
$el.removeClass('class').removeClass('test');
$el.addClass('red').removeClass().html();
$el.toggleClass('fruit green red').html();
// is
$el.is('#id');
$el.is($el);
$el.is(() => {
return true;
});
/**
* Forms
*/
// serializeArray
$('<form><input name="foo" value="bar" /></form>').serializeArray();
/**
* Traversing
*/
// find
$el.find('li').length;
$el.find($('.apple')).length;
// .parent([selector])
$el.parent().attr('id');
$el.parent('.class').attr('id');
// .parents([selector])
$el.parents().length;
$el.parents('.class').length;
// .parentsUntil([selector][,filter])
$el.parentsUntil().length;
$el.parentsUntil('.class').length;
// .closest(selector)
$el.closest();
$el.closest('.class');
// .next([selector])
$el.next().hasClass('class');
$el.next('.class').hasClass('class');
// .nextAll([selector])
$el.nextAll().length;
$el.nextAll('.class').length;
// .nextUntil([selector], [filter])
$el.nextUntil();
$el.nextUntil('.class');
// .prev([selector])
$el.prev().hasClass('class');
$el.prev('.class').hasClass('class');
// .prevAll([selector])
$el.prevAll().length;
$el.prevAll('.class').length;
// .prevUntil([selector], [filter])
$el.prevUntil();
$el.prevUntil('.class');
// .slice( start, [end] )
$el.slice(1).eq(0).text();
$el.slice(1, 2).length;
// .siblings([selector])
$el.siblings().length;
$el.siblings('.class').length;
// .children([selector])
$el.children().length;
$el.children('.class').text();
// .contents()
$el.contents().length;
// .each( function(index, element) )
$el.each((i, el) => {
$(el).html();
});
// .map( function(index, element) )
$el.map((i, el) => {
return $(el).text();
}).get().join(' ');
// .filter
$ = cheerio.load(html);
$el.filter('.class').attr('class');
$el.filter($('.class')).attr('class');
$el.filter($('.class')[0]).attr('class');
$el.filter((i, el) => {
return $(el).attr('class') === 'class';
}).attr('class');
// .not
$el.not('.class').length;
$el.not($('.class')).length;
$el.not($('.class')[0]).length;
$el.not((i, el) => {
return $(el).attr('class') === 'class';
}).length;
// .has
$el.has('.class').attr('id');
$el.has($el[0]).attr('id');
// .first()
$el.children().first().text();
// .last()
$el.children().last().text();
// .eq( i )
$el.eq(0).text();
$el.eq(-1).text();
// .get( [i] )
$el.get(0).tagName;
$el.get().length;
// .index()
// .index( selector )
// .index( nodeOrSelection )
$el.index();
$el.index('li');
$el.index($('#fruit, li'));
// .end()
$el.eq(0).end().length;
// .add
$el.add('.class').length
// .addBack( [filter] )
$el.eq(0).addBack().length
$el.eq(0).addBack('.class').length
/**
* Manipulation
*/
// .append( content, [content, ...] )
$el.append('<li class="plum">Plum</li>').html();
$el.append('<li class="plum">Plum</li>', '<li class="plum">Plum</li>').html();
// .prepend( content, [content, ...] )
$el.prepend('<li class="plum">Plum</li>').html();
$el.prepend('<li class="plum">Plum</li>', '<li class="plum">Plum</li>').html();
// .after( content, [content, ...] )
$el.after('<li class="plum">Plum</li>').html();
$el.after('<li class="plum">Plum</li>', '<li class="plum">Plum</li>').html();
// .insertAfter( content )
$('<li class="plum">Plum</li>').insertAfter('.class').html();
// .before( content, [content, ...] )
$el.before('<li class="plum">Plum</li>').html();
$el.before('<li class="plum">Plum</li>', '<li class="plum">Plum</li>').html();
// .insertBefore( content )
$('<li class="plum">Plum</li>').insertBefore('.class').html();
// .remove( [selector] )
$el.remove().html();
$el.remove('.class').html();
// .replaceWith( content )
$el.replaceWith($('<li class="plum">Plum</li>')).html();
// .empty()
$el.empty().html();
// .html( [htmlString] )
$el.html();
$el.html('<li class="mango">Mango</li>').html();
// .text( [textString] )
$el.text();
$el.text('text');
// .wrap( content )
// See https://github.com/cheeriojs/cheerio/issues/731
// $el.wrap($('<div class="red-fruit"></div>')).html();
// .css
$el.css('width');
$el.css(['width', 'height']);
$el.css('width', '50px');
/**
* Rendering
*/
$.html();
$.html('.class');
$.xml();
/**
* Miscellaneous
*/
// .clone() ####
$el.clone().html();
/**
* Utilities
*/
// $.root
$.root().append('<ul id="vegetables"></ul>').html();
// $.contains( container, contained )
$.contains($el[0], $el[0]);
// $.parseHTML( data [, context ] [, keepScripts ] )
$.parseHTML(html);
$.parseHTML(html, null, true);
/**
* Not in doc
*/
$el.toArray();
+59 -11
View File
@@ -17,12 +17,17 @@ interface Cheerio {
attr(name: string, value: any): Cheerio;
data(): any;
data(name: string): any;
data(name: string, value: any): any;
val(): string;
val(value: string): Cheerio;
removeAttr(name: string): Cheerio;
has(selector: string): Cheerio;
has(element: CheerioElement): Cheerio;
hasClass(className: string): boolean;
addClass(classNames: string): Cheerio;
@@ -41,6 +46,9 @@ interface Cheerio {
is(selection: Cheerio): boolean;
is(func: (index: number, element: CheerioElement) => boolean): boolean;
// Form
serializeArray(): {name: string, value: string}[];
// Traversing
find(selector: string): Cheerio;
@@ -52,10 +60,12 @@ interface Cheerio {
parentsUntil(element: CheerioElement, filter?: string): Cheerio;
parentsUntil(element: Cheerio, filter?: string): Cheerio;
closest(): Cheerio;
closest(selector: string): Cheerio;
next(selector?: string): Cheerio;
nextAll(): Cheerio;
nextAll(selector: string): Cheerio;
nextUntil(selector?: string, filter?: string): Cheerio;
nextUntil(element: CheerioElement, filter?: string): Cheerio;
@@ -63,6 +73,7 @@ interface Cheerio {
prev(selector?: string): Cheerio;
prevAll(): Cheerio;
prevAll(selector: string): Cheerio;
prevUntil(selector?: string, filter?: string): Cheerio;
prevUntil(element: CheerioElement, filter?: string): Cheerio;
@@ -83,15 +94,24 @@ interface Cheerio {
filter(selection: Cheerio): Cheerio;
filter(element: CheerioElement): Cheerio;
filter(elements: CheerioElement[]): Cheerio;
filter(func: (index: number) => boolean): Cheerio;
filter(func: (index: number, element: CheerioElement) => boolean): Cheerio;
not(selector: string): Cheerio;
not(selection: Cheerio): Cheerio;
not(element: CheerioElement): Cheerio;
not(func: (index: number, element: CheerioElement) => boolean): Cheerio;
first(): Cheerio;
last(): Cheerio;
eq(index: number): Cheerio;
get(): Document[];
get(index: number): Document;
get(): CheerioElement[];
get(index: number): CheerioElement;
index(): number;
index(selector: string): number;
index(selection: Cheerio): number;
end(): Cheerio;
@@ -101,6 +121,9 @@ interface Cheerio {
add(elements: CheerioElement[]): Cheerio;
add(selection: Cheerio): Cheerio;
addBack():Cheerio;
addBack(filter: string):Cheerio;
// Manipulation
append(content: string, ...contents: any[]): Cheerio;
@@ -118,11 +141,19 @@ interface Cheerio {
after(content: Document[], ...contents: any[]): Cheerio;
after(content: Cheerio, ...contents: any[]): Cheerio;
insertAfter(content: string): Cheerio;
insertAfter(content: Document): Cheerio;
insertAfter(content: Cheerio): Cheerio;
before(content: string, ...contents: any[]): Cheerio;
before(content: Document, ...contents: any[]): Cheerio;
before(content: Document[], ...contents: any[]): Cheerio;
before(content: Cheerio, ...contents: any[]): Cheerio;
insertBefore(content: string): Cheerio;
insertBefore(content: Document): Cheerio;
insertBefore(content: Cheerio): Cheerio;
remove(selector?: string): Cheerio;
replaceWith(content: string): Cheerio;
@@ -138,6 +169,11 @@ interface Cheerio {
text(): string;
text(text: string): Cheerio;
// See https://github.com/cheeriojs/cheerio/issues/731
/*wrap(content: string): Cheerio;
wrap(content: Document): Cheerio;
wrap(content: Cheerio): Cheerio;*/
css(propertyName: string): string;
css(propertyNames: string[]): string[];
css(propertyName: string, value: string): Cheerio;
@@ -172,11 +208,7 @@ interface CheerioOptionsInterface {
normalizeWhitespace?: boolean;
}
interface CheerioStatic {
// Document References
// Cheerio https://github.com/cheeriojs/cheerio
// JQuery http://api.jquery.com
interface CheerioSelector {
(selector: string): Cheerio;
(selector: string, context: string): Cheerio;
(selector: string, context: CheerioElement): Cheerio;
@@ -187,7 +219,12 @@ interface CheerioStatic {
(selector: string, context: CheerioElement[], root: string): Cheerio;
(selector: string, context: Cheerio, root: string): Cheerio;
(selector: any): Cheerio;
}
interface CheerioStatic extends CheerioSelector {
// Document References
// Cheerio https://github.com/cheeriojs/cheerio
// JQuery http://api.jquery.com
xml(): string;
root(): Cheerio;
contains(container: CheerioElement, contained: CheerioElement): boolean;
@@ -202,17 +239,28 @@ interface CheerioStatic {
interface CheerioElement {
// Document References
// Node Console
tagName: string;
type: string;
name: string;
attribs: Object;
children: CheerioElement[];
childNodes: CheerioElement[];
lastChild: CheerioElement;
next: CheerioElement;
nextSibling: CheerioElement;
prev: CheerioElement;
previousSibling: CheerioElement;
parent: CheerioElement;
root: CheerioElement;
parentNode: CheerioElement;
nodeValue: string;
}
interface CheerioAPI extends CheerioSelector {
load(html: string, options?: CheerioOptionsInterface): CheerioStatic;
}
declare var cheerio:CheerioAPI;
declare module "cheerio" {
export function load(html: string, options?: CheerioOptionsInterface): CheerioStatic;
export = cheerio;
}
+10 -5
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!');
@@ -43,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);
});
@@ -102,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');
@@ -410,6 +412,10 @@ 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): any {
$('.list').append('<li><h3>' + topic + '</h3><h4>' + data + '</h4></li>');
@@ -419,4 +425,3 @@ $.publish('news/update', 'The New York Stock Exchange rose an unprecedented 1000
$.unsubscribe('news/update');
// Due to being unsubscribed above, this does nothing:
$.publish('news/update', 'We have nothing further to comment at this time.');
+145 -60
View File
@@ -1,4 +1,4 @@
// Type definitions for chocolatechip v4.0.1
// Type definitions for chocolatechip v4.0.4
// Project: https://github.com/chocolatechipui/ChocolateChipJS
// Definitions by: Robert Biggs <http://chocolatechip-ui.com>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -38,7 +38,14 @@ interface ChocolateChipStatic {
*/
(elementArray: ChocolateChipElementArray): ChocolateChipElementArray;
/**
* Accepts the document element and returns it wrapped in an array.
*
* @param document The document object.
* @return document[]
*/
(document: Document): Document[];
/**
* If no argument is provided, return the document as a ChocolateChipElementArray.
* @return Document[]
@@ -105,7 +112,7 @@ interface ChocolateChipStatic {
uuidNum(): number;
/**
* Creates a Uuid and returns it as a string with the prefix: "chch_".
* Creates a uuid using uuidNum().
*
* @return A string.
*/
@@ -162,14 +169,15 @@ interface ChocolateChipStatic {
* @return An encode string form element names and values.
*/
serialize(element: any): string;
/**
* Parse the data in a Promise response as JSON.
*
*
* @param response The response from a Promise.
* @result
* @result
*/
json(reponse: Response): JSON;
json(reponse: Response): JSON;
/**
* This method will defer the execution of a function until the call stack is clear.
*
@@ -191,7 +199,7 @@ interface ChocolateChipStatic {
* This method makes sure a method always returns an array. If no values are available to return, it returns and empty array. This is to make sure that methods that expect a chainable array will not throw and exception.
*
* @param result The result of a method to test if it can be returned in an array.
* @return An array hold the results of a method, otherwise an empty array.
* @return An array holding the results of a method, otherwise an empty array.
*/
returnResult(result: HTMLElement[]): any[];
@@ -201,7 +209,7 @@ interface ChocolateChipStatic {
* @param array An array of elements.
* @param callback A callback to execute on each element. This has two parameters: the context, followed by the index of the current iteration.
*/
each(array: any[], callback: (ctx: any, idx?: number) => any): any[];
each<T>(array: T[], callback: (ctx: T, idx: number) => any): any;
/**
* This method will concatenate strings or values as a cleaner alternative to using the '+' operator.
@@ -426,26 +434,11 @@ interface ChocolateChipStatic {
*/
isNativeAndroid: boolean;
JSONPCallbacks: string[];
/**
* Load JSON from a remote server using the JSONP technique.
*
* @param url A string
* @return Promise
*/
jsonp(
options: {
timeout?: number;
callbackName?: string;
clear?: boolean;
}
): Promise<any>;
/**
* Serialize
*/
serialize(form: HTMLFormElement | ChocolateChipElementArray): string;
/**
* Grabs values from a form and converts them into a JSON object.
*
@@ -454,7 +447,7 @@ interface ChocolateChipStatic {
* You use the form input's name to set up the namespace structure for your JSON, e.g. name="newUser.name.first".
*/
form2JSON(rootNode: string | HTMLElement, delimiter: string): Object;
/**
* Subscribe to a publication. You provide the topic you want to subscribe to, as well as a callback to execute when a publication occurs.
* Any data passed by the publisher is exposed to the callback as its second parameter. The callback's first parameter is the published topic.
@@ -463,7 +456,7 @@ interface ChocolateChipStatic {
* @data any You can receive any type: string, number, array, object, etc.
* @return any
*/
subscribe(topic: string, callback: (topic: string, data: any) => boolean): boolean;
subscribe(topic: string, callback: (topic: string, data: any) => any): boolean;
/**
* Unsubscribe from a topic. Pass this the topic you wish to unsubscribe from. The subscription will be terminated immediately.
@@ -507,16 +500,64 @@ interface ChocolateChipStatic {
(template: string, variable?: string): Function;
/**
* A method to repeated output a template.
*
* @param element The target container into which the content will be inserted.
* @param template A string of markup.
* @param data The iterable data the template will consume.
* @return void.
* The repeater method used to rendering iterable template data.
*/
repeater: (element: ChocolateChipElementArray, template: string, data: any) => void;
repeater: {
/**
* Use this method to render declarative temlate repeaters. This expects a "data-repeater" attribute whose value points to data stored on $.template.data.
*/
(): void;
/**
* A method to repeated output a template.
*
* @param element The target container into which the content will be inserted.
* @param template A string of markup.
* @param data The iterable data the template will consume.
* @return void.
*/
(element: ChocolateChipElementArray, template: string, data: any): void;
}
/**
* An object that holds the reference to the controller for a repeater.
* This is used to cache the data that a repeater uses. After the repeater is rendered, the reference is deleted from this object.
* Example: $.template.data["myRepeater"] = [{name: "Joe"}, {name: "Sue"}];
*
*/
data: any;
/**
* Use this value to output an index value in a template repeater.
*/
index: number;
};
/**
* ATENTION: DO NOT TOUCH! This is the ChocolateChipJS cache. This is used to store details about registered events and data. You should not touch any of these values, even though they are exposed, as this can seriously impair the behavior of your app.
*
* data: this is used by $(element).data() to store data.
* events: this is used by the event system.
*/
chch_cache: {
/**
* DO NOT TOUCH! This hold data stored by $(element).data().
*/
data: {};
/**
* DO NOT TOUCH! This stores information about registered events.
*/
events: {
keys: any[];
values: any[];
set: Function;
hasKey: Function;
_delete: Function;
}
}
}
@@ -532,7 +573,7 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
* @param Function
* @return void
*/
each(func: (ctx: any, idx: number) => any): void;
each(func: (ctx: any, idx: number) => void): void;
/**
* Sorts an array and removes duplicates before returning it.
@@ -586,7 +627,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
*/
is(element: any): ChocolateChipElementArray;
/**
* Check the current matched set of elements against a selector or element and return it
* if it does not match the given arguments.
@@ -612,6 +652,7 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
* @ return HTMLElement[]
*/
has(selector: string): ChocolateChipElementArray;
/**
* Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element.
*
@@ -627,6 +668,7 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
* @ return HTMLElement[]
*/
hasnt(selector: string): ChocolateChipElementArray;
/**
* Reduce the set of matched elements to those that have a descendant that does not match the selector or DOM element.
*
@@ -713,7 +755,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
*/
closest(selector: string | number): ChocolateChipElementArray;
/**
* Get the siblings of each element in the set of matched elements, optionally filtered by a selector.
*
@@ -737,7 +778,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
*/
html(htmlString: string): ChocolateChipElementArray;
/**
* Get the value of style properties for the first element in the set of matched elements.
*
@@ -796,14 +836,13 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
*/
hasAttr(attributeName: string): ChocolateChipElementArray;
/**
* Get the value of an attribute for the first element in the set of matched elements.
* Test whether an attribute exists on the first element in the set of matched elements. The value returned is a boolean.
*
* @param attributeName The name of the attribute to get.
* @return string
* @return boolean
*/
prop(attributeName: string): string;
prop(propertyName: string): boolean;
/**
* Set an property for the set of matched elements.
@@ -812,7 +851,15 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
* @param value A string indicating the value to set the property to.
* @return HTMLElement[]
*/
prop(propertyName: string, value: string): ChocolateChipElementArray;
prop(propertyName: string, value: any | boolean): ChocolateChipElementArray;
/**
* Remove an element property.
*
* @param property The property to remove.
* @return HTMLElement[]
*/
removeProp(property: string): ChocolateChipElementArray;
/**
* Adds the specified class(es) to each of the set of matched elements.
@@ -870,7 +917,7 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
* @param key Name of the data stored.
* @return any
*/
removeData(key: string): any;
removeData(key?: string): any;
/**
* Store string data associated with the matched elements.
@@ -1100,7 +1147,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
*/
animate(options: Object, duration?: string, easing?: string): void;
/**
* Attach a handler to an event for the elements.
*
@@ -1119,7 +1165,7 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
* @param useCapture Setting the third argument to true will trigger event bubbling. The default is false.
* @return ChocolateChipStatic
*/
unbind(eventType: string, handler: (eventObject: Event) => any, useCapture?: boolean): ChocolateChipStatic;
unbind(eventType?: string, handler?: (eventObject: Event) => any, useCapture?: boolean): ChocolateChipStatic;
/**
* Add a delegated event to listen for the provided event on the descendant elements.
@@ -1142,7 +1188,7 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
* @param useCapture Setting the third argument to true will trigger event bubbling. The default is false.
* @return ChocolateChipStatic
*/
undelegate(selector: any, eventType: string, handler: (eventObject: Event) => any, useCapture?: boolean): ChocolateChipStatic;
undelegate(selector?: any, eventType?: string, handler?: (eventObject: Event) => any, useCapture?: boolean): ChocolateChipStatic;
/**
* Add a handler to an event for elements. If a selector is provided as the second argument, this implements a delegated event.
@@ -1168,7 +1214,10 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
off(eventType?: string, selector?: any, handler?: (eventObject: Event) => any, capturePhase?: boolean): ChocolateChipStatic;
/**
*
* Trigger an event on an element.
*
* @param eventType The event to trigger.
* @return void
*/
trigger(eventType: string): void;
}
@@ -1270,22 +1319,20 @@ interface PromiseConstructor {
}
declare var Promise: PromiseConstructor;
declare type ByteString = string;
declare type USVString = string;
declare type DOMString = string;
declare type OpenEndedDictionary = Object;
/**
* Interface for fetch API.
*
* @param input A string representing a valid url.
* @param init An object literal of key value pairs to set method, headers, body, credentials, cache or timeout.
* @param init An object literal of key value pairs to set method, headers, body, credentials or cache.
* @return Promise.
*/
interface fetch {
(input: string,
(input: string,
init?: {
method?: string;
headers?: {};
@@ -1301,12 +1348,12 @@ interface fetch {
include: string;
};
cache?: {
default: string;
"no-store": string;
reload: string;
"no-cache": string;
"force-cache": string;
"only-if-cached": string;
default: string;
"no-store": string;
reload: string;
"no-cache": string;
"force-cache": string;
"only-if-cached": string;
};
timeout?: number;
}): Promise<any>;
@@ -1316,6 +1363,9 @@ interface XMLHttpRequest {
responseURL: string;
}
/**
* Headers Interface. This defines the methods exposed by the Headers object.
*/
interface Headers {
(headers?: any): void;
append(name: string, value: string): void;
@@ -1331,6 +1381,9 @@ interface decode {
(body: any): FormData;
}
/**
* Request Interface. This defines the properties and methods exposed by the Request object.
*/
interface Request {
(input: {
url: string;
@@ -1358,6 +1411,9 @@ interface URLSearchParams {
():URLSearchParams;
}
/**
* Resonse Interface. This defines the properties and methods exposed by the Response object.
*/
interface Response {
(body?: {
blob: Blob;
@@ -1386,14 +1442,43 @@ interface Response {
headers: Headers;
bodyUsed: boolean;
}
interface ChocolateChipStatic {
/**
* A cache to hold callbacks execute by the response from a JSONP request. This is an array of strings. By default these values get purged when the callback execute and exposes the data returned by the request.
*/
JSONPCallbacks: string[];
/**
* Method to perform JSONP request.
*
* @param url A string defining the url to target.
* @param options And object literal of properties: {timeout? number, callbackName?: string, clear?: boolean}
*/
jsonp(url: string, options?: {
/**
* A number representing milliseconds to express when to refect a JSONP request.
*/
timeout?: number;
/**
* The optional name for the callback when the server response will execute. The default value is "callback". However some sites may use a different name for their JSONP function. Consult the documentation on the site to ascertain the correct value for this callback.
*/
callbackName?: string;
/**
* This value determines whether the callbacks and script associate with JSONP persist or are purged after the request returns. By default this is set to true, meaning that they will be purged.
*/
clear?: boolean;
}): any
}): any
}
interface Window {
chocolatechipjs: ChocolateChipStatic;
$: ChocolateChipStatic;
jsonp: any;
}
declare var $: ChocolateChipStatic;
declare var fetch: fetch;
declare var chocolatechipjs: ChocolateChipStatic;
-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));
+1
View File
@@ -37,6 +37,7 @@ $(function() {
$.UIGoToArticle("#main");
$.UIGoBack();
$.UIGoBackToArticle("#main");
$.UIEnableBrowserHashModification();
$.UIBlock();
$.UIBlock(.5);
$.UIUnblock();
+72 -2
View File
@@ -1,8 +1,8 @@
// Type definitions for chui v3.9.0
// Type definitions for chui v3.9.1
// Project: https://github.com/chocolatechipui/chocolatechip-ui
// Definitions by: Robert Biggs <http://chocolatechip-ui.com>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// ChocolateChip-UI 3.9.0
// ChocolateChip-UI 3.9.1
/**
These TypeScript delcarations for ChocolateChip-UI contain interfaces for both ChocolateChipJS and jQuery. Depending on which library you are using, you will get the type interfaces appropriate for it.
*/
@@ -89,6 +89,17 @@ interface ChocolateChipStatic {
*/
isNavigating: boolean;
/**
* Tell ChocolateChip-UI to not modify window hash during navigation.
* The default value is false.
*/
UIBrowserHashModification: boolean;
/**
* Method to tell ChocolateChip-UI to register navigation history on Window hash.
*/
UIEnableBrowserHashModification(): void;
/**
* Navigate to the article indicated by the provided destination ID. This enters the destination into the navigation history array.
*
@@ -784,6 +795,17 @@ interface JQueryStatic {
*/
isNavigating: boolean;
/**
* Tell ChocolateChip-UI to not modify window hash during navigation.
* The default value is false.
*/
UIBrowserHashModification: boolean;
/**
* Method to tell ChocolateChip-UI to register navigation history on Window hash.
*/
UIEnableBrowserHashModification(): void;
/**
* Navigate to the article indicated by the provided destination ID. This enters the destination into the navigation history array.
*
@@ -1014,6 +1036,54 @@ interface JQueryStatic {
*/
UIUnBindData(controller?: string): void;
/**
* Object used to store string templates and parsed templates.
*
* @param string A string defining the template.
* @param string A label used to access an object's properties in the template. If none is provided it defaults to "data": [[= data.name]].
* @return void
*/
templates: Object;
/**
* This method returns a parsed template.
*
*/
template: {
/**
* This method parses a string and an optoinal variable name and returns a parsed template in the form of a function. You can then pass this function data to get rendered nodes.
*
* @param template A string of markup to use as a template.
* @param variable An option name to use in the template. If it were "myData": [[= myData.name]]. Otherwise it defaults to "data": [[= data.name]].
* @return A function.
*/
(template: string, variable?: string): Function;
/**
* A method to repeated output a template.
*
* @param element The target container into which the content will be inserted.
* @param template A string of markup.
* @param data The iterable data the template will consume.
* @return void.
*/
repeater: (element: JQuery, template: string, data: any) => void;
/**
* A object that holds the reference to the controller for a repeater.
* This is used to cache the data that a repeater uses. After the repeater is rendered, the reference is deleted from this object.
*
*/
data: {
repeaterName?: any;
};
/**
* Use this value to output an index value in a template repeater.
*/
index: number;
};
}
/**
-1
View File
@@ -282,7 +282,6 @@ function test_adding_dialog_by_definition() {
function test_adding_plugin() {
CKEDITOR.plugins.add( 'abbr', {
icons: 'abbr',
init: function( editor: CKEDITOR.editor ) {
// empty logic
}
+9 -9
View File
@@ -628,7 +628,7 @@ declare module CKEDITOR {
data: Function;
defaults: Object;
dialog: String;
downcast: any; // should be string | Function
downcast: string | Function;
downcasts: Object;
draggable: boolean;
editables: Object;
@@ -643,16 +643,16 @@ declare module CKEDITOR {
styleToAllowedContentRules: Function;
styleableElements: string;
template: string;
upcast: any; // should be string | Function
upcast: string | Function;
upcasts: Object;
addClass(className: string): void;
applyStyle(style: any): void; // any should be CKEDITOR.style
capture(): void;
checkStyleActive(style: any): boolean; // any should be CKEDITOR.style
define(name: string, meta: {errorProof?: boolean}): void;
define(name: string, meta: { errorProof?: boolean }): void;
destroy(offline?: boolean): void;
destroyEditable(editableName:string, offline?: boolean): void;
destroyEditable(editableName: string, offline?: boolean): void;
edit(): boolean;
fire(eventName: string, data?: Object, editor?: editor): any; // should be boolean | Object
fireOnce(eventName: string, data?: Object, editor?: editor): any; // should be boolean | Object
@@ -670,7 +670,7 @@ declare module CKEDITOR {
removeClass(className: string): void;
removeListener(evnetName: string, listenerFunction: Function): void;
removeStyle(style: any): void; // any should be CKEDITOR.style
setData(keyOrData: any, value?: Object): IWidget; // any should be string | Object
setData(keyOrData: string | {}, value?: Object): IWidget;
setFocused(selected: boolean): IWidget;
setSelected(selected: boolean): IWidget;
toFeature(): any; // should be CKEDITOR.feature
@@ -685,7 +685,7 @@ declare module CKEDITOR {
data?: Function;
defaults?: Object;
dialog?: String;
downcast?: any; // should be string | Function
downcast?: string | Function;
downcasts?: Object;
draggable?: boolean;
edit?: Function;
@@ -701,7 +701,7 @@ declare module CKEDITOR {
styleToAllowedContentRules?: Function;
styleableElements?: string;
template?: string;
upcast?: any; // should be string | Function
upcast?: string | Function;
upcasts?: Object;
toFeature?(): any; // should be CKEDITOR.feature
}
@@ -732,8 +732,8 @@ declare module CKEDITOR {
interface IPluginDefinition {
hidpi?: boolean;
lang?: any; // should be string | string[]
requires?: any; // should be string | string[]a
lang?: string | string[];
requires?: string | string[];
afterInit?(editor: editor): any;
beforeInit?(editor: editor): any;
init?(editor: editor): any;
+8 -3
View File
@@ -1,13 +1,18 @@
// Type definitions for classnames
// Project: https://github.com/JedWatson/classnames
// Definitions by: Dave Keen <http://www.keendevelopment.ch>
// Definitions by: Dave Keen <http://www.keendevelopment.ch>, Adi Dahiya <https://github.com/adidahiya>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface ClassDictionary {
[id: string]: boolean;
}
interface ClassNamesFn {
(...classes: (string | ClassDictionary)[]): string;
}
declare var classNames: ClassNamesFn;
declare module "classnames" {
function classNames(...classes: (string|ClassDictionary)[]): string;
export = classNames
}
}
+2
View File
@@ -1,3 +1,5 @@
/// <reference path="./clone.d.ts" />
import clone = require("clone");
var original = {
+33
View File
@@ -0,0 +1,33 @@
/// <reference path="codemirror.d.ts" />
/// <reference path="codemirror-showhint.d.ts" />
var doc = new CodeMirror.Doc('text');
var pos = new CodeMirror.Pos(2, 3);
CodeMirror.showHint(doc);
CodeMirror.showHint(doc, function (cm) {
return {
from: pos,
list: ["one", "two"],
to: pos
};
});
CodeMirror.showHint(doc, function (cm) {
return {
from: pos,
list: [
{
text: "disp1",
render: function (el, self, data) {
;
}
},
{
className: "class2",
displayText: "disp2",
from: pos,
to: pos,
text: "sometext"
}
],
to: pos
};
});
+74
View File
@@ -0,0 +1,74 @@
// Type definitions for CodeMirror
// Project: https://github.com/marijnh/CodeMirror
// Definitions by: jacqt <https://github.com/jacqt>, basarat <https://github.com/basarat>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// See docs https://codemirror.net/doc/manual.html#addon_show-hint
declare module CodeMirror {
var commands: any;
/** Provides a framework for showing autocompletion hints. Defines editor.showHint, which takes an optional
options object, and pops up a widget that allows the user to select a completion. Finding hints is done with
a hinting functions (the hint option), which is a function that take an editor instance and options object,
and return a {list, from, to} object, where list is an array of strings or objects (the completions), and
from and to give the start and end of the token that is being completed as {line, ch} objects. An optional
selectedHint property (an integer) can be added to the completion object to control the initially selected hint. */
function showHint(cm: CodeMirror.Doc, hinter?: (doc: CodeMirror.Doc) => Hints, options?: ShowHintOptions): void;
interface Hints {
from: Position;
to: Position;
list: (Hint | string)[];
}
/** Interface used by showHint.js Codemirror add-on
When completions aren't simple strings, they should be objects with the following properties: */
interface Hint {
text: string;
className?: string;
displayText?: string;
from?: Position;
/** Called if a completion is picked. If provided *you* are responsible for applying the completion */
hint?: (cm: any, data: Hints, cur: Hint) => void;
render?: (element: HTMLLIElement, data: Hints, cur: Hint) => void;
to?: Position;
}
interface Editor {
/** An extension of the existing CodeMirror typings for the Editor.on("keyup", func) syntax */
on(eventName: string, handler: (doc: CodeMirror.Doc, event: any) => void): void;
off(eventName: string, handler: (doc: CodeMirror.Doc, event: any) => void): void;
}
/** Extend CodeMirror.Doc with a state object, so that the Doc.state.completionActive property is reachable*/
interface Doc {
state: any;
showHint: (options: ShowHintOptions) => void;
}
interface ShowHintOptions {
completeSingle: boolean;
hint: (doc: CodeMirror.Doc) => Hints;
}
/** The Handle used to interact with the autocomplete dialog box.*/
interface Handle {
moveFocus(n: number, avoidWrap: boolean): void;
setFocus(n: number): void;
menuSize(): number;
length: number;
close(): void;
pick(): void;
data: any;
}
interface EditorConfiguration {
showHint?: boolean;
hintOptions?: ShowHintOptions;
}
}
declare module "codemirror/addon/hint/show-hint" {
export = CodeMirror;
}
+5 -1
View File
@@ -787,7 +787,7 @@ declare module CodeMirror {
viewportMargin?: number;
/** Optional lint configuration to be used in conjunction with CodeMirror's linter addon. */
lint?: LintOptions;
lint?: boolean | LintOptions;
}
interface TextMarkerOptions {
@@ -1090,3 +1090,7 @@ declare module CodeMirror {
to?: Position;
}
}
declare module "codemirror" {
export = CodeMirror;
}
+15
View File
@@ -0,0 +1,15 @@
/// <reference path="coffeeify.d.ts" />
import coffeeify = require('coffeeify');
coffeeify.sourceMap = false;
var isCoffee = coffeeify.isCoffee('foo.coffee');
var isLiterate = coffeeify.isLiterate('bar.coffee');
coffeeify.compile('out.js', 'console.log 42', (err, compiled) => {
console.log(err);
console.log(compiled);
});
coffeeify('test.coffee').end();
+37
View File
@@ -0,0 +1,37 @@
// Type definitions for coffeeify
// Project: https://github.com/jnordberg/coffeeify
// Definitions by: Qubo <https://github.com/tkQubo>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../through/through.d.ts" />
declare module "coffeeify" {
import through = require('through');
namespace coffeeify {
interface Coffeeify {
isCoffee(file: string): boolean;
isLiterate(file: string): boolean;
sourceMap: boolean;
compile(file: string, data: string, callback: Callback): void;
(file: string): through.ThroughStream;
}
interface Callback {
(error: ParseError, compiled: string): void;
}
interface ParseError extends SyntaxError {
new(error: any, src: string, file: string): ParseError;
message: string;
line: number;
column: number;
annotated: string;
}
}
var coffeeify: coffeeify.Coffeeify;
export = coffeeify;
}
+1 -1
View File
@@ -1,4 +1,4 @@
/// <reference path="../express/express.d.ts"/>
/// <reference path="./connect-slashes.d.ts"/>
import express = require('express');
import slashes = require('connect-slashes');
+2
View File
@@ -1,3 +1,5 @@
/// <reference path="./contextjs.d.ts" />
import context = require("contextjs");
context.init();
@@ -1,3 +1,5 @@
/// <reference path="./convert-source-map.d.ts" />
import convert = require("convert-source-map");
var json = convert
@@ -10,4 +12,4 @@ var modified = convert
.toJSON();
console.log(json);
console.log(modified);
console.log(modified);
+6 -2
View File
@@ -176,8 +176,12 @@ file.download('http://some.server.com/download.php',
console.error('Failed with exception ' + err.exception);
}
},
{ headers: null },
true);
true,
{
headers: {
"Authorization": "Basic dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA=="
}
});
file.upload('cdvfile://localhost/persistent/path/to/downloads/',
'http://some.server.com/download.php',
+2
View File
@@ -24,6 +24,8 @@ interface Device {
uuid: string;
/** Get the operating system version. */
version: string;
/** Get the device's manufacturer. */
manufacturer: string;
}
declare var device: Device;
+4 -4
View File
@@ -53,8 +53,8 @@ interface FileTransfer {
target: string,
successCallback: (fileEntry: FileEntry) => void,
errorCallback: (error: FileTransferError) => void,
options?: FileDownloadOptions,
trustAllHosts?: boolean): void;
trustAllHosts?: boolean,
options?: FileDownloadOptions): void;
/**
* Aborts an in-progress transfer. The onerror callback is passed a FileTransferError object
* which has an error code of FileTransferError.ABORT_ERR.
@@ -98,8 +98,8 @@ interface FileUploadOptions {
/** Optional parameters for download method. */
interface FileDownloadOptions {
/** A map of header name/header values. Use an array to specify more than one value. */
headers?: Object[];
/** A map of header name/header values. */
headers?: {};
}
/** A FileTransferError object is passed to an error callback when an error occurs. */
+6 -1
View File
@@ -41,12 +41,17 @@ interface Globalization {
* @param onError Called on error with a GlobalizationError object.
* The error's expected code is GlobalizationError.FORMATTING_ERROR.
* @param options Optional format parameters. Default {formatLength:'short', selector:'date and time'}
* - 'formatLength' can be "short", "medium", "long", or "full".
* - 'selector' can be "date", "time", or "date and time".
*/
dateToString(
date: Date,
onSuccess: (date: { value: string; }) => void,
onError: (error: GlobalizationError) => void,
options?: { type?: string; item?: string; }): void;
options?: {
formatLength?: string; // "short" | "medium" | "long" | "full"
selector?: string; // "date" | "time" | "date and time"
}): void;
/**
* Parses a date formatted as a string, according to the client's user preferences
* and calendar using the time zone of the client, and returns the corresponding date object.
+21 -4
View File
@@ -1,17 +1,32 @@
// Type definitions for Apache Cordova Vibration plugin.
// Project: https://github.com/apache/cordova-plugin-vibration
// Definitions by: Microsoft Open Technologies, Inc. <http://msopentech.com>
// Definitions by: Microsoft Open Technologies, Inc. <http://msopentech.com>, Louis Lagrange <https://github.com/Minishlink/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
//
//
// Copyright (c) Microsoft Open Technologies, Inc.
// Licensed under the MIT license.
interface Navigator {
/**
* Vibrates the device for the specified amount of time.
* @param time Milliseconds to vibrate the device. 0 cancels the vibration. Ignored on iOS.
*/
vibrate(time: number): void;
/**
* Vibrates the device with a given pattern.
* @param time Sequence of durations (in milliseconds) for which to turn on or off the vibrator. Ignored on iOS.
*/
vibrate(time: number[]): void;
}
interface Notification {
/**
* Vibrates the device for the specified amount of time.
* @param time Milliseconds to vibrate the device. Ignored on iOS.
* @deprecated
*/
vibrate(time: number): void
vibrate(time: number): void;
/**
* Vibrates the device with a given pattern.
* @param number[] pattern Pattern with which to vibrate the device.
@@ -19,10 +34,12 @@ interface Notification {
* The next value - the number of milliseconds for which to keep the vibrator on before turning it off.
* @param number repeat Optional index into the pattern array at which to start repeating (will repeat until canceled),
* or -1 for no repetition (default).
* @deprecated
*/
vibrateWithPattern(pattern: number[], repeat: number): void;
/**
* Immediately cancels any currently running vibration.
* @deprecated
*/
cancelVibration(): void;
}
}
+146 -151
View File
@@ -22,13 +22,13 @@ declare type PropertyKey = string | number | symbol;
// #############################################################################################
// ECMAScript 6: Object & Function
// Modules: es6.object.assign, es6.object.is, es6.object.set-prototype-of,
// Modules: es6.object.assign, es6.object.is, es6.object.set-prototype-of,
// es6.object.to-string, es6.function.name and es6.function.has-instance.
// #############################################################################################
interface ObjectConstructor {
/**
* Copy the values of all of the enumerable own properties from one or more source objects to a
* Copy the values of all of the enumerable own properties from one or more source objects to a
* target object. Returns the target object.
* @param target The target object to copy to.
* @param sources One or more source objects to copy properties from.
@@ -57,10 +57,10 @@ interface Function {
*/
name: string;
/**
* Determines if a constructor object recognizes an object as one of the
/**
* Determines if a constructor object recognizes an object as one of the
* constructors instances.
* @param value The object to test.
* @param value The object to test.
*/
[Symbol.hasInstance](value: any): boolean;
}
@@ -71,30 +71,25 @@ interface Function {
// and es6.array.find-index
// #############################################################################################
interface ArrayLike<T> {
length: number;
[n: number]: T;
}
interface Array<T> {
/**
* Returns the value of the first element in the array where predicate is true, and undefined
/**
* Returns the value of the first element in the array where predicate is true, and undefined
* otherwise.
* @param predicate find calls predicate once for each element of the array, in ascending
* order, until it finds one where predicate returns true. If such an element is found, find
* @param predicate find calls predicate once for each element of the array, in ascending
* order, until it finds one where predicate returns true. If such an element is found, find
* immediately returns that element value. Otherwise, find returns undefined.
* @param thisArg If provided, it will be used as the this value for each invocation of
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
find(predicate: (value: T, index: number, obj: Array<T>) => boolean, thisArg?: any): T;
/**
* Returns the index of the first element in the array where predicate is true, and undefined
/**
* Returns the index of the first element in the array where predicate is true, and undefined
* otherwise.
* @param predicate find calls predicate once for each element of the array, in ascending
* order, until it finds one where predicate returns true. If such an element is found, find
* @param predicate find calls predicate once for each element of the array, in ascending
* order, until it finds one where predicate returns true. If such an element is found, find
* immediately returns that element value. Otherwise, find returns undefined.
* @param thisArg If provided, it will be used as the this value for each invocation of
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
findIndex(predicate: (value: T) => boolean, thisArg?: any): number;
@@ -102,21 +97,21 @@ interface Array<T> {
/**
* Returns the this object after filling the section identified by start and end with value
* @param value value to fill array section with
* @param start index to start filling the array at. If start is negative, it is treated as
* length+start where length is the length of the array.
* @param end index to stop filling the array at. If end is negative, it is treated as
* @param start index to start filling the array at. If start is negative, it is treated as
* length+start where length is the length of the array.
* @param end index to stop filling the array at. If end is negative, it is treated as
* length+end.
*/
fill(value: T, start?: number, end?: number): T[];
/**
/**
* Returns the this object after copying a section of the array identified by start and end
* to the same array starting at position target
* @param target If target is negative, it is treated as length+target where length is the
* length of the array.
* @param start If start is negative, it is treated as length+start. If end is negative, it
* @param target If target is negative, it is treated as length+target where length is the
* length of the array.
* @param start If start is negative, it is treated as length+start. If end is negative, it
* is treated as length+end.
* @param end If not specified, length of the this object is used as its default value.
* @param end If not specified, length of the this object is used as its default value.
*/
copyWithin(target: number, start: number, end?: number): T[];
@@ -161,47 +156,47 @@ interface ArrayConstructor {
// #############################################################################################
// ECMAScript 6: String & RegExp
// Modules: es6.string.from-code-point, es6.string.raw, es6.string.code-point-at,
// es6.string.ends-with, es6.string.includes, es6.string.repeat,
// Modules: es6.string.from-code-point, es6.string.raw, es6.string.code-point-at,
// es6.string.ends-with, es6.string.includes, es6.string.repeat,
// es6.string.starts-with, and es6.regexp
// #############################################################################################
interface String {
/**
* Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point
* value of the UTF-16 encoded code point starting at the string element at position pos in
* the String resulting from converting this object to a String.
* If there is no element at that position, the result is undefined.
* Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point
* value of the UTF-16 encoded code point starting at the string element at position pos in
* the String resulting from converting this object to a String.
* If there is no element at that position, the result is undefined.
* If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos.
*/
codePointAt(pos: number): number;
/**
* Returns true if searchString appears as a substring of the result of converting this
* object to a String, at one or more positions that are
* Returns true if searchString appears as a substring of the result of converting this
* object to a String, at one or more positions that are
* greater than or equal to position; otherwise, returns false.
* @param searchString search string
* @param searchString search string
* @param position If position is undefined, 0 is assumed, so as to search all of the String.
*/
includes(searchString: string, position?: number): boolean;
/**
* Returns true if the sequence of elements of searchString converted to a String is the
* same as the corresponding elements of this object (converted to a String) starting at
* Returns true if the sequence of elements of searchString converted to a String is the
* same as the corresponding elements of this object (converted to a String) starting at
* endPosition length(this). Otherwise returns false.
*/
endsWith(searchString: string, endPosition?: number): boolean;
/**
* Returns a String value that is made from count copies appended together. If count is 0,
* Returns a String value that is made from count copies appended together. If count is 0,
* T is the empty String is returned.
* @param count number of copies to append
*/
repeat(count: number): string;
/**
* Returns true if the sequence of elements of searchString converted to a String is the
* same as the corresponding elements of this object (converted to a String) starting at
* Returns true if the sequence of elements of searchString converted to a String is the
* same as the corresponding elements of this object (converted to a String) starting at
* position. Otherwise returns false.
*/
startsWith(searchString: string, position?: number): boolean;
@@ -216,7 +211,7 @@ interface StringConstructor {
/**
* String.raw is intended for use as a tag function of a Tagged Template String. When called
* as such the first argument will be a well formed template call site object and the rest
* as such the first argument will be a well formed template call site object and the rest
* parameter will contain the substitution values.
* @param template A well-formed template string call site representation.
* @param substitutions A set of substitution values.
@@ -248,14 +243,14 @@ interface RegExp {
interface NumberConstructor {
/**
* The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1
* that is representable as a Number value, which is approximately:
* that is representable as a Number value, which is approximately:
* 2.2204460492503130808472633361816 x 10‍‍16.
*/
EPSILON: number;
/**
* Returns true if passed value is finite.
* Unlike the global isFininte, Number.isFinite doesn't forcibly convert the parameter to a
* Unlike the global isFininte, Number.isFinite doesn't forcibly convert the parameter to a
* number. Only finite values of the type number, result in true.
* @param number A numeric value.
*/
@@ -268,7 +263,7 @@ interface NumberConstructor {
isInteger(number: number): boolean;
/**
* Returns a Boolean value that indicates whether a value is the reserved value NaN (not a
* Returns a Boolean value that indicates whether a value is the reserved value NaN (not a
* number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter
* to a number. Only values of the type number, that are also NaN, result in true.
* @param number A numeric value.
@@ -281,30 +276,30 @@ interface NumberConstructor {
*/
isSafeInteger(number: number): boolean;
/**
* The value of the largest integer n such that n and n + 1 are both exactly representable as
* a Number value.
/**
* The value of the largest integer n such that n and n + 1 are both exactly representable as
* a Number value.
* The value of Number.MIN_SAFE_INTEGER is 9007199254740991 2^53 1.
*/
MAX_SAFE_INTEGER: number;
/**
* The value of the smallest integer n such that n and n 1 are both exactly representable as
* a Number value.
/**
* The value of the smallest integer n such that n and n 1 are both exactly representable as
* a Number value.
* The value of Number.MIN_SAFE_INTEGER is 9007199254740991 ((2^53 1)).
*/
MIN_SAFE_INTEGER: number;
/**
* Converts a string to a floating-point number.
* @param string A string that contains a floating-point number.
* Converts a string to a floating-point number.
* @param string A string that contains a floating-point number.
*/
parseFloat(string: string): number;
/**
* Converts A string to an integer.
* @param s A string to convert into a number.
* @param radix A value between 2 and 36 that specifies the base of the number in numString.
* @param radix A value between 2 and 36 that specifies the base of the number in numString.
* If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.
* All other strings are considered decimal.
*/
@@ -350,7 +345,7 @@ interface Math {
log1p(x: number): number;
/**
* Returns the result of (e^x - 1) of x (e raised to the power of x, where e is the base of
* Returns the result of (e^x - 1) of x (e raised to the power of x, where e is the base of
* the natural logarithms).
* @param x A numeric expression.
*/
@@ -436,8 +431,8 @@ interface Symbol {
}
interface SymbolConstructor {
/**
* A reference to the prototype.
/**
* A reference to the prototype.
*/
prototype: Symbol;
@@ -448,14 +443,14 @@ interface SymbolConstructor {
(description?: string|number): symbol;
/**
* Returns a Symbol object from the global symbol registry matching the given key if found.
* Returns a Symbol object from the global symbol registry matching the given key if found.
* Otherwise, returns a new symbol with this key.
* @param key key to search for.
*/
for(key: string): symbol;
/**
* Returns a key from the global symbol registry matching the given Symbol if found.
* Returns a key from the global symbol registry matching the given Symbol if found.
* Otherwise, returns a undefined.
* @param sym Symbol to find the key for.
*/
@@ -463,72 +458,72 @@ interface SymbolConstructor {
// Well-known Symbols
/**
* A method that determines if a constructor object recognizes an object as one of the
* constructors instances. Called by the semantics of the instanceof operator.
/**
* A method that determines if a constructor object recognizes an object as one of the
* constructors instances. Called by the semantics of the instanceof operator.
*/
hasInstance: symbol;
/**
/**
* A Boolean value that if true indicates that an object should flatten to its array elements
* by Array.prototype.concat.
*/
isConcatSpreadable: symbol;
/**
* A method that returns the default iterator for an object. Called by the semantics of the
/**
* A method that returns the default iterator for an object. Called by the semantics of the
* for-of statement.
*/
iterator: symbol;
/**
* A regular expression method that matches the regular expression against a string. Called
* by the String.prototype.match method.
* A regular expression method that matches the regular expression against a string. Called
* by the String.prototype.match method.
*/
match: symbol;
/**
* A regular expression method that replaces matched substrings of a string. Called by the
/**
* A regular expression method that replaces matched substrings of a string. Called by the
* String.prototype.replace method.
*/
replace: symbol;
/**
* A regular expression method that returns the index within a string that matches the
* A regular expression method that returns the index within a string that matches the
* regular expression. Called by the String.prototype.search method.
*/
search: symbol;
/**
* A function valued property that is the constructor function that is used to create
/**
* A function valued property that is the constructor function that is used to create
* derived objects.
*/
species: symbol;
/**
* A regular expression method that splits a string at the indices that match the regular
* A regular expression method that splits a string at the indices that match the regular
* expression. Called by the String.prototype.split method.
*/
split: symbol;
/**
/**
* A method that converts an object to a corresponding primitive value.Called by the ToPrimitive
* abstract operation.
*/
toPrimitive: symbol;
/**
/**
* A String value that is used in the creation of the default string description of an object.
* Called by the built-in method Object.prototype.toString.
*/
toStringTag: symbol;
/**
* An Object whose own property names are property names that are excluded from the with
/**
* An Object whose own property names are property names that are excluded from the with
* environment bindings of the associated objects.
*/
unscopables: symbol;
/**
* Non-standard. Use simple mode for core-js symbols. See https://github.com/zloirock/core-js/#caveats-when-using-symbol-polyfill
*/
@@ -544,12 +539,12 @@ declare var Symbol: SymbolConstructor;
interface Object {
/**
* Determines whether an object has a property with the specified name.
* Determines whether an object has a property with the specified name.
* @param v A property name.
*/
hasOwnProperty(v: PropertyKey): boolean;
/**
/**
* Determines whether a specified property is enumerable.
* @param v A property name.
*/
@@ -564,17 +559,17 @@ interface ObjectConstructor {
getOwnPropertySymbols(o: any): symbol[];
/**
* Gets the own property descriptor of the specified object.
* An own property descriptor is one that is defined directly on the object and is not
* inherited from the object's prototype.
* Gets the own property descriptor of the specified object.
* An own property descriptor is one that is defined directly on the object and is not
* inherited from the object's prototype.
* @param o Object that contains the property.
* @param p Name of the property.
*/
getOwnPropertyDescriptor(o: any, propertyKey: PropertyKey): PropertyDescriptor;
/**
* Adds a property to an object, or modifies attributes of an existing property.
* @param o Object on which to add or modify the property. This can be a native JavaScript
* Adds a property to an object, or modifies attributes of an existing property.
* @param o Object on which to add or modify the property. This can be a native JavaScript
* object (that is, a user-defined object or a built in object) or a DOM object.
* @param p The property name.
* @param attributes Descriptor for the property. It can be for a data property or an accessor
@@ -693,17 +688,17 @@ interface Array<T> {
/** Iterator */
[Symbol.iterator](): IterableIterator<T>;
/**
/**
* Returns an array of key, value pairs for every entry in the array
*/
entries(): IterableIterator<[number, T]>;
/**
/**
* Returns an list of keys in the array
*/
keys(): IterableIterator<number>;
/**
/**
* Returns an list of values in the array
*/
values(): IterableIterator<T>;
@@ -776,21 +771,21 @@ interface Promise<T> {
}
interface PromiseConstructor {
/**
* A reference to the prototype.
/**
* A reference to the prototype.
*/
prototype: Promise<any>;
/**
* Creates a new Promise.
* @param executor A callback used to initialize the promise. This callback is passed two arguments:
* a resolve callback used resolve the promise with a value or the result of another promise,
* @param executor A callback used to initialize the promise. This callback is passed two arguments:
* a resolve callback used resolve the promise with a value or the result of another promise,
* and a reject callback used to reject the promise with a provided reason or error.
*/
new <T>(executor: (resolve: (value?: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void): Promise<T>;
/**
* Creates a Promise that is resolved with an array of results when all of the provided Promises
* Creates a Promise that is resolved with an array of results when all of the provided Promises
* resolve, or rejected when any Promise is rejected.
* @param values An array of Promises.
* @returns A new Promise.
@@ -798,7 +793,7 @@ interface PromiseConstructor {
all<T>(values: Iterable<T | PromiseLike<T>>): Promise<T[]>;
/**
* Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
* Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
* or rejected.
* @param values An array of Promises.
* @returns A new Promise.
@@ -859,7 +854,7 @@ declare module Reflect {
// #############################################################################################
// ECMAScript 7
// Modules: es7.array.includes, es7.string.at, es7.string.lpad, es7.string.rpad,
// Modules: es7.array.includes, es7.string.at, es7.string.lpad, es7.string.rpad,
// es7.object.to-array, es7.object.get-own-property-descriptors, es7.regexp.escape,
// es7.map.to-json, and es7.set.to-json
// #############################################################################################
@@ -918,14 +913,14 @@ interface ArrayConstructor {
*/
join<T>(array: ArrayLike<T>, separator?: string): string;
/**
* Reverses the elements in an Array.
* Reverses the elements in an Array.
*/
reverse<T>(array: ArrayLike<T>): T[];
/**
* Removes the first element from an array and returns it.
*/
shift<T>(array: ArrayLike<T>): T;
/**
/**
* Returns a section of an array.
* @param start The beginning of the specified portion of the array.
* @param end The end of the specified portion of the array.
@@ -988,21 +983,21 @@ interface ArrayConstructor {
/**
* Performs the specified action for each element in an array.
* @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.
* @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
*/
forEach<T>(array: ArrayLike<T>, callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void;
/**
* Calls a defined callback function on each element of an array, and returns an array that contains the results.
* @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.
* @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
*/
map<T, U>(array: ArrayLike<T>, callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[];
/**
* Returns the elements of an array that meet the condition specified in a callback function.
* @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array.
* Returns the elements of an array that meet the condition specified in a callback function.
* @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array.
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
*/
filter<T>(array: ArrayLike<T>, callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): T[];
@@ -1021,53 +1016,53 @@ interface ArrayConstructor {
*/
reduce<T>(array: ArrayLike<T>, callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T;
/**
/**
* Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
* @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
* @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
* @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
*/
reduceRight<T, U>(array: ArrayLike<T>, callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
/**
/**
* Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
* @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
* @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
* @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
*/
reduceRight<T>(array: ArrayLike<T>, callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T;
/**
/**
* Returns an array of key, value pairs for every entry in the array
*/
entries<T>(array: ArrayLike<T>): IterableIterator<[number, T]>;
/**
/**
* Returns an list of keys in the array
*/
keys<T>(array: ArrayLike<T>): IterableIterator<number>;
/**
/**
* Returns an list of values in the array
*/
values<T>(array: ArrayLike<T>): IterableIterator<T>;
/**
* Returns the value of the first element in the array where predicate is true, and undefined
/**
* Returns the value of the first element in the array where predicate is true, and undefined
* otherwise.
* @param predicate find calls predicate once for each element of the array, in ascending
* order, until it finds one where predicate returns true. If such an element is found, find
* @param predicate find calls predicate once for each element of the array, in ascending
* order, until it finds one where predicate returns true. If such an element is found, find
* immediately returns that element value. Otherwise, find returns undefined.
* @param thisArg If provided, it will be used as the this value for each invocation of
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
find<T>(array: ArrayLike<T>, predicate: (value: T, index: number, obj: Array<T>) => boolean, thisArg?: any): T;
/**
* Returns the index of the first element in the array where predicate is true, and undefined
/**
* Returns the index of the first element in the array where predicate is true, and undefined
* otherwise.
* @param predicate find calls predicate once for each element of the array, in ascending
* order, until it finds one where predicate returns true. If such an element is found, find
* @param predicate find calls predicate once for each element of the array, in ascending
* order, until it finds one where predicate returns true. If such an element is found, find
* immediately returns that element value. Otherwise, find returns undefined.
* @param thisArg If provided, it will be used as the this value for each invocation of
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
findIndex<T>(array: ArrayLike<T>, predicate: (value: T) => boolean, thisArg?: any): number;
@@ -1075,21 +1070,21 @@ interface ArrayConstructor {
/**
* Returns the this object after filling the section identified by start and end with value
* @param value value to fill array section with
* @param start index to start filling the array at. If start is negative, it is treated as
* length+start where length is the length of the array.
* @param end index to stop filling the array at. If end is negative, it is treated as
* @param start index to start filling the array at. If start is negative, it is treated as
* length+start where length is the length of the array.
* @param end index to stop filling the array at. If end is negative, it is treated as
* length+end.
*/
fill<T>(array: ArrayLike<T>, value: T, start?: number, end?: number): T[];
/**
/**
* Returns the this object after copying a section of the array identified by start and end
* to the same array starting at position target
* @param target If target is negative, it is treated as length+target where length is the
* length of the array.
* @param start If start is negative, it is treated as length+start. If end is negative, it
* @param target If target is negative, it is treated as length+target where length is the
* length of the array.
* @param start If start is negative, it is treated as length+start. If end is negative, it
* is treated as length+end.
* @param end If not specified, length of the this object is used as its default value.
* @param end If not specified, length of the this object is used as its default value.
*/
copyWithin<T>(array: ArrayLike<T>, target: number, start: number, end?: number): T[];
@@ -1113,7 +1108,7 @@ interface ObjectConstructor {
* Non-standard.
*/
classof(value: any): string;
/**
* Non-standard.
*/
@@ -1477,13 +1472,13 @@ declare module core {
}
declare module "core-js" {
export = core;
export = core;
}
declare module "core-js/shim" {
export = core;
export = core;
}
declare module "core-js/core" {
export = core;
export = core;
}
declare module "core-js/core/$for" {
import $for = core.$for;
@@ -2149,10 +2144,10 @@ declare module "core-js/fn/symbol/unscopables" {
export = unscopables;
}
declare module "core-js/es5" {
export = core;
export = core;
}
declare module "core-js/es6" {
export = core;
export = core;
}
declare module "core-js/es6/array" {
var Array: typeof core.Array;
@@ -2211,7 +2206,7 @@ declare module "core-js/es6/weak-set" {
export = WeakSet;
}
declare module "core-js/es7" {
export = core;
export = core;
}
declare module "core-js/es7/array" {
var Array: typeof core.Array;
@@ -2238,32 +2233,32 @@ declare module "core-js/es7/string" {
export = String;
}
declare module "core-js/js" {
export = core;
export = core;
}
declare module "core-js/js/array" {
var Array: typeof core.Array;
export = Array;
}
declare module "core-js/web" {
export = core;
export = core;
}
declare module "core-js/web/dom" {
export = core;
export = core;
}
declare module "core-js/web/immediate" {
export = core;
export = core;
}
declare module "core-js/web/timers" {
export = core;
export = core;
}
declare module "core-js/libary" {
export = core;
export = core;
}
declare module "core-js/libary/shim" {
export = core;
export = core;
}
declare module "core-js/libary/core" {
export = core;
export = core;
}
declare module "core-js/libary/core/$for" {
import $for = core.$for;
@@ -2928,10 +2923,10 @@ declare module "core-js/libary/fn/symbol/unscopables" {
export = unscopables;
}
declare module "core-js/libary/es5" {
export = core;
export = core;
}
declare module "core-js/libary/es6" {
export = core;
export = core;
}
declare module "core-js/libary/es6/array" {
var Array: typeof core.Array;
@@ -2990,7 +2985,7 @@ declare module "core-js/libary/es6/weak-set" {
export = WeakSet;
}
declare module "core-js/libary/es7" {
export = core;
export = core;
}
declare module "core-js/libary/es7/array" {
var Array: typeof core.Array;
@@ -3017,21 +3012,21 @@ declare module "core-js/libary/es7/string" {
export = String;
}
declare module "core-js/libary/js" {
export = core;
export = core;
}
declare module "core-js/libary/js/array" {
var Array: typeof core.Array;
export = Array;
}
declare module "core-js/libary/web" {
export = core;
export = core;
}
declare module "core-js/libary/web/dom" {
export = core;
export = core;
}
declare module "core-js/libary/web/immediate" {
export = core;
export = core;
}
declare module "core-js/libary/web/timers" {
export = core;
export = core;
}
+30 -24
View File
@@ -52,11 +52,11 @@ declare module CryptoJS{
init(cfg?: C): void
create(cfg?: C): IHasher<C>
update(messageUpdate: WordArray): Hasher
update(messageUpdate: string): Hasher
update(messageUpdate: WordArray): Hasher
finalize(messageUpdate?: WordArray): WordArray
finalize(messageUpdate?: string): WordArray
finalize(messageUpdate?: WordArray): WordArray
blockSize: number
@@ -69,16 +69,16 @@ declare module CryptoJS{
//tparam C - Configuration type
interface IHasherHelper<C>{
(message: WordArray, cfg?: C): WordArray
(message: string, cfg?: C): WordArray
(message: WordArray, cfg?: C): WordArray
}
interface HasherHelper extends IHasherHelper<Object>{}
interface IHasherHmacHelper{
(message: WordArray, key: WordArray): WordArray
(message: string, key: string): WordArray
(message: string, key: WordArray): WordArray
(message: WordArray, key: string): WordArray
(message: string, key: string): WordArray
(message: WordArray, key: WordArray): WordArray
}
//tparam C - Configuration type
@@ -90,11 +90,11 @@ declare module CryptoJS{
create(xformMode?: number, key?: WordArray, cfg?: C): ICipher<C>
init(xformMode?: number, key?: WordArray, cfg?: C): void
process(dataUpdate: WordArray): WordArray
process(dataUpdate: string): WordArray
process(dataUpdate: WordArray): WordArray
finalize(dataUpdate?: WordArray): WordArray
finalize(dataUpdate?: string): WordArray
finalize(dataUpdate?: WordArray): WordArray
keySize: number
ivSize: number
@@ -127,12 +127,13 @@ declare module CryptoJS{
//BlockCipher has interface same as IStreamCipher
interface BlockCipher extends IStreamCipher<IBlockCipherCfg>{}
interface IBlockCipherCfg{
interface IBlockCipherCfg {
iv?: WordArray;
mode?: mode.IBlockCipherModeImpl //default CBC
padding?: pad.IPaddingImpl //default Pkcs7
}
interface CipherParamsData{
interface CipherParamsData {
ciphertext?: lib.WordArray
key?: lib.WordArray
iv?: lib.WordArray
@@ -163,6 +164,9 @@ declare module CryptoJS{
interface SerializableCipher extends ISerializableCipher<ISerializableCipherCfg>{}
interface ISerializableCipherCfg{
format?: format.IFormatter //default OpenSSLFormatter
iv?: WordArray;
mode?: mode.IBlockCipherModeImpl;
padding?: pad.IPaddingImpl;
}
interface IPasswordBasedCipher<C extends IPasswordBasedCipherCfg> extends Base{
@@ -177,19 +181,21 @@ declare module CryptoJS{
interface PasswordBasedCipher extends IPasswordBasedCipher<IPasswordBasedCipherCfg>{}
interface IPasswordBasedCipherCfg extends ISerializableCipherCfg{
kdf?: kdf.IKdfImpl //default OpenSSLKdf
mode?: mode.IBlockCipherModeImpl;
padding?: pad.IPaddingImpl;
}
/** see Cipher._createHelper */
interface ICipherHelper<C>{
encrypt(message: WordArray, key: WordArray, cfg?: C): CipherParams
encrypt(message: string, password: string, cfg?: C): CipherParams
encrypt(message: string, key: WordArray, cfg?: C): CipherParams
encrypt(message: WordArray, password: string, cfg?: C): CipherParams
encrypt(message: string, password: string, cfg?: C): CipherParams
encrypt(message: WordArray, key: WordArray, cfg?: C): CipherParams
decrypt(ciphertext: CipherParamsData, key: WordArray, cfg?: C): WordArray
decrypt(ciphertext: string, password: string, cfg?: C): WordArray
decrypt(ciphertext: string, key: WordArray, cfg?: C): WordArray
decrypt(ciphertext: CipherParamsData, password: string, cfg?: C): WordArray
decrypt(ciphertext: string, password: string, cfg?: C): WordArray
decrypt(ciphertext: CipherParamsData, key: WordArray, cfg?: C): WordArray
}
interface CipherHelper extends ICipherHelper<Object>{}
@@ -228,8 +234,8 @@ declare module CryptoJS{
}
interface IKdfImpl{
execute(password: string, keySize: number, ivSize: number, salt?: lib.WordArray): lib.CipherParams
execute(password: string, keySize: number, ivSize: number, salt?: string): lib.CipherParams
execute(password: string, keySize: number, ivSize: number, salt?: lib.WordArray): lib.CipherParams
}
}
@@ -277,8 +283,8 @@ declare module CryptoJS{
encryptBlock(M: number[], offset: number): void
decryptBlock(M: number[], offset: number): void
createEncryptor(key: lib.WordArray, cfg?: lib.IBlockCipherCfg): IBlockCipherImpl
createDecryptor(key: lib.WordArray, cfg?: lib.IBlockCipherCfg): IBlockCipherImpl
createEncryptor(key: lib.WordArray, cfg?: lib.CipherParamsData): IBlockCipherImpl
createDecryptor(key: lib.WordArray, cfg?: lib.CipherParamsData): IBlockCipherImpl
create(xformMode?: number, key?: lib.WordArray, cfg?: lib.IBlockCipherCfg): IBlockCipherImpl
}
@@ -305,26 +311,26 @@ declare module CryptoJS{
}
interface HMAC extends lib.Base{
init(hasher?: lib.Hasher, key?: lib.WordArray): void
init(hasher?: lib.Hasher, key?: string): void
create(hasher?: lib.Hasher, key?: lib.WordArray): HMAC
init(hasher?: lib.Hasher, key?: lib.WordArray): void
create(hasher?: lib.Hasher, key?: string): HMAC
create(hasher?: lib.Hasher, key?: lib.WordArray): HMAC
update(messageUpdate: lib.WordArray): HMAC
update(messageUpdate: string): HMAC
update(messageUpdate: lib.WordArray): HMAC
finalize(messageUpdate?: lib.WordArray): lib.WordArray
finalize(messageUpdate?: string): lib.WordArray
finalize(messageUpdate?: lib.WordArray): lib.WordArray
}
interface EvpKDF extends lib.Base{
cfg: IEvpKDFCfg
init(cfg?: IEvpKDFCfg): void
create(cfg?: IEvpKDFCfg): EvpKDF
compute(password: lib.WordArray, salt: lib.WordArray): lib.WordArray
compute(password: string, salt: string): lib.WordArray
compute(password: string, salt: lib.WordArray): lib.WordArray
compute(password: lib.WordArray, salt: string): lib.WordArray
compute(password: string, salt: string): lib.WordArray
compute(password: lib.WordArray, salt: lib.WordArray): lib.WordArray
}
interface IEvpKDFCfg{
keySize?: number //default 128/32
@@ -332,10 +338,10 @@ declare module CryptoJS{
iterations?: number //default 1
}
interface IEvpKDFHelper{
(password: lib.WordArray, salt: lib.WordArray, cfg?: IEvpKDFCfg): lib.WordArray
(password: string, salt: string, cfg?: IEvpKDFCfg): lib.WordArray
(password: string, salt: lib.WordArray, cfg?: IEvpKDFCfg): lib.WordArray
(password: lib.WordArray, salt: string, cfg?: IEvpKDFCfg): lib.WordArray
(password: string, salt: string, cfg?: IEvpKDFCfg): lib.WordArray
(password: lib.WordArray, salt: lib.WordArray, cfg?: IEvpKDFCfg): lib.WordArray
}
interface PBKDF2 extends EvpKDF{} //PBKDF2 is same as EvpKDF
+1 -1
View File
@@ -50,7 +50,7 @@ YUI.add('algo-aes-test', function (Y) {
var expectedKey = key.toString();
var expectedIv = iv.toString();
C.AES.encrypt(message, key, { iv: iv });
C.AES.encrypt(message, key, { iv });
Y.Assert.areEqual(expectedMessage, message.toString());
Y.Assert.areEqual(expectedKey, key.toString());
+1 -1
View File
@@ -74,7 +74,7 @@ YUI.add('algo-des-test', function (Y) {
var expectedKey = key.toString();
var expectedIv = iv.toString();
C.DES.encrypt(message, key, { iv: iv });
C.DES.encrypt(message, key, { iv });
Y.Assert.areEqual(expectedMessage, message.toString());
Y.Assert.areEqual(expectedKey, key.toString());
+1 -1
View File
@@ -58,7 +58,7 @@ YUI.add('algo-tripledes-test', function (Y) {
var expectedKey = key.toString();
var expectedIv = iv.toString();
C.TripleDES.encrypt(message, key, { iv: iv });
C.TripleDES.encrypt(message, key, { iv });
Y.Assert.areEqual(expectedMessage, message.toString());
Y.Assert.areEqual(expectedKey, key.toString());
+1 -1
View File
@@ -922,7 +922,7 @@ module forcedBasedLabelPlacemant {
var nodes: Node[] = [];
var labelAnchors: LabelAnchor[] = [];
var labelAnchorLinks: { source: number; target: number }[] = [];
var labelAnchorLinks: { source: number; target: number; weight: number }[] = [];
var links: typeof labelAnchorLinks = [];
for (var i = 0; i < 30; i++) {
File diff suppressed because it is too large Load Diff
+60 -75
View File
@@ -5,7 +5,7 @@ module Tests.ui {
activeStateEnabled: true,
allowColumnReordering: true,
allowColumnResizing: true,
onCellClick: function () { },
onCellClick: function() { },
cellHintEnabled: true,
columnAutoWidth: true,
columnChooser: {
@@ -17,67 +17,52 @@ module Tests.ui {
},
columns: [
{
text: '5 columns with custom css class', value: [
{ dataField: 'Processed', dataType: 'boolean', allowSorting: false },
{ dataField: 'CustomerID', cssClass: 'customCssClass' },
'OrderDate',
{ dataField: 'Freight', validationRules: [{ type: "range", min: 1, max: 100 }] },
{ dataField: 'ShipName', validationRules: [{ type: 'required' }] },
'ShipCity']
},
{
text: 'with show editor always', value: [
{ dataField: 'Processed', dataType: 'boolean', allowSorting: false, showEditorAlways: true },
{ dataField: 'OrderDate', dataType: 'date', showEditorAlways: true },
{ dataField: 'CustomerID', showEditorAlways: true },
{ dataField: 'Freight', showEditorAlways: true },
{ dataField: 'ShipName', showEditorAlways: true }]
},
{
text: 'custom template/edit/header template', value: [
'CustomerID',
'OrderDate',
'Freight',
{
dataField: 'ShipVia',
editCellTemplate: function (container: JQuery, options: { value: number }) {
container.addClass('dx-editor-cell');
container.append($('<div />').dxSelectBox({
value: options.value,
dataSource: [
{ ShipperID: 1, CompanyName: 'Speedy Express' },
{ ShipperID: 2, CompanyName: 'United Package' },
{ ShipperID: 3, CompanyName: 'Federal Shipping' }
],
valueExpr: 'ShipperID',
displayExpr: 'CompanyName'
}));
},
cellTemplate: function (container: JQuery, options: { value: number }) {
container.text(String(options.value));
},
headerCellTemplate: function (container: JQuery, options: { headerCaption: string }) {
container.append($('<div/>').css({ border: '1px solid red' }).text(options.headerCaption));
}
},
'ShipName',
'ShipCity']
},
{ text: 'none', value: '' },
{
text: 'custom template/header hogan template', value: [
'CustomerID',
'OrderDate',
'Freight',
{
dataField: 'ShipVia',
cellTemplate: '#hoganColumnTemplate',
headerCellTemplate: $('#hoganHeaderColumnTemplate')
},
'ShipName',
'ShipCity']
}],
customizeColumns: function (columns) {
alignment: "center",
allowFixing: true,
allowEditing: true,
allowFiltering: true,
allowGrouping: true,
allowHiding: true,
allowReordering: true,
allowResizing: true,
allowSearch: true,
allowSorting: true,
autoExpandGroup: true,
calculateCellValue: function(rowData: Object) { return "test-value"; },
calculateFilterExpression: function(filterValue: any, selectedFilterOperation: string) { return []; },
caption: "Test column",
cellTemplate: function(container: JQuery, options: Object) { $("<span>Template</span>").appendTo(container); },
cssClass: "test-ccs-class-name",
customizeText: function(cellInfo: { value: any, valueText: string; }) { return "New text" },
dataField: "Test",
dataType: "string",
encodeHtml: true,
falseText: "FALSE",
filterOperations: ["contains", "notcontains"],
filterType: "exclude",
filterValue: "Test-filter-value",
fixed: true,
fixedPosition: "right",
groupIndex: 0,
lookup: {
allowClearing: true,
dataSource: ["first", "second"],
displayExpr: "this",
valueExpr: "this"
},
name: "test-column-name",
showEditorAlways: true,
showInColumnChooser: true,
showWhenGrouped: true,
sortIndex: 1,
sortOrder: "desc",
trueText: "TRUE",
visible: true,
visibleIndex: 0,
width: "100%"
}
],
customizeColumns: function(columns) {
var i: number;
for (i = 0; i < columns.length; i++) {
if (columns[i].dataField.indexOf('Date') > 0) {
@@ -94,16 +79,16 @@ module Tests.ui {
valueExpr: 'CustomerID',
displayExpr: 'ContactName'
}
}
}
if (columns[i].dataField === 'EmployeeID') {
columns[i].lookup = {
dataSource: { store: [], sort: 'LastName' },
valueExpr: 'EmployeeID',
displayExpr: function (data: any) {
displayExpr: function(data: any) {
return data.LastName + ' ' + data.FirstName;
}
}
}
}
if (columns[i].dataField === 'ShipVia') {
columns[i].lookup = {
dataSource: [
@@ -114,14 +99,14 @@ module Tests.ui {
valueExpr: 'ShipperID',
displayExpr: 'CompanyName'
}
}
}
if (columns[i].dataField === 'ShipCity') {
columns[i].editCellTemplate = function (container: JQuery, options: { value: string; setValue: Function }) {
columns[i].editCellTemplate = function(container: JQuery, options: { value: string; setValue: Function }) {
$('<div/>').dxAutocomplete({
items: ["Bern", "Lyon", "Lander"],
dataSource: ["Bern", "Lyon", "Lander"],
value: options.value,
onValueChange: function (e:{ value: string }) {
options.setValue(e.value);
onValueChanged: function() {
options.setValue("test-value");
}
}).appendTo(container);
}
@@ -242,10 +227,10 @@ module Tests.viz {
{ valueField: 's8' }
],
title: 'Long Chart\'s Title',
onPointClick: function (arg: any) {
onPointClick: function(arg: any) {
arg.target.isSelected() ? arg.target.clearSelection() : arg.target.select();
},
onSeriesClick: function (arg: any) {
onSeriesClick: function(arg: any) {
arg.target.isVisible() ? arg.target.hide() : arg.target.show();
}
};
@@ -313,8 +298,8 @@ module Tests.data {
pageSize: 25,
paginate: true,
map: function (item) { return item; },
postProcess: function (data) { return data; },
map: function(item) { return item; },
postProcess: function(data) { return data; },
searchExpr: "expr",
searchOperation: "contains",
searchValue: "somevalue",
@@ -328,7 +313,7 @@ module Tests.data {
});
new DevExpress.data.CustomStore(<DevExpress.data.CustomStoreOptions>{
load: function () {
load: function() {
return $.Deferred().promise();
}
});
+330 -203
View File
@@ -1,4 +1,4 @@
// Type definitions for DevExtreme 15.1.5
// Type definitions for DevExtreme 15.1.6
// Project: http://js.devexpress.com/
// Definitions by: DevExpress Inc. <http://devexpress.com/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -35,7 +35,7 @@ declare module DevExpress {
brokenRules: any[];
validators: IValidator[];
}
export interface GroupConfig extends EventsMixin<GroupConfig> {
export interface GroupConfig extends EventsMixin<GroupConfig> {
group: any;
validators: IValidator[];
validate(): ValidationGroupValidationResult;
@@ -56,14 +56,14 @@ declare module DevExpress {
/** Validates the rules that are defined within the dxValidator objects that are registered for the specified ViewModel. */
export function validateModel(model: Object): ValidationGroupValidationResult;
/** Registers all the dxValidator objects by which the fields of the specified ViewModel are extended. */
export function registerModelForValidation(model: Object) : void;
export function registerModelForValidation(model: Object): void;
}
export var hardwareBackButton: JQueryCallback;
/** Processes the hardware back button click. */
export function processHardwareBackButton(): void;
/** Specifies whether or not the entire application/site supports right-to-left representation. */
export var rtlEnabled: boolean;
/** Registers a new component in the DevExpress.ui namespace, and a jQuery plugin and Knockout binding for the required component. */
/** Registers a new component in the DevExpress.ui namespace as a jQuery plugin, Angular directive and Knockout binding. */
export function registerComponent(name: string, componentClass: Object): void;
/** Registers a new component in the specified namespace as a jQuery plugin, Angular directive and Knockout binding. */
export function registerComponent(name: string, namespace: Object, componentClass: Object): void;
@@ -323,7 +323,7 @@ declare module DevExpress {
key(): any;
/** Returns the key of the Store item that matches the specified object. */
keyOf(obj: Object): any;
/** Starts loading the data. */
/** Starts loading data. */
load(obj?: LoadOptions): JQueryPromise<any[]>;
/** Removes the data item specified by the key. */
remove(key: any): JQueryPromise<any>;
@@ -427,6 +427,8 @@ declare module DevExpress {
select?: Object;
/** An array of the strings that represent the names of the navigation properties to be loaded simultaneously with the OData store's entity. */
expand?: Object;
/** Specifies whether or not the DataSource instance requests the total count of items available in the storage. */
requireTotalCount?: boolean;
/** Specifies the initial sort option value. */
sort?: Object;
/** Specifies the underlying Store instance used to access data. */
@@ -496,6 +498,10 @@ declare module DevExpress {
select(): Object;
/** Sets the select option value. */
select(expr: Object): void;
/** Returns the current requireTotalCount option value. */
requireTotalCount(): boolean;
/** Sets the requireTotalCount option value. */
requireTotalCount(value: boolean): void;
/** Returns the current sort option value. */
sort(): Object;
/** Sets the sort option value. */
@@ -817,11 +823,26 @@ declare module DevExpress {
export function setTemplateEngine(name: string): void;
/** Sets a custom template engine defined via custom compile and render functions. */
export function setTemplateEngine(options: Object): void;
/** An object that serves as a namespace for utility methods that can be helpful when working with the DevExtreme framework and UI widgets. */
export var utils: {
/** Sets parameters for the viewport meta tag. */
initMobileViewport(options: { allowZoom?: boolean; allowPan?: boolean; allowSelection?: boolean }): void;
};
}
/** An object that serves as a namespace for utility methods that can be helpful when working with the DevExtreme framework and UI widgets. */
export var utils: {
/** Sets parameters for the viewport meta tag. */
initMobileViewport(options: { allowZoom?: boolean; allowPan?: boolean; allowSelection?: boolean }): void;
};
/** An object that serves as a namespace for DevExtreme Data Visualization Widgets. */
export module viz {
/** Applies a theme for the entire page with several DevExtreme visualization widgets. */
export function currentTheme(theme: string): void;
/** Applies a new theme (with the color scheme defined separately) for the entire page with several DevExtreme visualization widgets. */
export function currentTheme(platform: string, colorScheme: string): void;
/** Registers a new theme based on the existing one. */
export function registerTheme(customTheme: Object, baseTheme: string): void;
/** Applies a predefined or registered custom palette to all visualization widgets at once. */
export function currentPalette(paletteName: string): void;
/** Obtains the color sets of a predefined or registered palette. */
export function getPalette(paletteName: string): Object;
/** Registers a new palette. */
export function registerPalette(paletteName: string, palette: Object): void;
}
}
declare module DevExpress.ui {
@@ -894,7 +915,7 @@ declare module DevExpress.ui {
constructor(element: JQuery, options?: dxTooltipOptions);
constructor(element: Element, options?: dxTooltipOptions);
}
export interface dxDropDownListOptions extends dxDropDownEditorOptions {
export interface dxDropDownListOptions extends dxDropDownEditorOptions, DataExpressionMixinOptions {
/** Returns the value currently displayed by the widget. */
displayValue?: string;
/** The minimum number of characters that must be entered into the text box to begin a search. */
@@ -1191,7 +1212,7 @@ declare module DevExpress.ui {
/** Updates the dimensions of the scrollable contents. */
update(): void;
}
export interface dxRadioGroupOptions extends CollectionWidgetOptions {
export interface dxRadioGroupOptions extends CollectionWidgetOptions, DataExpressionMixinOptions {
/** Specifies the radio group layout. */
layout?: string;
}
@@ -1747,9 +1768,9 @@ declare module DevExpress.ui {
/** A Globalize format string specifying the date display format. */
formatString?: string;
/** The last date that can be selected within the widget. */
max?: Date;
max?: any;
/** The minimum date that can be selected within the widget. */
min?: Date;
min?: any;
/** The text displayed by the widget when the widget value is not yet specified. This text is also used as a title of the date picker. */
placeholder?: string;
/**
@@ -1757,8 +1778,8 @@ declare module DevExpress.ui {
* @deprecated Use 'pickerType' option instead.
*/
useCalendar?: boolean;
/** A Date object specifying the date and time currently selected using the date box. */
value?: Date;
/** An object or a value, specifying the date and time currently selected using the date box. */
value?: any;
/**
* Specifies whether or not the widget uses the native HTML input element.
* @deprecated Use 'pickerType' option instead.
@@ -1768,7 +1789,7 @@ declare module DevExpress.ui {
interval?: number;
/** Specifies the maximum zoom level of a calendar, which is used to pick the date. */
maxZoomLevel?: string;
/** Specifies the minimal zoom level of a calendar, which is used to pick the date. */
/** Specifies the minimal zoom level of a calendar, which is used to pick the date. */
minZoomLevel?: string;
/** Specifies the type of date/time picker. */
pickerType?: string;
@@ -1806,8 +1827,8 @@ declare module DevExpress.ui {
maxZoomLevel?: string;
/** Specifies the minimum zoom level of the calendar. */
minZoomLevel?: string;
/** The template to be used for rendering calendar cells. */
cellTemplate?: any;
/** The template to be used for rendering calendar cells. */
cellTemplate?: any;
}
/** A calendar widget. */
export class dxCalendar extends Editor {
@@ -1848,7 +1869,7 @@ declare module DevExpress.ui {
/** A container widget used to arrange inner elements. */
export class dxBox extends CollectionWidget {
constructor(element: JQuery, options?: dxBoxOptions);
constructor(element: Element, options?: dxBoxOptions);
constructor(element: Element, options?: dxBoxOptions);
}
export interface dxResponsiveBoxOptions extends CollectionWidgetOptions {
/** Specifies the collection of rows for the grid used to position layout elements. */
@@ -1866,14 +1887,77 @@ declare module DevExpress.ui {
constructor(element: Element, options?: dxBoxOptions);
}
export interface dxAutocompleteOptions extends dxDropDownListOptions {
/** Specifies the current value displayed by the widget. */
value?: string;
/** The minimum number of characters that must be entered into the text box to begin a search. */
minSearchLength?: number;
accessKey?: string;
activeStateEnabled?: boolean;
attr?: any;
dataSource?: any;
disabled?: boolean;
displayValue?: string;
fieldEditEnabled?: boolean;
focusStateEnabled?: boolean;
height?: string | number | (() => string | number);
hint?: string;
hoverStateEnabled?: boolean;
isValid?: boolean;
items?: any[];
/**
* The template to be used for rendering items.
* Defaults Value: "item"
*/
itemTemplate?: string | Node | JQuery | (() => string | Node | JQuery);
/** Specifies the maximum count of items displayed by the widget. */
maxItemCount?: number;
maxLength?: string | number;
/** The minimum number of characters that must be entered into the text box to begin a search. */
minSearchLength?: number;
mode?: string; // "text" | "email" | "search" | "tel" | "url" | "password"
onChange?: (e: { component: any; element: JQuery; model: any; event: JQueryEventObject }) => void;
onClosed?: (e: { component: any; element: JQuery; model: any }) => void;
onContentReady?: (e: { component: any; element: JQuery; model: any }) => void;
onCopy?: (e: { component: any; element: JQuery; model: any; event: JQueryEventObject }) => void;
onCut?: (e: { component: any; element: JQuery; model: any; event: JQueryEventObject }) => void;
onDisposing?: (e: { component: any; element: JQuery; model: any }) => void;
onEnterKey?: (e: { component: any; element: JQuery; model: any; event: JQueryEventObject }) => void;
onFocusIn?: (e: { component: any; element: JQuery; model: any; event: JQueryEventObject }) => void;
onFocusOut?: (e: { component: any; element: JQuery; model: any; event: JQueryEventObject }) => void;
onInitialized?: (e: { component: any; element: JQuery }) => void;
onInput?: (e: { component: any; element: JQuery; model: any; event: JQueryEventObject }) => void;
onItemClick?: (e: { component: any; element: JQuery; model: any; itemElement: HTMLElement }) => void;
onKeyDown?: (e: { component: any; element: JQuery; model: any; event: JQueryEventObject }) => void;
onKeyPress?: (e: { component: any; element: JQuery; model: any; event: JQueryEventObject }) => void;
onKeyUp?: (e: { component: any; element: JQuery; model: any; event: JQueryEventObject }) => void;
onOpened?: (e: { component: any; element: JQuery; model: any }) => void;
onOptionChanged?: (e: { component: any; element: JQuery; model: any; value: any }) => void;
onPaste?: (e: { component: any; element: JQuery; model: any; event: JQueryEventObject }) => void;
onSelectionChanged?: (e: { component: any; element: JQuery; model: any; selectedItem: any }) => void;
onValueChanged?: (e: { component: any; element: JQuery; model: any; value: any; previousValue: any; itemData: any; jQueryEvent: JQueryEventObject }) => void;
opened?: boolean;
placeholder?: string;
readOnly?: boolean;
rtlEnabled?: boolean;
searchExpr?: string;
searchMode?: string; // "contains" | "startswith"
searchTimeout?: number;
/** Gets the currently selected item. */
selectedItem?: Object;
selectedItem?: any;
showClearButton?: boolean;
spellcheck?: boolean;
tabIndex?: number;
text?: string;
validationError?: any;
validationMessageMode?: string; // "auto" | "always"
/** Specifies the current value displayed by the widget. */
value?: string;
/**
* CAn be any DOM event names separated by spaces.
*/
valueChangeEvent?: string;
valueExpr?: string | Function;
visible?: boolean;
width?: string | number | (() => string | number);
}
/** A textbox widget that supports autocompletion. */
export class dxAutocomplete extends dxDropDownList {
@@ -2661,6 +2745,8 @@ declare module DevExpress.ui {
updateAppointment(target: Object, appointment: Object): void;
/** Deletes the appointment defined by the parameter from the the data associated with the widget. */
deleteAppointment(appointment: Object): void;
/** Scrolls the scheduler work space to the specified time. */
scrollToTime(hours: number, minutes: number): void;
}
export interface dxColorBoxOptions extends dxDropDownEditorOptions {
/** Specifies the text displayed on the button that applies changes and closes the drop-down editor. */
@@ -2735,6 +2821,10 @@ declare module DevExpress.ui {
onItemExpanded?: Function;
/** A handler for the itemCollapsed event. */
onItemCollapsed?: Function;
onItemClick?: Function;
onItemContextMenu?: Function;
onItemRendered?: Function;
onItemHold?: Function;
hoverStateEnabled?: boolean;
focusStateEnabled?: boolean;
}
@@ -2951,9 +3041,9 @@ declare module DevExpress.ui {
lookup?: {
/** Specifies whether or not a user can nullify values of a lookup column. */
allowClearing?: boolean;
/**
Specifies the data source providing data for a lookup column.
*/
/**
* Specifies the data source providing data for a lookup column.
*/
dataSource?: any;
/** Specifies the expression defining the data source field whose values must be displayed. */
displayExpr?: any;
@@ -2986,6 +3076,9 @@ Specifies the data source providing data for a lookup column.
showInColumnChooser?: boolean;
/** Specifies the identifier of the column. */
name?: string;
// NOTE https://github.com/borisyankov/DefinitelyTyped/pull/5590
text?: string;
value?: any;
}
export interface dxDataGridOptions extends WidgetOptions {
/** Specifies whether the outer borders of the grid are visible or not. */
@@ -3081,10 +3174,10 @@ Specifies the data source providing data for a lookup column.
cancel?: string;
}
};
/**
An array of grid columns.
*/
columns?: Array<dxDataGridColumn>;
/**
* An array of grid columns.
*/
columns?: dxDataGridColumn[];
onContentReady?: Function;
contentReadyAction?: Function;
/** Specifies a function that customizes grid columns after they are created. */
@@ -3181,9 +3274,9 @@ An array of grid columns.
autoExpandAll?: boolean;
/** Specifies the message displayed in a group row when the corresponding group is continued from the previous page. */
groupContinuedMessage?: string;
/**
Specifies the message displayed in a group row when the corresponding group continues on the next page.
*/
/**
* Specifies the message displayed in a group row when the corresponding group continues on the next page.
*/
groupContinuesMessage?: string;
};
/** Specifies options that configure the group panel. */
@@ -3563,9 +3656,9 @@ Specifies the message displayed in a group row when the corresponding group cont
removeRow(rowIndex: number): void;
/** Saves changes made in a grid. */
saveEditData(): void;
/**
Searches grid records by a search string.
*/
/**
* Searches grid records by a search string.
*/
searchByText(text: string): void;
/** Selects all grid records. */
selectAll(): void;
@@ -3795,6 +3888,8 @@ declare module DevExpress.framework {
onExecute?: any;
/** Indicates whether or not the widget that displays this command is disabled. */
disabled?: boolean;
/** Specifies whether the current command should is rendered when a view is being rendered, or after a view has been shown. */
renderStage?: string;
/** Specifies the name of the icon shown inside the widget associated with this command. */
icon?: string;
iconSrc?: string;
@@ -4042,6 +4137,36 @@ declare module DevExpress.framework {
}
}
declare module DevExpress.viz.core {
/**
* Applies a theme for the entire page with several DevExtreme visualization widgets.
* @deprecated Use the DevExpress.viz.currentTheme(theme) method instead.
*/
export function currentTheme(theme: string): void;
/**
* Applies a new theme (with the color scheme defined separately) for the entire page with several DevExtreme visualization widgets.
* @deprecated Use the DevExpress.viz.currentTheme(platform, colorScheme) method instead.
*/
export function currentTheme(platform: string, colorScheme: string): void;
/**
* Registers a new theme based on the existing one.
* @deprecated Use the DevExpress.viz.registerTheme(customTheme, baseTheme) method instead.
*/
export function registerTheme(customTheme: Object, baseTheme: string): void;
/**
* Applies a predefined or registered custom palette to all visualization widgets at once.
* @deprecated Use the DevExpress.viz.currentPalette(paletteName) method instead.
*/
export function currentPalette(paletteName: string): void;
/**
* Obtains the color sets of a predefined or registered palette.
* @deprecated Use the DevExpress.viz.getPalette(paletteName) method instead.
*/
export function getPalette(paletteName: string): Object;
/**
* Registers a new palette.
* @deprecated Use the DevExpress.viz.registerPalette(paletteName, palette) method instead.
*/
export function registerPalette(paletteName: string, palette: Object): void;
export interface Border {
/** Sets a border color for a selected series. */
color?: string;
@@ -4210,16 +4335,16 @@ declare module DevExpress.viz.core {
}) => void;
/** A handler for the incidentOccurred event. */
onIncidentOccurred?: (
component: BaseWidget,
element: Element,
target: {
id: string;
type: string;
args: any;
text: string;
widget: string;
version: string;
}
component: BaseWidget,
element: Element,
target: {
id: string;
type: string;
args: any;
text: string;
widget: string;
version: string;
}
) => void;
/** Notifies a widget that it is embedded into an HTML page that uses a path modifier. */
pathModified?: boolean;
@@ -4245,7 +4370,7 @@ declare module DevExpress.viz.charts {
clearSelection(): void;
/** Gets the color of a particular series. */
getColor(): string;
/**
/**
* Gets a point from the series point collection based on the specified argument.
* @deprecated getPointsByArg(pointArg).md
*/
@@ -4450,8 +4575,8 @@ declare module DevExpress.viz.charts {
/** Specifies a precision for the percentage values displayed in the labels of a full-stacked-like series. */
percentPrecision?: number;
}
export interface BaseCommonSeriesConfig {
/** Specifies the data source field that provides arguments for series points. */
export interface BaseCommonSeriesConfig {
/** Specifies the data source field that provides arguments for series points. */
argumentField?: string;
axis?: string;
/** An object defining the label configuration options for a series in the dxChart widget. */
@@ -4511,83 +4636,83 @@ declare module DevExpress.viz.charts {
visible?: boolean;
/** Specifies a line width. */
width?: number;
/** Configures error bars. */
valueErrorBar?: {
/** Specifies whether error bars must be displayed in full or partially. */
displayMode?: string;
/** Specifies the data field that provides data for low error values. */
lowValueField?: string;
/** Specifies the data field that provides data for high error values. */
highValueField?: string;
/** Specifies how error bar values must be calculated. */
type?: string;
/** Specifies the value to be used for generating error bars. */
value?: number;
/** Specifies the color of error bars. */
color?: string;
/** Specifies the opacity of error bars. */
opacity?: number;
/** Specifies the length of the lines that indicate the error bar edges. */
edgeLength?: number;
/** Specifies the width of the error bar line. */
lineWidth?: number;
};
}
export interface CommonPointOptions {
/** Specifies border options for points in the line and area series. */
border?: viz.core.Border;
/** Specifies the points color. */
/** Configures error bars. */
valueErrorBar?: {
/** Specifies whether error bars must be displayed in full or partially. */
displayMode?: string;
/** Specifies the data field that provides data for low error values. */
lowValueField?: string;
/** Specifies the data field that provides data for high error values. */
highValueField?: string;
/** Specifies how error bar values must be calculated. */
type?: string;
/** Specifies the value to be used for generating error bars. */
value?: number;
/** Specifies the color of error bars. */
color?: string;
/** Specifies what series points to highlight when a point is hovered over. */
hoverMode?: string;
/** An object defining configuration options for a hovered point. */
hoverStyle?: {
/** An object defining the border options for a hovered point. */
border?: viz.core.Border;
/** Sets a color for a point when it is hovered over. */
color?: string;
/** Specifies the diameter of a hovered point in the series that represents data points as symbols (not as bars for instance). */
size?: number;
};
/** Specifies what series points to highlight when a point is selected. */
selectionMode?: string;
/** An object defining configuration options for a selected point. */
selectionStyle?: {
/** An object defining the border options for a selected point. */
border?: viz.core.Border;
/** <p>Sets a color for a point when it is selected.</p> */
color?: string;
/** Specifies the diameter of a selected point in the series that represents data points as symbols (not as bars for instance). */
size?: number;
};
/** Specifies the point diameter in pixels for those series that represent data points as symbols (not as bars for instance). */
/** Specifies the opacity of error bars. */
opacity?: number;
/** Specifies the length of the lines that indicate the error bar edges. */
edgeLength?: number;
/** Specifies the width of the error bar line. */
lineWidth?: number;
};
}
export interface CommonPointOptions {
/** Specifies border options for points in the line and area series. */
border?: viz.core.Border;
/** Specifies the points color. */
color?: string;
/** Specifies what series points to highlight when a point is hovered over. */
hoverMode?: string;
/** An object defining configuration options for a hovered point. */
hoverStyle?: {
/** An object defining the border options for a hovered point. */
border?: viz.core.Border;
/** Sets a color for a point when it is hovered over. */
color?: string;
/** Specifies the diameter of a hovered point in the series that represents data points as symbols (not as bars for instance). */
size?: number;
/** Specifies a symbol for presenting points of the line and area series. */
symbol?: string;
visible?: boolean;
}
export interface ChartCommonPointOptions extends CommonPointOptions {
/** An object specifying the parameters of an image that is used as a point marker. */
image?: {
/** Specifies the height of an image that is used as a point marker. */
height?: any;
/** Specifies a URL leading to the image to be used as a point marker. */
url?: any;
/** Specifies the width of an image that is used as a point marker. */
width?: any;
};
}
export interface PolarCommonPointOptions extends CommonPointOptions {
/** An object specifying the parameters of an image that is used as a point marker. */
image?: {
/** Specifies the height of an image that is used as a point marker. */
height?: number;
/** Specifies a URL leading to the image to be used as a point marker. */
url?: string;
/** Specifies the width of an image that is used as a point marker. */
width?: number;
};
}
};
/** Specifies what series points to highlight when a point is selected. */
selectionMode?: string;
/** An object defining configuration options for a selected point. */
selectionStyle?: {
/** An object defining the border options for a selected point. */
border?: viz.core.Border;
/** <p>Sets a color for a point when it is selected.</p> */
color?: string;
/** Specifies the diameter of a selected point in the series that represents data points as symbols (not as bars for instance). */
size?: number;
};
/** Specifies the point diameter in pixels for those series that represent data points as symbols (not as bars for instance). */
size?: number;
/** Specifies a symbol for presenting points of the line and area series. */
symbol?: string;
visible?: boolean;
}
export interface ChartCommonPointOptions extends CommonPointOptions {
/** An object specifying the parameters of an image that is used as a point marker. */
image?: {
/** Specifies the height of an image that is used as a point marker. */
height?: any;
/** Specifies a URL leading to the image to be used as a point marker. */
url?: any;
/** Specifies the width of an image that is used as a point marker. */
width?: any;
};
}
export interface PolarCommonPointOptions extends CommonPointOptions {
/** An object specifying the parameters of an image that is used as a point marker. */
image?: {
/** Specifies the height of an image that is used as a point marker. */
height?: number;
/** Specifies a URL leading to the image to be used as a point marker. */
url?: string;
/** Specifies the width of an image that is used as a point marker. */
width?: number;
};
}
/** An object that defines configuration options for chart series. */
export interface CommonSeriesConfig extends BaseCommonSeriesConfig {
/** Specifies the data source field that provides a 'close' value for a _candleStick_ or _stock_ series. */
@@ -4678,14 +4803,14 @@ declare module DevExpress.viz.charts {
/** Sets the series type. */
type?: string;
}
/** An object that defines configuration options for polar chart series. */
export interface CommonPolarSeriesConfig extends BaseCommonSeriesConfig {
/** Specifies whether or not to close the chart by joining the end point with the first point. */
/** An object that defines configuration options for polar chart series. */
export interface CommonPolarSeriesConfig extends BaseCommonSeriesConfig {
/** Specifies whether or not to close the chart by joining the end point with the first point. */
closed?: boolean;
label?: SeriesConfigLabel;
point?: PolarCommonPointOptions;
}
export interface CommonPolarSeriesSettings extends CommonPolarSeriesConfig {
}
export interface CommonPolarSeriesSettings extends CommonPolarSeriesConfig {
/** An object that specifies configuration options for all series of the <i>area</i> type in the chart. */
area?: CommonPolarSeriesConfig;
/** An object that specifies configuration options for all series of the _bar_ type in the chart. */
@@ -4783,7 +4908,7 @@ declare module DevExpress.viz.charts {
/** Specifies a data source field that represents the series name. */
nameField?: string;
}
export interface PolarSeriesTemplate {
export interface PolarSeriesTemplate {
/** Specifies a callback function that returns a series object with individual series settings. */
customizeSeries?: (seriesName: string) => PolarSeriesConfig;
/** Specifies a data source field that represents the series name. */
@@ -4800,18 +4925,18 @@ declare module DevExpress.viz.charts {
export interface PolarCommonConstantLineLabel {
/** Indicates whether or not to display labels for the axis constant lines. */
visible?: boolean;
/** Specifies font options for a constant line label. */
/** Specifies font options for a constant line label. */
font?: viz.core.Font;
}
export interface ConstantLineStyle {
/** Specifies a color for a constant line. */
}
export interface ConstantLineStyle {
/** Specifies a color for a constant line. */
color?: string;
/** Specifies a dash style for a constant line. */
dashStyle?: string;
/** Specifies a constant line width in pixels. */
width?: number;
}
export interface ChartCommonConstantLineStyle extends ConstantLineStyle {
}
export interface ChartCommonConstantLineStyle extends ConstantLineStyle {
/** An object defining constant line label options. */
label?: ChartCommonConstantLineLabel;
/** Specifies the space between the constant line label and the left/right side of the constant line. */
@@ -4819,24 +4944,24 @@ declare module DevExpress.viz.charts {
/** Specifies the space between the constant line label and the top/bottom side of the constant line. */
paddingTopBottom?: number;
}
export interface PolarCommonConstantLineStyle extends ConstantLineStyle {
/** An object defining constant line label options. */
export interface PolarCommonConstantLineStyle extends ConstantLineStyle {
/** An object defining constant line label options. */
label?: PolarCommonConstantLineLabel;
}
export interface CommonAxisLabel {
/** Specifies font options for axis labels. */
}
export interface CommonAxisLabel {
/** Specifies font options for axis labels. */
font?: viz.core.Font;
/** Specifies the spacing between an axis and its labels in pixels. */
indentFromAxis?: number;
/** Indicates whether or not axis labels are visible. */
visible?: boolean;
}
}
export interface ChartCommonAxisLabel extends CommonAxisLabel {
/** Specifies the label's position relative to the tick (grid line). */
alignment?: string;
/** Specifies the overlap resolving algorithm to be applied to axis labels. */
/** Specifies the overlap resolving algorithm to be applied to axis labels. */
overlappingBehavior?: {
/** Specifies how to arrange axis labels. */
/** Specifies how to arrange axis labels. */
mode?: string;
/** Specifies the angle used to rotate axis labels. */
rotationAngle?: number;
@@ -4848,7 +4973,7 @@ declare module DevExpress.viz.charts {
/** Specifies the overlap resolving algorithm to be applied to axis labels. */
overlappingBehavior?: string;
}
export interface CommonAxisTitle {
export interface CommonAxisTitle {
/** Specifies font options for an axis title. */
font?: viz.core.Font;
/** Specifies a margin for an axis title in pixels. */
@@ -4857,7 +4982,7 @@ declare module DevExpress.viz.charts {
export interface BaseCommonAxisSettings {
/** Specifies the color of the line that represents an axis. */
color?: string;
/** Specifies whether ticks/grid lines of a discrete axis are located between labels or cross the labels. */
/** Specifies whether ticks/grid lines of a discrete axis are located between labels or cross the labels. */
discreteAxisDivisionMode?: string;
/** An object defining the configuration options for the grid lines of an axis in the dxPolarChart widget. */
grid?: {
@@ -4870,7 +4995,7 @@ declare module DevExpress.viz.charts {
/** Specifies the width of grid lines. */
width?: number;
};
/** Specifies the options of the minor grid. */
/** Specifies the options of the minor grid. */
minorGrid?: {
/** Specifies a color for the lines of the minor grid. */
color?: string;
@@ -4896,7 +5021,7 @@ declare module DevExpress.viz.charts {
/** Indicates whether or not ticks are visible on an axis. */
visible?: boolean;
};
/** Specifies the options of the minor ticks. */
/** Specifies the options of the minor ticks. */
minorTick?: {
/** Specifies a color for the minor ticks. */
color?: string;
@@ -4910,18 +5035,18 @@ declare module DevExpress.viz.charts {
/** Specifies the width of the line that represents an axis in the chart. */
width?: number;
}
export interface ChartCommonAxisSettings extends BaseCommonAxisSettings {
export interface ChartCommonAxisSettings extends BaseCommonAxisSettings {
/** Specifies the appearance of all the widget's constant lines. */
constantLineStyle?: ChartCommonConstantLineStyle;
/** An object defining the label configuration options that are common for all axes in the dxChart widget. */
label?: ChartCommonAxisLabel;
/** Specifies a coefficient that determines the spacing between the maximum series point and the axis. */
maxValueMargin?: number;
maxValueMargin?: number;
/** Specifies a coefficient that determines the spacing between the minimum series point and the axis. */
minValueMargin?: number;
minValueMargin?: number;
/** Specifies, in pixels, the space reserved for an axis. */
placeholderSize?: number;
/** An object defining configuration options for strip style. */
/** An object defining configuration options for strip style. */
stripStyle?: {
/** An object defining the configuration options for a strip label style. */
label?: {
@@ -4942,7 +5067,7 @@ declare module DevExpress.viz.charts {
/** Indicates whether or not to display series with indents from axis boundaries. */
valueMarginsEnabled?: boolean;
}
export interface PolarCommonAxisSettings extends BaseCommonAxisSettings {
export interface PolarCommonAxisSettings extends BaseCommonAxisSettings {
/** Specifies the appearance of all the widget's constant lines. */
constantLineStyle?: PolarCommonConstantLineStyle;
/** An object defining the label configuration options that are common for all axes in the dxPolarChart widget. */
@@ -4964,22 +5089,22 @@ declare module DevExpress.viz.charts {
/** Specifies the text to be displayed in a constant line label. */
text?: string;
}
export interface PolarConstantLineLabel extends PolarCommonConstantLineLabel {
export interface PolarConstantLineLabel extends PolarCommonConstantLineLabel {
/** Specifies the text to be displayed in a constant line label. */
text?: string;
}
export interface AxisLabel {
/** Specifies the text for a hint that appears when a user hovers the mouse pointer over a label on the value axis. */
export interface AxisLabel {
/** Specifies the text for a hint that appears when a user hovers the mouse pointer over a label on the value axis. */
customizeHint?: (argument: { value: any; valueText: string }) => string;
/** Specifies a callback function that returns the text to be displayed in value axis labels. */
/** Specifies a callback function that returns the text to be displayed in value axis labels. */
customizeText?: (argument: { value: any; valueText: string }) => string;
/** Specifies a format for the text displayed by axis labels. */
/** Specifies a format for the text displayed by axis labels. */
format?: string;
/** Specifies a precision for the formatted value displayed in the axis labels. */
/** Specifies a precision for the formatted value displayed in the axis labels. */
precision?: number;
}
export interface ChartAxisLabel extends ChartCommonAxisLabel, AxisLabel {}
export interface PolarAxisLabel extends PolarCommonAxisLabel, AxisLabel {}
}
export interface ChartAxisLabel extends ChartCommonAxisLabel, AxisLabel { }
export interface PolarAxisLabel extends PolarCommonAxisLabel, AxisLabel { }
export interface AxisTitle extends CommonAxisTitle {
/** Specifies the text for the value axis title. */
text?: string;
@@ -4989,19 +5114,19 @@ declare module DevExpress.viz.charts {
label?: ChartConstantLineLabel;
}
export interface ChartConstantLine extends ChartConstantLineStyle {
/** An object defining constant line label options. */
/** An object defining constant line label options. */
label?: ChartConstantLineLabel;
/** Specifies a value to be displayed by a constant line. */
value?: any;
}
export interface PolarConstantLine extends PolarCommonConstantLineStyle {
/** An object defining constant line label options. */
}
export interface PolarConstantLine extends PolarCommonConstantLineStyle {
/** An object defining constant line label options. */
label?: PolarConstantLineLabel;
/** Specifies a value to be displayed by a constant line. */
value?: any;
}
export interface Axis {
/** Specifies a coefficient for dividing the value axis. */
}
export interface Axis {
/** Specifies a coefficient for dividing the value axis. */
axisDivisionFactor?: number;
/** Specifies the order in which discrete values are arranged on the value axis. */
categories?: Array<any>;
@@ -5015,11 +5140,11 @@ declare module DevExpress.viz.charts {
minorTickCount?: number;
/** Specifies the required type of the value axis. */
type?: string;
/** Specifies the pane on which the current value axis will be displayed. */
/** Specifies the pane on which the current value axis will be displayed. */
pane?: string;
/** Specifies options for value axis strips. */
strips?: Array<Strip>;
}
}
export interface ChartAxis extends ChartCommonAxisSettings, Axis {
/** Defines an array of the value axis constant lines. */
constantLines?: Array<ChartConstantLine>;
@@ -5036,52 +5161,52 @@ declare module DevExpress.viz.charts {
/** Specifies the title for a value axis. */
title?: AxisTitle;
}
export interface PolarAxis extends PolarCommonAxisSettings, Axis {
export interface PolarAxis extends PolarCommonAxisSettings, Axis {
/** Defines an array of the value axis constant lines. */
constantLines?: Array<PolarConstantLine>;
/** Specifies options for value axis labels. */
label?: PolarAxisLabel;
}
export interface ArgumentAxis {
/** Specifies the desired type of axis values. */
export interface ArgumentAxis {
/** Specifies the desired type of axis values. */
argumentType?: string;
/** Specifies the elements that will be highlighted when the argument axis is hovered over. */
hoverMode?: string;
}
export interface ChartArgumentAxis extends ChartAxis, ArgumentAxis {}
export interface PolarArgumentAxis extends PolarAxis, ArgumentAxis {
/** Specifies a start angle for the argument axis in degrees. */
}
export interface ChartArgumentAxis extends ChartAxis, ArgumentAxis { }
export interface PolarArgumentAxis extends PolarAxis, ArgumentAxis {
/** Specifies a start angle for the argument axis in degrees. */
startAngle?: number;
/** Specifies whether or not to display the first point at the angle specified by the startAngle option. */
firstPointOnStartAngle?: boolean;
/** Specifies the period of the argument values in the data source. */
period?: number;
}
export interface ValueAxis {
}
export interface ValueAxis {
/** Specifies the name of the value axis. */
name?: string;
/** Specifies whether or not to indicate a zero value on the value axis. */
showZero?: boolean;
/** Specifies the desired type of axis values. */
valueType?: string;
}
}
export interface ChartValueAxis extends ChartAxis, ValueAxis {
/** Specifies the spacing, in pixels, between multiple value axes in a chart. */
multipleAxesSpacing?: number;
/** Specifies the value by which the chart's value axes are synchronized. */
synchronizedValue?: number;
}
export interface PolarValueAxis extends PolarAxis, ValueAxis {
/** Indicates whether to display series with indents from axis boundaries. */
valueMarginsEnabled?: boolean;
/** Specifies a coefficient that determines the spacing between the maximum series point and the axis. */
export interface PolarValueAxis extends PolarAxis, ValueAxis {
/** Indicates whether to display series with indents from axis boundaries. */
valueMarginsEnabled?: boolean;
/** Specifies a coefficient that determines the spacing between the maximum series point and the axis. */
maxValueMargin?: number;
/** Specifies a coefficient that determines the spacing between the minimum series point and the axis. */
minValueMargin?: number;
tick?: {
visible?: boolean;
}
}
tick?: {
visible?: boolean;
}
}
export interface CommonPane {
/** Specifies a background color in a pane. */
backgroundColor?: string;
@@ -5222,7 +5347,7 @@ declare module DevExpress.viz.charts {
asyncSeriesRendering?: boolean;
}): void;
}
export interface AdvancedLegend extends core.BaseLegend {
export interface AdvancedLegend extends core.BaseLegend {
/** Specifies the text for a hint that appears when a user hovers the mouse pointer over a legend item. */
customizeHint?: (seriesInfo: { seriesName: string; seriesIndex: number; seriesColor: string; }) => string;
/** <p>Specifies a callback function that returns the text to be displayed by legend items.</p> */
@@ -5263,14 +5388,14 @@ declare module DevExpress.viz.charts {
/** Specifies whether a single series or multiple series can be selected in the chart. */
seriesSelectionMode?: string;
/** Specifies how the chart must behave when series point labels overlap. */
resolveLabelOverlapping?: string;
resolveLabelOverlapping?: string;
}
export interface Legend extends AdvancedLegend {
/** Specifies whether the legend is located outside or inside the chart's plot. */
position?: string;
}
export interface ChartTooltip extends BaseChartTooltip {
/** Specifies whether the tooltip must be located in the center of a bar or on its edge. Applies only to the Bar series. */
/** Specifies whether the tooltip must be located in the center of a bar or on its edge. Applies to the Bar and Bubble series. */
location?: string;
/** Specifies the kind of information to display in a tooltip. */
shared?: boolean;
@@ -5404,7 +5529,7 @@ declare module DevExpress.viz.charts {
/** Specifies whether or not point labels can be hidden when the layout is adapting. */
keepLabels?: boolean;
};
/** Indicates whether or not to display a "spider web". */
/** Indicates whether or not to display a "spider web". */
useSpiderWeb?: boolean;
/** Specifies argument axis options for the dxPolarChart widget. */
argumentAxis?: PolarArgumentAxis;
@@ -5458,7 +5583,7 @@ declare module DevExpress.viz.charts {
onLegendClick?: any;
legendClick?: any;
/** Specifies how the chart must behave when series point labels overlap. */
resolveLabelOverlapping?: string;
resolveLabelOverlapping?: string;
}
/** A circular chart widget for HTML JS applications. */
export class dxPieChart extends BaseChart {
@@ -5830,7 +5955,7 @@ declare module DevExpress.viz.rangeSelector {
behavior?: {
/** Indicates whether or not you can swap sliders. */
allowSlidersSwap?: boolean;
/**
/**
Indicates whether or not animation is enabled.
*/
animationEnabled?: boolean;
@@ -5860,6 +5985,8 @@ Indicates whether or not animation is enabled.
};
/** Specifies a value indicating whether all bars in a series must have the same width, or may have different widths if any points in other series are missing. */
equalBarWidth?: any;
/** Sets the name of the palette to be used in the range selector's chart. Alternatively, an array of colors can be set as a custom palette to be used within this chart. */
palette?: any;
/** An object defining the charts series. */
series?: Array<viz.charts.SeriesConfig>;
/** Defines options for the series template. */
@@ -5943,7 +6070,7 @@ Indicates whether or not animation is enabled.
maxRange?: any;
/** Specifies the number of minor ticks between neighboring major ticks. */
minorTickCount?: number;
/**
/**
Specifies an interval between minor ticks.
*/
minorTickInterval?: any;
@@ -5974,8 +6101,8 @@ Specifies an interval between minor ticks.
useTicksAutoArrangement?: boolean;
/** Specifies the type of values on the scale. */
valueType?: string;
/** Specifies the order of arguments on a discrete scale. */
categories?: Array<any>;
/** Specifies the order of arguments on a discrete scale. */
categories?: Array<any>;
};
/** Specifies the range to be selected when displaying the dxRangeSelector. */
selectedRange?: {
@@ -6276,9 +6403,9 @@ declare module DevExpress.viz.map {
centerChanged?: (center: Array<number>) => void;
/** A handler for the centerChanged event. */
onCenterChanged?: (e: {
center: Array<number>;
component: dxVectorMap;
element: Element;
center: Array<number>;
component: dxVectorMap;
element: Element;
}) => void;
/** A handler for the tooltipShown event. */
onTooltipShown?: (e: {
+49
View File
@@ -6,3 +6,52 @@ dompurify.sanitize('<script>alert("hi")</script>');
dompurify.addHook('beforeSanitizeElements', (el, data, config) => {
return el;
});
//examples from the DOMPurify README
let dirty = '<script>alert("hi")</script><p>Totally safe<p><p onerror="blowUp()">Totally not safe</p>';
// allow only <b>
dompurify.sanitize(dirty, {ALLOWED_TAGS: ['b']});
// allow only <b> and <q> with style attributes (for whatever reason)
dompurify.sanitize(dirty, {ALLOWED_TAGS: ['b', 'q'], ALLOWED_ATTR: ['style']});
// leave all as it is but forbid <style>
dompurify.sanitize(dirty, {FORBID_TAGS: ['style']});
// leave all as it is but forbid style attributes
dompurify.sanitize(dirty, {FORBID_ATTR: ['style']});
// extend the existing array of allowed tags
dompurify.sanitize(dirty, {ADD_TAGS: ['my-tag']});
// extend the existing array of attributes
dompurify.sanitize(dirty, {ADD_ATTR: ['my-attr']});
// prohibit HTML5 data attributes (default is true)
dompurify.sanitize(dirty, {ALLOW_DATA_ATTR: false});
// return a DOM HTMLBodyElement instead of an HTML string (default is false)
dompurify.sanitize(dirty, {RETURN_DOM: true});
// return a DOM DocumentFragment instead of an HTML string (default is false)
dompurify.sanitize(dirty, {RETURN_DOM_FRAGMENT: true});
// return a DOM DocumentFragment instead of an HTML string (default is false)
// also import it into the current document (default is false).
// RETURN_DOM_IMPORT must be set if you would like to append
// the returned node to the current document
let clean = dompurify.sanitize(dirty, {RETURN_DOM_FRAGMENT: true, RETURN_DOM_IMPORT: true});
document.body.appendChild(clean);
// return entire document including <html> tags (default is false)
dompurify.sanitize(dirty, {WHOLE_DOCUMENT: true});
// make output safe for usage in jQuery's $()/html() method (default is false)
dompurify.sanitize(dirty, {SAFE_FOR_JQUERY: true});
// disable DOM Clobbering protection on output (default is true, handle with care!)
dompurify.sanitize(dirty, {SANITIZE_DOM: false});
// discard an element's content when the element is removed (default is true)
dompurify.sanitize(dirty, {KEEP_CONTENT: false});
+21 -2
View File
@@ -1,11 +1,30 @@
// Type definitions for DOM Purify
// Project: https://github.com/cure53/DOMPurify
// Definitions by: Dave Taylor <http://davetayls.me>
// Definitions by: Dave Taylor <http://davetayls.me>, Samira Bazuzi <https://github.com/bazuzi>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface IDOMPurify {
sanitize(s:string):string;
addHook(hook:string, cb:(currentNode:Element, data:any, config:any) => Element):void;
sanitize(s:string, config:IDOMPurifyConfig):any;
addHook(hook:string, cb:(currentNode:Element, data:any, config:IDOMPurifyConfig) => Element):void;
}
interface IDOMPurifyConfig {
ADD_ATTR?:string[];
ADD_TAGS?:string[];
ALLOW_DATA_ATTR?:boolean;
ALLOWED_ATTR?:string[];
ALLOWED_TAGS?:string[];
FORBID_ATTR?:string[];
FORBID_TAGS?:string[];
KEEP_CONTENT?:boolean;
RETURN_DOM?:boolean;
RETURN_DOM_FRAGMENT?:boolean;
RETURN_DOM_IMPORT?:boolean;
SAFE_FOR_JQUERY?:boolean;
SANITIZE_DOM?:boolean;
WHOLE_DOCUMENT?:boolean;
}
declare var DOMPurify:IDOMPurify;
+1
View File
@@ -25,6 +25,7 @@ declare module DonnaTypes {
type: string;
name: string;
bindingType: string;
paramNames?: string[];
classProperties?: any[];
prototypeProperties?: number[][];
doc?: string;
+2
View File
@@ -1,3 +1,5 @@
/// <reference path="./dragula.d.ts" />
import dragula = require("dragula");
// containers

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