Merge remote-tracking branch 'upstream/master'

Conflicts:
	devextreme/dx.devextreme-tests.ts
This commit is contained in:
Igor Kriklivetc
2015-09-03 14:51:37 +03:00
316 changed files with 37364 additions and 9022 deletions
+75 -23
View File
@@ -16,17 +16,18 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](amqplib/amqplib.d.ts) [amqplib 0.3.x](https://github.com/squaremo/amqp.node) by [Michael Nahkies](https://github.com/mnahkies)
* [:link:](angular2/angular2.d.ts) [Angular](http://angular.io) by [angular team](https://github.com/angular)
* [:link:](angular2/router.d.ts) [Angular](http://angular.io) by [angular team](https://github.com/angular)
* [:link:](angular-file-upload/angular-file-upload.d.ts) [Angular File Upload](https://github.com/danialfarid/ng-file-upload) by [John Reilly](https://github.com/johnnyreilly)
* [:link:](ng-file-upload/ng-file-upload.d.ts) [Angular File Upload](https://github.com/danialfarid/ng-file-upload) by [John Reilly](https://github.com/johnnyreilly)
* [:link:](angular-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)
@@ -38,6 +39,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [: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)
@@ -49,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)
@@ -84,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,8 +123,9 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](bootstrap-slider/bootstrap-slider.d.ts) [bootstrap-slider.js](https://github.com/seiyria/bootstrap-slider) by [Daniel Beckwith](https://github.com/dbeckwith)
* [:link:](bootstrap.datepicker/bootstrap.datepicker.d.ts) [bootstrap.datepicker](https://github.com/eternicode/bootstrap-datepicker) by [Boris Yankov](https://github.com/borisyankov)
* [:link:](bootstrap.paginator/bootstrap.paginator.d.ts) [bootstrap.paginator](https://github.com/lyonlai/bootstrap-paginator) by [derikwhittaker](https://github.com/derikwhittaker)
* [:link:](box2d/box2dweb.d.ts) [bootstrap.timepicker](http://code.google.com/p/box2dweb) by [jbaldwin](https://github.com/jbaldwin)
* [:link:](bootstrap.timepicker/bootstrap.timepicker.d.ts) [bootstrap.timepicker](https://github.com/jdewit/bootstrap-timepicker) by [derikwhittaker](https://github.com/derikwhittaker)
* [:link:](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)
@@ -140,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)
@@ -165,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)
@@ -230,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)
@@ -241,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)
@@ -251,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)
@@ -266,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)
@@ -287,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)
@@ -295,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)
@@ -328,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)
@@ -372,19 +387,24 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](greensock/greensock.d.ts) [GreenSock Animation Platform](http://www.greensock.com/get-started-js) by [Robert S](https://github.com/codebelt)
* [:link:](gridfs-stream/gridfs-stream.d.ts) [gridfs-stream](https://github.com/aheckmann/gridfs-stream) by [Lior Mualem](https://github.com/liorm)
* [:link:](gruntjs/gruntjs.d.ts) [Grunt 0.4.x](http://gruntjs.com) by [Jeff May](https://github.com/jeffmay), [Basarat Ali Syed](https://github.com/basarat)
* [:link:](gsap/TweenLite.d.ts) [GSAP](http://greensock.com) by [VILIC VANE](https://vilic.github.io)
* [:link:](gsap/Ease.d.ts) [GSAP](http://greensock.com) by [VILIC VANE](https://vilic.github.io)
* [:link:](gsap/Core.d.ts) [GSAP](http://greensock.com) by [VILIC VANE](https://vilic.github.io)
* [:link:](gsap/Ease.d.ts) [GSAP](http://greensock.com) by [VILIC VANE](https://vilic.github.io)
* [: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-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)
@@ -393,6 +413,8 @@ 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)
@@ -401,6 +423,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [: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)
@@ -422,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,15 +455,16 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](html2canvas/html2canvas.d.ts) [html2canvas.js](https://github.com/niklasvh/html2canvas) by [Richard Hepburn](https://github.com/rwhepburn)
* [:link:](htmlparser2/htmlparser2.d.ts) [htmlparser2 v3.7.x](https://github.com/fb55/htmlparser2) by [James Roland Cabresos](https://github.com/staticfunction)
* [:link:](htmltojsx/htmltojsx.d.ts) [htmltojsx](https://www.npmjs.com/package/htmltojsx) by [Basarat Ali Syed](https://github.com/basarat)
* [:link:](http-errors/http-errors.d.ts) [http-errors](https://github.com/jshttp/http-errors) by [Tanguy Krotoff](https://github.com/tkrotoff)
* [:link:](statuses/statuses.d.ts) [http-errors](https://github.com/jshttp/statuses) by [Tanguy Krotoff](https://github.com/tkrotoff)
* [:link:](http-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)
* [:link:](ng-i18next/ng-i18next.d.ts) [i18next](https://github.com/i18next/ng-i18next) by [Cyril Schumacher](https://github.com/cyrilschumacher)
* [:link:](i18next/i18next.d.ts) [i18next](http://i18next.com) by [Maarten Docter](https://github.com/mdocter)
* [:link:](ng-i18next/ng-i18next.d.ts) [i18next](https://github.com/i18next/ng-i18next) by [Cyril Schumacher](https://github.com/cyrilschumacher)
* [:link:](iban/iban.d.ts) [iban.js](https://github.com/arhs/iban.js) by [Cyril Schumacher](https://github.com/cyrilschumacher)
* [:link:](icheck/icheck.d.ts) [iCheck](http://damirfoy.com/iCheck) by [Dániel Tar](https://github.com/qcz)
* [:link:](imagemagick/imagemagick.d.ts) [imagemagick](http://github.com/rsms/node-imagemagick) by [Carlos Ballesteros Velasco](https://github.com/soywiz)
@@ -522,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)
@@ -558,8 +585,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](jquery.timer/jquery.timer.d.ts) [jQueryTimer](https://github.com/jchavannes/jquery-timer) by [Joshua Strobl](https://github.com/JoshStrobl)
* [:link:](jquery.total-storage/jquery.total-storage.d.ts) [jQueryTotalStorage](https://github.com/Upstatement/jquery-total-storage) by [Jeremy Brooks](https://github.com/JeremyCBrooks)
* [:link:](jqueryui/jqueryui.d.ts) [jQueryUI](http://jqueryui.com) by [Boris Yankov](https://github.com/borisyankov), [John Reilly](https://github.com/johnnyreilly)
* [:link:](js-cookie/js-cookie.d.ts) [js-cookie](https://github.com/js-cookie/js-cookie) by [Theodore Brown](https://github.com/theodorejb)
* [:link:](ua-parser-js/ua-parser-js.d.ts) [js-cookie](https://github.com/faisalman/ua-parser-js) by [Viktor Miroshnikov](https://github.com/superduper)
* [:link:](js-cookie/js-cookie.d.ts) [js-cookie](https://github.com/js-cookie/js-cookie) by [Theodore Brown](https://github.com/theodorejb)
* [:link:](js-fixtures/fixtures.d.ts) [js-fixtures](https://github.com/badunk/js-fixtures) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid)
* [:link:](js-git/js-git.d.ts) [js-git](https://github.com/creationix/js-git) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](js-signals/js-signals.d.ts) [JS-Signals](http://millermedeiros.github.io/js-signals) by [Diullei Gomes](https://github.com/diullei)
@@ -593,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)
@@ -669,6 +697,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [: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)
@@ -709,15 +738,15 @@ 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)
@@ -753,6 +782,7 @@ 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)
@@ -761,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)
@@ -772,14 +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)
@@ -800,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:](nouislider/nouislider.d.ts) [nouislider](https://github.com/leongersen/noUiSlider) by [Patrick Davies](https://github.com/bleuarg)
* [: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 [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)
@@ -811,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)
@@ -879,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)
@@ -917,6 +956,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [: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)
@@ -932,7 +972,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](route-recognizer/route-recognizer.d.ts) [route-recognizer](https://github.com/tildeio/route-recognizer) by [Dave Keen](http://www.keendevelopment.ch)
* [:link:](routie/routie.d.ts) [routie](https://github.com/jgallen23/routie) by [Adilson](https://github.com/Adilson)
* [:link:](rsmq/rsmq.d.ts) [rsmq](http://smrchy.github.io/rsmq) by [Qubo](https://github.com/MugeSo)
* [:link:](rsmq-worker/rsmq-worker.d.ts) [rsmq-worker](http://smrchy.github.io/rsmq/rsmq-worker) by [Qubo](https://github.com/MugeSo)
* [:link:](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)
@@ -958,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)
@@ -987,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)
@@ -1010,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)
@@ -1021,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)
@@ -1109,6 +1154,7 @@ 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)
@@ -1120,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)
@@ -1137,7 +1186,9 @@ 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)
@@ -1178,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 {
+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;
}
}
}
@@ -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' });
@@ -177,3 +193,35 @@ module UiViewScrollProviderTests {
$uiViewScrollProvider.useAnchorScroll();
}]);
}
interface ITestUserService {
isLoggedIn: () => boolean;
handleLogin: () => ng.IPromise<{}>;
}
module UrlRouterProviderTests {
var app = angular.module("urlRouterProviderTests", ["ui.router"]);
app.config(($urlRouterProvider: ng.ui.IUrlRouterProvider) => {
// Prevent $urlRouter from automatically intercepting URL changes;
// this allows you to configure custom behavior in between
// location changes and route synchronization:
$urlRouterProvider.deferIntercept();
}).run(($rootScope: ng.IRootScopeService, $urlRouter: ng.ui.IUrlRouterService, UserService: ITestUserService) => {
$rootScope.$on('$locationChangeSuccess', e => {
// UserService is an example service for managing user state
if (UserService.isLoggedIn()) return;
// Prevent $urlRouter's default handler from firing
e.preventDefault();
UserService.handleLogin().then(() => {
// Once the user has logged in, sync the current URL to the router:
$urlRouter.sync();
});
});
// Configures $urlRouter's listener *after* your custom listener
$urlRouter.listen();
});
}
+113 -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 {
@@ -203,6 +269,7 @@ declare module angular.ui {
*
*/
sync(): void;
listen(): void;
}
interface IUiViewScrollProvider {
@@ -212,4 +279,47 @@ declare module angular.ui {
*/
useAnchorScroll(): void;
}
interface IType {
/**
* Converts a parameter value (from URL string or transition param) to a custom/native value.
*
* @param val {string} The URL parameter value to decode.
* @param key {string} The name of the parameter in which val is stored. Can be used for meta-programming of Type objects.
*
* @returns {any} Returns a custom representation of the URL parameter value.
*/
decode(val: string, key: string): any;
/**
* Encodes a custom/native type value to a string that can be embedded in a URL. Note that the return value does not need to be URL-safe (i.e. passed through encodeURIComponent()), it only needs to be a representation of val that has been coerced to a string.
*
* @param val {any} The value to encode.
* @param key {string} The name of the parameter in which val is stored. Can be used for meta-programming of Type objects.
*
* @returns {string} Returns a string representation of val that can be encoded in a URL.
*/
encode(val: any, key: string): string;
/**
* Determines whether two decoded values are equivalent.
*
* @param a {any} A value to compare against.
* @param b {any} A value to compare against.
*
* @returns {boolean} Returns true if the values are equivalent/equal, otherwise false.
*/
equals? (a: any, b: any): boolean;
/**
* Detects whether a value is of a particular type. Accepts a native (decoded) value and determines whether it matches the current Type object.
*
* @param val {any} The value to check.
* @param key {any} Optional. If the type check is happening in the context of a specific UrlMatcher object, this is the name of the parameter in which val is stored. Can be used for meta-programming of Type objects.
*
* @returns {boolean} Returns true if the value matches the type, otherwise false.
*/
is(val: any, key: string): boolean;
/**
* The regular expression pattern used to match values of this type when coming from a substring of a URL.
*/
pattern?: RegExp;
}
}
@@ -0,0 +1,93 @@
/// <reference path="angular-ui-scroll.d.ts" />
var myApp = angular.module('application', ['ui.scroll', 'ui.scroll.jqlite']);
module application {
interface IItem {
id: number;
content: string;
}
class DatasourceTest implements ng.ui.IScrollDatasource<IItem> {
get(index: number, count: number, success: (results: IItem[]) => void): void {
var ret = new Array<IItem>();
for (var i=0; i < count; i++) {
ret.push({id: i, content: 'item ' + i.toString()});
}
success(ret);
}
}
function factory(): any {
return DatasourceTest;
}
myApp.factory('DatasourceTest', factory);
// demo/examples/adapter
myApp.controller('mainController', ['$scope', 'DatasourceTest', function($scope: ng.IScope, datasource: DatasourceTest) {
var firstListAdapter: ng.ui.IScrollAdapter, secondListAdapter: ng.ui.IScrollAdapter;
$scope['datasource'] = datasource;
$scope['updateList1'] = (): void => {
firstListAdapter.applyUpdates( (item: IItem, scope: ng.IRepeatScope) => {
return item.content += ' *';
})
};
$scope['removeFromList1'] = (): void => {
firstListAdapter.applyUpdates( (item: IItem, scope: ng.IRepeatScope) => {
if (scope.$index % 2 === 0) {
return []
}
})
};
var idList1: number = 1000;
$scope['addToList1'] = (): void => {
firstListAdapter.applyUpdates((item: IItem, scope: ng.IRepeatScope) => {
var newItem: IItem;
newItem = void 0;
if (scope.$index === 2) {
newItem = {
id: idList1,
content: 'a new one #' + idList1
};
idList1++;
return [item, newItem];
}
});
};
$scope['updateList2'] = (): void => {
secondListAdapter.applyUpdates((item: IItem, scope: ng.IRepeatScope) => {
return item.content += ' *';
});
};
$scope['removeFromList2'] = (): void => {
secondListAdapter.applyUpdates((item: IItem, scope: ng.IRepeatScope) => {
if (scope.$index % 2 !== 0) {
return [];
}
});
};
var idList2: number = 2000;
$scope['addToList2'] = (): void => {
secondListAdapter.applyUpdates((item: IItem, scope: ng.IRepeatScope) => {
var newItem: IItem;
newItem = void 0;
if (scope.$index === 4) {
newItem = {
id: idList2,
content: 'a new one #' + idList1
};
idList2++;
return [item, newItem];
}
});
};
}]);
}
+85
View File
@@ -0,0 +1,85 @@
// Type definitions for Angular JS 1.3.1+ (ui.scroll module)
// Project: https://github.com/angular-ui/ui-scroll
// Definitions by: Mark Nadig <https://github.com/marknadig>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare module angular.ui {
interface IScrollDatasource<T> {
/**
* The datasource object implements methods and properties to be used by the directive to access the data
*
* @param index indicates the first data row requested
*
* @param count indicates number of data rows requested
*
* @param success function to call when the data are retrieved. The implementation of the service has to call
* this function when the data are retrieved and pass it an array of the items retrieved. If no items are
* retrieved, an empty array has to be passed.
*
* Important: Make sure to respect the index and count parameters of the request. The array passed to the
* success method should have exactly count elements unless it hit eof/bof
*/
get(index: number, count: number, success: (results: Array<T>) => any): void;
}
interface IScrollAdapter {
/**
* a boolean value indicating whether there are any pending load requests.
*/
isLoading: boolean;
/**
* a reference to the item currently in the topmost visible position.
*/
topVisible: any;
/**
* a reference to the DOM element currently in the topmost visible position.
*/
topVisibleElement: ng.IAugmentedJQueryStatic;
/**
* a reference to the scope created for the item currently in the topmost visible position.
*/
topVisibleScope: ng.IRepeatScope;
/**
* calling this method reinitializes and reloads the scroller content.
*/
reload(): void;
/**
* Replaces the item in the buffer at the given index with the new items.
*
* @param index provides position of the item to be affected in the dataset (not in the buffer). If the item with
* the given index currently is not in the buffer no updates will be applied. $index property of the item $scope
* can be used to access the index value for a given item
*
* @param newItems is an array of items to replace the affected item. If the array is empty ([]) the item will
* be deleted, otherwise the items in the array replace the item. If the newItem array contains the old item,
* the old item stays in place.
*/
applyUpdates(index: number, newItems: any[]): void;
/**
* Replaces the item in the buffer at the given index with the new items.
*
* @param updater is a function to be applied to every item currently in the buffer. The function will receive
* 3 parameters: item, scope, and element. Here item is the item to be affected, scope is the item $scope, and
* element is the html element for the item. The return value of the function should be an array of items.
* Similarly to the newItem parameter (see above), if the array is empty([]), the item is deleted, otherwise
* the item is replaced by the items in the array. If the return value is not an array, the item remains
* unaffected, unless some updates were made to the item in the updater function. This can be thought of as
* in place update.
*/
applyUpdates(updater: (item: any, scope: ng.IRepeatScope) => any): void;
/**
* Adds new items after the last item in the buffer
*
* @param newItems provides an array of items to be appended.
*/
append(newItems: any[]): void;
/**
* Adds new items before the first item in the buffer
*
* @param newItems provides an array of items to be prepended.
*/
prepend(newItems: any[]): void;
}
}
+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
+231 -86
View File
@@ -1,4 +1,4 @@
// Type definitions for Angular v2.0.0-alpha.35
// 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
@@ -1158,9 +1158,9 @@ declare module ng {
descendants: boolean;
isViewQuery: void;
isViewQuery: any;
selector: void;
selector: any;
isVarBindingQuery: boolean;
@@ -1200,7 +1200,7 @@ declare module ng {
attributeName: string;
token: void;
token: any;
toString(): string;
}
@@ -1250,7 +1250,7 @@ declare module ng {
* };
*
* MyComponent.annotations = [
* new ng.Component({...})
* new ng.Component({...}),
* new ng.View({...})
* ]
* MyComponent.parameters = [
@@ -1335,7 +1335,7 @@ declare module ng {
* };
*
* MyComponent.annotations = [
* new ng.Component({...})
* new ng.Component({...}),
* new ng.View({...})
* ]
* ```
@@ -1512,7 +1512,7 @@ declare module ng {
* };
*
* MyComponent.annotations = [
* new ng.Component({...})
* new ng.Component({...}),
* new ng.View({...})
* ]
* ```
@@ -1585,7 +1585,7 @@ declare module ng {
* };
*
* MyComponent.annotations = [
* new ng.Component({...})
* new ng.Component({...}),
* new ng.View({...})
* ]
* MyComponent.parameters = [
@@ -1604,7 +1604,7 @@ declare module ng {
/**
* {@link ViewQueryMetadata} factory function.
* {@link di/ViewQueryMetadata} factory function.
*/
var ViewQuery : QueryFactory ;
@@ -2020,6 +2020,8 @@ declare module ng {
*/
class WrappedValue {
static wrap(value: any): WrappedValue;
wrapped: any;
}
@@ -2075,6 +2077,30 @@ declare module ng {
*/
class IterableDiffers {
static create(factories: IterableDifferFactory[], parent?: IterableDiffers): IterableDiffers;
/**
* Takes an array of {@link IterableDifferFactory} and returns a binding used to extend the
* inherited {@link IterableDiffers} instance with the provided factories and return a new
* {@link IterableDiffers} instance.
*
* The following example shows how to extend an existing list of factories,
* which will only be applied to the injector for this component and its children.
* This step is all that's required to make a new {@link IterableDiffer} available.
*
* # Example
*
* ```
* @Component({
* viewBindings: [
* IterableDiffers.extend([new ImmutableListDiffer()])
* ]
* })
* ```
*/
static extend(factories: IterableDifferFactory[]): Binding;
factories: IterableDifferFactory[];
find(iterable: Object): IterableDifferFactory;
@@ -2104,6 +2130,30 @@ declare module ng {
*/
class KeyValueDiffers {
static create(factories: KeyValueDifferFactory[], parent?: KeyValueDiffers): KeyValueDiffers;
/**
* Takes an array of {@link KeyValueDifferFactory} and returns a binding used to extend the
* inherited {@link KeyValueDiffers} instance with the provided factories and return a new
* {@link KeyValueDiffers} instance.
*
* The following example shows how to extend an existing list of factories,
* which will only be applied to the injector for this component and its children.
* This step is all that's required to make a new {@link KeyValueDiffer} available.
*
* # Example
*
* ```
* @Component({
* viewBindings: [
* KeyValueDiffers.extend([new ImmutableMapDiffer()])
* ]
* })
* ```
*/
static extend(factories: KeyValueDifferFactory[]): Binding;
factories: KeyValueDifferFactory[];
find(kv: Object): KeyValueDifferFactory;
@@ -2147,41 +2197,6 @@ declare module ng {
const APP_COMPONENT : OpaqueToken ;
/**
* Represents a Angular's representation of an Application.
*
* `ApplicationRef` represents a running application instance. Use it to retrieve the host
* component, injector,
* or dispose of an application.
*/
interface ApplicationRef {
/**
* Returns the current {@link ComponentMetadata} type.
*/
hostComponentType: Type;
/**
* Returns the current {@link ComponentMetadata} instance.
*/
hostComponent: any;
/**
* Dispose (un-load) the application.
*/
dispose(): void;
/**
* Returns the root application {@link Injector}.
*/
injector: Injector;
}
/**
* Bootstrapping for Angular applications.
*
@@ -2323,6 +2338,41 @@ declare module ng {
}
/**
* Represents a Angular's representation of an Application.
*
* `ApplicationRef` represents a running application instance. Use it to retrieve the host
* component, injector,
* or dispose of an application.
*/
interface ApplicationRef {
/**
* Returns the current {@link ComponentMetadata} type.
*/
hostComponentType: Type;
/**
* Returns the current {@link ComponentMetadata} instance.
*/
hostComponent: any;
/**
* Dispose (un-load) the application.
*/
dispose(): void;
/**
* Returns the root application {@link Injector}.
*/
injector: Injector;
}
/**
* Specifies app root url for the application.
*
@@ -2338,7 +2388,7 @@ declare module ng {
/**
* Returns the base URL of the currently running application.
*/
value: void;
value: any;
}
@@ -3031,9 +3081,10 @@ declare module ng {
* A reference to an Angular ProtoView.
*
* A ProtoView is a reference to a template for easy creation of views.
* (See {@link AppViewManager#createViewInContainer} and {@link AppViewManager#createRootHostView}).
* (See {@link AppViewManager#createViewInContainer `AppViewManager#createViewInContainer`} and
* {@link AppViewManager#createRootHostView `AppViewManager#createRootHostView`}).
*
* A `ProtoView` is a foctary for creating `View`s.
* A `ProtoView` is a factory for creating `View`s.
*
* ## Example
*
@@ -3303,7 +3354,7 @@ declare module ng {
*/
class InjectMetadata {
token: void;
token: any;
toString(): string;
}
@@ -3458,7 +3509,7 @@ declare module ng {
*/
class DependencyMetadata {
token: void;
token: any;
}
@@ -3544,6 +3595,52 @@ declare module ng {
class Injector {
/**
* Turns a list of binding definitions into an internal resolved list of resolved bindings.
*
* A resolution is a process of flattening multiple nested lists and converting individual
* bindings into a list of {@link ResolvedBinding}s. The resolution can be cached by `resolve`
* for the {@link Injector} for performance-sensitive code.
*
* @param `bindings` can be a list of `Type`, {@link Binding}, {@link ResolvedBinding}, or a
* recursive list of more bindings.
*
* The returned list is sparse, indexed by `id` for the {@link Key}. It is generally not useful to
* application code
* other than for passing it to {@link Injector} functions that require resolved binding lists,
* such as
* `fromResolvedBindings` and `createChildFromResolved`.
*/
static resolve(bindings: List<Type | Binding | List<any>>): List<ResolvedBinding>;
/**
* Resolves bindings and creates an injector based on those bindings. This function is slower than
* the corresponding `fromResolvedBindings` because it needs to resolve bindings first. See
* `resolve`
* for the {@link Injector}.
*
* Prefer `fromResolvedBindings` in performance-critical code that creates lots of injectors.
*
* @param `bindings` can be a list of `Type`, {@link Binding}, {@link ResolvedBinding}, or a
* recursive list of more
* bindings.
* @param `depProvider`
*/
static resolveAndCreate(bindings: List<Type | Binding | List<any>>, depProvider?: DependencyProvider): Injector;
/**
* Creates an injector from previously resolved bindings. This bypasses resolution and flattening.
* This API is the recommended way to construct injectors in performance-sensitive parts.
*
* @param `bindings` A sparse list of {@link ResolvedBinding}s. See `resolve` for the
* {@link Injector}.
* @param `depProvider`
*/
static fromResolvedBindings(bindings: List<ResolvedBinding>, depProvider?: DependencyProvider): Injector;
/**
* Returns debug information about the injector.
*
@@ -3699,7 +3796,7 @@ declare module ng {
/**
* Token used when retrieving this binding. Usually the `Type`.
*/
token: void;
token: any;
/**
@@ -3748,7 +3845,7 @@ declare module ng {
* expect(injector.get(String)).toEqual('Hello');
* ```
*/
toValue: void;
toValue: any;
/**
@@ -3784,7 +3881,7 @@ declare module ng {
* expect(injectorClass.get(Vehicle) instanceof Car).toBe(true);
* ```
*/
toAlias: void;
toAlias: any;
/**
@@ -3841,7 +3938,7 @@ declare module ng {
*/
class BindingBuilder {
token: void;
token: any;
/**
@@ -3982,6 +4079,8 @@ declare module ng {
*/
class Dependency {
static fromKey(key: Key): Dependency;
key: Key;
optional: boolean;
@@ -4019,7 +4118,19 @@ declare module ng {
* Keys are used internally by the {@link Injector} because their system-wide unique `id`s allow the
* injector to index in arrays rather than looking up items in maps.
*/
interface Key {
class Key {
/**
* Retrieves a `Key` for a token.
*/
static get(token: Object): Key;
/**
* @returns the number of keys registered in the system.
*/
static numberOfKeys: number;
token: Object;
@@ -4075,7 +4186,7 @@ declare module ng {
addKey(injector: Injector, key: Key): void;
context: void;
context: any;
toString(): string;
}
@@ -4280,7 +4391,7 @@ declare module ng {
* instead of writing:
*
* ```
* import {If, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault} from 'angular2/angular2';
* import {NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault} from 'angular2/angular2';
* import {OtherDirective} from 'myDirectives';
*
* @Component({
@@ -4288,16 +4399,16 @@ declare module ng {
* })
* @View({
* templateUrl: 'myComponent.html',
* directives: [If, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault, OtherDirective]
* directives: [NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault, OtherDirective]
* })
* export class MyComponent {
* ...
* }
* ```
* one could enumerate all the core directives at once:
* one could import all the core directives at once:
*
* ```
* import {coreDirectives} from 'angular2/angular2';
* import {CORE_DIRECTIVES} from 'angular2/angular2';
* import {OtherDirective} from 'myDirectives';
*
* @Component({
@@ -4305,7 +4416,7 @@ declare module ng {
* })
* @View({
* templateUrl: 'myComponent.html',
* directives: [coreDirectives, OtherDirective]
* directives: [CORE_DIRECTIVES, OtherDirective]
* })
* export class MyComponent {
* ...
@@ -4337,9 +4448,9 @@ declare module ng {
*/
class NgClass {
initialClasses: void;
initialClasses: any;
rawClass: void;
rawClass: any;
onCheck(): void;
@@ -4379,6 +4490,10 @@ declare module ng {
*/
class NgFor {
static bulkRemove(tuples: List<RecordViewTuple>, viewContainer: ViewContainerRef): List<RecordViewTuple>;
static bulkInsert(tuples: List<RecordViewTuple>, viewContainer: ViewContainerRef, templateRef: TemplateRef): List<RecordViewTuple>;
viewContainer: ViewContainerRef;
templateRef: TemplateRef;
@@ -4387,7 +4502,7 @@ declare module ng {
cdr: ChangeDetectorRef;
ngForOf: void;
ngForOf: any;
onCheck(): void;
}
@@ -4424,7 +4539,7 @@ declare module ng {
*/
class NgIf {
ngIf: void;
ngIf: any;
}
@@ -4455,20 +4570,20 @@ declare module ng {
* # Example:
*
* ```
* <div ng-style="{'text-align': alignEpr}"></div>
* <div [ng-style]="{'text-align': alignExp}"></div>
* ```
*
* In the above example the `text-align` style will be updated based on the `alignEpr` value
* In the above example the `text-align` style will be updated based on the `alignExp` value
* changes.
*
* # Syntax
*
* - `<div ng-style="{'text-align': alignEpr}"></div>`
* - `<div ng-style="styleExp"></div>`
* - `<div [ng-style]="{'text-align': alignExp}"></div>`
* - `<div [ng-style]="styleExp"></div>`
*/
class NgStyle {
rawStyle: void;
rawStyle: any;
onCheck(): void;
}
@@ -4508,7 +4623,7 @@ declare module ng {
*/
class NgSwitch {
ngSwitch: void;
ngSwitch: any;
}
@@ -4529,7 +4644,7 @@ declare module ng {
*/
class NgSwitchWhen {
ngSwitchWhen: void;
ngSwitchWhen: any;
}
@@ -4782,7 +4897,7 @@ declare module ng {
*/
class NgControlName extends NgControl {
update: void;
update: any;
model: any;
@@ -4855,7 +4970,7 @@ declare module ng {
form: Control;
update: void;
update: any;
model: any;
@@ -4893,7 +5008,7 @@ declare module ng {
*/
class NgModel extends NgControl {
update: void;
update: any;
model: any;
@@ -5055,7 +5170,7 @@ declare module ng {
directives: List<NgControl>;
ngSubmit: void;
ngSubmit: any;
onChange(_: any): void;
@@ -5119,7 +5234,7 @@ declare module ng {
form: ControlGroup;
ngSubmit: void;
ngSubmit: any;
formDirective: Form;
@@ -5175,9 +5290,9 @@ declare module ng {
cd: NgControl;
onChange: void;
onChange: any;
onTouched: void;
onTouched: any;
renderer: Renderer;
@@ -5215,9 +5330,9 @@ declare module ng {
cd: NgControl;
onChange: void;
onChange: any;
onTouched: void;
onTouched: any;
renderer: Renderer;
@@ -5267,9 +5382,9 @@ declare module ng {
value: string;
onChange: void;
onChange: any;
onTouched: void;
onTouched: any;
renderer: Renderer;
@@ -5313,6 +5428,16 @@ declare module ng {
* ```
*/
class Validators {
static required(c:Control): StringMap<string, boolean>;
static nullValidator(c: any): StringMap<string, boolean>;
static compose(validators: List<Function>): Function;
static group(c:ControlGroup): StringMap<string, boolean>;
static array(c:ControlArray): StringMap<string, boolean>;
}
class NgValidator {
@@ -5403,6 +5528,30 @@ declare module ng {
class RenderDirectiveMetadata {
static DIRECTIVE_TYPE: any;
static COMPONENT_TYPE: any;
static create({id, selector, compileChildren, events, host, properties, readAttributes, type,
callOnDestroy, callOnChange, callOnCheck, callOnInit, callOnAllChangesDone,
changeDetection, exportAs}: {
id?: string,
selector?: string,
compileChildren?: boolean,
events?: List<string>,
host?: Map<string, string>,
properties?: List<string>,
readAttributes?: List<string>,
type?: number,
callOnDestroy?: boolean,
callOnChange?: boolean,
callOnCheck?: boolean,
callOnInit?: boolean,
callOnAllChangesDone?: boolean,
changeDetection?: string,
exportAs?: string
}): RenderDirectiveMetadata;
id: any;
selector: string;
@@ -5668,8 +5817,6 @@ declare module ng {
*/
const APP_ID : OpaqueToken ;
const DOM_REFLECT_PROPERTIES_AS_ATTRIBUTES : OpaqueToken ;
/**
* Defines when a compiled template should be stored as a string
@@ -5764,8 +5911,6 @@ declare module ng {
var ComponentRef: InjectableReference;
var Key: InjectableReference;
}
declare module "angular2/angular2" {
+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;
}
+11 -11
View File
@@ -1,4 +1,4 @@
// Type definitions for Angular v2.0.0-alpha.35
// 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
@@ -109,7 +109,7 @@ declare module ngRouter {
/**
* Subscribe to URL updates from the router
*/
subscribe(onNext: (value: any) => void): void;
subscribe(onNext: (value: any) => void): Object;
/**
@@ -214,7 +214,7 @@ declare module ngRouter {
visibleHref: string;
routeParams: void;
routeParams: any;
onClick(): boolean;
}
@@ -291,7 +291,7 @@ declare module ngRouter {
back(): void;
}
class HTML5LocationStrategy extends LocationStrategy {
class PathLocationStrategy extends LocationStrategy {
onPopState(fn: EventListener): void;
@@ -551,13 +551,13 @@ declare module ngRouter {
params: StringMap<string, any>;
componentType: void;
componentType: any;
resolveComponentType(): Promise<Type>;
specificity: void;
specificity: any;
terminal: void;
terminal: any;
routeData(): Object;
}
@@ -594,9 +594,11 @@ declare module ngRouter {
}
const routerDirectives : List<any> ;
const ROUTE_DATA : OpaqueToken ;
var routerInjectables : List<any> ;
const ROUTER_DIRECTIVES : List<any> ;
const ROUTER_BINDINGS : List<any> ;
class Route implements RouteDefinition {
@@ -667,8 +669,6 @@ declare module ngRouter {
data?: any;
}
const ROUTE_DATA : OpaqueToken ;
var RouteConfig : (configs: List<RouteDefinition>) => ClassDecorator ;
interface ComponentDefinition {
+100 -2
View File
@@ -126,18 +126,35 @@ requestHandler = httpBackendService.expect('GET', /test.local/, function (data:
requestHandler = httpBackendService.expect('GET', /test.local/, { key: 'value' });
requestHandler = httpBackendService.expect('GET', /test.local/, { key: 'value' }, { header: 'value' });
requestHandler = httpBackendService.expect('GET', /test.local/, { key: 'value' }, function (headers: Object): boolean { return true; });
requestHandler = httpBackendService.expect('GET', (url: string) => { return true; });
requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, 'response data');
requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, 'response data', { header: 'value' });
requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, 'response data', function (headers: Object): boolean { return true; });
requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, /response data/);
requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, /response data/, { header: 'value' });
requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, /response data/, function (headers: Object): boolean { return true; });
requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, function (data: string): boolean { return true; });
requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, function (data: string): boolean { return true; }, { header: 'value' });
requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, function (data: string): boolean { return true; }, function (headers: Object): boolean { return true; });
requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, { key: 'value' });
requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, { key: 'value' }, { header: 'value' });
requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, { key: 'value' }, function (headers: Object): boolean { return true; });
requestHandler = httpBackendService.expectDELETE('http://test.local');
requestHandler = httpBackendService.expectDELETE('http://test.local', { header: 'value' });
requestHandler = httpBackendService.expectDELETE(/test.local/, { header: 'value' });
requestHandler = httpBackendService.expectDELETE((url: string) => { return true; }, { header: 'value' });
requestHandler = httpBackendService.expectGET('http://test.local');
requestHandler = httpBackendService.expectGET('http://test.local', { header: 'value' });
requestHandler = httpBackendService.expectGET(/test.local/, { header: 'value' });
requestHandler = httpBackendService.expectGET((url: string) => { return true; }, { header: 'value' });
requestHandler = httpBackendService.expectHEAD('http://test.local');
requestHandler = httpBackendService.expectHEAD('http://test.local', { header: 'value' });
requestHandler = httpBackendService.expectHEAD(/test.local/, { header: 'value' });
requestHandler = httpBackendService.expectHEAD((url: string) => { return true; }, { header: 'value' });
requestHandler = httpBackendService.expectJSONP('http://test.local');
requestHandler = httpBackendService.expectJSONP(/test.local/);
requestHandler = httpBackendService.expectJSONP((url: string) => { return true; });
requestHandler = httpBackendService.expectPATCH('http://test.local');
requestHandler = httpBackendService.expectPATCH('http://test.local', 'response data');
@@ -157,6 +174,15 @@ requestHandler = httpBackendService.expectPATCH(/test.local/, function (data: st
requestHandler = httpBackendService.expectPATCH(/test.local/, function (data: string): boolean { return true; }, { header: 'value' });
requestHandler = httpBackendService.expectPATCH(/test.local/, { key: 'value' });
requestHandler = httpBackendService.expectPATCH(/test.local/, { key: 'value' }, { header: 'value' });
requestHandler = httpBackendService.expectPATCH((url: string) => { return true; });
requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }, 'response data');
requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }, 'response data', { header: 'value' });
requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }, /response data/);
requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }, /response data/, { header: 'value' });
requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }, function (data: string): boolean { return true; });
requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }, function (data: string): boolean { return true; }, { header: 'value' });
requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }, { key: 'value' });
requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }, { key: 'value' }, { header: 'value' });
requestHandler = httpBackendService.expectPOST('http://test.local');
requestHandler = httpBackendService.expectPOST('http://test.local', 'response data');
@@ -176,6 +202,15 @@ requestHandler = httpBackendService.expectPOST(/test.local/, function (data: str
requestHandler = httpBackendService.expectPOST(/test.local/, function (data: string): boolean { return true; }, { header: 'value' });
requestHandler = httpBackendService.expectPOST(/test.local/, { key: 'value' });
requestHandler = httpBackendService.expectPOST(/test.local/, { key: 'value' }, { header: 'value' });
requestHandler = httpBackendService.expectPOST((url: string) => { return true; });
requestHandler = httpBackendService.expectPOST((url: string) => { return true; }, 'response data');
requestHandler = httpBackendService.expectPOST((url: string) => { return true; }, 'response data', { header: 'value' });
requestHandler = httpBackendService.expectPOST((url: string) => { return true; }, /response data/);
requestHandler = httpBackendService.expectPOST((url: string) => { return true; }, /response data/, { header: 'value' });
requestHandler = httpBackendService.expectPOST((url: string) => { return true; }, function (data: string): boolean { return true; });
requestHandler = httpBackendService.expectPOST((url: string) => { return true; }, function (data: string): boolean { return true; }, { header: 'value' });
requestHandler = httpBackendService.expectPOST((url: string) => { return true; }, { key: 'value' });
requestHandler = httpBackendService.expectPOST((url: string) => { return true; }, { key: 'value' }, { header: 'value' });
requestHandler = httpBackendService.expectPUT('http://test.local');
requestHandler = httpBackendService.expectPUT('http://test.local', 'response data');
@@ -195,6 +230,15 @@ requestHandler = httpBackendService.expectPUT(/test.local/, function (data: stri
requestHandler = httpBackendService.expectPUT(/test.local/, function (data: string): boolean { return true; }, { header: 'value' });
requestHandler = httpBackendService.expectPUT(/test.local/, { key: 'value' });
requestHandler = httpBackendService.expectPUT(/test.local/, { key: 'value' }, { header: 'value' });
requestHandler = httpBackendService.expectPUT((url: string) => { return true; });
requestHandler = httpBackendService.expectPUT((url: string) => { return true; }, 'response data');
requestHandler = httpBackendService.expectPUT((url: string) => { return true; }, 'response data', { header: 'value' });
requestHandler = httpBackendService.expectPUT((url: string) => { return true; }, /response data/);
requestHandler = httpBackendService.expectPUT((url: string) => { return true; }, /response data/, { header: 'value' });
requestHandler = httpBackendService.expectPUT((url: string) => { return true; }, function (data: string): boolean { return true; });
requestHandler = httpBackendService.expectPUT((url: string) => { return true; }, function (data: string): boolean { return true; }, { header: 'value' });
requestHandler = httpBackendService.expectPUT((url: string) => { return true; }, { key: 'value' });
requestHandler = httpBackendService.expectPUT((url: string) => { return true; }, { key: 'value' }, { header: 'value' });
requestHandler = httpBackendService.when('GET', 'http://test.local');
requestHandler = httpBackendService.when('GET', 'http://test.local', 'response data');
@@ -222,18 +266,35 @@ requestHandler = httpBackendService.when('GET', /test.local/, function (data: st
requestHandler = httpBackendService.when('GET', /test.local/, { key: 'value' });
requestHandler = httpBackendService.when('GET', /test.local/, { key: 'value' }, { header: 'value' });
requestHandler = httpBackendService.when('GET', /test.local/, { key: 'value' }, function (headers: Object): boolean { return true; });
requestHandler = httpBackendService.when('GET', (url: string) => { return true; });
requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, 'response data');
requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, 'response data', { header: 'value' });
requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, 'response data', function (headers: Object): boolean { return true; });
requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, /response data/);
requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, /response data/, { header: 'value' });
requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, /response data/, function (headers: Object): boolean { return true; });
requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, function (data: string): boolean { return true; });
requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, function (data: string): boolean { return true; }, { header: 'value' });
requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, function (data: string): boolean { return true; }, function (headers: Object): boolean { return true; });
requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, { key: 'value' });
requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, { key: 'value' }, { header: 'value' });
requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, { key: 'value' }, function (headers: Object): boolean { return true; });
requestHandler = httpBackendService.whenDELETE('http://test.local');
requestHandler = httpBackendService.whenDELETE('http://test.local', { header: 'value' });
requestHandler = httpBackendService.whenDELETE(/test.local/, { header: 'value' });
requestHandler = httpBackendService.whenDELETE((url: string) => { return true; }, { header: 'value' });
requestHandler = httpBackendService.whenGET('http://test.local');
requestHandler = httpBackendService.whenGET('http://test.local', { header: 'value' });
requestHandler = httpBackendService.whenGET(/test.local/, { header: 'value' });
requestHandler = httpBackendService.whenGET((url: string) => { return true; }, { header: 'value' });
requestHandler = httpBackendService.whenHEAD('http://test.local');
requestHandler = httpBackendService.whenHEAD('http://test.local', { header: 'value' });
requestHandler = httpBackendService.whenHEAD(/test.local/, { header: 'value' });
requestHandler = httpBackendService.whenHEAD((url: string) => { return true; }, { header: 'value' });
requestHandler = httpBackendService.whenJSONP('http://test.local');
requestHandler = httpBackendService.whenJSONP(/test.local/);
requestHandler = httpBackendService.whenJSONP((url: string) => { return true; });
requestHandler = httpBackendService.whenPATCH('http://test.local');
requestHandler = httpBackendService.whenPATCH('http://test.local', 'response data');
@@ -253,6 +314,15 @@ requestHandler = httpBackendService.whenPATCH(/test.local/, function (data: stri
requestHandler = httpBackendService.whenPATCH(/test.local/, function (data: string): boolean { return true; }, { header: 'value' });
requestHandler = httpBackendService.whenPATCH(/test.local/, { key: 'value' });
requestHandler = httpBackendService.whenPATCH(/test.local/, { key: 'value' }, { header: 'value' });
requestHandler = httpBackendService.whenPATCH((url: string) => { return true; });
requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }, 'response data');
requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }, 'response data', { header: 'value' });
requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }, /response data/);
requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }, /response data/, { header: 'value' });
requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }, function (data: string): boolean { return true; });
requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }, function (data: string): boolean { return true; }, { header: 'value' });
requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }, { key: 'value' });
requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }, { key: 'value' }, { header: 'value' });
requestHandler = httpBackendService.whenPOST('http://test.local');
requestHandler = httpBackendService.whenPOST('http://test.local', 'response data');
@@ -272,6 +342,15 @@ requestHandler = httpBackendService.whenPOST(/test.local/, function (data: strin
requestHandler = httpBackendService.whenPOST(/test.local/, function (data: string): boolean { return true; }, { header: 'value' });
requestHandler = httpBackendService.whenPOST(/test.local/, { key: 'value' });
requestHandler = httpBackendService.whenPOST(/test.local/, { key: 'value' }, { header: 'value' });
requestHandler = httpBackendService.whenPOST((url: string) => { return true; });
requestHandler = httpBackendService.whenPOST((url: string) => { return true; }, 'response data');
requestHandler = httpBackendService.whenPOST((url: string) => { return true; }, 'response data', { header: 'value' });
requestHandler = httpBackendService.whenPOST((url: string) => { return true; }, /response data/);
requestHandler = httpBackendService.whenPOST((url: string) => { return true; }, /response data/, { header: 'value' });
requestHandler = httpBackendService.whenPOST((url: string) => { return true; }, function (data: string): boolean { return true; });
requestHandler = httpBackendService.whenPOST((url: string) => { return true; }, function (data: string): boolean { return true; }, { header: 'value' });
requestHandler = httpBackendService.whenPOST((url: string) => { return true; }, { key: 'value' });
requestHandler = httpBackendService.whenPOST((url: string) => { return true; }, { key: 'value' }, { header: 'value' });
requestHandler = httpBackendService.whenPUT('http://test.local');
requestHandler = httpBackendService.whenPUT('http://test.local', 'response data');
@@ -291,15 +370,34 @@ requestHandler = httpBackendService.whenPUT(/test.local/, function (data: string
requestHandler = httpBackendService.whenPUT(/test.local/, function (data: string): boolean { return true; }, { header: 'value' });
requestHandler = httpBackendService.whenPUT(/test.local/, { key: 'value' });
requestHandler = httpBackendService.whenPUT(/test.local/, { key: 'value' }, { header: 'value' });
requestHandler = httpBackendService.whenPUT((url: string) => { return true; });
requestHandler = httpBackendService.whenPUT((url: string) => { return true; }, 'response data');
requestHandler = httpBackendService.whenPUT((url: string) => { return true; }, 'response data', { header: 'value' });
requestHandler = httpBackendService.whenPUT((url: string) => { return true; }, /response data/);
requestHandler = httpBackendService.whenPUT((url: string) => { return true; }, /response data/, { header: 'value' });
requestHandler = httpBackendService.whenPUT((url: string) => { return true; }, function (data: string): boolean { return true; });
requestHandler = httpBackendService.whenPUT((url: string) => { return true; }, function (data: string): boolean { return true; }, { header: 'value' });
requestHandler = httpBackendService.whenPUT((url: string) => { return true; }, { key: 'value' });
requestHandler = httpBackendService.whenPUT((url: string) => { return true; }, { key: 'value' }, { header: 'value' });
///////////////////////////////////////
// IRequestHandler
///////////////////////////////////////
var expectedData = { key: 'value'};
requestHandler.passThrough();
requestHandler.respond(function () { });
requestHandler.passThrough().passThrough();
requestHandler.respond((method, url, data, headers) => [404, 'data', { header: 'value' }, 'responseText']);
requestHandler.respond((method, url, data, headers) => [404, 'data', { header: 'value' }, 'responseText']).respond({});
requestHandler.respond((method, url, data, headers) => { return [404, { key: 'value' }, { header: 'value' }, 'responseText']; });
requestHandler.respond('data');
requestHandler.respond('data').respond({});
requestHandler.respond(expectedData);
requestHandler.respond({ key: 'value' });
requestHandler.respond({ key: 'value' }, { header: 'value' });
requestHandler.respond(404);
requestHandler.respond({ key: 'value' }, { header: 'value' }, 'responseText');
requestHandler.respond(404, 'data');
requestHandler.respond(404, 'data').respond({});
requestHandler.respond(404, { key: 'value' });
requestHandler.respond(404, { key: 'value' }, { header: 'value' });
requestHandler.respond(404, { key: 'value' }, { header: 'value' }, 'responseText');
+182 -110
View File
@@ -1,6 +1,6 @@
// Type definitions for Angular JS 1.3 (ngMock, ngMockE2E module)
// Project: http://angularjs.org
// Definitions by: Diego Vilar <http://github.com/diegovilar>
// Definitions by: Diego Vilar <http://github.com/diegovilar>, Tony Curtis <http://github.com/daltin>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="angular.d.ts" />
@@ -97,137 +97,208 @@ declare module angular {
// see https://docs.angularjs.org/api/ngMock/service/$httpBackend
///////////////////////////////////////////////////////////////////////////
interface IHttpBackendService {
/**
* Flushes all pending requests using the trained responses.
* @param count Number of responses to flush (in the order they arrived). If undefined, all pending requests will be flushed.
*/
flush(count?: number): void;
/**
* Resets all request expectations, but preserves all backend definitions.
*/
resetExpectations(): void;
/**
* Verifies that all of the requests defined via the expect api were made. If any of the requests were not made, verifyNoOutstandingExpectation throws an exception.
*/
verifyNoOutstandingExpectation(): void;
/**
* Verifies that there are no outstanding requests that need to be flushed.
*/
verifyNoOutstandingRequest(): void;
expect(method: string, url: string, data?: string, headers?: Object): mock.IRequestHandler;
expect(method: string, url: string, data?: string, headers?: (object: Object) => boolean): mock.IRequestHandler;
expect(method: string, url: string, data?: RegExp, headers?: Object): mock.IRequestHandler;
expect(method: string, url: string, data?: RegExp, headers?: (object: Object) => boolean): mock.IRequestHandler;
expect(method: string, url: string, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
expect(method: string, url: string, data?: (data: string) => boolean, headers?: (object: Object) => boolean): mock.IRequestHandler;
expect(method: string, url: string, data?: Object, headers?: Object): mock.IRequestHandler;
expect(method: string, url: string, data?: Object, headers?: (object: Object) => boolean): mock.IRequestHandler;
expect(method: string, url: RegExp, data?: string, headers?: Object): mock.IRequestHandler;
expect(method: string, url: RegExp, data?: string, headers?: (object: Object) => boolean): mock.IRequestHandler;
expect(method: string, url: RegExp, data?: RegExp, headers?: Object): mock.IRequestHandler;
expect(method: string, url: RegExp, data?: RegExp, headers?: (object: Object) => boolean): mock.IRequestHandler;
expect(method: string, url: RegExp, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
expect(method: string, url: RegExp, data?: (data: string) => boolean, headers?: (object: Object) => boolean): mock.IRequestHandler;
expect(method: string, url: RegExp, data?: Object, headers?: Object): mock.IRequestHandler;
expect(method: string, url: RegExp, data?: Object, headers?: (object: Object) => boolean): mock.IRequestHandler;
/**
* Creates a new request expectation.
* Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false.
* Returns an object with respond method that controls how a matched request is handled.
* @param method HTTP method.
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
* @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation.
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation.
*/
expect(method: string, url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean)) :mock.IRequestHandler;
expectDELETE(url: string, headers?: Object): mock.IRequestHandler;
expectDELETE(url: RegExp, headers?: Object): mock.IRequestHandler;
expectGET(url: string, headers?: Object): mock.IRequestHandler;
expectGET(url: RegExp, headers?: Object): mock.IRequestHandler;
expectHEAD(url: string, headers?: Object): mock.IRequestHandler;
expectHEAD(url: RegExp, headers?: Object): mock.IRequestHandler;
expectJSONP(url: string): mock.IRequestHandler;
expectJSONP(url: RegExp): mock.IRequestHandler;
/**
* Creates a new request expectation for DELETE requests.
* Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false.
* Returns an object with respond method that controls how a matched request is handled.
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url is as expected.
* @param headers HTTP headers object to be compared with the HTTP headers in the request.
*/
expectDELETE(url: string | RegExp | ((url: string) => boolean), headers?: Object): mock.IRequestHandler;
expectPATCH(url: string, data?: string, headers?: Object): mock.IRequestHandler;
expectPATCH(url: string, data?: RegExp, headers?: Object): mock.IRequestHandler;
expectPATCH(url: string, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
expectPATCH(url: string, data?: Object, headers?: Object): mock.IRequestHandler;
expectPATCH(url: RegExp, data?: string, headers?: Object): mock.IRequestHandler;
expectPATCH(url: RegExp, data?: RegExp, headers?: Object): mock.IRequestHandler;
expectPATCH(url: RegExp, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
expectPATCH(url: RegExp, data?: Object, headers?: Object): mock.IRequestHandler;
/**
* Creates a new request expectation for GET requests.
* Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false.
* Returns an object with respond method that controls how a matched request is handled.
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
* @param headers HTTP headers object to be compared with the HTTP headers in the request.
*/
expectGET(url: string | RegExp | ((url: string) => boolean), headers?: Object): mock.IRequestHandler;
expectPOST(url: string, data?: string, headers?: Object): mock.IRequestHandler;
expectPOST(url: string, data?: RegExp, headers?: Object): mock.IRequestHandler;
expectPOST(url: string, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
expectPOST(url: string, data?: Object, headers?: Object): mock.IRequestHandler;
expectPOST(url: RegExp, data?: string, headers?: Object): mock.IRequestHandler;
expectPOST(url: RegExp, data?: RegExp, headers?: Object): mock.IRequestHandler;
expectPOST(url: RegExp, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
expectPOST(url: RegExp, data?: Object, headers?: Object): mock.IRequestHandler;
/**
* Creates a new request expectation for HEAD requests.
* Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false.
* Returns an object with respond method that controls how a matched request is handled.
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
* @param headers HTTP headers object to be compared with the HTTP headers in the request.
*/
expectHEAD(url: string | RegExp | ((url: string) => boolean), headers?: Object): mock.IRequestHandler;
/**
* Creates a new request expectation for JSONP requests.
* Throws a preformatted error if expectation(s) don't match supplied string, regular expression, or if function returns false.
* Returns an object with respond method that controls how a matched request is handled.
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
*/
expectJSONP(url: string | RegExp | ((url: string) => boolean)): mock.IRequestHandler;
expectPUT(url: string, data?: string, headers?: Object): mock.IRequestHandler;
expectPUT(url: string, data?: RegExp, headers?: Object): mock.IRequestHandler;
expectPUT(url: string, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
expectPUT(url: string, data?: Object, headers?: Object): mock.IRequestHandler;
expectPUT(url: RegExp, data?: string, headers?: Object): mock.IRequestHandler;
expectPUT(url: RegExp, data?: RegExp, headers?: Object): mock.IRequestHandler;
expectPUT(url: RegExp, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
expectPUT(url: RegExp, data?: Object, headers?: Object): mock.IRequestHandler;
/**
* Creates a new request expectation for PATCH requests.
* Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false.
* Returns an object with respond method that controls how a matched request is handled.
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
* @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation.
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation.
*/
expectPATCH(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object): mock.IRequestHandler;
when(method: string, url: string, data?: string, headers?: Object): mock.IRequestHandler;
when(method: string, url: string, data?: string, headers?: (object: Object) => boolean): mock.IRequestHandler;
when(method: string, url: string, data?: RegExp, headers?: Object): mock.IRequestHandler;
when(method: string, url: string, data?: RegExp, headers?: (object: Object) => boolean): mock.IRequestHandler;
when(method: string, url: string, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
when(method: string, url: string, data?: (data: string) => boolean, headers?: (object: Object) => boolean): mock.IRequestHandler;
when(method: string, url: string, data?: Object, headers?: Object): mock.IRequestHandler;
when(method: string, url: string, data?: Object, headers?: (object: Object) => boolean): mock.IRequestHandler;
when(method: string, url: RegExp, data?: string, headers?: Object): mock.IRequestHandler;
when(method: string, url: RegExp, data?: string, headers?: (object: Object) => boolean): mock.IRequestHandler;
when(method: string, url: RegExp, data?: RegExp, headers?: Object): mock.IRequestHandler;
when(method: string, url: RegExp, data?: RegExp, headers?: (object: Object) => boolean): mock.IRequestHandler;
when(method: string, url: RegExp, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
when(method: string, url: RegExp, data?: (data: string) => boolean, headers?: (object: Object) => boolean): mock.IRequestHandler;
when(method: string, url: RegExp, data?: Object, headers?: Object): mock.IRequestHandler;
when(method: string, url: RegExp, data?: Object, headers?: (object: Object) => boolean): mock.IRequestHandler;
/**
* Creates a new request expectation for POST requests.
* Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false.
* Returns an object with respond method that controls how a matched request is handled.
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
* @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation.
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation.
*/
expectPOST(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object): mock.IRequestHandler;
whenDELETE(url: string, headers?: Object): mock.IRequestHandler;
whenDELETE(url: string, headers?: (object: Object) => boolean): mock.IRequestHandler;
whenDELETE(url: RegExp, headers?: Object): mock.IRequestHandler;
whenDELETE(url: RegExp, headers?: (object: Object) => boolean): mock.IRequestHandler;
/**
* Creates a new request expectation for PUT requests.
* Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false.
* Returns an object with respond method that controls how a matched request is handled.
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
* @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation.
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation.
*/
expectPUT(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object): mock.IRequestHandler;
whenGET(url: string, headers?: Object): mock.IRequestHandler;
whenGET(url: string, headers?: (object: Object) => boolean): mock.IRequestHandler;
whenGET(url: RegExp, headers?: Object): mock.IRequestHandler;
whenGET(url: RegExp, headers?: (object: Object) => boolean): mock.IRequestHandler;
/**
* Creates a new backend definition.
* Returns an object with respond method that controls how a matched request is handled.
* @param method HTTP method.
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
* @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation.
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation.
*/
when(method: string, url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler;
whenHEAD(url: string, headers?: Object): mock.IRequestHandler;
whenHEAD(url: string, headers?: (object: Object) => boolean): mock.IRequestHandler;
whenHEAD(url: RegExp, headers?: Object): mock.IRequestHandler;
whenHEAD(url: RegExp, headers?: (object: Object) => boolean): mock.IRequestHandler;
/**
* Creates a new backend definition for DELETE requests.
* Returns an object with respond method that controls how a matched request is handled.
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation.
*/
whenDELETE(url: string | RegExp | ((url: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler;
whenJSONP(url: string): mock.IRequestHandler;
whenJSONP(url: RegExp): mock.IRequestHandler;
/**
* Creates a new backend definition for GET requests.
* Returns an object with respond method that controls how a matched request is handled.
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation.
*/
whenGET(url: string | RegExp | ((url: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler;
whenPATCH(url: string, data?: string, headers?: Object): mock.IRequestHandler;
whenPATCH(url: string, data?: RegExp, headers?: Object): mock.IRequestHandler;
whenPATCH(url: string, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
whenPATCH(url: string, data?: Object, headers?: Object): mock.IRequestHandler;
whenPATCH(url: RegExp, data?: string, headers?: Object): mock.IRequestHandler;
whenPATCH(url: RegExp, data?: RegExp, headers?: Object): mock.IRequestHandler;
whenPATCH(url: RegExp, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
whenPATCH(url: RegExp, data?: Object, headers?: Object): mock.IRequestHandler;
/**
* Creates a new backend definition for HEAD requests.
* Returns an object with respond method that controls how a matched request is handled.
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation.
*/
whenHEAD(url: string | RegExp | ((url: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler;
whenPOST(url: string, data?: string, headers?: Object): mock.IRequestHandler;
whenPOST(url: string, data?: RegExp, headers?: Object): mock.IRequestHandler;
whenPOST(url: string, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
whenPOST(url: string, data?: Object, headers?: Object): mock.IRequestHandler;
whenPOST(url: RegExp, data?: string, headers?: Object): mock.IRequestHandler;
whenPOST(url: RegExp, data?: RegExp, headers?: Object): mock.IRequestHandler;
whenPOST(url: RegExp, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
whenPOST(url: RegExp, data?: Object, headers?: Object): mock.IRequestHandler;
/**
* Creates a new backend definition for JSONP requests.
* Returns an object with respond method that controls how a matched request is handled.
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation.
*/
whenJSONP(url: string | RegExp | ((url: string) => boolean)): mock.IRequestHandler;
whenPUT(url: string, data?: string, headers?: Object): mock.IRequestHandler;
whenPUT(url: string, data?: RegExp, headers?: Object): mock.IRequestHandler;
whenPUT(url: string, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
whenPUT(url: string, data?: Object, headers?: Object): mock.IRequestHandler;
whenPUT(url: RegExp, data?: string, headers?: Object): mock.IRequestHandler;
whenPUT(url: RegExp, data?: RegExp, headers?: Object): mock.IRequestHandler;
whenPUT(url: RegExp, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler;
whenPUT(url: RegExp, data?: Object, headers?: Object): mock.IRequestHandler;
/**
* Creates a new backend definition for PATCH requests.
* Returns an object with respond method that controls how a matched request is handled.
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
* @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation.
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation.
*/
whenPATCH(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler;
/**
* Creates a new backend definition for POST requests.
* Returns an object with respond method that controls how a matched request is handled.
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
* @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation.
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation.
*/
whenPOST(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler;
/**
* Creates a new backend definition for PUT requests.
* Returns an object with respond method that controls how a matched request is handled.
* @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
* @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation.
* @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation.
*/
whenPUT(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler;
}
export module mock {
// returned interface by the the mocked HttpBackendService expect/when methods
interface IRequestHandler {
respond(func: Function): void;
respond(status: number, data?: any, headers?: any): void;
respond(data: any, headers?: any): void;
/**
* Controls the response for a matched request using a function to construct the response.
* Returns the RequestHandler object for possible overrides.
* @param func Function that receives the request HTTP method, url, data, and headers and returns an array containing response status (number), data, headers, and status text.
*/
respond(func: ((method: string, url: string, data: string | Object, headers: Object) => [number, string | Object, Object, string])): IRequestHandler;
// Available wehn ngMockE2E is loaded
passThrough(): void;
/**
* Controls the response for a matched request using supplied static data to construct the response.
* Returns the RequestHandler object for possible overrides.
* @param status HTTP status code to add to the response.
* @param data Data to add to the response.
* @param headers Headers object to add to the response.
* @param responseText Response text to add to the response.
*/
respond(status: number, data: string | Object, headers?: Object, responseText?: string): IRequestHandler;
/**
* Controls the response for a matched request using the HTTP status code 200 and supplied static data to construct the response.
* Returns the RequestHandler object for possible overrides.
* @param data Data to add to the response.
* @param headers Headers object to add to the response.
* @param responseText Response text to add to the response.
*/
respond(data: string | Object, headers?: Object, responseText?: string): IRequestHandler;
// Available when ngMockE2E is loaded
/**
* Any request matching a backend definition or expectation with passThrough handler will be passed through to the real backend (an XHR request will be made to the server.)
*/
passThrough(): IRequestHandler;
}
}
@@ -237,5 +308,6 @@ declare module angular {
///////////////////////////////////////////////////////////////////////////////
// functions attached to global object (window)
///////////////////////////////////////////////////////////////////////////////
declare var module: (...modules: any[]) => any;
//Use `angular.mock.module` instead of `module`, as `module` conflicts with commonjs.
//declare var module: (...modules: any[]) => any;
declare var inject: angular.IInjectStatic;
+118 -21
View File
@@ -260,6 +260,8 @@ module TestQ {
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
@@ -325,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;
@@ -335,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);
}
@@ -381,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;
}
///////////////////////////////////////////////////////////////////////////
+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;
}
+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;
}
+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;
+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));
////
+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> {
+225 -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>
@@ -369,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 });
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -508,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) => {
@@ -526,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
});
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -617,13 +639,42 @@ 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
});
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//TODO enable generator
/*
func = Promise.coroutine(f);
@@ -709,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
@@ -726,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
@@ -743,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
@@ -760,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()
@@ -853,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
@@ -870,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
@@ -887,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
@@ -904,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
});
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+35 -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,7 @@ 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;
/**
@@ -547,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.
@@ -593,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 {
@@ -623,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.
+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 {
+7
View File
@@ -0,0 +1,7 @@
import Bowser = require('bowser');
Bowser.msedge === true;
Bowser.test(['msie']) === true;
Bowser.a === Bowser.c;
Bowser.osversion > 10;
Bowser.osversion === '10.1A';
+54
View File
@@ -0,0 +1,54 @@
// Type definitions for Bowser 1.x
// Project: https://github.com/ded/bowser
// Definitions by: Paulo Cesar <https://github.com/pocesar>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module 'bowser' {
var def: BowserModule.IBowser;
export = def;
}
declare module BowserModule {
export interface IBowserUA {
msie: boolean;
chrome: boolean;
webkit: boolean;
phantom: boolean;
opera: boolean;
safari: boolean;
android: boolean;
ios: boolean;
webos: boolean;
msedge: boolean;
seamonkey: boolean;
firefox: boolean;
yandexbrowser: boolean;
blackberry: boolean;
tablet: boolean;
mobile: boolean;
silk: boolean;
bada: boolean;
tizen: boolean;
windowsphone: boolean;
firefoxos: boolean;
gecko: boolean;
sailfish: boolean;
chromeBook: boolean;
/** Grade A browser */
a: boolean;
/** Grade C browser */
c: boolean;
/** Grade X browser */
x: boolean;
name: string;
version: string|number;
osversion: string|number;
}
export interface IBowser extends IBowserUA {
test(browserList: string[]): boolean;
_detect(ua: string): IBowser;
}
}
+1
View File
@@ -459,6 +459,7 @@ declare module breeze {
interface EntityManagerProperties {
serviceName?: string;
dataService?: DataService;
metadataStore?: MetadataStore;
queryOptions?: QueryOptions;
saveOptions?: SaveOptions;
validationOptions?: ValidationOptions;
+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,
+5 -5
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);
@@ -52,7 +50,7 @@ declare module "bunyan" {
name: string;
streams?: Stream[];
level?: string | number;
stream?: WritableStream;
stream?: NodeJS.WritableStream;
serializers?: Serializers;
src?: boolean;
}
@@ -65,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>;
}
}
+281 -52
View File
@@ -1,65 +1,294 @@
/// <reference path="cheerio.d.ts" />
import cheerio = require("cheerio");
import 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 default cheerio;
}
+4 -2
View File
@@ -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');
+17 -8
View File
@@ -1,4 +1,4 @@
// Type definitions for chocolatechip v4.0.2
// 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
@@ -176,7 +176,8 @@ interface ChocolateChipStatic {
* @param response The response from a Promise.
* @result
*/
json(reponse: Response): JSON;
json(reponse: Response): JSON;
/**
* This method will defer the execution of a function until the call stack is clear.
*
@@ -198,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[];
@@ -455,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.
@@ -836,12 +837,12 @@ 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.
@@ -850,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.
+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 -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 {
+33
View File
@@ -0,0 +1,33 @@
/// <reference path="codemirror.d.ts" />
/// <reference path="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
};
});
+62
View File
@@ -0,0 +1,62 @@
// Type definitions for CodeMirror
// Project: https://github.com/marijnh/CodeMirror
// Definitions by: jacqt <https://github.com/jacqt>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
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?: IShowHintOptions) : 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;
render?: (element: any, self: any, data: any) => 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: IShowHintOptions) => void;
}
interface IShowHintOptions {
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;
}
}
+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;
}
+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.
+26 -20
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
@@ -128,6 +128,7 @@ declare module CryptoJS{
interface BlockCipher extends IStreamCipher<IBlockCipherCfg>{}
interface IBlockCipherCfg {
iv?: WordArray;
mode?: mode.IBlockCipherModeImpl //default CBC
padding?: pad.IPaddingImpl //default Pkcs7
}
@@ -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
}
}
@@ -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());
+5
View File
@@ -105,8 +105,13 @@ module Tests.ui {
$('<div/>').dxAutocomplete({
dataSource: ["Bern", "Lyon", "Lander"],
value: options.value,
<<<<<<< HEAD
onValueChanged: function () {
options.setValue("test-value");
=======
onValueChanged: function (e:{ value: string }) {
options.setValue(e.value);
>>>>>>> upstream/master
}
}).appendTo(container);
}
+180 -117
View File
@@ -1789,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;
@@ -1827,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 {
@@ -1887,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 {
@@ -2979,8 +3042,8 @@ declare module DevExpress.ui {
/** 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;
@@ -3109,9 +3172,9 @@ Specifies the data source providing data for a lookup column.
}
};
/**
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. */
@@ -3209,8 +3272,8 @@ An array of grid columns.
/** 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. */
@@ -3591,8 +3654,8 @@ Specifies the message displayed in a group row when the corresponding group cont
/** 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;
@@ -4304,7 +4367,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
*/
@@ -4509,8 +4572,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. */
@@ -4570,30 +4633,30 @@ 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. */
/** 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. */
/** 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;
@@ -4624,9 +4687,9 @@ declare module DevExpress.viz.charts {
/** 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. */
}
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;
@@ -4635,9 +4698,9 @@ declare module DevExpress.viz.charts {
/** 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. */
}
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;
@@ -4646,7 +4709,7 @@ declare module DevExpress.viz.charts {
/** 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. */
@@ -4737,14 +4800,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. */
@@ -4842,7 +4905,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. */
@@ -4859,18 +4922,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. */
@@ -4878,24 +4941,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;
@@ -4907,7 +4970,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. */
@@ -4916,7 +4979,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?: {
@@ -4929,7 +4992,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;
@@ -4955,7 +5018,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;
@@ -4969,18 +5032,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?: {
@@ -5001,7 +5064,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. */
@@ -5023,12 +5086,12 @@ 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. */
customizeText?: (argument: { value: any; valueText: string }) => string;
@@ -5036,9 +5099,9 @@ declare module DevExpress.viz.charts {
format?: string;
/** 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 PolarAxisLabel extends PolarCommonAxisLabel, AxisLabel {}
export interface AxisTitle extends CommonAxisTitle {
/** Specifies the text for the value axis title. */
text?: string;
@@ -5048,19 +5111,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>;
@@ -5074,11 +5137,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>;
@@ -5095,52 +5158,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 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;
@@ -5281,7 +5344,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> */
@@ -5463,7 +5526,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;
@@ -6035,8 +6098,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?: {
@@ -6337,9 +6400,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;
+187
View File
@@ -0,0 +1,187 @@
/// <reference path="./dropzone.d.ts"/>
import Dropzone = require("dropzone");
const dropzoneFromString = new Dropzone(".test");
const dropzoneFromElement = new Dropzone(document.getElementById("test"));
const dropzoneWithOptions = new Dropzone(".test", {
url: "/some/url",
method: "post",
withCredentials: false,
parallelUploads: 2,
uploadMultiple: true,
maxFilesize: 1024,
paramName: "file",
createImageThumbnails: true,
maxThumbnailFilesize: 1024,
thumbnailWidth: 50,
thumbnailHeight: 50,
filesizeBase: 1000,
maxFiles: 100,
params: {
additional: "param"
},
clickable: true,
ignoreHiddenFiles: true,
acceptedFiles: "image/*",
autoProcessQueue: true,
autoQueue: true,
addRemoveLinks: true,
previewsContainer: "<div></div>",
capture: "camera",
dictDefaultMessage: "",
dictFallbackMessage: "",
dictFallbackText: "",
dictFileTooBig: "",
dictInvalidFileType: "",
dictResponseError: "",
dictCancelUpload: "",
dictCancelUploadConfirmation: "",
dictRemoveFile: "",
dictRemoveFileConfirmation: "",
dictMaxFilesExceeded: "",
accept: (file:DropzoneFile, done:(error?:string|Error) => void) => {
if (file.accepted) {
file.previewElement.classList.add("accepted");
file.previewTemplate.classList.add("accepted");
file.previewsContainer.classList.add("accepted");
done();
}
else {
done(new Error(file.status));
}
},
init: () => console.log("Initialized"),
forceFallback: false,
fallback: () => console.log("Fallback"),
resize: (file:DropzoneFile) => ({
srcX: 0,
srcY: 0,
trgX: 10,
trgY: 10,
srcWidth: 100,
srcHeight: 100,
trgWidth: 50,
trgHeight: 50,
optWidth: 50,
optHeight: 50
}),
drop: (e:DragEvent) => console.log("Drop"),
dragstart: (e:DragEvent) => console.log("Dragstart"),
dragend: (e:DragEvent) => console.log("Dragend"),
dragenter: (e:DragEvent) => console.log("Dragenter"),
dragover: (e:DragEvent) => console.log("Dragover"),
dragleave: (e:DragEvent) => console.log("Dragleave"),
paste: (e:DragEvent) => console.log("Paste"),
reset: () => console.log("Reset"),
addedfile: (file:DropzoneFile) => console.log("Addedfile"),
addedfiles: (files:DropzoneFile[]) => console.log("Addedfiles"),
removedfile: (file:DropzoneFile) => console.log("Removedfile"),
thumbnail: (file:DropzoneFile, dataUrl:string) => console.log("Thumbnail"),
error: (file:DropzoneFile, message:string|Error) => console.log("Error"),
errormultiple: (files:DropzoneFile[], message:string|Error) => console.log("Errormultiple"),
processing: (file:DropzoneFile) => console.log("Processing"),
processingmultiple: (files:DropzoneFile[]) => console.log("Processingmultiple"),
uploadprogress: (file:DropzoneFile, progress:number, bytesSent:number) => console.log("Uploadprogress"),
totaluploadprogress: (totalProgress:number, totalBytes:number, totalBytesSent:number) => console.log("Totaluploadprogress"),
sending: (file:DropzoneFile, xhr:XMLHttpRequest, formData:{}) => console.log("Sending"),
sendingmultiple: (files:DropzoneFile[], xhr:XMLHttpRequest, formData:{}) => console.log("Sendingmultiple"),
success: (file:DropzoneFile) => console.log("Success"),
successmultiple: (files:DropzoneFile[]) => console.log("Successmultiple"),
canceled: (file:DropzoneFile) => console.log("Canceled"),
canceledmultiple: (file:DropzoneFile[]) => console.log("Canceledmultiple"),
complete: (file:DropzoneFile) => console.log("Complete"),
completemultiple: (file:DropzoneFile[]) => console.log("Completemultiple"),
maxfilesexceeded: (file:DropzoneFile) => console.log("Maxfilesexceeded"),
maxfilesreached: (files:DropzoneFile[]) => console.log("Maxfilesreached"),
queuecomplete: () => console.log("Queuecomplete"),
previewTemplate: "<div></div>",
});
var dropzoneWithOptionsVariations:Dropzone;
dropzoneWithOptionsVariations = new Dropzone(".test", {
clickable: ".test"
});
dropzoneWithOptionsVariations = new Dropzone(".test", {
clickable: document.getElementById("test")
});
dropzoneWithOptionsVariations = new Dropzone(".test", {
clickable: [".test", ".test"]
});
dropzoneWithOptionsVariations = new Dropzone(".test", {
clickable: [document.getElementById("test"), document.getElementById("test")]
});
dropzoneWithOptionsVariations = new Dropzone(".test", {
clickable: ["test", document.getElementById("test")]
});
const dropzone = new Dropzone(".test");
dropzone.enable();
dropzone.disable();
dropzone.files.forEach(f => {
if (f.accepted) {
f.previewElement.classList.add("accepted");
f.previewTemplate.classList.add("accepted");
f.previewsContainer.classList.add("accepted");
}
else {
console.log(f.status.toUpperCase());
}
});
const firstFile = dropzone.files[0];
dropzone.removeFile(firstFile);
dropzone.addFile(firstFile);
dropzone.enqueueFile(firstFile);
dropzone.processFile(firstFile);
dropzone.uploadFile(firstFile);
dropzone.cancelUpload(firstFile);
dropzone.createThumbnail(firstFile, () => {
console.log("createThumbnail")
});
dropzone.createThumbnailFromUrl(firstFile, "/some/url", () => {
console.log("createThumbnailFromUrl")
});
dropzone.accept(firstFile, (e:string|Error) => {
console.log(e);
});
const acceptedFiles = dropzone.getAcceptedFiles();
dropzone.processFiles(acceptedFiles);
const rejectedFiles = dropzone.getRejectedFiles();
dropzone.enqueueFiles(rejectedFiles);
const queuedFiles = dropzone.getQueuedFiles();
dropzone.processFiles(queuedFiles);
const uploadingFiles = dropzone.getUploadingFiles();
dropzone.processFiles(uploadingFiles);
const activeFiles = dropzone.getActiveFiles();
dropzone.processFiles(activeFiles);
const addedFiles = dropzone.getFilesWithStatus(Dropzone.ADDED);
dropzone.processFiles(addedFiles);
dropzone.processQueue();
dropzone.removeAllFiles(true);
dropzone.destroy();
+188
View File
@@ -0,0 +1,188 @@
/// <reference path="./dropzone.d.ts"/>
const dropzoneFromString = new Dropzone(".test");
const dropzoneFromElement = new Dropzone(document.getElementById("test"));
const dropzoneWithOptions = new Dropzone(".test", {
url: "/some/url",
method: "post",
withCredentials: false,
parallelUploads: 2,
uploadMultiple: true,
maxFilesize: 1024,
paramName: "file",
createImageThumbnails: true,
maxThumbnailFilesize: 1024,
thumbnailWidth: 50,
thumbnailHeight: 50,
filesizeBase: 1000,
maxFiles: 100,
params: {
additional: "param"
},
headers: {
"Some-Header": "Value"
},
clickable: true,
ignoreHiddenFiles: true,
acceptedFiles: "image/*",
autoProcessQueue: true,
autoQueue: true,
addRemoveLinks: true,
previewsContainer: "<div></div>",
capture: "camera",
dictDefaultMessage: "",
dictFallbackMessage: "",
dictFallbackText: "",
dictFileTooBig: "",
dictInvalidFileType: "",
dictResponseError: "",
dictCancelUpload: "",
dictCancelUploadConfirmation: "",
dictRemoveFile: "",
dictRemoveFileConfirmation: "",
dictMaxFilesExceeded: "",
accept: (file:DropzoneFile, done:(error?:string|Error) => void) => {
if (file.accepted) {
file.previewElement.classList.add("accepted");
file.previewTemplate.classList.add("accepted");
file.previewsContainer.classList.add("accepted");
done();
}
else {
done(new Error(file.status));
}
},
init: () => console.log("Initialized"),
forceFallback: false,
fallback: () => console.log("Fallback"),
resize: (file:DropzoneFile) => ({
srcX: 0,
srcY: 0,
trgX: 10,
trgY: 10,
srcWidth: 100,
srcHeight: 100,
trgWidth: 50,
trgHeight: 50,
optWidth: 50,
optHeight: 50
}),
drop: (e:DragEvent) => console.log("Drop"),
dragstart: (e:DragEvent) => console.log("Dragstart"),
dragend: (e:DragEvent) => console.log("Dragend"),
dragenter: (e:DragEvent) => console.log("Dragenter"),
dragover: (e:DragEvent) => console.log("Dragover"),
dragleave: (e:DragEvent) => console.log("Dragleave"),
paste: (e:DragEvent) => console.log("Paste"),
reset: () => console.log("Reset"),
addedfile: (file:DropzoneFile) => console.log("Addedfile"),
addedfiles: (files:DropzoneFile[]) => console.log("Addedfiles"),
removedfile: (file:DropzoneFile) => console.log("Removedfile"),
thumbnail: (file:DropzoneFile, dataUrl:string) => console.log("Thumbnail"),
error: (file:DropzoneFile, message:string|Error) => console.log("Error"),
errormultiple: (files:DropzoneFile[], message:string|Error) => console.log("Errormultiple"),
processing: (file:DropzoneFile) => console.log("Processing"),
processingmultiple: (files:DropzoneFile[]) => console.log("Processingmultiple"),
uploadprogress: (file:DropzoneFile, progress:number, bytesSent:number) => console.log("Uploadprogress"),
totaluploadprogress: (totalProgress:number, totalBytes:number, totalBytesSent:number) => console.log("Totaluploadprogress"),
sending: (file:DropzoneFile, xhr:XMLHttpRequest, formData:{}) => console.log("Sending"),
sendingmultiple: (files:DropzoneFile[], xhr:XMLHttpRequest, formData:{}) => console.log("Sendingmultiple"),
success: (file:DropzoneFile) => console.log("Success"),
successmultiple: (files:DropzoneFile[]) => console.log("Successmultiple"),
canceled: (file:DropzoneFile) => console.log("Canceled"),
canceledmultiple: (file:DropzoneFile[]) => console.log("Canceledmultiple"),
complete: (file:DropzoneFile) => console.log("Complete"),
completemultiple: (file:DropzoneFile[]) => console.log("Completemultiple"),
maxfilesexceeded: (file:DropzoneFile) => console.log("Maxfilesexceeded"),
maxfilesreached: (files:DropzoneFile[]) => console.log("Maxfilesreached"),
queuecomplete: () => console.log("Queuecomplete"),
previewTemplate: "<div></div>",
});
var dropzoneWithOptionsVariations:Dropzone;
dropzoneWithOptionsVariations = new Dropzone(".test", {
clickable: ".test"
});
dropzoneWithOptionsVariations = new Dropzone(".test", {
clickable: document.getElementById("test")
});
dropzoneWithOptionsVariations = new Dropzone(".test", {
clickable: [".test", ".test"]
});
dropzoneWithOptionsVariations = new Dropzone(".test", {
clickable: [document.getElementById("test"), document.getElementById("test")]
});
dropzoneWithOptionsVariations = new Dropzone(".test", {
clickable: ["test", document.getElementById("test")]
});
const dropzone = new Dropzone(".test");
dropzone.enable();
dropzone.disable();
dropzone.files.forEach(f => {
if (f.accepted) {
f.previewElement.classList.add("accepted");
f.previewTemplate.classList.add("accepted");
f.previewsContainer.classList.add("accepted");
}
else {
console.log(f.status.toUpperCase());
}
});
const firstFile = dropzone.files[0];
dropzone.removeFile(firstFile);
dropzone.addFile(firstFile);
dropzone.enqueueFile(firstFile);
dropzone.processFile(firstFile);
dropzone.uploadFile(firstFile);
dropzone.cancelUpload(firstFile);
dropzone.createThumbnail(firstFile, () => {
console.log("createThumbnail")
});
dropzone.createThumbnailFromUrl(firstFile, "/some/url", () => {
console.log("createThumbnailFromUrl")
});
dropzone.accept(firstFile, (e:string|Error) => {
console.log(e);
});
const acceptedFiles = dropzone.getAcceptedFiles();
dropzone.processFiles(acceptedFiles);
const rejectedFiles = dropzone.getRejectedFiles();
dropzone.enqueueFiles(rejectedFiles);
const queuedFiles = dropzone.getQueuedFiles();
dropzone.processFiles(queuedFiles);
const uploadingFiles = dropzone.getUploadingFiles();
dropzone.processFiles(uploadingFiles);
const activeFiles = dropzone.getActiveFiles();
dropzone.processFiles(activeFiles);
const addedFiles = dropzone.getFilesWithStatus(Dropzone.ADDED);
dropzone.processFiles(addedFiles);
dropzone.processQueue();
dropzone.removeAllFiles(true);
dropzone.destroy();
+202 -59
View File
@@ -1,10 +1,23 @@
// Type definitions for Dropzone 4.0.1
// Project: http://www.dropzonejs.com/
// Definitions by: Natan Vivo <https://github.com/nvivo>, Andy Hawkins <https://github.com/a904guy/,http://a904guy.com/,http://www.bmbsqd.com>
// Definitions 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>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts"/>
interface DropzoneResizeInfo {
srcX?:number;
srcY?:number;
trgX?:number;
trgY?:number;
srcWidth?:number;
srcHeight?:number;
trgWidth?:number;
trgHeight?:number;
optWidth?:number;
optHeight?:number;
}
interface DropzoneFile extends File {
previewElement: HTMLElement;
previewTemplate: HTMLElement;
@@ -18,109 +31,239 @@ interface DropzoneOptions {
method?: string;
withCredentials?: boolean;
parallelUploads?: number;
uploadMultiple?: boolean;
maxFilesize?: number;
paramName?: string;
uploadMultiple?: boolean;
headers?: any;
addRemoveLinks?: boolean;
previewsContainer?: string;
clickable?: any;
createImageThumbnails?: boolean;
maxThumbnailFilesize?: number;
thumbnailWidth?: number;
thumbnailHeight?: number;
filesizeBase?: number;
maxFiles?: number;
resize?: ( file?: any ) => any;
init?: () => void;
params?: {};
headers?: {},
clickable?: boolean|string|HTMLElement|(string|HTMLElement)[];
ignoreHiddenFiles?: boolean;
acceptedFiles?: string;
accept?: ( file: DropzoneFile, doneCallback: ( ...args ) => void ) => void;
autoProcessQueue?: boolean;
previewTemplate?: string;
forceFallback?: boolean;
fallback?: () => void;
autoQueue?: boolean;
addRemoveLinks?: boolean;
previewsContainer?: boolean|string|HTMLElement;
capture?: string;
// dictionary options
dictDefaultMessage?: string;
dictFallbackMessage?: string;
dictFallbackText?: string;
dictInvalidFileType?: string;
dictFileTooBig?: string;
dictInvalidFileType?: string;
dictResponseError?: string;
dictCancelUpload?: string;
dictCancelUploadConfirmation?: string;
dictRemoveFile?: string;
dictRemoveFileConfirmation?: string;
dictMaxFilesExceeded?: string;
accept?(file:DropzoneFile, done:(error?:string|Error) => void):void;
init?():void;
forceFallback?: boolean;
fallback?():void;
resize?(file:DropzoneFile):DropzoneResizeInfo;
drop?(e:DragEvent):void;
dragstart?(e:DragEvent):void;
dragend?(e:DragEvent):void;
dragenter?(e:DragEvent):void;
dragover?(e:DragEvent):void;
dragleave?(e:DragEvent):void;
paste?(e:DragEvent):void;
reset?():void;
addedfile?(file:DropzoneFile):void;
addedfiles?(files:DropzoneFile[]):void;
removedfile?(file:DropzoneFile):void;
thumbnail?(file:DropzoneFile, dataUrl:string):void;
error?(file:DropzoneFile, message:string|Error, xhr:XMLHttpRequest):void;
errormultiple?(files:DropzoneFile[], message:string|Error, xhr:XMLHttpRequest):void;
processing?(file:DropzoneFile):void;
processingmultiple?(files:DropzoneFile[]):void;
uploadprogress?(file:DropzoneFile, progress:number, bytesSent:number):void;
totaluploadprogress?(totalProgress:number, totalBytes:number, totalBytesSent:number):void;
sending?(file:DropzoneFile, xhr:XMLHttpRequest, formData:{}):void;
sendingmultiple?(files:DropzoneFile[], xhr:XMLHttpRequest, formData:{}):void;
success?(file:DropzoneFile, responseText:string):void;
successmultiple?(files:DropzoneFile[], responseText:string):void;
canceled?(file:DropzoneFile):void;
canceledmultiple?(file:DropzoneFile[]):void;
complete?(file:DropzoneFile):void;
completemultiple?(file:DropzoneFile[]):void;
maxfilesexceeded?(file:DropzoneFile):void;
maxfilesreached?(files:DropzoneFile[]):void;
queuecomplete?():void;
previewTemplate?: string;
}
declare class Dropzone {
constructor( container: string, options?: DropzoneOptions );
constructor( container: HTMLElement, options?: DropzoneOptions );
constructor(container:string|HTMLElement, options?:DropzoneOptions);
static autoDiscover: boolean;
static options: any;
static confirm: ( question: string, accepted: () => void, rejected?: () => void ) => void;
static autoDiscover:boolean;
static options:any;
static confirm:(question:string, accepted:() => void, rejected?:() => void) => void;
files: DropzoneFile[];
static ADDED:string;
static QUEUED:string;
static ACCEPTED:string;
static UPLOADING:string;
static PROCESSING:string;
static CANCELED:string;
static ERROR:string;
static SUCCESS:string;
enable(): void;
disable(): void;
destroy(): Dropzone;
files:DropzoneFile[];
on( eventName, callback: ( ...args ) => any );
enable():void;
off( eventName ): void;
disable():void;
addFile( file: DropzoneFile ): void;
destroy():Dropzone;
removeFile( file: DropzoneFile ): void;
addFile(file:DropzoneFile):void;
removeAllFiles( cancelIfNecessary?: boolean ): void;
removeFile(file:DropzoneFile):void;
processQueue(): void;
removeAllFiles(cancelIfNecessary?:boolean):void;
cancelUpload( file: DropzoneFile ): void;
processQueue():void;
processFiles ( files: DropzoneFile[] ): void;
processFile( file: DropzoneFile ): void;
cancelUpload(file:DropzoneFile):void;
uploadFile( file: DropzoneFile ): void;
processFiles(files:DropzoneFile[]):void;
getAcceptedFiles(): DropzoneFile[];
processFile(file:DropzoneFile):void;
getRejectedFiles(): DropzoneFile[];
uploadFile(file:DropzoneFile):void;
getQueuedFiles(): DropzoneFile[];
getAcceptedFiles():DropzoneFile[];
getUploadingFiles(): DropzoneFile[];
getRejectedFiles():DropzoneFile[];
accept( file: DropzoneFile, done: ( error?: string ) => {} ):void;
getActiveFiles(): DropzoneFile[];
getFilesWithStatus( status: string ): DropzoneFile[];
enqueueFile( file: DropzoneFile ): void;
enqueueFiles( file: DropzoneFile[] ): void;
createThumbnail( file: DropzoneFile, callback?: (...any) => {}): any;
createThumbnailFromUrl( file: DropzoneFile, url: string, callback?: ( ...any ) => any ): any;
getQueuedFiles():DropzoneFile[];
emit( eventName: string, file: DropzoneFile, str?: string );
emit( eventName: "thumbnail", file: DropzoneFile, path: string );
emit( eventName: "addedfile", file: DropzoneFile );
emit( eventName: "removedfile", file: DropzoneFile );
emit( eventName: "processing", file: DropzoneFile );
emit( eventName: "canceled", file: DropzoneFile );
emit( eventName: "complete", file: DropzoneFile );
getUploadingFiles():DropzoneFile[];
accept(file:DropzoneFile, done:(error?:string|Error) => void):void;
getActiveFiles():DropzoneFile[];
getFilesWithStatus(status:string):DropzoneFile[];
enqueueFile(file:DropzoneFile):void;
enqueueFiles(file:DropzoneFile[]):void;
createThumbnail(file:DropzoneFile, callback?:(...args:any[]) => void):any;
createThumbnailFromUrl(file:DropzoneFile, url:string, callback?:(...args:any[]) => void):any;
on(eventName:string, callback:(...args:any[]) => void):void;
off(eventName:string):void;
emit(eventName:string, ...args:any[]):void;
on(eventName:"drop", callback:(e:DragEvent) => any):void;
on(eventName:"dragstart", callback:(e:DragEvent) => any):void;
on(eventName:"dragend", callback:(e:DragEvent) => any):void;
on(eventName:"dragenter", callback:(e:DragEvent) => any):void;
on(eventName:"dragover", callback:(e:DragEvent) => any):void;
on(eventName:"dragleave", callback:(e:DragEvent) => any):void;
on(eventName:"paste", callback:(e:DragEvent) => any):void;
on(eventName:"reset"):void;
on(eventName:"addedfile", callback:(file:DropzoneFile) => any):void;
on(eventName:"addedfiles", callback:(files:DropzoneFile[]) => any):void;
on(eventName:"removedfile", callback:(file:DropzoneFile) => any):void;
on(eventName:"thumbnail", callback:(file:DropzoneFile, dataUrl:string) => any):void;
on(eventName:"error", callback:(file:DropzoneFile, message:string|Error) => any):void;
on(eventName:"errormultiple", callback:(files:DropzoneFile[], message:string|Error) => any):void;
on(eventName:"processing", callback:(file:DropzoneFile) => any):void;
on(eventName:"processingmultiple", callback:(files:DropzoneFile[]) => any):void;
on(eventName:"uploadprogress", callback:(file:DropzoneFile, progress:number, bytesSent:number) => any):void;
on(eventName:"totaluploadprogress", callback:(totalProgress:number, totalBytes:number, totalBytesSent:number) => any):void;
on(eventName:"sending", callback:(file:DropzoneFile, xhr:XMLHttpRequest, formData:{}) => any):void;
on(eventName:"sendingmultiple", callback:(files:DropzoneFile[], xhr:XMLHttpRequest, formData:{}) => any):void;
on(eventName:"success", callback:(file:DropzoneFile) => any):void;
on(eventName:"successmultiple", callback:(files:DropzoneFile[]) => any):void;
on(eventName:"canceled", callback:(file:DropzoneFile) => any):void;
on(eventName:"canceledmultiple", callback:(file:DropzoneFile[]) => any):void;
on(eventName:"complete", callback:(file:DropzoneFile) => any):void;
on(eventName:"completemultiple", callback:(file:DropzoneFile[]) => any):void;
on(eventName:"maxfilesexceeded", callback:(file:DropzoneFile) => any):void;
on(eventName:"maxfilesreached", callback:(files:DropzoneFile[]) => any):void;
on(eventName:"queuecomplete"):void;
emit(eventName:"drop", e:DragEvent):void;
emit(eventName:"dragstart", e:DragEvent):void;
emit(eventName:"dragend", e:DragEvent):void;
emit(eventName:"dragenter", e:DragEvent):void;
emit(eventName:"dragover", e:DragEvent):void;
emit(eventName:"dragleave", e:DragEvent):void;
emit(eventName:"paste", e:DragEvent):void;
emit(eventName:"reset"):void;
emit(eventName:"addedfile", file:DropzoneFile):void;
emit(eventName:"addedfiles", files:DropzoneFile[]):void;
emit(eventName:"removedfile", file:DropzoneFile):void;
emit(eventName:"thumbnail", file:DropzoneFile, dataUrl:string):void;
emit(eventName:"error", file:DropzoneFile, message:string|Error):void;
emit(eventName:"errormultiple", files:DropzoneFile[], message:string|Error):void;
emit(eventName:"processing", file:DropzoneFile):void;
emit(eventName:"processingmultiple", files:DropzoneFile[]):void;
emit(eventName:"uploadprogress", file:DropzoneFile, progress:number, bytesSent:number):void;
emit(eventName:"totaluploadprogress", totalProgress:number, totalBytes:number, totalBytesSent:number):void;
emit(eventName:"sending", file:DropzoneFile, xhr:XMLHttpRequest, formData:{}):void;
emit(eventName:"sendingmultiple", files:DropzoneFile[], xhr:XMLHttpRequest, formData:{}):void;
emit(eventName:"success", file:DropzoneFile):void;
emit(eventName:"successmultiple", files:DropzoneFile[]):void;
emit(eventName:"canceled", file:DropzoneFile):void;
emit(eventName:"canceledmultiple", file:DropzoneFile[]):void;
emit(eventName:"complete", file:DropzoneFile):void;
emit(eventName:"completemultiple", file:DropzoneFile[]):void;
emit(eventName:"maxfilesexceeded", file:DropzoneFile):void;
emit(eventName:"maxfilesreached", files:DropzoneFile[]):void;
emit(eventName:"queuecomplete"):void;
emit( eventName: string, e: Event );
emit( eventName: "drop", e: Event );
emit( eventName: "dragstart", e: Event );
emit( eventName: "dragend", e: Event );
emit( eventName: "dragenter", e: Event );
emit( eventName: "dragover", e: Event );
emit( eventName: "dragleave", e: Event );
}
interface JQuery {
dropzone( options: DropzoneOptions ): Dropzone;
dropzone(options:DropzoneOptions): Dropzone;
}
declare module "dropzone" {
+1 -1
View File
@@ -925,7 +925,7 @@ declare module createjs {
static framerate: number;
static interval: number;
static maxDelta: number;
static paused: number;
static paused: boolean;
static RAF: string;
static RAF_SYNCHED: string;
static TIMEOUT: string;
+43
View File
@@ -0,0 +1,43 @@
/**
* Created by karl on 14/07/15.
*/
/// <reference path="../express/express.d.ts" />
/// <reference path="../easy-xapi/easy-xapi.d.ts" />
/// <reference path="./easy-xapi-utils.d.ts" />
import express = require('express');
import eXapi = require('easy-xapi');
import eUtils = require('easy-xapi-utils');
eXapi.init({
jSend: {
partial: true
}
});
var xApi = eXapi.create({
root: __dirname,
log: {
name: 'Log',
level: 'info'
},
port: 3000,
name: 'test',
mount: function (app) {
app.get('/', eUtils.isLoggedIn(), function (req, res) {
res.send('ok');
});
app.get('/role', eUtils.isLoggedIn('admin'), function (req, res) {
res.send('ok');
});
app.get('/', eUtils.isLoggedOut(), function (req, res) {
res.send('ok');
});
app.get('/role', eUtils.hasRole('guest'), function (req, res) {
res.send('ok');
});
}
});
xApi.listen();
+16
View File
@@ -0,0 +1,16 @@
// Type definitions for easy-xapi-utils
// Project: https://github.com/DeadAlready/easy-xapi-utils
// Definitions by: Karl Düüna <https://github.com/DeadAlready/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../express/express.d.ts" />
/// <reference path="../easy-jsend/easy-jsend.d.ts" />
/// <reference path="../easy-x-headers/easy-x-headers.d.ts" />
declare module "easy-xapi-utils" {
import express = require('express');
export function isLoggedIn(role?: string): express.RequestHandler;
export function isLoggedOut(): express.RequestHandler;
export function hasRole(role: string): express.RequestHandler;
}
+21
View File
@@ -0,0 +1,21 @@
/// <reference path="envify.d.ts" />
/// <reference path="../browserify/browserify.d.ts" />
import browserify = require('browserify');
import envify = require('envify/custom');
import fs = require('fs');
var b = browserify('main.js')
, output = fs.createWriteStream('bundle.js');
b.transform(envify({
NODE_ENV: 'development'
}));
b.bundle().pipe(output);
b.transform(envify({
_: 'purge'
, NODE_ENV: 'development'
}));
+14
View File
@@ -0,0 +1,14 @@
// Type definitions for envify
// Project: https://github.com/hughsk/envify
// Definitions by: Qubo <https://github.com/tkQubo>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "envify" {
var envify: Function;
export = envify;
}
declare module "envify/custom" {
function envify(environment: { [name: string]: any }): Function;
export = envify;
}
+12
View File
@@ -0,0 +1,12 @@
/// <reference path="./express-less.d.ts" />
import express = require('express');
import expressLess = require('express-less');
var app = express();
var lessOptions: expressLess.Options = {};
lessOptions.compress = true;
lessOptions.debug = true;
app.use('/less-css', expressLess(__dirname));
app.use('/less-css-with-options', expressLess(__dirname + "/less", lessOptions));
+21
View File
@@ -0,0 +1,21 @@
// Type definitions for express-less
// Project: https://www.npmjs.com/package/express-less
// Definitions by: xyb <https://github.com/xieyubo>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../express/express.d.ts" />
declare module "express-less" {
import express = require('express');
function less(root: string, options?: less.Options): express.RequestHandler;
module less {
export interface Options {
debug?: boolean;
compress?: boolean;
}
}
export = less;
}
+19 -19
View File
@@ -34,8 +34,8 @@ function sample1() {
function sample2() {
var dot, i,
t1, t2,
var dot: fabric.ICircle, i: number,
t1: number, t2: number,
startTimer = function() {
t1 = new Date().getTime();
return t1;
@@ -89,16 +89,16 @@ function sample2() {
function sample3() {
var $ = function(id) { return document.getElementById(id) };
var $: (id: string) => HTMLElement = function(id: string) { return document.getElementById(id) };
function applyFilter(index, filter) {
var obj = <fabric.IImage>canvas.getActiveObject();
function applyFilter(index: number, filter: any) {
var obj: fabric.IImage = <fabric.IImage>canvas.getActiveObject();
obj.filters[index] = filter;
obj.applyFilters(canvas.renderAll.bind(canvas));
}
function applyFilterValue(index, prop, value) {
var obj = <fabric.IImage>canvas.getActiveObject();
function applyFilterValue(index: number, prop: string, value: any) {
var obj: fabric.IImage = <fabric.IImage>canvas.getActiveObject();
if (obj.filters[index]) {
obj.filters[index][prop] = value;
obj.applyFilters(canvas.renderAll.bind(canvas));
@@ -214,7 +214,7 @@ function sample3() {
function sample4() {
var canvas = new fabric.Canvas('c');
var $ = function(id) { return document.getElementById(id); };
var $: (id: string) => HTMLElement = function(id: string) { return document.getElementById(id); };
var rect = new fabric.Rect({
width: 100,
@@ -339,10 +339,10 @@ function sample6() {
canvas.centerObject(obj);
canvas.add(obj);
canvas.add(obj.clone(() => {}).set({ left: 100, top: 100, angle: -15 }));
canvas.add(obj.clone(() => {}).set({ left: 480, top: 100, angle: 15 }));
canvas.add(obj.clone(() => {}).set({ left: 100, top: 400, angle: -15 }));
canvas.add(obj.clone(() => {}).set({ left: 480, top: 400, angle: 15 }));
canvas.add(obj.clone(() => { }).set({ left: 100, top: 100, angle: -15 }));
canvas.add(obj.clone(() => { }).set({ left: 480, top: 100, angle: 15 }));
canvas.add(obj.clone(() => { }).set({ left: 100, top: 400, angle: -15 }));
canvas.add(obj.clone(() => { }).set({ left: 480, top: 400, angle: 15 }));
canvas.on('mouse:move', function(options) {
var p = canvas.getPointer(options.e);
@@ -456,7 +456,7 @@ function sample8() {
top = fabric.util.getRandomInt(0 + offset, 500 - offset),
angle = fabric.util.getRandomInt(-20, 40),
width = fabric.util.getRandomInt(30, 50),
opacity = (function(min, max) { return Math.random() * (max - min) + min; })(0.5, 1);
opacity = (function(min: number, max: number) { return Math.random() * (max - min) + min; })(0.5, 1);
switch (className) {
@@ -522,7 +522,7 @@ function sample8() {
break;
case 'shape':
var id = element.id, match;
var id: any = element.id, match: RegExpExecArray;
if (match = /\d+$/.exec(id)) {
fabric.loadSVGFromURL('../assets/' + match[0] + '.svg', function(objects, options) {
var loadedObject = fabric.util.groupSVGElements(objects, options);
@@ -586,7 +586,7 @@ function sample8() {
}
};
var supportsInputOfType = function(type) {
var supportsInputOfType = function(type: string) {
return function() {
var el = <HTMLInputElement>document.createElement('input');
try {
@@ -746,7 +746,7 @@ function sample8() {
canvas.on('object:selected', onObjectSelected);
canvas.on('group:selected', onObjectSelected);
function onObjectSelected(e) {
function onObjectSelected(e: fabric.IEvent) {
var selectedObject = e.target;
for (var i = activeObjectButtons.length; i--;) {
@@ -1033,7 +1033,7 @@ function sample8() {
};
canvas.on('object:selected', function(e: fabric.IEvent) {
slider.value = String((<fabric.IText>e.target).lineHeight );
slider.value = String((<fabric.IText>e.target).lineHeight);
});
})();
}
@@ -1050,6 +1050,6 @@ function sample8() {
function sample9() {
var canvas = new fabric.Canvas('c');
canvas.setBackgroundImage('yolo.jpg',() => { "a" }, { opacity: 45 });
canvas.setBackgroundImage('yolo.jpg',() => { "a" });
canvas.setBackgroundImage('yolo.jpg', () => { "a" }, { opacity: 45 });
canvas.setBackgroundImage('yolo.jpg', () => { "a" });
}
+58 -54
View File
@@ -1,6 +1,6 @@
// Type definitions for FabricJS v1.5.0
// Project: http://fabricjs.com/
// Definitions by: Oliver Klemencic <https://github.com/oklemencic/>, Joseph Livecchi <https://github.com/joewashear007/>
// Definitions by: Oliver Klemencic <https://github.com/oklemencic/>, Joseph Livecchi <https://github.com/joewashear007/>, Michael Randolph <https://github.com/mrand01/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/* tslint:disable:no-unused-variable */
@@ -41,7 +41,7 @@ declare module fabric {
* @param {Function} callback
* @param {Function} [reviver] Method for further parsing of SVG elements, called after each fabric object created.
*/
function loadSVGFromString(string: string, callback: (results: IObject[], options: any) => void, reviver?: Function);
function loadSVGFromString(string: string, callback: (results: IObject[], options: any) => void, reviver?: Function): void;
/**
* Takes url corresponding to an SVG document, and parses it into a set of fabric objects.
* Note that SVG is fetched via XMLHttpRequest, so it needs to conform to SOP (Same Origin Policy)
@@ -49,14 +49,14 @@ declare module fabric {
* @param {Function} callback
* @param {Function} [reviver] Method for further parsing of SVG elements, called after each fabric object created.
*/
function loadSVGFromURL(url: string, callback: (results: IObject[], options: any) => void, reviver?: Function);
function loadSVGFromURL(url: string, callback: (results: IObject[], options: any) => void, reviver?: Function): void;
/**
* Returns CSS rules for a given SVG document
* @param {SVGDocument} doc SVG document to parse
*/
function getCSSRules(doc: SVGElement): any;
function parseElements(elements: any[], callback: Function, options: any, reviver?: Function);
function parseElements(elements: any[], callback: Function, options: any, reviver?: Function): void;
/**
* Parses "points" attribute, returning an array of values
* @param {String} points points attribute string
@@ -99,7 +99,7 @@ declare module fabric {
* @param {Function} callback Callback to call when parsing is finished; It's being passed an array of elements (parsed from a document).
* @param {Function} [reviver] Method for further parsing of SVG elements, called after each fabric object created.
*/
function parseSVGDocument(doc: SVGElement, callback: (results: IObject[], options: any) => void, reviver?: Function);
function parseSVGDocument(doc: SVGElement, callback: (results: IObject[], options: any) => void, reviver?: Function): void;
/**
* Parses "transform" attribute, returning an array of values
* @param {String} attributeValue String containing attribute value
@@ -111,11 +111,11 @@ declare module fabric {
/**
* Wrapper around `console.log` (when available)
*/
function log(...values: any[]);
function log(...values: any[]): void;
/**
* Wrapper around `console.warn` (when available)
*/
function warn(...values: any[]);
function warn(...values: any[]): void;
////////////////////////////////////////////////////
// Classes
@@ -438,7 +438,7 @@ declare module fabric {
/**
* Sets source of this color (where source is an array representation; ex: [200, 200, 100, 1])
*/
setSource(source: number[]);
setSource(source: number[]): void;
/**
* Returns color represenation in RGB format ex: rgb(0-255,0-255,0-255)
@@ -474,7 +474,7 @@ declare module fabric {
* Sets value of alpha channel for this color
* @param {Number} alpha Alpha value 0-1
*/
setAlpha(alpha: number);
setAlpha(alpha: number): void;
/**
* Transforms color to its grayscale representation
@@ -627,17 +627,17 @@ declare module fabric {
/**
* Appends a point to intersection
*/
appendPoint(point: IPoint);
appendPoint(point: IPoint): void;
/**
* Appends points to intersection
*/
appendPoints(points: IPoint[]);
appendPoints(points: IPoint[]): void;
}
interface IIntersectionStatic {
/**
* Intersection class
*/
new (status?: string);
new (status?: string): void;
/**
* Checks if polygon intersects another polygon
*/
@@ -1313,7 +1313,7 @@ declare module fabric {
/**
* Callback; invoked right before object is about to be scaled/rotated
*/
onBeforeScaleRotate(target: IObject);
onBeforeScaleRotate(target: IObject): void;
// Functions from object straighten mixin
// --------------------------------------------------------------------------------------------------------------------------------
@@ -1839,12 +1839,12 @@ declare module fabric {
filters: IBaseFilter[];
}
interface IImage extends IObject, IImageOptions {
initialize(element?: string|HTMLImageElement, options?: IImageOptions);
initialize(element?: string|HTMLImageElement, options?: IImageOptions): void;
/**
* Applies filters assigned to this image (from "filters" array)
* @param {Function} callback Callback is invoked when all filters have been applied and new image is generated
*/
applyFilters(callback: Function);
applyFilters(callback: Function): void;
/**
* Returns a clone of an instance
* @param {Function} callback Callback is invoked with a clone as a first argument
@@ -1871,7 +1871,7 @@ declare module fabric {
* @return {String} Source of an image
*/
getSrc(): string;
render(ctx: CanvasRenderingContext2D, noTransform: boolean);
render(ctx: CanvasRenderingContext2D, noTransform: boolean): void;
/**
* Sets image element for this instance to a specified one.
@@ -2539,7 +2539,7 @@ declare module fabric {
* Sets object's properties from options
* @param {Object} [options] Options object
*/
setOptions(options: any);
setOptions(options: any): void;
/**
* Sets sourcePath of an object
* @param {String} value Value to set sourcePath to
@@ -2850,7 +2850,7 @@ declare module fabric {
}
interface IPathGroup extends IObject {
initialize(paths: IPath[], options?: IObjectOptions);
initialize(paths: IPath[], options?: IObjectOptions): void;
/**
* Returns number representation of object's complexity
* @return {Number} complexity
@@ -2865,7 +2865,7 @@ declare module fabric {
* Renders this group on a specified context
* @param {CanvasRenderingContext2D} ctx Context to render this instance on
*/
render(ctx: CanvasRenderingContext2D);
render(ctx: CanvasRenderingContext2D): void;
/**
* Returns dataless object representation of this path group
* @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output
@@ -2993,7 +2993,7 @@ declare module fabric {
minY?: number;
}
interface IPolyline extends IObject, IPolylineOptions {
initialize(points: IPoint[], options?: IPolylineOptions);
initialize(points: IPoint[], options?: IPolylineOptions): void;
/**
* Returns complexity of an instance
* @return {Number} complexity of this instance
@@ -3158,7 +3158,7 @@ declare module fabric {
* Renders text instance on a specified context
* @param {CanvasRenderingContext2D} ctx Context to render on
*/
render(ctx: CanvasRenderingContext2D, noTransform: boolean);
render(ctx: CanvasRenderingContext2D, noTransform: boolean): void;
/**
* Returns object representation of an instance
* @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output
@@ -3347,7 +3347,7 @@ declare module fabric {
* Returns true if object has no styling
*/
isEmptyStyles(): boolean;
render(ctx: CanvasRenderingContext2D, noTransform: boolean);
render(ctx: CanvasRenderingContext2D, noTransform: boolean): void;
/**
* Returns object representation of an instance
* @method toObject
@@ -4149,37 +4149,41 @@ declare module fabric {
requestAnimFrame(callback: Function): void;
}
interface IUtilAminEaseFunction {
(t: number, b: number, c: number, d: number): number;
}
interface IUtilAnimEase {
easeInBack(): Function;
easeInBounce(): Function;
easeInCirc(): Function;
easeInCubic(): Function;
easeInElastic(): Function;
easeInExpo(): Function;
easeInOutBack(): Function;
easeInOutBounce(): Function;
easeInOutCirc(): Function;
easeInOutCubic(): Function;
easeInOutElastic(): Function;
easeInOutExpo(): Function;
easeInOutQuad(): Function;
easeInOutQuart(): Function;
easeInOutQuint(): Function;
easeInOutSine(): Function;
easeInQuad(): Function;
easeInQuart(): Function;
easeInQuint(): Function;
easeInSine(): Function;
easeOutBack(): Function;
easeOutBounce(): Function;
easeOutCirc(): Function;
easeOutCubic(): Function;
easeOutElastic(): Function;
easeOutExpo(): Function;
easeOutQuad(): Function;
easeOutQuart(): Function;
easeOutQuint(): Function;
easeOutSine(): Function;
easeInBack: IUtilAminEaseFunction;
easeInBounce: IUtilAminEaseFunction;
easeInCirc: IUtilAminEaseFunction;
easeInCubic: IUtilAminEaseFunction;
easeInElastic: IUtilAminEaseFunction;
easeInExpo: IUtilAminEaseFunction;
easeInOutBack: IUtilAminEaseFunction;
easeInOutBounce: IUtilAminEaseFunction;
easeInOutCirc: IUtilAminEaseFunction;
easeInOutCubic: IUtilAminEaseFunction;
easeInOutElastic: IUtilAminEaseFunction;
easeInOutExpo: IUtilAminEaseFunction;
easeInOutQuad: IUtilAminEaseFunction;
easeInOutQuart: IUtilAminEaseFunction;
easeInOutQuint: IUtilAminEaseFunction;
easeInOutSine: IUtilAminEaseFunction;
easeInQuad: IUtilAminEaseFunction;
easeInQuart: IUtilAminEaseFunction;
easeInQuint: IUtilAminEaseFunction;
easeInSine: IUtilAminEaseFunction;
easeOutBack: IUtilAminEaseFunction;
easeOutBounce: IUtilAminEaseFunction;
easeOutCirc: IUtilAminEaseFunction;
easeOutCubic: IUtilAminEaseFunction;
easeOutElastic: IUtilAminEaseFunction;
easeOutExpo: IUtilAminEaseFunction;
easeOutQuad: IUtilAminEaseFunction;
easeOutQuart: IUtilAminEaseFunction;
easeOutQuint: IUtilAminEaseFunction;
easeOutSine: IUtilAminEaseFunction;
}
interface IUtilArc {
@@ -4360,13 +4364,13 @@ declare module fabric {
* @param {Object} [properties] Properties shared by all instances of this class
* (be careful modifying objects defined here as this would affect all instances)
*/
createClass(parent: Function, properties?: any);
createClass(parent: Function, properties?: any): void;
/**
* Helper for creation of "classes".
* @param {Object} [properties] Properties shared by all instances of this class
* (be careful modifying objects defined here as this would affect all instances)
*/
createClass(properties?: any);
createClass(properties?: any): void;
}
+68
View File
@@ -0,0 +1,68 @@
/// <reference path="./favico.js.d.ts"/>
// constructor options
var plain = (): favicojs.Favico => new Favico({
});
var repositioned = (): favicojs.Favico => new Favico({
position: 'upleft'
});
var shaped = (): favicojs.Favico => new Favico({
type: 'rectangle'
});
var usingCustomFont = (): favicojs.Favico => new Favico({
fontFamily: 'FontAwesome',
elementId: 'badgefont'
});
var colored = (): favicojs.Favico => new Favico({
bgColor: '#5CB85C',
textColor: '#ff0'
});
var domBound = (): favicojs.Favico => new Favico({
element: document.getElementById('favico')
});
var iconUrlHandler = (url: string): void => {
console.log(url);
};
var withDataUrl = (): favicojs.Favico => new Favico({
dataUrl: iconUrlHandler
});
var favicons: favicojs.Favico[] = [
plain(),
repositioned(),
shaped(),
usingCustomFont(),
colored(),
domBound(),
withDataUrl(),
];
// public methods
favicons.map(favico => {
// badge
favico.badge(2);
favico.badge(3, 'slide');
favico.badge(3000, {animation: 'none', type: 'rectangle'});
favico.reset();
// image
favico.image(document.getElementById('image'));
// video
favico.video(document.getElementById('video'));
// webcam
favico.webcam();
});
+43
View File
@@ -0,0 +1,43 @@
// Type definitions for favico.js
// Project: http://lab.ejci.net/favico.js/
// Definitions by: Yu Matsushita <https://github.com/drowse314-dev-ymat>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module favicojs {
interface FavicoJsStatic {
new (opt?: FavicoJsOptions): Favico;
}
interface FavicoJsOptions {
bgColor?: string;
textColor?: string;
fontFamily?: string;
fontStyle?: string;
type?: string;
position?: string;
animation?: string;
elementId?: string;
element?: HTMLElement;
dataUrl?: (url: string) => any;
}
interface Favico {
badge(number: number): void;
badge(number: number, animation: string): void;
badge(number: number, opts: FavicoJsOptions): void;
reset(): void;
image(imageElement: HTMLElement): void;
video(imageElement: HTMLElement): void;
webcam(): void;
}
}
declare var Favico: favicojs.FavicoJsStatic;
+23 -23
View File
@@ -1,29 +1,29 @@
/// <reference path="fbsdk.d.ts" />
window.fbAsyncInit = function() {
FB.init(
{
appId : '{your-app-id}',
xfbml : true,
version : 'v2.0'
}
);
FB.init(
{
appId : '{your-app-id}',
xfbml : true,
version : 'v2.0'
}
);
FB.ui(
{
method: 'share',
href: 'https://developers.facebook.com/docs/dialogs/'
},
function(response) {
console.log(response);
}
);
FB.ui(
{
method: 'share',
href: 'https://developers.facebook.com/docs/dialogs/'
},
function(response) {
console.log(response);
}
);
FB.api(
"/me",
"POST",
function (fbResponse){
console.log(fbResponse);
}
);
FB.api(
"/me",
"POST",
function (fbResponse){
console.log(fbResponse);
}
);
};
+130 -76
View File
@@ -4,132 +4,186 @@
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface FBInitParams{
appId ?: string;
authResponse ?: string;
cookie ?: boolean;
frictionlessRequests ?: boolean;
hideFlashCallback ?: Function;
logging ?: boolean;
status ?: boolean;
version ?: string;
xfbml ?: boolean;
appId?: string;
authResponse?: string;
cookie?: boolean;
frictionlessRequests?: boolean;
hideFlashCallback?: Function;
logging?: boolean;
status?: boolean;
version?: string;
xfbml?: boolean;
}
interface FBUIParams{
method : string;
interface ShareDialogParams {
method: string; // "share"
href: string;
}
interface PageTabDialogParams {
method: string; // "pagetab"
app_id: string;
redirect_uri?: string;
display?: any;
}
interface RequestsDialogParams {
method: string; // "apprequests"
app_id: string;
redirect_uri?: string;
to?: string;
message: string;
action_type?: string; // "send" | "askfor" | "turn"
object_id?: string;
filters: string /* "app_users" | "app_non_users" */ | {
name: string;
user_ids: string[];
};
suggestions?: string[];
exclude_ids?: string[];
max_recipients?: number;
data?: string;
title?: string;
}
interface SendDialogParams {
method: string; // "send"
app_id: string;
redirect_uri?: string;
display?: any;
to?: string;
link: string;
}
interface PayDialogParams {
method: string; // "pay"
action: string; // "purchaseitem"
product: string;
quantity?: number;
quantity_min?: number;
quantity_max?: number;
request_id?: string;
pricepoint_id?: string;
test_currency?: string;
}
declare type FBUIParams = ShareDialogParams
| PageTabDialogParams
| RequestsDialogParams
| SendDialogParams
| PayDialogParams;
interface FBLoginOptions{
auth_type ?: string;
scope ?: string;
return_scopes ?: boolean;
enable_profile_selector ?: boolean;
profile_selector_ids ?: string;
auth_type?: string;
scope?: string;
return_scopes?: boolean;
enable_profile_selector?: boolean;
profile_selector_ids?: string;
}
interface FBSDKEvents{
/* This method allows you to subscribe to a range of events, and define callback functions for when they fire. */
subscribe(event : string, callback : (fbResponseObject : Object) => any) : void;
/* This method allows you to subscribe to a range of events, and define callback functions for when they fire. */
subscribe(event : string, callback : (fbResponseObject : Object) => any) : void;
/* This method allows you to un-subscribe a callback from any events previously subscribed to using .Event.subscribe(). */
unsubscribe(event : string, callback : (fbResponseObject : Object) => any) : void;
/* This method allows you to un-subscribe a callback from any events previously subscribed to using .Event.subscribe(). */
unsubscribe(event : string, callback : (fbResponseObject : Object) => any) : void;
}
interface FBSDKXFBML{
/* This function parses and renders XFBML markup in a document on the fly. */
parse(ParseElement ?: Element) : void;
parse(ParseElement ?: HTMLElement) : void;
/* This function parses and renders XFBML markup in a document on the fly. */
parse(ParseElement?: Element) : void;
parse(ParseElement?: HTMLElement) : void;
}
interface FBSDKCanvasPrefetcher{
/* Tells Facebook that the current page uses a specified resource. */
addStaticResource(res : string) : void;
/* Tells Facebook that the current page uses a specified resource. */
addStaticResource(res : string) : void;
/* Controls how statistics are collected on resources used by your application. */
setCollectionMode(option : string) : void;
/* Controls how statistics are collected on resources used by your application. */
setCollectionMode(option : string) : void;
}
interface FBSDKCanvasSize{
height ?: Number;
width ?: Number;
height?: Number;
width?: Number;
}
interface FBSDKCanvasDoneLoading{
time_delta_ms : Number;
time_delta_ms : Number;
}
interface FBSDKCanvas{
Prefetcher : FBSDKCanvasPrefetcher;
Prefetcher : FBSDKCanvasPrefetcher;
/* Hides the HTML element passed in via the elem param from view. */
hideFlashElement(element : Element) : void;
hideFlashElement(element : HTMLElement) : void;
/* Hides the HTML element passed in via the elem param from view. */
hideFlashElement(element : Element) : void;
hideFlashElement(element : HTMLElement) : void;
/* Displays the HTML element passed in via the elem param, after it has been hidden via FB.Canvas.hideFlashElement. */
showFlashElement(element : Element) : void;
showFlashElement(element : HTMLElement) : void;
/* Displays the HTML element passed in via the elem param, after it has been hidden via FB.Canvas.hideFlashElement. */
showFlashElement(element : Element) : void;
showFlashElement(element : HTMLElement) : void;
/* Tells Facebook to scroll to a specific location of your canvas page. */
scrollTo(x : Number, y : Number) : void;
/* Tells Facebook to scroll to a specific location of your canvas page. */
scrollTo(x : Number, y : Number) : void;
/* Starts or stops a timer which will grow your iframe to fit the content every few milliseconds. */
setAutoGrow(stopTimer : boolean) : void;
setAutoGrow(diffInterval : Number) : void;
setAutoGrow(stopTimer : boolean, diffInterval : Number) : void
/* Starts or stops a timer which will grow your iframe to fit the content every few milliseconds. */
setAutoGrow(stopTimer : boolean) : void;
setAutoGrow(diffInterval : Number) : void;
setAutoGrow(stopTimer : boolean, diffInterval : Number) : void
/* Tells Facebook to resize your iframe. */
setSize(canvasSizeOptions : FBSDKCanvasSize) : void;
/* Tells Facebook to resize your iframe. */
setSize(canvasSizeOptions : FBSDKCanvasSize) : void;
/* Registers the callback for inline processing (i.e. without page reload) of user actions when they click on any link to the current app from Canvas */
setUrlHandler(handler ?: Function) : string;
/* Registers the callback for inline processing (i.e. without page reload) of user actions when they click on any link to the current app from Canvas */
setUrlHandler(handler?: Function) : string;
/* Calls you back with an integer, in milliseconds, of the timing of the page load, beginning from the time when the first bytes arrive on
the client, and ending from the point at which you call this function.
*/
setDoneLoading(handler ?: Function) : FBSDKCanvasDoneLoading;
/* Calls you back with an integer, in milliseconds, of the timing of the page load, beginning from the time when the first bytes arrive on
the client, and ending from the point at which you call this function.
*/
setDoneLoading(handler?: Function) : FBSDKCanvasDoneLoading;
/* Call startTimer to resume the timer after a period of time for the page load that you didn't wish to measure, which you began by calling stopTimer. */
startTimer() : void;
/* Call startTimer to resume the timer after a period of time for the page load that you didn't wish to measure, which you began by calling stopTimer. */
startTimer() : void;
/* Call stopTimer when you wish to stop timing the page load for a period of time */
stopTimer(handler ?: (fbResponseObject : Object) => any) : void;
/* Call stopTimer when you wish to stop timing the page load for a period of time */
stopTimer(handler?: (fbResponseObject : Object) => any) : void;
}
interface FBSDK{
/* This method is used to initialize and setup the SDK. */
init(fbInitObject : FBInitParams) : void;
/* This method is used to initialize and setup the SDK. */
init(fbInitObject : FBInitParams) : void;
/* This method lets you make calls to the Graph API. */
api(path : string, method : string, callback : (fbResponseObject : Object) => any) : Object;
api(path : string, params : Object, callback : (fbResponseObject : Object) => any) : Object;
api(path : string, method : string, params : Object, callback : (fbResponseObject : Object) => any) : Object;
/* This method lets you make calls to the Graph API. */
api(path : string, method : string, callback : (fbResponseObject : Object) => any) : Object;
api(path : string, params : Object, callback : (fbResponseObject : Object) => any) : Object;
api(path : string, method : string, params : Object, callback : (fbResponseObject : Object) => any) : Object;
/* This method is used to trigger different forms of Facebook created UI dialogs. */
ui(params : FBUIParams, handler : (fbResponseObject : Object) => any) : void;
/* This method is used to trigger different forms of Facebook created UI dialogs. */
ui(params : FBUIParams, handler : (fbResponseObject : Object) => any) : void;
/* Allows you to determine if a user is logged in to Facebook and has authenticated your app */
getLoginStatus(handler : Function, force ?: Boolean) : void;
/* Allows you to determine if a user is logged in to Facebook and has authenticated your app */
getLoginStatus(handler : Function, force?: Boolean) : void;
/* Calling FB.login prompts the user to authenticate your application using the Login Dialog. */
login(handler : (fbResponseObject : Object) => any, params ?: FBLoginOptions): void;
/* Calling FB.login prompts the user to authenticate your application using the Login Dialog. */
login(handler : (fbResponseObject : Object) => any, params?: FBLoginOptions): void;
/* Log the user out of your site and Facebook */
logout(handler : (fbResponseObject : Object) => any) : void;
/* Log the user out of your site and Facebook */
logout(handler : (fbResponseObject : Object) => any) : void;
/* Synchronous accessor for the current authResponse. */
getAuthResponse() : Object;
/* Synchronous accessor for the current authResponse. */
getAuthResponse() : Object;
Event : FBSDKEvents;
XFBML : FBSDKXFBML;
Canvas : FBSDKCanvas;
Event : FBSDKEvents;
XFBML : FBSDKXFBML;
Canvas : FBSDKCanvas;
}
interface Window{
fbAsyncInit() : any;
fbAsyncInit() : any;
}
declare module "FB" {
export = FB;
export = FB;
}
declare var FB : FBSDK;
+1
View File
@@ -11,5 +11,6 @@ declare module "form-data" {
getHeaders(): Object;
// TODO expand pipe
pipe(to: any): any;
submit(params: string|Object, callback: (error: any, response: any) => void): any;
}
}
+8
View File
@@ -0,0 +1,8 @@
// Type definitions for freedom v0.6.26
// Project: https://github.com/freedomjs/freedom
// Definitions by: Jonathan Pevarnek <https://github.com/jpevarnek/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="./freedom.d.ts" />
declare var freedom :freedom.FreedomInCoreEnv;
+8
View File
@@ -0,0 +1,8 @@
// Type definitions for freedom v0.6.26
// Project: https://github.com/freedomjs/freedom
// Definitions by: Jonathan Pevarnek <https://github.com/jpevarnek/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="./freedom.d.ts" />
declare var freedom :freedom.FreedomInModuleEnv;
+24
View File
@@ -0,0 +1,24 @@
/// <reference path="../es6-promise/es6-promise.d.ts"/>
/// <reference path="freedom.d.ts" />
var freedomModule :freedom.FreedomInModuleEnv;
var freedomCore :freedom.FreedomInCoreEnv;
var parentModule :freedom.ParentModuleThing = freedomModule();
parentModule.on('message', (x :string) => {
});
var coreInModule :freedom.Core = freedomModule['core']();
coreInModule.getLogger('tag').then((logger :freedom.Logger) => {
logger.log('message');
});
var freedomConsole :freedom.Console.Console = freedomModule['core.console']();
var doneLogging :Promise<void> = freedomConsole.log('source', 'message');
freedomCore('freedom-module.json', {
'logger': 'loggingprovider.json',
'debug': 'log'
}).then((moduleFactory) => {
moduleFactory.close();
});
+573
View File
@@ -0,0 +1,573 @@
// Type definitions for freedom v0.6.26
// Project: https://github.com/freedomjs/freedom
// Definitions by: Jonathan Pevarnek <https://github.com/jpevarnek/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../es6-promise/es6-promise.d.ts"/>
declare module freedom {
// Common on/emit for message passing interfaces.
interface EventDispatchFn<T> { (eventType: string, value?: T): void; }
interface EventHandlerFn<T> {
(eventType: string, handler: (eventData:T) => void): void;
}
interface Error {
errcode: string;
message: string;
}
// TODO: replace OnAndEmit with EventHandler and EventEmitter;
interface OnAndEmit<T,T2> {
on: EventHandlerFn<T>;
emit: EventDispatchFn<T2>;
}
interface EventHandler {
// Adds |f| as an event handler for all subsiquent events of type |t|.
on(t: string, f: Function): void;
// Adds |f| as an event handler for only the next event of type |t|.
once(t: string, f: Function): void;
// The |off| function removes the event event handling function |f| from
// both |on| and the |once| event handling.
off(t: string, f: Function): void;
}
interface PortModule<T, T2> extends OnAndEmit<T, T2> {
controlChannel: string;
}
interface ModuleSelfConstructor {
// Identifies a named API's provider class.
provideSynchronous: (classFn?: Function) => void;
provideAsynchronous :(classFn?: Function) => void;
providePromises: (classFn?: Function) => void;
}
interface ParentModuleThing extends ModuleSelfConstructor, OnAndEmit<any, any> {
}
interface Logger {
debug(...args: any[]): void;
info(...args: any[]): void;
log(...args: any[]): void;
warn(...args: any[]): void;
error(...args: any[]): void;
}
// See |Core_unprivileged| in |core.unprivileged.js|
interface Core {
// Create a new channel which which to communicate between modules.
createChannel(): Promise<ChannelSpecifier>;
// Given an ChannelEndpointIdentifier for a channel, create a proxy event
// interface for it.
bindChannel(channelIdentifier: string): Promise<Channel>;
// Returns the list of identifiers describing the dependency path.
getId(): Promise<string[]>;
getLogger(tag: string): Promise<Logger>;
}
// Channels are ways that freedom modules can send each other messages.
interface Channel extends OnAndEmit<any,any> {
close(): void;
}
// Specification for a channel.
interface ChannelSpecifier {
channel: Channel; // How to communicate over this channel.
// A freedom channel endpoint identifier. Can be passed over a freedom
// message-passing boundary. It is used to create a channel to the freedom
// module that called createChannel and created this ChannelSpecifier.
identifier: string;
}
// This is the first argument given to a core provider's constructor. It is an
// object that describes the parent module the core provider instance has been
// created for.
interface CoreProviderParentApp {
manifestId: string;
config: {
views: {[viewName: string]: Object};
};
global: {
removeEventListener: (s: string, f: Function, b: boolean) => void;
};
}
// A Freedom module sub is both a function and an object with members. The
// type |T| is the type of the module's stub interface.
interface FreedomModuleFactoryManager<T> {
// This is the factory constructor for a new instance of a stub/channel to a
// module.
(...args: any[]): T;
// This is the call to close a particular stub's channel and resources. It
// is assumed that the argument is a result of the factory constructor. If
// no argument is supplied, all stubs are closed.
close: (freedomModuleStubInstance?: T) => Promise<void>;
api: string;
}
interface FreedomInCoreEnvOptions {
debug?: string; // debug level
logger?: string; // string to json for logging provider.
}
interface FreedomInCoreEnv extends OnAndEmit<any,any> {
// Represents the call to freedom when you create a root module. Returns a
// promise to a factory constructor for the freedom module. The
// |manifestPath| should be a path to a json string that specifies the
// freedom module.
(manifestPath: string, options?: FreedomInCoreEnvOptions):
Promise<FreedomModuleFactoryManager<any>>;
}
interface FreedomInModuleEnv {
// Represents the call to freedom(), which returns the parent module's
// freedom stub interface in an on/emit style. This is a getter.
(): ParentModuleThing;
// Creates an interface to the freedom core provider which can be used to
// create loggers and channels.
// Note: unlike other providers, core is a getter.
'core': FreedomModuleFactoryManager<Core>;
'core.console': FreedomModuleFactoryManager<Console.Console>;
'core.rtcdatachannel': FreedomModuleFactoryManager<RTCDataChannel.RTCDataChannel>;
'core.rtcpeerconnection': FreedomModuleFactoryManager<RTCPeerConnection.RTCPeerConnection>;
'core.storage': FreedomModuleFactoryManager<Storage.Storage>;
'core.tcpsocket': FreedomModuleFactoryManager<TcpSocket.Socket>;
'core.udpsocket': FreedomModuleFactoryManager<UdpSocket.Socket>;
'pgp': FreedomModuleFactoryManager<PgpProvider.PgpProvider>;
'portControl': FreedomModuleFactoryManager<PortControl.PortControl>;
// We use this specification so that you can reference freedom sub-modules by
// an array-lookup of its name. One day, maybe we'll have a nicer way to do
// this.
[moduleName: string]: FreedomModuleFactoryManager<any>;
}
// This generic interface represents any freedom method. Its purpose is to extend
// the basic definition to include the reckless call method, which does not
// produce a reply message.
interface Method0<R> {
(): Promise<R>;
reckless: () => void;
}
interface Method1<T, R> {
(a: T): Promise<R>;
reckless: (a: T) => void;
}
interface Method2<T, U, R> {
(a: T, b: U) : Promise<R>;
reckless: (a: T, b: U) => void;
}
interface Method3<T, U, V, R> {
(a: T, b: U, c: V): Promise<R>;
reckless: (a: T, b: U, c: V) => void;
}
}
declare module freedom.Console {
interface Console {
log(source: string, message: string): Promise<void>;
debug(source: string, message: string): Promise<void>;
info(source: string, message: string): Promise<void>;
warn(source: string, message: string): Promise<void>;
error(source: string, message: string): Promise<void>;
}
}
declare module freedom.RTCDataChannel {
interface Message {
// Exactly one of the below must be specified.
text?: string;
buffer?: ArrayBuffer;
binary?: Blob; // Not yet supported in Chrome.
}
// Constructed by |freedom['rtcdatachannel'](id)| where |id| is a string
// representing the channel id created by an |rtcpeerconnection| object.
interface RTCDataChannel {
getLabel(): Promise<string>;
getOrdered(): Promise<boolean>;
getMaxPacketLifeTime(): Promise<number>;
getMaxRetransmits(): Promise<number>;
getProtocol(): Promise<string>;
getNegotiated(): Promise<boolean>;
getId(): Promise<number>;
getReadyState(): Promise<string>;
getBufferedAmount(): Promise<number>;
on(t: 'onopen', f: () => void): void;
on(t: 'onerror', f: () => void): void;
on(t: 'onclose', f: () => void): void;
on(t: 'onmessage', f: (m: Message) => void): void;
on(t: string, f: Function): void;
close(): Promise<void>;
getBinaryType(): Promise<string>;
setBinaryType(type: string): Promise<void>;
send: freedom.Method1<string, void>;
sendBuffer: freedom.Method1<ArrayBuffer, void>;
}
}
declare module freedom.RTCPeerConnection {
interface RTCIceServer {
urls: string[];
username?: string;
credential?: string;
}
interface RTCConfiguration {
iceServers: RTCIceServer[];
iceTransports?: string;
peerIdentity?: string;
}
interface RTCOfferOptions {
offerToReceiveVideo?: number;
offerToReceiveAudio?: number;
voiceActivityDetection?: boolean;
iceRestart?: boolean;
}
interface RTCSessionDescription {
type: string;
sdp: string;
}
interface RTCIceCandidate {
candidate: string;
sdpMid?: string;
sdpMLineIndex?: number;
}
interface OnIceCandidateEvent {
candidate: RTCIceCandidate
}
interface RTCDataChannelInit {
ordered?: boolean;
maxPacketLifeTime?: number;
maxRetransmits?: number;
protocol?: string;
negotiated?: boolean;
id?: number;
}
// Note: the freedom factory constructor
// |freedom['rtcpeerconnection'](config)| to create an RTCPeerConnection has
// |RTCConfiguration| as the type of its config its argument.
interface RTCPeerConnection {
createOffer(options?: RTCOfferOptions): Promise<RTCSessionDescription>;
createAnswer(): Promise<RTCSessionDescription>;
setLocalDescription(desc: RTCSessionDescription): Promise<void>;
getLocalDescription(): Promise<RTCSessionDescription>;
setRemoteDescription(desc: RTCSessionDescription): Promise<void>;
getRemoteDescription(): Promise<RTCSessionDescription>;
getSignalingState(): Promise<string>;
updateIce(configuration: RTCConfiguration): Promise<void>;
addIceCandidate(candidate: RTCIceCandidate): Promise<void>;
getIceGatheringState(): Promise<string>;
getIceConnectionState(): Promise<string>;
getConfiguration(): Promise<RTCConfiguration>;
getLocalStreams(): Promise<string[]>;
getRemoteStreams(): Promise<string[]>;
getStreamById(id: string): Promise<string>;
addStream(ref: string): Promise<void>;
removeStream(ref: string): Promise<void>;
close(): Promise<void>;
createDataChannel(label: string, init: RTCDataChannelInit): Promise<string>;
getStats(selector?: string): Promise<any>;
on(t: 'ondatachannel', f: (d: {channel: string}) => void): void;
on(t: 'onnegotiationneeded', f: () => void): void;
on(t: 'onicecandidate', f: (d: OnIceCandidateEvent) => void): void;
on(t: 'onsignalingstatechange', f: () => void): void;
on(t: 'onaddstream', f: (d: {stream: number}) => void): void;
on(t: 'onremovestream', f: (d: {stream: number}) => void): void;
on(t: 'oniceconnectionstatechange', f: () => void): void;
on(t: string, f: Function): void;
}
}
declare module freedom.Storage {
interface Storage {
// Fetch array of all keys.
keys(): Promise<string[]>;
// Fetch a value for a key.
get(key: string): Promise<string>;
// Sets a value to a key. Fulfills promise with the previous value, if it
// exists.
set(key: string, value: string): Promise<string>;
// Remove a single key. Fulfills promise with previous value, if exists.
remove(key: string): Promise<string>;
// Remove all data from storage.
clear(): Promise<void>;
} // class Storage
}
declare module freedom.TcpSocket {
interface DisconnectInfo {
errcode: string;
message: string;
}
interface ReadInfo {
data: ArrayBuffer;
}
interface WriteInfo {
bytesWritten: number;
}
interface SocketInfo {
connected: boolean;
localAddress?: string;
localPort?: number;
peerAddress?: string;
peerPort?: number;
}
interface ConnectInfo {
socket: number;
host: string;
port: number;
}
// The TcpSocket class (freedom['core.TcpSocket'])
interface Socket {
listen(address: string, port: number): Promise<void>;
connect(hostname: string, port: number): Promise<void>;
secure(): Promise<void>;
write: freedom.Method1<ArrayBuffer, WriteInfo>;
pause: freedom.Method0<void>;
resume: freedom.Method0<void>;
getInfo(): Promise<SocketInfo>;
close(): Promise<void>;
// TcpSockets have 3 types of events:
on(type: 'onConnection', f: (i: ConnectInfo) => void): void;
on(type: 'onData', f: (i:ReadInfo) => void): void;
off(type: 'onData', f: (i: ReadInfo) => void): void;
on(type: 'onDisconnect', f: (i: DisconnectInfo) => void): void;
on(eventType: string, f: (i: Object) => void): void;
off(eventType: string, f: (i: Object) => void): void;
}
}
declare module freedom.UdpSocket {
// Type for the chrome.socket.getInfo callback:
// https://developer.chrome.com/apps/sockets_udp#type-SocketInfo
// This is also the type returned by getInfo().
interface SocketInfo {
// Note that there are other fields but these are the ones we care about.
localAddress: string;
localPort: number;
}
// Type for the chrome.socket.recvFrom callback:
// http://developer.chrome.com/apps/socket#method-recvFrom
// This is also the type returned to onData callbacks.
interface RecvFromInfo {
resultCode: number;
address: string;
port: number;
data: ArrayBuffer;
}
interface Implementation {
bind(address: string, port: number, continuation: () => void) : void;
sendTo(data: ArrayBuffer, address: string, port: number,
continuation: (bytesWritten: number) => void): void;
destroy(continuation: () => void): void;
getInfo(continuation: (socketInfo: SocketInfo) => void): void;
}
interface Socket {
bind: (address: string, port: number) => Promise<void>;
sendTo: freedom.Method3<ArrayBuffer, string, number, number>;
destroy: () => Promise<void>;
on: (name: string, listener: Function) => void;
getInfo: () => Promise<SocketInfo>;
}
}
declare module freedom.PgpProvider {
interface PublicKey {
key: string;
fingerprint: string;
}
interface VerifyDecryptResult {
data: ArrayBuffer;
signedBy: string[];
}
interface PgpProvider {
// Standard freedom crypto API
setup(passphrase: string, userid: string): Promise<void>;
clear(): Promise<void>;
exportKey(): Promise<PublicKey>;
signEncrypt(data: ArrayBuffer, encryptKey?: string,
sign?: boolean): Promise<ArrayBuffer>;
verifyDecrypt(data: ArrayBuffer,
verifyKey?: string): Promise<VerifyDecryptResult>;
armor(data: ArrayBuffer, type?: string): Promise<string>;
dearmor(data: string): Promise<ArrayBuffer>;
}
}
declare module freedom.PortControl {
interface Mapping {
internalIp: string;
internalPort: number;
externalIp?: string;
externalPort: number;
lifetime: number;
protocol: string;
timeoutId?: number;
nonce?: number[];
errInfo?: string;
}
// A collection of Mappings
interface ActiveMappings {
[extPort: string]: Mapping;
}
// An object returned by probeProtocolSupport()
interface ProtocolSupport {
natPmp: boolean;
pcp: boolean;
upnp: boolean;
}
// Main interface for the module
interface PortControl {
addMapping(intPort: number, extPort: number, lifetime: number): Promise<Mapping>;
deleteMapping(extPort: number): Promise<boolean>;
probeProtocolSupport(): Promise<ProtocolSupport>;
probePmpSupport(): Promise<boolean>;
addMappingPmp(intPort: number, extPort: number, lifetime: number): Promise<Mapping>;
deleteMappingPmp(extPort: number): Promise<boolean>;
probePcpSupport(): Promise<boolean>;
addMappingPcp(intPort: number, extPort: number, lifetime: number): Promise<Mapping>;
deleteMappingPcp(extPort: number): Promise<boolean>;
probeUpnpSupport(): Promise<boolean>;
addMappingUpnp(intPort: number, extPort: number, lifetime: number,
controlUrl?: string): Promise<Mapping>;
deleteMappingUpnp(extPort: number): Promise<boolean>;
getActiveMappings(): Promise<ActiveMappings>;
getPrivateIps(): Promise<string[]>;
close(): Promise<void>;
}
}
declare module freedom.Social {
// Status of a client connected to a social network.
interface ClientState {
userId: string;
clientId: string;
status: string; // Either ONLINE, OFFLINE, or ONLINE_WITH_OTHER_APP
timestamp: number;
}
// The profile of a user on a social network.
interface UserProfile {
userId: string;
name: string;
url?: string;
// Image URI (e.g. data:image/png;base64,adkwe329...)
imageData?: string;
timestamp?: number;
}
interface Users {
[userId: string]: UserProfile;
}
interface Clients {
[clientId: string]: ClientState;
}
// Event for an incoming messages
interface IncomingMessage {
// UserID/ClientID/status of user from whom the message comes from.
from: ClientState;
// Message contents.
message: string;
}
// A request to login to a specific network as a specific agent
interface LoginRequest {
// Name of the application connecting to the network. Other logins with
// the same agent field will be listed as having status |ONLINE|, where
// those with different agents will be listed as
// |ONLINE_WITH_OTHER_CLIENT|
agent: string;
// Version of application
version: string;
// URL of application
url: string;
// When |interactive === true| social will always prompt user for login.
// Promise fails if the user did not login or provided invalid
// credentials. When |interactive === false|, promise fails unless the
// social provider has cached tokens/credentials.
interactive: boolean;
// When true, social provider will remember the token/credentials.
rememberLogin: boolean;
}
interface Social {
// Generic Freedom Event stuff. |on| binds an event handler to event type
// |eventType|. Every time |eventType| event is raised, the function |f|
// will be called.
//
// Message type |onMessage| happens when the user receives a message from
// another contact.
on(eventType: string, f: Function) : void;
on(eventType: 'onMessage', f: (message: IncomingMessage) => void): void;
// Message type |onRosterProfile| events are received when another user's
// profile is received or when a client changes status.
on(eventType: 'onUserProfile', f: (profile: UserProfile) => void): void;
// Message type |onMyStatus| is received when the user's client's status
// changes, e.g. when disconnected and online status becomes offline.
on(eventType: 'onClientState', f: (status: ClientState) => void): void;
// Do a singleton event binding: |f| will only be called once, on the next
// event of type |eventType|. Same events as above.
once(eventType: string, f: Function): void;
login(loginRequest: LoginRequest): Promise<ClientState>;
getUsers(): Promise<Users>;
getClients(): Promise<Clients>;
// Send a message to user on your network
// If the message is sent to a userId, it is sent to all clients
// If the message is sent to a clientId, it is sent to just that one client
// If the destination id is not specified or invalid, promise rejects.
sendMessage(destinationId: string, message: string): Promise<void>;
// Logs the user out of the social network. After the logout promise, the
// user status is OFFLINE.
logout(): Promise<void>;
// Forget any tokens/credentials used for logging in with the last used
// userId.
clearCachedCredentials(): Promise<void>;
}
} // declare module Social
+28
View File
@@ -0,0 +1,28 @@
/// <reference path="fs-ext.d.ts" />
/// <reference path="../node/node.d.ts" />
import fs = require('fs-ext');
var num:number;
var str:string;
//from node.js 'fs' module
fs.appendFileSync(str, "data");
fs.flock(num, str, (err)=>{
});
fs.flockSync(num, str);
fs.fcntl(num, str, num, (err, res)=>{
});
fs.fcntl(num, str, (err, res)=>{
});
fs.fcntlSync(num, str, num);
fs.seek(num, num, num, (err, pos)=>{
});
fs.seekSync(num, num, num);
fs.utime(str, num, num, (err)=>{
});
fs.utimeSync(str, num, num);
+102
View File
@@ -0,0 +1,102 @@
// Type definitions for fs-ext
// Project: https://github.com/baudehlo/node-fs-ext
// Definitions by: Oguzhan Ergin <https://github.com/OguzhanE>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
///<reference path="../node/node.d.ts"/>
declare module "fs-ext" {
export * from "fs";
/**
* Asynchronous flock(2). No arguments other than a possible error are passed to the callback.
* @param fd File Descriptor
* @param flags Flags can be 'sh', 'ex', 'shnb', 'exnb', 'un' and correspond to the various LOCK_SH, LOCK_EX, LOCK_SH|LOCK_NB, etc.
**/
export function flock(fd: number, flags: string, callback: (err: Error) => void): void;
/**
* Synchronous flock(2). Throws an exception on error.
* @param fd File Descriptor
* @param flags Flags can be 'sh', 'ex', 'shnb', 'exnb', 'un' and correspond to the various LOCK_SH, LOCK_EX, LOCK_SH|LOCK_NB, etc.
**/
export function flockSync(fd: number, flags: string):void;
/**
* Asynchronous fcntl(2).
* @param fd File Descriptor
* @param cmd The supported commands are: 'getfd' ( F_GETFD ) , 'setfd' ( F_SETFD )
* Requiring this module adds FD_CLOEXEC to the constants module, for use with F_SETFD.
* @param arg arg
**/
export function fcntl(fd: number, cmd: string, arg: number, callback: (err: Error, result: number) => void):void;
/**
* Asynchronous fcntl(2).
* @param fd File Descriptor
* @param cmd The supported commands are: 'getfd' ( F_GETFD ) , 'setfd' ( F_SETFD )
* Requiring this module adds FD_CLOEXEC to the constants module, for use with F_SETFD.
**/
export function fcntl(fd: number, cmd: string, callback: (err: Error, result: number) => void):void;
/**
* Synchronous fcntl(2). Throws an exception on error.
* @param fd File Descriptor
* @param cmd The supported commands are: 'getfd' ( F_GETFD ) , 'setfd' ( F_SETFD )
* Requiring this module adds FD_CLOEXEC to the constants module, for use with F_SETFD.
* @param arg arg
* @return Returns flags
**/
export function fcntlSync(fd: number, cmd: string, arg?: number): number;
/**
* Asynchronous lseek(2).
* @param fd File Descriptor
* @param offset Offset
* @param whence
* Whence can be 0 (SEEK_SET) to set the new position in bytes to offset, 1 (SEEK_CUR) to set the new
* position to the current position plus offset bytes (can be negative), or 2 (SEEK_END) to set to the end
* of the file plus offset bytes (usually negative or zero to seek to the end of the file).
**/
export function seek(fd: number, offset: number, whence: number, callback: (err: Error, currFilePos: number) => void): void;
/**
* Synchronous lseek(2). Throws an exception on error. Returns current file position.
* @param fd File Descriptor
* @param offset Offset
* @param whence
* Whence can be 0 (SEEK_SET) to set the new position in bytes to offset, 1 (SEEK_CUR) to set the new
* position to the current position plus offset bytes (can be negative), or 2 (SEEK_END) to set to the end
* of the file plus offset bytes (usually negative or zero to seek to the end of the file).
* @returns Returns current file position.
**/
export function seekSync(fd: number, offset: number, whence: number): number;
/**
* Asynchronous utime(2).
* @param path File path
* @param atime
* Arguments atime and mtime are in seconds as for the system call.Note that the number value of Date() is in milliseconds,
* so to use the 'now' value with fs.utime() you would have to divide by 1000 first, e.g. Date.now()/1000
* Just like for utime(2), the absence of the atime and mtime means 'now'.
* @param mtime
* Arguments atime and mtime are in seconds as for the system call.Note that the number value of Date() is in milliseconds,
* so to use the 'now' value with fs.utime() you would have to divide by 1000 first, e.g. Date.now()/1000
* Just like for utime(2), the absence of the atime and mtime means 'now'.
**/
export function utime(path: string, atime: number, mtime: number, callback: (err: Error) => void):void;
/**
* Synchronous version of utime(). Throws an exception on error.
* @param path File path
* @param atime
* Arguments atime and mtime are in seconds as for the system call.Note that the number value of Date() is in milliseconds,
* so to use the 'now' value with fs.utime() you would have to divide by 1000 first, e.g. Date.now()/1000
* Just like for utime(2), the absence of the atime and mtime means 'now'.
* @param mtime
* Arguments atime and mtime are in seconds as for the system call.Note that the number value of Date() is in milliseconds,
* so to use the 'now' value with fs.utime() you would have to divide by 1000 first, e.g. Date.now()/1000
* Just like for utime(2), the absence of the atime and mtime means 'now'.
**/
export function utimeSync(path: string, atime: number, mtime: number):void;
}
-1
View File
@@ -44,7 +44,6 @@ declare module GeoJSON {
*/
export interface MultiPoint extends GeometryObject
{
coordinates: Position[]
}
@@ -44,6 +44,9 @@ app.on('ready', () => {
// and load the index.html of the app.
mainWindow.loadUrl(`file://${__dirname}/index.html`);
mainWindow.openDevTools()
var opened: boolean = mainWindow.isDevToolsOpened()
mainWindow.toggleDevTools()
// Emitted when the window is closed.
mainWindow.on('closed', () => {
// Dereference the window object, usually you would store windows
@@ -51,6 +54,35 @@ app.on('ready', () => {
// when you should delete the corresponding element.
mainWindow = null;
});
mainWindow.print({silent: true, printBackground: false});
mainWindow.webContents.print({silent: true, printBackground: false});
mainWindow.print();
mainWindow.webContents.print();
mainWindow.print({silent: true, printBackground: false});
mainWindow.webContents.print({silent: true, printBackground: false});
mainWindow.print();
mainWindow.webContents.print();
mainWindow.printToPDF({
marginsType: 1,
pageSize: 'A3',
printBackground: true,
printSelectionOnly: true,
landscape: true,
}, (error: Error, data: Buffer) => {});
mainWindow.webContents.printToPDF({
marginsType: 1,
pageSize: 'A3',
printBackground: true,
printSelectionOnly: true,
landscape: true,
}, (error: Error, data: Buffer) => {});
mainWindow.printToPDF({}, (err, data) => {});
mainWindow.webContents.printToPDF({}, (err, data) => {});
});
// Desktop environment integration
+71 -6
View File
@@ -356,6 +356,10 @@ declare module GitHubElectron {
* Closes the developer tools.
*/
closeDevTools(): void;
/**
* Returns whether the developer tools are opened.
*/
isDevToolsOpened(): boolean;
/**
* Toggle the developer tools.
*/
@@ -377,17 +381,22 @@ declare module GitHubElectron {
capturePage(rect: Rectangle, callback: (image: NativeImage) => void): void;
capturePage(callback: (image: NativeImage) => void): void;
/**
* Prints the window's web page. Calling window.print() in a web page is
* equivalent to calling BrowserWindow.print({silent: false, printBackground: false}).
* Same with webContents.print([options])
*/
print(options?: {
/**
* When false, Electron will pick up system's default printer and default
* settings for printing.
*/
silent?: boolean;
printBackground?: boolean;
}): void;
/**
* Same with webContents.printToPDF([options])
*/
printToPDF(options: {
marginsType?: number;
pageSize?: string;
printBackground?: boolean;
printSelectionOnly?: boolean;
landscape?: boolean;
}, callback: (error: Error, data: Buffer) => void): void;
/**
* Same with webContents.loadUrl(url).
*/
@@ -659,6 +668,62 @@ declare module GitHubElectron {
* @param isFulfilled Whether the JS promise is fulfilled.
*/
(isFulfilled: boolean) => void): void;
/**
*
* Prints window's web page. When silent is set to false, Electron will pick up system's default printer and default settings for printing.
* Calling window.print() in web page is equivalent to call WebContents.print({silent: false, printBackground: false}).
* Note:
* On Windows, the print API relies on pdf.dll. If your application doesn't need print feature, you can safely remove pdf.dll in saving binary size.
*/
print(options?: {
/**
* Don't ask user for print settings, defaults to false
*/
silent?: boolean;
/**
* Also prints the background color and image of the web page, defaults to false.
*/
printBackground: boolean;
}): void;
/**
* Prints windows' web page as PDF with Chromium's preview printing custom settings.
*/
printToPDF(options: {
/**
* Specify the type of margins to use. Default is 0.
* 0 - default
* 1 - none
* 2 - minimum
*/
marginsType?: number;
/**
* String - Specify page size of the generated PDF. Default is A4.
* A4
* A3
* Legal
* Letter
* Tabloid
*/
pageSize?: string;
/**
* Whether to print CSS backgrounds. Default is false.
*/
printBackground?: boolean;
/**
* Whether to print selection only. Default is false.
*/
printSelectionOnly?: boolean;
/**
* true for landscape, false for portrait. Default is false.
*/
landscape?: boolean;
},
/**
* Callback function on completed converting to PDF.
* error Error
* data Buffer - PDF file content
*/
callback: (error: Error, data: Buffer) => void): void;
/**
* Send args.. to the web page via channel in asynchronous message, the web page
* can handle it by listening to the channel event of ipc module.
+19
View File
@@ -0,0 +1,19 @@
/// <reference path="../gulp/gulp.d.ts" />
/// <reference path="./gulp-changed.d.ts" />
/// <reference path="../gulp-minify-html/gulp-minify-html.d.ts" />
import * as gulp from "gulp";
import changed = require("gulp-changed");
import minifyHtml = require("gulp-minify-html");
// Without options
gulp.src("*.html")
.pipe(changed("build"))
.pipe(minifyHtml())
.pipe(gulp.dest("build"));
// With some options
gulp.src("*.html")
.pipe(changed("build", { hasChanged: changed.compareSha1Digest }))
.pipe(minifyHtml())
.pipe(gulp.dest("build"));
+60
View File
@@ -0,0 +1,60 @@
// Type definitions for gulp-changed
// Project: https://github.com/sindresorhus/gulp-changed
// Definitions by: Thomas Corbière <https://github.com/tomc974>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts"/>
/// <reference path="../vinyl/vinyl.d.ts"/>
declare module "gulp-changed"
{
import { Transform } from "stream";
import File = require("vinyl");
interface IComparator
{
/**
* @param stream Should be used to queue sourceFile if it passes some comparison
* @param callback Should be called when done
* @param sourceFile File to operate on
* @param destPath Destination for sourceFile as an absolute path
*/
(stream: Transform, callback: Function, sourceFile: File, destPath: string): void;
}
interface IDestination
{
(file: string|Buffer): string;
}
interface IOptions
{
/**
* The working directory the folder is relative to.
* @default process.cwd()
*/
cwd?: string;
/**
* Extension of the destination files.
*/
extension?: string;
/**
* Function that determines whether the source file is different from the destination file.
* @default changed.compareLastModifiedTime
*/
hasChanged?: IComparator;
}
interface IGulpChanged
{
(destination: string|IDestination, options?: IOptions): NodeJS.ReadWriteStream;
compareLastModifiedTime: IComparator;
compareSha1Digest: IComparator;
}
const changed: IGulpChanged;
export = changed;
}
+53
View File
@@ -0,0 +1,53 @@
/// <reference path="../gulp/gulp.d.ts" />
/// <reference path="gulp-coffeeify.d.ts" />
import gulp = require('gulp');
import coffeeify = require('gulp-coffeeify');
// Basic usage
gulp.task('scripts', function() {
gulp.src('src/coffee/**/*.coffee')
.pipe(coffeeify())
.pipe(gulp.dest('./build/js'));
});
gulp.task('scripts', function() {
gulp.src('src/coffee/**/*.coffee')
.pipe(coffeeify({
options: {
debug: true, // source map
paths: [__dirname + '/node_modules', __dirname + '/src/coffee']
}
}))
.pipe(gulp.dest('./build/js'));
});
gulp.task('scripts', function() {
gulp.src('src/coffee/**/*.coffee')
.pipe(coffeeify({
aliases: [
{
cwd: 'src/coffee/app',
base: 'app'
}
]
}))
.pipe(gulp.dest('./build/js'));
});
var xform = function(data: string){
return 'module.exports = "' + data + '"';
};
gulp.task('scripts', function() {
gulp.src('src/coffee/**/*.coffee')
.pipe(coffeeify({
transforms: [
{
ext: '.extension',
transform: xform
}
]
}))
.pipe(gulp.dest('./build/js'));
});
+44
View File
@@ -0,0 +1,44 @@
// Type definitions for gulp-coffeeify
// Project: https://github.com/nariyu/gulp-coffeeify
// Definitions by: Qubo <https://github.com/tkQubo>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare module "gulp-coffeeify" {
namespace coffeeify {
interface Coffeeify {
(option?: Option): NodeJS.ReadWriteStream;
}
interface Option {
options?: {
debug?: boolean;
paths?: string[];
},
/**
* [DEPRECATED]: You should use a 'paths' options of browserify.
*/
aliases?: Aliases;
/**
* [DEPRECATED]
*/
transforms?: Transforms;
}
interface Aliases {
cwd?: string;
base?: string;
}
interface Transforms {
ext?: string;
transform?(data: string): string;
}
}
var coffeeify: coffeeify.Coffeeify;
export = coffeeify;
}
+11
View File
@@ -0,0 +1,11 @@
/// <reference path="./gulp-dtsm.d.ts" />
/// <reference path="../node/node.d.ts" />
/// <reference path="../gulp/gulp.d.ts" />
import dtsm = require('gulp-dtsm');
import gulp = require('gulp');
var stream: NodeJS.WritableStream = dtsm();
gulp.task('dtsm', () => gulp.src('./dtsm.json').pipe(dtsm()));
+13
View File
@@ -0,0 +1,13 @@
// Type definitions for gulp-dtsm 0.0.0
// Project: https://github.com/9joneg/gulp-dtsm
// Definitions by: Aya Morisawa <https://github.com/AyaMorisawa>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare module "gulp-dtsm" {
function dtsm(): NodeJS.WritableStream;
export = dtsm;
}
+15
View File
@@ -0,0 +1,15 @@
/// <reference path="gulp-espower.d.ts" />
/// <reference path="../gulp/gulp.d.ts" />
import espower = require('gulp-espower');
import * as gulp from 'gulp';
gulp.src('src/*.coffee')
.pipe(espower())
.pipe(gulp.dest('out'));
gulp.src('src/*.coffee')
.pipe(espower({ patterns: ['assert(value, [message])'] }))
.pipe(gulp.dest('out'));
+27
View File
@@ -0,0 +1,27 @@
// Type definitions for gulp-espower
// Project: https://github.com/power-assert-js/gulp-espower
// Definitions by: Qubo <https://github.com/tkQubo>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare module "gulp-espower" {
namespace espower {
interface Espower {
/**
* @param options Target patterns for power assert feature instrumentation.
*/
(options?: Options): NodeJS.ReadWriteStream;
}
interface Options {
patterns: string[];
}
}
var espower: espower.Espower;
export = espower;
}
+47
View File
@@ -0,0 +1,47 @@
/// <reference path="../node/node.d.ts" />
/// <reference path="../gulp/gulp.d.ts" />
/// <reference path="gulp-help.d.ts" />
'use strict';
import gulpHelp = require('gulp-help');
var gulp = gulpHelp(require('gulp'));
gulp.task('lint', 'Lints all server side js', function () {
var jshint: () => NodeJS.ReadWriteStream;
gulp.src('./lib/**/*.js')
.pipe(jshint());
});
gulp.task('task-hidden-from-help', false, function () {
// ...
});
gulp.task('version', 'prints the version.', [], function() {
// ...
}, {
aliases: ['v', 'V']
});
gulp.task('version', 'prints the version.', [], function () {
// ...
}, {
options: {
'env=prod': 'description of env, perhaps with available values',
'key=val': 'description of key & val',
'key': 'description of key'
}
});
var gulp2 = require('gulp');
gulpHelp(gulp2, {
description: 'Desc',
aliases: ['h'],
hideEmpty: true,
hideDepsMessage: false,
afterPrintCallback(): any {
console.log('done');
}
});

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