mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-10 11:40:16 +08:00
+61
-11
@@ -9,6 +9,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](alertify/alertify.d.ts) [alertify](http://fabien-d.github.io/alertify.js) by [John Jeffery](http://github.com/jjeffery)
|
||||
* [:link:](amcharts/AmCharts.d.ts) [amCharts](http://www.amcharts.com) by [aleksey-bykov](https://github.com/aleksey-bykov)
|
||||
* [:link:](amplifyjs/amplifyjs.d.ts) [AmplifyJs](http://amplifyjs.com) by [Jonas Eriksson](https://github.com/joeriks)
|
||||
* [:link:](amqp-rpc/amqp-rpc.d.ts) [amqp-rpc](https://github.com/demchenkoe/node-amqp-rpc) by [Wonshik Kim](https://github.com/wokim)
|
||||
* [:link:](angular-file-upload/angular-file-upload.d.ts) [Angular File Upload](https://github.com/danialfarid/angular-file-upload) by [John Reilly](https://github.com/johnnyreilly)
|
||||
* [: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)
|
||||
@@ -19,13 +20,15 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](angularjs/angular-sanitize.d.ts) [Angular JS (ngSanitize module)](http://angularjs.org) by [Diego Vilar](http://github.com/diegovilar)
|
||||
* [:link:](angular-ui/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-protractor/angular-protractor.d.ts) [Angular Protractor](https://github.com/angular/protractor) by [Bill Armstrong](https://github.com/BillArmstrong)
|
||||
* [:link:](angularjs/angular-scenario.d.ts) [Angular Scenario Testing (ngScenario module)](http://angularjs.org) by [RomanoLindano](https://github.com/RomanoLindano)
|
||||
* [:link:](angular-scenario/angular-scenario.d.ts) [Angular Scenario Testing (ngScenario module)](http://angularjs.org) by [RomanoLindano](https://github.com/RomanoLindano)
|
||||
* [:link:](angular-translate/angular-translate.d.ts) [Angular Translate (pascalprecht.translate module)](https://github.com/PascalPrecht/angular-translate) by [Michel Salib](https://github.com/michelsalib)
|
||||
* [:link:](angular-ui-bootstrap/angular-ui-bootstrap.d.ts) [Angular UI Bootstrap](https://github.com/angular-ui/bootstrap) by [Brian Surowiec](https://github.com/xt0rted)
|
||||
* [:link:](angular-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-hotkeys/angular-hotkeys.d.ts) [angular-hotkeys](https://github.com/chieffancypants/angular-hotkeys) by [Jason Zhao](https://github.com/jlz27)
|
||||
* [: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-local-storage/angular-local-storage.d.ts) [angular-local-storage](https://github.com/grevory/angular-local-storage) by [Ken Fukuyama](https://github.com/kenfdev)
|
||||
* [:link:](angular-notify/angular-notify.d.ts) [angular-notify](https://github.com/cgross/angular-notify) by [Suwato](https://github.com/Suwato/DefinitelyTyped)
|
||||
* [:link:](angular-scroll/angular-scroll.d.ts) [angular-scroll](https://github.com/oblador/angular-scroll) by [Sam Herrmann](https://github.com/samherrmann)
|
||||
* [:link:](angular-spinner/angular-spinner.d.ts) [angular-spinner.js](https://github.com/urish/angular-spinner) by [Marcin Biegała](https://github.com/Biegal)
|
||||
* [:link:](angular-agility/angular-agility.d.ts) [AngularAgility](https://github.com/AngularAgility/AngularAgility) by [Roland Zwaga](https://github.com/rolandzwaga)
|
||||
* [:link:](angularfire/angularfire.d.ts) [AngularFire](http://angularfire.com) by [Dénes Harmath](http://github.com/thSoft)
|
||||
@@ -37,9 +40,11 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](appframework/appframework.d.ts) [AppFramework](http://app-framework-software.intel.com) by [kyo_ago](https://github.com/kyo-ago)
|
||||
* [:link:](arbiter/Arbiter.d.ts) [Arbiter.js](http://arbiterjs.com) by [Arash Shakery](https://github.com/arash16)
|
||||
* [:link:](asciify/asciify.d.ts) [asciify](https://www.npmjs.org/package/asciify) by [Alan Norbauer](http://alan.norbauer.com)
|
||||
* [:link:](aspnet-identity-pw/aspnet-identity-pw.d.ts) [aspnet-identity-pw](https://github.com/Syncbak-Git/aspnet-identity-pw) by [jt000](https://github.com/jt000)
|
||||
* [:link:](assert/assert.d.ts) [assert and power-assert](https://github.com/Jxck/assert) by [vvakame](https://github.com/vvakame)
|
||||
* [:link:](assertion-error/assertion-error.d.ts) [assertion-error](https://github.com/chaijs/assertion-error) by [Bart van der Schoor](https://github.com/Bartvds)
|
||||
* [:link:](async/async.d.ts) [Async](https://github.com/caolan/async) by [Boris Yankov](https://github.com/borisyankov)
|
||||
* [:link:](asyncblock/asyncblock.d.ts) [asyncblock](https://github.com/scriby/asyncblock) by [Hiroki Horiuchi](https://github.com/horiuchi)
|
||||
* [:link:](atmosphere/atmosphere.d.ts) [Atmosphere](https://github.com/Atmosphere/atmosphere-javascript) by [Kai Toedter](https://github.com/toedter)
|
||||
* [:link:](atom/atom.d.ts) [Atom](https://atom.io) by [vvakame](https://github.com/vvakame)
|
||||
* [:link:](atpl/atpl.d.ts) [atpl](https://github.com/soywiz/atpl.js) by [Carlos Ballesteros Velasco](https://github.com/soywiz)
|
||||
@@ -49,6 +54,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](node-azure/azure.d.ts) [Azure SDK for Node](https://github.com/WindowsAzure/azure-sdk-for-node) by [Andrew Gaspar](https://github.com/AndrewGaspar), [Anti Veeranna](https://github.com/antiveeranna), [Maxime LUCE](https://github.com/SomaticIT)
|
||||
* [:link:](backbone/backbone.d.ts) [Backbone](http://backbonejs.org) by [Boris Yankov](https://github.com/borisyankov), [Natan Vivo](https://github.com/nvivo)
|
||||
* [:link:](backbone-relational/backbone-relational.d.ts) [Backbone-relational](http://backbonerelational.org) by [Eirik Hoem](https://github.com/eirikhm)
|
||||
* [:link:](backbone.radio/backbone.radio.d.ts) [Backbone.Radio](https://github.com/marionettejs/backbone.radio) by [Peter Palotas](https://github.com/alphaleonis)
|
||||
* [:link:](backgrid/backgrid.d.ts) [Backgrid](http://backgridjs.com) by [Jeremy Lujan](https://github.com/jlujan)
|
||||
* [:link:](bcrypt/bcrypt.d.ts) [bcrypt](https://www.npmjs.org/package/bcrypt) by [Peter Harris](https://github.com/codeanimal)
|
||||
* [:link:](bgiframe/typescript.bgiframe.d.ts) [bgiframe](https://github.com/sumegizoltan/BgiFrame) by [Zoltan Sumegi](https://github.com/sumegizoltan)
|
||||
@@ -78,13 +84,14 @@ 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 Hunsaker](https://github.com/jedhunsaker), [Bart van der Schoor](https://github.com/Bartvds)
|
||||
* [: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-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)
|
||||
* [:link:](chai-jquery/chai-jquery.d.ts) [chai-jquery](https://github.com/chaijs/chai-jquery) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid)
|
||||
* [:link:](chalk/chalk.d.ts) [chalk](https://github.com/sindresorhus/chalk) by [Diullei Gomes](https://github.com/Diullei), [Bart van der Schoor](https://github.com/Bartvds)
|
||||
* [:link:](change-case/change-case.d.ts) [change-case](https://github.com/blakeembrey/change-case) by [Asana](https://asana.com)
|
||||
* [:link:](chartjs/chart.d.ts) [Chart.js](https://github.com/nnnick/Chart.js) by [Steve Fenton](https://github.com/Steve-Fenton)
|
||||
* [:link:](devextreme/dx.chartjs.d.ts) [ChartJS](http://js.devexpress.com/WebDevelopment/Charts) by [DevExpress Inc.](http://devexpress.com)
|
||||
* [:link:](checksum/checksum.d.ts) [checksum](https://github.com/dshaw/checksum) by [Rogier Schouten](https://github.com/rogierschouten)
|
||||
* [:link:](cheerio/cheerio.d.ts) [Cheerio](https://github.com/cheeriojs/cheerio) by [Bret Little](https://github.com/blittle), [VILIC VANE](http://vilic.info), [Wayne Maurer](https://github.com/wmaurer)
|
||||
* [:link:](chosen/chosen.jquery.d.ts) [Chosen.JQuery](http://harvesthq.github.com/chosen) by [Boris Yankov](https://github.com/borisyankov)
|
||||
@@ -125,8 +132,10 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](deep-diff/deep-diff.d.ts) [deep-diff](https://github.com/flitbit/diff) by [ZauberNerd](https://github.com/ZauberNerd)
|
||||
* [:link:](deep-freeze/deep-freeze.d.ts) [deep-freeze](https://github.com/substack/deep-freeze) by [Bart van der Schoor](https://github.com/Bartvds)
|
||||
* [:link:](detect-indent/detect-indent.d.ts) [detect-indent](https://github.com/sindresorhus/detect-indent) by [Bart van der Schoor](https://github.com/Bartvds)
|
||||
* [:link:](devextreme/dx.devextreme.d.ts) [DevExtreme](http://js.devexpress.com) by [DevExpress Inc.](http://devexpress.com)
|
||||
* [:link:](dhtmlxgantt/dhtmlxgantt.d.ts) [dhtmlxGantt](http://dhtmlx.com/docs/products/dhtmlxGantt) by [Maksim Kozhukh](http://github.com/mkozhukh)
|
||||
* [:link:](dhtmlxscheduler/dhtmlxscheduler.d.ts) [dhtmlxScheduler](http://dhtmlx.com/docs/products/dhtmlxScheduler) by [Maksim Kozhukh](http://github.com/mkozhukh)
|
||||
* [:link:](di-lite/di-lite.d.ts) [di-lite](https://github.com/NickQiZhu/di.js) by [Timothy Morris](https://github.com/dcrusader)
|
||||
* [:link:](diff/diff.d.ts) [diff](https://github.com/kpdecker/jsdiff) by [vvakame](https://github.com/vvakame)
|
||||
* [:link:](docCookies/docCookies.d.ts) [docCookies](https://developer.mozilla.org/en-US/docs/Web/API/document.cookie) by [Jon Egerton](https://github.com/jonegerton)
|
||||
* [:link:](dock-spawn/dock-spawn.d.ts) [Dock Spawn](http://dockspawn.com) by [Drew Noakes](https://drewnoakes.com)
|
||||
@@ -135,13 +144,16 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](domready/domready.d.ts) [domready](https://github.com/ded/domready) by [Christian Holm Nielsen](https://github.com/dotnetnerd)
|
||||
* [:link:](dot/dot.d.ts) [doT](https://github.com/olado/doT) by [ZombieHunter](https://github.com/ZombieHunter)
|
||||
* [:link:](dotdotdot/dotdotdot.d.ts) [dotdotdot](http://dotdotdot.frebsite.nl) by [Milan Jaros](https://github.com/milanjaros)
|
||||
* [:link:](doublearray/doublearray.d.ts) [doublearray](https://github.com/takuyaa/doublearray) by [MIZUSHIMA Junki](https://github.com/mzsm)
|
||||
* [:link:](dropboxjs/dropboxjs.d.ts) [dropbox-js](https://github.com/dropbox/dropbox-js) by [Steve Fenton](https://github.com/Steve-Fenton), [Pedro Casaubon](https://github.com/xperiments)
|
||||
* [:link:](dropzone/dropzone.d.ts) [Dropzone](http://www.dropzonejs.com) by [Natan Vivo](https://github.com/nvivo)
|
||||
* [:link:](durandal/durandal.d.ts) [Durandal](http://durandaljs.com) by [Blue Spire](https://github.com/BlueSpire)
|
||||
* [:link:](easeljs/easeljs.d.ts) [EaselJS](http://www.createjs.com/#!/EaselJS) by [Pedro Ferreira](https://bitbucket.org/drk4), [Chris Smith](https://github.com/evilangelist)
|
||||
* [: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:](easystarjs/easystarjs.d.ts) [EasyStar.js](http://easystarjs.com) by [Magnus Gustafsson](https://github.com/borundin)
|
||||
* [:link:](ejs-locals/ejs-locals.d.ts) [ejs-locals](https://github.com/randometc/ejs-locals) by [jt000](https://github.com/jt000)
|
||||
* [:link:](jquery.elang/jquery.elang.d.ts) [eLang](https://github.com/sumegizoltan/ELang) by [Zoltan Sumegi](https://github.com/sumegizoltan)
|
||||
* [:link:](element-resize-event/element-resize-event.d.ts) [element-resize-event](https://github.com/KyleAMathews/element-resize-event) by [Rogier Schouten](https://github.com/rogierschouten)
|
||||
* [:link:](elm/elm.d.ts) [Elm](http://elm-lang.org) by [Dénes Harmath](https://github.com/thSoft)
|
||||
* [:link:](ember/ember.d.ts) [Ember.js](http://emberjs.com) by [Jed Mao](https://github.com/jedmao)
|
||||
* [:link:](emissary/emissary.d.ts) [emissary](https://github.com/atom/emissary) by [vvakame](https://github.com/vvakame)
|
||||
@@ -158,6 +170,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-jwt/express-jwt.d.ts) [express-jwt](https://www.npmjs.org/package/express-jwt) by [Wonshik Kim](https://github.com/wokim)
|
||||
* [: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)
|
||||
* [:link:](express-unless/express-unless.d.ts) [express-unless](https://www.npmjs.org/package/express-unless) by [Wonshik Kim](https://github.com/wokim)
|
||||
* [:link:](express-validator/express-validator.d.ts) [express-validator](https://github.com/ctavan/express-validator) by [Nathan Ridley](https://github.com/axefrog), [Jonathan Häberle](http://dreampulse.de)
|
||||
@@ -165,6 +178,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](fabricjs/fabricjs.d.ts) [FabricJS](http://fabricjs.com) by [Oliver Klemencic](https://github.com/oklemencic)
|
||||
* [:link:](fbsdk/fbsdk.d.ts) [Facebook Javascript SDK](https://developers.facebook.com/docs/javascript) by [Joshua Strobl](https://github.com/JoshStrobl)
|
||||
* [:link:](fancybox/fancybox.d.ts) [fancyBox](https://github.com/fancyapps/fancyBox) by [Boris Yankov](https://github.com/borisyankov)
|
||||
* [: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:](fibers/fibers.d.ts) [fibers](https://github.com/laverdet/node-fibers) by [Carlos Ballesteros Velasco](https://github.com/soywiz)
|
||||
* [:link:](filewriter/filewriter.d.ts) [File API: Writer](http://www.w3.org/TR/file-writer-api) by [Kon](http://phyzkit.net)
|
||||
@@ -182,6 +196,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](flux/flux.d.ts) [Flux](http://facebook.github.io/flux) by [Steve Baker](https://github.com/stkb)
|
||||
* [:link:](ion.rangeSlider/ion.rangeSlider.d.ts) [for Ion.RangeSlider](https://github.com/IonDen/ion.rangeSlider) by [Sixin Li](https://github.com/sixinli)
|
||||
* [:link:](form-data/form-data.d.ts) [form-data](https://github.com/felixge/node-form-data) by [Carlos Ballesteros Velasco](https://github.com/soywiz)
|
||||
* [: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:](from/from.d.ts) [from](https://github.com/dominictarr/from) by [Bart van der Schoor](https://github.com/Bartvds)
|
||||
@@ -204,8 +219,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](google.analytics/ga.d.ts) [Google Analytics (Classic and Universal)](https://developers.google.com/analytics/devguides/collection/gajs) by [Ronnie Haakon Hegelund](http://ronniehegelund.blogspot.dk), [Pat Kujawa](http://patkujawa.com)
|
||||
* [:link:](gapi/gapi.d.ts) [Google API Client](https://code.google.com/p/google-api-javascript-client) by [Frank M](https://github.com/sgtfrankieboy)
|
||||
* [:link:](google.feeds/google.feed.api.d.ts) [Google Feed Apis](https://developers.google.com/feed) by [RodneyJT](https://github.com/RodneyJT)
|
||||
* [:link:](googlemaps/google.maps.d.ts) [Google Geolocation](https://developers.google.com/maps) by [Folia A/S](http://www.folia.dk)
|
||||
* [:link:](google.geolocation/google.geolocation.d.ts) [Google Geolocation](https://code.google.com/p/geo-location-javascript) by [Vincent Bortone](https://github.com/vbortone)
|
||||
* [:link:](googlemaps/google.maps.d.ts) [Google Geolocation](https://developers.google.com/maps) by [Folia A/S](http://www.folia.dk)
|
||||
* [:link:](gapi.pagespeedonline/gapi.pagespeedonline.d.ts) [Google Page Speed Online Api](https://developers.google.com/speed/pagespeed) by [Frank M](https://github.com/sgtfrankieboy)
|
||||
* [:link:](recaptcha/recaptcha.d.ts) [Google Recaptcha](https://www.google.com/recaptcha) by [Brent Jenkins](https://github.com/brentj73)
|
||||
* [:link:](gapi.translate/gapi.translate.d.ts) [Google Translate API](https://developers.google.com/translate) by [Frank M](https://github.com/sgtfrankieboy)
|
||||
@@ -240,6 +255,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](i18next/i18next.d.ts) [i18next](http://i18next.com) by [Maarten Docter](https://github.com/mdocter)
|
||||
* [:link:](icheck/icheck.d.ts) [iCheck](http://damirfoy.com/iCheck) by [Dániel Tar](https://github.com/qcz)
|
||||
* [:link:](imagemagick/imagemagick.d.ts) [imagemagick](http://github.com/rsms/node-imagemagick) by [Carlos Ballesteros Velasco](https://github.com/soywiz)
|
||||
* [:link:](imap/imap.d.ts) [imap](https://www.npmjs.com/package/imap) by [Peter Snider](https://github.com/psnider)
|
||||
* [:link:](impress/impress.d.ts) [Impress.js](https://github.com/bartaz/impress.js) by [Boris Yankov](https://github.com/borisyankov)
|
||||
* [:link:](inflection/inflection.d.ts) [inflection](https://github.com/dreamerslab/node.inflection) by [Shogo Iwano](https://github.com/shiwano)
|
||||
* [:link:](insight/insight.d.ts) [insight](https://github.com/yeoman/insight) by [vvakame](http://github.com/vvakame)
|
||||
@@ -260,6 +276,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](jasmine-matchers/jasmine-matchers.d.ts) [jasmine-matchers](https://github.com/uxebu/jasmine-matchers) by [Bart van der Schoor](https://github.com/Bartvds)
|
||||
* [:link:](jdataview/jdataview.d.ts) [jDataView](https://github.com/jDataView/jDataView) by [Ingvar Stepanyan](https://github.com/RReverser)
|
||||
* [:link:](jest/jest.d.ts) [Jest](http://facebook.github.io/jest) by [Asana](https://asana.com)
|
||||
* [:link:](jjv/jjv.d.ts) [JJV](https://github.com/acornejo/jjv) by [Wim Looman](https://github.com/Nemo157)
|
||||
* [:link:](jjve/jjve.d.ts) [JJVE](https://github.com/silas/jjve) by [Wim Looman](https://github.com/Nemo157)
|
||||
* [:link:](joi/joi.d.ts) [joi](https://github.com/spumko/joi) by [Bart van der Schoor](https://github.com/Bartvds)
|
||||
* [:link:](jointjs/jointjs.d.ts) [Joint JS](http://www.jointjs.com) by [Aidan Reel](http://github.com/areel), [David Durman](http://github.com/DavidDurman)
|
||||
* [:link:](jqrangeslider/jqrangeslider.d.ts) [jQRangeSlider](http://ghusse.github.com/jQRangeSlider) by [Dániel Tar](https://github.com/qcz)
|
||||
@@ -301,6 +319,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](jquery.customSelect/jquery.customSelect.d.ts) [jquery.customSelect.js](http://adam.co/lab/jquery/customselect/) by [adamcoulombe](https://github.com/adamcoulombe)
|
||||
* [:link:](jquery.cycle/jquery.cycle.d.ts) [jQuery.cycle.js](http://jquery.malsup.com/cycle) by [François Guillot](http://fguillot.developpez.com)
|
||||
* [:link:](jquery.dynatree/jquery.dynatree.d.ts) [jquery.dynatree](http://code.google.com/p/dynatree) by [François de Campredon](https://github.com/fdecampredon)
|
||||
* [:link:](jquery.fancytree/jquery.fancytree.d.ts) [jquery.fancytree](https://github.com/mar10/fancytree) by [Peter Palotas](https://github.com/alphaleonis)
|
||||
* [:link:](jquery.finger/jquery.finger.d.ts) [jquery.finger.js](http://ngryman.sh/jquery.finger) by [Max Ackley](https://github.com/maxackley)
|
||||
* [:link:](jquery.form/jquery.form.d.ts) [jQuery.form.js 3.26.0](http://malsup.com/jquery/form) by [François Guillot](http://fguillot.developpez.com)
|
||||
* [:link:](jquery.gridster/gridster.d.ts) [jQuery.gridster](https://github.com/jbaldwin/gridster) by [Josh Baldwin](https://github.com/jbaldwin)
|
||||
@@ -318,6 +337,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](jquery.superLink/jquery.superLink.d.ts) [jquery.superLink](http://james.padolsey.com/demos/plugins/jQuery/superLink/superlink.jquery.js) by [Blake Niemyjski](https://github.com/niemyjski)
|
||||
* [:link:](jquery.tile/jquery.tile.d.ts) [jquery.tile.js](https://github.com/urin/jquery.tile.js) by [Shunsuke Ohtani](https://github.com/zaneli)
|
||||
* [:link:](jquery.timeago/jquery.timeago.d.ts) [jQuery.timeago.js](http://timeago.yarp.com) by [François Guillot](http://fguillot.developpez.com)
|
||||
* [:link:](jquery.tipsy/jquery.tipsy.d.ts) [jQuery.tipsy](http://onehackoranother.com/projects/jquery/tipsy) by [Brian Dukes](https://github.com/bdukes)
|
||||
* [:link:](jquery.transit/jquery.transit.d.ts) [jQuery.transit.js](http://ricostacruz.com/jquery.transit) by [MrBigDog2U](https://github.com/MrBigDog2U)
|
||||
* [:link:](jquery.validation/jquery.validation.d.ts) [jquery.validation](http://jqueryvalidation.org) by [François de Campredon](https://github.com/fdecampredon), [Johj Reilly](https://github.com/johnnyreilly)
|
||||
* [:link:](jquery.timer/jquery.timer.d.ts) [jQueryTimer](https://github.com/jchavannes/jquery-timer) by [Joshua Strobl](https://github.com/JoshStrobl)
|
||||
@@ -330,6 +350,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](jsbn/jsbn.d.ts) [jsbn](http://www-cs-students.stanford.edu/%7Etjw/jsbn) by [Eugene Chernyshov](https://github.com/Evgenus)
|
||||
* [:link:](jscrollpane/jscrollpane.d.ts) [jScrollPane](http://jscrollpane.kelvinluck.com) by [Dániel Tar](https://github.com/qcz)
|
||||
* [:link:](jsdeferred/jsdeferred.d.ts) [JSDeferred](https://github.com/cho45/jsdeferred) by [Daisuke Mino](https://github.com/minodisk)
|
||||
* [:link:](jsdom/jsdom.d.ts) [jsdom](https://github.com/tmpvar/jsdom) by [Asana](https://asana.com)
|
||||
* [:link:](jsesc/jsesc.d.ts) [jsesc](https://github.com/mathiasbynens/jsesc) by [Bart van der Schoor](https://github.com/Bartvds)
|
||||
* [:link:](jsfl/jsfl.d.ts) [JSFL](https://adobe.com) by [soywiz](https://github.com/soywiz)
|
||||
* [:link:](jshamcrest/jshamcrest.d.ts) [JsHamcrest](https://github.com/danielfm/jshamcrest) by [David Harkness](https://github.com/dharkness)
|
||||
@@ -345,6 +366,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:](jszip/jszip.d.ts) [JSZip](http://stuk.github.com/jszip) by [mzeiher](https://github.com/mzeiher)
|
||||
* [: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:](karma-jasmine/karma-jasmine.d.ts) [karma-jasmine plugin](https://github.com/karma-runner/karma-jasmine) by [Michel Salib](https://github.com/michelsalib)
|
||||
* [:link:](keyboardjs/keyboardjs.d.ts) [KeyboardJS](https://github.com/RobertWHurst/KeyboardJS) by [Vincent Bortone](https://github.com/vbortone)
|
||||
* [:link:](keymaster/keymaster.d.ts) [keymaster](https://github.com/madrobby/keymaster) by [Martin W. Kirst](https://github.com/nitram509)
|
||||
@@ -367,6 +389,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](knockstrap/knockstrap.d.ts) [Knockstrap](http://faulknercs.github.io/Knockstrap) by [Adam Pluciński](https://github.com/adaskothebeast)
|
||||
* [:link:](knockout.kogrid/ko-grid.d.ts) [ko-grid](http://knockout-contrib.github.io/KoGrid) by [huer12](https://github.com/huer12)
|
||||
* [:link:](kolite/kolite.d.ts) [KoLite](https://github.com/CodeSeven/kolite) by [Boris Yankov](https://github.com/borisyankov)
|
||||
* [:link:](kuromoji/kuromoji.d.ts) [kuromoji.js](https://github.com/takuyaa/kuromoji.js) by [MIZUSHIMA Junki](https://github.com/mzsm)
|
||||
* [:link:](ladda/ladda.d.ts) [Ladda](https://github.com/hakimel/Ladda) by [Danil Flores](https://github.com/dflor003)
|
||||
* [:link:](lazy.js/lazy.js.d.ts) [Lazy.js](https://github.com/dtao/lazy.js) by [Bart van der Schoor](https://github.com/Bartvds)
|
||||
* [:link:](leaflet/leaflet.d.ts) [Leaflet.js](https://github.com/Leaflet/Leaflet) by [Vladimir Zotov](https://github.com/rgripper)
|
||||
@@ -382,6 +405,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](lodash/lodash.d.ts) [Lo-Dash](http://lodash.com) by [Brian Zengel](https://github.com/bczengel)
|
||||
* [:link:](lockfile/lockfile.d.ts) [lockfile](https://github.com/isaacs/lockfile) by [Bart van der Schoor](https://github.com/Bartvds)
|
||||
* [:link:](log4javascript/log4javascript.d.ts) [log4javascript](http://log4javascript.org) by [Markus Wagner](https://github.com/Ritzlgrmft)
|
||||
* [:link:](log4js/log4js.d.ts) [log4js](https://github.com/nomiddlename/log4js-node) by [Kentaro Okuno](http://github.com/armorik83)
|
||||
* [:link:](logg/logg.d.ts) [logg](https://github.com/dpup/node-logg) by [Bret Little](https://github.com/blittle)
|
||||
* [:link:](long/long.d.ts) [Long.js](https://github.com/dcodeIO/Long.js) by [Toshihide Hara](https://github.com/kerug)
|
||||
* [:link:](lru-cache/lru-cache.d.ts) [lru-cache](https://github.com/isaacs/node-lru-cache) by [Bart van der Schoor](https://github.com/Bartvds)
|
||||
@@ -401,6 +425,14 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](microsoft-ajax/microsoft.ajax.d.ts) [Microsoft ASP.NET Ajax client side library](http://msdn.microsoft.com/en-us/library/ee341002(v=vs.100).aspx) by [Patrick Magee](https://github.com/pjmagee)
|
||||
* [:link:](microsoft-live-connect/microsoft-live-connect.d.ts) [Microsoft Live Connect](http://msdn.microsoft.com/en-us/library/live/hh243643.aspx) by [John Vilk](https://github.com/jvilk)
|
||||
* [:link:](azure-mobile-services-client/AzureMobileServicesClient.d.ts) [Microsoft Windows AzureMobile Service](http://www.windowsazure.com/en-us/develop/mobile) by [Morosinotto Daniele](https://github.com/dmorosinotto)
|
||||
* [:link:](bingmaps/Microsoft.Maps.d.ts) [Microsoft.Maps](http://msdn.microsoft.com/en-us/library/gg427611.aspx) by [Eric Todd](https://github.com/ericrtodd)
|
||||
* [:link:](bingmaps/Microsoft.Maps.AdvancedShapes.d.ts) [Microsoft.Maps.AdvancedShapes](http://msdn.microsoft.com/en-us/library/hh921952.aspx) by [Eric Todd](https://github.com/ericrtodd)
|
||||
* [:link:](bingmaps/Microsoft.Maps.Directions.d.ts) [Microsoft.Maps.Directions](http://msdn.microsoft.com/en-us/library/hh312813.aspx) by [Eric Todd](https://github.com/ericrtodd)
|
||||
* [:link:](bingmaps/Microsoft.Maps.Search.d.ts) [Microsoft.Maps.Search](http://msdn.microsoft.com/en-us/library/hh868061.aspx) by [Eric Todd](https://github.com/ericrtodd)
|
||||
* [:link:](bingmaps/Microsoft.Maps.Themes.BingTheme.d.ts) [Microsoft.Maps.Themes](http://msdn.microsoft.com/en-us/library/hh868061.aspx) by [Eric Todd](https://github.com/ericrtodd)
|
||||
* [:link:](bingmaps/Microsoft.Maps.Traffic.d.ts) [Microsoft.Maps.Traffic](http://msdn.microsoft.com/en-us/library/hh312840.aspx) by [Eric Todd](https://github.com/ericrtodd)
|
||||
* [:link:](bingmaps/Microsoft.Maps.VenueMaps.d.ts) [Microsoft.Maps.VenueMaps](http://msdn.microsoft.com/en-us/library/hh312797.aspx) by [Eric Todd](https://github.com/ericrtodd)
|
||||
* [:link:](milkcocoa/milkcocoa.d.ts) [Milkcocoa](https://mlkcca.com) by [odangosan](https://github.com/odangosan)
|
||||
* [: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)
|
||||
@@ -409,13 +441,15 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [: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:](mocha/mocha.d.ts) [mocha](http://visionmedia.github.io/mocha) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid), [otiai10](https://github.com/otiai10)
|
||||
* [: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)
|
||||
* [:link:](mocha-phantomjs/mocha-phantomjs.d.ts) [mocha-phantomjs](http://metaskills.net/mocha-phantomjs) by [Erik Schierboom](https://github.com/ErikSchierboom)
|
||||
* [:link:](mockery/mockery.d.ts) [mockery](https://github.com/mfncooper/mockery) by [jt000](https://github.com/jt000)
|
||||
* [:link:](modernizr/modernizr.d.ts) [Modernizr](http://modernizr.com) by [Boris Yankov](https://github.com/borisyankov), [Theodore Brown](https://github.com/theodorejb)
|
||||
* [:link:](moment-timezone/moment-timezone.d.ts) [moment-timezone.js](http://momentjs.com/timezone) by [Michel Salib](https://github.com/michelsalib)
|
||||
* [:link:](moment/moment.d.ts) [Moment.js](https://github.com/timrwood/moment) by [Michael Lakerveld](https://github.com/Lakerfield), [Aaron King](https://github.com/kingdango), [Hiroki Horiuchi](https://github.com/horiuchi), [Dick van den Brink](https://github.com/DickvdBrink), [Adi Dahiya](https://github.com/adidahiya)
|
||||
* [:link:](mongodb/mongodb.d.ts) [MongoDB](https://github.com/mongodb/node-mongodb-native) by [Boris Yankov](https://github.com/borisyankov)
|
||||
* [:link:](mongoose/mongoose.d.ts) [Mongoose](http://mongoosejs.com) by [horiuchi](https://github.com/horiuchi)
|
||||
* [:link:](mongoose-mock/mongoose-mock.d.ts) [mongoose-mock](https://github.com/JohanObrink/mongoose-mock) by [jt000](https://github.com/jt000)
|
||||
* [:link:](morgan/morgan.d.ts) [morgan](https://github.com/expressjs/morgan) by [James Roland Cabresos](https://github.com/staticfunction)
|
||||
* [:link:](mousetrap/mousetrap.d.ts) [Mousetrap](http://craig.is/killing/mice) by [Dániel Tar](https://github.com/qcz)
|
||||
* [:link:](mousetrap/mousetrap-global-bind.d.ts) [Mousetrap 1.4.6's global-bind extension](http://craig.is/killing/mice#extensions.global) by [Andrew Bradley](https://github.com/cspotcode)
|
||||
@@ -426,23 +460,28 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](msgpack/msgpack.d.ts) [msgpack.js - MessagePack JavaScript Implementation](https://github.com/uupaa/msgpack.js) by [Shinya Mochizuki](https://github.com/enrapt-mochizuki)
|
||||
* [:link:](msnodesql/msnodesql.d.ts) [msnodesql](https://github.com/WindowsAzure/node-sqlserver) by [Boris Yankov](https://github.com/borisyankov), [Maxime LUCE](https://github.com/SomaticIT)
|
||||
* [:link:](mu2/mu2.d.ts) [mu2](http://github.com/raycmorgan/mu) by [Jeff Goddard](https://github.com/jedigo)
|
||||
* [:link:](multer/multer.d.ts) [multer](https://github.com/expressjs/multer) by [jt000](https://github.com/jt000)
|
||||
* [:link:](mustache/mustache.d.ts) [Mustache](https://github.com/janl/mustache.js) by [Mark Ashley Bell](https://github.com/markashleybell)
|
||||
* [:link:](nconf/nconf.d.ts) [nconf](https://github.com/flatiron/nconf) by [Jeff Goddard](https://github.com/jedigo)
|
||||
* [:link:](ncp/ncp.d.ts) [ncp](https://github.com/AvianFlu/ncp) by [Bart van der Schoor](https://github.com/bartvds)
|
||||
* [:link:](needle/needle.d.ts) [needle](https://github.com/tomas/needle) by [San Chen](https://github.com/bigsan)
|
||||
* [:link:](nexpect/nexpect.d.ts) [nexpect](https://github.com/nodejitsu/nexpect) by [vvakame](http://github.com/vvakame)
|
||||
* [:link:](ng-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:](ngprogress/ngprogress.d.ts) [ngProgress](http://victorbjelkholm.github.io/ngProgress) by [Martin McWhorter](https://github.com/martinmcwhorter)
|
||||
* [:link:](ngprogress-lite/ngprogress-lite.d.ts) [ngprogress-lite](https://github.com/voronianski/ngprogress-lite) by [Luke Forder](https://github.com/LukeForder)
|
||||
* [:link:](nightmare/nightmare.d.ts) [Nightmare](https://github.com/segmentio/nightmare) by [horiuchi](https://github.com/horiuchi)
|
||||
* [:link:](noble/noble.d.ts) [noble](https://github.com/sandeepmistry/noble) by [Seon-Wook Park](https://github.com/swook)
|
||||
* [: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:](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:](convict/convict.d.ts) [node-convict](https://github.com/mozilla/node-convict) by [Wim Looman](https://github.com/Nemo157)
|
||||
* [:link:](node-ffi/node-ffi.d.ts) [node-ffi](https://github.com/rbranson/node-ffi) by [Paul Loyd](https://github.com/loyd)
|
||||
* [:link:](node-fibers/node-fibers.d.ts) [node-fibers](https://github.com/laverdet/node-fibers) by [Cary Haynie](https://github.com/caryhaynie)
|
||||
* [:link:](node-form/node-form.d.ts) [node-form](https://github.com/rsamec/form) by [Roman Samec](https://github.com/rsamec)
|
||||
* [:link:](node-git/node-git.d.ts) [node-git](https://github.com/christkv/node-git) by [vvakame](https://github.com/vvakame)
|
||||
* [:link:](ip/ip.d.ts) [node-ip](https://github.com/indutny/node-ip) by [Peter Harris](https://github.com/codeanimal)
|
||||
* [:link:](multiparty/multiparty.d.ts) [node-multiparty](https://github.com/andrewrk/node-multiparty) by [Ken Fukuyama](https://github.com/kenfdev)
|
||||
* [:link:](mysql/mysql.d.ts) [node-mysql](https://github.com/felixge/node-mysql) by [William Johnston](https://github.com/wjohnsto)
|
||||
* [:link:](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)
|
||||
@@ -456,13 +495,14 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](nodemailer/nodemailer.d.ts) [Nodemailer](https://github.com/andris9/Nodemailer) by [Vincent Bortone](https://github.com/vbortone)
|
||||
* [: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:](notifyjs/notifyjs.d.ts) [notify.js](https://github.com/alexgibson/notify.js) by [soundTricker](https://github.com/soundTricker)
|
||||
* [:link:](notify/notify.d.ts) [Notify.js](https://github.com/jpillora/notifyjs) by [Xiaohan Zhang](https://github.com/hellochar)
|
||||
* [:link:](notifyjs/notifyjs.d.ts) [notify.js](https://github.com/alexgibson/notify.js) by [soundTricker](https://github.com/soundTricker)
|
||||
* [:link:](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)
|
||||
* [:link:](nprogress/NProgress.d.ts) [NProgress](https://github.com/rstacruz/nprogress) by [Judah Gabriel Himango](http://debuggerdotbreak.wordpress.com)
|
||||
* [:link:](numeraljs/numeraljs.d.ts) [Numeral.js](https://github.com/adamwdraper/Numeral-js) by [Vincent Bortone](https://github.com/vbortone)
|
||||
* [:link:](object-path/object-path.d.ts) [objectPath](https://github.com/mariocasciaro/object-path) by [Paulo Cesar](https://github.com/pocesar)
|
||||
* [: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:](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.js](https://github.com/openlayers/openlayers) by [Ilya Bolkhovsky](https://github.com/bolhovsky)
|
||||
@@ -477,7 +517,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](passport-local/passport-local.d.ts) [passport-local](https://github.com/jaredhanson/passport-local) by [Maxime LUCE](https://github.com/SomaticIT)
|
||||
* [:link:](pathwatcher/pathwatcher.d.ts) [pathwatcher](https://github.com/atom/node-pathwatcher) by [vvakame](https://github.com/vvakame)
|
||||
* [:link:](pdf/pdf.d.ts) [PDF.js](https://github.com/mozilla/pdf.js) by [Josh Baldwin](https://github.com/jbaldwin)
|
||||
* [:link:](peerjs/Peer.d.ts) [PeerJS](http://peerjs.com) by [Toshiya Nakakura](https://github.com/nakakura)
|
||||
* [:link:](peerjs/peerjs.d.ts) [PeerJS](http://peerjs.com) by [Toshiya Nakakura](https://github.com/nakakura)
|
||||
* [:link:](pegjs/pegjs.d.ts) [PEG.js](http://pegjs.majda.cz) by [vvakame](https://github.com/vvakame)
|
||||
* [:link:](persona/persona.d.ts) [Persona](http://www.mozilla.org/en-US/persona) by [James Frasca](https://github.com/Nycto)
|
||||
* [:link:](pg/pg.d.ts) [pg](https://github.com/brianc/node-postgres) by [Phips Peter](http://pspeter3.com)
|
||||
@@ -485,7 +525,6 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](phantom/phantom.d.ts) [PhantomJS bridge for NodeJS](https://github.com/sgentle/phantomjs-node) by [horiuchi](https://github.com/horiuchi)
|
||||
* [:link:](phantomjs/phantomjs.d.ts) [PhantomJS v1.9.0 API](https://github.com/ariya/phantomjs/wiki/API-Reference) by [Jed Hunsaker](https://github.com/jedhunsaker), [Mike Keesey](https://github.com/keesey)
|
||||
* [:link:](phonegap/phonegap.d.ts) [PhoneGap](http://phonegap.com) by [Boris Yankov](https://github.com/borisyankov), [Dick van den Brink](https://github.com/DickvdBrink)
|
||||
* [:link:](devextreme/dx.phonejs.d.ts) [PhoneJS](http://js.devexpress.com/MobileDevelopment) by [DevExpress Inc.](http://devexpress.com)
|
||||
* [:link:](physijs/physijs.d.ts) [Physijs](http://chandlerprall.github.io/Physijs) by [Satoru Kimura](https://github.com/gyohk)
|
||||
* [:link:](pickadate/pickadate.d.ts) [pickadate.js](https://github.com/amsul/pickadate.js) by [Adi Dahiya](https://github.com/adidahiya)
|
||||
* [:link:](pixi/pixi.d.ts) [PIXI](https://github.com/GoodBoyDigital/pixi.js) by [xperiments](http://github.com/xperiments)
|
||||
@@ -493,6 +532,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](playerframework/playerFramework.d.ts) [Player Framework (MMPPF)](https://playerframework.codeplex.com) by [Ricardo Sabino](https://github.com/ricardosabino)
|
||||
* [:link:](pleasejs/please.d.ts) [PleaseJS](http://www.checkman.io/please) by [Toshiya Nakakura](https://github.com/nakakura)
|
||||
* [:link:](podcast/podcast.d.ts) [podcast](http://github.com/maxnowack/node-podcast) by [Niklas Mollenhauer](https://github.com/nikeee)
|
||||
* [:link:](poly2tri/poly2tri.d.ts) [poly2tri](http://github.com/r3mi/poly2tri.js) by [Elemar Junior](https://github.com/elemarjr)
|
||||
* [:link:](popcorn/popcorn.d.ts) [Popcorn](https://github.com/mozilla/popcorn-js) by [grapswiz](https://github.com/grapswiz)
|
||||
* [:link:](pouchDB/pouch.d.ts) [Pouch](http://pouchdb.com) by [Bill Sears](https://github.com/MrBigDog2U)
|
||||
* [:link:](power-assert/power-assert.d.ts) [power-assert](https://github.com/twada/power-assert) by [vvakame](https://github.com/vvakame)
|
||||
@@ -502,6 +542,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](progressjs/progress.d.ts) [ProgressJs](http://usablica.github.io/progress.js) by [Shunsuke Ohtani](https://github.com/zaneli)
|
||||
* [: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)
|
||||
* [:link:](proxyquire/proxyquire.d.ts) [Proxyquire](https://github.com/thlorenz/proxyquire) by [jt000](https://github.com/jt000)
|
||||
* [:link:](pubsubjs/pubsub.d.ts) [PubSubJS](https://github.com/mroderick/PubSubJS) by [Boris Yankov](https://github.com/borisyankov)
|
||||
* [:link:](purl/purl.d.ts) [Purl](https://github.com/allmarkedup/purl) by [Daniel Ferreira Monteiro Alves](https://github.com/danfma)
|
||||
* [:link:](q/Q.d.ts) [Q](https://github.com/kriskowal/q) by [Barrie Nemetchek](https://github.com/bnemetchek), [Andrew Gaspar](https://github.com/AndrewGaspar), [John Reilly](https://github.com/johnnyreilly)
|
||||
@@ -509,6 +551,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](q-retry/q-retry.d.ts) [q-retry](https://github.com/vilic/q-retry) by [VILIC VANE](https://github.com/vilic)
|
||||
* [:link:](qajax/qajax.d.ts) [Qajax](https://github.com/gre/qajax) by [Boltmade](https://github.com/Boltmade)
|
||||
* [:link:](qunit/qunit.d.ts) [QUnit](http://qunitjs.com) by [Diullei Gomes](https://github.com/diullei)
|
||||
* [:link:](rabbit.js/rabbit.js.d.ts) [rabbit.js](https://github.com/squaremo/rabbit.js) by [Wonshik Kim](https://github.com/wokim)
|
||||
* [:link:](raphael/raphael.d.ts) [Raphael](http://raphaeljs.com) by [CheCoxshall](https://github.com/CheCoxshall)
|
||||
* [:link:](ravenjs/ravenjs.d.ts) [Raven.js](https://github.com/getsentry/raven-js) by [Santi Albo](https://github.com/santialbo)
|
||||
* [:link:](react/react.d.ts) [React](http://facebook.github.io/react) by [Asana](https://asana.com)
|
||||
@@ -544,11 +587,14 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](rx/rx.time.d.ts) [RxJS-Time](http://rx.codeplex.com) by [Carl de Billy](http://carl.debilly.net), [Igor Oleinikov](https://github.com/Igorbek)
|
||||
* [:link:](rx/rx.virtualtime.d.ts) [RxJS-VirtualTime](http://rx.codeplex.com) by [gsino](http://www.codeplex.com/site/users/view/gsino), [Igor Oleinikov](https://github.com/Igorbek)
|
||||
* [:link:](sammyjs/sammyjs.d.ts) [Sammy.js](http://sammyjs.org) by [Boris Yankov](https://github.com/borisyankov), [Oisin Grehan](https://github.com/oising)
|
||||
* [:link:](sanitize-filename/sanitize-filename.d.ts) [sanitize-filename](https://github.com/parshap/node-sanitize-filename) by [Wim Looman](https://github.com/Nemo157)
|
||||
* [:link:](screenfull/screenfull.d.ts) [screenfull.js](https://github.com/sindresorhus/screenfull.js) by [Ilia Choly](http://github.com/icholy)
|
||||
* [: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:](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:](sharedworker/SharedWorker.d.ts) [SharedWorker](http://www.w3.org/TR/workers) by [Toshiya Nakakura](https://github.com/nakakura)
|
||||
* [:link:](shelljs/shelljs.d.ts) [ShellJS](http://shelljs.org) by [Niklas Mollenhauer](https://github.com/nikeee)
|
||||
* [:link:](should/should.d.ts) [should.js](https://github.com/visionmedia/should.js) by [Alex Varju](https://github.com/varju), [Maxime LUCE](https://github.com/SomaticIT)
|
||||
* [:link:](showdown/showdown.d.ts) [Showdown](https://github.com/coreyti/showdown) by [cbowdon](https://github.com/cbowdon)
|
||||
@@ -593,6 +639,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](svg-pan-zoom/svg-pan-zoom.d.ts) [svg-pan-zoom](https://github.com/ariutta/svg-pan-zoom) by [Chintan Shah](https://github.com/Promact)
|
||||
* [:link:](svgjs/svgjs.d.ts) [svg.js](http://www.svgjs.com) by [Sean Hess](https://seanhess.github.io)
|
||||
* [:link:](svgjs.draggable/svgjs.draggable.d.ts) [svgjs.draggable](http://www.svgjs.com) by [Luigi Trabacchin](https://github.com/LiFeleSs)
|
||||
* [:link:](swag/swag.d.ts) [swag](https://github.com/elving/swag) by [Shogo Iwano](https://github.com/shiwano)
|
||||
* [:link:](swfobject/swfobject.d.ts) [swfobject](https://code.google.com/p/swfobject) by [rou](https://github.com/rou)
|
||||
* [:link:](swig/swig.d.ts) [swig](http://github.com/paularmstrong/swig) by [Peter Harris](https://github.com/CodeAnimal), [Carlos Ballesteros Velasco](https://github.com/soywiz)
|
||||
* [:link:](swiper/swiper.d.ts) [Swiper](https://github.com/nolimits4web/Swiper) by [Sebastián Galiano](https://github.com/sgaliano)
|
||||
@@ -600,6 +647,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](swiz/swiz.d.ts) [swiz](https://github.com/racker/node-swiz) by [Jeff Goddard](https://github.com/jedigo)
|
||||
* [:link:](tape/tape.d.ts) [tape](https://github.com/substack/tape) by [Bart van der Schoor](https://github.com/Bartvds)
|
||||
* [:link:](tar/tar.d.ts) [tar](https://github.com/npm/node-tar) by [Maxime LUCE](https://github.com/SomaticIT)
|
||||
* [:link:](tedious/tedious.d.ts) [tedious](https://pekim.github.io/tedious) by [Rogier Schouten](https://github.com/rogierschouten)
|
||||
* [:link:](teechart/teechart.d.ts) [TeeChart](http://www.steema.com) by [Steema Software](https://steema.com)
|
||||
* [:link:](text-buffer/text-buffer.d.ts) [text-buffer](https://github.com/atom/text-buffer) by [vvakame](https://github.com/vvakame)
|
||||
* [:link:](text-encoding/text-encoding.d.ts) [text-encoding](https://github.com/inexorabletash/text-encoding) by [MIZUNE Pine](https://github.com/pine613)
|
||||
@@ -621,6 +669,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](timezone-js/timezone-js.d.ts) [timezone-js](https://github.com/mde/timezone-js) by [bonnici](https://github.com/bonnici)
|
||||
* [:link:](timezonecomplete/timezonecomplete.d.ts) [timezonecomplete](https://github.com/SpiritIT/timezonecomplete) by [Rogier Schouten](https://github.com/rogierschouten)
|
||||
* [:link:](tv4/tv4.d.ts) [Tiny Validator tv4](https://github.com/geraintluff/tv4) by [Bart van der Schoor](https://github.com/Bartvds)
|
||||
* [:link:](tinycolor/tinycolor.d.ts) [tinycolor](https://github.com/bgrins/TinyColor) by [Mordechai Zuber](https://github.com/M-Zuber)
|
||||
* [:link:](titanium/titanium.d.ts) [Titanium Movile 3.1.3.GA](http://www.appcelerator.com) by [Airam Rguez](https://github.com/airamrguez)
|
||||
* [:link:](toastr/toastr.d.ts) [Toastr](https://github.com/CodeSeven/toastr) by [Boris Yankov](https://github.com/borisyankov)
|
||||
* [:link:](sencha_touch/SenchaTouch.d.ts) [Touch](http://www.sencha.com/products/touch) by [Brian Kotek](https://github.com/brian428)
|
||||
@@ -653,16 +702,17 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [: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-fs/vinyl-fs.d.ts) [vinyl-fs](https://github.com/wearefractal/vinyl-fs) by [vvakame](https://github.com/vvakame)
|
||||
* [:link:](vue/vue.d.ts) [vuejs](https://github.com/yyx990803/vue) by [odangosan](https://github.com/odangosan)
|
||||
* [:link:](watch/watch.d.ts) [watch](https://github.com/mikeal/watch) by [Carlos Ballesteros Velasco](https://github.com/soywiz)
|
||||
* [:link:](jquery.watermark/jquery.watermark.d.ts) [Watermark plugin for jQuery](http://jquery-watermark.googlecode.com) by [Anwar Javed](https://github.com/anwarjaved)
|
||||
* [:link:](webaudioapi/waa.d.ts) [Web Audio API](http://www.w3.org/TR/webaudio) by [Baruch Berger](https://github.com/bbss), [Kon](http://phyzkit.net)
|
||||
* [:link:](webaudioapi/waa.d.ts) [Web Audio API](http://www.w3.org/TR/webaudio) by [Baruch Berger](https://github.com/bbss), [Kon](http://phyzkit.net), [kubosho](https://github.com/kubosho)
|
||||
* [:link:](webaudioapi/waa-nightly.d.ts) [Web Audio API (nightly)](http://www.w3.org/TR/2012/WD-webaudio-20120802) by [Baruch Berger](https://github.com/bbss)
|
||||
* [:link:](webmidi/webmidi.d.ts) [Web MIDI API](http://www.w3.org/TR/webmidi) by [Toshiya Nakakura](https://github.com/nakakura)
|
||||
* [:link:](devextreme/dx.webappjs.d.ts) [WebAppJS](http://js.devexpress.com/WebDevelopment) by [DevExpress Inc.](http://devexpress.com)
|
||||
* [:link:](webcrypto/WebCrypto.d.ts) [WebCrypto](http://www.w3.org/TR/WebCryptoAPI) by [Lucas Dixon](https://github.com/iislucas)
|
||||
* [:link:](webrtc/MediaStream.d.ts) [WebRTC](http://dev.w3.org/2011/webrtc) by [Ken Smith](https://github.com/smithkl42)
|
||||
* [:link:](websocket/websocket.d.ts) [websocket](https://github.com/Worlize/WebSocket-Node) by [Paul Loyd](https://github.com/loyd)
|
||||
* [:link:](when/when.d.ts) [When](https://github.com/cujojs/when) by [Derek Cicerone](https://github.com/derekcicerone)
|
||||
* [:link:](when/when.d.ts) [When](https://github.com/cujojs/when) by [Derek Cicerone](https://github.com/derekcicerone), [Wim Looman](https://github.com/Nemo157)
|
||||
* [:link:](which/which.d.ts) [which](https://github.com/isaacs/node-which) by [vvakame](https://github.com/vvakame)
|
||||
* [:link:](winjs/winjs.d.ts) [WinJS](http://try.buildwinjs.com) by [TypeScript samples](https://www.typescriptlang.org), [Adam Hewitt](https://github.com/adamhewitt627), [Craig Treasure](https://github.com/craigktreasure), [Jeff Fisher](https://github.com/xirzec)
|
||||
* [:link:](winrt/winrt.d.ts) [WinRT](http://msdn.microsoft.com/en-us/library/windows/apps/br211377.aspx) by [TypeScript samples](https://www.typescriptlang.org)
|
||||
* [:link:](winston/winston.d.ts) [winston](https://github.com/flatiron/winston) by [bonnici](https://github.com/bonnici), [Peter Harris](https://github.com/codeanimal)
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
/// <reference path="FileSaver.d.ts" />
|
||||
|
||||
/**
|
||||
* @summary Test for "saveAs" function.
|
||||
*/
|
||||
function testSaveAs() {
|
||||
var data: Blob = new Blob(["Hello, world!"], {type: "text/plain;charset=utf-8"});
|
||||
var filename: string = 'hello world.txt';
|
||||
|
||||
saveAs(data, filename);
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
--noImplicitAny
|
||||
Vendored
+27
@@ -0,0 +1,27 @@
|
||||
// Type definitions for FileSaver.js
|
||||
// Project: https://github.com/eligrey/FileSaver.js/
|
||||
// Definitions by: Cyril Schumacher <https://github.com/cyrilschumacher>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* @summary Interface for "saveAs" function.
|
||||
* @author Cyril Schumacher
|
||||
* @version 1.0
|
||||
*/
|
||||
interface FileSaver {
|
||||
(
|
||||
/**
|
||||
* @summary Data.
|
||||
* @type {Blob}
|
||||
*/
|
||||
data: Blob,
|
||||
|
||||
/**
|
||||
* @summary File name.
|
||||
* @type {DOMString}
|
||||
*/
|
||||
filename: string
|
||||
): void
|
||||
}
|
||||
|
||||
declare var saveAs: FileSaver;
|
||||
@@ -1,23 +0,0 @@
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
|
||||
function readJSON(target) {
|
||||
return JSON.parse(fs.readFileSync(target, 'utf8'));
|
||||
}
|
||||
|
||||
function getSemFloat(str) {
|
||||
var m = /^[^\d]*(\d+)\.(\d+)/.exec(str);
|
||||
return parseFloat(m[1] + '.' + m[2]);
|
||||
}
|
||||
|
||||
var repo = readJSON(path.resolve(__dirname, '..', 'package.json'));
|
||||
|
||||
var testerPath = path.resolve(__dirname, '..', 'node_modules', 'definition-tester', 'package.json');
|
||||
|
||||
// ultra lame semver major/minor check
|
||||
if (!fs.existsSync(testerPath) || getSemFloat(repo.dependencies['definition-tester']) > getSemFloat(readJSON(testerPath).version)) {
|
||||
console.log('DefinitelyTyped tester needs an update!\n\n please run \'npm install\'\n');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
require('definition-tester');
|
||||
-9178
File diff suppressed because it is too large
Load Diff
@@ -1,2 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
require('./tsc.js')
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-14202
File diff suppressed because it is too large
Load Diff
@@ -1,2 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
require('./tsc.js')
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-14931
File diff suppressed because it is too large
Load Diff
@@ -1,2 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
require('./tsc.js')
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-14958
File diff suppressed because it is too large
Load Diff
@@ -1,2 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
require('./tsc.js')
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-14958
File diff suppressed because it is too large
Load Diff
@@ -1,2 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
require('./tsc.js')
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-14958
File diff suppressed because it is too large
Load Diff
@@ -1,2 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
require('./tsc.js')
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-14169
File diff suppressed because it is too large
Load Diff
@@ -1,2 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
require('./tsc.js')
|
||||
File diff suppressed because one or more lines are too long
-14169
File diff suppressed because it is too large
Load Diff
@@ -1,2 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
require('./tsc.js')
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,80 @@
|
||||
/// <reference path="./amqp-rpc.d.ts" />
|
||||
import amqp_rpc = require('amqp-rpc');
|
||||
var rpc = amqp_rpc.factory();
|
||||
|
||||
interface Name {
|
||||
name?: string;
|
||||
}
|
||||
|
||||
rpc.on<number>('inc', function (param, cb) {
|
||||
var prevVal = param;
|
||||
var nextVal = param + 2;
|
||||
cb(++param, prevVal, nextVal);
|
||||
});
|
||||
|
||||
rpc.on<Name>('say.*', function (param, cb, inf) {
|
||||
var arr = inf.cmd.split('.');
|
||||
var name = (param && param.name) ? param.name : 'world';
|
||||
cb(arr[1] + ' ' + name + '!');
|
||||
});
|
||||
|
||||
rpc.on('withoutCB', function (param, cb, inf) {
|
||||
if (cb) {
|
||||
cb('please run function without cb parameter')
|
||||
}
|
||||
else {
|
||||
console.log('this is function withoutCB');
|
||||
}
|
||||
});
|
||||
|
||||
rpc.call<number>('inc', 5, function (param1, param2, param3) {
|
||||
console.log(param1, param2, param3);
|
||||
});
|
||||
|
||||
rpc.call<Name>('say.Hello', { name: 'John' }, function (msg) {
|
||||
console.log('results of say.Hello:', msg); //output: Hello John!
|
||||
});
|
||||
|
||||
rpc.call<any>('withoutCB', {}, function (msg) {
|
||||
console.log('withoutCB results:', msg); //output: please run function without cb parameter
|
||||
});
|
||||
|
||||
rpc.call<any>('withoutCB', {}); //output message on server side console
|
||||
|
||||
import os = require('os');
|
||||
interface State {
|
||||
type: string;
|
||||
}
|
||||
|
||||
var counter = 0;
|
||||
rpc.onBroadcast<State>('getWorkerStat', function (params, cb) {
|
||||
if (params && params.type == 'fullStat') {
|
||||
cb(null, {
|
||||
pid: process.pid,
|
||||
hostname: os.hostname(),
|
||||
uptime: process.uptime(),
|
||||
counter: counter++
|
||||
});
|
||||
}
|
||||
else {
|
||||
cb(null, { counter: counter++ })
|
||||
}
|
||||
});
|
||||
|
||||
var all_stats: any = {};
|
||||
rpc.callBroadcast<State>(
|
||||
'getWorkerStat',
|
||||
{ type: 'fullStat' }, //request parameters
|
||||
{ //call options
|
||||
ttl: 1000, //wait response time (1 seconds), after run onComplete
|
||||
onResponse: function (err: any, stat: any) { //callback on each worker response
|
||||
all_stats[stat.hostname + ':' + stat.pid] = stat;
|
||||
},
|
||||
onComplete: function () { //callback on ttl expired
|
||||
console.log('----------------------- WORKER STATISTICS ----------------------------------------');
|
||||
for (var worker in all_stats) {
|
||||
var s: any = all_stats[worker];
|
||||
console.log(worker, '\tuptime=', s.uptime.toFixed(2) + ' seconds', '\tcounter=', s.counter);
|
||||
}
|
||||
}
|
||||
});
|
||||
Vendored
+72
@@ -0,0 +1,72 @@
|
||||
// Type definitions for amqp-rpc v0.0.8
|
||||
// Project: https://github.com/demchenkoe/node-amqp-rpc/
|
||||
// Definitions by: Wonshik Kim <https://github.com/wokim/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
|
||||
declare module "amqp-rpc" {
|
||||
|
||||
export interface Options {
|
||||
connection?: any;
|
||||
url?: string;
|
||||
exchangeInstance?: any;
|
||||
exchange?: string;
|
||||
exchange_options?: {
|
||||
exclusive?: boolean;
|
||||
autoDelete?: boolean;
|
||||
};
|
||||
ipml_options?: {
|
||||
defaultExchangeName?: string;
|
||||
}
|
||||
conn_options?: any;
|
||||
}
|
||||
|
||||
export interface CallOptions {
|
||||
correlationId?: string;
|
||||
autoDeleteCallback?: any;
|
||||
}
|
||||
|
||||
export interface HandlerOptions {
|
||||
queueName?: string;
|
||||
durable?: boolean;
|
||||
exclusive?: boolean;
|
||||
autoDelete?: boolean;
|
||||
}
|
||||
|
||||
export interface BroadcastOptions {
|
||||
ttl?: number;
|
||||
onResponse?: any;
|
||||
context?: any;
|
||||
onComplete?: any;
|
||||
}
|
||||
|
||||
export interface CommandInfo {
|
||||
cmd?: string;
|
||||
exchange?: string;
|
||||
contentType?: string;
|
||||
size?: number;
|
||||
}
|
||||
|
||||
export interface Callback {
|
||||
(...args: any[]): void;
|
||||
}
|
||||
|
||||
export interface CallbackWithError {
|
||||
(err: any, ...args: any[]): void;
|
||||
}
|
||||
|
||||
export function factory(opt?: Options): amqpRPC;
|
||||
|
||||
export class amqpRPC {
|
||||
constructor(opt?: Options);
|
||||
generateQueueName(type: string): string;
|
||||
disconnect(): void;
|
||||
call<T>(cmd: string, params: T, cb?: Callback, context?: any, options?: CallOptions): string;
|
||||
on<T>(cmd: string, cb: (param?: T, cb?: Callback, info?: CommandInfo) => void, context?: any, options?: HandlerOptions): boolean;
|
||||
off(cmd: string): boolean;
|
||||
callBroadcast<T>(cmd: string, params: T, options?: BroadcastOptions): void;
|
||||
onBroadcast<T>(cmd: string, cb?: (params?: T, cb?: CallbackWithError) => void, context?: any, options?: any): boolean;
|
||||
offBroadcast(cmd: string): boolean;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
/// <reference path='../angularjs/angular.d.ts' />
|
||||
/// <reference path='angular-local-storage.d.ts' />
|
||||
|
||||
interface TestScope extends ng.IScope {
|
||||
submit: (key: string, value: string) => boolean;
|
||||
getItem: (key: string) => string;
|
||||
removeItem: (key: string) => boolean;
|
||||
clearNumbers: () => boolean;
|
||||
clearAll: () => boolean;
|
||||
unbind: Function;
|
||||
update: (val: string) => void;
|
||||
property: string;
|
||||
}
|
||||
|
||||
module ng.local.storage.tests {
|
||||
export class TestController {
|
||||
constructor($scope: TestScope, localStorageService: ng.local.storage.ILocalStorageService<string>) {
|
||||
// isSupported
|
||||
if (localStorageService.isSupported) {
|
||||
// do something
|
||||
}
|
||||
|
||||
// getStorageType
|
||||
var storageType: string = localStorageService.getStorageType();
|
||||
|
||||
// set
|
||||
$scope.submit = (key, value) => {
|
||||
return localStorageService.set(key, value);
|
||||
};
|
||||
|
||||
// get
|
||||
$scope.getItem = (key) => {
|
||||
return localStorageService.get(key);
|
||||
};
|
||||
|
||||
// remove
|
||||
$scope.removeItem = (key) => {
|
||||
return localStorageService.remove(key);
|
||||
};
|
||||
|
||||
// clearAll(regexp)
|
||||
$scope.clearNumbers = () => {
|
||||
return localStorageService.clearAll(/^\d+$/);
|
||||
};
|
||||
|
||||
// clearAll
|
||||
$scope.clearAll = () => {
|
||||
return localStorageService.clearAll();
|
||||
};
|
||||
|
||||
// keys
|
||||
var lsKeys = localStorageService.keys();
|
||||
|
||||
// bind
|
||||
localStorageService.set('property', 'oldValue');
|
||||
$scope.unbind = localStorageService.bind($scope, 'property');
|
||||
|
||||
// deriveKey
|
||||
console.log(localStorageService.deriveKey('property')); // ls.property
|
||||
|
||||
// length
|
||||
var lsLength: number = localStorageService.length();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var app = angular.module('angular-local-storage-tests', ['LocalStorageModule']);
|
||||
app.config(function (localStorageServiceProvider: ng.local.storage.ILocalStorageServiceProvider) {
|
||||
localStorageServiceProvider
|
||||
.setPrefix('myApp')
|
||||
.setStorageType('sessionStorage')
|
||||
.setNotify(true, true);
|
||||
});
|
||||
|
||||
app.controller('TestController', ng.local.storage.tests.TestController);
|
||||
+149
@@ -0,0 +1,149 @@
|
||||
// Type definitions for angular-local-storage v0.1.5
|
||||
// Project: https://github.com/grevory/angular-local-storage
|
||||
// Definitions by: Ken Fukuyama <https://github.com/kenfdev>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path='../angularjs/angular.d.ts' />
|
||||
|
||||
declare module ng.local.storage {
|
||||
interface ILocalStorageServiceProvider extends IServiceProvider {
|
||||
/**
|
||||
* Setter for the prefix
|
||||
* You should set a prefix to avoid overwriting any local storage variables from the rest of your app
|
||||
* e.g. localStorageServiceProvider.setPrefix('youAppName');
|
||||
* With provider you can use config as this:
|
||||
* myApp.config(function (localStorageServiceProvider) {
|
||||
* localStorageServiceProvider.prefix = 'yourAppName';
|
||||
* });
|
||||
* @param prefix default: ls.<your-key>
|
||||
*/
|
||||
setPrefix(prefix: string):ILocalStorageServiceProvider;
|
||||
/**
|
||||
* Setter for the storageType
|
||||
* @param storageType localstorage or sessionStorage. default: localStorage
|
||||
*/
|
||||
setStorageType(storageType: string):ILocalStorageServiceProvider;
|
||||
/**
|
||||
* Setter for cookie config
|
||||
* @param exp number of days before cookies expire (0 = does not expire). default: 30
|
||||
* @param path the web path the cookie represents. default: '/'
|
||||
*/
|
||||
setStorageCookie(exp: number, path: string):ILocalStorageServiceProvider;
|
||||
/**
|
||||
* Set the cookie domain, since this runs inside a the config() block, only providers and constants can be injected. As a result, $location service can't be used here, use a hardcoded string or window.location.
|
||||
* No default value
|
||||
*/
|
||||
setStorageCookieDomain(domain: string):ILocalStorageServiceProvider;
|
||||
/**
|
||||
* Send signals for each of the following actions:
|
||||
* @param setItem default: true
|
||||
* @param removeItem default: false
|
||||
*/
|
||||
setNotify(setItem: boolean, removeItem: boolean):ILocalStorageServiceProvider;
|
||||
}
|
||||
|
||||
interface ICookie {
|
||||
/**
|
||||
* Checks if cookies are enabled in the browser.
|
||||
* Returns: Boolean
|
||||
*/
|
||||
isSupported:boolean;
|
||||
/**
|
||||
* Directly adds a value to cookies.
|
||||
* Note: Typically used as a fallback if local storage is not supported.
|
||||
* Returns: Boolean
|
||||
* @param key
|
||||
* @param val
|
||||
*/
|
||||
set(key:string, val:string):boolean;
|
||||
/**
|
||||
* Directly get a value from a cookie.
|
||||
* Returns: value from local storage
|
||||
* @param key
|
||||
*/
|
||||
get(key:string):string;
|
||||
/**
|
||||
* Remove directly value from a cookie.
|
||||
* Returns: Boolean
|
||||
* @param key
|
||||
*/
|
||||
remove(key:string):boolean;
|
||||
/**
|
||||
* Remove all data for this app from cookie.
|
||||
*/
|
||||
clearAll():any;
|
||||
|
||||
}
|
||||
|
||||
interface ILocalStorageService<T> {
|
||||
/**
|
||||
* Checks if the browser support the current storage type(e.g: localStorage, sessionStorage).
|
||||
* Returns: Boolean
|
||||
*/
|
||||
isSupported:boolean;
|
||||
/**
|
||||
* Returns: String
|
||||
*/
|
||||
getStorageType():string;
|
||||
/**
|
||||
* Directly adds a value to local storage.
|
||||
* If local storage is not supported, use cookies instead.
|
||||
* Returns: Boolean
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
set(key: string, value: T): boolean;
|
||||
/**
|
||||
* Directly get a value from local storage.
|
||||
* If local storage is not supported, use cookies instead.
|
||||
* Returns: value from local storage
|
||||
* @param key
|
||||
*/
|
||||
get(key: string): T;
|
||||
/**
|
||||
* Return array of keys for local storage, ignore keys that not owned.
|
||||
* Returns: value from local storage
|
||||
*/
|
||||
keys(): string[];
|
||||
/**
|
||||
* Remove an item from local storage by key.
|
||||
* If local storage is not supported, use cookies instead.
|
||||
* Returns: Boolean
|
||||
* @param key
|
||||
*/
|
||||
remove(key: string): boolean;
|
||||
/**
|
||||
* Remove all data for this app from local storage.
|
||||
* If local storage is not supported, use cookies instead.
|
||||
* Note: Optionally takes a regular expression string and removes matching.
|
||||
* Returns: Boolean
|
||||
* @param regularExpression
|
||||
*/
|
||||
clearAll(regularExpression?:RegExp):boolean;
|
||||
/**
|
||||
* Bind $scope key to localStorageService.
|
||||
* Usage: localStorageService.bind(scope, property, value[optional], key[optional])
|
||||
* Returns: deregistration function for this listener.
|
||||
* @param scope
|
||||
* @param property
|
||||
* @param value optional
|
||||
* @param key The corresponding key used in local storage
|
||||
*/
|
||||
bind(scope:ng.IScope, property: string, value?: any, key?: string): Function;
|
||||
/**
|
||||
* Return the derive key
|
||||
* Returns String
|
||||
* @param key
|
||||
*/
|
||||
deriveKey(key:string):string;
|
||||
/**
|
||||
* Return localStorageService.length, ignore keys that not owned.
|
||||
* Returns Number
|
||||
*/
|
||||
length():number;
|
||||
/**
|
||||
* Deal with browser's cookies directly.
|
||||
*/
|
||||
cookie:ICookie;
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,7 @@
|
||||
/// <reference path="angular-protractor.d.ts" />
|
||||
|
||||
function TestWebDriverExports() {
|
||||
var abstractBuilder: protractor.AbstractBuilder = new protractor.AbstractBuilder();
|
||||
var baseAbstractBuilder: webdriver.AbstractBuilder = abstractBuilder;
|
||||
|
||||
var button: protractor.Button = new protractor.Button();
|
||||
var baseButton: webdriver.Button = button;
|
||||
var button: number = protractor.Button.LEFT;
|
||||
|
||||
var key: string = protractor.Key.ADD;
|
||||
var chord: string = protractor.Key.chord(protractor.Key.NUMPAD0, protractor.Key.NUMPAD1);
|
||||
@@ -18,12 +14,6 @@ function TestWebDriverExports() {
|
||||
var action: protractor.ActionSequence = new protractor.ActionSequence(driver);
|
||||
var baseAction: webdriver.ActionSequence = action;
|
||||
|
||||
var alert: protractor.Alert = new protractor.Alert(driver, 'Message');
|
||||
var baseAlert: webdriver.Alert = alert;
|
||||
|
||||
var unhandledAlertError: protractor.UnhandledAlertError = new protractor.UnhandledAlertError('Message', alert);
|
||||
var baseUnhandledAlertError: webdriver.UnhandledAlertError = unhandledAlertError;
|
||||
|
||||
var browser: string = protractor.Browser.ANDROID;
|
||||
|
||||
var builder: protractor.Builder = new protractor.Builder();
|
||||
@@ -42,89 +32,168 @@ function TestWebDriverExports() {
|
||||
var eventEmitter: protractor.EventEmitter = new protractor.EventEmitter();
|
||||
var baseEventEmitter: webdriver.EventEmitter = eventEmitter;
|
||||
|
||||
var firefoxDomExecutor: protractor.FirefoxDomExecutor = new protractor.FirefoxDomExecutor();
|
||||
var baseFirefoxDomExecutor: webdriver.FirefoxDomExecutor = firefoxDomExecutor;
|
||||
|
||||
var webElement: protractor.WebElement = new protractor.WebElement(driver, new protractor.promise.Promise());
|
||||
var baseWebElement: webdriver.WebElement = webElement;
|
||||
|
||||
var locator: protractor.Locator = new protractor.Locator('id', 'ABC');
|
||||
var baseLocator: webdriver.Locator = locator;
|
||||
var locator: webdriver.Locator = by.id('abc');
|
||||
|
||||
var session: protractor.Session = new protractor.Session('ABC', webdriver.Capabilities.android());
|
||||
var baseSession: webdriver.Session = session;
|
||||
|
||||
locator = protractor.By.name('name');
|
||||
|
||||
// logging module
|
||||
var driver: protractor.WebDriver = new protractor.WebDriver(session, <webdriver.CommandExecutor><any>{});
|
||||
driver = new protractor.WebDriver(session, <webdriver.CommandExecutor><any>{}, new webdriver.promise.ControlFlow());
|
||||
var baseDriver: webdriver.WebDriver = driver;
|
||||
|
||||
var levelName: string = protractor.logging.LevelName.ALL;
|
||||
var webElement: protractor.WebElement = new protractor.WebElement(driver, { ELEMENT: 'abc' });
|
||||
var baseWebElement: webdriver.WebElement = webElement;
|
||||
|
||||
var webElementPromise: protractor.WebElementPromise = new protractor.WebElementPromise(driver, { ELEMENT: 'abc' });
|
||||
var baseWebElementPromise: webdriver.WebElementPromise = webElementPromise;
|
||||
}
|
||||
|
||||
function TestWebDriverErrorModule() {
|
||||
var errorCode: number = protractor.error.ErrorCode.ELEMENT_NOT_VISIBLE;
|
||||
var error: protractor.error.Error = new protractor.error.Error(protractor.error.ErrorCode.ELEMENT_NOT_VISIBLE);
|
||||
var baseError: webdriver.error.Error = error;
|
||||
}
|
||||
|
||||
function TestWebDriverLoggingModule() {
|
||||
var levelName: string = protractor.logging.Level.ALL.name;
|
||||
var loggingType: string = protractor.logging.Type.CLIENT;
|
||||
|
||||
var level: webdriver.logging.Level = protractor.logging.Level.ALL;
|
||||
var level: webdriver.logging.ILevel = protractor.logging.Level.ALL;
|
||||
|
||||
var entry: protractor.logging.Entry = new protractor.logging.Entry(protractor.logging.Level.ALL, 'Message');
|
||||
var baseEntry: webdriver.logging.Entry = entry;
|
||||
|
||||
level = protractor.logging.getLevel('DEBUG');
|
||||
|
||||
protractor.logging.Preferences = { a: 123 };
|
||||
var prefs: protractor.logging.Preferences = new protractor.logging.Preferences();
|
||||
}
|
||||
|
||||
// promise module
|
||||
function TestWebDriverPromiseModule() {
|
||||
var cancelError: protractor.promise.CancellationError = new protractor.promise.CancellationError();
|
||||
cancelError = new protractor.promise.CancellationError('message');
|
||||
var baseCancelError: webdriver.promise.CancellationError = cancelError;
|
||||
|
||||
var promise: protractor.promise.Promise = new protractor.promise.Promise();
|
||||
var basePromise: webdriver.promise.Promise = promise;
|
||||
var thenable: protractor.promise.Thenable<any> = new protractor.promise.Thenable();
|
||||
var baseThenable: webdriver.promise.Thenable<any> = thenable;
|
||||
|
||||
var deferred: protractor.promise.Deferred = new protractor.promise.Deferred();
|
||||
var baseDeferred: webdriver.promise.Deferred = deferred;
|
||||
var promise: protractor.promise.Promise<any> = new protractor.promise.Promise();
|
||||
var basePromise: webdriver.promise.Promise<any> = promise;
|
||||
|
||||
var deferred: protractor.promise.Deferred<any> = new protractor.promise.Deferred();
|
||||
var baseDeferred: webdriver.promise.Deferred<any> = deferred;
|
||||
|
||||
var flow: protractor.promise.ControlFlow = new protractor.promise.ControlFlow();
|
||||
var baseFlow: webdriver.promise.ControlFlow = flow;
|
||||
|
||||
protractor.promise.asap(promise, function(value: any){ return true; });
|
||||
protractor.promise.asap(promise, function(value: any){}, function(err: any) { return 'ABC'; });
|
||||
var arrayPromise: protractor.promise.Promise<any[]> = protractor.promise.all([new protractor.promise.Promise<number>(), new protractor.promise.Promise<string>()]);
|
||||
|
||||
promise = protractor.promise.checkedNodeCall(function(err: any, value: any) { return 123; });
|
||||
protractor.promise.asap(promise, function (value: any) { return true; });
|
||||
protractor.promise.asap(promise, function (value: any) { }, function (err: any) { return 'ABC'; });
|
||||
|
||||
promise = protractor.promise.checkedNodeCall(function (err: any, value: any) { return 123; });
|
||||
|
||||
promise = protractor.promise.consume(function () {
|
||||
return 5;
|
||||
});
|
||||
promise = protractor.promise.consume(function () {
|
||||
return 5;
|
||||
}, this);
|
||||
promise = protractor.promise.consume(function () {
|
||||
return 5;
|
||||
}, this, 1, 2, 3);
|
||||
|
||||
flow = protractor.promise.controlFlow();
|
||||
|
||||
promise = protractor.promise.createFlow(function(newFlow: webdriver.promise.ControlFlow) { });
|
||||
promise = protractor.promise.createFlow(function (newFlow: webdriver.promise.ControlFlow) { });
|
||||
|
||||
deferred = protractor.promise.defer(function() {});
|
||||
deferred = protractor.promise.defer(function(reason?: any) {});
|
||||
deferred = protractor.promise.defer();
|
||||
|
||||
promise = protractor.promise.delayed(123);
|
||||
|
||||
var numbersPromise: protractor.promise.Promise<number[]> = protractor.promise.filter([1, 2, 3], function (el: number, index: number, arr: number[]) {
|
||||
return true;
|
||||
});
|
||||
numbersPromise = protractor.promise.filter([1, 2, 3], function (el: number, index: number, arr: number[]) {
|
||||
return true;
|
||||
}, this);
|
||||
numbersPromise = protractor.promise.filter(numbersPromise, function (el: number, index: number, arr: number[]) {
|
||||
return true;
|
||||
});
|
||||
numbersPromise = protractor.promise.filter(numbersPromise, function (el: number, index: number, arr: number[]) {
|
||||
return true;
|
||||
}, this);
|
||||
|
||||
numbersPromise = protractor.promise.map([1, 2, 3], function (el: number, index: number, arr: number[]) {
|
||||
return true;
|
||||
});
|
||||
numbersPromise = protractor.promise.map([1, 2, 3], function (el: number, index: number, arr: number[]) {
|
||||
return true;
|
||||
}, this);
|
||||
numbersPromise = protractor.promise.map(numbersPromise, function (el: number, index: number, arr: number[]) {
|
||||
return true;
|
||||
});
|
||||
numbersPromise = protractor.promise.map(numbersPromise, function (el: number, index: number, arr: number[]) {
|
||||
return true;
|
||||
}, this);
|
||||
|
||||
promise = protractor.promise.fulfilled();
|
||||
promise = protractor.promise.fulfilled({a: 123});
|
||||
promise = protractor.promise.fulfilled({ a: 123 });
|
||||
|
||||
promise = protractor.promise.fullyResolved({a: 123});
|
||||
promise = protractor.promise.fullyResolved({ a: 123 });
|
||||
|
||||
var isPromise: boolean = protractor.promise.isPromise('ABC');
|
||||
var bool: boolean = protractor.promise.isGenerator(function () { });
|
||||
var bool: boolean = protractor.promise.isPromise('ABC');
|
||||
|
||||
promise = protractor.promise.rejected({a: 123});
|
||||
promise = protractor.promise.rejected({ a: 123 });
|
||||
|
||||
protractor.promise.setDefaultFlow(new webdriver.promise.ControlFlow());
|
||||
|
||||
promise = protractor.promise.when(promise, function(value: any) { return 123; }, function(err: Error) { return 123; });
|
||||
promise = protractor.promise.when(promise, function (value: any) { return 123; }, function (err: Error) { return 123; });
|
||||
}
|
||||
|
||||
// error module
|
||||
function TestWebDriverStacktraceModule() {
|
||||
var bool: boolean = protractor.stacktrace.BROWSER_SUPPORTED;
|
||||
|
||||
var errorCode: number = protractor.error.ErrorCode.ELEMENT_NOT_VISIBLE;
|
||||
var error: protractor.error.Error = new protractor.error.Error(protractor.error.ErrorCode.ELEMENT_NOT_VISIBLE);
|
||||
var baseError: webdriver.error.Error = error;
|
||||
var frame: protractor.stacktrace.Frame = new protractor.stacktrace.Frame();
|
||||
var baseFrame: webdriver.stacktrace.Frame = frame;
|
||||
|
||||
// process module
|
||||
var snapshot: protractor.stacktrace.Snapshot = new protractor.stacktrace.Snapshot();
|
||||
var baseSnapshot: webdriver.stacktrace.Snapshot = snapshot;
|
||||
|
||||
var isNative: boolean = protractor.process.isNative();
|
||||
var value: string;
|
||||
var err: Error = protractor.stacktrace.format(new Error("Error"));
|
||||
var frames: protractor.stacktrace.Frame[] = protractor.stacktrace.get();
|
||||
}
|
||||
|
||||
value = protractor.process.getEnv('name');
|
||||
value = protractor.process.getEnv('name', 'default');
|
||||
function TestWebDriverUntilModule() {
|
||||
var conditionB: protractor.until.Condition<boolean> = new protractor.until.Condition<boolean>('message', function (driver: webdriver.WebDriver) { return true; });
|
||||
var conditionBBase: webdriver.until.Condition<boolean> = conditionB;
|
||||
var conditionWebElement: protractor.until.Condition<webdriver.IWebElement>;
|
||||
var conditionWebElements: protractor.until.Condition<webdriver.IWebElement[]>;
|
||||
|
||||
protractor.process.setEnv('name', 'value');
|
||||
protractor.process.setEnv('name', 123);
|
||||
conditionB = protractor.until.ableToSwitchToFrame(5);
|
||||
var conditionAlert: protractor.until.Condition<webdriver.Alert> = protractor.until.alertIsPresent();
|
||||
var el: protractor.ElementFinder = element(by.id('id'));
|
||||
conditionB = protractor.until.elementIsDisabled(el);
|
||||
conditionB = protractor.until.elementIsEnabled(el);
|
||||
conditionB = protractor.until.elementIsNotSelected(el);
|
||||
conditionB = protractor.until.elementIsNotVisible(el);
|
||||
conditionB = protractor.until.elementIsSelected(el);
|
||||
conditionB = protractor.until.elementIsVisible(el);
|
||||
conditionB = protractor.until.elementTextContains(el, 'text');
|
||||
conditionB = protractor.until.elementTextIs(el, 'text');
|
||||
conditionB = protractor.until.elementTextMatches(el, /text/);
|
||||
conditionB = protractor.until.stalenessOf(el);
|
||||
conditionB = protractor.until.titleContains('text');
|
||||
conditionB = protractor.until.titleIs('text');
|
||||
conditionB = protractor.until.titleMatches(/text/);
|
||||
|
||||
conditionWebElement = protractor.until.elementLocated(by.id('id'));
|
||||
conditionWebElements = protractor.until.elementsLocated(by.className('class'));
|
||||
}
|
||||
|
||||
function TestProtractor() {
|
||||
@@ -133,31 +202,47 @@ function TestProtractor() {
|
||||
withCapabilities(webdriver.Capabilities.chrome()).
|
||||
build();
|
||||
|
||||
ptor = new protractor.Protractor(driver);
|
||||
ptor = new protractor.Protractor(driver, 'baseUrl');
|
||||
ptor = new protractor.Protractor(driver, 'baseUrl', 'rootElement');
|
||||
ptor = protractor.getInstance();
|
||||
protractor.setInstance(ptor);
|
||||
|
||||
ptor = protractor.wrapDriver(driver);
|
||||
ptor = protractor.wrapDriver(driver, 'baseUrl');
|
||||
ptor = protractor.wrapDriver(driver, 'baseUrl', 'rootElement');
|
||||
|
||||
ptor = browser;
|
||||
|
||||
var actions: protractor.ActionSequence = ptor.actions();
|
||||
|
||||
var promise: protractor.promise.Promise<any> = ptor.call(function () { });
|
||||
var promise: protractor.promise.Promise<any> = ptor.call(function () { }, this);
|
||||
var promise: protractor.promise.Promise<any> = ptor.call(function (a: number, b: number, c:number) { }, this, 1, 2,3);
|
||||
|
||||
promise = ptor.executeAsyncScript('SomeScript');
|
||||
promise = ptor.executeAsyncScript('SomeScript', 1, 2, 3);
|
||||
promise = ptor.executeAsyncScript(function () { });
|
||||
promise = ptor.executeAsyncScript(function (a: number, b: number, c: number) { }, 1, 2, 3);
|
||||
|
||||
promise = ptor.executeScript('SomeScript');
|
||||
promise = ptor.executeScript('SomeScript', 1, 2, 3);
|
||||
promise = ptor.executeScript(function () { });
|
||||
promise = ptor.executeScript(function (a: number, b: number, c: number) { }, 1, 2, 3);
|
||||
|
||||
ptor = browser.forkNewDriverInstance();
|
||||
ptor = browser.forkNewDriverInstance(true);
|
||||
ptor = browser.forkNewDriverInstance(true, false);
|
||||
|
||||
driver = ptor.driver;
|
||||
var baseUrl: string = ptor.baseUrl;
|
||||
var rootEl: string = ptor.rootEl;
|
||||
var ignoreSynchronization: boolean = ptor.ignoreSynchronization;
|
||||
var params: any = ptor.params;
|
||||
ptor.resetUrl = "url";
|
||||
|
||||
ptor.debugger();
|
||||
ptor.close();
|
||||
var controlFlow: protractor.promise.ControlFlow = ptor.controlFlow();
|
||||
|
||||
var webElement: protractor.WebElement = ptor.findElement(by.css('.class'));
|
||||
var promise: webdriver.promise.Promise;
|
||||
promise = ptor.findElements(by.css('.class'));
|
||||
promise = ptor.isElementPresent(by.css('.class'));
|
||||
promise = ptor.isElementPresent(webElement);
|
||||
ptor.findElements(by.css('.class')).then(function (elements: webdriver.WebElement[]) { });
|
||||
ptor.isElementPresent(by.css('.class')).then(function (present: boolean) { });
|
||||
ptor.isElementPresent(webElement).then(function (present: boolean) { });
|
||||
|
||||
ptor.clearMockModules();
|
||||
ptor.addMockModule('name', 'script');
|
||||
@@ -173,16 +258,43 @@ function TestProtractor() {
|
||||
|
||||
elementArrayFinder = ptor.$$('.class');
|
||||
|
||||
var locationAbsUrl: webdriver.promise.Promise = ptor.getLocationAbsUrl();
|
||||
var locationAbsUrl: webdriver.promise.Promise<string> = ptor.getLocationAbsUrl();
|
||||
ptor.setLocation('webaddress.com');
|
||||
|
||||
promise = ptor.get('webaddress.com');
|
||||
promise = ptor.get('webdaddress.com', 45);
|
||||
var voidPromise: webdriver.promise.Promise<void> = ptor.get('webaddress.com');
|
||||
voidPromise = ptor.get('webdaddress.com', 45);
|
||||
voidPromise = ptor.quit();
|
||||
voidPromise = ptor.sleep(5000);
|
||||
|
||||
ptor.refresh();
|
||||
ptor.refresh(45);
|
||||
var navigation: webdriver.WebDriverNavigation = ptor.navigate();
|
||||
ptor.pause();
|
||||
ptor.pause(8080);
|
||||
|
||||
ptor.getAllWindowHandles().then(function (handles: string[]) { });
|
||||
|
||||
var capabilities: protractor.promise.Promise<protractor.Capabilities> = ptor.getCapabilities();
|
||||
|
||||
var stringPromise: webdriver.promise.Promise<string>;
|
||||
stringPromise = ptor.getCurrentUrl();
|
||||
stringPromise = ptor.getPageSource();
|
||||
stringPromise = ptor.getTitle();
|
||||
stringPromise = ptor.getWindowHandle();
|
||||
stringPromise = ptor.takeScreenshot();
|
||||
|
||||
ptor.getPageTimeout = 5000;
|
||||
|
||||
var session: protractor.promise.Promise<protractor.Session> = ptor.getSession();
|
||||
|
||||
var options: webdriver.WebDriverOptions = ptor.manage();
|
||||
|
||||
promise = ptor.schedule(new protractor.Command(protractor.CommandName.ACCEPT_ALERT), 'asdf');
|
||||
|
||||
var targetLocator: webdriver.WebDriverTargetLocator = ptor.switchTo();
|
||||
|
||||
ptor.wait(protractor.until.elementLocated(by.id('id')), 5000).then(function (el: webdriver.IWebElement) { });;
|
||||
ptor.wait(protractor.until.elementLocated(by.id('id')), 5000, 'message').then(function (el: webdriver.IWebElement) { });;
|
||||
}
|
||||
|
||||
function TestElement() {
|
||||
@@ -192,80 +304,121 @@ function TestElement() {
|
||||
|
||||
function TestElementFinder() {
|
||||
var elementFinder: protractor.ElementFinder = element(by.id('id'));
|
||||
var promise: webdriver.promise.Promise;
|
||||
var voidPromise: webdriver.promise.Promise<void>;
|
||||
var stringPromise: webdriver.promise.Promise<string>;
|
||||
var booleanPromise: webdriver.promise.Promise<boolean>;
|
||||
|
||||
promise = elementFinder.click();
|
||||
promise = elementFinder.allowAnimations('string');
|
||||
promise = elementFinder.sendKeys(protractor.Key.UP, protractor.Key.DOWN);
|
||||
promise = elementFinder.getTagName();
|
||||
promise = elementFinder.getCssValue('display');
|
||||
promise = elementFinder.getAttribute('atribute');
|
||||
promise = elementFinder.getText();
|
||||
promise = elementFinder.getSize();
|
||||
promise = elementFinder.getLocation();
|
||||
promise = elementFinder.isEnabled();
|
||||
promise = elementFinder.isSelected();
|
||||
promise = elementFinder.submit();
|
||||
promise = elementFinder.clear();
|
||||
promise = elementFinder.isDisplayed();
|
||||
promise = elementFinder.getOuterHtml();
|
||||
promise = elementFinder.getInnerHtml();
|
||||
promise = elementFinder.isElementPresent(by.id('id'));
|
||||
promise = elementFinder.$('.class');
|
||||
promise = elementFinder.$$('.class');
|
||||
promise = elementFinder.evaluate('expression');
|
||||
promise = elementFinder.isPresent();
|
||||
elementFinder.getId().then(function (id: webdriver.IWebElementId) { });
|
||||
voidPromise = elementFinder.click();
|
||||
elementFinder = elementFinder.allowAnimations('string');
|
||||
voidPromise = elementFinder.sendKeys(protractor.Key.UP, protractor.Key.DOWN);
|
||||
stringPromise = elementFinder.getTagName();
|
||||
stringPromise = elementFinder.getCssValue('display');
|
||||
stringPromise = elementFinder.getAttribute('atribute');
|
||||
stringPromise = elementFinder.getText();
|
||||
elementFinder.getSize().then(function (size: webdriver.ISize) { });
|
||||
elementFinder.getLocation().then(function (location: webdriver.ILocation) { });
|
||||
booleanPromise = elementFinder.isEnabled();
|
||||
booleanPromise = elementFinder.isSelected();
|
||||
voidPromise = elementFinder.submit();
|
||||
voidPromise = elementFinder.clear();
|
||||
booleanPromise = elementFinder.isDisplayed();
|
||||
stringPromise = elementFinder.getOuterHtml();
|
||||
stringPromise = elementFinder.getInnerHtml();
|
||||
booleanPromise = elementFinder.isElementPresent(by.id('id'));
|
||||
elementFinder = elementFinder.$('.class');
|
||||
var finders: protractor.ElementArrayFinder = elementFinder.$$('.class');
|
||||
elementFinder = elementFinder.evaluate('expression');
|
||||
booleanPromise = elementFinder.isPresent();
|
||||
|
||||
var webElement: webdriver.WebElement;
|
||||
var webElement: webdriver.WebElement = elementFinder.getWebElement();
|
||||
finders = elementFinder.all(by.className('class'));
|
||||
elementFinder = elementFinder.allowAnimations('abc');
|
||||
elementFinder = elementFinder.clone();
|
||||
elementFinder = elementFinder.element(by.id('id'));
|
||||
|
||||
var b: boolean = elementFinder.isPending();
|
||||
var locator: webdriver.Locator = elementFinder.locator();
|
||||
}
|
||||
|
||||
function TestElementArrayFinder() {
|
||||
var elementArrayFinder: protractor.ElementArrayFinder = element.all(by.id('id'));
|
||||
var promise: webdriver.promise.Promise;
|
||||
var elementFinder: protractor.ElementFinder;
|
||||
|
||||
var voidPromise: webdriver.promise.Promise<void>;
|
||||
var stringPromise: webdriver.promise.Promise<string[]>;
|
||||
var booleanPromise: webdriver.promise.Promise<boolean[]>;
|
||||
|
||||
elementArrayFinder.getId().then(function (id: webdriver.IWebElementId[]) { });
|
||||
voidPromise = elementArrayFinder.click();
|
||||
elementArrayFinder = elementArrayFinder.allowAnimations(true);
|
||||
voidPromise = elementArrayFinder.sendKeys(protractor.Key.UP, protractor.Key.DOWN);
|
||||
stringPromise = elementArrayFinder.getTagName();
|
||||
stringPromise = elementArrayFinder.getCssValue('display');
|
||||
stringPromise = elementArrayFinder.getAttribute('atribute');
|
||||
stringPromise = elementArrayFinder.getText();
|
||||
elementArrayFinder.getSize().then(function (size: webdriver.ISize[]) { });
|
||||
elementArrayFinder.getLocation().then(function (location: webdriver.ILocation[]) { });
|
||||
booleanPromise = elementArrayFinder.isEnabled();
|
||||
booleanPromise = elementArrayFinder.isSelected();
|
||||
voidPromise = elementArrayFinder.submit();
|
||||
voidPromise = elementArrayFinder.clear();
|
||||
booleanPromise = elementArrayFinder.isDisplayed();
|
||||
stringPromise = elementArrayFinder.getOuterHtml();
|
||||
stringPromise = elementArrayFinder.getInnerHtml();
|
||||
var finders: protractor.ElementArrayFinder = elementArrayFinder.$$('.class');
|
||||
elementArrayFinder = elementArrayFinder.evaluate('expression');
|
||||
|
||||
finders = elementArrayFinder.all(by.className('class'));
|
||||
elementArrayFinder = elementArrayFinder.clone();
|
||||
|
||||
var b: boolean = elementArrayFinder.isPending();
|
||||
var locator: webdriver.Locator = elementArrayFinder.locator();
|
||||
|
||||
var findersArray: protractor.ElementFinder[] = elementArrayFinder.asElementFinders_();
|
||||
|
||||
var driverElementArray: webdriver.WebElement[] = elementArrayFinder.getWebElements();
|
||||
elementFinder = elementArrayFinder.get(42);
|
||||
var elementFinder: protractor.ElementFinder = elementArrayFinder.get(42);
|
||||
elementFinder = elementArrayFinder.first();
|
||||
elementFinder = elementArrayFinder.last();
|
||||
promise = elementArrayFinder.count();
|
||||
promise = elementArrayFinder.asElementFinders_();
|
||||
elementFinder = elementArrayFinder.toElementFinder_()
|
||||
var numberPromise: protractor.promise.Promise<number> = elementArrayFinder.count();
|
||||
elementArrayFinder.each(function(element: protractor.ElementFinder){
|
||||
// nothing
|
||||
});
|
||||
elementArrayFinder.map(function(element: protractor.ElementFinder, index: number){
|
||||
// nothing
|
||||
});
|
||||
elementArrayFinder.filter(function(element: protractor.ElementFinder, index: number){
|
||||
stringPromise = elementArrayFinder.map(function(element: protractor.ElementFinder, index: number){
|
||||
return 'abc';
|
||||
})
|
||||
elementArrayFinder = elementArrayFinder.filter(function(element: protractor.ElementFinder, index: number){
|
||||
return element.getText().then((text: string) => {
|
||||
return text === "foo";
|
||||
});
|
||||
});
|
||||
elementArrayFinder.reduce(function(accumulator: string, element: protractor.ElementFinder){
|
||||
elementArrayFinder.reduce(function (accumulator: string, element: protractor.ElementFinder) {
|
||||
return element.getText().then((text: string) => {
|
||||
return accumulator + ',' + text;
|
||||
});
|
||||
}, '');
|
||||
}, '').then(function (result: string) { });
|
||||
elementArrayFinder.reduce(function(accumulator: string, element: protractor.ElementFinder, index: number, array: protractor.ElementFinder[]){
|
||||
return element.getText().then((text: string) => {
|
||||
return accumulator + ',' + text;
|
||||
});
|
||||
}, '');
|
||||
}, '').then(function (result: string) { });
|
||||
elementArrayFinder.then(function(underlyingElementFinders: protractor.ElementFinder[]){
|
||||
//nothing
|
||||
});
|
||||
}
|
||||
|
||||
// This function tests the angular specific locator strategies.
|
||||
// This function tests the locator strategies.
|
||||
function TestLocatorStrategies() {
|
||||
var ptor: protractor.Protractor = protractor.getInstance();
|
||||
var ptor: protractor.Protractor = browser;
|
||||
var webElement: webdriver.WebElement;
|
||||
|
||||
// Protractor Specific Locators
|
||||
protractor.By.addLocator('customLocator', 'script');
|
||||
protractor.By.addLocator('customLocator2', function(){
|
||||
// nothing
|
||||
});
|
||||
|
||||
// Angular specific locators.
|
||||
webElement = ptor.findElement(protractor.By.binding('binding'));
|
||||
webElement = ptor.findElement(protractor.By.exactBinding('exactBinding'));
|
||||
webElement = ptor.findElement(protractor.By.model('model'));
|
||||
@@ -277,4 +430,23 @@ function TestLocatorStrategies() {
|
||||
webElement = ptor.findElement(protractor.By.partialButtonText('partialButtonText'));
|
||||
webElement = ptor.findElement(protractor.By.cssContainingText('cssSelector', 'search text'));
|
||||
webElement = ptor.findElement(protractor.By.options('options'));
|
||||
// One standard locator for good measure.
|
||||
webElement = ptor.findElement(protractor.By.id('id'));
|
||||
|
||||
var el: protractor.ElementFinder;
|
||||
|
||||
// Angular specific locators.
|
||||
el = element(by.binding('binding'));
|
||||
el = element(by.exactBinding('exactBinding'));
|
||||
el = element(by.model('model'));
|
||||
el = element(by.repeater('repeater'));
|
||||
el = element(by.repeater('repeater').column(0));
|
||||
el = element(by.repeater('repeater').row(0));
|
||||
el = element(by.repeater('repeater').row(0).column(0));
|
||||
el = element(by.buttonText('buttonText'));
|
||||
el = element(by.partialButtonText('partialButtonText'));
|
||||
el = element(by.cssContainingText('cssSelector', 'search text'));
|
||||
el = element(by.options('options'));
|
||||
// One standard locator for good measure.
|
||||
el = element(by.id('id'));
|
||||
}
|
||||
|
||||
+1050
-491
File diff suppressed because it is too large
Load Diff
@@ -1,244 +0,0 @@
|
||||
/// <reference path="angular-protractor-0.17.0.d.ts" />
|
||||
|
||||
function TestWebDriverExports() {
|
||||
var abstractBuilder: protractor.AbstractBuilder = new protractor.AbstractBuilder();
|
||||
var baseAbstractBuilder: webdriver.AbstractBuilder = abstractBuilder;
|
||||
|
||||
var button: protractor.Button = new protractor.Button();
|
||||
var baseButton: webdriver.Button = button;
|
||||
|
||||
var key: string = protractor.Key.ADD;
|
||||
var chord: string = protractor.Key.chord(protractor.Key.NUMPAD0, protractor.Key.NUMPAD1);
|
||||
|
||||
var driver: protractor.WebDriver = new protractor.Builder().
|
||||
withCapabilities(protractor.Capabilities.chrome()).
|
||||
build();
|
||||
var baseDriver: webdriver.WebDriver = driver;
|
||||
|
||||
var action: protractor.ActionSequence = new protractor.ActionSequence(driver);
|
||||
var baseAction: webdriver.ActionSequence = action;
|
||||
|
||||
var alert: protractor.Alert = new protractor.Alert(driver, 'Message');
|
||||
var baseAlert: webdriver.Alert = alert;
|
||||
|
||||
var unhandledAlertError: protractor.UnhandledAlertError = new protractor.UnhandledAlertError('Message', alert);
|
||||
var baseUnhandledAlertError: webdriver.UnhandledAlertError = unhandledAlertError;
|
||||
|
||||
var browser: string = protractor.Browser.ANDROID;
|
||||
|
||||
var builder: protractor.Builder = new protractor.Builder();
|
||||
var baseBuilder: webdriver.Builder = builder;
|
||||
|
||||
var capability: string = protractor.Capability.BROWSER_NAME;
|
||||
|
||||
var capabilities: protractor.Capabilities = protractor.Capabilities.chrome();
|
||||
var baseCapabilities: webdriver.Capabilities = capabilities;
|
||||
|
||||
var commandName: string = protractor.CommandName.CLICK_ELEMENT;
|
||||
|
||||
var command: protractor.Command = new protractor.Command(protractor.CommandName.CLICK);
|
||||
var baseCommand: webdriver.Command = command;
|
||||
|
||||
var eventEmitter: protractor.EventEmitter = new protractor.EventEmitter();
|
||||
var baseEventEmitter: webdriver.EventEmitter = eventEmitter;
|
||||
|
||||
var firefoxDomExecutor: protractor.FirefoxDomExecutor = new protractor.FirefoxDomExecutor();
|
||||
var baseFirefoxDomExecutor: webdriver.FirefoxDomExecutor = firefoxDomExecutor;
|
||||
|
||||
var webElement: protractor.WebElement = new protractor.WebElement(driver, new protractor.promise.Promise());
|
||||
var baseWebElement: webdriver.WebElement = webElement;
|
||||
|
||||
var locator: protractor.Locator = new protractor.Locator('id', 'ABC');
|
||||
var baseLocator: webdriver.Locator = locator;
|
||||
|
||||
var session: protractor.Session = new protractor.Session('ABC', webdriver.Capabilities.android());
|
||||
var baseSession: webdriver.Session = session;
|
||||
|
||||
locator = protractor.By.name('name');
|
||||
|
||||
// logging module
|
||||
|
||||
var levelName: string = protractor.logging.LevelName.ALL;
|
||||
var loggingType: string = protractor.logging.Type.CLIENT;
|
||||
|
||||
var level: webdriver.logging.Level = protractor.logging.Level.ALL;
|
||||
|
||||
var entry: protractor.logging.Entry = new protractor.logging.Entry(protractor.logging.Level.ALL, 'Message');
|
||||
var baseEntry: webdriver.logging.Entry = entry;
|
||||
|
||||
level = protractor.logging.getLevel('DEBUG');
|
||||
|
||||
protractor.logging.Preferences = { a: 123 };
|
||||
|
||||
// promise module
|
||||
|
||||
var promise: protractor.promise.Promise = new protractor.promise.Promise();
|
||||
var basePromise: webdriver.promise.Promise = promise;
|
||||
|
||||
var deferred: protractor.promise.Deferred = new protractor.promise.Deferred();
|
||||
var baseDeferred: webdriver.promise.Deferred = deferred;
|
||||
|
||||
var flow: protractor.promise.ControlFlow = new protractor.promise.ControlFlow();
|
||||
var baseFlow: webdriver.promise.ControlFlow = flow;
|
||||
|
||||
protractor.promise.asap(promise, function(value: any){ return true; });
|
||||
protractor.promise.asap(promise, function(value: any){}, function(err: any) { return 'ABC'; });
|
||||
|
||||
promise = protractor.promise.checkedNodeCall(function(err: any, value: any) { return 123; });
|
||||
|
||||
flow = protractor.promise.controlFlow();
|
||||
|
||||
promise = protractor.promise.createFlow(function(newFlow: webdriver.promise.ControlFlow) { });
|
||||
|
||||
deferred = protractor.promise.defer(function() {});
|
||||
deferred = protractor.promise.defer(function(reason?: any) {});
|
||||
|
||||
promise = protractor.promise.delayed(123);
|
||||
|
||||
promise = protractor.promise.fulfilled();
|
||||
promise = protractor.promise.fulfilled({a: 123});
|
||||
|
||||
promise = protractor.promise.fullyResolved({a: 123});
|
||||
|
||||
var isPromise: boolean = protractor.promise.isPromise('ABC');
|
||||
|
||||
promise = protractor.promise.rejected({a: 123});
|
||||
|
||||
protractor.promise.setDefaultFlow(new webdriver.promise.ControlFlow());
|
||||
|
||||
promise = protractor.promise.when(promise, function(value: any) { return 123; }, function(err: Error) { return 123; });
|
||||
|
||||
// error module
|
||||
|
||||
var errorCode: number = protractor.error.ErrorCode.ELEMENT_NOT_VISIBLE;
|
||||
var error: protractor.error.Error = new protractor.error.Error(protractor.error.ErrorCode.ELEMENT_NOT_VISIBLE);
|
||||
var baseError: webdriver.error.Error = error;
|
||||
|
||||
// process module
|
||||
|
||||
var isNative: boolean = protractor.process.isNative();
|
||||
var value: string;
|
||||
|
||||
value = protractor.process.getEnv('name');
|
||||
value = protractor.process.getEnv('name', 'default');
|
||||
|
||||
protractor.process.setEnv('name', 'value');
|
||||
protractor.process.setEnv('name', 123);
|
||||
|
||||
}
|
||||
|
||||
function TestProtractor() {
|
||||
var ptor: protractor.Protractor;
|
||||
var driver: webdriver.WebDriver = new webdriver.Builder().
|
||||
withCapabilities(webdriver.Capabilities.chrome()).
|
||||
build();
|
||||
|
||||
ptor = new protractor.Protractor(driver);
|
||||
ptor = new protractor.Protractor(driver, 'baseUrl');
|
||||
ptor = new protractor.Protractor(driver, 'baseUrl', 'rootElement');
|
||||
ptor = protractor.getInstance();
|
||||
protractor.setInstance(ptor);
|
||||
|
||||
ptor = protractor.wrapDriver(driver);
|
||||
ptor = protractor.wrapDriver(driver, 'baseUrl');
|
||||
ptor = protractor.wrapDriver(driver, 'baseUrl', 'rootElement');
|
||||
|
||||
ptor = browser;
|
||||
|
||||
driver = ptor.driver;
|
||||
var baseUrl: string = ptor.baseUrl;
|
||||
var rootEl: string = ptor.rootEl;
|
||||
var ignoreSynchronization: boolean = ptor.ignoreSynchronization;
|
||||
var params: any = ptor.params;
|
||||
|
||||
ptor.debugger();
|
||||
|
||||
ptor.clearMockModules();
|
||||
ptor.addMockModule('name', 'script');
|
||||
ptor.addMockModule('name', function() {});
|
||||
ptor.waitForAngular();
|
||||
|
||||
var elementFinder: protractor.ElementFinder;
|
||||
|
||||
elementFinder = ptor.element(by.id('ABC'));
|
||||
elementFinder = ptor.$('.class');
|
||||
|
||||
var elementArrayFinder: protractor.ElementArrayFinder = ptor.$$('.class');
|
||||
|
||||
var webElement: webdriver.WebElement = ptor.wrapWebElement(new webdriver.WebElement(driver, 'id'));
|
||||
|
||||
var locationAbsUrl: webdriver.promise.Promise = ptor.getLocationAbsUrl();
|
||||
}
|
||||
|
||||
function TestElement() {
|
||||
var elementFinder: protractor.ElementFinder = element(by.id('id'));
|
||||
var elementArrayFinder: protractor.ElementArrayFinder = element.all(by.className('class'));
|
||||
}
|
||||
|
||||
function TestElementFinder() {
|
||||
var elementFinder: protractor.ElementFinder = element(by.id('id'));
|
||||
var promise: webdriver.promise.Promise;
|
||||
|
||||
promise = elementFinder.click();
|
||||
promise = elementFinder.sendKeys(protractor.Key.UP, protractor.Key.DOWN);
|
||||
promise = elementFinder.getTagName();
|
||||
promise = elementFinder.getCssValue('display');
|
||||
promise = elementFinder.getAttribute('atribute');
|
||||
promise = elementFinder.getText();
|
||||
promise = elementFinder.getSize();
|
||||
promise = elementFinder.getLocation();
|
||||
promise = elementFinder.isEnabled();
|
||||
promise = elementFinder.isSelected();
|
||||
promise = elementFinder.submit();
|
||||
promise = elementFinder.clear();
|
||||
promise = elementFinder.isDisplayed();
|
||||
promise = elementFinder.getOuterHtml();
|
||||
promise = elementFinder.getInnerHtml();
|
||||
promise = elementFinder.isElementPresent(by.id('id'));
|
||||
promise = elementFinder.isElementPresent(by.js('function(a, b, c) {}'), 1, 2, 3);
|
||||
promise = elementFinder.findElements(by.className('class'));
|
||||
promise = elementFinder.findElements(by.js('function(a, b, c) {}'), 1, 2, 3);
|
||||
promise = elementFinder.$$('.class');
|
||||
promise = elementFinder.evaluate('expression');
|
||||
promise = elementFinder.isPresent();
|
||||
|
||||
var webElement: webdriver.WebElement;
|
||||
|
||||
webElement = elementFinder.$('.class');
|
||||
webElement = elementFinder.findElement(by.id('id'));
|
||||
webElement = elementFinder.findElement(by.js('function(a, b, c) {}'), 1, 2, 3);
|
||||
webElement = elementFinder.find();
|
||||
}
|
||||
|
||||
// This function tests the angular specific locator strategies.
|
||||
function TestLocatorStrategies() {
|
||||
var ptor: protractor.Protractor = protractor.getInstance();
|
||||
var webElement: webdriver.WebElement;
|
||||
|
||||
// Protractor Specific Locators
|
||||
webElement = ptor.findElement(protractor.By.binding('binding'));
|
||||
webElement = ptor.findElement(protractor.By.select('select'));
|
||||
webElement = ptor.findElement(protractor.By.selectedOption('selectedOptions'));
|
||||
webElement = ptor.findElement(protractor.By.input('input'));
|
||||
webElement = ptor.findElement(protractor.By.model('model'));
|
||||
webElement = ptor.findElement(protractor.By.textarea('textarea'));
|
||||
webElement = ptor.findElement(protractor.By.repeater('repeater'));
|
||||
webElement = ptor.findElement(protractor.By.buttonText('buttonText'));
|
||||
webElement = ptor.findElement(protractor.By.partialButtonText('partialButtonText'));
|
||||
}
|
||||
|
||||
// This function tests the methods that were added to the base WebElement class
|
||||
function TestWebElements() {
|
||||
var ptor: protractor.Protractor = protractor.getInstance();
|
||||
|
||||
var webElement: protractor.WebElement;
|
||||
var promise: webdriver.promise.Promise;
|
||||
|
||||
webElement = ptor.findElement(by.id('id')).$('.class');
|
||||
promise = ptor.findElement(by.id('id')).$$('.class');
|
||||
promise = ptor.findElement(by.id('id')).evaluate('something');
|
||||
|
||||
webElement = webElement.findElement(by.id('id')).$('.class');
|
||||
promise = webElement.findElement(by.id('id')).$$('.class');
|
||||
promise = webElement.findElement(by.id('id')).evaluate('something');
|
||||
}
|
||||
@@ -1,906 +0,0 @@
|
||||
// Type definitions for Angular Protractor 0.17.0
|
||||
// Project: https://github.com/angular/protractor
|
||||
// Definitions by: Bill Armstrong <https://github.com/BillArmstrong>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../../selenium-webdriver/selenium-webdriver.d.ts" />
|
||||
|
||||
declare module protractor {
|
||||
//region Wrapped webdriver Items
|
||||
|
||||
class AbstractBuilder extends webdriver.AbstractBuilder {}
|
||||
class ActionSequence extends webdriver.ActionSequence {}
|
||||
class Alert extends webdriver.Alert {}
|
||||
class Builder extends webdriver.Builder {}
|
||||
class Button extends webdriver.Button {}
|
||||
class Capabilities extends webdriver.Capabilities {}
|
||||
class Command extends webdriver.Command {}
|
||||
class EventEmitter extends webdriver.EventEmitter {}
|
||||
class FirefoxDomExecutor extends webdriver.FirefoxDomExecutor {}
|
||||
class Locator extends webdriver.Locator {}
|
||||
class Session extends webdriver.Session {}
|
||||
class WebDriver extends webdriver.WebDriver {}
|
||||
class Browser extends webdriver.Browser {}
|
||||
class Capability extends webdriver.Capability {}
|
||||
class CommandName extends webdriver.CommandName {}
|
||||
class Key extends webdriver.Key {}
|
||||
class UnhandledAlertError extends webdriver.UnhandledAlertError {}
|
||||
|
||||
class WebElement extends webdriver.WebElement {
|
||||
/**
|
||||
* Shortcut for querying the document directly with css.
|
||||
*
|
||||
* @param {string} selector a css selector
|
||||
* @see webdriver.WebElement.findElement
|
||||
* @return {!protractor.WebElement}
|
||||
*/
|
||||
$(selector: string): protractor.WebElement;
|
||||
|
||||
/**
|
||||
* Shortcut for querying the document directly with css.
|
||||
*
|
||||
* @param {string} selector a css selector
|
||||
* @see webdriver.WebElement.findElements
|
||||
* @return {!webdriver.promise.Promise} A promise that will be resolved to an
|
||||
* array of the located {@link webdriver.WebElement}s.
|
||||
*/
|
||||
$$(selector: string): webdriver.promise.Promise;
|
||||
|
||||
/**
|
||||
* Evalates the input as if it were on the scope of the current element.
|
||||
* @param {string} expression
|
||||
*
|
||||
* @return {!webdriver.promise.Promise} A promise that will resolve to the
|
||||
* evaluated expression. The result will be resolved as in
|
||||
* {@link webdriver.WebDriver.executeScript}. In summary - primitives will
|
||||
* be resolved as is, functions will be converted to string, and elements
|
||||
* will be returned as a WebElement.
|
||||
*/
|
||||
evaluate(expression: string): webdriver.promise.Promise;
|
||||
|
||||
/**
|
||||
* Schedule a command to find a descendant of this element. If the element
|
||||
* cannot be found, a {@code bot.ErrorCode.NO_SUCH_ELEMENT} result will
|
||||
* be returned by the driver. Unlike other commands, this error cannot be
|
||||
* suppressed. In other words, scheduling a command to find an element doubles
|
||||
* as an assert that the element is present on the page. To test whether an
|
||||
* element is present on the page, use {@code #isElementPresent} instead.
|
||||
* <p/>
|
||||
* The search criteria for find an element may either be a
|
||||
* {@code webdriver.Locator} object, or a simple JSON object whose sole key
|
||||
* is one of the accepted locator strategies, as defined by
|
||||
* {@code webdriver.Locator.Strategy}. For example, the following two
|
||||
* statements are equivalent:
|
||||
* <code><pre>
|
||||
* var e1 = element.findElement(By.id('foo'));
|
||||
* var e2 = element.findElement({id:'foo'});
|
||||
* </pre></code>
|
||||
* <p/>
|
||||
* Note that JS locator searches cannot be restricted to a subtree. All such
|
||||
* searches are delegated to this instance's parent WebDriver.
|
||||
*
|
||||
* @param {webdriver.Locator|Object.<string>} locator The locator
|
||||
* strategy to use when searching for the element.
|
||||
* @param {...} var_args Arguments to pass to {@code WebDriver#executeScript} if
|
||||
* using a JavaScript locator. Otherwise ignored.
|
||||
* @return {protractor.WebElement} A WebElement that can be used to issue
|
||||
* commands against the located element. If the element is not found, the
|
||||
* element will be invalidated and all scheduled commands aborted.
|
||||
*/
|
||||
findElement(locator: webdriver.Locator, ...var_args: any[]): protractor.WebElement;
|
||||
findElement(locator: any, ...var_args: any[]): protractor.WebElement;
|
||||
}
|
||||
|
||||
module command {
|
||||
class Command extends webdriver.Command {}
|
||||
class CommandName extends webdriver.CommandName {}
|
||||
}
|
||||
|
||||
module error {
|
||||
class Error extends webdriver.error.Error {}
|
||||
class ErrorCode extends webdriver.error.ErrorCode {}
|
||||
}
|
||||
|
||||
module events {
|
||||
class EventEmitter extends webdriver.EventEmitter {}
|
||||
}
|
||||
|
||||
module logging {
|
||||
var Preferences: any;
|
||||
|
||||
class LevelName extends webdriver.logging.LevelName {}
|
||||
class Type extends webdriver.logging.Type {}
|
||||
class Level extends webdriver.logging.Level {}
|
||||
class Entry extends webdriver.logging.Entry {}
|
||||
|
||||
function getLevel(nameOrValue: string): webdriver.logging.Level;
|
||||
function getLevel(nameOrValue: number): webdriver.logging.Level;
|
||||
}
|
||||
|
||||
module promise {
|
||||
class Promise extends webdriver.promise.Promise {}
|
||||
class Deferred extends webdriver.promise.Deferred {}
|
||||
class ControlFlow extends webdriver.promise.ControlFlow {}
|
||||
|
||||
/**
|
||||
* @return {!webdriver.promise.ControlFlow} The currently active control flow.
|
||||
*/
|
||||
function controlFlow(): webdriver.promise.ControlFlow;
|
||||
|
||||
/**
|
||||
* Creates a new control flow. The provided callback will be invoked as the
|
||||
* first task within the new flow, with the flow as its sole argument. Returns
|
||||
* a promise that resolves to the callback result.
|
||||
* @param {function(!webdriver.promise.ControlFlow)} callback The entry point
|
||||
* to the newly created flow.
|
||||
* @return {!webdriver.promise.Promise} A promise that resolves to the callback
|
||||
* result.
|
||||
*/
|
||||
function createFlow(callback: (flow: webdriver.promise.ControlFlow) => any): webdriver.promise.Promise;
|
||||
|
||||
/**
|
||||
* Determines whether a {@code value} should be treated as a promise.
|
||||
* Any object whose "then" property is a function will be considered a promise.
|
||||
*
|
||||
* @param {*} value The value to test.
|
||||
* @return {boolean} Whether the value is a promise.
|
||||
*/
|
||||
function isPromise(value: any): boolean;
|
||||
|
||||
/**
|
||||
* Creates a promise that will be resolved at a set time in the future.
|
||||
* @param {number} ms The amount of time, in milliseconds, to wait before
|
||||
* resolving the promise.
|
||||
* @return {!webdriver.promise.Promise} The promise.
|
||||
*/
|
||||
function delayed(ms: number): webdriver.promise.Promise;
|
||||
|
||||
/**
|
||||
* Creates a new deferred object.
|
||||
* @param {Function=} opt_canceller Function to call when cancelling the
|
||||
* computation of this instance's value.
|
||||
* @return {!webdriver.promise.Deferred} The new deferred object.
|
||||
*/
|
||||
function defer(opt_canceller?: any): webdriver.promise.Deferred;
|
||||
|
||||
/**
|
||||
* Creates a promise that has been resolved with the given value.
|
||||
* @param {*=} opt_value The resolved value.
|
||||
* @return {!webdriver.promise.Promise} The resolved promise.
|
||||
*/
|
||||
function fulfilled(opt_value?: any): webdriver.promise.Promise;
|
||||
|
||||
/**
|
||||
* Creates a promise that has been rejected with the given reason.
|
||||
* @param {*=} opt_reason The rejection reason; may be any value, but is
|
||||
* usually an Error or a string.
|
||||
* @return {!webdriver.promise.Promise} The rejected promise.
|
||||
*/
|
||||
function rejected(opt_reason?: any): webdriver.promise.Promise;
|
||||
|
||||
/**
|
||||
* Wraps a function that is assumed to be a node-style callback as its final
|
||||
* argument. This callback takes two arguments: an error value (which will be
|
||||
* null if the call succeeded), and the success value as the second argument.
|
||||
* If the call fails, the returned promise will be rejected, otherwise it will
|
||||
* be resolved with the result.
|
||||
* @param {!Function} fn The function to wrap.
|
||||
* @return {!webdriver.promise.Promise} A promise that will be resolved with the
|
||||
* result of the provided function's callback.
|
||||
*/
|
||||
function checkedNodeCall(fn: (error: any, value: any) => any): webdriver.promise.Promise;
|
||||
|
||||
/**
|
||||
* Registers an observer on a promised {@code value}, returning a new promise
|
||||
* that will be resolved when the value is. If {@code value} is not a promise,
|
||||
* then the return promise will be immediately resolved.
|
||||
* @param {*} value The value to observe.
|
||||
* @param {Function=} opt_callback The function to call when the value is
|
||||
* resolved successfully.
|
||||
* @param {Function=} opt_errback The function to call when the value is
|
||||
* rejected.
|
||||
* @return {!webdriver.promise.Promise} A new promise.
|
||||
*/
|
||||
function when(value: any, opt_callback?: (value: any) => any, opt_errback?: (error: any) => any): webdriver.promise.Promise;
|
||||
|
||||
/**
|
||||
* Invokes the appropriate callback function as soon as a promised
|
||||
* {@code value} is resolved. This function is similar to
|
||||
* {@code webdriver.promise.when}, except it does not return a new promise.
|
||||
* @param {*} value The value to observe.
|
||||
* @param {Function} callback The function to call when the value is
|
||||
* resolved successfully.
|
||||
* @param {Function=} opt_errback The function to call when the value is
|
||||
* rejected.
|
||||
*/
|
||||
function asap(value: any, callback: (value: any) => any, opt_errback?: (error: any) => any): void;
|
||||
|
||||
/**
|
||||
* Returns a promise that will be resolved with the input value in a
|
||||
* fully-resolved state. If the value is an array, each element will be fully
|
||||
* resolved. Likewise, if the value is an object, all keys will be fully
|
||||
* resolved. In both cases, all nested arrays and objects will also be
|
||||
* fully resolved. All fields are resolved in place; the returned promise will
|
||||
* resolve on {@code value} and not a copy.
|
||||
*
|
||||
* Warning: This function makes no checks against objects that contain
|
||||
* cyclical references:
|
||||
*
|
||||
* var value = {};
|
||||
* value['self'] = value;
|
||||
* webdriver.promise.fullyResolved(value); // Stack overflow.
|
||||
*
|
||||
* @param {*} value The value to fully resolve.
|
||||
* @return {!webdriver.promise.Promise} A promise for a fully resolved version
|
||||
* of the input value.
|
||||
*/
|
||||
function fullyResolved(value: any): webdriver.promise.Promise;
|
||||
|
||||
/**
|
||||
* Changes the default flow to use when no others are active.
|
||||
* @param {!webdriver.promise.ControlFlow} flow The new default flow.
|
||||
* @throws {Error} If the default flow is not currently active.
|
||||
*/
|
||||
function setDefaultFlow(flow: webdriver.promise.ControlFlow): void;
|
||||
|
||||
}
|
||||
|
||||
module process {
|
||||
|
||||
/**
|
||||
* Queries for a named environment variable.
|
||||
* @param {string} name The name of the environment variable to look up.
|
||||
* @param {string=} opt_default The default value if the named variable is not
|
||||
* defined.
|
||||
* @return {string} The queried environment variable.
|
||||
*/
|
||||
function getEnv(name: string, opt_default?: string): string;
|
||||
|
||||
/**
|
||||
* @return {boolean} Whether the current process is Node's native process
|
||||
* object.
|
||||
*/
|
||||
function isNative(): boolean;
|
||||
|
||||
/**
|
||||
* Sets an environment value. If the new value is either null or undefined, the
|
||||
* environment variable will be cleared.
|
||||
* @param {string} name The value to set.
|
||||
* @param {*} value The new value; will be coerced to a string.
|
||||
*/
|
||||
function setEnv(name: string, value: any): void;
|
||||
|
||||
}
|
||||
|
||||
//endregion
|
||||
|
||||
interface Element {
|
||||
(locator: webdriver.Locator): ElementFinder;
|
||||
all(locator: webdriver.Locator): ElementArrayFinder;
|
||||
}
|
||||
|
||||
interface ElementFinder {
|
||||
/**
|
||||
* Schedules a command to click on this element.
|
||||
* @return {!webdriver.promise.Promise} A promise that will be resolved when
|
||||
* the click command has completed.
|
||||
*/
|
||||
click(): webdriver.promise.Promise;
|
||||
|
||||
/**
|
||||
* Schedules a command to type a sequence on the DOM element represented by this
|
||||
* instance.
|
||||
* <p/>
|
||||
* Modifier keys (SHIFT, CONTROL, ALT, META) are stateful; once a modifier is
|
||||
* processed in the keysequence, that key state is toggled until one of the
|
||||
* following occurs:
|
||||
* <ul>
|
||||
* <li>The modifier key is encountered again in the sequence. At this point the
|
||||
* state of the key is toggled (along with the appropriate keyup/down events).
|
||||
* </li>
|
||||
* <li>The {@code webdriver.Key.NULL} key is encountered in the sequence. When
|
||||
* this key is encountered, all modifier keys current in the down state are
|
||||
* released (with accompanying keyup events). The NULL key can be used to
|
||||
* simulate common keyboard shortcuts:
|
||||
* <code>
|
||||
* element.sendKeys("text was",
|
||||
* webdriver.Key.CONTROL, "a", webdriver.Key.NULL,
|
||||
* "now text is");
|
||||
* // Alternatively:
|
||||
* element.sendKeys("text was",
|
||||
* webdriver.Key.chord(webdriver.Key.CONTROL, "a"),
|
||||
* "now text is");
|
||||
* </code></li>
|
||||
* <li>The end of the keysequence is encountered. When there are no more keys
|
||||
* to type, all depressed modifier keys are released (with accompanying keyup
|
||||
* events).
|
||||
* </li>
|
||||
* </ul>
|
||||
* <strong>Note:</strong> On browsers where native keyboard events are not yet
|
||||
* supported (e.g. Firefox on OS X), key events will be synthesized. Special
|
||||
* punctionation keys will be synthesized according to a standard QWERTY en-us
|
||||
* keyboard layout.
|
||||
*
|
||||
* @param {...string} var_args The sequence of keys to
|
||||
* type. All arguments will be joined into a single sequence (var_args is
|
||||
* permitted for convenience).
|
||||
* @return {!webdriver.promise.Promise} A promise that will be resolved when all
|
||||
* keys have been typed.
|
||||
*/
|
||||
sendKeys(...var_args: string[]): webdriver.promise.Promise;
|
||||
|
||||
/**
|
||||
* Schedules a command to query for the tag/node name of this element.
|
||||
* @return {!webdriver.promise.Promise} A promise that will be resolved with the
|
||||
* element's tag name.
|
||||
*/
|
||||
getTagName(): webdriver.promise.Promise;
|
||||
|
||||
/**
|
||||
* Schedules a command to query for the computed style of the element
|
||||
* represented by this instance. If the element inherits the named style from
|
||||
* its parent, the parent will be queried for its value. Where possible, color
|
||||
* values will be converted to their hex representation (e.g. #00ff00 instead of
|
||||
* rgb(0, 255, 0)).
|
||||
* <p/>
|
||||
* <em>Warning:</em> the value returned will be as the browser interprets it, so
|
||||
* it may be tricky to form a proper assertion.
|
||||
*
|
||||
* @param {string} cssStyleProperty The name of the CSS style property to look
|
||||
* up.
|
||||
* @return {!webdriver.promise.Promise} A promise that will be resolved with the
|
||||
* requested CSS value.
|
||||
*/
|
||||
getCssValue(cssStyleProperty: string): webdriver.promise.Promise;
|
||||
|
||||
/**
|
||||
* Schedules a command to query for the value of the given attribute of the
|
||||
* element. Will return the current value even if it has been modified after the
|
||||
* page has been loaded. More exactly, this method will return the value of the
|
||||
* given attribute, unless that attribute is not present, in which case the
|
||||
* value of the property with the same name is returned. If neither value is
|
||||
* set, null is returned. The "style" attribute is converted as best can be to a
|
||||
* text representation with a trailing semi-colon. The following are deemed to
|
||||
* be "boolean" attributes and will be returned as thus:
|
||||
*
|
||||
* <p>async, autofocus, autoplay, checked, compact, complete, controls, declare,
|
||||
* defaultchecked, defaultselected, defer, disabled, draggable, ended,
|
||||
* formnovalidate, hidden, indeterminate, iscontenteditable, ismap, itemscope,
|
||||
* loop, multiple, muted, nohref, noresize, noshade, novalidate, nowrap, open,
|
||||
* paused, pubdate, readonly, required, reversed, scoped, seamless, seeking,
|
||||
* selected, spellcheck, truespeed, willvalidate
|
||||
*
|
||||
* <p>Finally, the following commonly mis-capitalized attribute/property names
|
||||
* are evaluated as expected:
|
||||
* <ul>
|
||||
* <li>"class"
|
||||
* <li>"readonly"
|
||||
* </ul>
|
||||
* @param {string} attributeName The name of the attribute to query.
|
||||
* @return {!webdriver.promise.Promise} A promise that will be resolved with the
|
||||
* attribute's value.
|
||||
*/
|
||||
getAttribute(attributeName: string): webdriver.promise.Promise;
|
||||
|
||||
/**
|
||||
* Get the visible (i.e. not hidden by CSS) innerText of this element, including
|
||||
* sub-elements, without any leading or trailing whitespace.
|
||||
* @return {!webdriver.promise.Promise} A promise that will be resolved with the
|
||||
* element's visible text.
|
||||
*/
|
||||
getText(): webdriver.promise.Promise;
|
||||
|
||||
/**
|
||||
* Schedules a command to compute the size of this element's bounding box, in
|
||||
* pixels.
|
||||
* @return {!webdriver.promise.Promise} A promise that will be resolved with the
|
||||
* element's size as a {@code {width:number, height:number}} object.
|
||||
*/
|
||||
getSize(): webdriver.promise.Promise;
|
||||
|
||||
/**
|
||||
* Schedules a command to compute the location of this element in page space.
|
||||
* @return {!webdriver.promise.Promise} A promise that will be resolved to the
|
||||
* element's location as a {@code {x:number, y:number}} object.
|
||||
*/
|
||||
getLocation(): webdriver.promise.Promise;
|
||||
|
||||
/**
|
||||
* Schedules a command to query whether the DOM element represented by this
|
||||
* instance is enabled, as dicted by the {@code disabled} attribute.
|
||||
* @return {!webdriver.promise.Promise} A promise that will be resolved with
|
||||
* whether this element is currently enabled.
|
||||
*/
|
||||
isEnabled(): webdriver.promise.Promise;
|
||||
|
||||
/**
|
||||
* Schedules a command to query whether this element is selected.
|
||||
* @return {!webdriver.promise.Promise} A promise that will be resolved with
|
||||
* whether this element is currently selected.
|
||||
*/
|
||||
isSelected(): webdriver.promise.Promise;
|
||||
|
||||
/**
|
||||
* Schedules a command to submit the form containing this element (or this
|
||||
* element if it is a FORM element). This command is a no-op if the element is
|
||||
* not contained in a form.
|
||||
* @return {!webdriver.promise.Promise} A promise that will be resolved when
|
||||
* the form has been submitted.
|
||||
*/
|
||||
submit(): webdriver.promise.Promise;
|
||||
|
||||
/**
|
||||
* Schedules a command to clear the {@code value} of this element. This command
|
||||
* has no effect if the underlying DOM element is neither a text INPUT element
|
||||
* nor a TEXTAREA element.
|
||||
* @return {!webdriver.promise.Promise} A promise that will be resolved when
|
||||
* the element has been cleared.
|
||||
*/
|
||||
clear(): webdriver.promise.Promise;
|
||||
|
||||
/**
|
||||
* Schedules a command to test whether this element is currently displayed.
|
||||
* @return {!webdriver.promise.Promise} A promise that will be resolved with
|
||||
* whether this element is currently visible on the page.
|
||||
*/
|
||||
isDisplayed(): webdriver.promise.Promise;
|
||||
|
||||
/**
|
||||
* Schedules a command to retrieve the outer HTML of this element.
|
||||
* @return {!webdriver.promise.Promise} A promise that will be resolved with
|
||||
* the element's outer HTML.
|
||||
*/
|
||||
getOuterHtml(): webdriver.promise.Promise;
|
||||
|
||||
/**
|
||||
* Schedules a command to retrieve the inner HTML of this element.
|
||||
* @return {!webdriver.promise.Promise} A promise that will be resolved with the
|
||||
* element's inner HTML.
|
||||
*/
|
||||
getInnerHtml(): webdriver.promise.Promise;
|
||||
|
||||
/**
|
||||
* Schedules a command to test if there is at least one descendant of this
|
||||
* element that matches the given search criteria.
|
||||
*
|
||||
* <p>Note that JS locator searches cannot be restricted to a subtree of the
|
||||
* DOM. All such searches are delegated to this instance's parent WebDriver.
|
||||
*
|
||||
* @param {webdriver.Locator|Object.<string>} locator The locator
|
||||
* strategy to use when searching for the element.
|
||||
* @param {...} var_args Arguments to pass to {@code WebDriver#executeScript} if
|
||||
* using a JavaScript locator. Otherwise ignored.
|
||||
* @return {!webdriver.promise.Promise} A promise that will be resolved with
|
||||
* whether an element could be located on the page.
|
||||
*/
|
||||
isElementPresent(locator: webdriver.Locator, ...var_args: any[]): webdriver.promise.Promise;
|
||||
isElementPresent(locator: any, ...var_args: any[]): webdriver.promise.Promise;
|
||||
|
||||
/**
|
||||
* Schedules a command to find all of the descendants of this element that match
|
||||
* the given search criteria.
|
||||
* <p/>
|
||||
* Note that JS locator searches cannot be restricted to a subtree. All such
|
||||
* searches are delegated to this instance's parent WebDriver.
|
||||
*
|
||||
* @param {webdriver.Locator|Object.<string>} locator The locator
|
||||
* strategy to use when searching for the elements.
|
||||
* @param {...} var_args Arguments to pass to {@code WebDriver#executeScript} if
|
||||
* using a JavaScript locator. Otherwise ignored.
|
||||
* @return {!webdriver.promise.Promise} A promise that will be resolved with an
|
||||
* array of located {@link webdriver.WebElement}s.
|
||||
*/
|
||||
findElements(locator: webdriver.Locator, ...var_args: any[]): webdriver.promise.Promise;
|
||||
findElements(locator: any, ...var_args: any[]): webdriver.promise.Promise;
|
||||
|
||||
/**
|
||||
* Shortcut for querying the document directly with css.
|
||||
*
|
||||
* @param {string} selector a css selector
|
||||
* @see webdriver.WebElement.findElement
|
||||
* @return {!protractor.WebElement}
|
||||
*/
|
||||
$(selector: string): protractor.WebElement;
|
||||
|
||||
/**
|
||||
* Shortcut for querying the document directly with css.
|
||||
*
|
||||
* @param {string} selector a css selector
|
||||
* @see webdriver.WebElement.findElements
|
||||
* @return {!webdriver.promise.Promise} A promise that will be resolved to an
|
||||
* array of the located {@link webdriver.WebElement}s.
|
||||
*/
|
||||
$$(selector: string): webdriver.promise.Promise;
|
||||
|
||||
/**
|
||||
* Schedule a command to find a descendant of this element. If the element
|
||||
* cannot be found, a {@code bot.ErrorCode.NO_SUCH_ELEMENT} result will
|
||||
* be returned by the driver. Unlike other commands, this error cannot be
|
||||
* suppressed. In other words, scheduling a command to find an element doubles
|
||||
* as an assert that the element is present on the page. To test whether an
|
||||
* element is present on the page, use {@code #isElementPresent} instead.
|
||||
* <p/>
|
||||
* The search criteria for find an element may either be a
|
||||
* {@code webdriver.Locator} object, or a simple JSON object whose sole key
|
||||
* is one of the accepted locator strategies, as defined by
|
||||
* {@code webdriver.Locator.Strategy}. For example, the following two
|
||||
* statements are equivalent:
|
||||
* <code><pre>
|
||||
* var e1 = element.findElement(By.id('foo'));
|
||||
* var e2 = element.findElement({id:'foo'});
|
||||
* </pre></code>
|
||||
* <p/>
|
||||
* Note that JS locator searches cannot be restricted to a subtree. All such
|
||||
* searches are delegated to this instance's parent WebDriver.
|
||||
*
|
||||
* @param {webdriver.Locator|Object.<string>} locator The locator
|
||||
* strategy to use when searching for the element.
|
||||
* @param {...} var_args Arguments to pass to {@code WebDriver#executeScript} if
|
||||
* using a JavaScript locator. Otherwise ignored.
|
||||
* @return {protractor.WebElement} A WebElement that can be used to issue
|
||||
* commands against the located element. If the element is not found, the
|
||||
* element will be invalidated and all scheduled commands aborted.
|
||||
*/
|
||||
findElement(locator: webdriver.Locator, ...var_args: any[]): protractor.WebElement;
|
||||
findElement(locator: any, ...var_args: any[]): protractor.WebElement;
|
||||
|
||||
/**
|
||||
* Evalates the input as if it were on the scope of the current element.
|
||||
* @param {string} expression
|
||||
*
|
||||
* @return {!webdriver.promise.Promise} A promise that will resolve to the
|
||||
* evaluated expression. The result will be resolved as in
|
||||
* {@link webdriver.WebDriver.executeScript}. In summary - primitives will
|
||||
* be resolved as is, functions will be converted to string, and elements
|
||||
* will be returned as a WebElement.
|
||||
*/
|
||||
evaluate(expression: string): webdriver.promise.Promise;
|
||||
|
||||
/**
|
||||
* Use as: element(locator).element(locator)
|
||||
* Calls to element may be chained to find elements within a parent.
|
||||
*
|
||||
* @param {webdriver.Locator} The locator that will be used to find descendents.
|
||||
*
|
||||
* @return {protractor.ElementFinder} the descendent element found by the locator
|
||||
*/
|
||||
element(locator: webdriver.Locator): protractor.ElementFinder;
|
||||
|
||||
/**
|
||||
* Use as: element(locator).all(locator)
|
||||
* Calls to element may be chained to find an array of elements within a parent.
|
||||
*
|
||||
* @param {webdriver.Locator} The locator that will be used to find descendents.
|
||||
*
|
||||
* @return {protractor.ElementArrayFinder} the descendent elements found by the locator
|
||||
*/
|
||||
all(locator: webdriver.Locator): protractor.ElementArrayFinder;
|
||||
|
||||
find(): protractor.WebElement;
|
||||
|
||||
isPresent(): webdriver.promise.Promise;
|
||||
}
|
||||
|
||||
interface ElementArrayFinder{
|
||||
count(): webdriver.promise.Promise;
|
||||
get(index: number): protractor.WebElement;
|
||||
first(): protractor.WebElement;
|
||||
last(): protractor.WebElement;
|
||||
then(fn: (value: any) => any): webdriver.promise.Promise;
|
||||
}
|
||||
|
||||
class LocatorWithColumn extends webdriver.Locator {
|
||||
column(index: number): webdriver.Locator;
|
||||
}
|
||||
|
||||
class RepeaterLocator extends LocatorWithColumn {
|
||||
row(index: number): LocatorWithColumn;
|
||||
}
|
||||
|
||||
interface IProtractorLocatorStrategy extends webdriver.ILocatorStrategy {
|
||||
/**
|
||||
* Add a locator to this instance of ProtractorBy. This locator can then be
|
||||
* used with element(by.<name>(<args>)).
|
||||
*
|
||||
* @param {string} name
|
||||
* @param {function|string} script A script to be run in the context of
|
||||
* the browser. This script will be passed an array of arguments
|
||||
* that begins with the element scoping the search, and then
|
||||
* contains any args passed into the locator. It should return
|
||||
* an array of elements.
|
||||
*/
|
||||
addLocator(name: string, script: any): void;
|
||||
|
||||
/**
|
||||
* Usage:
|
||||
* <span>{{status}}</span>
|
||||
* var status = element(by.binding('{{status}}'));
|
||||
*/
|
||||
binding(bindingDescriptor: string): webdriver.Locator;
|
||||
|
||||
/**
|
||||
* Usage:
|
||||
* <select ng-model="user" ng-options="user.name for user in users"></select>
|
||||
* element(by.select("user"));
|
||||
*/
|
||||
select(model: string): webdriver.Locator;
|
||||
|
||||
/**
|
||||
* Usage:
|
||||
* <select ng-model="user" ng-options="user.name for user in users"></select>
|
||||
* element(by.selectedOption("user"));
|
||||
*/
|
||||
selectedOption(model: string): webdriver.Locator;
|
||||
|
||||
/**
|
||||
* @DEPRECATED - use 'model' instead.
|
||||
* Usage:
|
||||
* <input ng-model="user" type="text"/>
|
||||
* element(by.input('user'));
|
||||
*/
|
||||
input(model: string): webdriver.Locator;
|
||||
|
||||
/**
|
||||
* Usage:
|
||||
* <input ng-model="user" type="text"/>
|
||||
* element(by.model('user'));
|
||||
*/
|
||||
model(model: string): webdriver.Locator;
|
||||
|
||||
/**
|
||||
* Usage:
|
||||
* <textarea ng-model="user"></textarea>
|
||||
* element(by.textarea("user"));
|
||||
*/
|
||||
textarea(model: string): webdriver.Locator;
|
||||
|
||||
/**
|
||||
* Usage:
|
||||
* <div ng-repeat = "cat in pets">
|
||||
* <span>{{cat.name}}</span>
|
||||
* <span>{{cat.age}}</span>
|
||||
* </div>
|
||||
*
|
||||
* // Returns the DIV for the second cat.
|
||||
* var secondCat = element(by.repeater("cat in pets").row(2));
|
||||
* // Returns the SPAN for the first cat's name.
|
||||
* var firstCatName = element(
|
||||
* by.repeater("cat in pets").row(1).column("{{cat.name}}"));
|
||||
* // Returns a promise that resolves to an array of WebElements from a column
|
||||
* var ages = element(
|
||||
* by.repeater("cat in pets").column("{{cat.age}}"));
|
||||
* // Returns a promise that resolves to an array of WebElements containing
|
||||
* // all rows of the repeater.
|
||||
* var rows = element(by.repeater("cat in pets"));
|
||||
*/
|
||||
repeater(repeatDescriptor: string): RepeaterLocator;
|
||||
|
||||
buttonText(searchText: string): webdriver.Locator;
|
||||
|
||||
partialButtonText(searchText: string): webdriver.Locator;
|
||||
}
|
||||
|
||||
var By: IProtractorLocatorStrategy;
|
||||
|
||||
class Protractor extends webdriver.WebDriver {
|
||||
|
||||
//region Constructors
|
||||
|
||||
/**
|
||||
* @param {webdriver.WebDriver} webdriver
|
||||
* @param {string=} opt_baseUrl A base URL to run get requests against.
|
||||
* @param {string=body} opt_rootElement Selector element that has an ng-app in
|
||||
* scope.
|
||||
* @constructor
|
||||
*/
|
||||
constructor(webdriver: webdriver.WebDriver, opt_baseUrl?: string, opt_rootElement?: string);
|
||||
|
||||
//endregion
|
||||
|
||||
//region Properties
|
||||
|
||||
/**
|
||||
* The wrapped webdriver instance. Use this to interact with pages that do
|
||||
* not contain Angular (such as a log-in screen).
|
||||
*
|
||||
* @type {webdriver.WebDriver}
|
||||
*/
|
||||
driver: webdriver.WebDriver;
|
||||
|
||||
/**
|
||||
* All get methods will be resolved against this base URL. Relative URLs are =
|
||||
* resolved the way anchor tags resolve.
|
||||
*
|
||||
* @type {string}
|
||||
*/
|
||||
baseUrl: string;
|
||||
|
||||
/**
|
||||
* The css selector for an element on which to find Angular. This is usually
|
||||
* 'body' but if your ng-app is on a subsection of the page it may be
|
||||
* a subelement.
|
||||
*
|
||||
* @type {string}
|
||||
*/
|
||||
rootEl: string;
|
||||
|
||||
/**
|
||||
* If true, Protractor will not attempt to synchronize with the page before
|
||||
* performing actions. This can be harmful because Protractor will not wait
|
||||
* until $timeouts and $http calls have been processed, which can cause
|
||||
* tests to become flaky. This should be used only when necessary, such as
|
||||
* when a page continuously polls an API using $timeout.
|
||||
*
|
||||
* @type {boolean}
|
||||
*/
|
||||
ignoreSynchronization: boolean;
|
||||
|
||||
/**
|
||||
* An object that holds custom test parameters.
|
||||
*
|
||||
* @type {Object}
|
||||
*/
|
||||
params: any;
|
||||
|
||||
//endregion
|
||||
|
||||
//region Methods
|
||||
|
||||
/**
|
||||
* Helper function for finding elements.
|
||||
*
|
||||
* @type {function(webdriver.Locator): ElementFinder}
|
||||
*/
|
||||
element(locator: webdriver.Locator): ElementFinder;
|
||||
|
||||
/**
|
||||
* Helper function for finding elements by css.
|
||||
*
|
||||
* @type {function(string): ElementFinder}
|
||||
*/
|
||||
$(cssLocator: string): ElementFinder;
|
||||
|
||||
/**
|
||||
* Helper function for finding arrays of elements by css.
|
||||
*
|
||||
* @type {function(string): ElementArrayFinder}
|
||||
*/
|
||||
$$(cssLocator: string): ElementArrayFinder;
|
||||
|
||||
/**
|
||||
* Instruct webdriver to wait until Angular has finished rendering and has
|
||||
* no outstanding $http calls before continuing.
|
||||
*
|
||||
* @return {!webdriver.promise.Promise} A promise that will resolve to the
|
||||
* scripts return value.
|
||||
*/
|
||||
waitForAngular(): webdriver.promise.Promise;
|
||||
|
||||
/**
|
||||
* Wrap a webdriver.WebElement with protractor specific functionality.
|
||||
*
|
||||
* @param {webdriver.WebElement} element
|
||||
* @return {protractor.WebElement} the wrapped web element.
|
||||
*/
|
||||
wrapWebElement(element: webdriver.WebElement): protractor.WebElement;
|
||||
|
||||
/**
|
||||
* Add a module to load before Angular whenever Protractor.get is called.
|
||||
* Modules will be registered after existing modules already on the page,
|
||||
* so any module registered here will override preexisting modules with the same
|
||||
* name.
|
||||
*
|
||||
* @param {!string} name The name of the module to load or override.
|
||||
* @param {!string|Function} script The JavaScript to load the module.
|
||||
*/
|
||||
addMockModule(name: string, script: string): void;
|
||||
addMockModule(name: string, script: any): void;
|
||||
|
||||
/**
|
||||
* Clear the list of registered mock modules.
|
||||
*/
|
||||
clearMockModules(): void;
|
||||
|
||||
/**
|
||||
* Returns the current absolute url from AngularJS.
|
||||
*/
|
||||
getLocationAbsUrl(): webdriver.promise.Promise;
|
||||
|
||||
/**
|
||||
* Pauses the test and injects some helper functions into the browser, so that
|
||||
* debugging may be done in the browser console.
|
||||
*
|
||||
* This should be used under node in debug mode, i.e. with
|
||||
* protractor debug <configuration.js>
|
||||
*
|
||||
* While in the debugger, commands can be scheduled through webdriver by
|
||||
* entering the repl:
|
||||
* debug> repl
|
||||
* Press Ctrl + C to leave rdebug repl
|
||||
* > ptor.findElement(protractor.By.input('user').sendKeys('Laura'));
|
||||
* > ptor.debugger();
|
||||
* debug> c
|
||||
*
|
||||
* This will run the sendKeys command as the next task, then re-enter the
|
||||
* debugger.
|
||||
*/
|
||||
debugger(): void;
|
||||
|
||||
/**
|
||||
* Schedule a command to find an element on the page. If the element cannot be
|
||||
* found, a {@code bot.ErrorCode.NO_SUCH_ELEMENT} result will be returned
|
||||
* by the driver. Unlike other commands, this error cannot be suppressed. In
|
||||
* other words, scheduling a command to find an element doubles as an assert
|
||||
* that the element is present on the page. To test whether an element is
|
||||
* present on the page, use {@code #isElementPresent} instead.
|
||||
*
|
||||
* <p>The search criteria for find an element may either be a
|
||||
* {@code webdriver.Locator} object, or a simple JSON object whose sole key
|
||||
* is one of the accepted locator strategies, as defined by
|
||||
* {@code webdriver.Locator.Strategy}. For example, the following two statements
|
||||
* are equivalent:
|
||||
* <code><pre>
|
||||
* var e1 = driver.findElement(By.id('foo'));
|
||||
* var e2 = driver.findElement({id:'foo'});
|
||||
* </pre></code>
|
||||
*
|
||||
* <p>When running in the browser, a WebDriver cannot manipulate DOM elements
|
||||
* directly; it may do so only through a {@link webdriver.WebElement} reference.
|
||||
* This function may be used to generate a WebElement from a DOM element. A
|
||||
* reference to the DOM element will be stored in a known location and this
|
||||
* driver will attempt to retrieve it through {@link #executeScript}. If the
|
||||
* element cannot be found (eg, it belongs to a different document than the
|
||||
* one this instance is currently focused on), a
|
||||
* {@link bot.ErrorCode.NO_SUCH_ELEMENT} error will be returned.
|
||||
*
|
||||
* @param {!(webdriver.Locator|Object.<string>|Element)} locatorOrElement The
|
||||
* locator strategy to use when searching for the element, or the actual
|
||||
* DOM element to be located by the server.
|
||||
* @param {...} var_args Arguments to pass to {@code #executeScript} if using a
|
||||
* JavaScript locator. Otherwise ignored.
|
||||
* @return {!protractor.WebElement} A WebElement that can be used to issue
|
||||
* commands against the located element. If the element is not found, the
|
||||
* element will be invalidated and all scheduled commands aborted.
|
||||
*/
|
||||
findElement(locatorOrElement: webdriver.Locator, ...var_args: any[]): protractor.WebElement;
|
||||
findElement(locatorOrElement: any, ...var_args: any[]): protractor.WebElement;
|
||||
|
||||
//endregion
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new instance of Protractor by wrapping a webdriver instance.
|
||||
*
|
||||
* @param {webdriver.WebDriver} webdriver The configured webdriver instance.
|
||||
* @param {string=} opt_baseUrl A URL to prepend to relative gets.
|
||||
* @return {Protractor}
|
||||
*/
|
||||
function wrapDriver(webdriver: webdriver.WebDriver, opt_baseUrl?: string, opt_rootElement?: string): Protractor;
|
||||
|
||||
/**
|
||||
* Set a singleton instance of protractor.
|
||||
* @param {Protractor} ptor
|
||||
*/
|
||||
function setInstance(ptor: Protractor): void;
|
||||
|
||||
/**
|
||||
* Get the singleton instance.
|
||||
* @return {Protractor}
|
||||
*/
|
||||
function getInstance(): Protractor;
|
||||
|
||||
}
|
||||
|
||||
interface cssSelectorHelper {
|
||||
(cssLocator: string): protractor.ElementFinder;
|
||||
}
|
||||
|
||||
declare var browser: protractor.Protractor;
|
||||
declare var by: protractor.IProtractorLocatorStrategy;
|
||||
declare var element: protractor.Element;
|
||||
declare var $: cssSelectorHelper;
|
||||
declare var $$: cssSelectorHelper;
|
||||
|
||||
declare module 'protractor' {
|
||||
export = protractor;
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
/// <reference path="angular-scroll.d.ts" />
|
||||
|
||||
module TestApp {
|
||||
|
||||
class TestController {
|
||||
|
||||
constructor($scope: ng.IScope, $document: duScroll.IDocumentService) {
|
||||
var positionFromTop = 400;
|
||||
var positionFromLeft = 200;
|
||||
var offsetInPixels = 100;
|
||||
var durationInMillis = 2000;
|
||||
var someElement: ng.IAugmentedJQuery;
|
||||
|
||||
$document.duScrollTo(positionFromLeft, positionFromTop);
|
||||
$document.duScrollTo(positionFromLeft, positionFromTop, durationInMillis).then(this.onScrollCompleted);
|
||||
$document.duScrollTo(positionFromLeft, positionFromTop, durationInMillis, this.invertedEasingFn).then(this.onScrollCompleted);
|
||||
|
||||
$document.duScrollTo(someElement);
|
||||
$document.duScrollTo(someElement, offsetInPixels);
|
||||
$document.duScrollTo(someElement, offsetInPixels, durationInMillis).then(this.onScrollCompleted);
|
||||
$document.duScrollTo(someElement, offsetInPixels, durationInMillis, this.invertedEasingFn).then(this.onScrollCompleted);
|
||||
|
||||
$document.duScrollToElement(someElement);
|
||||
$document.duScrollToElement(someElement, offsetInPixels);
|
||||
$document.duScrollToElement(someElement, offsetInPixels, durationInMillis).then(this.onScrollCompleted);
|
||||
$document.duScrollToElement(someElement, offsetInPixels, durationInMillis, this.invertedEasingFn).then(this.onScrollCompleted);
|
||||
|
||||
$document.duScrollToElementAnimated(someElement).then(this.onScrollCompleted);
|
||||
$document.duScrollToElementAnimated(someElement, offsetInPixels).then(this.onScrollCompleted);
|
||||
$document.duScrollToElementAnimated(someElement, offsetInPixels, durationInMillis).then(this.onScrollCompleted);
|
||||
$document.duScrollToElementAnimated(someElement, offsetInPixels, durationInMillis, this.invertedEasingFn).then(this.onScrollCompleted);
|
||||
|
||||
$document.duScrollTop(positionFromTop);
|
||||
$document.duScrollTop(positionFromTop, durationInMillis).then(this.onScrollCompleted);
|
||||
$document.duScrollTop(positionFromTop, durationInMillis, this.invertedEasingFn).then(this.onScrollCompleted);
|
||||
|
||||
$document.duScrollTopAnimated(positionFromTop).then(this.onScrollCompleted);
|
||||
$document.duScrollTopAnimated(positionFromTop, durationInMillis).then(this.onScrollCompleted);
|
||||
$document.duScrollTopAnimated(positionFromTop, durationInMillis, this.invertedEasingFn).then(this.onScrollCompleted);
|
||||
|
||||
$document.duScrollLeft(positionFromLeft);
|
||||
$document.duScrollLeft(positionFromLeft, durationInMillis).then(this.onScrollCompleted);
|
||||
$document.duScrollLeft(positionFromLeft, durationInMillis, this.invertedEasingFn).then(this.onScrollCompleted);
|
||||
|
||||
$document.duScrollLeftAnimated(positionFromLeft).then(this.onScrollCompleted);
|
||||
$document.duScrollLeftAnimated(positionFromLeft, durationInMillis).then(this.onScrollCompleted);
|
||||
$document.duScrollLeftAnimated(positionFromLeft, durationInMillis, this.invertedEasingFn).then(this.onScrollCompleted);
|
||||
|
||||
var verticalPosition: number = $document.duScrollTop();
|
||||
var horixontalPosition: number = $document.duScrollLeft();
|
||||
}
|
||||
|
||||
private invertedEasingFn = (x: number): number => {
|
||||
return 1 - x;
|
||||
}
|
||||
|
||||
private onScrollCompleted = (): void => {
|
||||
console.log('Done scrolling');
|
||||
}
|
||||
}
|
||||
|
||||
angular.module('testApp', ['duScroll'])
|
||||
.controller('testController', TestController);
|
||||
}
|
||||
Vendored
+44
@@ -0,0 +1,44 @@
|
||||
// Type definitions for angular-scroll
|
||||
// Project: https://github.com/oblador/angular-scroll
|
||||
// Definitions by: Sam Herrmann <https://github.com/samherrmann>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
|
||||
/// <reference path="../angularjs/angular.d.ts" />
|
||||
|
||||
declare module duScroll {
|
||||
|
||||
/**
|
||||
* Extends the angular.element object returned by the $document sercive with a few jQuery like functions.
|
||||
* see https://github.com/oblador/angular-scroll#angularelement-scroll-api
|
||||
*/
|
||||
interface IDocumentService extends ng.IDocumentService {
|
||||
|
||||
duScrollTo(left: number, top: number): void;
|
||||
duScrollTo(left: number, top: number, duration: number, easing?: Function): ng.IPromise<void>;
|
||||
|
||||
duScrollTo(element: ng.IAugmentedJQuery, offset?: number): void;
|
||||
duScrollTo(element: ng.IAugmentedJQuery, offset: number, duration: number, easing?: Function): ng.IPromise<void>;
|
||||
|
||||
duScrollToElement(element: ng.IAugmentedJQuery, offset?: number): void;
|
||||
duScrollToElement(element: ng.IAugmentedJQuery, offset: number, duration: number, easing?: Function): ng.IPromise<void>;
|
||||
|
||||
duScrollToElementAnimated(element: ng.IAugmentedJQuery, offset?: number): ng.IPromise<void>;
|
||||
duScrollToElementAnimated(element: ng.IAugmentedJQuery, offset: number, duration: number, easing?: Function): ng.IPromise<void>;
|
||||
|
||||
duScrollTop(top: number): void;
|
||||
duScrollTop(top: number, duration: number, easing?: Function): ng.IPromise<void>;
|
||||
|
||||
duScrollTopAnimated(top: number): ng.IPromise<void>;
|
||||
duScrollTopAnimated(top: number, duration: number, easing?: Function): ng.IPromise<void>;
|
||||
|
||||
duScrollLeft(left: number): void;
|
||||
duScrollLeft(left: number, duration: number, easing?: Function): ng.IPromise<void>;
|
||||
|
||||
duScrollLeftAnimated(left: number): ng.IPromise<void>;
|
||||
duScrollLeftAnimated(left: number, duration: number, easing?: Function): ng.IPromise<void>;
|
||||
|
||||
duScrollTop(): number;
|
||||
duScrollLeft(): number;
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,13 @@ myApp.config((
|
||||
$urlMatcherFactory: ng.ui.IUrlMatcherFactory) => {
|
||||
|
||||
var matcher: ng.ui.IUrlMatcher = $urlMatcherFactory.compile("/foo/:bar?param1");
|
||||
|
||||
$urlMatcherFactory.type("myType2", {
|
||||
encode: function (item: any) { return item; },
|
||||
decode: function (item: any) { return item; },
|
||||
is: function (item: any) { return true; }
|
||||
});
|
||||
|
||||
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' });
|
||||
|
||||
Vendored
+1
@@ -42,6 +42,7 @@ declare module ng.ui {
|
||||
interface IUrlMatcherFactory {
|
||||
compile(pattern: string): IUrlMatcher;
|
||||
isMatcher(o: any): boolean;
|
||||
type(name: string, definition: any, definitionFn?: any): any;
|
||||
}
|
||||
|
||||
interface IUrlRouterProvider extends IServiceProvider {
|
||||
|
||||
@@ -8,10 +8,29 @@
|
||||
|
||||
declare var $routeProvider: ng.route.IRouteProvider;
|
||||
$routeProvider
|
||||
.when('/projects/:projectId/dashboard',{
|
||||
controller: '',
|
||||
templateUrl: '',
|
||||
caseInsensitiveMatch: true,
|
||||
reloadOnSearch: false
|
||||
})
|
||||
.otherwise({redirectTo: '/'});
|
||||
.when('/projects/:projectId/dashboard', {
|
||||
controller: 'I am a string',
|
||||
templateUrl: "So am I",
|
||||
caseInsensitiveMatch: true,
|
||||
reloadOnSearch: false
|
||||
})
|
||||
.when('/projects/:projectId/dashboard2', {
|
||||
controller: function () {
|
||||
//Look at me - I'm a function!
|
||||
},
|
||||
template: function ($routeParams?: ng.route.IRouteParamsService) {
|
||||
return "I return a string"
|
||||
}
|
||||
})
|
||||
.when('/projects/:projectId/dashboard3', {
|
||||
controllerAs: 'I am a string',
|
||||
template: "Yup. String"
|
||||
})
|
||||
.when('/projects/:projectId/dashboard4', {
|
||||
controller: 'I am a string',
|
||||
templateUrl: function ($routeParams?: ng.route.IRouteParamsService) {
|
||||
return "I return a string"
|
||||
}
|
||||
})
|
||||
.otherwise({ redirectTo: '/' })
|
||||
.otherwise({ redirectTo: ($routeParams?: ng.route.IRouteParamsService, $locationPath?: string, $locationSearch?: any) => "" });
|
||||
|
||||
Vendored
+5
-5
@@ -42,7 +42,7 @@ declare module ng.route {
|
||||
* {(string|function()=}
|
||||
* Controller fn that should be associated with newly created scope or the name of a registered controller if passed as a string.
|
||||
*/
|
||||
controller?: any;
|
||||
controller?: string|Function;
|
||||
/**
|
||||
* A controller alias name. If present the controller will be published to scope under the controllerAs name.
|
||||
*/
|
||||
@@ -59,7 +59,7 @@ declare module ng.route {
|
||||
*
|
||||
* {Array.<Object>} - route parameters extracted from the current $location.path() by applying the current route
|
||||
*/
|
||||
template?: string;
|
||||
template?: string|{($routeParams?: ng.route.IRouteParamsService) : string;}
|
||||
/**
|
||||
* {string=|function()=}
|
||||
* Path or function that returns a path to an html template that should be used by ngView.
|
||||
@@ -68,14 +68,14 @@ declare module ng.route {
|
||||
*
|
||||
* {Array.<Object>} - route parameters extracted from the current $location.path() by applying the current route
|
||||
*/
|
||||
templateUrl?: any;
|
||||
templateUrl?: string|{ ($routeParams?: ng.route.IRouteParamsService): string; }
|
||||
/**
|
||||
* {Object.<string, function>=} - An optional map of dependencies which should be injected into the controller. If any of these dependencies are promises, the router will wait for them all to be resolved or one to be rejected before the controller is instantiated. If all the promises are resolved successfully, the values of the resolved promises are injected and $routeChangeSuccess event is fired. If any of the promises are rejected the $routeChangeError event is fired. The map object is:
|
||||
*
|
||||
* - key - {string}: a name of a dependency to be injected into the controller.
|
||||
* - factory - {string|function}: If string then it is an alias for a service. Otherwise if function, then it is injected and the return value is treated as the dependency. If the result is a promise, it is resolved before its value is injected into the controller. Be aware that ngRoute.$routeParams will still refer to the previous route within these resolve functions. Use $route.current.params to access the new route parameters, instead.
|
||||
*/
|
||||
resolve?: {[key: string]: any};
|
||||
resolve?: {[key: string]: any};
|
||||
/**
|
||||
* {(string|function())=}
|
||||
* Value to update $location path with and trigger route redirection.
|
||||
@@ -87,7 +87,7 @@ declare module ng.route {
|
||||
* - {Object} - current $location.search()
|
||||
* - The custom redirectTo function is expected to return a string which will be used to update $location.path() and $location.search().
|
||||
*/
|
||||
redirectTo?: any;
|
||||
redirectTo?: string|{($routeParams?: ng.route.IRouteParamsService, $locationPath?: string, $locationSearch?: any) : string};
|
||||
/**
|
||||
* Reload route when only $location.search() or $location.hash() changes.
|
||||
*
|
||||
|
||||
Vendored
+40
-82
@@ -392,32 +392,44 @@ declare module ng {
|
||||
// see http://docs.angularjs.org/api/ng.$compile.directive.Attributes
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
interface IAttributes {
|
||||
// this is necessary to be able to access the scoped attributes. it's not very elegant
|
||||
// because you have to use attrs['foo'] instead of attrs.foo but I don't know of a better way
|
||||
// this should really be limited to return string but it creates this problem: http://stackoverflow.com/q/17201854/165656
|
||||
/**
|
||||
* this is necessary to be able to access the scoped attributes. it's not very elegant
|
||||
* because you have to use attrs['foo'] instead of attrs.foo but I don't know of a better way
|
||||
* this should really be limited to return string but it creates this problem: http://stackoverflow.com/q/17201854/165656
|
||||
*/
|
||||
[name: string]: any;
|
||||
|
||||
// Adds the CSS class value specified by the classVal parameter to the
|
||||
// element. If animations are enabled then an animation will be triggered
|
||||
// for the class addition.
|
||||
/**
|
||||
* Adds the CSS class value specified by the classVal parameter to the
|
||||
* element. If animations are enabled then an animation will be triggered
|
||||
* for the class addition.
|
||||
*/
|
||||
$addClass(classVal: string): void;
|
||||
|
||||
// Removes the CSS class value specified by the classVal parameter from the
|
||||
// element. If animations are enabled then an animation will be triggered for
|
||||
// the class removal.
|
||||
/**
|
||||
* Removes the CSS class value specified by the classVal parameter from the
|
||||
* element. If animations are enabled then an animation will be triggered for
|
||||
* the class removal.
|
||||
*/
|
||||
$removeClass(classVal: string): void;
|
||||
|
||||
// Set DOM element attribute value.
|
||||
/**
|
||||
* Set DOM element attribute value.
|
||||
*/
|
||||
$set(key: string, value: any): void;
|
||||
|
||||
// Observes an interpolated attribute.
|
||||
// The observer function will be invoked once during the next $digest
|
||||
// following compilation. The observer is then invoked whenever the
|
||||
// interpolated value changes.
|
||||
/**
|
||||
* Observes an interpolated attribute.
|
||||
* The observer function will be invoked once during the next $digest
|
||||
* following compilation. The observer is then invoked whenever the
|
||||
* interpolated value changes.
|
||||
*/
|
||||
$observe(name: string, fn: (value?: any) => any): Function;
|
||||
|
||||
// A map of DOM element attribute names to the normalized name. This is needed
|
||||
// to do reverse lookup from normalized name back to actual name.
|
||||
/**
|
||||
* A map of DOM element attribute names to the normalized name. This is needed
|
||||
* to do reverse lookup from normalized name back to actual name.
|
||||
*/
|
||||
$attr: Object;
|
||||
}
|
||||
|
||||
@@ -820,33 +832,9 @@ declare module ng {
|
||||
* Change search part when called with parameter and return $location.
|
||||
*
|
||||
* @param search New search params
|
||||
* @param paramValue If search is a string or a Number, then paramValue will override only a single search property. If paramValue is null, the property specified via the first argument will be deleted.
|
||||
* @param paramValue If search is a string or a Number, then paramValue will override only a single search property. If paramValue is null, the property specified via the first argument will be deleted. If paramValue is an array, it will override the property of the search component of $location specified via the first argument. If paramValue is true, the property specified via the first argument will be added with no value nor trailing equal sign.
|
||||
*/
|
||||
search(search: string, paramValue: string): ILocationService;
|
||||
|
||||
/**
|
||||
* Change search part when called with parameter and return $location.
|
||||
*
|
||||
* @param search New search params
|
||||
* @param paramValue If search is a string or a Number, then paramValue will override only a single search property. If paramValue is null, the property specified via the first argument will be deleted.
|
||||
*/
|
||||
search(search: string, paramValue: number): ILocationService;
|
||||
|
||||
/**
|
||||
* Change search part when called with parameter and return $location.
|
||||
*
|
||||
* @param search New search params
|
||||
* @param paramValue If paramValue is an array, it will override the property of the search component of $location specified via the first argument.
|
||||
*/
|
||||
search(search: string, paramValue: string[]): ILocationService;
|
||||
|
||||
/**
|
||||
* Change search part when called with parameter and return $location.
|
||||
*
|
||||
* @param search New search params
|
||||
* @param paramValue If paramValue is true, the property specified via the first argument will be added with no value nor trailing equal sign.
|
||||
*/
|
||||
search(search: string, paramValue: boolean): ILocationService;
|
||||
search(search: string, paramValue: string|number|string[]|boolean): ILocationService;
|
||||
|
||||
state(): any;
|
||||
state(state: any): ILocationService;
|
||||
@@ -906,15 +894,7 @@ declare module ng {
|
||||
*
|
||||
* @param promises An array or hash of promises.
|
||||
*/
|
||||
all(promises: IPromise<any>[]): IPromise<any[]>;
|
||||
/**
|
||||
* Combines multiple promises into a single promise that is resolved when all of the input promises are resolved.
|
||||
*
|
||||
* Returns a single promise that will be resolved with an array/hash of values, each value corresponding to the promise at the same index/key in the promises array/hash. If any of the promises is resolved with a rejection, this resulting promise will be rejected with the same rejection value.
|
||||
*
|
||||
* @param promises An array or hash of promises.
|
||||
*/
|
||||
all(promises: { [id: string]: IPromise<any>; }): IPromise<{ [id: string]: any }>;
|
||||
all(promises: IPromise<any>[]|{ [id: string]: IPromise<any>; }): IPromise<any[]>;
|
||||
/**
|
||||
* Creates a Deferred object which represents a task which will finish in the future.
|
||||
*/
|
||||
@@ -932,13 +912,7 @@ declare module ng {
|
||||
*
|
||||
* @param value Value or a promise
|
||||
*/
|
||||
when<T>(value: IPromise<T>): IPromise<T>;
|
||||
/**
|
||||
* Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted.
|
||||
*
|
||||
* @param value Value or a promise
|
||||
*/
|
||||
when<T>(value: T): IPromise<T>;
|
||||
when<T>(value: IPromise<T>|T): IPromise<T>;
|
||||
/**
|
||||
* Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted.
|
||||
*
|
||||
@@ -953,32 +927,12 @@ declare module ng {
|
||||
*
|
||||
* This method returns a new promise which is resolved or rejected via the return value of the successCallback, errorCallback. It also notifies via the return value of the notifyCallback method. The promise can not be resolved or rejected from the notifyCallback method.
|
||||
*/
|
||||
then<TResult>(successCallback: (promiseValue: T) => IHttpPromise<TResult>, errorCallback?: (reason: any) => any, notifyCallback?: (state: any) => any): IPromise<TResult>;
|
||||
/**
|
||||
* Regardless of when the promise was or will be resolved or rejected, then calls one of the success or error callbacks asynchronously as soon as the result is available. The callbacks are called with a single argument: the result or rejection reason. Additionally, the notify callback may be called zero or more times to provide a progress indication, before the promise is resolved or rejected.
|
||||
*
|
||||
* This method returns a new promise which is resolved or rejected via the return value of the successCallback, errorCallback. It also notifies via the return value of the notifyCallback method. The promise can not be resolved or rejected from the notifyCallback method.
|
||||
*/
|
||||
then<TResult>(successCallback: (promiseValue: T) => IPromise<TResult>, errorCallback?: (reason: any) => any, notifyCallback?: (state: any) => any): IPromise<TResult>;
|
||||
/**
|
||||
* Regardless of when the promise was or will be resolved or rejected, then calls one of the success or error callbacks asynchronously as soon as the result is available. The callbacks are called with a single argument: the result or rejection reason. Additionally, the notify callback may be called zero or more times to provide a progress indication, before the promise is resolved or rejected.
|
||||
*
|
||||
* This method returns a new promise which is resolved or rejected via the return value of the successCallback, errorCallback. It also notifies via the return value of the notifyCallback method. The promise can not be resolved or rejected from the notifyCallback method.
|
||||
*/
|
||||
then<TResult>(successCallback: (promiseValue: T) => TResult, errorCallback?: (reason: any) => TResult, notifyCallback?: (state: any) => any): IPromise<TResult>;
|
||||
then<TResult>(successCallback: (promiseValue: T) => IHttpPromise<TResult>|IPromise<TResult>|TResult, errorCallback?: (reason: any) => any, notifyCallback?: (state: any) => any): IPromise<TResult>;
|
||||
|
||||
/**
|
||||
* Shorthand for promise.then(null, errorCallback)
|
||||
*/
|
||||
catch<TResult>(onRejected: (reason: any) => IHttpPromise<TResult>): IPromise<TResult>;
|
||||
/**
|
||||
* Shorthand for promise.then(null, errorCallback)
|
||||
*/
|
||||
catch<TResult>(onRejected: (reason: any) => IPromise<TResult>): IPromise<TResult>;
|
||||
/**
|
||||
* Shorthand for promise.then(null, errorCallback)
|
||||
*/
|
||||
catch<TResult>(onRejected: (reason: any) => TResult): IPromise<TResult>;
|
||||
catch<TResult>(onRejected: (reason: any) => IHttpPromise<TResult>|IPromise<TResult>|TResult): IPromise<TResult>;
|
||||
|
||||
/**
|
||||
* Allows you to observe either the fulfillment or rejection of a promise, but to do so without modifying the final value. This is useful to release resources or do some clean-up that needs to be done whether the promise was rejected or resolved. See the full specification for more information.
|
||||
@@ -1273,13 +1227,17 @@ declare module ng {
|
||||
interface IHttpPromise<T> extends IPromise<T> {
|
||||
success(callback: IHttpPromiseCallback<T>): IHttpPromise<T>;
|
||||
error(callback: IHttpPromiseCallback<any>): IHttpPromise<T>;
|
||||
then<TResult>(successCallback: (response: IHttpPromiseCallbackArg<T>) => IPromise<TResult>, errorCallback?: (response: IHttpPromiseCallbackArg<any>) => any): IPromise<TResult>;
|
||||
then<TResult>(successCallback: (response: IHttpPromiseCallbackArg<T>) => TResult, errorCallback?: (response: IHttpPromiseCallbackArg<any>) => any): IPromise<TResult>;
|
||||
then<TResult>(successCallback: (response: IHttpPromiseCallbackArg<T>) => IPromise<TResult>|TResult, errorCallback?: (response: IHttpPromiseCallbackArg<any>) => any): IPromise<TResult>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Object that controls the defaults for $http provider
|
||||
* https://docs.angularjs.org/api/ng/service/$http#defaults
|
||||
*/
|
||||
interface IHttpProviderDefaults {
|
||||
xsrfCookieName?: string;
|
||||
xsrfHeaderName?: string;
|
||||
withCredentials?: boolean;
|
||||
headers?: {
|
||||
common?: any;
|
||||
post?: any;
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
/// <reference path="animation-frame.d.ts"/>
|
||||
module AnimationFrameTests {
|
||||
var animation = new AnimationFrame();
|
||||
function frame() {
|
||||
animation.request(frame);
|
||||
}
|
||||
|
||||
animation.request(frame);
|
||||
}
|
||||
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
// Type definitions for animation-frame 0.1.7
|
||||
// Project: https://github.com/kof/animation-frame
|
||||
// Definitions by: Qinfeng Chen <https://github.com/qinfchen>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
interface AnimationFrame {
|
||||
new(): AnimationFrame;
|
||||
request(callback: () => void): void;
|
||||
}
|
||||
|
||||
declare var AnimationFrame: AnimationFrame;
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
/// <reference path="aspnet-identity-pw.d.ts" />
|
||||
|
||||
import passwordHasher = require('aspnet-identity-pw');
|
||||
|
||||
function usageSync() {
|
||||
var hashedPassword: string = passwordHasher.hashPassword('SomePassword');
|
||||
var isValid: boolean = passwordHasher.validatePassword('SomePassword', hashedPassword);
|
||||
}
|
||||
|
||||
function usageAsync() {
|
||||
var hashedPassword: string = null;
|
||||
var isValid: boolean = null;
|
||||
|
||||
passwordHasher.hashPassword('SomePassword', function(err, result) {
|
||||
hashedPassword = result;
|
||||
});
|
||||
|
||||
passwordHasher.validatePassword('SomePassword', hashedPassword, function(err, result) {
|
||||
isValid = result;
|
||||
});
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// Type definitions for aspnet-identity-pw 1.0.0
|
||||
// Project: https://github.com/Syncbak-Git/aspnet-identity-pw
|
||||
// Definitions by: jt000 <https://github.com/jt000>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module "aspnet-identity-pw" {
|
||||
|
||||
export function hashPassword(password: string): string;
|
||||
export function hashPassword(password: string, callback: (err: any, result: string)=>void): void;
|
||||
|
||||
export function validatePassword(password: string, hashedPass: string): boolean;
|
||||
export function validatePassword(password: string, hashedPass: string, callback: (err: any, result: boolean) => void): void;
|
||||
}
|
||||
@@ -0,0 +1,189 @@
|
||||
/// <reference path="asyncblock.d.ts" />
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
|
||||
import asyncblock = require('asyncblock');
|
||||
import fs = require('fs');
|
||||
|
||||
|
||||
// Sleeping in series
|
||||
asyncblock((flow: asyncblock.IFlow) => {
|
||||
console.time('time');
|
||||
|
||||
setTimeout(flow.add(), 1000);
|
||||
flow.wait(); //Wait for the first setTimeout to finish
|
||||
|
||||
setTimeout(flow.add(), 2000);
|
||||
flow.wait(); //Wait for the second setTimeout to finish
|
||||
|
||||
console.timeEnd('time'); //3 seconds
|
||||
});
|
||||
|
||||
// Trapping results
|
||||
asyncblock((flow) => {
|
||||
var path1 = '', path2 = '';
|
||||
//Start two parallel file reads
|
||||
fs.readFile(path1, 'utf8', flow.set('contents1'));
|
||||
fs.readFile(path2, 'utf8', flow.set('contents2'));
|
||||
|
||||
//Print the concatenation of the results when both reads are finished
|
||||
console.log(flow.get<string>('contents1') + flow.get<string>('contents2'));
|
||||
|
||||
var paths: string[] = [];
|
||||
//Wait for a large number of tasks
|
||||
for(var i = 0; i < 100; i++){
|
||||
//Add each task in parallel with i as the key
|
||||
fs.readFile(paths[i], 'utf8', flow.add(i));
|
||||
}
|
||||
|
||||
//Wait for all the tasks to finish. Results is an object of the form {key1: value1, key2: value2, ...}
|
||||
var results = flow.wait();
|
||||
|
||||
var path = '';
|
||||
//One-liner syntax for waiting on a single task
|
||||
var contents = flow.sync( fs.readFile(path, 'utf8', flow.callback()) );
|
||||
|
||||
//See overview & API docs for more extensive description of techniques
|
||||
});
|
||||
|
||||
// Error handling
|
||||
var asyncTask = (callback: (err: any) => void) => {
|
||||
asyncblock((flow) => {
|
||||
flow.errorCallback = callback; //Setting the errorCallback is the easiest way to perform error handling. If erroCallback isn't set, and an error occurs, it will be thrown instead of returned to the callback
|
||||
|
||||
var path = '';
|
||||
fs.readFile(path, 'utf8', flow.add()); //If readFile encountered an error, it would automatically get passed to the callback
|
||||
var contents = flow.wait();
|
||||
|
||||
console.log(contents); //If an error occured above, this code won't run
|
||||
});
|
||||
};
|
||||
|
||||
// Returning results
|
||||
var asyncTask2 = (callback: (err: any, res: string) => void) => {
|
||||
asyncblock((flow) => {
|
||||
var path = '';
|
||||
var contents = flow.sync( fs.readFile(path, 'utf8', flow.callback()) ); //If readFile encountered an error, it would automatically get passed to the callback
|
||||
|
||||
return contents; //Return the value you want to be passed to the callback
|
||||
}, callback); //The callback can be specified as the 2nd arg to asyncblock. It will be called with the value returned from the asyncblock as the 2nd arg.
|
||||
//If an error occurs, the callback will be called with the error as the first argument.
|
||||
};
|
||||
|
||||
|
||||
// Sample
|
||||
asyncblock.nostack((flow) => {
|
||||
fs.readFile('path1', 'utf8', flow.add('first'));
|
||||
fs.readFile('path2', 'utf8', flow.add('second'));
|
||||
|
||||
//Wait until done reading the first and second files, then write them to another file
|
||||
fs.writeFile('path3', flow.wait<string>('first') + flow.wait<string>('second'), flow.add());
|
||||
flow.wait(); //Wait on all outstanding tasks
|
||||
|
||||
fs.readFile('path3', 'utf8', flow.add('data'));
|
||||
|
||||
console.log(flow.wait('data')); //Print the 3rd file's data
|
||||
console.log('all done');
|
||||
});
|
||||
|
||||
|
||||
// Formatting results
|
||||
(function() {
|
||||
|
||||
var asyncTask = function(callback: (err: any, res1: number, res2: number, res3: number) => void) {
|
||||
process.nextTick(function() {
|
||||
callback(null, 1, 2, 3);
|
||||
});
|
||||
}
|
||||
|
||||
asyncblock(function(flow) {
|
||||
asyncTask(flow.add());
|
||||
|
||||
var result = flow.wait();
|
||||
console.log(result); // Prints 1
|
||||
});
|
||||
|
||||
asyncblock(function(flow) {
|
||||
asyncTask(flow.add(['first', 'second', 'third']));
|
||||
|
||||
var result = flow.wait();
|
||||
console.log(result); // Prints { first: 1, second: 2, third: 3 }
|
||||
|
||||
asyncTask(flow.add('key1', ['first', 'second', 'third']));
|
||||
asyncTask(flow.add('key2', ['a', 'b', 'c']));
|
||||
var result = flow.wait();
|
||||
console.log(result); // Prints { key1: { first: 1, second: 2, third: 3 }, key2: { a: 1, b: 2, c: 3} }
|
||||
});
|
||||
|
||||
})();
|
||||
|
||||
|
||||
// Parallel task rate limiting
|
||||
(function() {
|
||||
|
||||
asyncblock(function(flow) {
|
||||
flow.queue(function(callback: Function) {
|
||||
setTimeout(callback, 1000);
|
||||
});
|
||||
|
||||
flow.wait(); //This will wait for about a second
|
||||
});
|
||||
|
||||
asyncblock(function(flow) {
|
||||
flow.maxParallel = 2;
|
||||
|
||||
process.nextTick(function(){
|
||||
flow.queue(function(callback: Function) {
|
||||
setTimeout(callback, 1000);
|
||||
});
|
||||
|
||||
flow.queue(function(callback: Function) {
|
||||
setTimeout(callback, 2000);
|
||||
});
|
||||
|
||||
flow.queue(function(callback: Function) {
|
||||
setTimeout(callback, 3000);
|
||||
});
|
||||
|
||||
flow.doneAdding();
|
||||
});
|
||||
|
||||
flow.forceWait();
|
||||
});
|
||||
|
||||
asyncblock(function(flow) {
|
||||
setTimeout(flow.callback(), 1000);
|
||||
|
||||
flow.queue(function(callback: Function) {
|
||||
setTimeout(callback, 1000);
|
||||
});
|
||||
flow.queue((callback: (err: any, res: string) => void) => {
|
||||
callback(null, '');
|
||||
});
|
||||
|
||||
flow.wait();
|
||||
});
|
||||
|
||||
})();
|
||||
|
||||
|
||||
// Task timeouts
|
||||
(function() {
|
||||
|
||||
asyncblock(function(flow){
|
||||
setTimeout(flow.add({timeout: 1000, timeoutIsError: false}), 2000);
|
||||
flow.wait(); //The fiber will yield here for 1 second, then continue
|
||||
|
||||
//Code here will run
|
||||
});
|
||||
|
||||
asyncblock(function(flow){
|
||||
flow.timeoutIsError = false;
|
||||
|
||||
setTimeout(flow.add({timeout: 1000}), 2000);
|
||||
flow.wait(); //The fiber will yield here for 1 second, then continue
|
||||
|
||||
//Code here will run
|
||||
});
|
||||
|
||||
})();
|
||||
|
||||
Vendored
+73
@@ -0,0 +1,73 @@
|
||||
// Type definitions for asyncblock 2.1.23
|
||||
// Project: https://github.com/scriby/asyncblock
|
||||
// Definitions by: Hiroki Horiuchi <https://github.com/horiuchi/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
|
||||
declare module "asyncblock" {
|
||||
function asyncblock<T>(f: (flow: asyncblock.IFlow) => void, callback?: (err: any, res: T) => void): void;
|
||||
|
||||
module asyncblock {
|
||||
export function nostack<T>(f: (flow: asyncblock.IFlow) => void, callback?: (err: any, res: T) => void): void;
|
||||
|
||||
export interface IFlow {
|
||||
add(responseFormat?: string[]): IExecuteFunction;
|
||||
add(key: string, responseFormat?: string[]): IExecuteFunction;
|
||||
add(key: number, responseFormat?: string[]): IExecuteFunction;
|
||||
add(options: IFlowOptions): IExecuteFunction;
|
||||
callback(responseFormat?: string[]): IExecuteFunction;
|
||||
callback(key: string, responseFormat?: string[]): IExecuteFunction;
|
||||
callback(key: number, responseFormat?: string[]): IExecuteFunction;
|
||||
callback(options: IFlowOptions): IExecuteFunction;
|
||||
wait<T>(key?: string): T;
|
||||
wait<T>(key?: number): T;
|
||||
|
||||
get<T>(key: string): T;
|
||||
set(key: string, responseFormat?: string[]): IExecuteFunction;
|
||||
set(options: IFlowOptions): IExecuteFunction;
|
||||
del(key: string): void;
|
||||
|
||||
sync<T>(task: any): T;
|
||||
queue(toExecute: IExecuteFunction): void;
|
||||
queue(key: string, toExecute: IExecuteFunction): void;
|
||||
queue(key: number, toExecute: IExecuteFunction): void;
|
||||
queue(responseFormat: string[], toExecute: IExecuteFunction): void;
|
||||
queue(key: string, responseFormat: string[], toExecute: IExecuteFunction): void;
|
||||
queue(key: number, responseFormat: string[], toExecute: IExecuteFunction): void;
|
||||
queue(options: IFlowOptions, toExecute: IExecuteFunction): void;
|
||||
doneAdding(): void;
|
||||
forceWait<T>(): T;
|
||||
|
||||
maxParallel: number;
|
||||
errorCallback: (err: any) => void;
|
||||
taskTimeout: number;
|
||||
timeoutIsError: boolean;
|
||||
}
|
||||
|
||||
export interface IFlowOptions {
|
||||
ignoreError?: boolean; // default false
|
||||
key?: string; // string | number
|
||||
responseFormat?: string[];
|
||||
timeout?: number;
|
||||
timeoutIsError?: boolean;
|
||||
dontWait?: boolean;
|
||||
firstArgIsError?: boolean; // default true
|
||||
}
|
||||
|
||||
export interface IExecuteFunction {
|
||||
<T1, T2, T3>(err: any, res1: T1, res2: T2, res3: T3): any;
|
||||
<T1, T2>(err: any, res1: T1, res2: T2): any;
|
||||
<T>(err: any, res: T): any;
|
||||
(err: any): any;
|
||||
|
||||
// firstArgIsError === false
|
||||
<T1, T2, T3>(res1: T1, res2: T2, res3: T3): any;
|
||||
<T1, T2>(res1: T1, res2: T2): any;
|
||||
<T>(res: T): any;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export = asyncblock;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
/// <reference path="backbone.radio.d.ts" />
|
||||
/// <reference path="../jquery/jquery.d.ts" />
|
||||
|
||||
class MyCommands extends Backbone.Radio.Commands {
|
||||
|
||||
}
|
||||
|
||||
class MyRequests extends Backbone.Radio.Requests {
|
||||
|
||||
}
|
||||
|
||||
function onRender() : void {
|
||||
|
||||
}
|
||||
|
||||
function onStart(arg1 : string, arg2 : number) : number {
|
||||
return 0;
|
||||
}
|
||||
|
||||
function TestCommands() {
|
||||
var myCommands = new MyCommands();
|
||||
|
||||
var r: Backbone.Radio.Commands;
|
||||
r = myCommands.comply('render', onRender);
|
||||
myCommands.command('render');
|
||||
myCommands.command('start', 'pelle', 23);
|
||||
|
||||
r = myCommands.complyOnce('start', onStart);
|
||||
r = myCommands.complyOnce('start', onStart, myCommands);
|
||||
|
||||
r = myCommands.comply({
|
||||
'render': onRender,
|
||||
'start': onStart
|
||||
});
|
||||
|
||||
r = myCommands.complyOnce({
|
||||
'render': onRender,
|
||||
'start': onStart
|
||||
});
|
||||
|
||||
myCommands.stopComplying('render');
|
||||
myCommands.stopComplying(null, onStart);
|
||||
myCommands.stopComplying(null, null, myCommands);
|
||||
}
|
||||
|
||||
function TestRequests() {
|
||||
var myRequests = new MyRequests();
|
||||
|
||||
var r: Backbone.Radio.Requests;
|
||||
r = myRequests.reply('render', onRender);
|
||||
|
||||
var result: any;
|
||||
result = myRequests.request('render');
|
||||
result = myRequests.request('start', 'pelle', 23);
|
||||
|
||||
r = myRequests.replyOnce('start', onStart);
|
||||
r = myRequests.replyOnce('start', onStart, myRequests);
|
||||
|
||||
r = myRequests.reply({
|
||||
'render': onRender,
|
||||
'start': onStart
|
||||
});
|
||||
|
||||
r = myRequests.replyOnce({
|
||||
'render': onRender,
|
||||
'start': onStart
|
||||
});
|
||||
|
||||
myRequests.stopReplying('render');
|
||||
myRequests.stopReplying(null, onStart);
|
||||
myRequests.stopReplying(null, null, myRequests);
|
||||
}
|
||||
|
||||
function TestGlobalApiAndChannels() {
|
||||
var authChannel = Backbone.Radio.channel('auth');
|
||||
|
||||
// Turn on debug mode
|
||||
Backbone.Radio.DEBUG = true;
|
||||
|
||||
// This will log a warning to the console if it goes unhandled
|
||||
authChannel.command('show:view');
|
||||
|
||||
// Likewise, this will too, helping to prevent memory leaks
|
||||
authChannel.stopReplying('startTime');
|
||||
|
||||
var radio: Backbone.Radio = Backbone.Radio.tuneIn('calendar');
|
||||
radio.tuneIn('calendar');
|
||||
radio = Backbone.Radio.tuneOut('calendar');
|
||||
|
||||
Backbone.Radio.log('channelName', 'eventName', 42, true);
|
||||
|
||||
// Trigger 'some:event' on the settings channel
|
||||
Backbone.Radio.trigger('settings', 'some:event');
|
||||
|
||||
authChannel.reset();
|
||||
|
||||
var channelName: string = authChannel.channelName;
|
||||
|
||||
Backbone.Radio.command('auth', 'show:view');
|
||||
Backbone.Radio.comply('auth', 'show', onRender, authChannel);
|
||||
|
||||
Backbone.Radio.reply('auth', 'authenticate', onStart);
|
||||
Backbone.Radio.request('auth', 'authenticate', 'pelle', 42);
|
||||
}
|
||||
Vendored
+92
@@ -0,0 +1,92 @@
|
||||
// Type definitions for Backbone.Radio v0.8.3
|
||||
// Project: https://github.com/marionettejs/backbone.radio
|
||||
// Definitions by: Peter Palotas <https://github.com/alphaleonis/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../backbone/backbone.d.ts" />
|
||||
|
||||
declare module Backbone {
|
||||
interface Radio {
|
||||
tuneIn(channelName: string): Radio;
|
||||
tuneOut(channelName: string): Radio;
|
||||
log(channelName: string, eventName: string, ...args: any[]): void;
|
||||
channel(channelName: string): Radio.Channel;
|
||||
}
|
||||
|
||||
module Radio {
|
||||
var VERSION: string;
|
||||
var DEBUG: boolean;
|
||||
|
||||
function log(channelName: string, eventName: string, ...args: any[]): void;
|
||||
function tuneIn(channelName: string): Radio;
|
||||
function tuneOut(channelName: string): Radio;
|
||||
function channel(channelName: string): Channel;
|
||||
|
||||
// Proxy functions for Commands
|
||||
function command(channelName: string, commandName: string, ...args: any[]): void;
|
||||
function comply(channelName: string, commandName: string, callback: (...args: any[]) => void, context?: any): Commands;
|
||||
function comply(channelName: string, commands: { [key: string]: (...args: any[]) => any }, context?: any): Commands;
|
||||
function complyOnce(channelName: string, commandName: string, callback: (...args: any[]) => void, context?: any): Commands;
|
||||
function complyOnce(channelName: string, commands: { [key: string]: (...args: any[]) => any }, context?: any): Commands;
|
||||
function stopComplying(channelName: string, commandName?: string, callback?: (...args: any[]) => void, context?: any): Commands;
|
||||
|
||||
// Proxy functions for Requests
|
||||
function request(channelName: string, requestName: string, ...args: any[]): any;
|
||||
function reply(channelName: string, requestName: string, callback: (...args: any[]) => any, context?: any): Requests;
|
||||
function reply(channelName: string, commands: { [key: string]: (...args: any[]) => any }, context?: any): Requests;
|
||||
function replyOnce(channelName: string, requestName: string, callback: (...args: any[]) => any, context?: any): Requests;
|
||||
function replyOnce(channelName: string, commands: { [key: string]: (...args: any[]) => any }, context?: any): Requests;
|
||||
function stopReplying(channelName: string, commandName?: string, callback?: (...args: any[]) => any, context?: any): Requests;
|
||||
|
||||
// Proxy functions for Backbone.Events
|
||||
function on(channelName: string, eventName: string, callback?: Function, context?: any): any;
|
||||
function off(channelName: string, eventName?: string, callback?: Function, context?: any): any;
|
||||
function trigger(channelName: string, eventName: string, ...args: any[]): any;
|
||||
function bind(channelName: string, eventName: string, callback: Function, context?: any): any;
|
||||
function unbind(channelName: string, eventName?: string, callback?: Function, context?: any): any;
|
||||
|
||||
function once(channelName: string, events: string, callback: Function, context?: any): any;
|
||||
function listenTo(channelName: string, object: any, events: string, callback: Function): any;
|
||||
function listenToOnce(channelName: string, object: any, events: string, callback: Function): any;
|
||||
function stopListening(channelName: string, object?: any, events?: string, callback?: Function): any;
|
||||
|
||||
class Commands {
|
||||
command(commandName: string, ...args: any[]): void;
|
||||
comply(commandName: string, callback: (...args: any[]) => void, context?: any): Commands;
|
||||
comply(commands: { [key: string]: (...args: any[]) => any }, context?: any): Commands;
|
||||
complyOnce(commands: { [key: string]: (...args: any[]) => any }, context?: any): Commands;
|
||||
complyOnce(commandName: string, callback: (...args: any[]) => void, context?: any): Commands;
|
||||
stopComplying(commandName?: string, callback?: (...args: any[]) => void, context?: any): Commands;
|
||||
}
|
||||
|
||||
class Requests {
|
||||
request(requestName: string, ...args: any[]): any;
|
||||
reply(requestName: string, callback: (...args: any[]) => any, context?: any): Requests;
|
||||
reply(commands: { [key: string]: (...args: any[]) => any }, context?: any): Requests;
|
||||
replyOnce(requestName: string, callback: (...args: any[]) => any, context?: any): Requests;
|
||||
replyOnce(commands: { [key: string]: (...args: any[]) => any }, context?: any): Requests;
|
||||
stopReplying(commandName?: string, callback?: (...args: any[]) => any, context?: any): Requests;
|
||||
}
|
||||
|
||||
class Channel extends Backbone.Events implements Commands, Requests {
|
||||
channelName: string;
|
||||
reset(): Channel;
|
||||
|
||||
// Radio.Commands
|
||||
command(commandName: string, ...args: any[]): void;
|
||||
comply(commandName: string, callback: (...args: any[]) => void, context?: any): Commands;
|
||||
comply(commands: { [key: string]: (...args: any[]) => any }, context?: any): Commands;
|
||||
complyOnce(commandName: string, callback: (...args: any[]) => void, context?: any): Commands;
|
||||
complyOnce(commands: { [key: string]: (...args: any[]) => any }, context?: any): Commands;
|
||||
stopComplying(commandName?: string, callback?: (...args: any[]) => void, context?: any): Commands;
|
||||
|
||||
// Radio.Requests
|
||||
request(requestName: string, ...args: any[]): any;
|
||||
reply(requestName: string, callback: (...args: any[]) => any, context?: any): Requests;
|
||||
reply(commands: { [key: string]: (...args: any[]) => any }, context?: any): Requests;
|
||||
replyOnce(requestName: string, callback: (...args: any[]) => any, context?: any): Requests;
|
||||
replyOnce(commands: { [key: string]: (...args: any[]) => any }, context?: any): Requests;
|
||||
stopReplying(commandName?: string, callback?: (...args: any[]) => any, context?: any): Requests;
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+12
-10
@@ -109,7 +109,7 @@ declare module Backbone {
|
||||
urlRoot: any;
|
||||
|
||||
constructor(attributes?: any, options?: any);
|
||||
initialize(attributes?: any): void;
|
||||
initialize(attributes?: any, options?: any): void;
|
||||
|
||||
fetch(options?: ModelFetchOptions): JQueryXHR;
|
||||
|
||||
@@ -176,6 +176,7 @@ declare module Backbone {
|
||||
length: number;
|
||||
|
||||
constructor(models?: TModel[], options?: any);
|
||||
initialize(models?: TModel[], options?: any): void;
|
||||
|
||||
fetch(options?: CollectionFetchOptions): JQueryXHR;
|
||||
|
||||
@@ -274,7 +275,7 @@ declare module Backbone {
|
||||
* For assigning routes as object hash, do it like this: this.routes = <any>{ "route": callback, ... };
|
||||
* That works only if you set it in the constructor or the initialize method.
|
||||
**/
|
||||
routes(): any;
|
||||
routes: any;
|
||||
|
||||
constructor(options?: RouterOptions);
|
||||
initialize(options?: RouterOptions): void;
|
||||
@@ -310,14 +311,14 @@ declare module Backbone {
|
||||
private _updateHash(location: Location, fragment: string, replace: boolean): void;
|
||||
}
|
||||
|
||||
interface ViewOptions<TModel extends Model> {
|
||||
model?: TModel;
|
||||
collection?: Backbone.Collection<TModel>;
|
||||
el?: any;
|
||||
id?: string;
|
||||
className?: string;
|
||||
tagName?: string;
|
||||
attributes?: any[];
|
||||
interface ViewOptions<TModel extends Model> {
|
||||
model?: TModel;
|
||||
collection?: Backbone.Collection<TModel>;
|
||||
el?: any;
|
||||
id?: string;
|
||||
className?: string;
|
||||
tagName?: string;
|
||||
attributes?: {[id: string]: any};
|
||||
}
|
||||
|
||||
class View<TModel extends Model> extends Events {
|
||||
@@ -328,6 +329,7 @@ declare module Backbone {
|
||||
private static extend(properties: any, classProperties?: any): any;
|
||||
|
||||
constructor(options?: ViewOptions<TModel>);
|
||||
initialize(options?: ViewOptions<TModel>): void;
|
||||
|
||||
/**
|
||||
* Events hash or a method returning the events hash that maps events/selectors to methods on your View.
|
||||
|
||||
@@ -230,4 +230,21 @@ function propertiesTest3() {
|
||||
y.c // '0' [0].toString()
|
||||
y.e // 0
|
||||
y.s // -1
|
||||
}
|
||||
|
||||
// see http://mikemcl.github.io/big.js/#faq
|
||||
// "How can I simultaneously use different decimal places and/or rounding mode settings for different Big numbers?"
|
||||
function testMultipleConstructors() {
|
||||
|
||||
var Big10 = Big();
|
||||
|
||||
// Set the decimal places of division operations for each constructor.
|
||||
Big.DP = 3;
|
||||
Big10.DP = 10;
|
||||
|
||||
var x = Big(5);
|
||||
var y = Big10(5);
|
||||
|
||||
x.div(3) // 1.667
|
||||
y.div(3) // 1.6666666667
|
||||
}
|
||||
Vendored
+3
@@ -42,6 +42,9 @@ declare module BigJsLibrary {
|
||||
(value: string): BigJS;
|
||||
/** A decimal value. */
|
||||
(value: BigJS): BigJS;
|
||||
|
||||
/** A decimal value. */
|
||||
(): BigJS;
|
||||
}
|
||||
|
||||
/** BigJS instance methods */
|
||||
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
// Type definitions for Microsoft.Maps.AdvancedShapes 7.0
|
||||
// Project: http://msdn.microsoft.com/en-us/library/hh921952.aspx
|
||||
// Definitions by: Eric Todd <https://github.com/ericrtodd>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="Microsoft.Maps.d.ts"/>
|
||||
|
||||
declare module Microsoft.Maps.AdvancedShapes {
|
||||
|
||||
export class EntityCollection {
|
||||
|
||||
constructor(options: EntityCollectionOptions);
|
||||
|
||||
clear(): void;
|
||||
get(index: number): Entity;
|
||||
getLength(): number;
|
||||
getVisible(): boolean;
|
||||
getZIndex(): number;
|
||||
indexOf(entity: Entity): number;
|
||||
insert(entity: Entity, index: number): void;
|
||||
pop(): Entity;
|
||||
push(entity: Entity): void;
|
||||
remove(entity: Entity): Entity;
|
||||
removeAt(index: number): Entity;
|
||||
setOptions(options: EntityCollectionOptions): void;
|
||||
toString(): string;
|
||||
|
||||
entityAdded: (args: EntityChangeArgs) => any;
|
||||
entityChanged: (args: EntityChangeArgs) => any;
|
||||
entityRemoved: (args: EntityChangeArgs) => any;
|
||||
}
|
||||
|
||||
export class Polygon implements Entity {
|
||||
|
||||
constructor(locations: Array<Location>, options?: PolygonOptions);
|
||||
|
||||
getFillColor(): Color;
|
||||
getLocations(): Array<Location>;
|
||||
getStrokeColor(): Color;
|
||||
getStrokeDashArray(): string;
|
||||
getStrokeThickness(): number;
|
||||
getVisible(): boolean;
|
||||
setLocations(locations: Location[]): void;
|
||||
setOptions(options: PolylineOptions): void;
|
||||
toString(): string;
|
||||
|
||||
click: (eventArgs: MouseEventArgs) => void;
|
||||
dbclick: (eventArgs: MouseEventArgs) => void;
|
||||
entitychanged: (entity: Entity) => void;
|
||||
mousedown: (eventArgs: MouseEventArgs) => void;
|
||||
mouseout: (eventArgs: MouseEventArgs) => void;
|
||||
mouseover: (eventArgs: MouseEventArgs) => void;
|
||||
mouseup: (eventArgs: MouseEventArgs) => void;
|
||||
rightclick: (eventArgs: MouseEventArgs) => void;
|
||||
}
|
||||
|
||||
}
|
||||
+461
@@ -0,0 +1,461 @@
|
||||
// Type definitions for Microsoft.Maps.Directions 7.0
|
||||
// Project: http://msdn.microsoft.com/en-us/library/hh312813.aspx
|
||||
// Definitions by: Eric Todd <https://github.com/ericrtodd>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="Microsoft.Maps.d.ts"/>
|
||||
|
||||
declare module Microsoft.Maps.Directions {
|
||||
|
||||
export interface BusinessDetails {
|
||||
|
||||
businessName?: string;
|
||||
entityId?: string;
|
||||
phoneNumber?: string;
|
||||
website?: string;
|
||||
}
|
||||
|
||||
export interface WaypointOptions {
|
||||
|
||||
address?: string;
|
||||
businessDetails?: BusinessDetails;
|
||||
disambiguationContainer?: HTMLElement;
|
||||
exactLocation?: string;
|
||||
isViapoint?: boolean;
|
||||
location?: Location;
|
||||
pushpin?: Pushpin;
|
||||
shortAddress?: string;
|
||||
}
|
||||
|
||||
export interface BusinessDisambiguationSuggestion {
|
||||
|
||||
address?: string;
|
||||
distance?: number;
|
||||
entityId?: number;
|
||||
index?: number;
|
||||
isApproximate?: boolean;
|
||||
location?: Location;
|
||||
name?: string;
|
||||
phoneNumber?: string;
|
||||
photoUrl?: string;
|
||||
rooftopLocation?: Location;
|
||||
website?: string;
|
||||
}
|
||||
|
||||
export interface LocationDisambiguationSuggestion {
|
||||
|
||||
formattedSuggestion?: string;
|
||||
location?: Location;
|
||||
rooftopLocation?: Location;
|
||||
suggestion?: string;
|
||||
}
|
||||
|
||||
export interface Disambiguation {
|
||||
|
||||
businessSuggestions?: Array<BusinessDisambiguationSuggestion>;
|
||||
hasMoreSuggestions?: boolean;
|
||||
headerText?: string;
|
||||
locationSuggestions?: Array<LocationDisambiguationSuggestion>;
|
||||
}
|
||||
|
||||
export interface WaypointEventArgs {
|
||||
|
||||
waypoint: Waypoint;
|
||||
}
|
||||
|
||||
export class Waypoint {
|
||||
|
||||
constructor(options: WaypointOptions);
|
||||
|
||||
clear(): void;
|
||||
dispose(): void;
|
||||
getAddress(): string;
|
||||
getBusinessDetails(): BusinessDetails;
|
||||
getDisambiguationContainer(): HTMLElement;
|
||||
getDisambiguationResult(): Disambiguation;
|
||||
getLocation(): Location;
|
||||
getPushpin(): Pushpin;
|
||||
getShortAddress(): string;
|
||||
isExactLocation(): boolean;
|
||||
isViapoint(): boolean;
|
||||
setOptions(options: WaypointOptions): void;
|
||||
|
||||
changed: (args: WaypointEventArgs) => void;
|
||||
geocoded: (args: WaypointEventArgs) => void;
|
||||
reverseGeocoded: (args: WaypointEventArgs) => void;
|
||||
}
|
||||
|
||||
export interface DirectionsRenderOptions {
|
||||
|
||||
autoDisplayDisambiguation?: boolean;
|
||||
autoUpdateMapView?: boolean;
|
||||
disambiguationPushpinOptions?: PushpinOptions;
|
||||
displayDisclaimer?: boolean;
|
||||
displayManeuverIcons?: boolean;
|
||||
displayPostItineraryItemHints?: boolean;
|
||||
displayPreItineraryItemHints?: boolean;
|
||||
displayRouteSelector?: boolean;
|
||||
displayStepWarnings?: boolean;
|
||||
displayTrafficAvoidanceOption?: boolean;
|
||||
displayWalkingWarning?: boolean;
|
||||
drivingPolylineOptions?: PolylineOptions;
|
||||
itineraryContainer?: HTMLElement;
|
||||
lastWaypointIcon?: string;
|
||||
middleWaypointIcon?: string;
|
||||
stepPushpinOptions?: PushpinOptions;
|
||||
transitPolylineOptions?: PolylineOptions;
|
||||
viapointPushpinsOptions?: PushpinOptions;
|
||||
walkingPolylineOptions?: PolylineOptions;
|
||||
waypointPushpinOptions?: PushpinOptions;
|
||||
}
|
||||
|
||||
export enum DistanceUnit {
|
||||
kilometers= 0,
|
||||
miles= 1
|
||||
}
|
||||
|
||||
export enum RouteAvoidance {
|
||||
none= 0,
|
||||
minimizeLimitedAccessHighway= 1,
|
||||
minimizeToll= 2,
|
||||
avoidLimitedAccessHighway= 4,
|
||||
avoidToll= 8,
|
||||
avoidExpressTrain= 16,
|
||||
avoidAirline= 32,
|
||||
avoidBulletTrain= 64
|
||||
}
|
||||
|
||||
export enum RouteMode {
|
||||
driving,
|
||||
transit,
|
||||
walking
|
||||
}
|
||||
|
||||
export enum RouteOptimization {
|
||||
shortestTime= 0,
|
||||
shortestDistance= 1,
|
||||
minimizeMoney= 3,
|
||||
minimizeTransfers= 4,
|
||||
minimizeWalking= 5
|
||||
}
|
||||
|
||||
export enum TimeType {
|
||||
arrival,
|
||||
departure,
|
||||
lastAvailable
|
||||
}
|
||||
|
||||
export interface TransitOptions {
|
||||
timeType?: TimeType;
|
||||
transitTime?: Date;
|
||||
}
|
||||
|
||||
export interface DirectionsRequestOptions {
|
||||
|
||||
avoidTraffic?: boolean;
|
||||
distanceUnit?: DistanceUnit;
|
||||
maxRoutes?: number;
|
||||
routeAvoidance?: Array<RouteAvoidance>;
|
||||
routeDraggable?: boolean;
|
||||
routeIndex?: boolean;
|
||||
routeMode?: RouteMode;
|
||||
routeOptimization?: RouteOptimization;
|
||||
transitOptions?: TransitOptions;
|
||||
}
|
||||
|
||||
export class DirectionsManager {
|
||||
|
||||
constructor(map: Microsoft.Maps.Map);
|
||||
|
||||
resetDirections(): void;
|
||||
addWaypoint(waypoint: Waypoint, index?: number): void;
|
||||
calculateDirections(): void;
|
||||
clearDisplay(): void;
|
||||
dispose(): void;
|
||||
getAllWaypoints(): Array<Waypoint>;
|
||||
getMap(): Map;
|
||||
getNearbyMajorRoads(location: Location, callback: any, errorCallback: any, userData: any): void;
|
||||
getRenderOptions(): DirectionsRenderOptions;
|
||||
getRequestOptions(): DirectionsRequestOptions;
|
||||
getRouteResult(): Array<Route>;
|
||||
removeWaypoint(waypoint: Waypoint): void;
|
||||
removeWaypoint(index: number): void;
|
||||
resetDirections(options: ResetDirectionsOptions): void;
|
||||
reverseGeocode(location: Location, callback: any, errorCallback: any, userData: any): void;
|
||||
setMapView(): void;
|
||||
setRenderOptions(options: DirectionsRenderOptions): void;
|
||||
setRequestOptions(options: DirectionsRequestOptions): void;
|
||||
|
||||
afterRouteSelectorRender: (args: RouteSelectorRenderEventArgs) => void;
|
||||
afterStepRender: (args: DirectionsStepRenderEventArgs) => void;
|
||||
afterSummaryRender: (args: RouteSummaryRenderEventArgs) => void;
|
||||
afterWaypointRender: (args: WaypointRenderEventArgs) => void;
|
||||
beforeDisambiguationRender: (args: DisambiguationRenderEventArgs) => void;
|
||||
beforeRouteSelectorRender: (args: RouteSelectorRenderEventArgs) => void;
|
||||
beforeStepRender: (args: DirectionsStepRenderEventArgs) => void;
|
||||
beforeSummaryRender: (args: RouteSummaryRenderEventArgs) => void;
|
||||
beforeWaypointRender: (args: WaypointRenderEventArgs) => void;
|
||||
directionsError: (args: DirectionsErrorEventArgs) => void;
|
||||
directionsUpdated: (args: DirectionsEventArgs) => void;
|
||||
dragDropCompleted: () => void;
|
||||
itineraryStepClicked: (args: DirectionsStepEventArgs) => void;
|
||||
mouseEnterRouteSelector: (args: RouteSelectorEventArgs) => void;
|
||||
mouseEnterStep: (args: DirectionsStepEventArgs) => void;
|
||||
mouseLeaveRouteSelector: (args: RouteSelectorEventArgs) => void;
|
||||
mouseLeaveStep: (args: DirectionsStepEventArgs) => void;
|
||||
routeSelectorClicked: (args: RouteSelectorEventArgs) => void;
|
||||
waypointAdded: (args: WaypointEventArgs) => void;
|
||||
waypointRemoved: (args: WaypointEventArgs) => void;
|
||||
}
|
||||
|
||||
export interface DirectionsStepEventArgs {
|
||||
handled: boolean;
|
||||
location: Location;
|
||||
routeIndex: number;
|
||||
routeLegIndex: number;
|
||||
step: DirectionsStep;
|
||||
stepIndex: number;
|
||||
stepNumber: number;
|
||||
}
|
||||
|
||||
export interface DirectionsErrorEventArgs {
|
||||
responseCode: RouteResponseCode;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface DirectionsEventArgs {
|
||||
routeSummary: Array<RouteSummary>;
|
||||
route: Array<Route>;
|
||||
}
|
||||
|
||||
export interface DisambiguationRenderEventArgs {
|
||||
containerElement: HTMLElement;
|
||||
handled: boolean;
|
||||
waypoint: Waypoint;
|
||||
}
|
||||
|
||||
export interface DirectionsStepRenderEventArgs {
|
||||
containerElement: HTMLElement;
|
||||
handled: boolean;
|
||||
lastStep: boolean;
|
||||
routeIndex: number;
|
||||
routeLegIndex: number;
|
||||
step: DirectionsStep;
|
||||
stepIndex: number;
|
||||
}
|
||||
|
||||
export interface RouteSummaryRenderEventArgs {
|
||||
containerElement: HTMLElement;
|
||||
handled: boolean;
|
||||
routeLegIndex: number;
|
||||
summary: RouteSummary;
|
||||
}
|
||||
|
||||
export interface WaypointRenderEventArgs {
|
||||
containerElement: HTMLElement;
|
||||
handled: boolean;
|
||||
waypoint: Waypoint;
|
||||
}
|
||||
|
||||
export interface DirectionsStep {
|
||||
|
||||
childItineraryItems: Array<DirectionsStep>;
|
||||
coordinate: Location;
|
||||
distance: string;
|
||||
durationInSeconds: number;
|
||||
formattedText: string;
|
||||
iconType: IconType;
|
||||
isImageRoadShield: boolean;
|
||||
maneuver: Maneuver;
|
||||
maneuverImageName: string;
|
||||
monetaryCost: number;
|
||||
postIntersectionHints: Array<string>;
|
||||
preIntersectionHings: Array<string>;
|
||||
startStopName: string;
|
||||
transitLine: TransitLine;
|
||||
transitStepIcon: string;
|
||||
transitStopId: string;
|
||||
transitTerminus: string;
|
||||
warnings: Array<DirectionsStepWarning>;
|
||||
}
|
||||
|
||||
export enum IconType {
|
||||
none,
|
||||
other,
|
||||
auto,
|
||||
ferry,
|
||||
walk,
|
||||
bus,
|
||||
train,
|
||||
airline
|
||||
}
|
||||
|
||||
export enum Maneuver {
|
||||
none= 0,
|
||||
unknown= 1,
|
||||
departStart= 2,
|
||||
departIntermediateStop= 3,
|
||||
departIntermediateStopReturning= 4,
|
||||
arriveFinish= 5,
|
||||
arriveIntermediateStop= 6,
|
||||
turnLeft= 7,
|
||||
turnRight= 8,
|
||||
turnBack= 9,
|
||||
uTurn= 10,
|
||||
turnToStayLeft= 11,
|
||||
turnToStayRight= 12,
|
||||
bearLeft= 13,
|
||||
bearRight= 14,
|
||||
keepToStayLeft= 15,
|
||||
keepToStayRight= 16,
|
||||
keepToStayStraight= 17,
|
||||
keepLeft= 18,
|
||||
keepRight= 19,
|
||||
keepStraight= 20,
|
||||
take= 21,
|
||||
takeRampLeft= 22,
|
||||
takeRampRight= 23,
|
||||
takeRampStraight= 24,
|
||||
keepOnRampLeft= 25,
|
||||
keepOnRampRight= 26,
|
||||
keepOnRampStraight= 27,
|
||||
merge= 28,
|
||||
continueRoute= 29,
|
||||
roadNameChange= 30,
|
||||
enterRoundabout= 31,
|
||||
exitRoundabout= 32,
|
||||
turnRightThenTurnRight= 33,
|
||||
turnRightThenTurnLeft= 34,
|
||||
turnRightThenBearRight= 35,
|
||||
turnRightThenBearLeft= 36,
|
||||
turnLeftThenTurnLeft= 37,
|
||||
turnLeftThenTurnRight= 38,
|
||||
turnLeftThenBearLeft= 39,
|
||||
turnLeftThenBearRight= 40,
|
||||
bearRightThenTurnRight= 41,
|
||||
bearRightThenTurnLeft= 42,
|
||||
bearRightThenBearRight= 43,
|
||||
bearRightThenBearLeft= 44,
|
||||
bearLeftThenTurnLeft= 45,
|
||||
bearLeftThenTurnRight= 46,
|
||||
bearLeftThenBearRight= 47,
|
||||
bearLeftThenBearLeft= 48,
|
||||
rampThenHighwayRight= 49,
|
||||
rampThenHighwayLeft= 50,
|
||||
rampToHighwayStraight= 51,
|
||||
enterThenExitRoundabout= 52,
|
||||
bearThenMerge= 53,
|
||||
turnThenMerge= 54,
|
||||
bearThenKeep= 55,
|
||||
transfer= 56,
|
||||
wait = 57,
|
||||
takeTransit= 58,
|
||||
walk = 59,
|
||||
transitDepart = 60,
|
||||
transitArrive= 61,
|
||||
}
|
||||
|
||||
export interface TransitLine {
|
||||
abbreviatedName: string;
|
||||
agencyId: number;
|
||||
agencyName: string;
|
||||
agencyUrl: string;
|
||||
lineColor: Color;
|
||||
lineTextColor: Color;
|
||||
providerInfo: string;
|
||||
verboseName: string;
|
||||
}
|
||||
|
||||
export interface DirectionsStepWarning {
|
||||
style: StepWarningStyle;
|
||||
text: string;
|
||||
}
|
||||
|
||||
export enum StepWarningStyle {
|
||||
info= 0,
|
||||
minor= 1,
|
||||
moderate= 2,
|
||||
major= 3,
|
||||
ccZoneEnter= 4,
|
||||
ccZoneExit= 5
|
||||
}
|
||||
|
||||
export interface ResetDirectionsOptions {
|
||||
removeAllWaypoints?: boolean;
|
||||
resetRenderOptions?: boolean;
|
||||
resetRequestOptions?: boolean;
|
||||
}
|
||||
|
||||
export interface Route {
|
||||
routeLegs: Array<RouteLeg>;
|
||||
}
|
||||
|
||||
export interface RouteLeg {
|
||||
endTime: Date;
|
||||
endWaypointLocation: Location;
|
||||
itineraryItems: Array<DirectionsStep>;
|
||||
originalRouteIndex: number;
|
||||
startTime: Date;
|
||||
startWaypointLocation: Location;
|
||||
subLegs: Array<RouteSubLeg>;
|
||||
summary: RouteSummary;
|
||||
}
|
||||
|
||||
export interface RouteSubLeg {
|
||||
actualEnd: Location;
|
||||
actualStart: Location;
|
||||
endDescription: string;
|
||||
routePath: RoutePath;
|
||||
startDescription: string;
|
||||
summary: RouteSummary;
|
||||
}
|
||||
|
||||
export interface RoutePath {
|
||||
decodedLatitudes: Array<number>;
|
||||
decodedLongitudes: Array<number>;
|
||||
decodedRegions: Array<any>;
|
||||
}
|
||||
|
||||
export interface RouteSummary {
|
||||
distance: number;
|
||||
monetaryCost: number;
|
||||
northEast: Location;
|
||||
southWest: Location;
|
||||
time: number;
|
||||
timeWithTraffic: number;
|
||||
}
|
||||
|
||||
export enum RouteResponseCode {
|
||||
success= 0,
|
||||
unknownError= 1,
|
||||
cannotFindNearbyRoad= 2,
|
||||
tooFar= 3,
|
||||
noSolution= 4,
|
||||
dataSourceNotFound= 5,
|
||||
noAvailableTransitTrip= 7,
|
||||
transitStopsTooClose= 8,
|
||||
walkingBestAlternative= 9,
|
||||
outOfTransitBounds= 10,
|
||||
timeout= 11,
|
||||
waypointDisambiguation= 12,
|
||||
hasEmptyWaypoint= 13,
|
||||
exceedMaxWaypointLimit= 14,
|
||||
atleastTwoWaypointRequired= 15,
|
||||
firstOrLastStoppointsIsVia= 16,
|
||||
searchServiceFailed= 17,
|
||||
invalidCredentials= 18
|
||||
}
|
||||
|
||||
export interface RouteSelectorEventArgs {
|
||||
handled: boolean;
|
||||
routeIndex: number;
|
||||
}
|
||||
|
||||
export interface RouteSelectorRenderEventArgs {
|
||||
containerElement: HTMLElement;
|
||||
handled: boolean;
|
||||
routeIndex: number;
|
||||
routeLeg: RouteLeg;
|
||||
}
|
||||
|
||||
}
|
||||
Vendored
+152
@@ -0,0 +1,152 @@
|
||||
// Type definitions for Microsoft.Maps.Search 7.0
|
||||
// Project: http://msdn.microsoft.com/en-us/library/hh868061.aspx
|
||||
// Definitions by: Eric Todd <https://github.com/ericrtodd>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="Microsoft.Maps.d.ts"/>
|
||||
|
||||
declare module Microsoft.Maps.Search {
|
||||
|
||||
export interface Address {
|
||||
addressLine: string;
|
||||
adminDistrict: string;
|
||||
countryRegion: string;
|
||||
district: string;
|
||||
formattedAddress: string;
|
||||
locality: string;
|
||||
postalCode: string;
|
||||
postalTown:string;
|
||||
}
|
||||
|
||||
export interface GeocodeLocation {
|
||||
location: Location;
|
||||
name: string;
|
||||
precision:LocationPrecision;
|
||||
}
|
||||
|
||||
export interface GeocodeRequestOptions {
|
||||
bounds: LocationRect;
|
||||
callback: (result: GeocodeResult, userData: any) => any;
|
||||
count: number;
|
||||
errorCallback: (options: GeocodeRequestOptions) => any;
|
||||
timeout: number;
|
||||
userData: any;
|
||||
where:string;
|
||||
}
|
||||
|
||||
export interface GeocodeResult {
|
||||
parsedAddress: Address;
|
||||
parsedKeyword: string;
|
||||
parsedSeparator: string;
|
||||
results:Array<PlaceResult>;
|
||||
}
|
||||
|
||||
export enum LocationPrecision {
|
||||
interpolated,
|
||||
rooftop,
|
||||
}
|
||||
|
||||
export enum MatchCode {
|
||||
none,
|
||||
good,
|
||||
ambiguous,
|
||||
upHierarchy,
|
||||
modified,
|
||||
}
|
||||
|
||||
export enum MatchConfidence {
|
||||
high,
|
||||
medium,
|
||||
low,
|
||||
unknown,
|
||||
}
|
||||
|
||||
export interface PlaceResult {
|
||||
bestView: LocationRect;
|
||||
location: GeocodeLocation;
|
||||
locations: Array<GeocodeLocation>;
|
||||
matchCode: MatchCode;
|
||||
matchConfidence: MatchConfidence;
|
||||
name:string;
|
||||
}
|
||||
|
||||
export interface ReverseGeocodeRequestOptions {
|
||||
callback: (result: PlaceResult, userData: any) => any;
|
||||
errorCallback: (options: ReverseGeocodeRequestOptions) => any;
|
||||
location: Location;
|
||||
timeout: number;
|
||||
userData:any;
|
||||
}
|
||||
|
||||
export class SearchManager {
|
||||
|
||||
constructor(map: Map);
|
||||
|
||||
geocode(request: GeocodeRequestOptions): void;
|
||||
reverseGeocode(request: ReverseGeocodeRequestOptions): void;
|
||||
search(request:SearchRequestOptions):void;
|
||||
}
|
||||
|
||||
export interface SearchParseResult {
|
||||
keyword: string;
|
||||
location: GeocodeLocation;
|
||||
matchConfidence:MatchConfidence;
|
||||
}
|
||||
|
||||
export interface SearchRegion {
|
||||
address: Address;
|
||||
geocodeLocations: Array<GeocodeLocation>;
|
||||
explicitLocation: GeocodeLocation;
|
||||
mapBounds: LocationRect;
|
||||
matchCode: MatchCode;
|
||||
matchConfidence: MatchConfidence;
|
||||
source:string;
|
||||
}
|
||||
|
||||
export interface SearchRequestOptions {
|
||||
callback:(result: SearchResponse, userData: any)=>any;
|
||||
count: number;
|
||||
errorCallback:(options: SearchRequestOptions)=>any;
|
||||
query: string;
|
||||
startIndex: number;
|
||||
timeout: number;
|
||||
entityType: string;
|
||||
userData: any;
|
||||
what: string;
|
||||
where:string;
|
||||
}
|
||||
|
||||
export interface SearchResponse {
|
||||
alternateSearchRegions: Array<SearchRegion>;
|
||||
hasMore: boolean;
|
||||
parseResults: Array<SearchParseResult>;
|
||||
responseSummary: SearchResponseSummary;
|
||||
searchRegion: SearchRegion;
|
||||
searchResults:Array<SearchResult>;
|
||||
}
|
||||
|
||||
export interface SearchResponseSummary {
|
||||
authResultCode: number;
|
||||
copyright: string;
|
||||
errorMessage: string;
|
||||
statusCode: number;
|
||||
traceId:number;
|
||||
}
|
||||
|
||||
export interface SearchResult {
|
||||
address: Address;
|
||||
city: string;
|
||||
country: string;
|
||||
entityType: string;
|
||||
hoursOfOperation: string;
|
||||
id: number;
|
||||
location: Location;
|
||||
name: string;
|
||||
phone: string;
|
||||
postalCode: string;
|
||||
reviewCount: number;
|
||||
userRating: number;
|
||||
website:string;
|
||||
}
|
||||
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// Type definitions for Microsoft.Maps.Themes 7.0
|
||||
// Project: http://msdn.microsoft.com/en-us/library/hh868061.aspx
|
||||
// Definitions by: Eric Todd <https://github.com/ericrtodd>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module Microsoft.Maps.Themes {
|
||||
|
||||
export class BingTheme {
|
||||
constructor();
|
||||
}
|
||||
|
||||
}
|
||||
Vendored
+24
@@ -0,0 +1,24 @@
|
||||
// Type definitions for Microsoft.Maps.Traffic 7.0
|
||||
// Project: http://msdn.microsoft.com/en-us/library/hh312840.aspx
|
||||
// Definitions by: Eric Todd <https://github.com/ericrtodd>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="Microsoft.Maps.d.ts"/>
|
||||
|
||||
declare module Microsoft.Maps.Traffic {
|
||||
|
||||
export class TrafficManager {
|
||||
|
||||
constructor(map: Map);
|
||||
|
||||
hide(): void;
|
||||
hideFlow(): void;
|
||||
hideIncidents(): void;
|
||||
hideLegend(): void;
|
||||
show(): void;
|
||||
showFlow(): void;
|
||||
showIncidents(): void;
|
||||
showLegend():void;
|
||||
}
|
||||
|
||||
}
|
||||
+141
@@ -0,0 +1,141 @@
|
||||
// Type definitions for Microsoft.Maps.VenueMaps 7.0
|
||||
// Project: http://msdn.microsoft.com/en-us/library/hh312797.aspx
|
||||
// Definitions by: Eric Todd <https://github.com/ericrtodd>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="Microsoft.Maps.d.ts"/>
|
||||
|
||||
declare module Microsoft.Maps.VenueMaps {
|
||||
|
||||
export interface MouseResponse {
|
||||
eventArgs: MouseEventArgs;
|
||||
}
|
||||
|
||||
export interface Directory {
|
||||
|
||||
addToDOM(div: HTMLElement, sortOrder: DirectorySortOrder, to_group_or_not: DirectoryGrouping): void;
|
||||
createUIElements(): void;
|
||||
handleMouseClick(response: MouseResponse): void;
|
||||
handleMouseOut(response: MouseResponse): void;
|
||||
handleMouseOver(response: MouseResponse): void;
|
||||
isInDOM(): boolean;
|
||||
removeFromDOM(): void;
|
||||
setHeight(height: number): void;
|
||||
|
||||
click: (eventArgs: MouseEventArgs) => any;
|
||||
mouseOut: (eventArgs: MouseEventArgs) => any;
|
||||
mouseOver: (eventArgs: MouseEventArgs) => any;
|
||||
}
|
||||
|
||||
export enum DirectoryGrouping {
|
||||
byCategory,
|
||||
none,
|
||||
}
|
||||
|
||||
export enum DirectorySortOrder {
|
||||
alphabetical,
|
||||
byFloor,
|
||||
}
|
||||
|
||||
export interface Floor {
|
||||
name: string;
|
||||
primitives: Array<Primitive>;
|
||||
zoomRange: Array<number>;
|
||||
}
|
||||
|
||||
export interface Footprint {
|
||||
polygons: Array<Polygon>;
|
||||
zoomRange: Array<number>;
|
||||
}
|
||||
|
||||
export interface Metadata {
|
||||
CenterLatitude: number;
|
||||
CenterLongitude: number;
|
||||
DefaultFloor: string;
|
||||
FloorHeader: string;
|
||||
Floors: Array<Floor>;
|
||||
Footprint: Footprint;
|
||||
MapId: string;
|
||||
MapType: string;
|
||||
Name: string;
|
||||
YpId: string;
|
||||
}
|
||||
|
||||
export interface NearbyVenue {
|
||||
distance: number;
|
||||
metadata: Metadata;
|
||||
}
|
||||
|
||||
export interface NearbyVenueOptions {
|
||||
callback: (maps: Array<VenueMap>) => any;
|
||||
location: Location;
|
||||
map: Map;
|
||||
radius: number;
|
||||
}
|
||||
|
||||
export interface Polygon {
|
||||
bounds: LocationRect;
|
||||
center: Location;
|
||||
locations: Array<Location>;
|
||||
}
|
||||
|
||||
export interface Primitive {
|
||||
|
||||
bounds: LocationRect;
|
||||
businessId: string;
|
||||
categoryId: string;
|
||||
categoryName: string;
|
||||
center: Location;
|
||||
floor: Floor;
|
||||
id: string;
|
||||
locations: Array<Location>;
|
||||
name: string;
|
||||
|
||||
highlight(): void;
|
||||
unhighlight(): void;
|
||||
}
|
||||
|
||||
export interface VenueMap {
|
||||
|
||||
address: string;
|
||||
bestMapView: ViewOptions;
|
||||
businessId: string;
|
||||
center: Location;
|
||||
defaultFloor: string;
|
||||
directory: Directory;
|
||||
floorHeader: string;
|
||||
floors: Array<Floor>;
|
||||
footprint: Footprint;
|
||||
id: string;
|
||||
name: string;
|
||||
phoneNumber: string;
|
||||
type: string;
|
||||
|
||||
dispose(): void;
|
||||
getActiveFloor(): string;
|
||||
hide(): void;
|
||||
setActiveFloor(floor: string): void;
|
||||
show(): void;
|
||||
|
||||
click: (eventArgs: Primitive) => any;
|
||||
close: () => any;
|
||||
footprintclick: (eventArgs: Primitive) => any;
|
||||
mouseout: (eventArgs: Primitive) => any;
|
||||
mouseover: (eventArgs: Primitive) => any;
|
||||
}
|
||||
|
||||
export interface VenueMapCreationOptions {
|
||||
error: (errorCode: number, args: any) => any;
|
||||
success: (venueMap: VenueMap, args: any) => any;
|
||||
venueMapId: string;
|
||||
}
|
||||
|
||||
export class VenueMapFactory {
|
||||
|
||||
constructor(map: Map);
|
||||
|
||||
create(options: VenueMapCreationOptions): void;
|
||||
getNearbyVenues(options: NearbyVenueOptions): void;
|
||||
}
|
||||
|
||||
}
|
||||
Vendored
+573
@@ -0,0 +1,573 @@
|
||||
// Type definitions for Microsoft.Maps 7.0
|
||||
// Project: http://msdn.microsoft.com/en-us/library/gg427611.aspx
|
||||
// Definitions by: Eric Todd <https://github.com/ericrtodd>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module Microsoft.Maps {
|
||||
|
||||
export enum AltitudeReference {
|
||||
ground,
|
||||
ellipsoid
|
||||
}
|
||||
|
||||
export class Location {
|
||||
|
||||
constructor(latitude: number, longitude: number, altitude?: number, altitudeReference?: AltitudeReference);
|
||||
|
||||
altitude: number;
|
||||
altitudeReference: AltitudeReference;
|
||||
latitude: number;
|
||||
longitude: number;
|
||||
|
||||
static areEqual(location1: Location, location2: Location): boolean;
|
||||
static normalizeLongitude(longitude: number): number;
|
||||
|
||||
clone(): Location;
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
export class LocationRect {
|
||||
|
||||
constructor(center: Location, width: number, height: number);
|
||||
|
||||
center: Location;
|
||||
height: number;
|
||||
width: number;
|
||||
|
||||
static fromCorners(northwest: Location, southeast: Location): LocationRect;
|
||||
static fromEdges(north: number, west: number, south: number, east: number, altitude: number, altitudeReference: AltitudeReference): LocationRect;
|
||||
static fromLocations(locations: Array<Location>): LocationRect;
|
||||
static fromString(value: string): LocationRect;
|
||||
|
||||
clone(): LocationRect;
|
||||
contains(location: Location): boolean;
|
||||
getEast(): number;
|
||||
getNorth(): number;
|
||||
getNorthwest(): Location;
|
||||
getSouth(): number;
|
||||
getSouthEast(): Location;
|
||||
getWest(): number;
|
||||
intersects(rect: LocationRect): boolean;
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
export class Point {
|
||||
|
||||
constructor(x: number, y: number);
|
||||
|
||||
x: number;
|
||||
y: number;
|
||||
|
||||
static areEqual(p1: Point, p2: Point): boolean;
|
||||
static clone(p: Point): Point;
|
||||
|
||||
clone(): Point;
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
export class Events {
|
||||
|
||||
static addHandler(target: any, eventName: string, handler: () => void): any;
|
||||
static addThrottledHandler(target: any, eventName: string, handler: () => void, throttleInterval: number): any;
|
||||
static hasHandler(target: any, eventName: string): boolean;
|
||||
static invoke(target: any, eventName: string, args: any): void;
|
||||
static removeHandler(handlerId: any): void;
|
||||
}
|
||||
|
||||
export interface KeyEventArgs {
|
||||
altKey: boolean;
|
||||
ctrlKey: boolean;
|
||||
eventName: boolean;
|
||||
handled: boolean;
|
||||
keyCode: string;
|
||||
originalEvent: any;
|
||||
shiftKey: boolean;
|
||||
}
|
||||
|
||||
export enum LabelOverlay {
|
||||
hidden,
|
||||
visible
|
||||
}
|
||||
|
||||
export interface ZoomRange {
|
||||
min: number;
|
||||
max: number;
|
||||
}
|
||||
|
||||
export class Map {
|
||||
|
||||
constructor(containerElement: HTMLElement, options: MapOptions);
|
||||
|
||||
entities: EntityCollection;
|
||||
|
||||
static getVersion(): string;
|
||||
|
||||
blur(): void;
|
||||
dispose(): void;
|
||||
focus(): void;
|
||||
getBounds(): LocationRect;
|
||||
getCenter(): Location;
|
||||
getCopyrights(callback: (copyrights: Array<string>) => void): void;
|
||||
getCredentials(callback: (credentials: Array<string>) => void): void;
|
||||
getHeading(): string;
|
||||
getHeight(): number;
|
||||
getImageryId: string;
|
||||
getMapTypeId(): string;
|
||||
getMetersPerPixel(): number;
|
||||
getMode(): MapMode;
|
||||
getModeLayer(): HTMLElement;
|
||||
getOptions(): MapOptions;
|
||||
getPageX(): number;
|
||||
getPageY(): number;
|
||||
getRootElement(): HTMLElement;
|
||||
getTargetBounds(): LocationRect;
|
||||
getTargetCenter(): Location;
|
||||
getTargetHeading(): number;
|
||||
getTargetMetersPerPixel(): number;
|
||||
getTargetZoom(): number;
|
||||
getUserLayer(): HTMLElement;
|
||||
getViewportX(): number;
|
||||
getViewportY(): number;
|
||||
getWidth(): number;
|
||||
getZoom(): number;
|
||||
getZoomRange(): ZoomRange;
|
||||
isDownloadingTiles(): boolean;
|
||||
isMercator(): boolean;
|
||||
isRotationEnabled(): boolean;
|
||||
setMapType(mapTypeId: MapTypeId): void;
|
||||
setOptions(options: MapOptions): void;
|
||||
setView(options: ViewOptions): void;
|
||||
tryLocationToPixel(locations: Array<Location>, reference?: PixelReference): any;
|
||||
tryPixelToLocation(points: Array<Point>, reference?: PixelReference): any;
|
||||
|
||||
click: (eventArgs: MouseEventArgs) => void;
|
||||
copyrightchanged: () => void;
|
||||
dblclick: (eventArgs: MouseEventArgs) => void;
|
||||
imagerychanged: () => void;
|
||||
keydown: (eventArgs: KeyEventArgs) => void;
|
||||
keypress: (eventArgs: KeyEventArgs) => void;
|
||||
keyup: (eventArgs: KeyEventArgs) => void;
|
||||
maptypechanged: () => void;
|
||||
mousedown: (eventArgs: MouseEventArgs) => void;
|
||||
mousemove: (eventArgs: MouseEventArgs) => void;
|
||||
mouseout: (eventArgs: MouseEventArgs) => void;
|
||||
mouseover: (eventArgs: MouseEventArgs) => void;
|
||||
mouseup: (eventArgs: MouseEventArgs) => void;
|
||||
mousewheel: (eventArgs: MouseEventArgs) => void;
|
||||
rightlick: (eventArgs: MouseEventArgs) => void;
|
||||
targetviewchanged: () => void;
|
||||
tiledownloadcomplete: () => void;
|
||||
viewchange: () => void;
|
||||
viewchangeend: () => void;
|
||||
viewchangestart: () => void;
|
||||
}
|
||||
|
||||
export class MapMode {
|
||||
|
||||
getDrawShapesInSingleLayer(): boolean;
|
||||
getShouldClipPolygons(): boolean;
|
||||
setOptions(options: MapOptions): void;
|
||||
setViewChangeEndDelay(delay: number): void;
|
||||
}
|
||||
|
||||
export interface MapOptions {
|
||||
|
||||
backgroundColor?: Color;
|
||||
credentials?: string;
|
||||
customizeOverlays?: boolean;
|
||||
disableBirdseye?: boolean;
|
||||
disableKeyboardInput?: boolean;
|
||||
disableMouseInput?: boolean;
|
||||
disablePanning?: boolean;
|
||||
disableTouchInput?: boolean;
|
||||
disableUserInput?: boolean;
|
||||
disableZooming?: boolean;
|
||||
enableClickableLogo?: boolean;
|
||||
enableSearchLogo?: boolean;
|
||||
fixedMapPosition?: boolean;
|
||||
height?: number;
|
||||
inertiaIntensity?: number;
|
||||
showBreadcrumb?: boolean;
|
||||
showCopyright?: boolean;
|
||||
showDashboard?: boolean;
|
||||
showMapTypeSelector?: boolean;
|
||||
showScalebar?: boolean;
|
||||
theme?: any;
|
||||
tileBuffer?: number;
|
||||
useInertia?: boolean;
|
||||
width?: number;
|
||||
center?: Location;
|
||||
zoom?: number;
|
||||
mapTypeId?: MapTypeId;
|
||||
}
|
||||
|
||||
export enum MapTypeId {
|
||||
aerial,
|
||||
auto,
|
||||
birdseye,
|
||||
collinsBart,
|
||||
mercator,
|
||||
ordnanceSurvey,
|
||||
road
|
||||
}
|
||||
|
||||
export class MouseEventArgs {
|
||||
|
||||
eventName: string;
|
||||
handled: boolean;
|
||||
isPrimary: boolean;
|
||||
isSecondary: boolean;
|
||||
isTouchEvent: boolean;
|
||||
originalEvent: any;
|
||||
pageX: number;
|
||||
pageY: number;
|
||||
target: any;
|
||||
targetType: string;
|
||||
wheelDelta: number;
|
||||
|
||||
getX(): number;
|
||||
getY(): number;
|
||||
}
|
||||
|
||||
export enum PixelReference {
|
||||
control,
|
||||
page,
|
||||
viewport
|
||||
}
|
||||
|
||||
export interface ViewOptions {
|
||||
|
||||
animate?: boolean;
|
||||
bounds?: LocationRect;
|
||||
center?: Location;
|
||||
centerOffset?: Point;
|
||||
heading?: number;
|
||||
labelOverlay?: LabelOverlay;
|
||||
mapTypeId?: string;
|
||||
padding?: number;
|
||||
zoom?: number;
|
||||
}
|
||||
|
||||
export class Color {
|
||||
|
||||
constructor(alpha: number, red: number, green: number, blue: number);
|
||||
|
||||
a: number;
|
||||
r: number;
|
||||
g: number;
|
||||
b: number;
|
||||
|
||||
static clone(color: Color): Color;
|
||||
static fromHex(hex: string): Color;
|
||||
|
||||
clone(): Color;
|
||||
getOpacity(): number;
|
||||
toHex(): string;
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
export interface EntityChangeArgs {
|
||||
collection: EntityCollection;
|
||||
entity: Entity;
|
||||
}
|
||||
|
||||
export interface EntityCollectionOptions {
|
||||
bubble: boolean;
|
||||
visible: boolean;
|
||||
zIndex: number;
|
||||
}
|
||||
|
||||
export class EntityCollection {
|
||||
|
||||
constructor(options: EntityCollectionOptions);
|
||||
|
||||
clear(): void;
|
||||
get(index: number): Entity;
|
||||
getLength(): number;
|
||||
getVisible(): boolean;
|
||||
getZIndex(): number;
|
||||
indexOf(entity: Entity): number;
|
||||
insert(entity: Entity, index: number): void;
|
||||
pop(): Entity;
|
||||
push(entity: Entity): void;
|
||||
remove(entity: Entity): Entity;
|
||||
removeAt(index: number): Entity;
|
||||
setOptions(options: EntityCollectionOptions): void;
|
||||
toString(): string;
|
||||
|
||||
entityAdded: (args: EntityChangeArgs) => any;
|
||||
entityChanged: (args: EntityChangeArgs) => any;
|
||||
entityRemoved: (args: EntityChangeArgs) => any;
|
||||
}
|
||||
|
||||
export class Infobox {
|
||||
|
||||
constructor(location: Location, options?: InfoboxOptions);
|
||||
|
||||
getActions(): any;
|
||||
getAnchor(): Point;
|
||||
getDescription(): string;
|
||||
getHeight(): number;
|
||||
getHtmlContent(): string;
|
||||
getId(): string;
|
||||
getLocation(): Location;
|
||||
getOffset(): Point;
|
||||
getOptions(): InfoboxOptions;
|
||||
getShowCloseButton(): boolean;
|
||||
getShowPointer(): boolean;
|
||||
getTitle(): string;
|
||||
getTitleAction(): any;
|
||||
getTitleClickHandler(): () => void;
|
||||
getVisible(): boolean;
|
||||
getWidth(): number;
|
||||
getZIndex(): number;
|
||||
setHtmlContent(content: string): void;
|
||||
setLocation(location: Location): void;
|
||||
setOptions(options: InfoboxOptions): void;
|
||||
toString(): string;
|
||||
|
||||
click: (eventArgs: MouseEventArgs) => void;
|
||||
entitychanged: (entity: Entity) => void;
|
||||
mouseenter: (eventArgs: MouseEventArgs) => void;
|
||||
mouseleave: (eventArgs: MouseEventArgs) => void;
|
||||
}
|
||||
|
||||
export interface Action {
|
||||
label?: string;
|
||||
icon?: string;
|
||||
eventHandler: (args?: any) => void;
|
||||
}
|
||||
|
||||
export interface InfoboxOptions {
|
||||
|
||||
actions?: Array<Action>;
|
||||
description?: string;
|
||||
htmlContent?: string;
|
||||
id?: string;
|
||||
location?: Location;
|
||||
offset?: Point;
|
||||
showCloseButton?: boolean;
|
||||
showPointer?: boolean;
|
||||
pushpin?: Pushpin;
|
||||
title?: string;
|
||||
titleAction?: { label?: string; eventHandler: () => void; };
|
||||
titleClickHandler?: () => void;
|
||||
typeName?: InfoboxType;
|
||||
visible?: boolean;
|
||||
width?: number;
|
||||
height?: number;
|
||||
}
|
||||
|
||||
export enum InfoboxType {
|
||||
mini,
|
||||
standard
|
||||
}
|
||||
|
||||
export interface Entity {
|
||||
}
|
||||
|
||||
export class Polyline implements Entity {
|
||||
|
||||
constructor(locations: Array<Location>, options?: PolylineOptions);
|
||||
|
||||
getLocations(): Array<Location>;
|
||||
getStrokeColor(): Color;
|
||||
getStrokeDashArray(): string;
|
||||
getStrokeThickness(): number;
|
||||
getVisible(): boolean;
|
||||
setLocations(locations: Array<Location>): void;
|
||||
setOptions(options: PolylineOptions): void;
|
||||
toString(): string;
|
||||
|
||||
click: (eventArgs: MouseEventArgs) => void;
|
||||
dblclick: (eventArgs: MouseEventArgs) => void;
|
||||
entitychanged: (entity: Entity) => void;
|
||||
mousedown: (eventArgs: MouseEventArgs) => void;
|
||||
mouseout: (eventArgs: MouseEventArgs) => void;
|
||||
mouseover: (eventArgs: MouseEventArgs) => void;
|
||||
mouseup: (eventArgs: MouseEventArgs) => void;
|
||||
rightclick: (eventArgs: MouseEventArgs) => void;
|
||||
}
|
||||
|
||||
export interface PolylineOptions {
|
||||
|
||||
strokeColor: Color;
|
||||
strokeDashArray: string;
|
||||
strokeThickness: number;
|
||||
visible: boolean;
|
||||
}
|
||||
|
||||
export class Polygon implements Entity {
|
||||
|
||||
constructor(locations: Array<Location>, options?: PolygonOptions);
|
||||
|
||||
getFillColor(): Color;
|
||||
getLocations(): Array<Location>;
|
||||
getStrokeColor(): Color;
|
||||
getStrokeDashArray(): string;
|
||||
getStrokeThickness(): number;
|
||||
getVisible(): boolean;
|
||||
setLocations(locations: Location[]): void;
|
||||
setOptions(options: PolylineOptions): void;
|
||||
toString(): string;
|
||||
|
||||
click: (eventArgs: MouseEventArgs) => void;
|
||||
dbclick: (eventArgs: MouseEventArgs) => void;
|
||||
entitychanged: (entity: Entity) => void;
|
||||
mousedown: (eventArgs: MouseEventArgs) => void;
|
||||
mouseout: (eventArgs: MouseEventArgs) => void;
|
||||
mouseover: (eventArgs: MouseEventArgs) => void;
|
||||
mouseup: (eventArgs: MouseEventArgs) => void;
|
||||
rightclick: (eventArgs: MouseEventArgs) => void;
|
||||
}
|
||||
|
||||
export interface PolygonOptions {
|
||||
|
||||
strokeColor: Color;
|
||||
strokeDashArray: string;
|
||||
strokeThickness: number;
|
||||
visible: boolean;
|
||||
}
|
||||
|
||||
export class Pushpin implements Entity {
|
||||
|
||||
constructor(location: Location, options?: PushpinOptions);
|
||||
|
||||
getAnchor(): Point;
|
||||
getIcon(): string;
|
||||
getHeight(): number;
|
||||
getLocation(): Location;
|
||||
getText(): string;
|
||||
getTextOffset(): Point;
|
||||
getTypeName(): string;
|
||||
getVisible(): boolean;
|
||||
getWidth(): number;
|
||||
getZIndex(): number;
|
||||
setLocation(location: Location): void;
|
||||
setOptions(options: PushpinOptions): void;
|
||||
toString(): string;
|
||||
|
||||
click: (eventArgs: MouseEventArgs) => void;
|
||||
dblclick: (eventArgs: MouseEventArgs) => void;
|
||||
drag: (object: Pushpin) => any;
|
||||
dragend: (eventArgs: MouseEventArgs) => void;
|
||||
dragstart: (eventArgs: MouseEventArgs) => void;
|
||||
entitychanged: (object: { entity: Entity; }) => any;
|
||||
mousedown: (eventArgs: MouseEventArgs) => void;
|
||||
mouseout: (eventArgs: MouseEventArgs) => void;
|
||||
mouseover: (eventArgs: MouseEventArgs) => void;
|
||||
mouseup: (eventArgs: MouseEventArgs) => void;
|
||||
rightclick: (eventArgs: MouseEventArgs) => void;
|
||||
}
|
||||
|
||||
export enum EntityState {
|
||||
highlighted,
|
||||
none,
|
||||
selected
|
||||
}
|
||||
|
||||
export interface PushpinOptions {
|
||||
|
||||
anchor?: Point;
|
||||
draggable?: boolean;
|
||||
height?: number;
|
||||
htmlContent?: string;
|
||||
icon?: string;
|
||||
infobox?: Infobox;
|
||||
state?: EntityState;
|
||||
text?: string;
|
||||
textOffset?: Point;
|
||||
typeName?: string;
|
||||
visible?: boolean;
|
||||
width?: number;
|
||||
zIndex?: number;
|
||||
}
|
||||
|
||||
export class TileLayer implements Entity {
|
||||
|
||||
constructor(options: TileLayerOptions);
|
||||
|
||||
getOpacty(): number;
|
||||
getTileSource(projection: string): TileSource;
|
||||
getZIndex(): number;
|
||||
setOptions(options: TileLayerOptions): void;
|
||||
toString(): string;
|
||||
|
||||
tiledownloadcomplete: () => void;
|
||||
}
|
||||
|
||||
export class TileSource {
|
||||
|
||||
constructor(options: TileSourceOptions);
|
||||
|
||||
getHeight(): number;
|
||||
getUriConstructor(): string;
|
||||
getWidth(): string;
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
export interface TileSourceOptions {
|
||||
|
||||
height?: number;
|
||||
uriConstructor: string;
|
||||
width?: number;
|
||||
}
|
||||
|
||||
|
||||
export interface TileLayerOptions {
|
||||
|
||||
animationDisplay?: AnimationVisibility;
|
||||
downloadTimeout?: number;
|
||||
mercator?: TileSource;
|
||||
opacity?: number;
|
||||
visible?: boolean;
|
||||
zIndex?: number;
|
||||
}
|
||||
|
||||
export enum AnimationVisibility {
|
||||
auto,
|
||||
hide,
|
||||
show
|
||||
}
|
||||
|
||||
export class Coordinates {
|
||||
|
||||
accuracy: number;
|
||||
altitude: number;
|
||||
altitudeAccuracy: number;
|
||||
heading: number;
|
||||
latitude: number;
|
||||
longitude: number;
|
||||
}
|
||||
|
||||
export class GeoLocationProvider {
|
||||
|
||||
constructor(map: Map);
|
||||
|
||||
addAccuracyCircle(center: Location, radiusInMeters: number, segments: number, options: PositionCircleOptions): void;
|
||||
cancelCurrentRequest(): void;
|
||||
getCurrentPosition(options?: PositionOptions): void;
|
||||
removeAccuracyCircle(): void;
|
||||
}
|
||||
|
||||
export interface PositionCircleOptions {
|
||||
polygonOptions: PolygonOptions;
|
||||
showOnMap: boolean;
|
||||
}
|
||||
|
||||
export class PositionError {
|
||||
errorCode: number;
|
||||
internalError: string;
|
||||
}
|
||||
|
||||
export interface ModuleOptions {
|
||||
callback?: () => void;
|
||||
styleURLS?: Array<string>;
|
||||
culture?: string;
|
||||
homeRegion?: string;
|
||||
}
|
||||
|
||||
export function loadModule(moduleKey: string, options: ModuleOptions): void;
|
||||
export function moduleLoaded(moduleKey: string): void;
|
||||
export function registerModule(moduleKey: string, scriptUrl: string, options?: ModuleOptions): void;
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
/// <reference path="Microsoft.Maps.d.ts"/>
|
||||
/// <reference path="Microsoft.Maps.AdvancedShapes.d.ts"/>
|
||||
/// <reference path="Microsoft.Maps.Directions.d.ts"/>
|
||||
/// <reference path="Microsoft.Maps.Search.d.ts"/>
|
||||
/// <reference path="Microsoft.Maps.Themes.BingTheme.d.ts"/>
|
||||
/// <reference path="Microsoft.Maps.Traffic.d.ts"/>
|
||||
/// <reference path="Microsoft.Maps.VenueMaps.d.ts"/>
|
||||
|
||||
module BingMapsTests {
|
||||
|
||||
// An interactive set of Bing Maps AJAX control usages can be found at http://www.bingmapsportal.com/isdk/ajaxv7
|
||||
// A full API description can be found at http://msdn.microsoft.com/en-us/library/gg427610.aspx
|
||||
export class TestFixture {
|
||||
|
||||
public createMap(
|
||||
// This key can be acquired at http://www.microsoft.com/maps/create-a-bing-maps-key.aspx
|
||||
bingMapsApiKey: string,
|
||||
// This is the HTML container that the map will be drawn inside of
|
||||
target: HTMLElement,
|
||||
// These positions will be placed as pushpins onto the map
|
||||
mapPositions: Array<Position>,
|
||||
// This will fire if the geolocation fails and will pass the original target (parameter 2)
|
||||
onFailure: (element: HTMLElement) => any) {
|
||||
|
||||
var self = this;
|
||||
var map: Microsoft.Maps.Map;
|
||||
|
||||
navigator.geolocation.getCurrentPosition((position: Position) => {
|
||||
|
||||
var locations: Array<Microsoft.Maps.Location> = new Array<Microsoft.Maps.Location>();
|
||||
var options: Microsoft.Maps.MapOptions;
|
||||
|
||||
function loadMap() {
|
||||
options = {};
|
||||
options.credentials = bingMapsApiKey;
|
||||
options.enableClickableLogo = false;
|
||||
options.enableSearchLogo = false;
|
||||
options.showDashboard = false;
|
||||
options.showScalebar = false;
|
||||
options.center = self.toLocation(position);
|
||||
options.zoom = 16;
|
||||
options.mapTypeId = Microsoft.Maps.MapTypeId.road;
|
||||
options.height = target.clientHeight;
|
||||
options.width = target.clientWidth;
|
||||
|
||||
target.innerHTML = "";
|
||||
|
||||
map = new Microsoft.Maps.Map(target, options);
|
||||
|
||||
for (var i = 0; i < mapPositions.length; ++i) {
|
||||
|
||||
var mapPosition: Position = mapPositions[i];
|
||||
var location: Microsoft.Maps.Location = self.createPushpin(map, mapPosition);
|
||||
|
||||
locations.push(location);
|
||||
}
|
||||
|
||||
// Sets the view of the map to the smallest size that contains all of the
|
||||
// specified locations (in this case the pusphin locations)
|
||||
map.setView({ bounds: Microsoft.Maps.LocationRect.fromLocations(locations) });
|
||||
}
|
||||
|
||||
if ((<any>window).Windows != undefined) {
|
||||
// Running in Win8 app
|
||||
Microsoft.Maps.loadModule("Microsoft.Maps.Map", { callback: loadMap });
|
||||
} else {
|
||||
// Running anywhere else
|
||||
loadMap();
|
||||
}
|
||||
}, () => onFailure(target), { maximumAge: 3000, timeout: 5000, enableHighAccuracy: true });
|
||||
|
||||
}
|
||||
|
||||
// Converts a standard HTML geolocation Position to a Location
|
||||
private toLocation(position: Position): Microsoft.Maps.Location {
|
||||
return new Microsoft.Maps.Location(position.coords.latitude, position.coords.longitude);
|
||||
}
|
||||
|
||||
// Creates a pushpin on a specified map and returns the Location for potentially setting the map view
|
||||
private createPushpin(map: Microsoft.Maps.Map, position: Position): Microsoft.Maps.Location {
|
||||
|
||||
var location: Microsoft.Maps.Location;
|
||||
var pushpin: Microsoft.Maps.Pushpin;
|
||||
|
||||
location = this.toLocation(position);
|
||||
pushpin = new Microsoft.Maps.Pushpin(location, null);
|
||||
|
||||
map.entities.push(pushpin);
|
||||
|
||||
return location;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
/// <reference path="boom.d.ts" />
|
||||
|
||||
import Boom = require('boom');
|
||||
|
||||
Boom.create(500, 'Internal server error', { timestamp: Date.now() });
|
||||
Boom.wrap(new Error('test'), 400);
|
||||
Boom.badRequest('Invalid cookies');
|
||||
Vendored
+32
@@ -0,0 +1,32 @@
|
||||
// Type definitions for boom
|
||||
// Project: http://github.com/hapijs/boom
|
||||
// Definitions by: Igor Rogatty <http://github.com/rogatty>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
|
||||
declare module Boom {
|
||||
interface BoomError {
|
||||
data: any;
|
||||
reformat: () => void;
|
||||
isBoom: boolean;
|
||||
isServer: boolean;
|
||||
message: string;
|
||||
output: Output;
|
||||
}
|
||||
|
||||
export interface Output {
|
||||
statusCode: number;
|
||||
headers: any;
|
||||
payload: any;
|
||||
}
|
||||
|
||||
export function wrap(error: Error, statusCode?: number, message?: string): BoomError;
|
||||
export function create(statusCode: number, message?: string, data?: any): BoomError;
|
||||
|
||||
export function badRequest(message?: string, data?: any): BoomError;
|
||||
}
|
||||
|
||||
declare module "boom" {
|
||||
export = Boom;
|
||||
}
|
||||
Vendored
+3
-3
@@ -26,8 +26,8 @@ interface BootboxButton {
|
||||
}
|
||||
|
||||
interface BootboxDialogOptions {
|
||||
message: any; // String | Element
|
||||
title?: any; // String | Element
|
||||
message: string | Element;
|
||||
title?: string | Element;
|
||||
callback?: (result: boolean) => any;
|
||||
show?: boolean;
|
||||
onEscape?: () => any;
|
||||
@@ -60,4 +60,4 @@ interface BootboxStatic {
|
||||
hideAll(): void;
|
||||
}
|
||||
|
||||
declare var bootbox: BootboxStatic;
|
||||
declare var bootbox: BootboxStatic;
|
||||
|
||||
+79
-84
@@ -1,8 +1,3 @@
|
||||
// Type definitions for Breeze 1.4.1
|
||||
// Project: http://www.breezejs.com/
|
||||
// Definitions by: IdeaBlade <https://github.com/IdeaBlade/Breeze/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="breeze.d.ts" />
|
||||
|
||||
import core = breeze.core;
|
||||
@@ -50,9 +45,9 @@ function test_entityAspect() {
|
||||
var orderDateErrors = order.entityAspect.getValidationErrors("OrderDate");
|
||||
var orderDateProperty = order.entityType.getProperty("OrderDate");
|
||||
var orderDateErrors = order.entityAspect.getValidationErrors(orderDateProperty);
|
||||
order.entityAspect.loadNavigationProperty("Orders").then(function (data) {
|
||||
order.entityAspect.loadNavigationProperty("Orders").then(function (data: breeze.QueryResult) {
|
||||
var orders = data.results;
|
||||
}).fail(function (exception) { });
|
||||
}).catch(function (exception) { });
|
||||
order.entityAspect.rejectChanges();
|
||||
order.entityAspect.setDeleted();
|
||||
order.entityAspect.setModified();
|
||||
@@ -109,7 +104,7 @@ function test_metadataStore() {
|
||||
var ms = new breeze.MetadataStore();
|
||||
ms.fetchMetadata("breeze/NorthwindIBModel")
|
||||
.then(function (rawMetadata) { })
|
||||
.fail(function (exception) { });
|
||||
.catch(function (exception) { });
|
||||
var odType = em1.metadataStore.getEntityType("OrderDetail");
|
||||
var badType = em1.metadataStore.getEntityType("Foo", false);
|
||||
var allTypes = em1.metadataStore.getEntityTypes();
|
||||
@@ -172,14 +167,14 @@ function test_entityManager() {
|
||||
var em = new breeze.EntityManager(serviceName);
|
||||
var query = new breeze.EntityQuery("Orders");
|
||||
em.executeQuery(query)
|
||||
.then(function (data) {
|
||||
.then(function (data: breeze.QueryResult) {
|
||||
var orders = data.results;
|
||||
}).fail(function (err) {
|
||||
}).catch(function (err) {
|
||||
});
|
||||
var em = new breeze.EntityManager(serviceName);
|
||||
var query = new breeze.EntityQuery("Orders");
|
||||
em.executeQuery(query,
|
||||
function (data) {
|
||||
function (data: breeze.QueryResult) {
|
||||
var orders = data.results;
|
||||
},
|
||||
function (err) {
|
||||
@@ -187,9 +182,9 @@ function test_entityManager() {
|
||||
var em = new breeze.EntityManager(serviceName);
|
||||
var query = new breeze.EntityQuery("Orders").using(em);
|
||||
query.execute()
|
||||
.then(function (data) {
|
||||
.then(function (data: breeze.QueryResult) {
|
||||
var orders = data.results;
|
||||
}).fail(function (err) {
|
||||
}).catch(function (err) {
|
||||
});
|
||||
var em = new breeze.EntityManager(serviceName);
|
||||
var query = new breeze.EntityQuery("Orders");
|
||||
@@ -197,9 +192,9 @@ function test_entityManager() {
|
||||
var em = new breeze.EntityManager(serviceName);
|
||||
var query = new breeze.EntityQuery("Orders").using(breeze.FetchStrategy.FromLocalCache);
|
||||
em.executeQuery(query)
|
||||
.then(function (data) {
|
||||
.then(function (data: breeze.QueryResult) {
|
||||
var orders = data.results;
|
||||
}).fail(function (err) {
|
||||
}).catch(function (err) {
|
||||
});
|
||||
var bundle = em1.exportEntities();
|
||||
window.localStorage.setItem("myEntityManager", bundle);
|
||||
@@ -217,7 +212,7 @@ function test_entityManager() {
|
||||
.then(function () {
|
||||
var metadataStore = em1.metadataStore;
|
||||
})
|
||||
.fail(function (exception) {
|
||||
.catch(function (exception) {
|
||||
});
|
||||
var employeeType = em1.metadataStore.getEntityType("Employee");
|
||||
var employeeKey = new breeze.EntityKey(<breeze.EntityType> employeeType, 1);
|
||||
@@ -228,7 +223,7 @@ function test_entityManager() {
|
||||
var custumer = custType.createEntity();
|
||||
var customerId = em.generateTempKeyValue(custumer);
|
||||
em1.saveChanges()
|
||||
.then(function (data) {
|
||||
.then(function (data: breeze.SaveResult) {
|
||||
var sameCust1 = data.entities[0];
|
||||
});
|
||||
var changedEntities = em1.getChanges();
|
||||
@@ -263,22 +258,22 @@ function test_entityManager() {
|
||||
metadataStore: em1.metadataStore
|
||||
});
|
||||
em2.importEntities(bundle);
|
||||
var bundle = em1.exportEntities();
|
||||
em2.importEntities(bundle, { mergeStrategy: breeze.MergeStrategy.PreserveChanges });
|
||||
em.saveChanges().then(function (saveResult) {
|
||||
var bundle2 = em1.exportEntities(null, { asString: true, includeMetadata: true });
|
||||
em2.importEntities(bundle2, { mergeStrategy: breeze.MergeStrategy.PreserveChanges });
|
||||
em.saveChanges().then(function (saveResult: breeze.SaveResult) {
|
||||
var savedEntities = saveResult.entities;
|
||||
var keyMappings = saveResult.keyMappings;
|
||||
}).fail(function (e) {
|
||||
}).catch(function (e) {
|
||||
});
|
||||
var saveOptions = new breeze.SaveOptions({ allowConcurrentSaves: true });
|
||||
var entitiesToSave: breeze.Entity[];
|
||||
em.saveChanges(entitiesToSave, saveOptions).then(function (saveResult) {
|
||||
em.saveChanges(entitiesToSave, saveOptions).then(function (saveResult: breeze.SaveResult) {
|
||||
var savedEntities = saveResult.entities;
|
||||
var keyMappings = saveResult.keyMappings;
|
||||
}).fail(function (e) {
|
||||
}).catch(function (e) {
|
||||
});
|
||||
em.saveChanges(entitiesToSave, null,
|
||||
function (saveResult) {
|
||||
function (saveResult: breeze.SaveResult) {
|
||||
var savedEntities = saveResult.entities;
|
||||
var keyMappings = saveResult.keyMappings;
|
||||
}, function (e) { }
|
||||
@@ -307,21 +302,21 @@ function test_entityQuery() {
|
||||
var em = new breeze.EntityManager(serviceName);
|
||||
var query = new breeze.EntityQuery("Orders").using(em);
|
||||
query.execute()
|
||||
.then(function (data) { })
|
||||
.fail(function (err) { });
|
||||
.then(function (data: breeze.QueryResult) { })
|
||||
.catch(function (err) { });
|
||||
var em = new breeze.EntityManager(serviceName);
|
||||
var query = new breeze.EntityQuery("Orders").using(em);
|
||||
query.execute(
|
||||
function (data) {
|
||||
function (data: breeze.QueryResult) {
|
||||
var orders = data.results;
|
||||
},
|
||||
function (err) { });
|
||||
var em = new breeze.EntityManager(serviceName);
|
||||
var query = new breeze.EntityQuery("Orders");
|
||||
em.executeQuery(query)
|
||||
.then(function (data) {
|
||||
.then(function (data: breeze.QueryResult) {
|
||||
var orders = data.results;
|
||||
}).fail(function (err) {
|
||||
}).catch(function (err) {
|
||||
});
|
||||
var query = new breeze.EntityQuery("Orders").using(em);
|
||||
var orders = query.executeLocally();
|
||||
@@ -409,6 +404,8 @@ function test_entityQuery() {
|
||||
var query = new breeze.EntityQuery("Customers")
|
||||
.where("toUpper(substring(CompanyName, 1, 2))", breeze.FilterQueryOp.Equals, "OM");
|
||||
var q2 = query.toType("foo").orderBy("foo2");
|
||||
|
||||
var json = query.toJSON();
|
||||
}
|
||||
|
||||
function test_entityState() {
|
||||
@@ -487,55 +484,53 @@ function test_entityType() {
|
||||
}
|
||||
|
||||
//function test_enum() {
|
||||
// var prototype = {
|
||||
// nextDay: function () {
|
||||
// var nextIndex = (this.dayIndex + 1) % 7;
|
||||
// return DayOfWeek.getSymbols()[nextIndex];
|
||||
// }
|
||||
// };
|
||||
// var DayOfWeek = new core.Enum("DayOfWeek", prototype);
|
||||
// DayOfWeek.Monday = DayOfWeek.addSymbol({ dayIndex: 0 });
|
||||
// var symbol = DayOfWeek.Friday;
|
||||
// if (DayOfWeek.contains(symbol)) { }
|
||||
// var dayOfWeek = DayOfWeek.from("Thursday");
|
||||
// var symbols = DayOfWeek.getNames();
|
||||
// var symbols = DayOfWeek.getSymbols();
|
||||
// if (core.Enum.isSymbol(DayOfWeek.Wednesday)) { };
|
||||
// DayOfWeek.seal();
|
||||
// var name = DayOfWeek.Monday.getName();
|
||||
// var name = DayOfWeek.Monday.toString();
|
||||
// var prototype = {
|
||||
// nextDay: function () {
|
||||
// var nextIndex = (this.dayIndex + 1) % 7;
|
||||
// return DayOfWeek.getSymbols()[nextIndex];
|
||||
// }
|
||||
// };
|
||||
// var DayOfWeek = new core.Enum("DayOfWeek", prototype);
|
||||
// DayOfWeek.Monday = DayOfWeek.addSymbol({ dayIndex: 0 });
|
||||
// var symbol = DayOfWeek.Friday;
|
||||
// if (DayOfWeek.contains(symbol)) { }
|
||||
// var dayOfWeek = DayOfWeek.from("Thursday");
|
||||
// var symbols = DayOfWeek.getNames();
|
||||
// var symbols = DayOfWeek.getSymbols();
|
||||
// if (core.Enum.isSymbol(DayOfWeek.Wednesday)) { };
|
||||
// DayOfWeek.seal();
|
||||
// var name = DayOfWeek.Monday.getName();
|
||||
// var name = DayOfWeek.Monday.toString();
|
||||
|
||||
|
||||
// var prototype = {
|
||||
// nextDay: function () {
|
||||
// var nextIndex = (this.dayIndex + 1) % 7;
|
||||
// return DayOfWeek.getSymbols()[nextIndex];
|
||||
// }
|
||||
// };
|
||||
// var DayOfWeek = new core.Enum("DayOfWeek", prototype);
|
||||
// DayOfWeek.Monday = DayOfWeek.addSymbol({ dayIndex: 0 });
|
||||
// DayOfWeek.Tuesday = DayOfWeek.addSymbol({ dayIndex: 1 });
|
||||
// DayOfWeek.Wednesday = DayOfWeek.addSymbol({ dayIndex: 2 });
|
||||
// DayOfWeek.Thursday = DayOfWeek.addSymbol({ dayIndex: 3 });
|
||||
// DayOfWeek.Friday = DayOfWeek.addSymbol({ dayIndex: 4 });
|
||||
// DayOfWeek.Saturday = DayOfWeek.addSymbol({ dayIndex: 5, isWeekend: true });
|
||||
// DayOfWeek.Sunday = DayOfWeek.addSymbol({ dayIndex: 6, isWeekend: true });
|
||||
// DayOfWeek.seal();
|
||||
// DayOfWeek.Monday.nextDay() === DayOfWeek.Tuesday;
|
||||
// DayOfWeek.Sunday.nextDay() === DayOfWeek.Monday;
|
||||
// DayOfWeek.Tuesday.isWeekend === undefined;
|
||||
// DayOfWeek.Saturday.isWeekend == true;
|
||||
// DayOfWeek instanceof core.Enum;
|
||||
// core.Enum.isSymbol(DayOfWeek.Wednesday);
|
||||
// DayOfWeek.contains(DayOfWeek.Thursday);
|
||||
// DayOfWeek.Tuesday.parentEnum == DayOfWeek;
|
||||
// DayOfWeek.getSymbols().length === 7;
|
||||
// DayOfWeek.Friday.toString() === "Friday";
|
||||
// var prototype = {
|
||||
// nextDay: function () {
|
||||
// var nextIndex = (this.dayIndex + 1) % 7;
|
||||
// return DayOfWeek.getSymbols()[nextIndex];
|
||||
// }
|
||||
// };
|
||||
// var DayOfWeek = new core.Enum("DayOfWeek", prototype);
|
||||
// DayOfWeek.Monday = DayOfWeek.addSymbol({ dayIndex: 0 });
|
||||
// DayOfWeek.Tuesday = DayOfWeek.addSymbol({ dayIndex: 1 });
|
||||
// DayOfWeek.Wednesday = DayOfWeek.addSymbol({ dayIndex: 2 });
|
||||
// DayOfWeek.Thursday = DayOfWeek.addSymbol({ dayIndex: 3 });
|
||||
// DayOfWeek.Friday = DayOfWeek.addSymbol({ dayIndex: 4 });
|
||||
// DayOfWeek.Saturday = DayOfWeek.addSymbol({ dayIndex: 5, isWeekend: true });
|
||||
// DayOfWeek.Sunday = DayOfWeek.addSymbol({ dayIndex: 6, isWeekend: true });
|
||||
// DayOfWeek.seal();
|
||||
// DayOfWeek.Monday.nextDay() === DayOfWeek.Tuesday;
|
||||
// DayOfWeek.Sunday.nextDay() === DayOfWeek.Monday;
|
||||
// DayOfWeek.Tuesday.isWeekend === undefined;
|
||||
// DayOfWeek.Saturday.isWeekend == true;
|
||||
// DayOfWeek instanceof core.Enum;
|
||||
// core.Enum.isSymbol(DayOfWeek.Wednesday);
|
||||
// DayOfWeek.contains(DayOfWeek.Thursday);
|
||||
// DayOfWeek.Tuesday.parentEnum == DayOfWeek;
|
||||
// DayOfWeek.getSymbols().length === 7;
|
||||
// DayOfWeek.Friday.toString() === "Friday";
|
||||
//}
|
||||
|
||||
interface CustomEntityManager extends breeze.EntityManager
|
||||
{
|
||||
customTag: string;
|
||||
interface CustomEntityManager extends breeze.EntityManager {
|
||||
customTag: string;
|
||||
}
|
||||
|
||||
function test_event() {
|
||||
@@ -699,14 +694,12 @@ function test_validationOptions() {
|
||||
var newOptions = validationOptions.using({ validateOnQuery: true, validateOnSave: false });
|
||||
}
|
||||
|
||||
interface NumericRange
|
||||
{
|
||||
max: number;
|
||||
interface NumericRange{
|
||||
max: number;
|
||||
min: number;
|
||||
}
|
||||
|
||||
interface NumericRangeValidatorFunctionContext extends breeze.ValidatorFunctionContext, NumericRange
|
||||
{
|
||||
interface NumericRangeValidatorFunctionContext extends breeze.ValidatorFunctionContext, NumericRange {
|
||||
}
|
||||
|
||||
function test_validator() {
|
||||
@@ -726,7 +719,7 @@ function test_validator() {
|
||||
var re = /^\d{5}([\-]\d{4})?$/;
|
||||
return (re.test(value));
|
||||
}
|
||||
valFn = function (v: any) {
|
||||
var valFn = function (v: any) {
|
||||
if (v.getProperty("Country") === "USA") {
|
||||
var postalCode = v.getProperty("PostalCode");
|
||||
return isValidZipCode(postalCode);
|
||||
@@ -799,7 +792,7 @@ function test_validator() {
|
||||
var errMsg = result.errorMessage;
|
||||
var context = result.context;
|
||||
var sameValidator = result.validator;
|
||||
valFn = function (v: any) {
|
||||
var valFn = function (v: any) {
|
||||
if (v == null) return true;
|
||||
return (v.substr(0,2) === "US");
|
||||
};
|
||||
@@ -808,6 +801,8 @@ function test_validator() {
|
||||
|
||||
breeze.Validator.register(countryValidator);
|
||||
breeze.Validator.registerFactory(() => countryValidator, "country");
|
||||
|
||||
var urlValidator = breeze.Validator.url({ messageTemplate: 'u got that wrong' });
|
||||
}
|
||||
|
||||
function test_demo() {
|
||||
@@ -817,7 +812,7 @@ function test_demo() {
|
||||
var query = new breeze.EntityQuery()
|
||||
.from("Employees");
|
||||
|
||||
manager.executeQuery(query).then(function (data) { });
|
||||
manager.executeQuery(query).then(function (data: breeze.QueryResult) { });
|
||||
}
|
||||
|
||||
function test_corefns() {
|
||||
@@ -888,4 +883,4 @@ function test_config() {
|
||||
config.registerType(f1, "myCtor");
|
||||
s = config.stringifyPad;
|
||||
o = config.typeRegistry;
|
||||
}
|
||||
}
|
||||
Vendored
+286
-102
@@ -4,10 +4,12 @@
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
// Updated Jan 14 2011 - Jay Traband ( www.ideablade.com).
|
||||
// Updated March 27 2013 - John Lantz (www.ideablade.com).
|
||||
// Updated Aug 13 2013 - Steve Schmitt ( www.ideablade.com).
|
||||
|
||||
/// <reference path="../q/Q.d.ts" />
|
||||
// Updated Sep 26 2013 for Breeze 1.4.3 - Steve Schmitt ( www.ideablade.com).
|
||||
// Updated Jul 22 2014 for Breeze 1.4.16 - Steve Schmitt ( www.ideablade.com)
|
||||
// Updated Aug 22 2014 for Breeze 1.4.17 and removing Q dependency - Steve Schmitt ( www.ideablade.com)
|
||||
// Updated Jan 16 2015 for Breeze 1.4.17 to add support for noimplicitany - Kevin Wilson ( www.kwilson.me.uk )
|
||||
// Updated Jan 20 2015 for Breeze 1.5.2 and merging changes from DefinitelyTyped
|
||||
|
||||
declare module breeze.core {
|
||||
|
||||
@@ -23,7 +25,7 @@ declare module breeze.core {
|
||||
}
|
||||
|
||||
class Enum implements IEnum {
|
||||
constructor (name: string, methodObj?: any);
|
||||
constructor(name: string, methodObj?: any);
|
||||
|
||||
addSymbol(propertiesObj?: any): EnumSymbol;
|
||||
contains(object: any): boolean;
|
||||
@@ -31,7 +33,7 @@ declare module breeze.core {
|
||||
getNames(): string[];
|
||||
getSymbols(): EnumSymbol[];
|
||||
static isSymbol(object: any): boolean;
|
||||
seal(): void;
|
||||
resolveSymbols(): void;
|
||||
}
|
||||
|
||||
class EnumSymbol {
|
||||
@@ -42,7 +44,7 @@ declare module breeze.core {
|
||||
}
|
||||
|
||||
class Event {
|
||||
constructor (name: string, publisher: any, defaultErrorCallback?: ErrorCallback);
|
||||
constructor(name: string, publisher: any, defaultErrorCallback?: ErrorCallback);
|
||||
|
||||
static enable(eventName: string, target: any): void;
|
||||
static enable(eventName: string, target: any, isEnabled: boolean): void;
|
||||
@@ -51,25 +53,26 @@ declare module breeze.core {
|
||||
static isEnabled(eventName: string, target: any): boolean;
|
||||
publish(data: any, publishAsync?: boolean, errorCallback?: ErrorCallback): void;
|
||||
publishAsync(data: any, errorCallback?: ErrorCallback): void;
|
||||
subscribe(callback?: (data: any) => void ): number;
|
||||
subscribe(callback?: (data: any) => void): number;
|
||||
unsubscribe(unsubKey: number): boolean;
|
||||
clear(): void;
|
||||
}
|
||||
|
||||
export function objectForEach(obj: Object, kvfn: (key:string, value:any) => void): void;
|
||||
export function objectForEach(obj: Object, kvfn: (key: string, value: any) => void): void;
|
||||
|
||||
export function extend(target: Object, source: Object): Object;
|
||||
export function propEq(propertyName: string, value: any): (obj: Object) => boolean;
|
||||
export function pluck(propertyName: string): (obj: Object) => any;
|
||||
export function arrayEquals(a1: any[], a2: any[], equalsFn: (e1:any, e2:any) => boolean): boolean;
|
||||
export function arrayFirst(a1: any[], predicate: (e:any) => boolean): any;
|
||||
export function arrayEquals(a1: any[], a2: any[], equalsFn: (e1: any, e2: any) => boolean): boolean;
|
||||
export function arrayFirst(a1: any[], predicate: (e: any) => boolean): any;
|
||||
export function arrayIndexOf(a1: any[], predicate: (e: any) => boolean): number;
|
||||
export function arrayRemoveItem(array: any[], item: any, shouldRemoveMultiple: boolean): any;
|
||||
export function arrayRemoveItem(array: any[], predicate: (e: any) => boolean, shouldRemoveMultiple: boolean): any;
|
||||
export function arrayZip(a1: any[], a2: any[], callback: (e1:any, e2:any) => any): any[];
|
||||
export function arrayZip(a1: any[], a2: any[], callback: (e1: any, e2: any) => any): any[];
|
||||
|
||||
export function requireLib(libnames: string, errMessage: string): Object;
|
||||
export function using(obj: Object, property: string, tempValue: any, fn: () => any): any;
|
||||
export function memoize(fn:Function): any;
|
||||
export function memoize(fn: (...any: any[]) => any): any;
|
||||
export function getUuid(): string;
|
||||
export function durationToSeconds(duration: string): number;
|
||||
|
||||
@@ -147,7 +150,6 @@ declare module breeze {
|
||||
concurrencyMode: string;
|
||||
dataType: DataTypeSymbol;
|
||||
defaultValue: any;
|
||||
fixedLength: boolean;
|
||||
isComplexProperty: boolean;
|
||||
isDataProperty: boolean;
|
||||
isInherited: boolean;
|
||||
@@ -155,24 +157,26 @@ declare module breeze {
|
||||
isNullable: boolean;
|
||||
isPartOfKey: boolean;
|
||||
isUnmapped: boolean;
|
||||
|
||||
|
||||
maxLength: number;
|
||||
name: string;
|
||||
nameOnServer: string;
|
||||
parentType: IStructuralType;
|
||||
relatedNavigationProperty: NavigationProperty;
|
||||
validators: Validator[];
|
||||
constructor (config: DataPropertyOptions);
|
||||
constructor(config: DataPropertyOptions);
|
||||
}
|
||||
|
||||
interface DataPropertyOptions {
|
||||
complexTypeName?: string;
|
||||
concurrencyMode?: string;
|
||||
custom?: any;
|
||||
dataType?: DataTypeSymbol;
|
||||
defaultValue?: any;
|
||||
fixedLength?: boolean;
|
||||
displayName?: string;
|
||||
isNullable?: boolean;
|
||||
isPartOfKey?: boolean;
|
||||
isScalar?: boolean;
|
||||
isUnmapped?: boolean;
|
||||
maxLength?: number;
|
||||
name?: string;
|
||||
@@ -185,6 +189,7 @@ declare module breeze {
|
||||
adapterName: string;
|
||||
hasServerMetadata: boolean;
|
||||
serviceName: string;
|
||||
uriBuilderName: string;
|
||||
jsonResultsAdapter: JsonResultsAdapter;
|
||||
useJsonp: boolean;
|
||||
constructor(config: DataServiceOptions);
|
||||
@@ -194,17 +199,18 @@ declare module breeze {
|
||||
interface DataServiceOptions {
|
||||
serviceName?: string;
|
||||
adapterName?: string;
|
||||
uriBuilderName?: string;
|
||||
hasServerMetadata?: boolean;
|
||||
jsonResultsAdapter?: JsonResultsAdapter;
|
||||
useJsonp?: boolean;
|
||||
}
|
||||
|
||||
class DataServiceAdapter {
|
||||
checkForRecomposition(interfaceInitializedArgs: { interfaceName: string; isDefault: boolean}): void;
|
||||
checkForRecomposition(interfaceInitializedArgs: { interfaceName: string; isDefault: boolean }): void;
|
||||
initialize(): void;
|
||||
fetchMetadata(metadataStore: MetadataStore, dataService: DataService): Q.Promise<any>;
|
||||
executeQuery(mappingContext: Object): Q.Promise<any>;
|
||||
saveChanges(saveContext: { resourceName: string }, saveBundle: Object): Q.Promise<SaveResult>;
|
||||
fetchMetadata(metadataStore: MetadataStore, dataService: DataService): breeze.promises.IPromise<any>;
|
||||
executeQuery(mappingContext: { getUrl: () => string; query: EntityQuery; dataService: DataService }): breeze.promises.IPromise<any>;
|
||||
saveChanges(saveContext: { resourceName: string; dataService: DataService }, saveBundle: Object): breeze.promises.IPromise<SaveResult>;
|
||||
JsonResultsAdapter: JsonResultsAdapter;
|
||||
}
|
||||
|
||||
@@ -232,9 +238,9 @@ declare module breeze {
|
||||
}
|
||||
|
||||
class DataTypeSymbol extends breeze.core.EnumSymbol {
|
||||
defaultValue: any;
|
||||
isNumeric: boolean;
|
||||
isDate: boolean;
|
||||
defaultValue: any;
|
||||
isNumeric: boolean;
|
||||
isDate: boolean;
|
||||
}
|
||||
interface DataType extends breeze.core.IEnum {
|
||||
Binary: DataTypeSymbol;
|
||||
@@ -283,6 +289,7 @@ declare module breeze {
|
||||
entityState: EntityStateSymbol;
|
||||
isBeingSaved: boolean;
|
||||
originalValues: Object;
|
||||
extraMetadata: Object;
|
||||
|
||||
propertyChanged: PropertyChangedEvent;
|
||||
validationErrorsChanged: ValidationErrorsChangedEvent;
|
||||
@@ -297,8 +304,11 @@ declare module breeze {
|
||||
getValidationErrors(property: IProperty): ValidationError[];
|
||||
hasValidationErrors: boolean;
|
||||
|
||||
loadNavigationProperty(navigationProperty: string, callback?: Function, errorCallback?: Function): Q.Promise<QueryResult>;
|
||||
loadNavigationProperty(navigationProperty: NavigationProperty, callback?: Function, errorCallback?: Function): Q.Promise<QueryResult>;
|
||||
isNavigationPropertyLoaded(navigationProperty: string): boolean;
|
||||
isNavigationPropertyLoaded(navigationProperty: NavigationProperty): boolean;
|
||||
|
||||
loadNavigationProperty(navigationProperty: string, callback?: Function, errorCallback?: Function): breeze.promises.IPromise<QueryResult>;
|
||||
loadNavigationProperty(navigationProperty: NavigationProperty, callback?: Function, errorCallback?: Function): breeze.promises.IPromise<QueryResult>;
|
||||
|
||||
rejectChanges(): void;
|
||||
|
||||
@@ -307,10 +317,14 @@ declare module breeze {
|
||||
removeValidationError(validator: Validator, property: NavigationProperty): void;
|
||||
removeValidationError(validationError: ValidationError): void;
|
||||
|
||||
/** Sets the entity to an EntityState of 'Added'. This is NOT the equivalent of calling {{#crossLink "EntityManager/addEntity"}}{{/crossLink}}
|
||||
because no key generation will occur for autogenerated keys as a result of this operation. */
|
||||
setAdded(): void;
|
||||
setDeleted(): void;
|
||||
setDetached(): void;
|
||||
setModified(): void;
|
||||
setUnchanged(): void;
|
||||
setEntityState(entityState: EntityStateSymbol): void;
|
||||
validateEntity(): boolean;
|
||||
|
||||
validateProperty(property: string, context?: any): boolean;
|
||||
@@ -320,13 +334,15 @@ declare module breeze {
|
||||
|
||||
class PropertyChangedEventArgs {
|
||||
entity: Entity;
|
||||
property: IProperty;
|
||||
propertyName: string;
|
||||
oldValue: any;
|
||||
newValue: any;
|
||||
parent: any;
|
||||
}
|
||||
|
||||
class PropertyChangedEvent extends breeze.core.Event {
|
||||
subscribe(callback?: (data: PropertyChangedEventArgs) => void ): number;
|
||||
subscribe(callback?: (data: PropertyChangedEventArgs) => void): number;
|
||||
}
|
||||
|
||||
class ValidationErrorsChangedEventArgs {
|
||||
@@ -336,12 +352,12 @@ declare module breeze {
|
||||
}
|
||||
|
||||
class ValidationErrorsChangedEvent extends breeze.core.Event {
|
||||
subscribe(callback?: (data: ValidationErrorsChangedEventArgs) => void ): number;
|
||||
subscribe(callback?: (data: ValidationErrorsChangedEventArgs) => void): number;
|
||||
}
|
||||
|
||||
class EntityKey {
|
||||
constructor (entityType: EntityType, keyValue: any);
|
||||
constructor (entityType: EntityType, keyValues: any[]);
|
||||
constructor(entityType: EntityType, keyValue: any);
|
||||
constructor(entityType: EntityType, keyValues: any[]);
|
||||
|
||||
equals(entityKey: EntityKey): boolean;
|
||||
static equals(k1: EntityKey, k2: EntityKey): boolean;
|
||||
@@ -354,6 +370,10 @@ declare module breeze {
|
||||
entityKey: EntityKey;
|
||||
fromCache: boolean;
|
||||
}
|
||||
interface ExportEntitiesOptions {
|
||||
asString: boolean; // default true
|
||||
includeMetadata: boolean; // default true
|
||||
}
|
||||
|
||||
class EntityManager {
|
||||
dataService: DataService;
|
||||
@@ -368,26 +388,26 @@ declare module breeze {
|
||||
hasChangesChanged: HasChangesChangedEvent;
|
||||
validationErrorsChanged: ValidationErrorsChangedEvent;
|
||||
|
||||
constructor (config?: EntityManagerOptions);
|
||||
constructor (config?: string);
|
||||
constructor(config?: EntityManagerOptions);
|
||||
constructor(config?: string);
|
||||
|
||||
addEntity(entity: Entity): Entity;
|
||||
attachEntity(entity: Entity, entityState?: EntityStateSymbol): Entity;
|
||||
attachEntity(entity: Entity, entityState?: EntityStateSymbol, mergeStrategy?: MergeStrategySymbol): Entity;
|
||||
clear(): void;
|
||||
createEmptyCopy(): EntityManager;
|
||||
createEntity(typeName: string, config?: {}, entityState?: EntityStateSymbol) : Entity;
|
||||
createEntity(typeName: string, config?: {}, entityState?: EntityStateSymbol, mergeStrategy?: StrategySymbol): Entity;
|
||||
createEntity(entityType: EntityType, config?: {}, entityState?: EntityStateSymbol): Entity;
|
||||
createEntity(typeName: string, config?: {}, entityState?: EntityStateSymbol, mergeStrategy?: MergeStrategySymbol): Entity;
|
||||
createEntity(entityType: EntityType, config?: {}, entityState?: EntityStateSymbol, mergeStrategy?: MergeStrategySymbol): Entity;
|
||||
detachEntity(entity: Entity): boolean;
|
||||
executeQuery(query: string, callback?: ExecuteQuerySuccessCallback, errorCallback?: ExecuteQueryErrorCallback): Q.Promise<QueryResult>;
|
||||
executeQuery(query: EntityQuery, callback?: ExecuteQuerySuccessCallback, errorCallback?: ExecuteQueryErrorCallback): Q.Promise<QueryResult>;
|
||||
executeQuery(query: string, callback?: ExecuteQuerySuccessCallback, errorCallback?: ExecuteQueryErrorCallback): breeze.promises.IPromise<QueryResult>;
|
||||
executeQuery(query: EntityQuery, callback?: ExecuteQuerySuccessCallback, errorCallback?: ExecuteQueryErrorCallback): breeze.promises.IPromise<QueryResult>;
|
||||
|
||||
executeQueryLocally(query: EntityQuery): Entity[];
|
||||
exportEntities(entities?: Entity[], includeMetadata?: boolean): string;
|
||||
fetchEntityByKey(typeName: string, keyValue: any, checkLocalCacheFirst?: boolean): Q.Promise<EntityByKeyResult>;
|
||||
fetchEntityByKey(typeName: string, keyValues: any[], checkLocalCacheFirst?: boolean): Q.Promise<EntityByKeyResult>;
|
||||
fetchEntityByKey(entityKey: EntityKey, checkLocalCacheFirst?: boolean): Q.Promise<EntityByKeyResult>;
|
||||
fetchMetadata(callback?: (schema: any) => void , errorCallback?: breeze.core.ErrorCallback): Q.Promise<any>;
|
||||
exportEntities(entities?: Entity[], options?: ExportEntitiesOptions): any; // string | Object
|
||||
fetchEntityByKey(typeName: string, keyValue: any, checkLocalCacheFirst?: boolean): breeze.promises.IPromise<EntityByKeyResult>;
|
||||
fetchEntityByKey(typeName: string, keyValues: any[], checkLocalCacheFirst?: boolean): breeze.promises.IPromise<EntityByKeyResult>;
|
||||
fetchEntityByKey(entityKey: EntityKey): breeze.promises.IPromise<EntityByKeyResult>;
|
||||
fetchMetadata(callback?: (schema: any) => void, errorCallback?: breeze.core.ErrorCallback): breeze.promises.IPromise<any>;
|
||||
generateTempKeyValue(entity: Entity): any;
|
||||
getChanges(): Entity[];
|
||||
getChanges(entityTypeName: string): Entity[];
|
||||
@@ -415,13 +435,13 @@ declare module breeze {
|
||||
hasChanges(entityType: EntityType): boolean;
|
||||
hasChanges(entityTypes: EntityType[]): boolean;
|
||||
|
||||
static importEntities(exportedString: string, config?: { mergeStrategy?: StrategySymbol; }): EntityManager;
|
||||
static importEntities(exportedData: Object, config?: { mergeStrategy?: StrategySymbol; }): EntityManager;
|
||||
importEntities(exportedString: string, config?: { mergeStrategy?: StrategySymbol; }): EntityManager;
|
||||
importEntities(exportedData: Object, config?: { mergeStrategy?: StrategySymbol; }): EntityManager;
|
||||
static importEntities(exportedString: string, config?: { mergeStrategy?: MergeStrategySymbol; metadataVersionFn?: (any: any) => void }): EntityManager;
|
||||
static importEntities(exportedData: Object, config?: { mergeStrategy?: MergeStrategySymbol; metadataVersionFn?: (any: any) => void }): EntityManager;
|
||||
importEntities(exportedString: string, config?: { mergeStrategy?: MergeStrategySymbol; metadataVersionFn?: (any: any) => void }): { entities: Entity[]; tempKeyMapping: { [key: string] : EntityKey } };
|
||||
importEntities(exportedData: Object, config?: { mergeStrategy?: MergeStrategySymbol; metadataVersionFn?: (any: any) => void }): { entities: Entity[]; tempKeyMapping: { [key: string]: EntityKey } };
|
||||
|
||||
rejectChanges(): Entity[];
|
||||
saveChanges(entities?: Entity[], saveOptions?: SaveOptions, callback?: SaveChangesSuccessCallback, errorCallback?: SaveChangesErrorCallback): Q.Promise<SaveResult>;
|
||||
saveChanges(entities?: Entity[], saveOptions?: SaveOptions, callback?: SaveChangesSuccessCallback, errorCallback?: SaveChangesErrorCallback): breeze.promises.IPromise<SaveResult>;
|
||||
setProperties(config: EntityManagerProperties): void;
|
||||
}
|
||||
|
||||
@@ -449,15 +469,29 @@ declare module breeze {
|
||||
}
|
||||
|
||||
interface ExecuteQueryErrorCallback {
|
||||
(error: { query: EntityQuery; XHR: XMLHttpRequest; entityManager: EntityManager}): void;
|
||||
(error: { query: EntityQuery; httpResponse: HttpResponse; entityManager: EntityManager; message?: string; stack?:string }): void;
|
||||
}
|
||||
|
||||
interface SaveChangesSuccessCallback {
|
||||
(saveResult: SaveResult): void;
|
||||
}
|
||||
|
||||
interface EntityError {
|
||||
entity: Entity;
|
||||
errorMessage: string;
|
||||
errorName: string;
|
||||
isServerError: boolean;
|
||||
propertyName: string;
|
||||
}
|
||||
|
||||
interface SaveChangesErrorCallback {
|
||||
(error: { XHR: XMLHttpRequest; }): void;
|
||||
(error: {
|
||||
entityErrors: EntityError[];
|
||||
httpResponse: HttpResponse;
|
||||
message: string;
|
||||
stack?: string;
|
||||
status?: number
|
||||
}): void;
|
||||
}
|
||||
|
||||
class EntityChangedEventArgs {
|
||||
@@ -467,7 +501,7 @@ declare module breeze {
|
||||
}
|
||||
|
||||
class EntityChangedEvent extends breeze.core.Event {
|
||||
subscribe(callback?: (data: EntityChangedEventArgs) => void ): number;
|
||||
subscribe(callback?: (data: EntityChangedEventArgs) => void): number;
|
||||
}
|
||||
|
||||
class HasChangesChangedEventArgs {
|
||||
@@ -476,7 +510,7 @@ declare module breeze {
|
||||
}
|
||||
|
||||
class HasChangesChangedEvent extends breeze.core.Event {
|
||||
subscribe(callback?: (data: HasChangesChangedEventArgs) => void ): number;
|
||||
subscribe(callback?: (data: HasChangesChangedEventArgs) => void): number;
|
||||
}
|
||||
|
||||
class EntityQuery {
|
||||
@@ -490,9 +524,11 @@ declare module breeze {
|
||||
takeCount: number;
|
||||
wherePredicate: Predicate;
|
||||
|
||||
constructor (resourceName?: string);
|
||||
constructor(resourceName?: string);
|
||||
/** Create query from an expression tree */
|
||||
constructor(tree: Object);
|
||||
|
||||
execute(callback?: ExecuteQuerySuccessCallback, errorCallback?: ExecuteQueryErrorCallback): Q.Promise<QueryResult>;
|
||||
execute(callback?: ExecuteQuerySuccessCallback, errorCallback?: ExecuteQueryErrorCallback): breeze.promises.IPromise<QueryResult>;
|
||||
executeLocally(): Entity[];
|
||||
expand(propertyPaths: string[]): EntityQuery;
|
||||
expand(propertyPaths: string): EntityQuery;
|
||||
@@ -503,9 +539,9 @@ declare module breeze {
|
||||
static fromEntityKey(entityKey: EntityKey): EntityQuery;
|
||||
static fromEntityNavigation(entity: Entity, navigationProperty: NavigationProperty): EntityQuery;
|
||||
inlineCount(enabled?: boolean): EntityQuery;
|
||||
noTracking(enabled: boolean): EntityQuery;
|
||||
orderBy(propertyPaths: string): EntityQuery;
|
||||
orderBy(propertyPaths: string[]): EntityQuery;
|
||||
noTracking(enabled?: boolean): EntityQuery;
|
||||
orderBy(propertyPaths: string, isDescending?: boolean): EntityQuery;
|
||||
orderBy(propertyPaths: string[], isDescending?: boolean): EntityQuery;
|
||||
orderByDesc(propertyPaths: string): EntityQuery;
|
||||
orderByDesc(propertyPaths: string[]): EntityQuery;
|
||||
select(propertyPaths: string): EntityQuery;
|
||||
@@ -520,14 +556,18 @@ declare module breeze {
|
||||
using(obj: DataService): EntityQuery;
|
||||
using(obj: JsonResultsAdapter): EntityQuery;
|
||||
using(obj: QueryOptions): EntityQuery;
|
||||
using(obj: StrategySymbol): EntityQuery;
|
||||
using(obj: MergeStrategySymbol): EntityQuery;
|
||||
using(obj: FetchStrategySymbol): EntityQuery;
|
||||
|
||||
where(predicate: Predicate): EntityQuery;
|
||||
where(property: string, operator: string, value: any): EntityQuery;
|
||||
where(property: string, operator: FilterQueryOpSymbol, value: any): EntityQuery;
|
||||
where(property: string, filterop: FilterQueryOpSymbol, property2: string, filterop2: FilterQueryOpSymbol, value: any): EntityQuery; // for any/all clauses
|
||||
where(property: string, filterop: string, property2: string, filterop2: string, value: any): EntityQuery; // for any/all clauses
|
||||
where(predicate: FilterQueryOpSymbol): EntityQuery;
|
||||
where(property: string, filterop: FilterQueryOpSymbol, property2: string, filterop2: FilterQueryOpSymbol,value:any): EntityQuery;
|
||||
withParameters(params: Object): EntityQuery;
|
||||
|
||||
toJSON(): string;
|
||||
}
|
||||
|
||||
interface OrderByClause {
|
||||
@@ -569,8 +609,8 @@ declare module breeze {
|
||||
unmappedProperties: DataProperty[];
|
||||
validators: Validator[];
|
||||
|
||||
constructor (config: MetadataStore);
|
||||
constructor (config: EntityTypeOptions);
|
||||
constructor(config: MetadataStore);
|
||||
constructor(config: EntityTypeOptions);
|
||||
|
||||
addProperty(property: IProperty): void;
|
||||
addValidator(validator: Validator, property?: IProperty): void;
|
||||
@@ -599,10 +639,15 @@ declare module breeze {
|
||||
interface EntityTypeProperties {
|
||||
autoGeneratedKeyType?: AutoGeneratedKeyType;
|
||||
defaultResourceName?: string;
|
||||
}
|
||||
serializerFn?: (dataProperty: DataProperty, value: any) => any;
|
||||
}
|
||||
|
||||
class FetchStrategySymbol extends breeze.core.EnumSymbol {
|
||||
private foo; // to distinguish this class from MergeStrategySymbol
|
||||
}
|
||||
interface FetchStrategy extends breeze.core.IEnum {
|
||||
FromLocalCache: StrategySymbol;
|
||||
FromServer: StrategySymbol;
|
||||
FromLocalCache: FetchStrategySymbol;
|
||||
FromServer: FetchStrategySymbol;
|
||||
}
|
||||
var FetchStrategy: FetchStrategy;
|
||||
|
||||
@@ -620,6 +665,7 @@ declare module breeze {
|
||||
NotEquals: FilterQueryOpSymbol;
|
||||
StartsWith: FilterQueryOpSymbol;
|
||||
Any: FilterQueryOpSymbol;
|
||||
All: FilterQueryOpSymbol;
|
||||
}
|
||||
var FilterQueryOp: FilterQueryOp;
|
||||
|
||||
@@ -627,16 +673,18 @@ declare module breeze {
|
||||
static caseInsensitiveSQL: LocalQueryComparisonOptions;
|
||||
static defaultInstance: LocalQueryComparisonOptions;
|
||||
|
||||
constructor (config: { name?: string; isCaseSensitive?: boolean; usesSql92CompliantStringComparison?: boolean; });
|
||||
constructor(config: { name?: string; isCaseSensitive?: boolean; usesSql92CompliantStringComparison?: boolean; });
|
||||
|
||||
setAsDefault(): void;
|
||||
}
|
||||
|
||||
class StrategySymbol extends breeze.core.EnumSymbol {
|
||||
class MergeStrategySymbol extends breeze.core.EnumSymbol {
|
||||
}
|
||||
interface MergeStrategy extends breeze.core.IEnum {
|
||||
OverwriteChanges: StrategySymbol;
|
||||
PreserveChanges: StrategySymbol;
|
||||
OverwriteChanges: MergeStrategySymbol;
|
||||
PreserveChanges: MergeStrategySymbol;
|
||||
SkipMerge: MergeStrategySymbol;
|
||||
Disallowed: MergeStrategySymbol;
|
||||
}
|
||||
var MergeStrategy: MergeStrategy;
|
||||
|
||||
@@ -644,11 +692,11 @@ declare module breeze {
|
||||
constructor();
|
||||
constructor(config?: MetadataStoreOptions);
|
||||
namingConvention: NamingConvention;
|
||||
addDataService(dataService: DataService): void;
|
||||
addDataService(dataService: DataService, shouldOverwrite?: boolean): void;
|
||||
addEntityType(structuralType: IStructuralType): void;
|
||||
exportMetadata(): string;
|
||||
fetchMetadata(dataService: string, callback?: (data: any) => void , errorCallback?: breeze.core.ErrorCallback): Q.Promise<any>;
|
||||
fetchMetadata(dataService: DataService, callback?: (data: any) => void , errorCallback?: breeze.core.ErrorCallback): Q.Promise<any>;
|
||||
fetchMetadata(dataService: string, callback?: (data: any) => void, errorCallback?: breeze.core.ErrorCallback): breeze.promises.IPromise<any>;
|
||||
fetchMetadata(dataService: DataService, callback?: (data: any) => void, errorCallback?: breeze.core.ErrorCallback): breeze.promises.IPromise<any>;
|
||||
getDataService(serviceName: string): DataService;
|
||||
getEntityType(entityTypeName: string, okIfNotFound?: boolean): IStructuralType;
|
||||
getEntityTypes(): IStructuralType[];
|
||||
@@ -656,11 +704,12 @@ declare module breeze {
|
||||
static importMetadata(exportedString: string): MetadataStore;
|
||||
importMetadata(exportedString: string, allowMerge?: boolean): MetadataStore;
|
||||
isEmpty(): boolean;
|
||||
registerEntityTypeCtor(entityTypeName: string, entityCtor: Function, initializationFn?: (entity: Entity) =>void ): void;
|
||||
registerEntityTypeCtor(entityTypeName: string, entityCtor: Function, initializationFn?: (entity: Entity) => void, noTrackingFn?: (entity: Entity) => Entity): void;
|
||||
trackUnmappedType(entityCtor: Function, interceptor?: Function): void;
|
||||
setEntityTypeForResourceName(resourceName: string, entityType: EntityType): void;
|
||||
setEntityTypeForResourceName(resourceName: string, entityTypeName: string): void;
|
||||
getEntityTypeNameForResourceName(resourceName: string): string;
|
||||
setProperties(config: { name?: string; serializerFn?: Function }): void;
|
||||
}
|
||||
|
||||
interface MetadataStoreOptions {
|
||||
@@ -673,7 +722,7 @@ declare module breeze {
|
||||
static defaultInstance: NamingConvention;
|
||||
static none: NamingConvention;
|
||||
|
||||
constructor (config: NamingConventionOptions);
|
||||
constructor(config: NamingConventionOptions);
|
||||
|
||||
clientPropertyNameToServer(clientPropertyName: string): string;
|
||||
clientPropertyNameToServer(clientPropertyName: string, property: IProperty): string;
|
||||
@@ -702,7 +751,7 @@ declare module breeze {
|
||||
relatedDataProperties: DataProperty[];
|
||||
validators: Validator[];
|
||||
|
||||
constructor (config: NavigationPropertyOptions);
|
||||
constructor(config: NavigationPropertyOptions);
|
||||
}
|
||||
|
||||
interface NavigationPropertyOptions {
|
||||
@@ -717,8 +766,12 @@ declare module breeze {
|
||||
}
|
||||
|
||||
class Predicate {
|
||||
constructor (property: string, operator: string, value: any, valueIsLiteral?: boolean);
|
||||
constructor (property: string, operator: FilterQueryOpSymbol, value: any, valueIsLiteral?: boolean);
|
||||
constructor(property: string, operator: string, value: any);
|
||||
constructor(property: string, operator: FilterQueryOpSymbol, value: any);
|
||||
constructor(property: string, operator: string, value: { value: any; isLiteral?: boolean; dataType?: breeze.DataType });
|
||||
constructor(property: string, operator: FilterQueryOpSymbol, value: { value: any; isLiteral?: boolean; dataType?: breeze.DataType });
|
||||
/** Create predicate from an expression tree */
|
||||
constructor(tree: Object);
|
||||
|
||||
and: PredicateMethod;
|
||||
static and: PredicateMethod;
|
||||
@@ -736,6 +789,8 @@ declare module breeze {
|
||||
toFunction(): Function;
|
||||
toString(): string;
|
||||
validate(entityType: EntityType): void;
|
||||
|
||||
toJSON(): string;
|
||||
}
|
||||
|
||||
interface PredicateMethod {
|
||||
@@ -747,37 +802,56 @@ declare module breeze {
|
||||
|
||||
class QueryOptions {
|
||||
static defaultInstance: QueryOptions;
|
||||
fetchStrategy: StrategySymbol;
|
||||
mergeStrategy: StrategySymbol;
|
||||
fetchStrategy: FetchStrategySymbol;
|
||||
mergeStrategy: MergeStrategySymbol;
|
||||
/** Whether query should return cached deleted entities (false by default) */
|
||||
includeDeleted: boolean
|
||||
|
||||
constructor (config?: QueryOptionsConfiguration);
|
||||
constructor(config?: QueryOptionsConfiguration);
|
||||
|
||||
setAsDefault(): void;
|
||||
using(config: QueryOptionsConfiguration): QueryOptions;
|
||||
using(config: StrategySymbol): QueryOptions;
|
||||
using(config: MergeStrategySymbol): QueryOptions;
|
||||
using(config: FetchStrategySymbol): QueryOptions;
|
||||
}
|
||||
|
||||
interface QueryOptionsConfiguration {
|
||||
fetchStrategy?: StrategySymbol;
|
||||
mergeStrategy?: StrategySymbol;
|
||||
fetchStrategy?: FetchStrategySymbol;
|
||||
mergeStrategy?: MergeStrategySymbol;
|
||||
}
|
||||
|
||||
interface HttpResponse {
|
||||
config: any;
|
||||
data: Entity[];
|
||||
error?: any;
|
||||
saveContext?: any;
|
||||
status: number;
|
||||
getHeaders(headerName: string): string
|
||||
}
|
||||
|
||||
interface QueryResult {
|
||||
/** Top level entities returned */
|
||||
results: Entity[];
|
||||
/** Query that was executed */
|
||||
query: EntityQuery;
|
||||
XHR: XMLHttpRequest;
|
||||
/** Raw response from the server */
|
||||
httpResponse: HttpResponse;
|
||||
/** EntityManager that executed the query */
|
||||
entityManager?: EntityManager;
|
||||
inlineCount?: number
|
||||
/** Total number of results available on the server */
|
||||
inlineCount?: number;
|
||||
/** All entities returned by the query. Differs from results when an expand is used. */
|
||||
retrievedEntities?: Entity[]
|
||||
}
|
||||
|
||||
class SaveOptions {
|
||||
allowConcurrentSaves: boolean;
|
||||
resourceName: string;
|
||||
dataService: DataService;
|
||||
tag: string;
|
||||
tag: Object;
|
||||
static defaultInstance: SaveOptions;
|
||||
|
||||
constructor (config?: { allowConcurrentSaves?: boolean; });
|
||||
constructor(config?: { allowConcurrentSaves?: boolean; });
|
||||
|
||||
setAsDefault(): SaveOptions;
|
||||
using(config: SaveOptionsConfiguration): SaveOptions;
|
||||
@@ -787,7 +861,7 @@ declare module breeze {
|
||||
allowConcurrentSaves?: boolean;
|
||||
resourceName?: string;
|
||||
dataService?: DataService;
|
||||
tag?: string;
|
||||
tag?: Object;
|
||||
}
|
||||
|
||||
interface SaveResult {
|
||||
@@ -805,7 +879,7 @@ declare module breeze {
|
||||
validator: Validator;
|
||||
getKey: (validator: Validator, property: string) => string;
|
||||
|
||||
constructor (validator: Validator, context: any, errorMessage: string, key: string);
|
||||
constructor(validator: Validator, context: any, errorMessage: string, key: string);
|
||||
}
|
||||
|
||||
class ValidationOptions {
|
||||
@@ -815,7 +889,7 @@ declare module breeze {
|
||||
validateOnQuery: boolean;
|
||||
validateOnSave: boolean;
|
||||
|
||||
constructor (config?: ValidationOptionsConfiguration);
|
||||
constructor(config?: ValidationOptionsConfiguration);
|
||||
|
||||
setAsDefault(): ValidationOptions;
|
||||
using(config: ValidationOptionsConfiguration): ValidationOptions;
|
||||
@@ -829,31 +903,65 @@ declare module breeze {
|
||||
}
|
||||
|
||||
class Validator {
|
||||
/** Map of standard error message templates keyed by validator name.*/
|
||||
static messageTemplates: any;
|
||||
context: any;
|
||||
name: string;
|
||||
|
||||
constructor (name: string, validatorFn: ValidatorFunction, context?: any);
|
||||
constructor(name: string, validatorFn: ValidatorFunction, context?: any);
|
||||
|
||||
static bool(): Validator;
|
||||
static byte(): Validator;
|
||||
/** integer between 0 and 255 inclusive */
|
||||
static byte(context?: { messageTemplate?: string }): Validator;
|
||||
static date(): Validator;
|
||||
/** Returns a ISO 8601 duration string Validator. */
|
||||
static duration(): Validator;
|
||||
/** Validators number, double, and single are all the same */
|
||||
static number(context?: { messageTemplate?: string }): Validator;
|
||||
/** Validators number, double, and single are all the same */
|
||||
static double(context?: { messageTemplate?: string }): Validator;
|
||||
/** Validators number, double, and single are all the same */
|
||||
static single(context?: { messageTemplate?: string }): Validator;
|
||||
|
||||
static guid(): Validator;
|
||||
static int16(): Validator;
|
||||
static int32(): Validator;
|
||||
static int64(): Validator;
|
||||
static maxLength(context: { maxLength: number; }): Validator;
|
||||
static number(): Validator;
|
||||
static required(): Validator;
|
||||
static int16(context?: { messageTemplate?: string }): Validator;
|
||||
static int32(context?: { messageTemplate?: string }): Validator;
|
||||
static int64(context?: { messageTemplate?: string }): Validator;
|
||||
/** Same as int64 */
|
||||
static integer(context?: { messageTemplate?: string }): Validator;
|
||||
static maxLength(context: { maxLength: number; messageTemplate?: string }): Validator;
|
||||
static required(context?: { messageTemplate?: string }): Validator;
|
||||
static string(): Validator;
|
||||
static stringLength(context: { maxLength: number; minLength: number; }): Validator;
|
||||
|
||||
static register(validator: Validator): void;
|
||||
static registerFactory(fn: () => Validator, name: string): void;
|
||||
static stringLength(context: { maxLength: number; minLength: number; messageTemplate?: string }): Validator;
|
||||
/** Returns a credit card number validator that performs a Luhn algorithm checksum test for plausability */
|
||||
static creditCard(context?: { messageTemplate?: string }): Validator;
|
||||
/** Returns a regular expression validator; the expression must be specified in the context parameter */
|
||||
static regularExpression(context: { expression: RegExp; messageTemplate?: string }): Validator;
|
||||
/** Returns the email address validator */
|
||||
static emailAddress(context?: { messageTemplate?: string }): Validator;
|
||||
/** Returns the phone validator, which handles prefix, country code, area code, and local number, with [-/. ] break characters. */
|
||||
static phone(context?: { messageTemplate?: string }): Validator;
|
||||
/** Returns the URL (protocol required) validator */
|
||||
static url(context?: { messageTemplate?: string }): Validator;
|
||||
/** Always returns true */
|
||||
static none(): Validator;
|
||||
|
||||
/** Creates a validator instance from a JSON object or an array of instances from an array of JSON objects. */
|
||||
static fromJSON(json: string): Validator;
|
||||
/** Register a validator instance so that any deserialized metadata can reference it. */
|
||||
static register(validator: Validator): void;
|
||||
/** Register a validator factory so that any deserialized metadata can reference it. */
|
||||
static registerFactory(fn: () => Validator, name: string): void;
|
||||
/** Creates a regular expression validator with a fixed expression. */
|
||||
static makeRegExpValidator(validatorName: string, expression: RegExp, defaultMessage: string, context?: any): Validator;
|
||||
|
||||
/** Run this validator against the specified value.
|
||||
@param value {Object} Value to validate
|
||||
@param additionalContext {Object} Any additional contextual information that the Validator can make use of.
|
||||
@return {ValidationError|null} A ValidationError if validation fails, null otherwise */
|
||||
validate(value: any, context?: any): ValidationError;
|
||||
|
||||
/** Returns the message generated by the most recent execution of this Validator. */
|
||||
getMessage(): string;
|
||||
}
|
||||
|
||||
@@ -879,18 +987,94 @@ declare module breeze.config {
|
||||
var ajax: string;
|
||||
var dataService: string;
|
||||
var functionRegistry: Object;
|
||||
export function getAdapter(interfaceName: string, adapterName: string): Object;
|
||||
/**
|
||||
Returns the ctor function used to implement a specific interface with a specific adapter name.
|
||||
@method getAdapter
|
||||
@param interfaceName {String} One of the following interface names "ajax", "dataService" or "modelLibrary"
|
||||
@param [adapterName] {String} The name of any previously registered adapter. If this parameter is omitted then
|
||||
this method returns the "default" adapter for this interface. If there is no default adapter, then a null is returned.
|
||||
@return {Function|null} Returns either a ctor function or null.
|
||||
**/
|
||||
export function getAdapter(interfaceName: string, adapterName?: string): Function;
|
||||
/**
|
||||
Returns the adapter instance corresponding to the specified interface and adapter names.
|
||||
@method getAdapterInstance
|
||||
@param interfaceName {String} The name of the interface.
|
||||
@param [adapterName] {String} - The name of a previously registered adapter. If this parameter is
|
||||
omitted then the default implementation of the specified interface is returned. If there is
|
||||
no defaultInstance of this interface, then the first registered instance of this interface is returned.
|
||||
@return {an instance of the specified adapter}
|
||||
**/
|
||||
export function getAdapterInstance(interfaceName: string, adapterName?: string): Object;
|
||||
export function initializeAdapterInstance(interfaceName: string, adapterName: string, isDefault: boolean): void;
|
||||
export function initializeAdapterInstances(config: Object): void;
|
||||
/**
|
||||
Initializes a single adapter implementation. Initialization means either newing a instance of the
|
||||
specified interface and then calling "initialize" on it or simply calling "initialize" on the instance
|
||||
if it already exists.
|
||||
@method initializeAdapterInstance
|
||||
@param interfaceName {String} The name of the interface to which the adapter to initialize belongs.
|
||||
@param adapterName {String} - The name of a previously registered adapter to initialize.
|
||||
@param [isDefault=true] {Boolean} - Whether to make this the default "adapter" for this interface.
|
||||
@return {an instance of the specified adapter}
|
||||
**/
|
||||
export function initializeAdapterInstance(interfaceName: string, adapterName: string, isDefault?: boolean): void;
|
||||
/**
|
||||
Initializes a collection of adapter implementations and makes each one the default for its corresponding interface.
|
||||
@method initializeAdapterInstances
|
||||
@param config {Object}
|
||||
@param [config.ajax] {String} - the name of a previously registered "ajax" adapter
|
||||
@param [config.dataService] {String} - the name of a previously registered "dataService" adapter
|
||||
@param [config.modelLibrary] {String} - the name of a previously registered "modelLibrary" adapter
|
||||
@param [config.uriBuilder] {String} - the name of a previously registered "uriBuilder" adapter
|
||||
@return [array of instances]
|
||||
**/
|
||||
export function initializeAdapterInstances(config: Object): Object[];
|
||||
var interfaceInitialized: Event;
|
||||
var interfaceRegistry: Object;
|
||||
var objectRegistry: Object;
|
||||
/**
|
||||
Method use to register implementations of standard breeze interfaces. Calls to this method are usually
|
||||
made as the last step within an adapter implementation.
|
||||
@method registerAdapter
|
||||
@param interfaceName {String} - one of the following interface names "ajax", "dataService" or "modelLibrary"
|
||||
@param adapterCtor {Function} - an ctor function that returns an instance of the specified interface.
|
||||
**/
|
||||
export function registerAdapter(interfaceName: string, adapterCtor: Function): void;
|
||||
export function registerFunction(fn: Function, fnName: string): void;
|
||||
export function registerType(ctor: Function, typeName: string): void;
|
||||
//static setProperties(config: Object): void; //deprecated
|
||||
/**
|
||||
Set the promise implementation, if Q.js is not found.
|
||||
@param q - implementation of promise. @see http://wiki.commonjs.org/wiki/Promises/A
|
||||
*/
|
||||
export function setQ(q: breeze.promises.IPromiseService): void;
|
||||
var stringifyPad: string;
|
||||
var typeRegistry: Object;
|
||||
|
||||
}
|
||||
|
||||
/** Promises interface used by Breeze. Usually implemented by Q (https://github.com/kriskowal/q) or angular.$q using breeze.config.setQ(impl) */
|
||||
declare module breeze.promises {
|
||||
interface IPromise<T> {
|
||||
then<U>(onFulfill: (value: T) => U, onReject?: (reason: any) => U): IPromise<U>;
|
||||
then<U>(onFulfill: (value: T) => IPromise<U>, onReject?: (reason: any) => U): IPromise<U>;
|
||||
then<U>(onFulfill: (value: T) => U, onReject?: (reason: any) => IPromise<U>): IPromise<U>;
|
||||
then<U>(onFulfill: (value: T) => IPromise<U>, onReject?: (reason: any) => IPromise<U>): IPromise<U>;
|
||||
catch<U>(onRejected: (reason: any) => U): IPromise<U>;
|
||||
catch<U>(onRejected: (reason: any) => IPromise<U>): IPromise<U>;
|
||||
finally(finallyCallback: () => any): IPromise<T>;
|
||||
}
|
||||
|
||||
interface IDeferred<T> {
|
||||
promise: IPromise<T>;
|
||||
resolve(value: T): void;
|
||||
reject(reason: any): void;
|
||||
}
|
||||
|
||||
interface IPromiseService {
|
||||
defer<T>(): IDeferred<T>;
|
||||
reject(reason?: any): IPromise<any>;
|
||||
resolve<T>(object: T): IPromise<T>;
|
||||
resolve<T>(object: IPromise<T>): IPromise<T>;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+5
-5
@@ -18,8 +18,8 @@ declare module "bunyan" {
|
||||
child(obj:Object, simple?:boolean):Logger;
|
||||
reopenFileStreams():void;
|
||||
|
||||
level(value:any /* number | string */):void;
|
||||
levels(name:any /* number | string */, value:any /* number | string */):void;
|
||||
level(value: number | string):void;
|
||||
levels(name: number | string, value: number | string):void;
|
||||
|
||||
trace(error:Error, format?:any, ...params:any[]):void;
|
||||
trace(buffer:Buffer, format?:any, ...params:any[]):void;
|
||||
@@ -62,9 +62,9 @@ declare module "bunyan" {
|
||||
|
||||
interface Stream {
|
||||
type?: string;
|
||||
level?: any; // number | string
|
||||
level?: number | string;
|
||||
path?: string;
|
||||
stream?: WritableStream;
|
||||
stream?: WritableStream | Stream;
|
||||
closeOnExit?: boolean;
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ declare module "bunyan" {
|
||||
export var ERROR:number;
|
||||
export var FATAL:number;
|
||||
|
||||
export function resolveLevel(value:any /* number | string */):number;
|
||||
export function resolveLevel(value: number | string):number;
|
||||
|
||||
export function createLogger(options:LoggerOptions):Logger;
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
|
||||
Vendored
+6
-1
@@ -12,6 +12,8 @@ declare class CamlBuilder {
|
||||
@param viewFields If omitted, default view fields are requested; otherwise, only values for the fields with the specified internal names are returned.
|
||||
Specifying view fields is a good practice, as it decreases traffic between server and client. */
|
||||
public View(viewFields?: string[]): CamlBuilder.IView;
|
||||
/** Generate <ViewFields> tag for SPServices */
|
||||
public ViewFields(viewFields: string[]): CamlBuilder.IFinalizableToString;
|
||||
/** Use for:
|
||||
1. SPServices CAMLQuery attribute
|
||||
2. Creating partial expressions
|
||||
@@ -58,9 +60,11 @@ declare module CamlBuilder {
|
||||
interface IQuery {
|
||||
Where(): IFieldExpression;
|
||||
}
|
||||
interface IFinalizable {
|
||||
interface IFinalizableToString {
|
||||
/** Get the resulting CAML query as string */
|
||||
ToString(): string;
|
||||
}
|
||||
interface IFinalizable extends IFinalizableToString {
|
||||
/** Get the resulting CAML query as SP.CamlQuery object */
|
||||
ToCamlQuery(): any;
|
||||
}
|
||||
@@ -333,6 +337,7 @@ declare module CamlBuilder {
|
||||
}
|
||||
class Internal {
|
||||
static createView(viewFields?: string[]): IView;
|
||||
static createViewFields(viewFields: string[]): IFinalizableToString;
|
||||
static createWhere(): IFieldExpression;
|
||||
static createExpression(): IFieldExpression;
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
/// <reference path="../chai/chai.d.ts" />
|
||||
/// <reference path="chai-as-promised.d.ts" />
|
||||
|
||||
import chai = require('chai');
|
||||
import chaiAsPromised = require('chai-as-promised');
|
||||
|
||||
chai.use(chaiAsPromised);
|
||||
|
||||
var promise: any;
|
||||
chai.expect(promise).to.eventually.equal(3);
|
||||
chai.expect(promise).to.become(3);
|
||||
chai.expect(promise).to.be.rejected;
|
||||
chai.expect(promise).to.be.rejectedWith(Error);
|
||||
chai.expect(promise).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");
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
// Type definitions for chai-as-promised
|
||||
// Project: https://github.com/domenic/chai-as-promised/
|
||||
// Definitions by: jt000 <https://github.com/jt000>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../chai/chai.d.ts" />
|
||||
|
||||
declare module 'chai-as-promised' {
|
||||
import chai = require('chai');
|
||||
|
||||
function chaiAsPromised(chai: any, utils: any): void;
|
||||
|
||||
export = chaiAsPromised;
|
||||
}
|
||||
|
||||
declare module chai {
|
||||
|
||||
interface LanguageChains {
|
||||
become(expected: any): Expect;
|
||||
eventually: Expect;
|
||||
rejected: Expect;
|
||||
rejectedWith(expected: any): Expect;
|
||||
notify(fn: Function): Expect;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
/// <reference path="../when/when.d.ts" />
|
||||
/// <reference path="./chai-http.d.ts" />
|
||||
|
||||
import fs = require('fs');
|
||||
import http = require('http');
|
||||
import chai = require('chai');
|
||||
import chaiHttp = require('chai-http');
|
||||
import when = require('when');
|
||||
|
||||
chai.use(chaiHttp);
|
||||
|
||||
// Add promise support if this does not exist natively.
|
||||
if (!global.Promise) {
|
||||
chai.request.addPromises(when.promise);
|
||||
}
|
||||
|
||||
|
||||
var app: http.Server;
|
||||
|
||||
chai.request(app).get('/');
|
||||
chai.request('http://localhost:8080').get('/');
|
||||
|
||||
chai.request(app)
|
||||
.put('/user/me')
|
||||
.set('X-API-Key', 'foobar')
|
||||
.send({ password: '123', confirmPassword: '123' });
|
||||
|
||||
chai.request(app)
|
||||
.post('/user/me')
|
||||
.field('_method', 'put')
|
||||
.field('password', '123')
|
||||
.field('confirmPassword', '123');
|
||||
|
||||
chai.request(app)
|
||||
.post('/user/avatar')
|
||||
.attach('imageField', fs.readFileSync('avatar.png'), 'avatar.png');
|
||||
|
||||
chai.request(app)
|
||||
.get('/protected')
|
||||
.auth('user', 'pass');
|
||||
|
||||
chai.request(app)
|
||||
.get('/search')
|
||||
.query('name', 'foo')
|
||||
.query('limit', '10');
|
||||
|
||||
chai.request(app)
|
||||
.put('/user/me')
|
||||
.send({ passsword: '123', confirmPassword: '123' })
|
||||
.end((err: any, res: chaiHttp.Response) => {
|
||||
chai.expect(err).to.be.null;
|
||||
chai.expect(res).to.have.status(200);
|
||||
});
|
||||
|
||||
chai.request(app)
|
||||
.put('/user/me')
|
||||
.send({ passsword: '123', confirmPassword: '123' })
|
||||
.then((res: chaiHttp.Response) => chai.expect(res).to.have.status(200))
|
||||
.catch((err: any) => { throw err; });
|
||||
|
||||
var agent = chai.request.agent(app);
|
||||
|
||||
agent
|
||||
.post('/session')
|
||||
.send({ username: 'me', password: '123' })
|
||||
.then((res: chaiHttp.Response) => {
|
||||
chai.expect(res).to.have.cookie('sessionid');
|
||||
// The `agent` now has the sessionid cookie saved, and will send it
|
||||
// back to the server in the next request:
|
||||
return agent.get('/user/me')
|
||||
.then((res: chaiHttp.Response) => chai.expect(res).to.have.status(200));
|
||||
});
|
||||
|
||||
function test1() {
|
||||
var req = chai.request(app).get('/');
|
||||
req.then((res: chaiHttp.Response) => {
|
||||
chai.expect(res).to.have.status(200);
|
||||
chai.expect(res).to.have.header('content-type', 'text/plain');
|
||||
chai.expect(res).to.have.header('content-type', /^text/);
|
||||
chai.expect(res).to.have.headers;
|
||||
chai.expect('127.0.0.1').to.be.an.ip;
|
||||
chai.expect(res).to.be.json;
|
||||
chai.expect(res).to.be.html;
|
||||
chai.expect(res).to.be.text;
|
||||
chai.expect(res).to.redirect;
|
||||
chai.expect(res).to.redirectTo('http://example.com');
|
||||
chai.expect(res).to.have.param('orderby');
|
||||
chai.expect(res).to.have.param('orderby', 'date');
|
||||
chai.expect(res).to.not.have.param('limit');
|
||||
chai.expect(req).to.have.cookie('session_id');
|
||||
chai.expect(req).to.have.cookie('session_id', '1234');
|
||||
chai.expect(req).to.not.have.cookie('PHPSESSID');
|
||||
chai.expect(res).to.have.cookie('session_id');
|
||||
chai.expect(res).to.have.cookie('session_id', '1234');
|
||||
chai.expect(res).to.not.have.cookie('PHPSESSID');
|
||||
chai.expect(res.body).to.have.property('version', '4.0.0');
|
||||
}, (err: any) => {
|
||||
throw err;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
when(chai.request(app).get('/')).done(() => console.log('success'), () => console.log('failure'));
|
||||
Vendored
+87
@@ -0,0 +1,87 @@
|
||||
// Type definitions for chai-http
|
||||
// Project: https://github.com/chaijs/chai-http
|
||||
// Definitions by: Wim Looman <https://github.com/Nemo157>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
/// <reference path="../chai/chai.d.ts" />
|
||||
|
||||
declare module chai {
|
||||
export function request(server: any): chaiHttp.Agent;
|
||||
|
||||
export module request {
|
||||
export function agent(server: any): chaiHttp.Agent;
|
||||
export function addPromises(promiseConstructor: chaiHttp.PromiseConstructor): void;
|
||||
}
|
||||
|
||||
interface Assertions extends chaiHttp.Assertions {
|
||||
}
|
||||
|
||||
interface TypeComparison extends chaiHttp.TypeComparison {
|
||||
}
|
||||
}
|
||||
|
||||
declare function chaiHttp(chai: any, utils: any): void;
|
||||
declare module chaiHttp {
|
||||
interface PromiseConstructor {
|
||||
<T>(resolver: (resolve: (value: T) => void, reject: (reason: any) => void) => void): Promise<T>;
|
||||
}
|
||||
|
||||
interface Promise<T> {
|
||||
then<U>(onFulfilled: (value: T) => U, onRejected?: (reason: any) => U): Promise<U>;
|
||||
}
|
||||
|
||||
interface Response {
|
||||
body: any;
|
||||
type: string;
|
||||
status: number;
|
||||
}
|
||||
|
||||
interface Request extends FinishedRequest {
|
||||
attach(field: string, file: string, filename: string): Request;
|
||||
attach(field: string, file: Buffer, filename: string): Request;
|
||||
set(field: string, val: string): Request;
|
||||
query(key: string, value: string): Request;
|
||||
send(data: Object): Request;
|
||||
auth(user: string, name: string): Request;
|
||||
field(name: string, val: string): Request;
|
||||
end(callback?: (err: any, res: Response) => void): FinishedRequest;
|
||||
}
|
||||
|
||||
interface FinishedRequest {
|
||||
then(success?: (res: Response) => void, failure?: (err: any) => void): FinishedRequest;
|
||||
catch(failure?: (err: any) => void): FinishedRequest;
|
||||
}
|
||||
|
||||
interface Agent {
|
||||
get(url: string, callback?: (err: any, res: Response) => void): Request;
|
||||
post(url: string, callback?: (err: any, res: Response) => void): Request;
|
||||
put(url: string, callback?: (err: any, res: Response) => void): Request;
|
||||
head(url: string, callback?: (err: any, res: Response) => void): Request;
|
||||
del(url: string, callback?: (err: any, res: Response) => void): Request;
|
||||
options(url: string, callback?: (err: any, res: Response) => void): Request;
|
||||
patch(url: string, callback?: (err: any, res: Response) => void): Request;
|
||||
}
|
||||
|
||||
interface Assertions {
|
||||
status(code: number): any;
|
||||
header(key: string, value?: string): any;
|
||||
header(key: string, value?: RegExp): any;
|
||||
headers: any;
|
||||
json: any;
|
||||
// text: any;
|
||||
// html: any;
|
||||
redirect: any;
|
||||
redirectTo(location: string): any;
|
||||
param(key: string, value?: string): any;
|
||||
cookie(key: string, value?: string): any;
|
||||
}
|
||||
|
||||
interface TypeComparison {
|
||||
ip: any;
|
||||
}
|
||||
}
|
||||
|
||||
declare module "chai-http" {
|
||||
export = chaiHttp;
|
||||
}
|
||||
Vendored
+2
-2
@@ -12,8 +12,8 @@ declare module chai {
|
||||
stack: string;
|
||||
}
|
||||
|
||||
function expect(target: any, message?: string): Expect;
|
||||
|
||||
export function expect(target: any, message?: string): Expect;
|
||||
|
||||
export var assert: Assert;
|
||||
export var config: Config;
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
|
||||
Vendored
+2
-2
@@ -18,7 +18,7 @@ declare module chrome.app.runtime {
|
||||
}
|
||||
|
||||
interface LaunchDataItem {
|
||||
entry: File;
|
||||
entry: FileEntry;
|
||||
type: string;
|
||||
}
|
||||
|
||||
@@ -367,4 +367,4 @@ declare module chrome.sockets.tcpServer {
|
||||
|
||||
var onAccept: Event<AcceptEventArgs>;
|
||||
var onAcceptError: Event<AcceptErrorEventArgs>;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
|
||||
Vendored
+21
-10
@@ -397,7 +397,7 @@ declare module chrome.cookies {
|
||||
}
|
||||
|
||||
export function getAllCookieStores(callback: (cookieStores: CookieStore[]) => void): void;
|
||||
export function getAll(details: GetAllDetails, callback: (cookies: Cookie) => void): void;
|
||||
export function getAll(details: GetAllDetails, callback: (cookies: Cookie[]) => void): void;
|
||||
export function set(details: SetDetails, callback?: (cookie?: Cookie) => void): void;
|
||||
export function remove(details: Details, callback?: (details: Details) => void): void;
|
||||
export function get(details: Details, callback: (cookie?: Cookie) => void): void;
|
||||
@@ -2089,11 +2089,17 @@ declare module chrome.webNavigation {
|
||||
interface GetFrameResultDetails {
|
||||
url: string;
|
||||
errorOccurred: boolean;
|
||||
parentFrameId: number;
|
||||
}
|
||||
|
||||
interface GetAllFrameDetails {
|
||||
tabId: number;
|
||||
}
|
||||
|
||||
interface GetAllFrameResultDetails extends GetFrameResultDetails {
|
||||
processId: number;
|
||||
frameId: number;
|
||||
}
|
||||
|
||||
interface ReferenceFragmentUpdatedDetails {
|
||||
processId: number;
|
||||
@@ -2144,6 +2150,7 @@ declare module chrome.webNavigation {
|
||||
url: string;
|
||||
timeStamp: number;
|
||||
frameId: number;
|
||||
parentFrameId: number;
|
||||
}
|
||||
|
||||
interface CommittedDetails {
|
||||
@@ -2173,20 +2180,24 @@ declare module chrome.webNavigation {
|
||||
error: string;
|
||||
}
|
||||
|
||||
interface WebNavigationEventFilters {
|
||||
url: chrome.events.UrlFilter[];
|
||||
}
|
||||
|
||||
interface WebNavigationReferenceFragmentUpdatedEvent extends chrome.events.Event {
|
||||
addListener(callback: (details: ReferenceFragmentUpdatedDetails) => void): void;
|
||||
addListener(callback: (details: ReferenceFragmentUpdatedDetails) => void, filters? : WebNavigationEventFilters): void;
|
||||
}
|
||||
|
||||
interface WebNavigationCompletedEvent extends chrome.events.Event {
|
||||
addListener(callback: (details: CompletedDetails) => void): void;
|
||||
addListener(callback: (details: CompletedDetails) => void, filters? : WebNavigationEventFilters): void;
|
||||
}
|
||||
|
||||
interface WebNavigationHistoryStateUpdatedEvent extends chrome.events.Event {
|
||||
addListener(callback: (details: HistoryStateUpdatedDetails) => void): void;
|
||||
addListener(callback: (details: HistoryStateUpdatedDetails) => void, filters?: WebNavigationEventFilters): void;
|
||||
}
|
||||
|
||||
interface WebNavigationCreatedNavigationTargetEvent extends chrome.events.Event {
|
||||
addListener(callback: (details: CreatedNavigationTargetDetails) => void): void;
|
||||
addListener(callback: (details: CreatedNavigationTargetDetails) => void, filters?: WebNavigationEventFilters): void;
|
||||
}
|
||||
|
||||
interface WebNavigationTabReplacedEvent extends chrome.events.Event {
|
||||
@@ -2194,23 +2205,23 @@ declare module chrome.webNavigation {
|
||||
}
|
||||
|
||||
interface WebNavigationBeforeNavigateEvent extends chrome.events.Event {
|
||||
addListener(callback: (details: BeforeNavigateDetails) => void): void;
|
||||
addListener(callback: (details: BeforeNavigateDetails) => void, filters?: WebNavigationEventFilters): void;
|
||||
}
|
||||
|
||||
interface WebNavigationCommittedEvent extends chrome.events.Event {
|
||||
addListener(callback: (details: CommittedDetails) => void): void;
|
||||
addListener(callback: (details: CommittedDetails) => void, filters?: WebNavigationEventFilters): void;
|
||||
}
|
||||
|
||||
interface WebNavigationDomContentLoadedEvent extends chrome.events.Event {
|
||||
addListener(callback: (details: DomContentLoadedDetails) => void): void;
|
||||
addListener(callback: (details: DomContentLoadedDetails) => void, filters?: WebNavigationEventFilters): void;
|
||||
}
|
||||
|
||||
interface WebNavigationErrorOccurredEvent extends chrome.events.Event {
|
||||
addListener(callback: (details: ErrorOccurredDetails) => void): void;
|
||||
addListener(callback: (details: ErrorOccurredDetails) => void, filters?: WebNavigationEventFilters): void;
|
||||
}
|
||||
|
||||
export function getFrame(details: GetFrameDetails, callback: (details?: GetFrameResultDetails) => void): void;
|
||||
export function getAllFrames(details: GetAllFrameDetails, callback: (details?: Object[]) => void): void;
|
||||
export function getAllFrames(details: GetAllFrameDetails, callback: (details?: GetAllFrameResultDetails[]) => void): void;
|
||||
|
||||
var onReferenceFragmentUpdated: WebNavigationReferenceFragmentUpdatedEvent;
|
||||
var onCompleted: WebNavigationCompletedEvent;
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
/// <reference path='convict.d.ts' />
|
||||
/// <reference path='../validator/validator.d.ts' />
|
||||
|
||||
import convict = require('convict');
|
||||
import validator = require('validator');
|
||||
|
||||
// define a schema
|
||||
|
||||
var conf = convict({
|
||||
env: {
|
||||
doc: 'The applicaton environment.',
|
||||
format: ['production', 'development', 'test'],
|
||||
default: 'development',
|
||||
env: 'NODE_ENV',
|
||||
arg: 'node-env',
|
||||
},
|
||||
ip: {
|
||||
doc: 'The IP address to bind.',
|
||||
format: 'ipaddress',
|
||||
default: '127.0.0.1',
|
||||
env: 'IP_ADDRESS',
|
||||
},
|
||||
port: {
|
||||
doc: 'The port to bind.',
|
||||
format: 'port',
|
||||
default: 0,
|
||||
env: 'PORT',
|
||||
arg: 'port',
|
||||
},
|
||||
key: {
|
||||
doc: "API key",
|
||||
format: (val: string) => validator.isUUID(val),
|
||||
default: '01527E56-8431-11E4-AF91-47B661C210CA'
|
||||
},
|
||||
db: {
|
||||
ip: {
|
||||
doc: 'The IP address to bind.',
|
||||
format: 'ipaddress',
|
||||
default: '127.0.0.1',
|
||||
env: 'IP_ADDRESS',
|
||||
},
|
||||
port: {
|
||||
doc: 'The port to bind.',
|
||||
format: 'port',
|
||||
default: 0,
|
||||
env: 'PORT',
|
||||
arg: 'port',
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
// load environment dependent configuration
|
||||
|
||||
var env = conf.get('env');
|
||||
var dbip = conf.get('db.ip');
|
||||
conf.loadFile('./config/' + env + '.json');
|
||||
conf.loadFile(['./configs/always.json', './configs/sometimes.json']);
|
||||
|
||||
// perform validation
|
||||
|
||||
conf.validate();
|
||||
|
||||
var port: number = conf.default('port');
|
||||
|
||||
if (conf.has('key')) {
|
||||
conf.set('the.awesome', true);
|
||||
conf.load({
|
||||
thing: {
|
||||
a: 'b'
|
||||
}
|
||||
});
|
||||
}
|
||||
// vim:et:sw=2:ts=2
|
||||
Vendored
+33
@@ -0,0 +1,33 @@
|
||||
// Type definitions for node-convict v0.6.0
|
||||
// Project: https://github.com/mozilla/node-convict
|
||||
// Definitions by: Wim Looman <https://github.com/Nemo157>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module "convict" {
|
||||
function convict(schema: convict.Schema): convict.Config;
|
||||
|
||||
module convict {
|
||||
interface Schema {
|
||||
[name: string]: convict.Schema | {
|
||||
default: any;
|
||||
doc?: string;
|
||||
format?: any;
|
||||
env?: string;
|
||||
arg?: string;
|
||||
};
|
||||
}
|
||||
|
||||
interface Config {
|
||||
get(name: string): any;
|
||||
default(name: string): any;
|
||||
has(name: string): boolean;
|
||||
set(name: string, value: any): void;
|
||||
load(conf: Object): void;
|
||||
loadFile(file: string): void;
|
||||
loadFile(files: string[]): void;
|
||||
validate(): void;
|
||||
}
|
||||
}
|
||||
|
||||
export = convict;
|
||||
}
|
||||
Vendored
+3
-2
@@ -2,9 +2,9 @@
|
||||
// Project: http://cordova.apache.org
|
||||
// Definitions by: Microsoft Open Technologies Inc. <http://msopentech.com>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
//
|
||||
//
|
||||
// Copyright (c) Microsoft Open Technologies, Inc.
|
||||
// Licensed under the MIT license.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
/// <reference path="plugins/BatteryStatus.d.ts"/>
|
||||
/// <reference path="plugins/Camera.d.ts"/>
|
||||
@@ -22,6 +22,7 @@
|
||||
/// <reference path="plugins/NetworkInformation.d.ts"/>
|
||||
/// <reference path="plugins/Push.d.ts"/>
|
||||
/// <reference path="plugins/Splashscreen.d.ts"/>
|
||||
/// <reference path="plugins/StatusBar.d.ts"/>
|
||||
/// <reference path="plugins/Vibration.d.ts"/>
|
||||
/// <reference path="plugins/WebSQL.d.ts"/>
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
// Licensed under the MIT license.
|
||||
|
||||
/// <reference path="StatusBar.d.ts" />
|
||||
|
||||
var statusBar: StatusBar = window.StatusBar;
|
||||
statusBar.overlaysWebView(true);
|
||||
statusBar.overlaysWebView(false);
|
||||
statusBar.styleDefault();
|
||||
statusBar.styleLightContent();
|
||||
statusBar.styleBlackTranslucent();
|
||||
statusBar.styleBlackOpaque();
|
||||
statusBar.backgroundColorByName("red");
|
||||
statusBar.backgroundColorByHexString("#aaa");
|
||||
statusBar.hide();
|
||||
statusBar.show();
|
||||
var visible: boolean = statusBar.isVisible;
|
||||
Vendored
+75
@@ -0,0 +1,75 @@
|
||||
// Type definitions for Apache Cordova StatusBar plugin.
|
||||
// Project: https://github.com/apache/cordova-plugin-statusbar
|
||||
// Definitions by: Xinkai Chen <https://github.com/Xinkai>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* Global object StatusBar.
|
||||
*/
|
||||
interface Window {
|
||||
StatusBar: StatusBar;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The StatusBar object provides some functions to customize the iOS and Android StatusBar.
|
||||
*/
|
||||
interface StatusBar {
|
||||
/**
|
||||
* On iOS 7, make the statusbar overlay or not overlay the WebView.
|
||||
* @param isOverlay On iOS 7, set to false to make the statusbar appear like iOS 6.
|
||||
* Set the style and background color to suit using the other functions.
|
||||
*/
|
||||
overlaysWebView: (isOverlay: boolean) => void;
|
||||
|
||||
/**
|
||||
* Use the default statusbar (dark text, for light backgrounds).
|
||||
*/
|
||||
styleDefault: () => void;
|
||||
|
||||
/**
|
||||
* Use the lightContent statusbar (light text, for dark backgrounds).
|
||||
*/
|
||||
styleLightContent: () => void;
|
||||
|
||||
/**
|
||||
* Use the blackTranslucent statusbar (light text, for dark backgrounds).
|
||||
*/
|
||||
styleBlackTranslucent: () => void;
|
||||
|
||||
/**
|
||||
* Use the blackOpaque statusbar (light text, for dark backgrounds).
|
||||
*/
|
||||
styleBlackOpaque: () => void;
|
||||
|
||||
/**
|
||||
* On iOS 7, when you set StatusBar.statusBarOverlaysWebView to false,
|
||||
* you can set the background color of the statusbar by color name.
|
||||
* @param color Supported color names are:
|
||||
* black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown
|
||||
*/
|
||||
backgroundColorByName: (color: string) => void;
|
||||
|
||||
/**
|
||||
* Sets the background color of the statusbar by a hex string.
|
||||
* @param color CSS shorthand properties are also supported.
|
||||
* On iOS 7, when you set StatusBar.statusBarOverlaysWebView to false, you can set the background color of the statusbar by a hex string (#RRGGBB).
|
||||
* On WP7 and WP8 you can also specify values as #AARRGGBB, where AA is an alpha value
|
||||
*/
|
||||
backgroundColorByHexString: (color: string) => void;
|
||||
|
||||
/**
|
||||
* Hide the statusbar.
|
||||
*/
|
||||
hide: () => void;
|
||||
|
||||
/**
|
||||
* Show the statusbar.
|
||||
*/
|
||||
show: () => void;
|
||||
|
||||
/**
|
||||
* Read this property to see if the statusbar is visible or not.
|
||||
*/
|
||||
isVisible: boolean;
|
||||
}
|
||||
Vendored
+2
-2
@@ -62,12 +62,12 @@ interface SqlTransaction {
|
||||
* @param sql SQL statement to execute.
|
||||
* @param arguments SQL stetement arguments.
|
||||
* @param successCallback Called in case of query has been successfully done.
|
||||
* @param errorCallback Called, when query fails.
|
||||
* @param errorCallback Called, when query fails. Return false to continue transaction; true or no return to rollback.
|
||||
*/
|
||||
executeSql(sql: string,
|
||||
arguments?: any[],
|
||||
successCallback?: (transaction: SqlTransaction, resultSet: SqlResultSet) => void,
|
||||
errorCallback?: (transaction: SqlTransaction, error: SqlError) => void): void;
|
||||
errorCallback?: (transaction: SqlTransaction, error: SqlError) => any): void;
|
||||
}
|
||||
|
||||
declare var SqlTransaction: {
|
||||
|
||||
Vendored
+3
@@ -56,6 +56,7 @@ declare module createjs {
|
||||
clone(): Event;
|
||||
preventDefault(): void;
|
||||
remove(): void;
|
||||
set(props: Object): Event;
|
||||
stopImmediatePropagation(): void;
|
||||
stopPropagation(): void;
|
||||
toString(): string;
|
||||
@@ -93,7 +94,9 @@ declare module createjs {
|
||||
willTrigger(type: string): boolean;
|
||||
}
|
||||
|
||||
export function extend(subclass: () => any, superclass: () => any): () => any; // returns the subclass prototype
|
||||
export function indexOf(array: any[], searchElement: Object): number;
|
||||
export function promote(subclass: () => any, prefix: string): () => any;
|
||||
|
||||
export function proxy(method: (eventObj: Object) => boolean, scope: Object, ...arg: any[]): (eventObj: Object) => any;
|
||||
export function proxy(method: (eventObj: Object) => void, scope: Object, ...arg: any[]): (eventObj: Object) => any;
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
/// <reference path="../d3/d3.d.ts" />
|
||||
/// <reference path="d3.cloud.layout.d.ts" />
|
||||
|
||||
interface ICompTextSize{
|
||||
text:string;
|
||||
size:number;
|
||||
x?:number;
|
||||
y?:number;
|
||||
rotate?:number;
|
||||
}
|
||||
|
||||
|
||||
var fill = d3.scale.category20();
|
||||
d3.layout.cloud().size([300, 300])
|
||||
.words([
|
||||
"Hello", "world", "normally", "you", "want", "more", "words",
|
||||
"than", "this"].map(function(d:string) {
|
||||
return {text: d, size: 10 + Math.random() * 90};
|
||||
}))
|
||||
.padding(5)
|
||||
.rotate(function() { return ~~(Math.random() * 2) * 90; })
|
||||
.font("Impact")
|
||||
.fontSize(function(d:ICompTextSize) { return d.size; })
|
||||
.on("end", draw)
|
||||
.start();
|
||||
function draw(words:ICompTextSize[]) {
|
||||
d3.select("body").append("svg")
|
||||
.attr("width", 300)
|
||||
.attr("height", 300)
|
||||
.append("g")
|
||||
.attr("transform", "translate(150,150)")
|
||||
.selectAll("text")
|
||||
.data(words)
|
||||
.enter().append("text")
|
||||
.style("font-size", function(d:ICompTextSize) { return d.size + "px"; })
|
||||
.style("font-family", "Impact")
|
||||
.style("fill", function(d:ICompTextSize, i:number) { return fill(i); })
|
||||
.attr("text-anchor", "middle")
|
||||
.attr("transform", function(d:ICompTextSize) {
|
||||
return "translate(" + [d.x, d.y] + ")rotate(" + d.rotate + ")";
|
||||
})
|
||||
.text(function(d:ICompTextSize) { return d.text; });
|
||||
}
|
||||
Vendored
+45
@@ -0,0 +1,45 @@
|
||||
// Type definitions for d3JS cloud layout plugin by Jason Davies
|
||||
// Project: https://github.com/jasondavies/d3-cloud
|
||||
// Definitions by: hans windhoff <https://github.com/hansrwindhoff>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../d3/d3.d.ts" />
|
||||
|
||||
declare module D3 {
|
||||
export module Layout {
|
||||
export interface IRotate {
|
||||
(number:number) : CloudLayout;
|
||||
(number:()=>number) : CloudLayout;
|
||||
}
|
||||
|
||||
|
||||
|
||||
export interface CloudLayout {
|
||||
(layers: any[], index?: number): any[];
|
||||
values(accessor?: (d: any) => any): CloudLayout;
|
||||
offset(offset: string): CloudLayout;
|
||||
size: {
|
||||
/**
|
||||
* Gets the available layout size
|
||||
*/
|
||||
(): Array<number>;
|
||||
/**
|
||||
* Sets the available layout size
|
||||
*/
|
||||
(size: Array<number>): CloudLayout;
|
||||
};
|
||||
words: (inputArray: Array<any>) => CloudLayout;
|
||||
rotate:IRotate;
|
||||
padding: (number:number) => CloudLayout;
|
||||
font: (string:string) => CloudLayout;
|
||||
fontSize(fctn: (d: any) => number): CloudLayout;
|
||||
on: (eventname: string, callee: (words: any[]) => void) => CloudLayout;
|
||||
start: () => CloudLayout;
|
||||
}
|
||||
|
||||
|
||||
export interface Layout {
|
||||
cloud(): CloudLayout;
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+3
-1
@@ -926,7 +926,7 @@ declare module D3 {
|
||||
(name: string, value: any, priority?: string): Transition;
|
||||
(name: string, valueFunction: (data: any, index: number) => any, priority?: string): Transition;
|
||||
};
|
||||
call(callback: (selection: Selection) => void ): Transition;
|
||||
call(callback: (transition: Transition, ...args: any[]) => void, ...args: any[]): Transition;
|
||||
/**
|
||||
* Select an element from the current document
|
||||
*/
|
||||
@@ -1750,6 +1750,8 @@ declare module D3 {
|
||||
|
||||
export interface Axis {
|
||||
(selection: Selection): void;
|
||||
(transition: Transition.Transition): void;
|
||||
|
||||
scale: {
|
||||
(): any;
|
||||
(scale: any): Axis;
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
/// <reference path="dagre.d.ts"/>
|
||||
module DagreTests {
|
||||
var gDagre = new dagre.graphlib.Graph();
|
||||
gDagre.setGraph({});
|
||||
gDagre.setDefaultEdgeLabel(function(){
|
||||
return ;
|
||||
});
|
||||
|
||||
gDagre.setNode("a", {});
|
||||
gDagre.setEdge("b", "c");
|
||||
|
||||
dagre.layout(gDagre);
|
||||
}
|
||||
Vendored
+29
@@ -0,0 +1,29 @@
|
||||
// Type definitions for dagre 0.7.0
|
||||
// Project: https://github.com/cpettitt/dagre
|
||||
// Definitions by: Qinfeng Chen <https://github.com/qinfchen>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
declare module Dagre{
|
||||
interface DagreFactory {
|
||||
graphlib: GraphLib;
|
||||
layout(graph: Graph): void;
|
||||
}
|
||||
|
||||
interface Graph {
|
||||
new (): Graph;
|
||||
edges(): string[];
|
||||
edge(id: string): any;
|
||||
nodes(): string[];
|
||||
node(id: string): any;
|
||||
setDefaultEdgeLabel(callback: () => void): void;
|
||||
setEdge(sourceId: string, targetId: string): void;
|
||||
setGraph(options: { [key: string]: any }): void;
|
||||
setNode(id: string, node: { [key: string]: any }): void;
|
||||
}
|
||||
|
||||
interface GraphLib {
|
||||
Graph: Graph
|
||||
}
|
||||
}
|
||||
|
||||
declare var dagre: Dagre.DagreFactory;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user