diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index d4a3000cb..849055699 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -10,11 +10,14 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](adm-zip/adm-zip.d.ts) [adm-zip](https://github.com/cthackers/adm-zip) by [John Vilk](https://github.com/jvilk) * [:link:](alertify/alertify.d.ts) [alertify](http://fabien-d.github.io/alertify.js) by [John Jeffery](http://github.com/jjeffery) * [:link:](alt/alt.d.ts) [Alt](https://github.com/goatslacker/alt) by [Michael Shearer](https://github.com/Shearerbeard) +* [:link:](amazon-product-api/amazon-product-api.d.ts) [amazon-product-api](https://github.com/t3chnoboy/amazon-product-api) by [Matti Lehtinen](https://github.com/MattiLehtinen) * [: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:](amplify-deferred/amplify-deferred.d.ts) [AmplifyJs 1.1.0 using JQuery Deferred](http://amplifyjs.com) by [Jonas Eriksson](https://github.com/joeriks), [Laurentiu Stamate](https://github.com/laurentiustamate94) * [:link:](amqp-rpc/amqp-rpc.d.ts) [amqp-rpc](https://github.com/demchenkoe/node-amqp-rpc) by [Wonshik Kim](https://github.com/wokim) * [:link:](amqplib/amqplib.d.ts) [amqplib 0.3.x](https://github.com/squaremo/amqp.node) by [Michael Nahkies](https://github.com/mnahkies) * [:link:](angular2/angular2.d.ts) [Angular](http://angular.io) by [angular team](https://github.com/angular) +* [:link:](angular2/http.d.ts) [Angular](http://angular.io) by [angular team](https://github.com/angular) * [:link:](angular2/router.d.ts) [Angular](http://angular.io) by [angular team](https://github.com/angular) * [:link:](ng-file-upload/ng-file-upload.d.ts) [Angular File Upload](https://github.com/danialfarid/ng-file-upload) by [John Reilly](https://github.com/johnnyreilly) * [:link:](angular-file-upload/angular-file-upload.d.ts) [Angular File Upload](https://github.com/danialfarid/ng-file-upload) by [John Reilly](https://github.com/johnnyreilly) @@ -69,9 +72,11 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](cordova-plugin-email-composer/cordova-plugin-email-composer.d.ts) [Apache Cordova Email Composer plugin](https://github.com/katzer/cordova-plugin-email-composer) by [Dave Taylor](http://davetayls.me) * [:link:](api-error-handler/api-error-handler.d.ts) [api-error-handler](https://github.com/expressjs/api-error-handler) by [Tanguy Krotoff](https://github.com/tkrotoff) * [:link:](appframework/appframework.d.ts) [AppFramework](http://app-framework-software.intel.com) by [kyo_ago](https://github.com/kyo-ago) +* [:link:](appletvjs/appletvjs.d.ts) [AppleTVJS](https://developer.apple.com/library/prerelease/tvos/documentation/TVMLJS/Reference/TVJSFrameworkReference/index.html) by [Adam Valverde](https://github.com/brainded) * [:link:](applicationinsights/applicationinsights.d.ts) [Application Insights](https://github.com/Microsoft/ApplicationInsights-node.js) by [Scott Southwood](https://github.com/scsouthw) * [:link:](arbiter/Arbiter.d.ts) [Arbiter.js](http://arbiterjs.com) by [Arash Shakery](https://github.com/arash16) * [:link:](arcgis-js-api/arcgis-js-api.d.ts) [ArcGIS API for JavaScript](http://js.arcgis.com) by [Esri](http://www.esri.com) +* [:link:](archiver/archiver.d.ts) [archiver](https://github.com/archiverjs/node-archiver) by [Esri](https://github.com/archiverjs/node-archiver) * [:link:](archy/archy.d.ts) [archy](https://github.com/substack/node-archy) by [vvakame](https://github.com/vvakame) * [: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) @@ -104,6 +109,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](bardjs/bardjs.d.ts) [bardjs](https://github.com/wardbell/bardjs) by [Andrew Archibald](https://github.com/TepigMC) * [:link:](batch-stream/batch-stream.d.ts) [batch-stream](https://github.com/segmentio/batch-stream) by [Nicholas Penree](http://github.com/drudge) * [:link:](bcrypt/bcrypt.d.ts) [bcrypt](https://www.npmjs.org/package/bcrypt) by [Peter Harris](https://github.com/codeanimal) +* [:link:](better-curry/better-curry.d.ts) [better-curry](https://github.com/pocesar/js-bettercurry) by [Paulo Cesar](https://github.com/pocesar) * [:link:](bgiframe/typescript.bgiframe.d.ts) [bgiframe](https://github.com/sumegizoltan/BgiFrame) by [Zoltan Sumegi](https://github.com/sumegizoltan) * [:link:](big.js/big.js.d.ts) [big.js](https://github.com/MikeMcl/big.js) by [Steve Ognibene](https://github.com/nycdotnet) * [:link:](bigint/bigint.d.ts) [BigInt](https://github.com/Evgenus/BigInt) by [Eugene Chernyshov](https://github.com/Evgenus) @@ -112,6 +118,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](bitwise-xor/bitwise-xor.d.ts) [bitwise-xor](https://github.com/czzarr/node-bitwise-xor) by [Rogier Schouten](https://github.com/rogierschouten) * [:link:](blob-stream/blob-stream.d.ts) [blob-stream](https://github.com/devongovett/blob-stream) by [Eric Hillah](https://github.com/erichillah) * [:link:](bluebird/bluebird.d.ts) [bluebird](https://github.com/petkaantonov/bluebird) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](bluebird-retry/bluebird-retry.d.ts) [bluebird-retry](https://github.com/jut-io/bluebird-retry) by [Pascal Vomhoff](https://github.com/pvomhoff) * [:link:](blueimp-md5/blueimp-md5.d.ts) [blueimp-md5](https://github.com/blueimp/JavaScript-MD5) by [Ray Martone](https://github.com/rmartone) * [:link:](body-parser/body-parser.d.ts) [body-parser](http://expressjs.com) by [Santi Albo](https://github.com/santialbo), [VILIC VANE](https://vilic.info), [Jonathan Häberle](https://github.com/dreampulse) * [:link:](boom/boom.d.ts) [boom](http://github.com/hapijs/boom) by [Igor Rogatty](http://github.com/rogatty) @@ -119,7 +126,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](bootstrap/bootstrap.d.ts) [Bootstrap](http://twitter.github.com/bootstrap) by [Boris Yankov](https://github.com/borisyankov) * [:link:](bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker.d.ts) [Bootstrap datetimepicker v3](http://eonasdan.github.io/bootstrap-datetimepicker) by [Jesica N. Fera](https://github.com/bayitajesi) * [:link:](bootstrap-touchspin/bootstrap-touchspin.d.ts) [Bootstrap TouchSpin](http://www.virtuosoft.eu/code/bootstrap-touchspin) by [Albin Sunnanbo](https://github.com/albinsunnanbo) -* [:link:](bootstrap-notify/bootstrap-notify.d.ts) [bootstrap-notify](https://github.com/Nijikokun/bootstrap-notify) by [Blake Niemyjski](https://github.com/niemyjski) +* [:link:](bootstrap-notify/bootstrap-notify.d.ts) [bootstrap-notify](http://bootstrap-notify.remabledesigns.com) by [Blake Niemyjski](https://github.com/niemyjski), [Robert McIntosh](https://github.com/mouse0270), [Robert Voica](https://github.com/robert-voica) * [:link:](bootstrap-slider/bootstrap-slider.d.ts) [bootstrap-slider.js](https://github.com/seiyria/bootstrap-slider) by [Daniel Beckwith](https://github.com/dbeckwith) * [:link:](bootstrap.datepicker/bootstrap.datepicker.d.ts) [bootstrap.datepicker](https://github.com/eternicode/bootstrap-datepicker) by [Boris Yankov](https://github.com/borisyankov) * [:link:](bootstrap.paginator/bootstrap.paginator.d.ts) [bootstrap.paginator](https://github.com/lyonlai/bootstrap-paginator) by [derikwhittaker](https://github.com/derikwhittaker) @@ -144,7 +151,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](camljs/camljs.d.ts) [camljs](http://camljs.codeplex.com) by [Andrey Markeev](http://markeev.com) * [:link:](canvasjs/canvasjs.d.ts) [CanvasJS](http://canvasjs.com) by [Mark Overholt](https://github.com/mover5) * [:link:](casperjs/casperjs.d.ts) [CasperJS](http://casperjs.org) by [Jed Mao](https://github.com/jedmao) -* [:link:](chai/chai.d.ts) [chai](http://chaijs.com) by [Jed Mao](https://github.com/jedmao), [Bart van der Schoor](https://github.com/Bartvds), [Andrew Brown](https://github.com/AGBrown) +* [:link:](chai/chai.d.ts) [chai](http://chaijs.com) by [Jed Mao](https://github.com/jedmao), [Bart van der Schoor](https://github.com/Bartvds), [Andrew Brown](https://github.com/AGBrown), [Olivier Chevet](https://github.com/olivr70) * [:link:](chai-as-promised/chai-as-promised.d.ts) [chai-as-promised](https://github.com/domenic/chai-as-promised) by [jt000](https://github.com/jt000), [Yuki Kokubun](https://github.com/Kuniwak) * [:link:](chai-datetime/chai-datetime.d.ts) [chai-datetime](https://github.com/gaslight/chai-datetime.git) by [Cliff Burger](https://github.com/cliffburger) * [:link:](chai-fuzzy/chai-fuzzy.d.ts) [chai-fuzzy](http://chaijs.com/plugins/chai-fuzzy) by [Bart van der Schoor](https://github.com/Bartvds) @@ -155,6 +162,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](chance/chance.d.ts) [Chance](http://chancejs.com) by [Chris Bowdon](https://github.com/cbowdon) * [: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:](chartist/chartist.d.ts) [Chartist](https://github.com/gionkunz/chartist-js) by [Matt Gibbs](https://github.com/mtgibbs) * [: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:](chocolatechipjs/chocolatechipjs.d.ts) [chocolatechip](https://github.com/chocolatechipui/ChocolateChipJS) by [Robert Biggs](http://chocolatechip-ui.com) @@ -167,11 +175,13 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](chui/chui.d.ts) [chui](https://github.com/chocolatechipui/chocolatechip-ui) by [Robert Biggs](http://chocolatechip-ui.com) * [:link:](circular-json/circular-json.d.ts) [circular-json](https://github.com/WebReflection/circular-json) by [Jonathan Pevarnek](https://github.com/jpevarnek) * [:link:](ckeditor/ckeditor.d.ts) [CKEditor](http://ckeditor.com) by [Ondrej Sevcik](https://github.com/ondrejsevcik) -* [:link:](classnames/classnames.d.ts) [classnames](https://github.com/JedWatson/classnames) by [Dave Keen](http://www.keendevelopment.ch) +* [:link:](classnames/classnames.d.ts) [classnames](https://github.com/JedWatson/classnames) by [Dave Keen](http://www.keendevelopment.ch), [Adi Dahiya](https://github.com/adidahiya), [Jason Killian](https://github.com/JKillian) * [:link:](cli-color/cli-color.d.ts) [cli-color](https://github.com/medikoo/cli-color) by [Joel Spadin](https://github.com/ChaosinaCan) * [:link:](clone/clone.d.ts) [clone](https://github.com/pvorb/node-clone) by [Kieran Simpson](https://github.com/kierans/DefinitelyTyped) -* [:link:](codemirror/showhint.d.ts) [CodeMirror](https://github.com/marijnh/CodeMirror) by [jacqt](https://github.com/jacqt) * [:link:](codemirror/codemirror.d.ts) [CodeMirror](https://github.com/marijnh/CodeMirror) by [mihailik](https://github.com/mihailik) +* [:link:](codemirror/searchcursor.d.ts) [CodeMirror](https://github.com/marijnh/CodeMirror) by [jacqt](https://github.com/jacqt) +* [:link:](codemirror/codemirror-matchbrackets.d.ts) [CodeMirror](https://github.com/marijnh/CodeMirror) by [Sixin Li](https://github.com/sixinli) +* [:link:](codemirror/codemirror-showhint.d.ts) [CodeMirror](https://github.com/marijnh/CodeMirror) by [jacqt](https://github.com/jacqt), [basarat](https://github.com/basarat) * [:link:](coffeeify/coffeeify.d.ts) [coffeeify](https://github.com/jnordberg/coffeeify) by [Qubo](https://github.com/tkQubo) * [:link:](colorbrewer/colorbrewer.d.ts) [colorbrewer](https://github.com/jeanlauliac/colorbrewer) by [Matt Traynham](https://github.com/mtraynham) * [:link:](colors/colors.d.ts) [Colors.js 0.6.0-1](https://github.com/Marak/colors.js) by [Bart van der Schoor](https://github.com/Bartvds) @@ -192,7 +202,10 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](cookie-parser/cookie-parser.d.ts) [cookie-parser](https://github.com/expressjs/cookie-parser) by [Santi Albo](https://github.com/santialbo) * [:link:](cookiejs/cookiejs.d.ts) [cookie.js](https://github.com/js-coder/cookie.js) by [Boltmade](https://github.com/Boltmade) * [:link:](cordova-ionic/plugins/keyboard.d.ts) [Cordova Keyboard plugin](https://github.com/driftyco/ionic-plugins-keyboard) by [Hendrik Maus](https://github.com/hendrikmaus) +* [:link:](cordova-plugin-app-version/cordova-plugin-app-version.d.ts) [cordova-plugin-app-version](https://github.com/whiteoctober/cordova-plugin-app-version) by [Markus Wagner](https://github.com/Ritzlgrmft) +* [:link:](cordova-plugin-ibeacon/cordova-plugin-ibeacon.d.ts) [cordova-plugin-ibeacon](https://github.com/petermetz/cordova-plugin-ibeacon) by [Markus Wagner](https://github.com/Ritzlgrmft) * [:link:](cordovarduino/cordovarduino.d.ts) [Cordovarduino plugin](https://github.com/stereolux/cordovarduino) by [Hendrik Maus](https://github.com/hendrikmaus) +* [:link:](core-decorators/core-decorators.d.ts) [core-decorators.js](https://github.com/jayphelps/core-decorators.js) by [Qubo](https://github.com/tkqubo) * [:link:](core-js/core-js.d.ts) [core-js](https://github.com/zloirock/core-js) by [Ron Buckton](http://github.com/rbuckton) * [:link:](cors/cors.d.ts) [cors](https://github.com/troygoode/node-cors) by [Mihhail Lapushkin](https://github.com/mihhail-lapushkin) * [:link:](couchbase/couchbase.d.ts) [Couchbase Couchnode](https://github.com/couchbase/couchnode) by [Basarat Ali Syed](https://github.com/basarat) @@ -236,6 +249,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](docCookies/docCookies.d.ts) [docCookies](https://developer.mozilla.org/en-US/docs/Web/API/document.cookie) by [Jon Egerton](https://github.com/jonegerton) * [:link:](dock-spawn/dock-spawn.d.ts) [Dock Spawn](http://dockspawn.com) by [Drew Noakes](https://drewnoakes.com) * [:link:](documentdb/documentdb.d.ts) [DocumentDB](https://github.com/Azure/azure-documentdb-node) by [Noel Abrahams](https://github.com/NoelAbrahams), [Brett Gutstein](https://github.com/brettferdosi) +* [:link:](documentdb-server/documentdb-server.d.ts) [DocumentDB server side JavaScript SDK](http://dl.windowsazure.com/documentDB/jsserverdocs) by [François Nguyen](https://github.com/lith-light-g) * [:link:](dojo/dojo.d.ts) [Dojo](http://dojotoolkit.org) by [Michael Van Sickle](https://github.com/vansimke) * [:link:](dompurify/dompurify.d.ts) [DOM Purify](https://github.com/cure53/DOMPurify) by [Dave Taylor](http://davetayls.me), [Samira Bazuzi](https://github.com/bazuzi) * [:link:](domo/domo.d.ts) [Domo](http://domo-js.com) by [Steve Fenton](https://github.com/Steve-Fenton) @@ -265,6 +279,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](easystarjs/easystarjs.d.ts) [EasyStar.js](http://easystarjs.com) by [Magnus Gustafsson](https://github.com/borundin) * [:link:](egg.js/egg.js.d.ts) [Egg.js](https://github.com/mikeflynn/egg.js) by [Markus Peloso](https://github.com/ToastHawaii) * [:link:](ejs-locals/ejs-locals.d.ts) [ejs-locals](https://github.com/randometc/ejs-locals) by [jt000](https://github.com/jt000) +* [:link:](ejs/ejs.d.ts) [ejs.js](http://ejs.co) by [Ben Liddicott](https://github.com/benliddicott/DefinitelyTyped) * [:link:](jquery.elang/jquery.elang.d.ts) [eLang](https://github.com/sumegizoltan/ELang) by [Zoltan Sumegi](https://github.com/sumegizoltan) * [:link:](github-electron/github-electron.d.ts) [Electron (shared between main and rederer processes)](http://electron.atom.io) by [jedmao](https://github.com/jedmao) * [:link:](github-electron/electron-prebuilt.d.ts) [electron-prebuilt](https://github.com/mafintosh/electron-prebuilt) by [rhysd](https://github.com/rhysd) @@ -307,12 +322,14 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](eyes/eyes.d.ts) [eyes](https://github.com/cloudhead/eyes.js) by [bryn austin bellomy](https://github.com/brynbellomy) * [:link:](fabricjs/fabricjs.d.ts) [FabricJS](http://fabricjs.com) by [Oliver Klemencic](https://github.com/oklemencic), [Joseph Livecchi](https://github.com/joewashear007), [Michael Randolph](https://github.com/mrand01) * [:link:](fbsdk/fbsdk.d.ts) [Facebook Javascript SDK](https://developers.facebook.com/docs/javascript) by [Joshua Strobl](https://github.com/JoshStrobl) +* [:link:](faker/faker.d.ts) [faker](http://marak.com/faker.js) by [Bas Pennings](https://github.com/basp), [Yuki Kokubun](https://github.com/Kuniwak) * [:link:](famous/famous.d.ts) [Famous Engine](http://famous.org) by [Boris Vasilenko](https://github.com/borisvasilenko) * [:link:](fancybox/fancybox.d.ts) [fancyBox](https://github.com/fancyapps/fancyBox) by [Boris Yankov](https://github.com/borisyankov) * [:link:](farbtastic/farbtastic.d.ts) [Farbtastic: jQuery Color Wheel](http://mattfarina.github.io/farbtastic) by [Matt Brooks](https://github.com/EnableSoftware) * [:link:](fast-stats/fast-stats.d.ts) [fast-stats](https://github.com/bluesmoon/node-faststats) by [Rogier Schouten](https://github.com/rogierschouten) * [:link:](fastclick/fastclick.d.ts) [FastClick](https://github.com/ftlabs/fastclick) by [Shinnosuke Watanabe](https://github.com/shinnn) * [:link:](favico.js/favico.js.d.ts) [favico.js](http://lab.ejci.net/favico.js) by [Yu Matsushita](https://github.com/drowse314-dev-ymat) +* [:link:](featherlight/featherlight.d.ts) [Featherlight](https://noelboss.github.io/featherlight) by [Kaur Kuut](https://github.com/xStrom) * [:link:](whatwg-fetch/whatwg-fetch.d.ts) [fetch API](https://github.com/github/fetch) by [Ryan Graham](https://github.com/ryan-codingintrigue) * [:link:](fhir/fhir.d.ts) [FHIR DSTU2](http://www.hl7.org/fhir/2015May/index.html) by [Artifact Health](www.artifacthealth.com) * [:link:](fibers/fibers.d.ts) [fibers](https://github.com/laverdet/node-fibers) by [Carlos Ballesteros Velasco](https://github.com/soywiz) @@ -320,7 +337,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](filesystem/filesystem.d.ts) [File System API](http://www.w3.org/TR/file-system-api) by [Kon](http://phyzkit.net) * [:link:](FileSaver/FileSaver.d.ts) [FileSaver.js](https://github.com/eligrey/FileSaver.js) by [Cyril Schumacher](https://github.com/cyrilschumacher) * [:link:](Finch/Finch.d.ts) [Finch](https://github.com/stoodder/finchjs) by [David Sichau](https://github.com/DavidSichau) -* [:link:](findup-sync/findup-sync.d.ts) [findup-sync](https://github.com/cowboy/node-findup-sync) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](findup-sync/findup-sync.d.ts) [findup-sync](https://github.com/cowboy/node-findup-sync) by [Bart van der Schoor](https://github.com/Bartvds), [Nathan Brown](https://github.com/ngbrown) * [:link:](fingerprintjs/fingerprint.d.ts) [fingerprintjs](https://github.com/Valve/fingerprintjs) by [Shunsuke Ohtani](https://github.com/zaneli) * [:link:](state-machine/state-machine.d.ts) [Finite State Machine](https://github.com/jakesgordon/javascript-state-machine) by [Boris Yankov](https://github.com/borisyankov), [Maarten Docter](https://github.com/mdocter), [William Sears](https://github.com/MrBigDog2U) * [:link:](firebase/firebase.d.ts) [Firebase API](https://www.firebase.com/docs/javascript/firebase) by [Vincent Botone](https://github.com/vbortone), [Shin1 Kashimura](https://github.com/in-async) @@ -331,17 +348,19 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](flight/flight.d.ts) [Flight](http://flightjs.github.com/flight) by [Jonathan Hedrén](https://github.com/jonathanhedren) * [:link:](flipsnap/flipsnap.d.ts) [flipsnap.js](http://pxgrid.github.io/js-flipsnap) by [kubosho](https://github.com/kubosho), [gsino](https://github.com/gsino), [Mayuki Sawatari](https://github.com/mayuki) * [:link:](flot/jquery.flot.d.ts) [Flot](http://www.flotcharts.org) by [Matt Burland](https://github.com/burlandm) +* [:link:](flowjs/flowjs.d.ts) [flowjs](https://github.com/flowjs/flow.js) by [Ryan McNamara](https://github.com/ryan10132) * [:link:](flux/flux.d.ts) [Flux](http://facebook.github.io/flux) by [Steve Baker](https://github.com/stkb) * [:link:](fluxxor/fluxxor.d.ts) [Fluxxor](https://github.com/BinaryMuse/fluxxor) by [Yuichi Murata](https://github.com/mrk21) +* [:link:](fontoxml/fontoxml.d.ts) [FontoXML](http://www.fontoxml.com) by [Roland Zwaga](https://github.com/rolandzwaga) * [:link:](ion.rangeSlider/ion.rangeSlider.d.ts) [for Ion.RangeSlider](https://github.com/IonDen/ion.rangeSlider) by [Sixin Li](https://github.com/sixinli) * [:link:](forge-di/forge-di.d.ts) [forge-di](https://github.com/nkohari/forge) by [Adam Carr](https://github.com/adamcarr) * [: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:](freedom/freedom.d.ts) [freedom](https://github.com/freedomjs/freedom) by [Jonathan Pevarnek](https://github.com/jpevarnek) * [:link:](freedom/freedom-module-env.d.ts) [freedom](https://github.com/freedomjs/freedom) by [Jonathan Pevarnek](https://github.com/jpevarnek) * [:link:](freedom/freedom-core-env.d.ts) [freedom](https://github.com/freedomjs/freedom) by [Jonathan Pevarnek](https://github.com/jpevarnek) -* [:link:](freedom/freedom.d.ts) [freedom](https://github.com/freedomjs/freedom) by [Jonathan Pevarnek](https://github.com/jpevarnek) * [:link:](from/from.d.ts) [from](https://github.com/dominictarr/from) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](fs-ext/fs-ext.d.ts) [fs-ext](https://github.com/baudehlo/node-fs-ext) by [Oguzhan Ergin](https://github.com/OguzhanE) * [:link:](fs-extra/fs-extra.d.ts) [fs-extra](https://github.com/jprichardson/node-fs-extra) by [midknight41](https://github.com/midknight41) @@ -356,6 +375,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](gamepad/gamepad.d.ts) [Gamepad API](http://www.w3.org/TR/gamepad) by [Kon](http://phyzkit.net) * [:link:](gamequery/gamequery.d.ts) [gameQuery](http://gamequeryjs.com) by [David Laubreiter](https://github.com/Laubi) * [:link:](gently/gently.d.ts) [gently](https://www.npmjs.org/package/gently) by [bonnici](https://github.com/bonnici) +* [:link:](geoip-lite/geoip-lite.d.ts) [GeoIP-lite](https://github.com/bluesmoon/node-geoip) by [Yuce Tekol](http://yuce.me) * [:link:](geojson/geojson.d.ts) [GeoJSON Format Specification](http://geojson.org) by [Jacob Bruun](https://github.com/cobster) * [:link:](geometry-dom/geometry-dom.d.ts) [Geometry Format Specification](http://www.w3.org/TR/geometry-1) by [Toshiya Nakakura](https://github.com/nakakura) * [:link:](giraffe/giraffe.d.ts) [Giraffe](https://github.com/barc/backbone.giraffe) by [Matt McCray](https://github.com/darthapo) @@ -383,18 +403,22 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](google.visualization/google.visualization.d.ts) [Google Visualisation Apis](https://developers.google.com/chart) by [Dan Ludwig](https://github.com/danludwig) * [:link:](gae.channel.api/gae.channel.api.d.ts) [GoogleAppEngine's Channel API](https://developers.google.com/appengine/docs/java/channel/javascript) by [vvakame](https://github.com/vvakame) * [:link:](graceful-fs/graceful-fs.d.ts) [graceful-fs](https://github.com/cowboy/graceful-fs) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](graphviz/graphviz.d.ts) [Graphviz](git://github.com/glejeune/node-graphviz.git) by [Matt Frantz](https://github.com/mhfrantz) * [:link:](greasemonkey/greasemonkey.d.ts) [Greasemonkey](http://www.greasespot.net) by [Kota Saito](https://github.com/kotas) * [:link:](greensock/greensock.d.ts) [GreenSock Animation Platform](http://www.greensock.com/get-started-js) by [Robert S](https://github.com/codebelt) * [:link:](gridfs-stream/gridfs-stream.d.ts) [gridfs-stream](https://github.com/aheckmann/gridfs-stream) by [Lior Mualem](https://github.com/liorm) +* [:link:](gridstack/gridstack.d.ts) [Gridstack](http://troolee.github.io/gridstack.js) by [Pascal Senn](https://github.com/PascalSenn) * [:link:](gruntjs/gruntjs.d.ts) [Grunt 0.4.x](http://gruntjs.com) by [Jeff May](https://github.com/jeffmay), [Basarat Ali Syed](https://github.com/basarat) * [:link:](gsap/Core.d.ts) [GSAP](http://greensock.com) by [VILIC VANE](https://vilic.github.io) -* [:link:](gsap/Ease.d.ts) [GSAP](http://greensock.com) by [VILIC VANE](https://vilic.github.io) * [:link:](gsap/TweenLite.d.ts) [GSAP](http://greensock.com) by [VILIC VANE](https://vilic.github.io) +* [:link:](gsap/Ease.d.ts) [GSAP](http://greensock.com) by [VILIC VANE](https://vilic.github.io) * [:link:](gulp/gulp.d.ts) [Gulp v3.8.x](http://gulpjs.com) by [Drew Noakes](https://drewnoakes.com) * [:link:](gulp-autoprefixer/gulp-autoprefixer.d.ts) [gulp-autoprefixer](https://github.com/sindresorhus/gulp-autoprefixer) by [Asana](https://asana.com) * [:link:](gulp-cached/gulp-cached.d.ts) [gulp-cached](https://github.com/wearefractal/gulp-cached) by [Thomas Corbière](https://github.com/tomc974) * [:link:](gulp-changed/gulp-changed.d.ts) [gulp-changed](https://github.com/sindresorhus/gulp-changed) by [Thomas Corbière](https://github.com/tomc974) +* [:link:](gulp-cheerio/gulp-cheerio.d.ts) [gulp-cheerio](https://github.com/KenPowers/gulp-cheerio) by [Qubo](https://github.com/tkQubo) * [:link:](gulp-coffeeify/gulp-coffeeify.d.ts) [gulp-coffeeify](https://github.com/nariyu/gulp-coffeeify) by [Qubo](https://github.com/tkQubo) +* [:link:](gulp-coffeelint/gulp-coffeelint.d.ts) [gulp-coffeelint](https://github.com/janraasch/gulp-coffeelint) by [Qubo](https://github.com/tkQubo) * [:link:](gulp-concat/gulp-concat.d.ts) [gulp-concat](http://github.com/wearefractal/gulp-concat) by [Keita Kagurazaka](https://github.com/k-kagurazaka) * [:link:](gulp-rev/gulp-rev.d.ts) [gulp-csso](https://github.com/sindresorhus/gulp-rev) by [Tanguy Krotoff](https://github.com/tkrotoff) * [:link:](gulp-csso/gulp-csso.d.ts) [gulp-csso](https://github.com/ben-eb/gulp-csso) by [Tanguy Krotoff](https://github.com/tkrotoff) @@ -403,6 +427,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](gulp-espower/gulp-espower.d.ts) [gulp-espower](https://github.com/power-assert-js/gulp-espower) by [Qubo](https://github.com/tkQubo) * [:link:](gulp-flatten/gulp-flatten.d.ts) [gulp-flatten](https://github.com/armed/gulp-flatten) by [Keita Kagurazaka](https://github.com/k-kagurazaka) * [:link:](gulp-gh-pages/gulp-gh-pages.d.ts) [gulp-gh-pages](https://github.com/rowoot/gulp-gh-pages) by [Asana](https://asana.com) +* [:link:](gulp-gzip/gulp-gzip.d.ts) [gulp-gzip](https://github.com/jstuckey/gulp-gzip) by [Qubo](https://github.com/tkQubo) * [:link:](gulp-help/gulp-help.d.ts) [gulp-help](https://github.com/chmontgomery/gulp-help) by [Qubo](https://github.com/tkQubo) * [:link:](gulp-if/gulp-if.d.ts) [gulp-if](https://github.com/robrich/gulp-if) by [Asana](https://asana.com), [Joe Skeen](http://github.com/joeskeen) * [:link:](gulp-inject/gulp-inject.d.ts) [gulp-inject](https://github.com/klei/gulp-inject) by [Keita Kagurazaka](https://github.com/k-kagurazaka) @@ -414,6 +439,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](gulp-minify-html/gulp-minify-html.d.ts) [gulp-minify-html](https://github.com/murphydanger/gulp-minify-html) by [Tanguy Krotoff](https://github.com/tkrotoff) * [:link:](gulp-mocha/gulp-mocha.d.ts) [gulp-mocha](https://github.com/sindresorhus/gulp-mocha) by [Asana](https://asana.com) * [:link:](gulp-newer/gulp-newer.d.ts) [gulp-newer](https://github.com/tschaub/gulp-newer) by [Thomas Corbière](https://github.com/tomc974) +* [:link:](gulp-ng-annotate/gulp-ng-annotate.d.ts) [gulp-ng-annotate](https://github.com/Kagami/gulp-ng-annotate) by [Qubo](https://github.com/tkQubo) +* [:link:](gulp-nodemon/gulp-nodemon.d.ts) [gulp-nodemon](https://github.com/JacksonGariety/gulp-nodemon) by [Qubo](https://github.com/tkQubo) * [:link:](gulp-plumber/gulp-plumber.d.ts) [gulp-plumber](https://github.com/floatdrop/gulp-plumber) by [Joe Skeen](http://github.com/joeskeen) * [:link:](gulp-protractor/gulp-protractor.d.ts) [gulp-protractor](https://github.com/mllrsohn/gulp-protractor) by [Tanguy Krotoff](https://github.com/tkrotoff) * [:link:](gulp-remember/gulp-remember.d.ts) [gulp-remember](https://github.com/ahaurw01/gulp-remember) by [Thomas Corbière](https://github.com/tomc974) @@ -422,9 +449,12 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](gulp-rev-replace/gulp-rev-replace.d.ts) [gulp-rev-replace](https://github.com/jamesknelson/gulp-rev-replace) by [Tanguy Krotoff](https://github.com/tkrotoff) * [:link:](gulp-ruby-sass/gulp-ruby-sass.d.ts) [gulp-ruby-sass](https://github.com/sindresorhus/gulp-ruby-sass) by [Agnislav Onufrijchuk](https://github.com/agnislav) * [:link:](gulp-sass/gulp-sass.d.ts) [gulp-sass](https://github.com/dlmanning/gulp-sass) by [Asana](https://asana.com) +* [:link:](gulp-shell/gulp-shell.d.ts) [gulp-shell](https://github.com/sun-zheng-an/gulp-shell) by [Qubo](https://github.com/tkqubo) * [:link:](gulp-size/gulp-size.d.ts) [gulp-size](https://github.com/sindresorhus/gulp-size) by [Tanguy Krotoff](https://github.com/tkrotoff) * [:link:](gulp-sort/gulp-sort.d.ts) [gulp-sort](https://github.com/pgilad/gulp-sort) by [Joe Skeen](http://github.com/joeskeen) * [:link:](gulp-sourcemaps/gulp-sourcemaps.d.ts) [gulp-sourcemaps](https://github.com/floridoo/gulp-sourcemaps) by [Asana](https://asana.com) +* [:link:](gulp-svg-sprite/gulp-svg-sprite.d.ts) [gulp-svg-sprite](https://github.com/jkphl/gulp-svg-sprite) by [Qubo](https://github.com/tkqubo) +* [:link:](gulp-task-listing/gulp-task-listing.d.ts) [gulp-task-listing](https://github.com/OverZealous/gulp-task-listing) by [Joe Skeen](http://github.com/joeskeen) * [:link:](gulp-tsd/gulp-tsd.d.ts) [gulp-tsd](https://github.com/moznion/gulp-tsd) by [Keita Kagurazaka](https://github.com/k-kagurazaka) * [:link:](gulp-tslint/gulp-tslint.d.ts) [gulp-tslint](https://github.com/panuhorsmalahti/gulp-tslint) by [Asana](https://asana.com) * [:link:](gulp-typedoc/gulp-typedoc.d.ts) [gulp-typedoc](https://github.com/rogierschouten/gulp-typedoc) by [Asana](https://asana.com) @@ -455,8 +485,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](html2canvas/html2canvas.d.ts) [html2canvas.js](https://github.com/niklasvh/html2canvas) by [Richard Hepburn](https://github.com/rwhepburn) * [:link:](htmlparser2/htmlparser2.d.ts) [htmlparser2 v3.7.x](https://github.com/fb55/htmlparser2) by [James Roland Cabresos](https://github.com/staticfunction) * [:link:](htmltojsx/htmltojsx.d.ts) [htmltojsx](https://www.npmjs.com/package/htmltojsx) by [Basarat Ali Syed](https://github.com/basarat) -* [:link:](statuses/statuses.d.ts) [http-errors](https://github.com/jshttp/statuses) by [Tanguy Krotoff](https://github.com/tkrotoff) * [:link:](http-errors/http-errors.d.ts) [http-errors](https://github.com/jshttp/http-errors) by [Tanguy Krotoff](https://github.com/tkrotoff) +* [:link:](statuses/statuses.d.ts) [http-errors](https://github.com/jshttp/statuses) by [Tanguy Krotoff](https://github.com/tkrotoff) * [:link:](http-status/http-status.d.ts) [http-status](https://github.com/wdavidw/node-http-status) by [Michael Zabka](https://github.com/misak113) * [:link:](http-string-parser/http-string-parser.d.ts) [http-string-parser](https://github.com/apiaryio/http-string-parser) by [MIZUNE Pine](https://github.com/pine613) * [:link:](httperr/httperr.d.ts) [httperr](https://github.com/pluma/httperr) by [Troy Gerwien](https://github.com/yortus) @@ -476,6 +506,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](incremental-dom/incremental-dom.d.ts) [Incremetal DOM](https://github.com/google/incremental-dom) by [Basarat Ali Syed](https://github.com/basarat) * [:link:](inflection/inflection.d.ts) [inflection](https://github.com/dreamerslab/node.inflection) by [Shogo Iwano](https://github.com/shiwano) * [:link:](ini/ini.d.ts) [ini](https://github.com/isaacs/ini) by [Marcin Porębski](https://github.com/marcinporebski) +* [:link:](inquirer/inquirer.d.ts) [Inquirer.js](https://github.com/SBoudrias/Inquirer.js) by [Qubo](https://github.com/tkQubo) * [:link:](insight/insight.d.ts) [insight](https://github.com/yeoman/insight) by [vvakame](http://github.com/vvakame) * [:link:](interactjs/interact.d.ts) [Interacting for interact.js](https://github.com/taye/interact.js) by [Douglas Eichelberger](https://github.com/dduugg), [Adi Dahiya](https://github.com/adidahiya), [Tom Hasner](https://github.com/thasner) * [:link:](intercomjs/intercom.d.ts) [intercom.js](https://github.com/diy/intercom.js) by [spencerwi](http://github.com/spencerwi) @@ -497,10 +528,12 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](jasmine/jasmine.d.ts) [Jasmine](http://jasmine.github.io) by [Boris Yankov](https://github.com/borisyankov), [Theodore Brown](https://github.com/theodorejb), [David Pärsson](https://github.com/davidparsson) * [:link:](jasmine-data_driven_tests/jasmine-data_driven_tests.d.ts) [Jasmine Data Driven Tests](https://github.com/gburghardt/jasmine-data_driven_tests) by [Anthony MacKinnon](https://github.com/AnthonyMacKinnon) * [:link:](jasmine-ajax/jasmine-ajax.d.ts) [jasmine-ajax](https://github.com/jasmine/jasmine-ajax) by [Louis Grignon](https://github.com/lgrignon) +* [:link:](jasmine-es6-promise-matchers/jasmine-es6-promise-matchers.d.ts) [jasmine-es6-promise-matchers](https://github.com/bvaughn/jasmine-es6-promise-matchers) by [Stephen Lautier](https://github.com/stephenlautier) * [:link:](jasmine-fixture/jasmine-fixture.d.ts) [Jasmine-fixture](https://github.com/searls/jasmine-fixture) by [Craig Brett](https://github.com/craigbrett17) * [:link:](jasmine-jquery/jasmine-jquery.d.ts) [Jasmine-JQuery](https://github.com/velesin/jasmine-jquery) by [Gregor Stamac](https://github.com/gstamac) * [: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:](jasmine-promise-matchers/jasmine-promise-matchers.d.ts) [jasmine-promise-matchers](https://github.com/bvaughn/jasmine-promise-matchers) by [Matthew Hill](https://github.com/matthewjh) +* [:link:](java/java.d.ts) [java](https://github.com/joeferner/java) by [Jim Lloyd](https://github.com/jimlloyd) * [:link:](java-applet/java-applet.d.ts) [Java Applet](https://www.java.com) by [Cyril Schumacher](https://github.com/cyrilschumacher) * [:link:](hooker/hooker.d.ts) [JavaScript Hooker](https://github.com/cowboy/javascript-hooker) by [Michael Zabka](https://github.com/misak113) * [:link:](oauth.js/oauth.js.d.ts) [JavaScript software for implementing an OAuth consumer](https://code.google.com/p/oauth) by [NOBUOKA Yu](https://github.com/nobuoka) @@ -519,7 +552,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](jquery.cleditor/jquery.cleditor.d.ts) [jQuery CLEditor Plugin](http://premiumsoftware.net/CLEditor) by [Jeffery Grajkowski](https://github.com/pushplay) * [:link:](jquery.colorpicker/jquery.colorpicker.d.ts) [jQuery Colorpicker Plugin](https://github.com/vanderlee/colorpicker) by [Jeffery Grajkowski](https://github.com/pushplay) * [:link:](jquery.contextMenu/jquery.contextMenu.d.ts) [jQuery contextMenu](http://medialize.github.com/jQuery-contextMenu) by [Natan Vivo](https://github.com/nvivo) -* [:link:](jquery.cookie/jquery.cookie.d.ts) [jQuery Cookie Plugin](https://github.com/carhartl/jquery-cookie) by [Roy Goode](https://github.com/RoyGoode) +* [:link:](jquery.cookie/jquery.cookie.d.ts) [jQuery Cookie Plugin](https://github.com/carhartl/jquery-cookie) by [Roy Goode](https://github.com/RoyGoode), [Ben Lorantfy](https://github.com/BenLorantfy) * [:link:](jquery.cycle2/jquery.cycle2.d.ts) [jQuery Cycle2 version (build 20140216)](http://jquery.malsup.com/cycle2) by [Donny Nadolny](https://github.com/dnadolny) * [:link:](jquery.dataTables/jquery.dataTables.d.ts) [JQuery DataTables](http://www.datatables.net) by [Kiarash Ghiaseddin](https://github.com/Silver-Connection/DefinitelyTyped), [Omid Rad](https://github.com/omidkrad), [Armin Sander](https://github.com/pragmatrix) * [:link:](jquery.fileupload/jquery.fileupload.d.ts) [jQuery File Upload Plugin](https://github.com/blueimp/jQuery-File-Upload) by [Rob Alarcon](https://github.com/rob-alarcon) @@ -543,6 +576,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](jquery.ui.datetimepicker/jquery.ui.datetimepicker.d.ts) [jQuery UI DateTimePicker](http://trentrichardson.com/examples/timepicker) by [dougajmcdonald](https://github.com/dougajmcdonald) * [:link:](jquery.ui.layout/jquery.ui.layout.d.ts) [jQuery UI Layout Plug-in](http://layout.jquery-dev.net) by [Steve Fenton](https://github.com/Steve-Fenton) * [:link:](jquery.timepicker/jquery.timepicker.d.ts) [jQuery UI Timepicker](http://fgelinas.com/code/timepicker) by [Anwar Javed](https://github.com/anwarjaved) +* [:link:](jquery-ajax-chain/jquery-ajax-chain.d.ts) [jquery-ajax-chain v](https://github.com/humana-fragilitas/jQuery-Ajax-Chain) by [Andrea Blasio](https://github.com/humana-fragilitas) * [:link:](jquery-fullscreen/jquery-fullscreen.d.ts) [jquery-fullscreen](https://github.com/kayahr/jquery-fullscreen-plugin) by [Bruno Grieder](https://github.com/bgrieder) * [:link:](jquery-handsontable/jquery-handsontable.d.ts) [jquery-handsontable](http://handsontable.com) by [Ted John](https://github.com/intelorca) * [:link:](jquery.menuaim/jquery.menuaim.d.ts) [jQuery-menu-aim](https://github.com/kamens/jQuery-menu-aim) by [Robert Fonseca-Ensor](http://www.robfe.com) @@ -585,13 +619,13 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](jquery.timer/jquery.timer.d.ts) [jQueryTimer](https://github.com/jchavannes/jquery-timer) by [Joshua Strobl](https://github.com/JoshStrobl) * [:link:](jquery.total-storage/jquery.total-storage.d.ts) [jQueryTotalStorage](https://github.com/Upstatement/jquery-total-storage) by [Jeremy Brooks](https://github.com/JeremyCBrooks) * [:link:](jqueryui/jqueryui.d.ts) [jQueryUI](http://jqueryui.com) by [Boris Yankov](https://github.com/borisyankov), [John Reilly](https://github.com/johnnyreilly) +* [:link:](js-beautify/js-beautify.d.ts) [js_beautify](https://github.com/beautify-web/js-beautify) by [Josh Goldberg](https://github.com/JoshuaKGoldberg) * [:link:](ua-parser-js/ua-parser-js.d.ts) [js-cookie](https://github.com/faisalman/ua-parser-js) by [Viktor Miroshnikov](https://github.com/superduper) * [:link:](js-cookie/js-cookie.d.ts) [js-cookie](https://github.com/js-cookie/js-cookie) by [Theodore Brown](https://github.com/theodorejb) * [:link:](js-fixtures/fixtures.d.ts) [js-fixtures](https://github.com/badunk/js-fixtures) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid) * [:link:](js-git/js-git.d.ts) [js-git](https://github.com/creationix/js-git) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](js-signals/js-signals.d.ts) [JS-Signals](http://millermedeiros.github.io/js-signals) by [Diullei Gomes](https://github.com/diullei) * [:link:](js-yaml/js-yaml.d.ts) [js-yaml](https://github.com/nodeca/js-yaml) by [Bart van der Schoor](https://github.com/Bartvds) -* [:link:](js-beautify/js-beautify.d.ts) [js_beautify](https://github.com/beautify-web/js-beautify) by [Josh Goldberg](https://github.com/JoshuaKGoldberg) * [:link:](blocks/blocks.d.ts) [jsblocks](http://jsblocks.com) by [Krzysztof Śmigiel](https://github.com/ksmigiel) * [: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) @@ -608,6 +642,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](jsnox/jsnox.d.ts) [JSnoX](https://github.com/af/jsnox) by [Steve Baker](https://github.com/stkb) * [:link:](json-patch/json-patch.d.ts) [json-patch](https://github.com/bruth/jsonpatch-js) by [vvakame](https://github.com/vvakame) * [:link:](json-pointer/json-pointer.d.ts) [json-pointer 1.0 l](https://www.npmjs.org/package/json-pointer) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](json-stable-stringify/json-stable-stringify.d.ts) [json-stable-stringify](https://github.com/substack/json-stable-stringify) by [Matt Frantz](https://github.com/mhfrantz) * [:link:](json5/json5.d.ts) [JSON5](http://json5.org) by [Jason Swearingen](https://jasonswearingen.github.io) * [:link:](jsoneditoronline/jsoneditoronline.d.ts) [JSONEditorOnline](https://github.com/josdejong/jsoneditoronline) by [Vincent Bortone](https://github.com/vbortone) * [:link:](jsonpath/jsonpath.d.ts) [jsonpath](https://www.npmjs.org/package/jsonpath) by [Hiroki Horiuchi](https://github.com/horiuchi) @@ -627,6 +662,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](karma/karma.d.ts) [karma](https://github.com/karma-runner/karma) by [Tanguy Krotoff](https://github.com/tkrotoff) * [:link:](karma-jasmine/karma-jasmine.d.ts) [karma-jasmine plugin](https://github.com/karma-runner/karma-jasmine) by [Michel Salib](https://github.com/michelsalib) * [:link:](katex/katex.d.ts) [KaTeX v.0.5.0](http://khan.github.io/KaTeX) by [Michael Randolph](https://github.com/mrand01) +* [:link:](kefir/kefir.d.ts) [Kefir](http://rpominov.github.io/kefir) by [Aya Morisawa](https://github.com/AyaMorisawa) * [:link:](kendo-ui/kendo-ui.d.ts) [Kendo UI Professional](http://www.telerik.com/kendo-ui) by [Telerik](https://github.com/telerik) * [:link:](keyboardjs/keyboardjs.d.ts) [KeyboardJS](https://github.com/RobertWHurst/KeyboardJS) by [Vincent Bortone](https://github.com/vbortone) * [:link:](keymaster/keymaster.d.ts) [keymaster](https://github.com/madrobby/keymaster) by [Martin W. Kirst](https://github.com/nitram509) @@ -667,6 +703,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](leapmotionTS/LeapMotionTS.d.ts) [Leap Motion TS](https://github.com/logotype/LeapMotionTS) by [Victor Norgren](https://github.com/logotype) * [:link:](less/less.d.ts) [LESS](http://lesscss.org) by [Tom Hasner](https://github.com/thasner) * [:link:](less-middleware/less-middleware.d.ts) [less-middleware](https://github.com/emberfeather/less.js-middleware) by [Federico Bond](https://github.com/federicobond) +* [:link:](level-sublevel/level-sublevel.d.ts) [level-sublevel](https://github.com/dominictarr/level-sublevel) by [Bas Pennings](https://github.com/basp) * [:link:](levelup/levelup.d.ts) [LevelUp](https://github.com/rvagg/node-levelup) by [Bret Little](https://github.com/blittle) * [:link:](libxmljs/libxmljs.d.ts) [Libxmljs](https://github.com/polotek/libxmljs) by [François de Campredon](https://github.com/fdecampredon) * [:link:](dustjs-linkedin/dustjs-linkedin.d.ts) [linkedin dustjs](https://github.com/linkedin/dustjs) by [Marcelo Dezem](http://github.com/mdezem) @@ -709,15 +746,18 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](marked/marked.d.ts) [Marked](https://github.com/chjj/marked) by [William Orr](https://github.com/worr) * [:link:](markerclustererplus/markerclustererplus.d.ts) [MarkerClustererPlus for Google Maps V3](http://github.com/mahnunchik/markerclustererplus) by [Mathias Rodriguez](http://github.com/enanox) * [:link:](maskedinput/maskedinput.d.ts) [Masked Input plugin for jQuery](http://digitalbush.com/projects/masked-input-plugin) by [Lokesh Peta](https://github.com/lokeshpeta) +* [:link:](material-ui/material-ui.d.ts) [material-ui](https://github.com/callemall/material-ui) by [Nathan Brown](https://github.com/ngbrown) * [:link:](mathjax/mathjax.d.ts) [MathJax](https://github.com/mathjax/MathJax) by [Roland Zwaga](https://github.com/rolandzwaga) * [:link:](matter-js/matter-js.d.ts) [Matter.js](https://github.com/liabru/matter-js) by [Ivane Gegia](https://twitter.com/ivanegegia) * [:link:](mCustomScrollbar/mCustomScrollbar.d.ts) [mCustomScrollbar](https://github.com/malihu/malihu-custom-scrollbar-plugin) by [Sarah Williams](https://github.com/flurg) * [:link:](memory-cache/memory-cache.d.ts) [memory-cache](http://github.com/ptarjan/node-cache) by [Jeff Goddard](https://github.com/jedigo) * [:link:](merge-stream/merge-stream.d.ts) [merge-stream](https://github.com/grncdr/merge-stream) by [Keita Kagurazaka](https://github.com/k-kagurazaka) * [:link:](merge2/merge2.d.ts) [merge2](https://github.com/teambition/merge2) by [Tanguy Krotoff](https://github.com/tkrotoff) +* [:link:](meshblu/meshblu.d.ts) [meshblu.js](https://github.com/octoblu/meshblu-npm) by [Felipe Nipo](https://github.com/fnipo) * [:link:](mess/mess.d.ts) [mess](https://github.com/bobrik/node-mess) by [Wim Looman](https://github.com/Nemo157) * [:link:](messenger/messenger.d.ts) [Messenger.js](https://github.com/HubSpot/messenger) by [Derek Cicerone](https://github.com/derekcicerone) * [:link:](meteor/meteor.d.ts) [Meteor](http://www.meteor.com) by [Dave Allen](https://github.com/fullflavedave) +* [:link:](node-mysql-wrapper/my-meteor.d.ts) [meteorjs for node-mysql-wrapper which helps in development](https://github.com/nodets/node-mysql-wrapper) by [Makis Maropoulos](https://github.com/kataras) * [:link:](method-override/method-override.d.ts) [method-override](https://github.com/expressjs/method-override) by [Santi Albo](https://github.com/santialbo) * [:link:](metismenu/metismenu.d.ts) [metisMenu](http://github.com/onokumus/metisMenu) by [onokums](https://github.com/onokumus) * [:link:](microsoft-ajax/microsoft.ajax.d.ts) [Microsoft ASP.NET Ajax client side library](http://msdn.microsoft.com/en-us/library/ee341002(v=vs.100).aspx) by [Patrick Magee](https://github.com/pjmagee) @@ -745,16 +785,18 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](mkdirp/mkdirp.d.ts) [mkdirp](http://github.com/substack/node-mkdirp) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](mkpath/mkpath.d.ts) [mkpath](https://www.npmjs.com/package/mkpath) by [Jared Klopper](https://github.com/optical) * [:link:](mobile-detect/mobile-detect.d.ts) [mobile-detect](http://hgoebl.github.io/mobile-detect.js) by [Martin McWhorter](https://github.com/martinmcwhorter) -* [:link:](mocha/mocha.d.ts) [mocha](http://mochajs.org) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid), [otiai10](https://github.com/otiai10), [jt000](https://github.com/jt000), [Vadim Macagon](https://github.com/enlight) +* [:link:](mobservable/mobservable.d.ts) [mobservable](https://mweststrate.github.io/mobservable) by [Michel Weststrate](https://github.com/mweststrate) +* [:link:](mobservable-react/mobservable-react.d.ts) [mobservable](https://github.com/mweststrate/mobservable-react) by [Michel Weststrate](https://github.com/mweststrate) * [:link:](mocha/mocha-node.d.ts) [mocha](http://mochajs.org) by [Vadim Macagon](https://github.com/enlight), [vvakame](https://github.com/vvakame) +* [:link:](mocha/mocha.d.ts) [mocha](http://mochajs.org) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid), [otiai10](https://github.com/otiai10), [jt000](https://github.com/jt000), [Vadim Macagon](https://github.com/enlight) * [:link:](mocha-phantomjs/mocha-phantomjs.d.ts) [mocha-phantomjs](http://metaskills.net/mocha-phantomjs) by [Erik Schierboom](https://github.com/ErikSchierboom) * [:link:](mock-fs/mock-fs.d.ts) [mock-fs](https://github.com/tschaub/mock-fs) by [Wim Looman](https://github.com/Nemo157) * [:link:](mockery/mockery.d.ts) [mockery](https://github.com/mfncooper/mockery) by [jt000](https://github.com/jt000) * [:link:](modernizr/modernizr.d.ts) [Modernizr](http://modernizr.com) by [Boris Yankov](https://github.com/borisyankov), [Theodore Brown](https://github.com/theodorejb) * [:link:](moment-timezone/moment-timezone.d.ts) [moment-timezone.js](http://momentjs.com/timezone) by [Michel Salib](https://github.com/michelsalib) -* [:link:](moment/moment-node.d.ts) [Moment.js](https://github.com/timrwood/moment) by [Michael Lakerveld](https://github.com/Lakerfield), [Aaron King](https://github.com/kingdango), [Hiroki Horiuchi](https://github.com/horiuchi), [Dick van den Brink](https://github.com/DickvdBrink), [Adi Dahiya](https://github.com/adidahiya), [Matt Brooks](https://github.com/EnableSoftware) * [:link:](moment/moment.d.ts) [Moment.js](https://github.com/timrwood/moment) by [Michael Lakerveld](https://github.com/Lakerfield), [Aaron King](https://github.com/kingdango), [Hiroki Horiuchi](https://github.com/horiuchi), [Dick van den Brink](https://github.com/DickvdBrink), [Adi Dahiya](https://github.com/adidahiya), [Matt Brooks](https://github.com/EnableSoftware) * [:link:](moment-range/moment-range.d.ts) [Moment.js](https://github.com/gf3/moment-range) by [Bart van den Burg](https://github.com/Burgov), [Wilgert Velinga](https://github.com/wilgert) +* [:link:](moment/moment-node.d.ts) [Moment.js](https://github.com/timrwood/moment) by [Michael Lakerveld](https://github.com/Lakerfield), [Aaron King](https://github.com/kingdango), [Hiroki Horiuchi](https://github.com/horiuchi), [Dick van den Brink](https://github.com/DickvdBrink), [Adi Dahiya](https://github.com/adidahiya), [Matt Brooks](https://github.com/EnableSoftware) * [:link:](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) @@ -767,7 +809,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](mpromise/mpromise.d.ts) [mpromise](https://github.com/aheckmann/mpromise) by [Seulgi Kim](https://github.com/sgkim126) * [: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:](mssql/mssql.d.ts) [mssql](https://www.npmjs.com/package/mssql) by [COLSA Corporation](http://www.colsa.com) +* [:link:](msportalfx-test/msportalfx-test.d.ts) [msportalfx-test](https://msazure.visualstudio.com/DefaultCollection/AzureUX/_git/portalfx-msportalfx-test) by [Julio Casal](https://github.com/julioct) +* [:link:](mssql/mssql.d.ts) [mssql](https://www.npmjs.com/package/mssql) by [COLSA Corporation](http://www.colsa.com), [Ben Farr](https://github.com/jaminfarr) * [: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), [vilicvane](https://vilic.github.io) * [:link:](multiplexjs/multiplexjs.d.ts) [Multiplex.js](http://github.com/multiplex/multiplex.js) by [Kamyar Nazeri](http://github.com/KamyarNazeri) @@ -778,8 +821,10 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](ncp/ncp.d.ts) [ncp](https://github.com/AvianFlu/ncp) by [Bart van der Schoor](https://github.com/bartvds) * [:link:](nedb/nedb.d.ts) [NeDB](https://github.com/louischatriot/nedb) by [Stefan Steinhart](https://github.com/reppners) * [:link:](needle/needle.d.ts) [needle](https://github.com/tomas/needle) by [San Chen](https://github.com/bigsan) +* [:link:](netmask/netmask.d.ts) [Netmask](https://github.com/rs/node-netmask) by [Matt Frantz](https://github.com/mhfrantz) * [:link:](nexpect/nexpect.d.ts) [nexpect](https://github.com/nodejitsu/nexpect) by [vvakame](http://github.com/vvakame) * [:link:](ng-command/ng-command.d.ts) [ng-command](https://github.com/stephenlautier/ng-command) by [Stephen Lautier](https://github.com/stephenlautier) +* [:link:](ng-flow/ng-flow.d.ts) [ng-flow](https://github.com/flowjs/ng-flow) by [Ryan McNamara](https://github.com/ryan10132) * [:link:](ng-grid/ng-grid.d.ts) [ng-grid](http://angular-ui.github.io/ng-grid) by [Ken Smith](https://github.com/smithkl42), [Roland Zwaga](https://github.com/rolandzwaga), [Kent Cooper](https://github.com/kentcooper) * [:link:](angular-idle/angular-idle.d.ts) [ng-idle](http://hackedbychinese.github.io/ng-idle) by [mthamil](https://github.com/mthamil) * [:link:](ng-dialog/ng-dialog.d.ts) [ngDialog](https://github.com/likeastore/ngDialog) by [Stephen Lautier](https://github.com/stephenlautier) @@ -791,10 +836,15 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](nock/nock.d.ts) [nock](https://github.com/pgte/nock) by [bonnici](https://github.com/bonnici) * [:link:](node-imap/imap.d.ts) [node imap](https://github.com/mscdex/node-imap) by [Steve Fenton](https://github.com/Steve-Fenton) * [:link:](node-sass/node-sass.d.ts) [Node Sass](https://github.com/sass/node-sass) by [Asana](https://asana.com) +* [:link:](acl/acl.d.ts) [node_acl](https://github.com/optimalbits/node_acl) by [Qubo](https://github.com/tkQubo) +* [:link:](mdns/mdns.d.ts) [node_mdns](https://github.com/agnat/node_mdns) by [Stefan Steinhart](https://github.com/reppners) +* [:link:](node_redis/node_redis.d.ts) [node_redis](https://github.com/mranney/node_redis) by [Boris Yankov](https://github.com/borisyankov) * [:link:](apn/apn.d.ts) [node-apn](https://github.com/argon/node-apn) by [Zenorbi](https://github.com/zenorbi) * [:link:](bunyan/bunyan.d.ts) [node-bunyan](https://github.com/trentm/node-bunyan) by [Alex Mikhalev](https://github.com/amikhalev) * [:link:](bunyan-logentries/bunyan-logentries.d.ts) [node-bunyan-logentries](https://github.com/nemtsov/node-bunyan-logentries) by [Aymeric Beaumet](http://aymericbeaumet.me) +* [:link:](node-cache/node-cache.d.ts) [node-cache](https://github.com/tcs-de/nodecache) by [Ilya Mochalov](https://github.com/chrootsu) * [:link:](node-calendar/node-calendar.d.ts) [node-calendar](https://www.npmjs.com/package/node-calendar) by [Luzian Zagadinow](https://github.com/luzianz) +* [:link:](config/config.d.ts) [node-config](https://github.com/lorenwest/node-config) by [Roman Korneev](https://github.com/RWander) * [: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) @@ -806,10 +856,11 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](node-jsfl-runner/node-jsfl-runner.d.ts) [node-jsfl-runner](https://www.npmjs.com/package/node-jsfl-runner) by [Michael Randolph](https://github.com/mrand01) * [:link:](multiparty/multiparty.d.ts) [node-multiparty](https://github.com/andrewrk/node-multiparty) by [Ken Fukuyama](https://github.com/kenfdev) * [:link:](mysql/mysql.d.ts) [node-mysql](https://github.com/felixge/node-mysql) by [William Johnston](https://github.com/wjohnsto) -* [:link:](node-mysql-wrapper/node-mysql-wrapper.d.ts) [node-mysql-wrapper](https://github.com/kataras/node-mysql-wrapper) by [Makis Maropoulos](https://github.com/kataras) +* [:link:](node-mysql-wrapper/node-mysql-wrapper.d.ts) [node-mysql-wrapper](https://github.com/nodets/node-mysql-wrapper) by [Makis Maropoulos](https://github.com/kataras) * [:link:](node-notifier/node-notifier.d.ts) [node-notifier](https://github.com/mikaelbr/node-notifier) by [Qubo](https://github.com/tkQubo) * [:link:](node-persist/node-persist.d.ts) [node-persist](https://github.com/simonlast/node-persist) by [Spencer Williams](http://spencerwi.com) * [:link:](node-polyglot/node-polyglot.d.ts) [node-polyglot](https://github.com/airbnb/polyglot.js) by [Tim Jackson-Kiely](https://github.com/timjk) +* [:link:](progress/progress.d.ts) [node-progress](https://github.com/tj/node-progress) by [Sebastian Lenz](https://github.com/sebastian-lenz) * [:link:](promptly/promptly.d.ts) [node-promptly](https://github.com/IndigoUnited/node-promptly) by [Dan Spencer](https://github.com/danrspencer) * [:link:](radius/radius.d.ts) [node-radius](https://github.com/retailnext/node-radius) by [Peter Harris](https://github.com/codeanimal) * [:link:](node-schedule/node-schedule.d.ts) [node-schedule](https://github.com/tejasmanohar/node-schedule) by [Cyril Schumacher](https://github.com/cyrilschumacher) @@ -821,12 +872,9 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](node/node.d.ts) [Node.js](http://nodejs.org) by [Microsoft TypeScript](http://typescriptlang.org), [DefinitelyTyped](https://github.com/borisyankov/DefinitelyTyped) * [:link:](_debugger/_debugger.d.ts) [Node.js debugger API](http://nodejs.org) by [Basarat Ali Syed](https://github.com/basarat) * [:link:](restify/restify.d.ts) [node.js REST framework](https://github.com/mcavage/node-restify) by [Bret Little](https://github.com/blittle) -* [:link:](acl/acl.d.ts) [node_acl](https://github.com/optimalbits/node_acl) by [Qubo](https://github.com/tkQubo) -* [:link:](mdns/mdns.d.ts) [node_mdns](https://github.com/agnat/node_mdns) by [Stefan Steinhart](https://github.com/reppners) -* [:link:](node_redis/node_redis.d.ts) [node_redis](https://github.com/mranney/node_redis) by [Boris Yankov](https://github.com/borisyankov) * [:link:](each/each.d.ts) [NodeEach](http://www.adaltas.com/projects/node-each) by [Michael Zabka](https://github.com/misak113) -* [:link:](nodemailer/nodemailer-types.d.ts) [Nodemailer](https://github.com/andris9/Nodemailer) by [Rogier Schouten](https://github.com/rogierschouten) * [:link:](nodemailer/nodemailer.d.ts) [Nodemailer](https://github.com/andris9/Nodemailer) by [Rogier Schouten](https://github.com/rogierschouten) +* [:link:](nodemailer/nodemailer-types.d.ts) [Nodemailer](https://github.com/andris9/Nodemailer) by [Rogier Schouten](https://github.com/rogierschouten) * [:link:](nodemailer-direct-transport/nodemailer-direct-transport.d.ts) [nodemailer-direct-transport](https://github.com/andris9/nodemailer-direct-transport) by [Rogier Schouten](https://github.com/rogierschouten) * [:link:](nodemailer-pickup-transport/nodemailer-pickup-transport.d.ts) [nodemailer-pickup-transport](https://www.npmjs.com/package/nodemailer-pickup-transport) by [Peter Snider](https://github.com/psnider) * [:link:](nodemailer-smtp-pool/nodemailer-smtp-pool.d.ts) [nodemailer-smtp-pool](https://github.com/andris9/nodemailer-smtp-pool) by [Rogier Schouten](https://github.com/rogierschouten) @@ -834,19 +882,21 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](nodeunit/nodeunit.d.ts) [nodeunit](https://github.com/caolan/nodeunit) by [Jeff Goddard](https://github.com/jedigo) * [:link:](nomnom/nomnom.d.ts) [nomnom](https://github.com/harthur/nomnom) by [Paul Vick](https://github.com/panopticoncentral) * [:link:](nopt/nopt.d.ts) [nopt](https://github.com/npm/nopt) by [jbondc](https://github.com/jbondc) -* [:link:](notify/notify.d.ts) [Notify.js](https://github.com/jpillora/notifyjs) by [Xiaohan Zhang](https://github.com/hellochar) * [:link:](notifyjs/notifyjs.d.ts) [notify.js](https://github.com/alexgibson/notify.js) by [soundTricker](https://github.com/soundTricker) -* [:link:](wnumb/wnumb.d.ts) [nouislider](https://github.com/leongersen/wnumb) by [Corey Jepperson](https://github.com/acoreyj) +* [:link:](notify/notify.d.ts) [Notify.js](https://github.com/jpillora/notifyjs) by [Xiaohan Zhang](https://github.com/hellochar) * [:link:](nouislider/nouislider.d.ts) [nouislider](https://github.com/leongersen/noUiSlider) by [Patrick Davies](https://github.com/bleuarg) +* [:link:](wnumb/wnumb.d.ts) [nouislider](https://github.com/leongersen/wnumb) by [Corey Jepperson](https://github.com/acoreyj) * [:link:](noVNC/noVNC.d.ts) [noVNC](https://github.com/kanaka/noVNC) by [Ken Smith](https://github.com/smithkl42) * [:link:](npm/npm.d.ts) [npm](https://github.com/npm/npm) by [Maxime LUCE](https://github.com/SomaticIT) * [:link:](nprogress/NProgress.d.ts) [NProgress](https://github.com/rstacruz/nprogress) by [Judah Gabriel Himango](http://debuggerdotbreak.wordpress.com) * [:link:](numbro/numbro.d.ts) [Numbro.js](https://github.com/foretagsplatsen/numbro) by [Vincent Bortone](https://github.com/vbortone) * [:link:](numeraljs/numeraljs.d.ts) [Numeral.js](https://github.com/adamwdraper/Numeral-js) by [Vincent Bortone](https://github.com/vbortone) +* [:link:](object-assign/object-assign.d.ts) [object-assign](https://github.com/sindresorhus/object-assign) by [Christopher Brown](https://github.com/chbrown) * [:link:](object-hash/object-hash.d.ts) [object-hash](https://github.com/puleos/object-hash) by [Michael Zabka](https://github.com/misak113) * [:link:](object-path/object-path.d.ts) [objectPath v0.9.x](https://github.com/mariocasciaro/object-path) by [Paulo Cesar](https://github.com/pocesar) * [:link:](oblo-util/oblo-util.d.ts) [oblo-util](https://github.com/Oblosys/oblo-util) by [Martijn Schrage](https://github.com/Oblosys) * [:link:](oboe/oboe.d.ts) [oboe](https://github.com/jimhigson/oboe.js) by [Jared Klopper](https://github.com/optical) +* [:link:](observe-js/observe-js.d.ts) [observe-js](https://github.com/Polymer/observe-js) by [Oliver Herrmann](https://github.com/herrmanno) * [:link:](oclazyload/oclazyload.d.ts) [oc.LazyLoad](https://github.com/ocombe/ocLazyLoad) by [Roland Zwaga](https://github.com/rolandzwaga) * [:link:](angular-odata-resources/angular-odata-resources.d.ts) [OData Angular Resources](https://github.com/devnixs/ODataAngularResources) by [Raphael ATALLAH](http://raphael.atallah.me) * [:link:](offline-js/offline-js.d.ts) [Offline](https://github.com/HubSpot/offline) by [Chris Wrench](https://github.com/cgwrench) @@ -869,9 +919,9 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](pascal-case/pascal-case.d.ts) [pascal-case](https://github.com/blakeembrey/pascal-case) by [Sam Saint-Pettersen](https://github.com/stpettersens) * [:link:](passport/passport.d.ts) [Passport](http://passportjs.org) by [Horiuchi_H](https://github.com/horiuchi) * [:link:](passport-strategy/passport-strategy.d.ts) [Passport Strategy module](https://github.com/jaredhanson/passport-strategy) by [Lior Mualem](https://github.com/liorm) -* [:link:](passport-twitter/passport-twitter.d.ts) [passport-facebook](https://github.com/jaredhanson/passport-facebook) by [James Roland Cabresos](https://github.com/staticfunction) -* [:link:](passport-google-oauth/passport-google-oauth.d.ts) [passport-facebook](https://github.com/jaredhanson/passport-facebook) by [James Roland Cabresos](https://github.com/staticfunction) * [:link:](passport-facebook/passport-facebook.d.ts) [passport-facebook](https://github.com/jaredhanson/passport-facebook) by [James Roland Cabresos](https://github.com/staticfunction) +* [:link:](passport-google-oauth/passport-google-oauth.d.ts) [passport-facebook](https://github.com/jaredhanson/passport-facebook) by [James Roland Cabresos](https://github.com/staticfunction) +* [:link:](passport-twitter/passport-twitter.d.ts) [passport-facebook](https://github.com/jaredhanson/passport-facebook) by [James Roland Cabresos](https://github.com/staticfunction) * [:link:](passport-facebook-token/passport-facebook-token.d.ts) [passport-facebook-token](https://github.com/drudge/passport-facebook-token) by [Ray Martone](https://github.com/rmartone) * [:link:](passport-local/passport-local.d.ts) [passport-local](https://github.com/jaredhanson/passport-local) by [Maxime LUCE](https://github.com/SomaticIT) * [:link:](path-case/path-case.d.ts) [path-case](https://github.com/blakeembrey/path-case) by [Sam Saint-Pettersen](https://github.com/stpettersens) @@ -890,6 +940,8 @@ 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:](phonegap-facebook-plugin/phonegap-facebook-plugin.d.ts) [phonegap-facebook-plugin](https://github.com/Wizcorp/phonegap-facebook-plugin) by [Justin Unterreiner](https://github.com/Justin-Credible) +* [:link:](phonegap-plugin-push/phonegap-plugin-push.d.ts) [phonegap-plugin-push](https://github.com/phonegap/phonegap-plugin-push) by [Frederico Galvão](https://github.com/fredgalvao) * [:link:](photonui/photonui.d.ts) [PhotonUI](https://github.com/wanadev/PhotonUI) by [Florent Poujol](https://github.com/florentpoujol) * [:link:](photoswipe/photoswipe.d.ts) [PhotoSwipe](http://photoswipe.com) by [Xiaohan Zhang](https://github.com/hellochar) * [:link:](physijs/physijs.d.ts) [Physijs](http://chandlerprall.github.io/Physijs) by [Satoru Kimura](https://github.com/gyohk) @@ -914,6 +966,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](power-assert/power-assert.d.ts) [power-assert](https://github.com/twada/power-assert) by [vvakame](https://github.com/vvakame) * [:link:](power-assert-formatter/power-assert-formatter.d.ts) [power-assert-formatter](https://github.com/twada/power-assert-formatter) by [vvakame](https://github.com/vvakame) * [:link:](precise/precise.d.ts) [precise](https://www.npmjs.org/package/precise) by [Peter Harris](https://github.com/codeanimal) +* [:link:](precond/precond.d.ts) [precond](https://github.com/MathieuTurcotte/node-precond) by [Oliver Schneider](https://github.com/olsio) * [:link:](preloadjs/preloadjs.d.ts) [PreloadJS](http://www.createjs.com/#!/PreloadJS) by [Pedro Ferreira](https://bitbucket.org/drk4) * [:link:](prelude-ls/prelude-ls.d.ts) [prelude.ls](http://www.preludels.com) by [Aya Morisawa](https://github.com/AyaMorisawa) * [:link:](progressjs/progress.d.ts) [ProgressJs](http://usablica.github.io/progress.js) by [Shunsuke Ohtani](https://github.com/zaneli) @@ -925,10 +978,12 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](pty.js/pty.js.d.ts) [pty.js 0.2.7-1](https://github.com/chjj/pty.js) by [Vadim Macagon](https://github.com/enlight) * [: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:](pusher-js/pusher-js.d.ts) [pusher-js](https://github.com/pusher/pusher-js) by [Qubo](https://github.com/tkqubo) * [: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) * [:link:](q-io/Q-io.d.ts) [Q-io](https://github.com/kriskowal/q-io) by [Bart van der Schoor](https://github.com/Bartvds) * [: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:](qs/qs.d.ts) [qs](https://github.com/hapijs/qs) by [Roman Korneev](https://github.com/RWander) * [:link:](qtip2/qtip2.d.ts) [qtip2](http://qtip2.com) by [Nathan Pitman](https://github.com/Seltzer) * [:link:](quixote/quixote.d.ts) [quixote](http://quixote-css.com) by [Aleksandr Filatov](https://github.com/greybax) * [:link:](qunit/qunit.d.ts) [QUnit](http://qunitjs.com) by [Diullei Gomes](https://github.com/diullei) @@ -936,21 +991,29 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](rabbit.js/rabbit.js.d.ts) [rabbit.js](https://github.com/squaremo/rabbit.js) by [Wonshik Kim](https://github.com/wokim) * [:link:](ractive/ractive.d.ts) [Ractive](http://ractivejs.org) by [Han Lin Yap](http://yap.nu) * [:link:](random-string/random-string.d.ts) [random-string](https://github.com/valiton/node-random-string) by [Sam Saint-Pettersen](https://github.com/stpettersens) +* [:link:](rangy/rangy.d.ts) [Rangy](https://github.com/timdown/rangy) by [Rudolph Gottesheim](http://www.midnight-design.at) * [:link:](raphael/raphael.d.ts) [Raphael](http://raphaeljs.com) by [CheCoxshall](https://github.com/CheCoxshall) * [:link:](rappid/rappid.d.ts) [Rappid](http://jointjs.com/about-rappid) by [Ewout Van Gossum](https://github.com/DenEwout) * [:link:](ravenjs/ravenjs.d.ts) [Raven.js](https://github.com/getsentry/raven-js) by [Santi Albo](https://github.com/santialbo) * [:link:](raygun4js/raygun4js.d.ts) [raygun4js](https://github.com/MindscapeHQ/raygun4js) by [Brian Surowiec](https://github.com/xt0rted) -* [:link:](react/react.d.ts) [React (external module)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com) -* [:link:](react/react-global.d.ts) [React (internal module)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com) +* [:link:](react/react.d.ts) [React](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com) +* [:link:](react/react-global.d.ts) [React (namespace)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com) * [:link:](react-dnd/react-dnd.d.ts) [React DnD](https://github.com/gaearon/react-dnd) by [Asana](https://asana.com) * [:link:](react-router/react-router.d.ts) [React Router](https://github.com/rackt/react-router) by [Yuichi Murata](https://github.com/mrk21), [Václav Ostrožlík](https://github.com/vasek17) +* [:link:](react-mixin/react-mixin.d.ts) [react-mixin](https://github.com/brigand/react-mixin) by [Qubo](https://github.com/tkqubo) +* [:link:](react-props-decorators/react-props-decorators.d.ts) [react-props-decorators](https://github.com/popkirby/react-props-decorators) by [Qubo](https://github.com/tkqubo) +* [:link:](react-redux/react-redux.d.ts) [react-redux](https://github.com/rackt/react-redux) by [Qubo](https://github.com/tkqubo) +* [:link:](react-spinkit/react-spinkit.d.ts) [react-spinkit](https://github.com/KyleAMathews/react-spinkit) by [Qubo](https://github.com/tkqubo) * [:link:](react-swf/react-swf.d.ts) [react-swf](https://github.com/syranide/react-swf) by [Stepan Mikhaylyuk](https://github.com/stepancar) -* [:link:](react/react-addons.d.ts) [ReactWithAddons (external module)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com) -* [:link:](react/react-addons-global.d.ts) [ReactWithAddons (internal module)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com) * [:link:](readdir-stream/readdir-stream.d.ts) [readdir-stream](https://github.com/logicalparadox/readdir-stream) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](recursive-readdir/recursive-readdir.d.ts) [recursive-readdir](https://github.com/jergason/recursive-readdir) by [Elisée Maurer](https://github.com/elisee) -* [:link:](redis/redis.d.ts) [redis](https://github.com/mranney/node_redis) by [Carlos Ballesteros Velasco](https://github.com/soywiz), [Peter Harris](https://github.com/CodeAnimal) +* [:link:](redis/redis.d.ts) [redis](https://github.com/mranney/node_redis) by [Carlos Ballesteros Velasco](https://github.com/soywiz), [Peter Harris](https://github.com/CodeAnimal), [TANAKA Koichi](https://github.com/MugeSo) +* [:link:](redlock/redlock.d.ts) [Redlock](https://github.com/mike-marcacci/node-redlock) by [Ilya Mochalov](https://github.com/chrootsu) * [:link:](redux/redux.d.ts) [Redux](https://github.com/rackt/redux) by [William Buchwalter](https://github.com/wbuchwalter), [Vincent Prouillet](https://github.com/Keats) +* [:link:](redux-action-utils/redux-action-utils.d.ts) [redux-action-utils](https://github.com/insin/redux-action-utils) by [Qubo](https://github.com/tkqubo) +* [:link:](redux-actions/redux-actions.d.ts) [redux-actions](https://github.com/acdlite/redux-actions) by [Jack Hsu](https://github.com/jaysoo) +* [:link:](redux-devtools/redux-devtools.d.ts) [redux-devtools](https://github.com/gaearon/redux-devtools) by [Qubo](https://github.com/tkqubo) +* [:link:](redux-logger/redux-logger.d.ts) [redux-logger](https://github.com/fcomb/redux-logger) by [Alexander Rusakov](https://github.com/arusakov) * [:link:](ref/ref.d.ts) [ref](https://github.com/TooTallNate/ref) by [Paul Loyd](https://github.com/loyd) * [:link:](ref-array/ref-array.d.ts) [ref-array](https://github.com/TooTallNate/ref-array) by [Paul Loyd](https://github.com/loyd) * [:link:](ref-struct/ref-struct.d.ts) [ref-struct](https://github.com/TooTallNate/ref-struct) by [Paul Loyd](https://github.com/loyd) @@ -961,13 +1024,16 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](requirejs/require.d.ts) [RequireJS](http://requirejs.org) by [Josh Baldwin](https://github.com/jbaldwin) * [:link:](resemblejs/resemblejs.d.ts) [Resemble.js](http://huddle.github.io/Resemble.js) by [Tim Perry](https://github.com/pimterry) * [:link:](response-time/response-time.d.ts) [response-time](https://github.com/expressjs/response-time) by [Uros Smolnik](https://github.com/urossmolnik) +* [:link:](rest-io/rest-io.d.ts) [rest-io](https://github.com/EnoF/rest-io) by [Andy Tang](https://github.com/EnoF), [Stefan Schacherl](https://github.com/TheBay0r) * [:link:](rest/rest.d.ts) [rest.js](https://github.com/cujojs/rest) by [Wim Looman](https://github.com/Nemo157) * [:link:](restangular/restangular.d.ts) [Restangular](https://github.com/mgonto/restangular) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](restful.js/restful.js.d.ts) [restful.js](https://github.com/marmelab/restful.js) by [Qubo](https://github.com/tkqubo) * [:link:](rethinkdb/rethinkdb.d.ts) [Rethinkdb](http://rethinkdb.com) by [Sean Hess](https://seanhess.github.io) * [:link:](reveal/reveal.d.ts) [Reveal](https://github.com/hakimel/reveal.js) by [grapswiz](https://github.com/grapswiz) * [:link:](rickshaw/rickshaw.d.ts) [Rickshaw](http://code.shutterstock.com/rickshaw) by [Blake Niemyjski](https://github.com/niemyjski) * [:link:](rimraf/rimraf.d.ts) [rimraf](https://github.com/isaacs/rimraf) by [Carlos Ballesteros Velasco](https://github.com/soywiz) * [:link:](riotjs/riotjs.d.ts) [riot.js](https://github.com/moot/riotjs) by [vvakame](https://github.com/vvakame) +* [:link:](riotcontrol/riotcontrol.d.ts) [RiotControl](https://github.com/jimsparkman/RiotControl) by [Ilya Mochalov](https://github.com/chrootsu) * [:link:](rivets/rivets.d.ts) [rivets](http://rivetsjs.com) by [Trevor Baron](https://github.com/TrevorDev) * [:link:](route-recognizer/route-recognizer.d.ts) [route-recognizer](https://github.com/tildeio/route-recognizer) by [Dave Keen](http://www.keendevelopment.ch) * [:link:](routie/routie.d.ts) [routie](https://github.com/jgallen23/routie) by [Adilson](https://github.com/Adilson) @@ -1008,8 +1074,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](sentence-case/sentence-case.d.ts) [sentence-case](https://github.com/blakeembrey/sentence-case) by [Sam Saint-Pettersen](https://github.com/stpettersens) * [:link:](sequelize/sequelize.d.ts) [Sequelize](http://sequelizejs.com) by [samuelneff](https://github.com/samuelneff), [Peter Harris](https://github.com/codeanimal), [Ivan Drinchev](https://github.com/drinchev) * [:link:](sequelize-fixtures/sequelize-fixtures.d.ts) [Sequelize-Fixtures](https://github.com/domasx2/sequelize-fixtures) by [Christian Schwarz](https://github.com/cschwarz) -* [:link:](serve-favicon/serve-favicon.d.ts) [serve-favicon](https://github.com/expressjs/serve-favicon) by [Uros Smolnik](https://github.com/urossmolnik) * [:link:](on-headers/on-headers.d.ts) [serve-favicon](https://github.com/jshttp/on-headers) by [John Jeffery](https://github.com/jjeffery) +* [:link:](serve-favicon/serve-favicon.d.ts) [serve-favicon](https://github.com/expressjs/serve-favicon) by [Uros Smolnik](https://github.com/urossmolnik) * [:link:](serve-static/serve-static.d.ts) [serve-static](https://github.com/expressjs/serve-static) by [Uros Smolnik](https://github.com/urossmolnik) * [:link:](sharedworker/SharedWorker.d.ts) [SharedWorker](http://www.w3.org/TR/workers) by [Toshiya Nakakura](https://github.com/nakakura) * [:link:](sharepoint/SharePoint.d.ts) [SharePoint 2010 and 2013](http://sptypescript.codeplex.com) by [Stanislav Vyshchepan](http://blog.gandjustas.ru), [Andrey Markeev](http://markeev.com) @@ -1023,6 +1089,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](signalr/signalr.d.ts) [SignalR](http://www.asp.net/signalr) by [Boris Yankov](https://github.com/borisyankov), [T. Michael Keesey](https://github.com/keesey) * [:link:](signature_pad/signature_pad.d.ts) [signature_pad](https://github.com/szimek/signature_pad) by [Abubaker Bashir](https://github.com/AbubakerB) * [:link:](simple-cw-node/simple-cw-node.d.ts) [simple-cw-node](https://github.com/astronaughts/simple-cw-node) by [vvakame](https://github.com/vvakame) +* [:link:](simplebar/simplebar.d.ts) [simplebar.js](https://github.com/Grsmto/simplebar) by [Gregor Woiwode](https://github.com/gregonnet) * [:link:](jquery.simplemodal/jquery.simplemodal.d.ts) [SimpleModal](http://www.ericmmartin.com/projects/simplemodal) by [Friedrich von Never](https://github.com/ForNeVeR) * [:link:](sinon/sinon.d.ts) [Sinon](http://sinonjs.org) by [William Sears](https://github.com/mrbigdog2u) * [:link:](sinon-chai/sinon-chai.d.ts) [sinon-chai](https://github.com/domenic/sinon-chai) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid), [Jed Mao](https://github.com/jedmao) @@ -1040,6 +1107,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](snapsvg/snapsvg.d.ts) [Snap-SVG](https://github.com/adobe-webplatform/Snap.svg) by [Lars Klein](https://github.com/lhk) * [:link:](socket.io/socket.io.d.ts) [socket.io](http://socket.io) by [PROGRE](https://github.com/progre), [Damian Connolly](https://github.com/divillysausages) * [:link:](socket.io-client/socket.io-client.d.ts) [socket.io-client](http://socket.io) by [PROGRE](https://github.com/progre), [Damian Connolly](https://github.com/divillysausages) +* [:link:](socket.io.users/socket.io.users.d.ts) [socket.io.users](https://github.com/nodets/socket.io.users) by [Makis Maropoulos](https://github.com/kataras) * [:link:](sockjs/sockjs.d.ts) [SockJS 0.3.x](https://github.com/sockjs/sockjs-client) by [Emil Ivanov](https://github.com/vladev) * [:link:](sockjs-node/sockjs-node.d.ts) [sockjs-node 0.3.x](https://github.com/sockjs/sockjs-node) by [Phil McCloghry-Laing](https://github.com/pmccloghrylaing) * [:link:](soundjs/soundjs.d.ts) [SoundJS](http://www.createjs.com/#!/SoundJS) by [Pedro Ferreira](https://bitbucket.org/drk4) @@ -1057,6 +1125,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](stack-mapper/stack-mapper.d.ts) [stack-mapper](https://github.com/thlorenz/stack-mapper) by [Rogier Schouten](https://github.com/rogierschouten) * [:link:](stacktrace-js/stacktrace-js.d.ts) [stacktrace.js](https://github.com/stacktracejs/stacktrace.js) by [Exceptionless](https://github.com/exceptionless) * [:link:](stampit/stampit.d.ts) [stampit](https://github.com/stampit-org/stampit) by [Vasyl Boroviak](https://github.com/koresar) +* [:link:](static-eval/static-eval.d.ts) [static-eval](https://github.com/substack/static-eval) by [Ben Liddicott](https://github.com/benliddicott/DefinitelyTyped) * [:link:](stats/stats.d.ts) [Stats.js r12](http://github.com/mrdoob/stats.js) by [Gregory Dalton](https://github.com/gregolai) * [:link:](statsd-client/statsd-client.d.ts) [statsd-client](https://github.com/msiebuhr/node-statsd-client) by [Peter Kooijmans](https://github.com/peterkooijmans) * [:link:](status-bar/status-bar.d.ts) [status-bar](https://github.com/atom/status-bar) by [vvakame](https://github.com/vvakame) @@ -1066,6 +1135,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](stream-to-array/stream-to-array.d.ts) [stream-to-array](https://github.com/stream-utils/stream-to-array) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](streamjs/streamjs.d.ts) [streamjs](http://winterbe.github.io/streamjs) by [Bence Eros](https://github.com/erosb) * [:link:](string_score/string_score.d.ts) [string_score](https://github.com/joshaven/string_score) by [Marcin Porębski](https://github.com/marcinporebski) +* [:link:](string/string.d.ts) [string.js](http://stringjs.com) by [Bas Pennings](https://github.com/basp) * [:link:](stripe/stripe.d.ts) [stripe](https://stripe.com) by [Andy Hawkins](https://github.com/a904guy/,http://a904guy.com), [Eric J. Smith](https://github.com/ejsmith) * [:link:](stripe-checkout/stripe-checkout.d.ts) [Stripe Checkout](https://stripe.com/checkout) by [Chris Wrench](https://github.com/cgwrench) * [:link:](stripe/stripe-node.d.ts) [stripe-node](https://github.com/stripe/stripe-node) by [William Johnston](https://github.com/wjohnsto) @@ -1075,10 +1145,12 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](superagent/superagent.d.ts) [SuperAgent](https://github.com/visionmedia/superagent) by [Alex Varju](https://github.com/varju) * [:link:](supertest/supertest.d.ts) [SuperTest](https://github.com/visionmedia/supertest) by [Alex Varju](https://github.com/varju) * [: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:](svg-sprite/svg-sprite.d.ts) [svg-sprite](https://github.com/jkphl/svg-sprite) by [Qubo](https://github.com/tkqubo) * [:link:](svgjs/svgjs.d.ts) [svg.js](http://www.svgjs.com) by [Sean Hess](https://seanhess.github.io) * [:link:](svg2png/svg2png.d.ts) [svg2png node package](https://github.com/domenic/svg2png) by [hans windhoff](https://github.com/hansrwindhoff) * [:link:](svgjs.draggable/svgjs.draggable.d.ts) [svgjs.draggable](http://www.svgjs.com) by [Luigi Trabacchin](https://github.com/LiFeleSs) * [:link:](swag/swag.d.ts) [swag](https://github.com/elving/swag) by [Shogo Iwano](https://github.com/shiwano) +* [:link:](swaggerize-express/swaggerize-express.d.ts) [swaggerize-express 4.x](https://github.com/krakenjs/swaggerize-express) by [TANAKA Koichi](https://github.com/mugeso) * [:link:](swap-case/swap-case.d.ts) [swap-case](https://github.com/blakeembrey/swap-case) by [Sam Saint-Pettersen](https://github.com/stpettersens) * [:link:](sweetalert/sweetalert.d.ts) [SweetAlert](https://github.com/t4t5/sweetalert) by [Markus Peloso](https://github.com/ToastHawaii) * [:link:](swfobject/swfobject.d.ts) [swfobject](https://code.google.com/p/swfobject) by [rou](https://github.com/rou) @@ -1090,6 +1162,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](switchery/switchery.d.ts) [switchery](https://github.com/abpetkov/switchery) by [Bruno Grieder](https://github.com/bgrieder) * [:link:](swiz/swiz.d.ts) [swiz](https://github.com/racker/node-swiz) by [Jeff Goddard](https://github.com/jedigo) * [:link:](systemjs/systemjs.d.ts) [System.js](https://github.com/systemjs/systemjs) by [Ludovic HENIN](https://github.com/ludohenin), [Nathan Walker](https://github.com/NathanWalker) +* [:link:](tabris/tabris.d.ts) [Tabris.js](http://tabrisjs.com) by [Tabris.js team](http://github.com/eclipsesource/tabris) * [:link:](tabtab/tabtab.d.ts) [tabtab](https://github.com/mklabs/node-tabtab) by [Vojtěch Habarta](https://github.com/vojtechhabarta) * [:link:](tape/tape.d.ts) [tape](https://github.com/substack/tape) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](tar/tar.d.ts) [tar](https://github.com/npm/node-tar) by [Maxime LUCE](https://github.com/SomaticIT) @@ -1125,13 +1198,14 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](timelinejs/timelinejs.d.ts) [timelinejs](https://github.com/NUKnightLab/TimelineJS) by [Roland Zwaga](https://github.com/rolandzwaga) * [: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:](tv4/tv4.d.ts) [Tiny Validator tv4](https://github.com/geraintluff/tv4) by [Bart van der Schoor](https://github.com/Bartvds), [Peter Snider](https://github.com/psnider) * [: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 Mobile](http://www.appcelerator.com) by [Craig Younkins](https://github.com/cyounkins) * [:link:](title-case/title-case.d.ts) [title-case](https://github.com/blakeembrey/title-case) by [Sam Saint-Pettersen](https://github.com/stpettersens) * [:link:](tmp/tmp.d.ts) [tmp](https://www.npmjs.com/package/tmp) by [Jared Klopper](https://github.com/optical) * [:link:](to-title-case-gouch/to-title-case-gouch.d.ts) [to-title-case](https://github.com/gouch/to-title-case) by [Sam Saint-Pettersen](https://github.com/stpettersens) * [:link:](toastr/toastr.d.ts) [Toastr](https://github.com/CodeSeven/toastr) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](tooltipster/tooltipster.d.ts) [tooltipster](https://github.com/iamceege/tooltipster) by [Stephen Lautier](https://github.com/stephenlautier) * [:link:](sencha_touch/SenchaTouch.d.ts) [Touch](http://www.sencha.com/products/touch) by [Brian Kotek](https://github.com/brian428) * [:link:](traceback/traceback.d.ts) [Traceback](http://github.com/iriscouch/traceback) by [Michael Zabka](https://github.com/misak113) * [:link:](traverson/traverson.d.ts) [Traverson](https://github.com/basti1302/traverson) by [Marcin Porębski](https://github.com/marcinporebski) @@ -1154,15 +1228,16 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](typescript-services/typescriptServices.d.ts) [TypeScript-Services](https://www.npmjs.org/package/typescript-services) by [Basarat Ali Syed](http://github.com/basarat) * [:link:](unity-webapi/unity-webapi.d.ts) [Ubuntu Unity Web API](https://launchpad.net/libunity-webapps) by [John Vrbanac](jhttps://github.com/jmvrbanac) * [:link:](ui-grid/ui-grid.d.ts) [ui-grid](http://www.ui-grid.info) by [Ben Tesser](https://github.com/btesser) -* [:link:](ui-router-extras/ui-router-extras.d.ts) [UI-Router Extras (ct.ui.router.extras module)](https://github.com/christopherthielen/ui-router-extras) by [Michael Putters](https://github.com/mputters) -* [:link:](umbraco/umbraco-resources.d.ts) [Umbraco](https://github.com/umbraco) by [DeCareSystemsIreland](https://github.com/DeCareSystemsIreland) +* [:link:](ui-router-extras/ui-router-extras.d.ts) [UI-Router Extras (ct.ui.router.extras module)](https://github.com/christopherthielen/ui-router-extras) by [Michael Putters](https://github.com/mputters), [Marcel van de Kamp](https://github.com/marcel-k) * [:link:](umbraco/umbraco-services.d.ts) [Umbraco](https://github.com/umbraco) by [DeCareSystemsIreland](https://github.com/DeCareSystemsIreland) * [:link:](umbraco/umbraco.d.ts) [Umbraco](https://github.com/umbraco) by [DeCareSystemsIreland](https://github.com/DeCareSystemsIreland) +* [:link:](umbraco/umbraco-resources.d.ts) [Umbraco](https://github.com/umbraco) by [DeCareSystemsIreland](https://github.com/DeCareSystemsIreland) * [:link:](underscore/underscore.d.ts) [Underscore](http://underscorejs.org) by [Boris Yankov](https://github.com/borisyankov), [Josh Baldwin](https://github.com/jbaldwin) * [:link:](underscore-ko/underscore-ko.d.ts) [Underscore-ko 1.2.2 with underscore](https://github.com/kamranayub/UnderscoreKO) by [Maurits Elbers](https://github.com/MagicMau) * [:link:](underscore.string/underscore.string.d.ts) [underscore.string](https://github.com/epeli/underscore.string) by [Ry Racherbaumer](http://github.com/rygine) * [:link:](jquery.uniform/jquery.uniform.d.ts) [Uniform.js](https://github.com/pixelmatrix/uniform) by [flyfishMT](https://github.com/flyfishMT) * [:link:](uniq/uniq.d.ts) [uniq](https://www.npmjs.com/package/uniq) by [Hans Windhoff](https://github.com/hansrwindhoff) +* [:link:](unique-random/unique-random.d.ts) [unique-random](https://github.com/sindresorhus/unique-random) by [Yuki Kokubun](https://github.com/Kuniwak) * [:link:](universal-analytics/universal-analytics.d.ts) [universal-analytics](https://github.com/peaksandpies/universal-analytics) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](unorm/unorm.d.ts) [unorm](https://github.com/walling/unorm) by [Christopher Brown](https://github.com/chbrown) * [:link:](update-notifier/update-notifier.d.ts) [update-notifier](https://github.com/yeoman/update-notifier) by [vvakame](https://github.com/vvakame) @@ -1202,7 +1277,9 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](webcola/webcola.d.ts) [webcola](https://github.com/tgdwyer/WebCola) by [Qinfeng Chen](https://github.com/qinfchen) * [:link:](webcomponents.js/webcomponents.js.d.ts) [webcomponents.js](https://github.com/webcomponents/webcomponentsjs) by [Adi Dahiya](https://github.com/adidahiya) * [:link:](webcrypto/WebCrypto.d.ts) [WebCrypto](http://www.w3.org/TR/WebCryptoAPI) by [Lucas Dixon](https://github.com/iislucas) +* [:link:](webgl-ext/webgl-ext.d.ts) [WebGL Extensions](http://webgl.org) by [Arthur Langereis](https://github.com/zenmumbler) * [:link:](webix/webix.d.ts) [Webix UI](http://webix.com) by [Maksim Kozhukh](http://github.com/mkozhukh) +* [:link:](webpack/webpack.d.ts) [webpack](https://github.com/webpack/webpack) by [Qubo](https://github.com/tkqubo) * [: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:](websql/websql.d.ts) [websql](http://www.w3.org/TR/webdatabase) by [TeamworkGuy2](https://github.com/TeamworkGuy2) @@ -1222,6 +1299,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](xdate/xdate.d.ts) [XDate](http://arshaw.com/xdate) by [yamada28go](https://github.com/yamada28go) * [:link:](jsfl/xJSFL.d.ts) [xJSFL](http://www.xjsfl.com) by [soywiz](https://github.com/soywiz) * [:link:](xlsx/xlsx.d.ts) [xlsx](https://github.com/SheetJS/js-xlsx) by [themauveavenger](https://github.com/themauveavenger) +* [:link:](xml-parser/xml-parser.d.ts) [xml-parser](https://github.com/segmentio/xml-parser) by [Matt Frantz](https://github.com/mhfrantz) * [:link:](xmlbuilder/xmlbuilder.d.ts) [xmlbuilder](https://github.com/oozcitak/xmlbuilder-js) by [Wallymathieu](http://github.com/wallymathieu) * [:link:](xpath/xpath.d.ts) [xpath](https://github.com/goto100/xpath) by [Andrew Bradley](https://github.com/cspotcode) * [:link:](xregexp/xregexp.d.ts) [XRegExp](http://xregexp.com) by [Bart van der Schoor](https://github.com/Bartvds) diff --git a/angular-ui-router/angular-ui-router-tests.ts b/angular-ui-router/angular-ui-router-tests.ts index 7a1bc2d00..694059f77 100644 --- a/angular-ui-router/angular-ui-router-tests.ts +++ b/angular-ui-router/angular-ui-router-tests.ts @@ -174,6 +174,20 @@ class UrlLocatorTestService implements IUrlLocatorTestService { this.$state.get(); this.$state.reload(); + // http://angular-ui.github.io/ui-router/site/#/api/ui.router.state.$state#properties + if (this.$state.transition) { + var transitionPromise: ng.IPromise<{}> = this.$state.transition; + transitionPromise.then(() => { + // transition success + }, () => { + // transition failure + }).catch(() => { + // transition failure + }).finally(() => { + // transition ended (success or failure) + }); + } + // Accesses the currently resolved values for the current state // http://stackoverflow.com/questions/28026620/is-there-a-way-to-access-resolved-state-dependencies-besides-injecting-them-into/28027023#28027023 var resolvedValues = this.$state.$current.locals.globals; diff --git a/angular-ui-router/angular-ui-router.d.ts b/angular-ui-router/angular-ui-router.d.ts index ff0d6ce7e..d6c60f47e 100644 --- a/angular-ui-router/angular-ui-router.d.ts +++ b/angular-ui-router/angular-ui-router.d.ts @@ -240,10 +240,15 @@ declare module angular.ui { href(state: string, params?: {}, options?: IHrefOptions): string; get(state: string): IState; get(): IState[]; + /** A reference to the state's config object. However you passed it in. Useful for accessing custom data. */ current: IState; + /** A param object, e.g. {sectionId: section.id)}, that you'd like to test against the current active state. */ params: IStateParamsService; reload(): void; + /** Currently pending transition. A promise that'll resolve or reject. */ + transition: ng.IPromise<{}>; + $current: IResolvedState; } diff --git a/angularjs/angular-animate.d.ts b/angularjs/angular-animate.d.ts index 35fe10ca9..babc752b2 100644 --- a/angularjs/angular-animate.d.ts +++ b/angularjs/angular-animate.d.ts @@ -26,7 +26,7 @@ declare module angular.animate { * AnimateService * see http://docs.angularjs.org/api/ngAnimate/service/$animate */ - interface IAnimateService extends angular.IAnimateService { + interface IAnimateService { /** * Globally enables / disables animations. * diff --git a/angularjs/angular-cookies.d.ts b/angularjs/angular-cookies.d.ts index e34518b8a..25efc42de 100644 --- a/angularjs/angular-cookies.d.ts +++ b/angularjs/angular-cookies.d.ts @@ -16,6 +16,33 @@ declare module "angular-cookies" { */ declare module angular.cookies { + /** + * Cookies options + * see https://docs.angularjs.org/api/ngCookies/provider/$cookiesProvider#defaults + */ + interface ICookiesOptions { + /** + * The cookie will be available only for this path and its sub-paths. + * By default, this would be the URL that appears in your base tag. + */ + path?: string; + /** + * The cookie will be available only for this domain and its sub-domains. + * For obvious security reasons the user agent will not accept the cookie if the + * current domain is not a sub domain or equals to the requested domain. + */ + domain?: string; + /** + * String of the form "Wdy, DD Mon YYYY HH:MM:SS GMT" or a Date object + * indicating the exact date/time this cookie will expire. + */ + expires?: string|Date; + /** + * The cookie will be available only in secured connection. + */ + secure?: boolean; + } + /** * CookieService * see http://docs.angularjs.org/api/ngCookies.$cookies @@ -31,10 +58,11 @@ declare module angular.cookies { interface ICookiesService { get(key: string): string; getObject(key: string): any; + getObject(key: string): T; getAll(): any; - put(key: string, value: string, options?: any): void; - putObject(key: string, value: any, options?: any): void; - remove(key: string, options?: any): void; + put(key: string, value: string, options?: ICookiesOptions): void; + putObject(key: string, value: any, options?: ICookiesOptions): void; + remove(key: string, options?: ICookiesOptions): void; } /** diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index dac88280d..9f7fa07b0 100644 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -1246,8 +1246,9 @@ declare module angular { /////////////////////////////////////////////////////////////////////////// interface IControllerService { // Although the documentation doesn't state this, locals are optional - (controllerConstructor: Function, locals?: any, bindToController?: any): any; - (controllerName: string, locals?: any, bindToController?: any): any; + (controllerConstructor: new (...args: any[]) => T, locals?: any, bindToController?: any): T; + (controllerConstructor: Function, locals?: any, bindToController?: any): T; + (controllerName: string, locals?: any, bindToController?: any): T; } interface IControllerProvider extends IServiceProvider { @@ -1713,18 +1714,6 @@ declare module angular { inheritedData(key?: string): any; } - /////////////////////////////////////////////////////////////////////// - // AnimateService - // see http://docs.angularjs.org/api/ng.$animate - /////////////////////////////////////////////////////////////////////// - interface IAnimateService { - addClass(element: JQuery, className: string, done?: Function): IPromise; - enter(element: JQuery, parent: JQuery, after: JQuery, done?: Function): void; - leave(element: JQuery, done?: Function): void; - move(element: JQuery, parent: JQuery, after: JQuery, done?: Function): void; - removeClass(element: JQuery, className: string, done?: Function): void; - } - /////////////////////////////////////////////////////////////////////////// // AUTO module (angular.js) /////////////////////////////////////////////////////////////////////////// diff --git a/angulartics/angulartics-tests.ts b/angulartics/angulartics-tests.ts index af6eb52a3..549b0c4b4 100644 --- a/angulartics/angulartics-tests.ts +++ b/angulartics/angulartics-tests.ts @@ -20,5 +20,7 @@ module Analytics { $analyticsProvider.registerPageTrack((path:string, locationObj:angular.ILocationService) => { console.log("viewed " + path); }); + + $analyticsProvider.settings.pageTracking.basePath = "/my/base/path"; }]); } diff --git a/angulartics/angulartics.d.ts b/angulartics/angulartics.d.ts index 706ee6713..edb9aefb3 100644 --- a/angulartics/angulartics.d.ts +++ b/angulartics/angulartics.d.ts @@ -32,6 +32,16 @@ declare module angulartics { registerSetUsername(callback: (username: string) => any): void registerSetUserProperties(callback: (userProperties: any) => any): void registerSetSuperProperties(callback: (superProperties: any) => any): void + + settings: { + pageTracking: { + autoTrackingVirtualPages: boolean, + autoTrackingFirstPage: boolean, + basePath: string, + autoBasePath: boolean + }, + developerMode: boolean + } } } diff --git a/appletvjs/README.md b/appletvjs/README.md new file mode 100644 index 000000000..161282ed6 --- /dev/null +++ b/appletvjs/README.md @@ -0,0 +1,21 @@ +# AppleTVJS Definitions Usage Notes + +## Referencing AppleTVJS definition files in your code + +To do that, simply add `/// ` at the top of your code. + +This will allow you to have intellisense in your AppleTVJS typescript code. + +## Global objects + +AppleTVJS has a global App object instance that is your entry point into the javascript app. There is also a Device and navigationDocument object that is in the global context. To access any of these simply use them in your TypeScript code as so. They have aliases in the type definition file for your convenience. + +## The AppleTVJS namespace + +All non global objects have interfaces in the AppleTVJS type definition file are contained in the AppleTVJS namespace. + +To use them simple provide the namespace like so: + +```ts +var keyboard: AppleTVJS.Keyboard = textfield.getFeature('Keyboard'); +``` diff --git a/appletvjs/appletvjs-tests.ts b/appletvjs/appletvjs-tests.ts new file mode 100644 index 000000000..8bdda9c63 --- /dev/null +++ b/appletvjs/appletvjs-tests.ts @@ -0,0 +1,215 @@ +/// + +//test the global app events and functions +function test_AppEvents() { + App.onError = function (options: any) { + //do something + } + + App.onExit = function (options: any) { + //do something + } + + App.onLaunch = function (options: any) { + //do something + } + + App.reload({ someProperty: 'Testing...' }); +} + +//test the global device object properties +function test_DeviceProperties() { + var appIdentifier = Device.appIdentifier; + var appVersion = Device.appVersion; + var model = Device.model; + var productType = Device.productType; + var systemVersion = Device.systemVersion; + var vendorIdentifier = Device.vendorIdentifier; +} + +function test_FeatureElement() { + var parser = new DOMParser(); + var document = parser.parseFromString('', "application/xml"); + var textField = document.getElementById("textField"); + textField.addEventListener("change", function() { + change.call(this, textField); + }); + + var change = function (textField: AppleTVJS.FeatureElement){ + var keyboard: AppleTVJS.Keyboard = textField.getFeature('Keyboard'); + + var text = keyboard.text; + }; + + var menuBar = document.getElementById("menuBar"); + textField.addEventListener("change", function() { + change.call(this, textField); + }); + + var select = function (menuBar: AppleTVJS.FeatureElement) { + var menuBarDocument: AppleTVJS.MenuBarDocument = menuBar.getFeature('MenuBarDocument'); + + var document = menuBarDocument.getDocument(menuBar); + menuBarDocument.setDocument(document, menuBar); + menuBarDocument.setSelectedItem(menuBar); + }; +} + +function test_MediaItem() { + var mediaItem = new AppleTVJS.MediaItem('video', 'http://www.vidme.com/abc123'); + mediaItem.artworkImageURL = "http://google.com/artwork.png"; + mediaItem.contentRatingDomain = "movie"; + mediaItem.contentRatingRanking = 1; + mediaItem.description = "Media Item"; + + var highlight = new AppleTVJS.Highlight(); + highlight.description = "Highlight"; + highlight.duration = 10; + highlight.imageURL = "http://google.com/img.png"; + highlight.name = "Name of Highlight"; + highlight.starttime = 10; + + var highlightGroup = new AppleTVJS.HighlightGroup(); + highlightGroup.name = "Highlight Group"; + highlightGroup.hightlights.push(highlight); + + mediaItem.highlightGroups.push(highlightGroup); + + var interstitial = new AppleTVJS.Interstitial(); + interstitial.duration = 10; + interstitial.starttime = 20; + + mediaItem.interstitials.push(interstitial); + + mediaItem.isExplicit = false; + mediaItem.resumeTime = 0; + mediaItem.subtitle = "Subtitle"; + + var loadAssetIDCallback = function (assetID: string, error: string) { + //do something + }; + + mediaItem.loadAssetID = function (url: string, loadAssetIDCallback: (assetID: string, error: string) => void) { + //do something + }; + + var loadCertificateCallback = function (certificate: string, error: string) { + //do something + }; + + mediaItem.loadCertificate = function (url: string, loadCertificateCallback: (certificate: string, error: string) => void) { + //do something + }; + + var loadKeyCallback = function (key: string, renewalDate: string, error: string) { + //do something + }; + + mediaItem.loadKey = function (url: string, loadKeyCallback: (key: string, renewalDate: string, error: string) => void) { + //do something + }; +} + +//test the global navigation document object +function test_navigationDocument() { + var parser = new DOMParser(); + var document = parser.parseFromString('', "application/xml"); + + var documents = navigationDocument.documents; + + navigationDocument.clear(); + navigationDocument.dismissModal(); + navigationDocument.insertBeforeDocument(document); + navigationDocument.insertBeforeDocument(document, document); + navigationDocument.popDocument(); + navigationDocument.popToDocument(document); + navigationDocument.popToRootDocument(); + navigationDocument.presentModal(document); + navigationDocument.pushDocument(document); + navigationDocument.removeDocument(document); + navigationDocument.replaceDocument(document, document); +} + +function test_Player() { + var playlist = new AppleTVJS.Playlist(); + + var mediaItem = new AppleTVJS.MediaItem('audio'); + playlist.push(mediaItem); + playlist.pop(); + var result: AppleTVJS.MediaItem[] = playlist.splice(0, 1, mediaItem); + var length: number = playlist.length; + + var player = new AppleTVJS.Player(); + player.playlist = playlist; + + var parser = new DOMParser(); + var document = parser.parseFromString('', "application/xml"); + player.overlayDocument = document; + + player.present(); + player.pause(); + player.play(); + + var playbackState: string = player.playbackState; + player.seekToTime(10); + player.setPlaybackRate(2); + player.stop(); + + var currentMediaItem: AppleTVJS.MediaItem = player.currentMediaItem; + var nextMediaItem: AppleTVJS.MediaItem = player.nextMediaItem; + var previousMediaItem: AppleTVJS.MediaItem = player.previousMediaItem; + + player.mediaItemDidChange = function (reason: string) { + //do something + }; + + player.requestSeekToTime = function (result) { + //do something + }; + + player.shouldHandleStateChange = function (result: boolean) { + //do something + }; + + player.stateDidChange = function (){ + //do something + }; + + player.stateWillChange = function (){ + //do something + }; + + player.timeBoundaryDidCross = function (){ + //do something + }; + + player.timeDidChange = function (){ + //do something + }; + + player.timedMetadata = function (){ + //do something + }; +} + +//test the global settings object +function test_Settings() { + var language = Settings.language; + Settings.onRestrictionsChange = function () { + //do something + } + var restrictions = Settings.restrictions; + var allowsExplicit = restrictions.allowsExplicit; + var maxMovieRank = restrictions.maxMovieRank; + var maxMovieRatingForCountry = restrictions.maxMovieRatingForCountry('US');; + var allowsExplmaxTVShowRankicit = restrictions.maxTVShowRank; + var maxTVShowRatingForCountry = restrictions.maxTVShowRatingForCountry('US'); + var storeFrontCountryCode = Settings.storefrontCountryCode; +} + +function test_TVError() { + var tvError = new AppleTVJS.TVError(); + tvError.code = "404"; + tvError.description = "Not found"; + tvError.domain = "NSMachErrorDomain"; +} \ No newline at end of file diff --git a/appletvjs/appletvjs.d.ts b/appletvjs/appletvjs.d.ts new file mode 100644 index 000000000..7e3847cd2 --- /dev/null +++ b/appletvjs/appletvjs.d.ts @@ -0,0 +1,439 @@ +// Type definitions for AppleTVJS +// Project: https://developer.apple.com/library/prerelease/tvos/documentation/TVMLJS/Reference/TVJSFrameworkReference/index.html +// Definitions by: Adam Valverde +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare var App: AppleTVJS.App; +declare var Device: AppleTVJS.Device; +declare var navigationDocument: AppleTVJS.NavigationDocument; +declare var Settings: AppleTVJS.Settings; + +declare function evaluateScripts(scripts: string[], complete: (success: boolean) => void): void; + +declare module AppleTVJS { + interface App { + + /** + * The onError attribute is used to handle any errors sent from the device. + * This attribute must be set to a function that accepts an “options” argument. + * For example App.onError = function (options) {}. + * */ + onError: (options: any) => void; + + /** + * The onExit attribute is used to complete any actions that need to be cleaned + * up when the app has been exited. This attribute must be set to a function that + * accepts an “options” argument. For example App.onExit = function (options) {}. + * */ + onExit: (options: any) => void; + + /** + * The onLaunch attribute is used to start any required actions when the app + * launches. This attribute must be set to a function that accepts an “options” + * argument. For example App.onLaunch = function (options) {}. + * */ + onLaunch: (options: any) => void; + + /** + * This function reloads the initial JavaScript file without quitting the app. + * The optional reloadData parameter provides developers with a way to capture + * and restart the app in it’s current state. If the reloadData parameter is not + * present, the app is restarted in its initial state. This attribute must be set + * to a function that accepts an “options” argument. + * For example App.onError = function (options) {}. + * */ + reload(options?: any, reloadData?: any): void; + } + + interface Device { + /** The unique identifier for the app. */ + appIdentifier: string; + + /** The current app version. */ + appVersion: string; + + /** A string that identifies the device model. */ + model: string; + + /** The version of the product installed on the device. */ + productType: string; + + /** The operating system on the device. */ + systemVersion: string; + + /** The UUID of the device. */ + vendorIdentifier: string; + } + + interface FeatureElement extends Element { + /** Gets a feature for a given element. */ + getFeature(feature: string): any; + } + + class Highlight { + /** The name of the highlight. */ + name: string; + + /** The description of the highlight. */ + description: string; + + /** The starttime of the highlight. */ + starttime: number; + + /** The duration of the highlight. */ + duration: number; + + /** The imageURL of the highlight. */ + imageURL: string; + } + + class HighlightGroup { + /** The name of the highlight group. */ + name: string; + + /** The hightlights in the highlight group. */ + hightlights: Highlight[]; + } + + class Interstitial { + /** The starttime of the interstitial. */ + starttime: number; + + /** The duration of the interstitial. */ + duration: number; + } + + interface Keyboard { + /** The text inside of a searchField or textField element. */ + text: string; + + /** + * A callback function that is called when the text inside + * of searchField or textField element changes. + * */ + onTextChange: () => void; + } + + class MediaItem { + /** + * Creates a new MediaItem object from the information stored in the URL location. + * @type: Valid values are: audio, video. Defaults to video. + * @url: The URL pointing to the media item information. + * */ + constructor(type: string, url?: string); + + /** + * The domain that the rating applies to. + * There are three valid values for this property: movie, music, and tvshow. + * */ + contentRatingDomain: string; + + /** + * The rating for a video item. + * The rating is a value from 0-1000. This value corresponds to a specific rating + * used by different countries. For example, a rating value can represent a PG-13 + * rating in the United State and a MA15+ in Australia. + * */ + contentRatingRanking: number; + + /** + * A value indicating whether the item has explicit lyrics. + * This property is ignored if the MediaItem object type is video. + * */ + isExplicit: boolean; + + /** The URL path to the artwork that accompanies the media item. */ + artworkImageURL: string; + + /** The description for a media item. */ + description: string; + + /** The subtitle for a the media item. */ + subtitle: string; + + /** The title of the media item. */ + title: string; + + /** + * The type of media item. + * The valid values for this attribute are audio and video. + * */ + type: string; + + /** The URL path to the media item. */ + url: string; + + /** An array of highlightGroup objects. */ + highlightGroups: HighlightGroup[]; + + /** An array of interstitial objects. */ + interstitials: Interstitial[]; + + /** + * The number, in seconds, that a media item starts playing at. + * Use this to begin playing a MediaItem object at a time other than + * at the beginning of the object. If this property contains anything + * other than 0, the player displays “Resume” instead of + * “Play from beginning” on playback. + * */ + resumeTime: number; + + /** A callback function used to load the asset identifier for an item. */ + loadAssetID: (url: string, callback: (assetID: string, error: string) => void) => void; + + /** A callback function used to load the security certificate for an item. */ + loadCertificate: (url: string, callback: (certificate: string, error: string) => void) => void; + + /** A callback function used to load the security key for an item. */ + loadKey: (url: string, requestData: any, callback: (key: string, renewalDate: string, error: string) => void) => void; + } + + interface MenuBarDocument { + /** + * Retrieves the document associated with the specified menu item. + * */ + getDocument(menuItem: Element): Document; + + /** + * Associates a document with a menu item. + * */ + setDocument(document: Document, menuItem: Element): void; + + /** + * Sets the focus in a menu bar to the specified menu item. + * */ + setSelectedItem(menuItem: Element): void; + } + + interface NavigationDocument { + /** + * Inserts a new document directly before a document currently on the stack. + * */ + insertBeforeDocument(document: Document, beforeDocument?: Document): void; + + /** + * This function searches the stack for the first instance of the document + * contained in the beforeDocument parameter and inserts the document contained + * in the document parameter on top of it. + * */ + pushDocument(document: Document): void; + + /** + * Replaces a document on the stack with a new document. + * */ + replaceDocument(document: Document, beforeDocument?: Document): void; + + /** Dismisses the document displayed in modal view. */ + dismissModal(): void; + + /** + * Displays the passed document on top of the current document. + * */ + presentModal(document: Document): void; + + /** The documents currently on the stack. */ + documents: Document[]; + + /** + * Removes all documents currently on the stack. + * */ + clear(): void; + + /** + * Removes the top most document from the stack. + * */ + popDocument(): void; + + /** + * Removes all of the documents on the stack that are above the passed document. + * */ + popToDocument(document: Document): void; + + /** + * Removes all documents from the stack except for the bottom most document. + * */ + popToRootDocument(): void; + + /** + * Removes the specified document from the stack. + * */ + removeDocument(document: Document): void; + } + + class Player { + /** The annotations for a video created by placing a DOM document over the video. */ + overlayDocument: Document; + + /** The play list for a player. */ + playlist: Playlist; + + /** Shows the player UI if it is not currently visible. */ + present(): void; + + /** Pauses the currently playing media item. */ + pause(): void; + + /** Plays the currently selected media item. */ + play(): void; + + /** + * The current state of the player. + * + * This property can contain the following valid values: + * begin + * end + * loading + * playing + * paused + * scanning + * */ + playbackState: string; + + /** Sets the playback point to a specified time. */ + seekToTime(time: number): void; + + /** Sets the playback speed. */ + setPlaybackRate(playbackRate: number): void; + + /** Stops the currently playing item and dismisses the player UI. */ + stop(): void; + + /** The currently selected media item in the playlist. */ + currentMediaItem: MediaItem; + + /** The next media item in the playlist. */ + nextMediaItem: MediaItem; + + /** The previous MediaItem object in the playlist. */ + previousMediaItem: MediaItem; + + /** + * An event notifying the listener that the player is about to change media items. + * + * Valid values are: + * errorDidOccur + * fastForwardedToEndOfMediaItem + * mannuallyChanged + * newPlaylist + * playerInvalidated + * playedToEndOfMediaItem + * */ + mediaItemDidChange: (reason: string) => void; + + /** + * An event that indicates if a seek to time request was accomplished. + * + * The values for this attribute can be one of the following: + * true — The seek performed as requested. + * false or null— The seek was not performed. + * An integer value — The seek will be performed to the stated value and not the initial requested value. + * */ + requestSeekToTime: (result?: any) => void; + + /** An event that indicates a state change request has occurred. */ + shouldHandleStateChange: (result: boolean) => void; + + /** An event that indicates the state has changed. */ + stateDidChange: () => void; + + /** An event that indicates the state is about to change. */ + stateWillChange: () => void; + + /** An event that indicates a particular playback time has been crossed. */ + timeBoundaryDidCross: () => void; + + /** An event that happens at a specified interval. */ + timeDidChange: () => void; + + /** An event that happens whenever a specified piece of metadata occurs. */ + timedMetadata: () => void; + } + + class Playlist { + /** Returns the MediaItem located in the indicated array index. */ + item(index: number): MediaItem; + + /** The number of items in the playlist. */ + length: number; + + /** Removes a media item from the end of a playlist. */ + pop(): MediaItem; + + /** Adds a media item to the end of a playlist. */ + push(object: MediaItem): void; + + /** Deletes the indicated array elements and replaces them with the specified elements. */ + splice(index: number, howManu: number, object: MediaItem): MediaItem[]; + } + + interface Restrictions { + /** A boolean value that indicates if explicit media is allowed. */ + allowsExplicit: boolean; + + /** The maximum movie ranking allowed. */ + maxMovieRank: number; + + /** The maximum movie rating allowed for the specified country. */ + maxMovieRatingForCountry(countryCode: string): string; + + /** The maximum television show ranking allowed. */ + maxTVShowRank: number + + /** Sets the maximum television show rating allowed for the specified country. */ + maxTVShowRatingForCountry(countryCode: string): string; + } + + interface Settings { + /** Contains the restriction information on the device. */ + restrictions: Restrictions; + + /** Contains the language the device displays information in. */ + language: string; + + /** Contains the country code used by the store on this device. */ + storefrontCountryCode: string; + + /** + * Called when changes to a device’s restriction information changes. + */ + onRestrictionsChange: () => void; + } + + class TVError { + /** The error code. */ + code: string; + + /** A string containing the description of the error. */ + description: string; + + /** + * A string containing the error domain. + * + * The predefined error domains: + * NSPOSIXErrorDomain - POSIX/BSD errors + * NSOSStatusErrorDomain - OS X/Carbon errors + * NSMachErrorDomain - Mach errors + * */ + domain: string; + + /** + * The user info dictionary. + * + * These keys may exist in the user info dictionary: + * NSLocalizedDesciptionKey + * NSFilePathErrorKey + * NSStringEncodingErrorKey + * NSUnderlyingErrorKey + * NSURLErrorKey + * NSLocalizedFailureReasonErrorKey + * NSLocalizedRecoverySuggestionErrorKey + * NSLocalizedRecoveryOptionsErrorKey + * NSRecoveryAttempterErrorKey + * NSHelpAnchorErrorKey + * NSURLErrorFailingURLErrorKey + * NSURLErrorFailingURLStringErrorKey + * NSURLErrorFailingURLPeerTrustErrorKey + * */ + userInfo: any; + } +} diff --git a/auto-launch/auto-launch-tests.ts b/auto-launch/auto-launch-tests.ts index 735985624..24d6aad14 100644 --- a/auto-launch/auto-launch-tests.ts +++ b/auto-launch/auto-launch-tests.ts @@ -14,4 +14,11 @@ var a2 = new AutoLaunch({ a1.enable(); a2.disable(); -var enabled: boolean = a1.isEnabled(); + +a1.isEnabled(function(enabled: boolean) { + if (enabled) { + return; + } + + a1.enable(function(err){ console.log(err.message); }); +}); diff --git a/auto-launch/auto-launch.d.ts b/auto-launch/auto-launch.d.ts index c208d10fd..0b277c79f 100644 --- a/auto-launch/auto-launch.d.ts +++ b/auto-launch/auto-launch.d.ts @@ -32,7 +32,7 @@ declare class AutoLaunch { /** * Returns if auto start up is enabled */ - isEnabled(callback?: (err: Error) => void): boolean; + isEnabled(callback: (enabled: boolean) => void): void; } declare module "auto-launch" { diff --git a/bardjs/bardjs-tests.ts b/bardjs/bardjs-tests.ts index 71671b23e..312b06496 100644 --- a/bardjs/bardjs-tests.ts +++ b/bardjs/bardjs-tests.ts @@ -232,7 +232,7 @@ module bardTests { _default: $q.when([]) }); - controller = $controller('MyController'); + controller = $controller('MyController'); $rootScope.$apply(); }); } @@ -264,7 +264,7 @@ module bardTests { _default: $q.when([]) }); - controller = $controller('MyController'); + controller = $controller('MyController'); $rootScope.$apply(); }); diff --git a/bootstrap-notify/bootstrap-notify-test.ts b/bootstrap-notify/bootstrap-notify-test.ts new file mode 100644 index 000000000..a71a83557 --- /dev/null +++ b/bootstrap-notify/bootstrap-notify-test.ts @@ -0,0 +1,52 @@ +/// +/// + +//Test for bootstrap-notify v3.1.3 +//Copied example directly from Bootstrap-notify site + +$.notify({ + // options + icon: 'glyphicon glyphicon-warning-sign', + title: 'Bootstrap notify', + message: 'Turning standard Bootstrap alerts into "notify" like notifications', + url: 'https://github.com/mouse0270/bootstrap-notify', + target: '_blank' +},{ + // settings + element: 'body', + position: null, + type: "info", + allow_dismiss: true, + newest_on_top: false, + showProgressbar: false, + placement: { + from: "top", + align: "right" + }, + offset: 20, + spacing: 10, + z_index: 1031, + delay: 5000, + timer: 1000, + url_target: '_blank', + mouse_over: null, + animate: { + enter: 'animated fadeInDown', + exit: 'animated fadeOutUp' + }, + onShow: null, + onShown: null, + onClose: null, + onClosed: null, + icon_type: 'class', + template: '' +}); \ No newline at end of file diff --git a/bootstrap-notify/bootstrap-notify.d.ts b/bootstrap-notify/bootstrap-notify.d.ts index 2159aa21a..52e0cb472 100644 --- a/bootstrap-notify/bootstrap-notify.d.ts +++ b/bootstrap-notify/bootstrap-notify.d.ts @@ -1,68 +1,62 @@ -// Type definitions for bootstrap-notify -// Project: https://github.com/Nijikokun/bootstrap-notify -// Definitions by: Blake Niemyjski +// Type definitions for bootstrap-notify v3.1.3 +// Project: http://bootstrap-notify.remabledesigns.com/ +// Definitions by: Blake Niemyjski , Robert McIntosh , Robert Voica // Definitions: https://github.com/borisyankov/DefinitelyTyped -/// +/// + +/* tslint:disable: interface-name no-any */ + +interface JQueryStatic { + /* tslint:enable: interface-name */ + notify(message: string): NotifyReturn; + notify(opts: NotifyOptions, settings?: NotifySettings): NotifyReturn; + notifyDefaults(settings: NotifySettings): void; + notifyClose(): void; + notifyClose(command: string): void; +} interface NotifyOptions { - /** - Alert style, omit alert- from style name. - @param {string} type - */ - type?: string; - /** - Allow alert to be closable through a close icon. - @param {boolean} closable - */ - closable?: boolean; - /** - Alert transition, pretty sure only fade is supported, you can try others if you wish. - @param {string} transition - */ - transition?: string; - /** - Fade alert out after a certain delay (in ms) - @param {string} fadeOut - */ - fadeOut?: NotifyFadeOutSettings; - /** - Text to show on alert, you can use either html or text. HTML will override text. - @param {MessageOptions} message - */ - message?: MessageOptions; - /** - Called before alert closes. - @param {function} onClose - */ - onClose?: () => void; - /** - Called after alert closes. - @param {function} onClosed - */ - onClosed?: () => void; + message: string; + title?: string; + icon?: string; + url?: string; + target?: string; } -interface NotifyFadeOutSettings { - enabled?: boolean; - delay?: number; +interface NotifySettings { + element?: string; + position?: string; + type?: string; + allow_dismiss?: boolean; + allow_duplicates?: boolean; + newest_on_top?: boolean; + showProgressbar?: boolean; + placement?: { + from?: string; + align?: string; + }; + offset?: number; + spacing?: number; + z_index?: number; + delay?: number; + timer?: number; + url_target?: string; + mouse_over?: string; + animate?: { + enter?: string; + exit?: string; + }; + onShow?: () => void; + onShown?: () => void; + onClose?: () => void; + onClosed?: () => void; + icon_type?: string; + template?: string; } -interface MessageOptions { - html?: string; - text?: string; -} - -interface Notification { - show(); - hide(); -} - -interface JQuery { - /** - Creates a notification instance with default options. - @constructor - @param {NotifyOptions} options - */ - notify(options: NotifyOptions): Notification; +interface NotifyReturn { + $ele: JQueryStatic; + close: () => void; + update: (command: string, update: any) => void; } \ No newline at end of file diff --git a/chartist/chartist-tests.ts b/chartist/chartist-tests.ts new file mode 100644 index 000000000..0a5072c6a --- /dev/null +++ b/chartist/chartist-tests.ts @@ -0,0 +1,170 @@ +/// + +new Chartist.Line('.ct-chart', { + labels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'], + series: [ + [12, 9, 7, 8, 5], + [2, 1, 3.5, 7, 3], + [1, 3, 4, 5, 6] + ] +}, { + fullWidth: true, + chartPadding: { + right: 40 + } +}); + +var lineChart = new Chartist.Line('.ct-chart', { + labels: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], + series: [ + [5, 5, 10, 8, 7, 5, 4, null, null, null, 10, 10, 7, 8, 6, 9], + [10, 15, null, 12, null, 10, 12, 15, null, null, 12, null, 14, null, null, null], + [null, null, null, null, 3, 4, 1, 3, 4, 6, 7, 9, 5, null, null, null] + ] +}, { + fullWidth: true, + chartPadding: { + right: 10 + }, + low: 0 +}); + +new Chartist.Line('.ct-chart', { + labels: ['1', '2', '3', '4', '5', '6'], + series: [ + { + name: 'Fibonacci sequence', + data: [1, 2, 3, 5, 8, 13] + }, + { + name: 'Golden section', + data: [1, 1.618, 2.618, 4.236, 6.854, 11.09] + } + ] +}); + +var data = { + series: [5, 3, 4] +}; + +var sum = function(a: number, b: number) { return a + b }; + +new Chartist.Pie('.ct-chart', data, { + labelInterpolationFnc: function(value: number) { + return Math.round(value / data.series.reduce(sum) * 100) + '%'; + } +}); + +new Chartist.Pie('.ct-chart', { + series: [20, 10, 30, 40] +}, { + donut: true, + donutWidth: 60, + startAngle: 270, + total: 200, + showLabel: false +}); + + +// Animation Donut example + +var chart = new Chartist.Pie('.ct-chart', { + series: [10, 20, 50, 20, 5, 50, 15], + labels: [1, 2, 3, 4, 5, 6, 7] +}, { + donut: true, + showLabel: false +}); + +chart.on('draw', function(data: any) { + if(data.type === 'slice') { + // Get the total path length in order to use for dash array animation + var pathLength = data.element._node.getTotalLength(); + + // Set a dasharray that matches the path length as prerequisite to animate dashoffset + data.element.attr({ + 'stroke-dasharray': pathLength + 'px ' + pathLength + 'px' + }); + + // Create animation definition while also assigning an ID to the animation for later sync usage + var animationDefinition: any = { + 'stroke-dashoffset': { + id: 'anim' + data.index, + dur: 1000, + from: -pathLength + 'px', + to: '0px', + easing: Chartist.Svg.Easing.easeOutQuint, + // We need to use `fill: 'freeze'` otherwise our animation will fall back to initial (not visible) + fill: 'freeze' + } + }; + + // If this was not the first slice, we need to time the animation so that it uses the end sync event of the previous animation + if(data.index !== 0) { + animationDefinition['stroke-dashoffset'].begin = 'anim' + (data.index - 1) + '.end'; + } + + // We need to set an initial value before the animation starts as we are not in guided mode which would do that for us + data.element.attr({ + 'stroke-dashoffset': -pathLength + 'px' + }); + + // We can't use guided mode as the animations need to rely on setting begin manually + // See http://gionkunz.github.io/chartist-js/api-documentation.html#chartistsvg-function-animate + data.element.animate(animationDefinition, false); + } +}); + +new Chartist.Bar('.ct-chart', { + labels: ['XS', 'S', 'M', 'L', 'XL', 'XXL', 'XXXL'], + series: [20, 60, 120, 200, 180, 20, 10] +}, { + distributeSeries: true +}); + +new Chartist.Bar('.ct-chart', { + labels: ['Quarter 1', 'Quarter 2', 'Quarter 3', 'Quarter 4'], + series: [ + [5, 4, 3, 7], + [3, 2, 9, 5], + [1, 5, 8, 4], + [2, 3, 4, 6], + [4, 1, 2, 1] + ] +}, { + // Default mobile configuration + stackBars: true, + axisX: { + labelInterpolationFnc: function(value: string) { + return value.split(/\s+/).map(function(word: string) { + return word[0]; + }).join(''); + } + }, + axisY: { + offset: 20 + } +}, [ + // Options override for media > 400px + ['screen and (min-width: 400px)', { + reverseData: true, + horizontalBars: true, + axisX: { + labelInterpolationFnc: Chartist.noop + }, + axisY: { + offset: 60 + } + }], + // Options override for media > 800px + ['screen and (min-width: 800px)', { + stackBars: false, + seriesBarDistance: 10 + }], + // Options override for media > 1000px + ['screen and (min-width: 1000px)', { + reverseData: false, + horizontalBars: false, + seriesBarDistance: 15 + }] +]); diff --git a/chartist/chartist.d.ts b/chartist/chartist.d.ts new file mode 100644 index 000000000..a4419eb4d --- /dev/null +++ b/chartist/chartist.d.ts @@ -0,0 +1,268 @@ +// Type definitions for Chartist v0.9.4 +// Project: https://github.com/gionkunz/chartist-js +// Definitions by: Matt Gibbs +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module Chartist { + interface ChartistStatic { + Pie: IChartistPieChart; + Bar: IChartistBarChart; + Line: IChartistLineChart; + + Svg: any; + noop: Function; + } + + interface IResponsiveOptionTuple extends Array { + 0: string; + 1: T; + } + + interface IChartistBase { + container: any; + data: Object; + defaultOptions: T; + options: T; + responsiveOptions: Array>; + + // this most likely doesn't need to be exposed to the user + eventEmitter: any; + + supportsForeignObject: boolean; + supportsAnimations: boolean; + resizeListener: any; + + update(data: Object, options?: T, override?: boolean): void; + detatch(): void; + + /** + * Use this function to register event handlers. The handler callbacks are synchronous and will run in the main thread rather than the event loop. + * + * @method on + * @param event {string} Name of the event. Check the examples for supported events. + * @param handler {Function} The handler function that will be called when an event with the given name was emitted. This function will receive a data argument which contains event data. See the example for more details. + */ + on(event: string, handler: Function): IChartistBase; + + /** + * Use this function to un-register event handlers. If the handler function parameter is omitted all handlers for the given event will be un-registered. + * + * @method off + * @param event {string} Name of the event for which a handler should be removed + * @param handler {Function} The handler function that that was previously used to register a new event handler. This handler will be removed from the event handler list. If this parameter is omitted then all event handlers for the given event are removed from the list. + */ + off(event: string, handler?: Function): IChartistBase; + } + + interface IChartistPieChart extends IChartistBase { + new (target: any, data: Object, options?: IPieChartOptions, responsiveOptions?: Array>): IChartistPieChart; + } + + interface IChartistLineChart extends IChartistBase { + new (target: any, data: Object, options?: ILineChartOptions, responsiveOptions?: Array>): IChartistLineChart; + } + + interface IChartistBarChart extends IChartistBase { + new (target: any, data: Object, options?: IBarChartOptions, responsiveOptions?: Array>): IChartistBarChart; + } + + interface IChartOptions { + /** + * If true the whole data is reversed including labels, the series order as well as the whole series data arrays. + */ + reverseData?: boolean; + } + + interface IPieChartOptions extends IChartOptions { + /** + * Specify a fixed width for the chart as a string (i.e. '100px' or '50%') + */ + width?: number | string; + + /** + * Specify a fixed height for the chart as a string (i.e. '100px' or '50%') + */ + height?: number | string; + + /** + * Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5} + */ + chartPadding?: IChartPadding | number; + + /** + * Override the class names that are used to generate the SVG structure of the chart + */ + classNames?: IPieChartClasses; + + /** + * The start angle of the pie chart in degrees where 0 points north. A higher value offsets the start angle clockwise. + */ + startAngle?: number; + + /** + * An optional total you can specify. By specifying a total value, the sum of the values in the series must be this total in order to draw a full pie. You can use this parameter to draw only parts of a pie or gauge charts. + */ + total?: number; + + /** + * If specified the donut CSS classes will be used and strokes will be drawn instead of pie slices. + */ + donut?: boolean; + + /** + * Specify the donut stroke width, currently done in javascript for convenience. + */ + donutWidth?: number; + + /** + * Specify if a label should be shown or not + */ + showLabel?: boolean; + + /** + * Label position offset from the standard position which is half distance of the radius. This value can be either positive or negative. Positive values will position the label away from the center. + */ + labelOffset?: number; + + /** + * This option can be set to 'inside', 'outside' or 'center'. Positioned with 'inside' the labels will be placed on half the distance of the radius to the border of the Pie by respecting the 'labelOffset'. The 'outside' option will place the labels at the border of the pie and 'center' will place the labels in the absolute center point of the chart. The 'center' option only makes sense in conjunction with the 'labelOffset' option. + */ + labelPosition?: string; + + /** + * An interpolation function for the label value + */ + labelInterpolationFnc?: Function; + + /** + * Label direction can be 'neutral', 'explode' or 'implode'. Default is 'neutral'. The labels anchor will be positioned based on those settings as well as the fact if the labels are on the right or left side of the center of the chart. Usually explode is useful when labels are positioned far away from the center. + */ + labelDirection?: string; + } + + interface IChartPadding { + top?: number; + right?: number; + bottom?: number; + left?: number; + } + + interface IPieChartClasses { + chartPie?: string; + chartDonut?: string; + series?: string; + slicePie?: string; + sliceDonut?: string; + label?: string; + } + + interface IBarChartOptions extends IChartOptions { + axisX?: IBarChartAxis; + axisY?: IBarChartAxis; + width?: number | string; + height?: number | string; + high?: number; + low?: number; + onlyInteger?: boolean; + chartPadding?: IChartPadding; + seriesBarDistance?: number; + + /** + * If set to true this property will cause the series bars to be stacked and form a total for each series point. This will also influence the y-axis and the overall bounds of the chart. In stacked mode the seriesBarDistance property will have no effect. + */ + stackBars?: boolean; + + horizontalBars?: boolean; + distributeSeries?: boolean; + } + + interface IBarChartAxis { + offset?: number; + position?: string; + labelOffset?: { + x?: number; + y?: number; + }, + showLabel?: boolean; + showGrid?: boolean; + labelInterpolationFnc?: Function; + scaleMinSpace?: number; + onlyInteger?: boolean; + } + + interface IBarChartClasses { + chart?: string; + horizontalBars?: string; + label?: string; + labelGroup?: string; + series?: string; + bar?: string; + grid?: string; + gridGroup?: string; + vertical?: string; + horizontal?: string; + start?: string; + end?: string; + } + + interface ILineChartOptions extends IChartOptions { + axisX?: ILineChartXAxis; + axisY?: ILineChartYAxis; + width?: number | string; + height?: number | string; + showLine?: boolean; + showPoint?: boolean; + showArea?: boolean; + areaBase?: number; + lineSmooth?: boolean; + low?: number; + high?: number; + chartPadding?: IChartPadding; + fullWidth?: boolean; + reverseData?: boolean; + classNames?: ILineChartClasses; + } + + interface ILineChartAxis { + offset?: number; + position?: string; + labelOffset?: { + x?: number; + y?: number; + }; + showLabel?: boolean; + showGrid?: boolean; + labelInterpolationFnc?: Function; + type?: any; + } + + interface ILineChartXAxis extends ILineChartAxis { + } + + interface ILineChartYAxis extends ILineChartAxis { + scaleMinSpace?: number; + onlyInteger?: boolean; + } + + // TODO: Finish documenting all of the defaults + interface ILineChartClasses { + /** + * Default is 'ct-chart-line' + */ + chart?: string; + label?: string; + labelGroup?: string; + series?: string; + line?: string; + point?: string; + area?: string; + grid?: string; + gridGroup?: string; + vertical?: string; + horizontal?: string; + start?: string; + end?: string; + } +} + +declare var Chartist: Chartist.ChartistStatic; diff --git a/chrome/chrome-app.d.ts b/chrome/chrome-app.d.ts index 5cfa0fbce..f75f7dca6 100644 --- a/chrome/chrome-app.d.ts +++ b/chrome/chrome-app.d.ts @@ -138,6 +138,7 @@ declare module chrome.app.window { interface WindowEvent { addListener(callback: () => void): void; + removeListener(callback: () => void): void; } var onBoundsChanged: WindowEvent; diff --git a/ckeditor/ckeditor.d.ts b/ckeditor/ckeditor.d.ts index 3bb90c760..a8f268074 100644 --- a/ckeditor/ckeditor.d.ts +++ b/ckeditor/ckeditor.d.ts @@ -572,6 +572,10 @@ declare module CKEDITOR { colorButton_colors?: string; startupFocus?: boolean; on?: any; + extraPlugins?: string; + height?: string | number; + toolbarLocation?: string; + readOnly?: boolean; } diff --git a/classnames/classnames-tests.ts b/classnames/classnames-tests.ts index 7b085c4fb..3c3086c51 100644 --- a/classnames/classnames-tests.ts +++ b/classnames/classnames-tests.ts @@ -8,9 +8,16 @@ classNames('foo', 'bar'); // => 'foo bar' classNames('foo', { bar: true }); // => 'foo bar' classNames({ foo: true }, { bar: true }); // => 'foo bar' classNames({ foo: true, bar: true }); // => 'foo bar' +classNames(10, 11); // => '10 11'; // lots of arguments of various types -classNames('foo', { bar: true, duck: false }, 'baz', { quux: true }) // => 'foo bar baz quux' +classNames('foo', { bar: true, duck: false }, 'baz', { quux: true }); // => 'foo bar baz quux' + +classNames(['foo', 'bar', 'baz']); // => 'foo bar baz' +classNames([1, 2, 3]); // => '1 2 3' +classNames([{ foo: true, bar: false }, { baz: true }]); // => 'foo baz' + +classNames(["foo", ["bar", {baz: true}]]); // => 'foo bar baz' // other falsy values are just ignored // NOTE: We don't really want to allow this kind of thing with Typescript (otherwise what's the point!) diff --git a/classnames/classnames.d.ts b/classnames/classnames.d.ts index 22ab1858a..58a3e096f 100644 --- a/classnames/classnames.d.ts +++ b/classnames/classnames.d.ts @@ -1,14 +1,18 @@ // Type definitions for classnames // Project: https://github.com/JedWatson/classnames -// Definitions by: Dave Keen , Adi Dahiya +// Definitions by: Dave Keen , Adi Dahiya , Jason Killian // Definitions: https://github.com/borisyankov/DefinitelyTyped +declare type ClassValue = string | number | ClassDictionary | ClassArray; + interface ClassDictionary { [id: string]: boolean; } +interface ClassArray extends Array { } + interface ClassNamesFn { - (...classes: (string | ClassDictionary)[]): string; + (...classes: ClassValue[]): string; } declare var classNames: ClassNamesFn; diff --git a/codemirror/codemirror-matchbrackets-tests.ts b/codemirror/codemirror-matchbrackets-tests.ts new file mode 100644 index 000000000..2189612c0 --- /dev/null +++ b/codemirror/codemirror-matchbrackets-tests.ts @@ -0,0 +1,4 @@ +/// +/// + +var myCodeMirror: CodeMirror.Editor = CodeMirror(document.body, { matchBrackets: true }); diff --git a/codemirror/codemirror-matchbrackets.d.ts b/codemirror/codemirror-matchbrackets.d.ts new file mode 100644 index 000000000..13241a5a3 --- /dev/null +++ b/codemirror/codemirror-matchbrackets.d.ts @@ -0,0 +1,13 @@ +// Type definitions for CodeMirror +// Project: https://github.com/marijnh/CodeMirror +// Definitions by: Sixin Li +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +// See docs https://codemirror.net/doc/manual.html#addon_matchbrackets + +declare module CodeMirror { + interface EditorConfiguration { + // when set to true, causes matching brackets to be highlighted whenever the cursor is next to them + matchBrackets?: boolean; + } +} diff --git a/codemirror/codemirror.d.ts b/codemirror/codemirror.d.ts index 0f548a3fa..ca7c71792 100644 --- a/codemirror/codemirror.d.ts +++ b/codemirror/codemirror.d.ts @@ -787,7 +787,10 @@ declare module CodeMirror { viewportMargin?: number; /** Optional lint configuration to be used in conjunction with CodeMirror's linter addon. */ - lint?: boolean | LintOptions; + lint?: boolean | LintOptions; + + /** Optional value to be used in conduction with CodeMirror’s placeholder add-on. */ + placeholder?: string; } interface TextMarkerOptions { diff --git a/commander/commander-tests.ts b/commander/commander-tests.ts index f2457901d..135ad8bf0 100644 --- a/commander/commander-tests.ts +++ b/commander/commander-tests.ts @@ -95,6 +95,13 @@ program.on('--help', () => { console.log(''); }); +program + .command('allow-unknown-option') + .allowUnknownOption() + .action(() => { + console.log('unknown option is allowed'); + }); + program.parse(process.argv); console.log('stuff'); diff --git a/commander/commander.d.ts b/commander/commander.d.ts index 09d796659..278a491a6 100644 --- a/commander/commander.d.ts +++ b/commander/commander.d.ts @@ -158,6 +158,15 @@ declare module commander { option(flags:string, description?:string, fn?:(arg1:any, arg2:any)=>void, defaultValue?:any):ICommand; option(flags:string, description?:string, defaultValue?:any):ICommand; + /** + * Allow unknown options on the command line. + * + * @param {Boolean} arg if `true` or omitted, no error will be thrown + * for unknown options. + * @api public + */ + allowUnknownOption(arg?: boolean):ICommand; + /** * Parse `argv`, settings options and invoking commands when defined. * diff --git a/d3/d3-tests.ts b/d3/d3-tests.ts index 414a2346e..98888dde7 100644 --- a/d3/d3-tests.ts +++ b/d3/d3-tests.ts @@ -2693,3 +2693,16 @@ function testD3MutlieTimeFormat() { ["%Y", function() { return true; }] ]); } + +function testMultiUtcFormat() { + var format = d3.time.format.utc.multi([ + [".%L", function(d) { return d.getMilliseconds(); }], + [":%S", function(d) { return d.getSeconds(); }], + ["%I:%M", function(d) { return d.getMinutes(); }], + ["%I %p", function(d) { return d.getHours(); }], + ["%a %d", function(d) { return d.getDay() && d.getDate() != 1; }], + ["%b %d", function(d) { return d.getDate() != 1; }], + ["%B", function(d) { return d.getMonth(); }], + ["%Y", function() { return true; }] + ]); +} \ No newline at end of file diff --git a/d3/d3.d.ts b/d3/d3.d.ts index 2d1b20c3b..fbeca365e 100644 --- a/d3/d3.d.ts +++ b/d3/d3.d.ts @@ -1802,6 +1802,10 @@ declare module d3 { export module format { export function multi(formats: Array<[string, (d: Date) => boolean|number]>): Format; export function utc(specifier: string): Format; + module utc { + export function multi(formats: Array<[string, (d: Date) => boolean|number]>): Format; + } + export var iso: Format; } diff --git a/diff/diff.d.ts b/diff/diff.d.ts index 9ccbb10a8..f5c2cc48f 100644 --- a/diff/diff.d.ts +++ b/diff/diff.d.ts @@ -39,6 +39,8 @@ declare module JsDiff { function diffWordsWithSpace(oldStr:string, newStr:string):IDiffResult[]; + function diffJson(oldObj: Object, newObj: Object): IDiffResult[]; + function diffLines(oldStr:string, newStr:string):IDiffResult[]; function diffCss(oldStr:string, newStr:string):IDiffResult[]; diff --git a/documentdb-server/documentdb-server-tests.ts b/documentdb-server/documentdb-server-tests.ts new file mode 100644 index 000000000..722fdbec5 --- /dev/null +++ b/documentdb-server/documentdb-server-tests.ts @@ -0,0 +1,1016 @@ +/// + +// Samples taken from http://dl.windowsazure.com/documentDB/jsserverdocs/Collection.html +function chain() { + var name: string = "John"; + var result: IQueryResponse = __.chain() + .filter(function (doc: any) { return doc.name == name; }) + .map(function (doc: any) { return { name: doc.name, age: doc.age }; }) + .value(); + if (!result.isAccepted) throw new Error("The call was not accepted"); +} +function filter() { + // Example 1: get documents(people) with age < 30. + var result: IQueryResponse = __.filter(function (doc: any) { return doc.age < 30; }); + if (!result.isAccepted) throw new Error("The call was not accepted"); + // Example 2: get documents (people) with age < 30 and select only name. + var result: IQueryResponse = __.chain() + .filter(function (doc: any) { return doc.age < 30; }) + .pluck("name") + .value(); + if (!result.isAccepted) throw new Error("The call was not accepted"); + // Example 3: get document (person) with id = 1 and delete it. + var result: IQueryResponse = __.filter(function (doc: any) { return doc.id === 1; }, function (err: IFeedCallbackError, feed: Array, options: IFeedCallbackOptions) { + if (err) throw err; + if (!__.deleteDocument(feed[0].getSelfLink())) throw new Error("deleteDocument was not accepted"); + }); + if (!result.isAccepted) throw new Error("The call was not accepted"); +} +function flatten() { + // Get documents (people) with age < 30, select tags (an array property) + // and flatten the result into one array for all documents. + var result: IQueryResponse = __.chain() + .filter(function (doc: any) { return doc.age < 30; }) + .map(function (doc: any) { return doc.tags; }) + .flatten() + .value(); + if (!result.isAccepted) throw new Error("The call was not accepted"); +} +function map() { + // Example 1: select only name and age for each document (person). + var result: IQueryResponse = __.map(function (doc: any) { return { name: doc.name, age: doc.age }; }); + if (!result.isAccepted) throw new Error("The call was not accepted"); + // Example 2: select name and age for each document (person), and return only people with age < 30. + var result: IQueryResponse = __.chain() + .map(function (doc: any) { return { name: doc.name, age: doc.age }; }) + .filter(function (doc: any) { return doc.age < 30; }) + .value(); + if (!result.isAccepted) throw new Error("The call was not accepted"); +} +function pluck() { + // Get documents (people) with age < 30 and select only name. + var result: IQueryResponse = __.chain() + .filter(function (doc: any) { return doc.age < 30; }) + .pluck("name") + .value(); + if (!result.isAccepted) throw new Error("The call was not accepted"); +} +function sortBy() { + // Example 1: sort documents (people) by age + var result: IQueryResponse = __.sortBy(function (doc: any) { return doc.age; }) + if (!result.isAccepted) throw new Error("The call was not accepted"); + // Example 2: sortBy in a chain by name + var result: IQueryResponse = __.chain() + .filter(function (doc: any) { return doc.age < 30; }) + .sortBy(function (doc: any) { return doc.name; }) + .value(); + if (!result.isAccepted) throw new Error("The call was not accepted"); +} +function sortByDescending() { + // Example 1: sort documents (people) by age in descending order + var result: IQueryResponse = __.sortByDescending(function (doc: any) { return doc.age; }) + if (!result.isAccepted) throw new Error("The call was not accepted"); + // Example 2: sortBy in a chain by name in descending order + var result: IQueryResponse = __.chain() + .filter(function (doc: any) { return doc.age < 30; }) + .sortByDescending(function (doc: any) { return doc.name; }) + .value(); + if (!result.isAccepted) throw new Error("The call was not accepted"); +} +function value() { + // Example 1: use defaults: the result goes to the response body. + var result: IQueryResponse = __.chain() + .filter(function (doc: any) { return doc.name == "John"; }) + .pluck("age") + .value(); + if (!result.isAccepted) throw new Error("The call was not accepted"); + // Example 2: use options and callback. + function usingOptionsAndCallback (continuationToken: string) { + var result = __.chain() + .filter(function (doc: any) { return doc.name == "John"; }) + .pluck("age") + .value({ continuation: continuationToken }, function (err: IFeedCallbackError, feed: Array, options: IFeedCallbackOptions) { + if (err) throw err; + __.response.setBody({ + result: feed, + continuation: options.continuation + }); + }); + if (!result.isAccepted) throw new Error("The call was not accepted"); + } +} + +// Samples taken from https://github.com/Azure/azure-documentdb-js-server/tree/master/samples +/** +* This script called as stored procedure to import lots of documents in one batch. +* The script sets response body to the number of docs imported and is called multiple times +* by the client until total number of docs desired by the client is imported. +* @param {Object[]} docs - Array of documents to import. +*/ +function bulkImport(docs: Array) { + var collection: ICollection = getContext().getCollection(); + var collectionLink: string = collection.getSelfLink(); + + // The count of imported docs, also used as current doc index. + var count: number = 0; + + // Validate input. + if (!docs) throw new Error("The array is undefined or null."); + + var docsLength: number = docs.length; + if (docsLength == 0) { + getContext().getResponse().setBody(0); + return; + } + + // Call the CRUD API to create a document. + tryCreate(docs[count], callback); + + // Note that there are 2 exit conditions: + // 1) The createDocument request was not accepted. + // In this case the callback will not be called, we just call setBody and we are done. + // 2) The callback was called docs.length times. + // In this case all documents were created and we don't need to call tryCreate anymore. Just call setBody and we are done. + function tryCreate(doc: Object, callback: (err: IRequestCallbackError, doc: Object, options: IRequestCallbackOptions) => void): void { + var isAccepted = collection.createDocument(collectionLink, doc, callback); + + // If the request was accepted, callback will be called. + // Otherwise report current count back to the client, + // which will call the script again with remaining set of docs. + // This condition will happen when this stored procedure has been running too long + // and is about to get cancelled by the server. This will allow the calling client + // to resume this batch from the point we got to before isAccepted was set to false + if (!isAccepted) getContext().getResponse().setBody(count); + } + + // This is called when collection.createDocument is done and the document has been persisted. + function callback(err: IRequestCallbackError, doc: Object, options: IRequestCallbackOptions) { + if (err) throw err; + + // One more document has been inserted, increment the count. + count++; + + if (count >= docsLength) { + // If we have created all documents, we are done. Just set the response. + getContext().getResponse().setBody(count); + } else { + // Create next document. + tryCreate(docs[count], callback); + } + } +} + +/** +* This is executed as stored procedure to count the number of docs in the collection. +* To avoid script timeout on the server when there are lots of documents (100K+), the script executed in batches, +* each batch counts docs to some number and returns continuation token. +* The script is run multiple times, starting from empty continuation, +* then using continuation returned by last invocation script until continuation returned by the script is null/empty string. +* +* @param {String} filterQuery - Optional filter for query (e.g. "SELECT * FROM docs WHERE docs.category = 'food'"). +* @param {String} continuationToken - The continuation token passed by request, continue counting from this token. +*/ +function count(filterQuery: string, continuationToken: string) { + var collection: ICollection = getContext().getCollection(); + var maxResult: number = 25; // MAX number of docs to process in one batch, when reached, return to client/request continuation. + // intentionally set low to demonstrate the concept. This can be much higher. Try experimenting. + // We've had it in to the high thousands before seeing the stored proceudre timing out. + + // The number of documents counted. + var result: number = 0; + + tryQuery(continuationToken); + + // Helper method to check for max result and call query. + function tryQuery(nextContinuationToken: string) { + var responseOptions: Object = { continuation: nextContinuationToken, pageSize: maxResult }; + + // In case the server is running this script for long time/near timeout, it would return false, + // in this case we set the response to current continuation token, + // and the client will run this script again starting from this continuation. + // When the client calls this script 1st time, is passes empty continuation token. + if (result >= maxResult || !query(responseOptions)) { + setBody(nextContinuationToken); + } + } + + function query(responseOptions: IFeedOptions) { + // For empty query string, use readDocuments rather than queryDocuments -- it's faster as doesn't need to process the query. + return (filterQuery && filterQuery.length) ? + collection.queryDocuments(collection.getSelfLink(), filterQuery, responseOptions, onReadDocuments) : + collection.readDocuments(collection.getSelfLink(), responseOptions, onReadDocuments); + } + + // This is callback is called from collection.queryDocuments/readDocuments. + function onReadDocuments(err: IFeedCallbackError, docFeed: Array, responseOptions: IFeedCallbackOptions) { + if (err) { + throw 'Error while reading document: ' + err; + } + + // Increament the number of documents counted so far. + result += docFeed.length; + + // If there is continuation, call query again with it, + // otherwise we are done, in which case set continuation to null. + if (responseOptions.continuation) { + tryQuery(responseOptions.continuation); + } else { + setBody(null); + } + } + + // Set response body: use an object the client is expecting (2 properties: result and continuationToken). + function setBody(continuationToken: string) { + var body: Object = { count: result, continuationToken: continuationToken }; + getContext().getResponse().setBody(body); + } +} + +/** +* This is run as stored procedure and does the following: +* - create ordered result set (result) which is an array sorted by orderByFieldName parameter. +* - call collection.queryDocuments. +* - in the callback for each document, insert into an array (result) +* - in the end, sort the resulting array and return it to the client +* +* Important notes: +* - The resulting record set could be too large to fit into one response +* - To walk around that, we setBody by one element and catch the REQUEST_ENTITY_TOO_LARGE exception. +* When we get the exception, return resulting set to the client with continuation token +* to continue from item index specified by this token. +* - Note that when continuation is called, it will be different transaction +* +* @param {String} filterQuery - Optional filter for query. +* @param {String} orderByFieldName - The name of the field to order by resulting set. +* @param {String} continuationToken - The continuation token passed by request, continue counting from this token. +*/ +function orderBy(filterQuery: string, orderByFieldName: string, continuationToken: number) { + // HTTP error codes sent to our callback funciton by DocDB server. + var ErrorCode: any = { + REQUEST_ENTITY_TOO_LARGE: 413, + } + + var collection: ICollection = getContext().getCollection(); + var collectionLink: string = collection.getSelfLink(); + var result: Array = new Array(); + + tryQuery({}); + + function tryQuery(options: IFeedOptions) { + var isAccepted: boolean = (filterQuery && filterQuery.length) ? + collection.queryDocuments(collectionLink, filterQuery, options, callback) : + collection.readDocuments(collectionLink, options, callback) + + if (!isAccepted) throw new Error("Source dataset is too large to complete the operation."); + } + + /** + * queryDocuments callback. + * @param {Error} err - Error object in case of error/exception. + * @param {Array} queryFeed - array containing results of the query. + * @param {ResponseOptions} responseOptions. + */ + function callback(err: IFeedCallbackError, queryFeed: Array, responseOptions: IFeedCallbackOptions) { + if (err) { + throw err; + } + + // Iterate over document feed and store documents into the result array. + queryFeed.forEach(function (element: any, index: number, array: Array) { + result[result.length] = element; + }); + + if (responseOptions.continuation) { + // If there is continuation, call query again providing continuation token. + tryQuery({ continuation: responseOptions.continuation }); + } else { + // We are done with querying/got all results. Sort the results and return from the script. + result.sort(compare); + + fillResponse(); + } + } + + // Compare two objects(documents) using field specified by the orderByFieldName parameter. + // Return 0 if equal, -1 if less, 1 if greater. + function compare(x: any, y: any) { + if (x[orderByFieldName] == y[orderByFieldName]) return 0; + else if (x[orderByFieldName] < y[orderByFieldName]) return -1; + return 1; + } + + // This is called in the very end on an already sorted array. + // Sort the results and set the response body. + function fillResponse() { + // Main script is called with continuationToken which is the index of 1st item to start result batch from. + // Slice the result array and discard the beginning. From now on use the 'continuationResult' var. + var continuationResult: Array = result; + if (continuationToken) continuationResult = result.slice(continuationToken); + else continuationToken = 0; + + // Get/initialize the response. + var response: IResponse = getContext().getResponse(); + response.setBody(null); + + // Take care of response body getting too large: + // Set Response iterating by one element. When we fail due to MAX response size, return to the client requesting continuation. + var i = 0; + for (; i < continuationResult.length; ++i) { + try { + // Note: setBody is very expensive vs appendBody, use appendBody with simple approximation JSON.stringify(element). + response.appendBody(JSON.stringify(continuationResult[i])); + } catch (ex) { + if (!ex.number == ErrorCode.REQUEST_ENTITY_TOO_LARGE) throw ex; + break; + } + } + + // Now next batch to return to client has i elements. + // Slice the continuationResult if needed and discard the end. + var partialResult: Array = continuationResult; + var newContinuation: string = null; + if (i < continuationResult.length) { + partialResult = continuationResult.slice(0, i); + } + + // Finally, set response body. + response.setBody({ result: result, continuation: newContinuation }); + } +} + + +/** +* This is run as stored procedure and does the following: +* - get 1st document in the collection, convert to JSON, prepend string specified by the prefix parameter +* and set response to the result of that. +* +* @param {String} prefix - The string to prepend to the 1st document in collection. +*/ +function simple(prefix: string) { + var collection: ICollection = getContext().getCollection(); + + // Query documents and take 1st item. + var isAccepted: boolean = collection.queryDocuments( + collection.getSelfLink(), + 'SELECT * FROM root r', + function (err: IFeedCallbackError, feed: Array, options: IFeedCallbackOptions) { + if (err) throw err; + + // Check the feed and if it's empty, set the body to 'no docs found', + // Otherwise just take 1st element from the feed. + if (!feed || !feed.length) getContext().getResponse().setBody("no docs found"); + else getContext().getResponse().setBody(prefix + JSON.stringify(feed[0])); + }); + + if (!isAccepted) throw new Error("The query wasn't accepted by the server. Try again/use continuation token between API and script."); +} + +/** + * A DocumentDB stored procedure that bulk deletes documents for a given query.
+ * Note: You may need to execute this sproc multiple times (depending whether the sproc is able to delete every document within the execution timeout limit). + * + * @function + * @param {string} query - A query that provides the documents to be deleted (e.g. "SELECT * FROM c WHERE c.founded_year = 2008") + * @returns {Object.} Returns an object with the two properties:
+ * deleted - contains a count of documents deleted
+ * continuation - a boolean whether you should execute the sproc again (true if there are more documents to delete; false otherwise). + */ +function bulkDeleteSproc(query: string) { + var collection: ICollection = getContext().getCollection(); + var collectionLink: string = collection.getSelfLink(); + var response: IResponse = getContext().getResponse(); + var responseBody: any = { + deleted: 0, + continuation: true + }; + + // Validate input. + if (!query) throw new Error("The query is undefined or null."); + + tryQueryAndDelete(); + + // Recursively runs the query w/ support for continuation tokens. + // Calls tryDelete(documents) as soon as the query returns documents. + function tryQueryAndDelete(continuation?: string) { + var requestOptions: IFeedOptions = { continuation: continuation }; + + var isAccepted: boolean = collection.queryDocuments(collectionLink, query, requestOptions, function (err: IFeedCallbackError, retrievedDocs: Array, responseOptions: IFeedCallbackOptions) { + if (err) throw err; + + if (retrievedDocs.length > 0) { + // Begin deleting documents as soon as documents are returned form the query results. + // tryDelete() resumes querying after deleting; no need to page through continuation tokens. + // - this is to prioritize writes over reads given timeout constraints. + tryDelete(retrievedDocs); + } else if (responseOptions.continuation) { + // Else if the query came back empty, but with a continuation token; repeat the query w/ the token. + tryQueryAndDelete(responseOptions.continuation); + } else { + // Else if there are no more documents and no continuation token - we are finished deleting documents. + responseBody.continuation = false; + response.setBody(responseBody); + } + }); + + // If we hit execution bounds - return continuation: true. + if (!isAccepted) { + response.setBody(responseBody); + } + } + + // Recursively deletes documents passed in as an array argument. + // Attempts to query for more on empty array. + function tryDelete(documents: Array) { + if (documents.length > 0) { + // Delete the first document in the array. + var isAccepted: boolean = collection.deleteDocument(documents[0]._self, {}, function (err, responseOptions) { + if (err) throw err; + + responseBody.deleted++; + documents.shift(); + // Delete the next document in the array. + tryDelete(documents); + }); + + // If we hit execution bounds - return continuation: true. + if (!isAccepted) { + response.setBody(responseBody); + } + } else { + // If the document array is empty, query for more documents. + tryQueryAndDelete(); + } + } +} + +/** + * A DocumentDB stored procedure that updates a document by id, using a similar syntax to MongoDB's update operator.
+ *
+ * The following operations are supported:
+ *
+ * Field Operators:
+ *
    + *
  • $inc - Increments the value of the field by the specified amount.
  • + *
  • $mul - Multiplies the value of the field by the specified amount.
  • + *
  • $rename - Renames a field.
  • + *
  • $set - Sets the value of a field in a document.
  • + *
  • $unset - Removes the specified field from a document.
  • + *
  • $min - Only updates the field if the specified value is less than the existing field value.
  • + *
  • $max - Only updates the field if the specified value is greater than the existing field value.
  • + *
  • $currentDate - Sets the value of a field to current date as a Unix Epoch.
  • + *
+ *
+ * Array Operators:
+ *
    + *
  • $addToSet - Adds elements to an array only if they do not already exist in the set.
  • + *
  • $pop - Removes the first or last item of an array.
  • + *
  • $push - Adds an item to an array.
  • + *
+ *
+ * Note: Performing multiple operations on the same field may yield unexpected results.
+ * + * @example Increment the property "counter" by 1 in the document where id = "foo". + * updateSproc("foo", {$inc: {counter: 1}}); + * + * @example Set the property "message" to "Hello World" and the "messageDate" to the current date in the document where id = "bar". + * updateSproc("bar", {$set: {message: "Hello World"}, $currentDate: {messageDate: ""}}); + * + * @function + * @param {string} id - The id for your document. + * @param {object} update - the modifications to apply. + * @returns {object} the updated document. + */ +function updateSproc(id: string, update: Object) { + var collection: ICollection = getContext().getCollection(); + var collectionLink: string = collection.getSelfLink(); + var response: IResponse = getContext().getResponse(); + + // Validate input. + if (!id) throw new Error("The id is undefined or null."); + if (!update) throw new Error("The update is undefined or null."); + + tryQueryAndUpdate(); + + // Recursively queries for a document by id w/ support for continuation tokens. + // Calls tryUpdate(document) as soon as the query returns a document. + function tryQueryAndUpdate(continuation?: string) { + var query: IParameterizedQuery = { query: "select * from root r where r.id = @id", parameters: [{ name: "@id", value: id }] }; + var requestOptions: IFeedOptions = { continuation: continuation }; + + var isAccepted: boolean = collection.queryDocuments(collectionLink, query, requestOptions, function (err: IFeedCallbackError, documents: Array, responseOptions: IFeedCallbackOptions) { + if (err) throw err; + + if (documents.length > 0) { + // If the document is found, update it. + // There is no need to check for a continuation token since we are querying for a single document. + tryUpdate(documents[0]); + } else if (responseOptions.continuation) { + // Else if the query came back empty, but with a continuation token; repeat the query w/ the token. + // It is highly unlikely for this to happen when performing a query by id; but is included to serve as an example for larger queries. + tryQueryAndUpdate(responseOptions.continuation); + } else { + // Else a document with the given id does not exist.. + throw new Error("Document not found."); + } + }); + + // If we hit execution bounds - throw an exception. + // This is highly unlikely given that this is a query by id; but is included to serve as an example for larger queries. + if (!isAccepted) { + throw new Error("The stored procedure timed out."); + } + } + + // Updates the supplied document according to the update object passed in to the sproc. + function tryUpdate(document: IDocumentMeta) { + + // DocumentDB supports optimistic concurrency control via HTTP ETag. + var requestOptions: IReplaceOptions = { etag: document._etag }; + + // Update operators. + inc(document, update); + mul(document, update); + rename(document, update); + set(document, update); + unset(document, update); + min(document, update); + max(document, update); + currentDate(document, update); + addToSet(document, update); + pop(document, update); + push(document, update); + + // Update the document. + var isAccepted: boolean = collection.replaceDocument(document._self, document, requestOptions, function (err, updatedDocument, responseOptions) { + if (err) throw err; + + // If we have successfully updated the document - return it in the response body. + response.setBody(updatedDocument); + }); + + // If we hit execution bounds - throw an exception. + if (!isAccepted) { + throw new Error("The stored procedure timed out."); + } + } + + // Operator implementations. + // The $inc operator increments the value of a field by a specified amount. + function inc(document: any, update: any) { + var fields: Array, i: number; + + if (update.$inc) { + fields = Object.keys(update.$inc); + for (i = 0; i < fields.length; i++) { + if (isNaN(update.$inc[fields[i]])) { + // Validate the field; throw an exception if it is not a number (can't increment by NaN). + throw new Error("Bad $inc parameter - value must be a number") + } else if (document[fields[i]]) { + // If the field exists, increment it by the given amount. + document[fields[i]] += update.$inc[fields[i]]; + } else { + // Otherwise set the field to the given amount. + document[fields[i]] = update.$inc[fields[i]]; + } + } + } + } + + // The $mul operator multiplies the value of the field by the specified amount. + function mul(document: any, update: any) { + var fields: Array, i: number; + + if (update.$mul) { + fields = Object.keys(update.$mul); + for (i = 0; i < fields.length; i++) { + if (isNaN(update.$mul[fields[i]])) { + // Validate the field; throw an exception if it is not a number (can't multiply by NaN). + throw new Error("Bad $mul parameter - value must be a number") + } else if (document[fields[i]]) { + // If the field exists, multiply it by the given amount. + document[fields[i]] *= update.$mul[fields[i]]; + } else { + // Otherwise set the field to 0. + document[fields[i]] = 0; + } + } + } + } + + // The $rename operator renames a field. + function rename(document: any, update: any) { + var fields: Array, i: number, existingFieldName: string, newFieldName: string; + + if (update.$rename) { + fields = Object.keys(update.$rename); + for (i = 0; i < fields.length; i++) { + existingFieldName = fields[i]; + newFieldName = update.$rename[fields[i]]; + + if (existingFieldName == newFieldName) { + throw new Error("Bad $rename parameter: The new field name must differ from the existing field name.") + } else if (document[existingFieldName]) { + // If the field exists, set/overwrite the new field name and unset the existing field name. + document[newFieldName] = document[existingFieldName]; + delete document[existingFieldName]; + } else { + // Otherwise this is a noop. + } + } + } + } + + // The $set operator sets the value of a field. + function set(document: any, update: any) { + var fields: Array, i: number; + + if (update.$set) { + fields = Object.keys(update.$set); + for (i = 0; i < fields.length; i++) { + document[fields[i]] = update.$set[fields[i]]; + } + } + } + + // The $unset operator removes the specified field. + function unset(document: any, update: any) { + var fields: Array, i: number; + + if (update.$unset) { + fields = Object.keys(update.$unset); + for (i = 0; i < fields.length; i++) { + delete document[fields[i]]; + } + } + } + + // The $min operator only updates the field if the specified value is less than the existing field value. + function min(document: any, update: any) { + var fields: Array, i: number; + + if (update.$min) { + fields = Object.keys(update.$min); + for (i = 0; i < fields.length; i++) { + if (update.$min[fields[i]] < document[fields[i]]) { + document[fields[i]] = update.$min[fields[i]]; + } + } + } + } + + // The $max operator only updates the field if the specified value is greater than the existing field value. + function max(document: any, update: any) { + var fields: Array, i: number; + + if (update.$max) { + fields = Object.keys(update.$max); + for (i = 0; i < fields.length; i++) { + if (update.$max[fields[i]] > document[fields[i]]) { + document[fields[i]] = update.$max[fields[i]]; + } + } + } + } + + // The $currentDate operator sets the value of a field to current date as a POSIX epoch. + function currentDate(document: any, update: any) { + var currentDate: Date = new Date(); + var fields: Array, i: number; + + if (update.$currentDate) { + fields = Object.keys(update.$currentDate); + for (i = 0; i < fields.length; i++) { + // ECMAScript's Date.getTime() returns milliseconds, where as POSIX epoch are in seconds. + document[fields[i]] = Math.round(currentDate.getTime() / 1000); + } + } + } + + // The $addToSet operator adds elements to an array only if they do not already exist in the set. + function addToSet(document: any, update: any) { + var fields: Array, i: number; + + if (update.$addToSet) { + fields = Object.keys(update.$addToSet); + + for (i = 0; i < fields.length; i++) { + if (!Array.isArray(document[fields[i]])) { + // Validate the document field; throw an exception if it is not an array. + throw new Error("Bad $addToSet parameter - field in document must be an array.") + } else if (document[fields[i]].indexOf(update.$addToSet[fields[i]]) === -1) { + // Add the element if it doesn't already exist in the array. + document[fields[i]].push(update.$addToSet[fields[i]]); + } + } + } + } + + // The $pop operator removes the first or last item of an array. + // Pass $pop a value of -1 to remove the first element of an array and 1 to remove the last element in an array. + function pop(document: any, update: any) { + var fields: Array, i: number; + + if (update.$pop) { + fields = Object.keys(update.$pop); + + for (i = 0; i < fields.length; i++) { + if (!Array.isArray(document[fields[i]])) { + // Validate the document field; throw an exception if it is not an array. + throw new Error("Bad $pop parameter - field in document must be an array.") + } else if (update.$pop[fields[i]] < 0) { + // Remove the first element from the array if it's less than 0 (be flexible). + document[fields[i]].shift(); + } else { + // Otherwise, remove the last element from the array (have 0 default to javascript's pop()). + document[fields[i]].pop(); + } + } + } + } + + // The $push operator adds an item to an array. + function push(document: any, update: any) { + var fields: Array, i: number; + + if (update.$push) { + fields = Object.keys(update.$push); + + for (i = 0; i < fields.length; i++) { + if (!Array.isArray(document[fields[i]])) { + // Validate the document field; throw an exception if it is not an array. + throw new Error("Bad $push parameter - field in document must be an array.") + } else { + // Push the element in to the array. + document[fields[i]].push(update.$push[fields[i]]); + } + } + } + } +} + +/** + * A DocumentDB stored procedure that upserts a given document (insert new or update if present) using its id property.
+ * This implementation tries to create, and if the create fails then query for the document with the specified document's id, then replace it. + * Use this sproc if creates are more common than replaces, otherwise use "upsertOptimizedForReplace" + * + * @function + * @param {Object} document - A document that should be upserted into this collection. + * @returns {Object.} Returns an object with the property:
+ * op - created (or) replaced. + */ +function upsert(document: IDocumentMeta) { + var context: IContext = getContext(); + var collection: ICollection = context.getCollection(); + var collectionLink: string = collection.getSelfLink(); + var response: IResponse = context.getResponse(); + var errorCodes: any = { CONFLICT: 409 }; + + // Not checking for existence of document.id for compatibility with createDocument. + if (!document) throw new Error("The document is undefined or null."); + + tryCreate(document, callback); + + function tryCreate(doc: IDocumentMeta, callback: (err: IRequestCallbackError, obj: any, options: IRequestCallbackOptions) => void) { + var isAccepted: boolean = collection.createDocument(collectionLink, doc, callback); + if (!isAccepted) throw new Error("Unable to schedule create document"); + response.setBody({ "op": "created" }); + } + + // To replace the document, first issue a query to find it and then call replace. + function tryReplace(doc: IDocumentMeta, callback: (err: IRequestCallbackError, obj: any, options: IRequestCallbackOptions) => void) { + retrieveDoc(doc, null, function (retrievedDocs: Array) { + var isAccepted: boolean = collection.replaceDocument(retrievedDocs[0]._self, doc, callback); + if (!isAccepted) throw new Error("Unable to schedule replace document"); + response.setBody({ "op": "replaced" }); + }); + } + + function retrieveDoc(doc: IDocumentMeta, continuation: string, callback: Function) { + var query: IParameterizedQuery = { query: "select * from root r where r.id = @id", parameters: [{ name: "@id", value: doc.id }] }; + var requestOptions: IFeedOptions = { continuation: continuation }; + var isAccepted: boolean = collection.queryDocuments(collectionLink, query, requestOptions, function (err: IFeedCallbackError, retrievedDocs: Array, responseOptions: IFeedCallbackOptions) { + if (err) throw err; + + if (retrievedDocs.length > 0) { + callback(retrievedDocs); + } else if (responseOptions.continuation) { + // Conservative check for continuation. Not expected to hit in practice for the "id query" + retrieveDoc(doc, responseOptions.continuation, callback); + } else { + throw new Error("Error in retrieving document: " + doc.id); + } + }); + if (!isAccepted) throw new Error("Unable to query documents"); + } + + // This is called when collection.createDocument is done in order to + // process the result. + function callback(err: IRequestCallbackError, doc: any, options: IRequestCallbackOptions) { + if (err) { + // Replace the document if status code is 409 and upsert is enabled + if (err.number == errorCodes.CONFLICT) { + return tryReplace(document, callback); + } else { + throw err; + } + } + } +} + +/** + * A DocumentDB stored procedure that upserts a given document (insert new or update if present) using its id property.
+ * This implementation queries for the document's id, and creates if absent and replaces if found. + * Use this sproc if replaces are more common than creates, otherwise use "upsert" + * + * @function + * @param {Object} document - A document that should be upserted into this collection. + * @returns {Object.} Returns an object with the property:
+ * op - created (or) replaced. + */ +function upsertOptimizedForReplace(document: any) { + var context: IContext = getContext(); + var collection: ICollection = context.getCollection(); + var collectionLink: string = collection.getSelfLink(); + var response: IResponse = context.getResponse(); + + // Not checking for existence of document.id for compatibility with createDocument. + if (!document) throw new Error("The document is undefined or null."); + + retrieveDoc(document, null, callback); + + function retrieveDoc(doc: IDocumentMeta, continuation: string, callback: (err: IRequestCallbackError, obj: any, options: IRequestCallbackOptions) => void) { + var query: IParameterizedQuery = { query: "select * from root r where r.id = @id", parameters: [{ name: "@id", value: doc.id }] }; + var requestOptions: IFeedOptions = { continuation: continuation }; + var isAccepted: boolean = collection.queryDocuments(collectionLink, query, requestOptions, function (err: IFeedCallbackError, retrievedDocs: Array, responseOptions: IFeedCallbackOptions) { + if (err) throw err; + if (retrievedDocs.length > 0) { + tryReplace(retrievedDocs[0], doc, callback); + } else if (responseOptions.continuation) { + // Conservative check for continuation. Not expected to hit in practice for the "id query". + retrieveDoc(doc, responseOptions.continuation, callback); + } else { + tryCreate(doc, callback); + } + }); + if (!isAccepted) throw new Error("Unable to query documents"); + } + + function tryCreate(doc: any, callback: (err: IRequestCallbackError, obj: any, options: IRequestCallbackOptions) => void) { + var isAccepted = collection.createDocument(collectionLink, doc, callback); + if (!isAccepted) throw new Error("Unable to schedule create document"); + response.setBody({ "op": "created" }); + } + + function tryReplace(docToReplace: IDocumentMeta, docContent: any, callback: (err: IRequestCallbackError, obj: any, options: IRequestCallbackOptions) => void) { + var isAccepted = collection.replaceDocument(docToReplace._self, docContent, callback); + if (!isAccepted) throw new Error("Unable to schedule replace document"); + response.setBody({ "op": "replaced" }); + } + + function callback(err: IRequestCallbackError, obj: any, options: IRequestCallbackOptions): void { + if (err) throw err; + } +} + +/** +* This script runs as a pre-trigger when a document is inserted: +* for each inserted document, validate/canonicalize document.weekday and create field document.createdTime. +*/ +function validateClass() { + var collection: ICollection = getContext().getCollection(); + var collectionLink: string = collection.getSelfLink(); + var doc: any = getContext().getRequest().getBody(); + + // Validate/canonicalize the data. + doc.weekday = canonicalizeWeekDay(doc.weekday); + + // Insert auto-created field 'createdTime'. + doc.createdTime = new Date(); + + // Update the request -- this is what is going to be inserted. + getContext().getRequest().setBody(doc); + + function canonicalizeWeekDay(day: string) { + // Simple input validation. + if (!day || !day.length || day.length < 3) throw new Error("Bad input: " + day); + + // Try to see if we can canonicalize the day. + var days: Array = ["Monday", "Tuesday", "Wednesday", "Friday", "Saturday", "Sunday"]; + var fullDay: string; + days.forEach(function (x: string) { + if (day.substring(0, 3).toLowerCase() == x.substring(0, 3).toLowerCase()) fullDay = x; + }); + if (fullDay) return fullDay; + + // Couldn't get the weekday from input. Throw. + throw new Error("Bad weekday: " + day); + } +} + +/** +* This script runs as a trigger: +* for each inserted document, look at document.size and update aggregate properties of metadata document: minSize, maxSize, totalSize. +*/ +function updateMetadata() { + // HTTP error codes sent to our callback funciton by DocDB server. + var ErrorCode: any = { + RETRY_WITH: 449, + } + + var collection: ICollection = getContext().getCollection(); + var collectionLink: string = collection.getSelfLink(); + + // Get the document from request (the script runs as trigger, thus the input comes in request). + var doc: any = getContext().getRequest().getBody(); + + // Check the doc (ignore docs with invalid/zero size and metaDoc itself) and call updateMetadata. + if (!doc.isMetadata && doc.size != undefined && doc.size > 0) { + getAndUpdateMetadata(); + } + + function getAndUpdateMetadata() { + // Get the meta document. We keep it in the same collection. it's the only doc that has .isMetadata = true. + var isAccepted: boolean = collection.queryDocuments(collectionLink, 'SELECT * FROM root r WHERE r.isMetadata = true', function (err: IFeedCallbackError, feed: Array, options: IFeedCallbackOptions) { + if (err) throw err; + if (!feed || !feed.length) throw new Error("Failed to find the metadata document."); + + // The metadata document. + var metaDoc: any = feed[0]; + + // Update metaDoc.minSize: + // for 1st document use doc.Size, for all the rest see if it's less than last min. + if (metaDoc.minSize == 0) metaDoc.minSize = doc.size; + else metaDoc.minSize = Math.min(metaDoc.minSize, doc.size); + + // Update metaDoc.maxSize. + metaDoc.maxSize = Math.max(metaDoc.maxSize, doc.size); + + // Update metaDoc.totalSize. + metaDoc.totalSize += doc.size; + + // Update/replace the metadata document in the store. + var isAccepted: boolean = collection.replaceDocument(metaDoc._self, metaDoc, function (err: IRequestCallbackError) { + if (err) throw err; + // Note: in case concurrent updates causes conflict with ErrorCode.RETRY_WITH, we can't read the meta again + // and update again because due to Snapshot isolation we will read same exact version (we are in same transaction). + // We have to take care of that on the client side. + }); + if (!isAccepted) throw new Error("The call replaceDocument(metaDoc) returned false."); + }); + if (!isAccepted) throw new Error("The call queryDocuments for metaDoc returned false."); + } +} + +/** + * This script is meant to run as a pre-trigger to enforce the uniqueness of the "name" property. + */ + +function validateName() { + var collection: ICollection = getContext().getCollection(); + var request: IRequest = getContext().getRequest(); + var docToCreate: any = request.getBody(); + + // Reject documents that do not have a name property by throwing an exception. + if (!docToCreate.name) { + throw new Error('Document must include a "name" property.'); + } + + lookForDuplicates(); + + function lookForDuplicates(continuation?: string) { + var query: IParameterizedQuery = { + query: 'SELECT * FROM myCollection c WHERE c.name = @name', + parameters: [{ + name: '@name', + value: docToCreate.name + }] + }; + var requestOptions: IFeedOptions = { + continuation: continuation + }; + + var isAccepted: boolean = collection.queryDocuments(collection.getSelfLink(), query, requestOptions, + function (err: IFeedCallbackError, results: Array, responseOptions: IFeedCallbackOptions) { + if (err) { + throw new Error('Error querying for documents with duplicate names: ' + err.body); + } + if (results.length > 0) { + // At least one document with name exists. + throw new Error('Document with the name, ' + docToCreate.name + ', already exists: ' + JSON.stringify(results[0])); + } else if (responseOptions.continuation) { + // Else if the query came back empty, but with a continuation token; repeat the query w/ the token. + // This is highly unlikely; but is included to serve as an example for larger queries. + lookForDuplicates(responseOptions.continuation); + } else { + // Success, no duplicates found! Do nothing. + } + } + ); + + // If we hit execution bounds - throw an exception. + // This is highly unlikely; but is included to serve as an example for more complex operations. + if (!isAccepted) { + throw new Error('Timeout querying for document with duplicate name.'); + } + } +} diff --git a/documentdb-server/documentdb-server.d.ts b/documentdb-server/documentdb-server.d.ts new file mode 100644 index 000000000..e878960b1 --- /dev/null +++ b/documentdb-server/documentdb-server.d.ts @@ -0,0 +1,538 @@ +// Type definitions for DocumentDB server side JavaScript SDK +// Project: http://dl.windowsazure.com/documentDB/jsserverdocs +// Definitions by: François Nguyen +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/** The Context object provides access to all operations that can be performed on DocumentDB data, as well as access to the request and response objects. */ +interface IContext { + /** Gets the collection object. */ + getCollection(): ICollection; + /** Gets the request object. */ + getRequest(): IRequest; + /** + * Gets the response object. + * Note: this is not available in pre-triggers. + */ + getResponse(): IResponse; +} + +/** + * The __ object can be used as a shortcut to the Collection and Context objects. + * It derives from the ICollection object via prototype and defines request and response properties + * which are shortcuts to getContext().getRequest() and getContext().getResponse(). + */ +interface I__Object extends ICollection { + /** Alias for getContext().getRequest() */ + request: IRequest; + /** Alias for getContext().getResponse() */ + response: IResponse; +} + +interface IQueryAPI { + /** + * Execute a filter on the input stream of documents, resulting in a subset of the input stream that matches the given filter. + * When filter is called by itself, the input document stream is the set of all documents in the current document collection. When used in a chained call, the input document stream is the set of documents returned from the previous query function. + * @param predicate The predicate function for a filter query, which acts as a truth test of whether a document should be filtered or not. + * @param options Optional query options. Should not be used in a chained call. + * @param callback Optional callback for the operation. If no callback is provided, any error in the operation will be thrown and the result document set will be written to the Response body. Should not be used in a chained call. + */ + filter(predicate: (document: Object) => boolean, + options?: IFeedOptions, + callback?: (error: IFeedCallbackError, resources: Array, options: IFeedCallbackOptions) => void): IQueryResponse; + filter(predicate: (document: Object) => boolean, + options?: IFeedOptions, + callback?: (error: IFeedCallbackError, resources: Array, options: IFeedCallbackOptions) => void): IQueryResponse; + /** + * Produce a new set of documents by mapping/projecting the properties of the documents in the input document stream through the given mapping predicate. + * When map is called by itself, the input document stream is the set of all documents in the current document collection. When used in a chained call, the input document stream is the set of documents returned from the previous query function. + * @param predicate The predicate function for a map/projection, which maps the input document's properties into a new document object. + * @param options Optional query options. Should not be used in a chained call. + * @param callback Optional callback for the operation. If no callback is provided, any error in the operation will be thrown and the result document set will be written to the Response body. Should not be used in a chained call. + */ + map(predicate: (document: Object) => Object, + options?: IFeedOptions, + callback?: (error: IFeedCallbackError, resources: Array, options: IFeedCallbackOptions) => void): IQueryResponse; + map(predicate: (document: Object) => Object, + options?: IFeedOptions, + callback?: (error: IFeedCallbackError, resources: Array, options: IFeedCallbackOptions) => void): IQueryResponse; + /** + * Produce a new set of documents by extracting a single property from each document in the input document stream. This is equivalent to a map call that projects only propertyName. + * When pluck is called by itself, the input document stream is the set of all documents in the current document collection. When used in a chained call, the input document stream is the set of documents returned from the previous query function. + * @param propertyName Name of the property to pluck from all documents in the current collection + * @param options Optional query options. Should not be used in a chained call. + * @param callback Optional callback for the operation. If no callback is provided, any error in the operation will be thrown and the result document set will be written to the Response body. Should not be used in a chained call. + */ + pluck(propertyName: string, + options?: IFeedOptions, + callback?: (error: IFeedCallbackError, resources: Array, options: IFeedCallbackOptions) => void): IQueryResponse; + pluck(propertyName: string, + options?: IFeedOptions, + callback?: (error: IFeedCallbackError, resources: Array, options: IFeedCallbackOptions) => void): IQueryResponse; + /** + * Flatten nested arrays from each document in the input document stream. + * When flatten is called by itself, the input document stream is the set of all documents in the current document collection. When used in a chained call, the input document stream is the set of documents returned from the previous query function. + * @param isShallow If true, flattens only the first level of nested arrays (false by default) + * @param options Optional query options. Should not be used in a chained call. + * @param callback Optional callback for the operation. If no callback is provided, any error in the operation will be thrown and the result document set will be written to the Response body. Should not be used in a chained call. + */ + flatten(isShallow?: boolean, + options?: IFeedOptions, + callback?: (error: IFeedCallbackError, resources: Array, options: IFeedCallbackOptions) => void): IQueryResponse; + flatten(isShallow?: boolean, + options?: IFeedOptions, + callback?: (error: IFeedCallbackError, resources: Array, options: IFeedCallbackOptions) => void): IQueryResponse; + /** + * Produce a new set of documents by sorting the documents in the input document stream in ascending order using the given predicate. + * When sortBy is called by itself, the input document stream is the set of all documents in the current document collection. When used in a chained call, the input document stream is the set of documents returned from the previous query function. + * @param predicate Predicate function defining the property to sort by. + * @param options Optional query options. Should not be used in a chained call. + * @param Optional callback for the operation. If no callback is provided, any error in the operation will be thrown and the result document set will be written to the Response body. Should not be used in a chained call. + */ + sortBy(predicate: (document: Object) => string, + options?: IFeedOptions, + callback?: (error: IFeedCallbackError, resources: Array, options: IFeedCallbackOptions) => void): IQueryResponse; + sortBy(predicate: (document: Object) => number, + options?: IFeedOptions, + callback?: (error: IFeedCallbackError, resources: Array, options: IFeedCallbackOptions) => void): IQueryResponse; + sortBy(predicate: (document: Object) => string, + options?: IFeedOptions, + callback?: (error: IFeedCallbackError, resources: Array, options: IFeedCallbackOptions) => void): IQueryResponse; + sortBy(predicate: (document: Object) => number, + options?: IFeedOptions, + callback?: (error: IFeedCallbackError, resources: Array, options: IFeedCallbackOptions) => void): IQueryResponse; + /** + * Produce a new set of documents by sorting the documents in the input document stream in descending order using the given predicate. + * When sortByDescending is called by itself, the input document stream is the set of all documents in the current document collection. When used in a chained call, the input document stream is the set of documents returned from the previous query function. + * @param predicate Predicate function defining the property to sort by. + * @param options Optional query options. Should not be used in a chained call. + * @param callback Optional callback for the operation. If no callback is provided, any error in the operation will be thrown and the result document set will be written to the Response body. Should not be used in a chained call. + */ + sortByDescending(predicate: (document: Object) => string, + options?: IFeedOptions, + callback?: (error: IFeedCallbackError, resources: Array, options: IFeedCallbackOptions) => void): IQueryResponse; + sortByDescending(predicate: (document: Object) => number, + options?: IFeedOptions, + callback?: (error: IFeedCallbackError, resources: Array, options: IFeedCallbackOptions) => void): IQueryResponse; + sortByDescending(predicate: (document: Object) => string, + options?: IFeedOptions, + callback?: (error: IFeedCallbackError, resources: Array, options: IFeedCallbackOptions) => void): IQueryResponse; + sortByDescending(predicate: (document: Object) => number, + options?: IFeedOptions, + callback?: (error: IFeedCallbackError, resources: Array, options: IFeedCallbackOptions) => void): IQueryResponse; + /** + * Terminating call for a chained query. Should be used in conjunction with the opening chain call to perform chained queries. + * When value is called, the query is queued for execution with the given options and callback. + * @param options Optional query options for the entire chained call. + * @param callback Optional callback for the operation. If no callback is provided, any error in the operation will be thrown and the result document set will be written to the Response body. + */ + value(options?: IFeedOptions, + callback?: (error: IFeedCallbackError, resources: Array, options: IFeedCallbackOptions) => void): IQueryResponse; + value(options?: IFeedOptions, + callback?: (error: IFeedCallbackError, resources: Array, options: IFeedCallbackOptions) => void): IQueryResponse; +} + +/** + * Stored procedures and triggers are registered for a particular collection. The Collection object supports create, read, update and delete (CRUD) and query operations on documents and attachments in the current collection. + * All collection operations are completed asynchronously. You can provide a callback to handle the result of the operation, and to perform error handling if necessary. + * Stored procedures and triggers are executed in a time-limited manner. Long-running stored procedures and triggers are defensively timed out and all transactions performed are rolled back. + * We stop queuing collection operations if the stored procedure is close to timing out. You can inspect the boolean return value of all collection operations to see if an operation was not queued and handle this situation gracefully. + */ +interface ICollection extends IQueryAPI { + /** Opening call to start a chained query. Should be used in conjunction with the closing value call to perform chained queries. */ + chain(): IQueryResponse; + + /** + * Create an attachment for the document. + * @param documentLink resource link of the collection under which the document will be created + * @param body metadata that defines the attachment media like media, contentType. It can include any other properties as part of the metedata. + * @param options optional create options + * @param callback optional callback for the operation. If no callback is provided, any error in the operation will be thrown. + */ + createAttachment(documentLink: string, + body: IAttachment, + options?: ICreateOptions, + callback?: (error: IRequestCallbackError, resources: Object, options: IRequestCallbackOptions) => void): boolean; + + /** + * Create a document under the collection. + * @param collectionLink resource link of the collection under which the document will be created + * @param body of the document. The "id" property is required and will be generated automatically if not provided (this behaviour can be overriden using the CreateOptions). Any other properties can be added. + * @param optional create options + * @param optional callback for the operation. If no callback is provided, any error in the operation will be thrown. + */ + createDocument(collectionLink: string, + body: Object, + options?: ICreateOptions, + callback?: (error: IRequestCallbackError, resources: Object, options: IRequestCallbackOptions) => void): boolean; + + /** + * Delete an attachment. + * @param attachmentLink resource link of the attachment to be deleted + * @param options optional delete options. + * @param callback optional callback for the operation. If no callback is provided, any error in the operation will be thrown. + */ + deleteAttachment(attachmentLink: string, + options?: IDeleteOptions, + callback?: (error: IRequestCallbackError, resources: Object, options: IRequestCallbackOptions) => void): boolean; + + /** + * Delete a document. + * @param documentLink resource link of the document to delete + * @param options optional delete options + * @param callback optional callback for the operation. If no callback is provided, any error in the operation will be thrown. + */ + deleteDocument(documentLink: string, + options?: IDeleteOptions, + callback?: (error: IRequestCallbackError, resources: Object, options: IRequestCallbackOptions) => void): boolean; + + /** Get alt link (name-based link) of current collection. */ + getAltLink(): string; + + /** Get self link of current collection. */ + getSelfLink(): string; + + /** + * Execute a SQL query on the attachments for the document. + * @param documentLink resource link of the document whose attachments are being queried + * @param query SQL query string. This can also be a JSON object to pass in a parameterized query along with the values. + * @param options optional query options + * @param callback optional callback for the operation. If no callback is provided, any error in the operation will be thrown. + */ + queryAttachments(documentLink: string, + query: string, + options?: IFeedOptions, + callback?: (error: IFeedCallbackError, resources: Array, options: IFeedCallbackOptions) => void): boolean; + queryAttachments(documentLink: string, + query: IParameterizedQuery, + options?: IFeedOptions, + callback?: (error: IFeedCallbackError, resources: Array, options: IFeedCallbackOptions) => void): boolean; + + /** + * Execute a SQL query on the documents of the collection. + * @param collectionLink resource link of the collection whose documents are being queried + * @param filterQuery SQL query string. This can also be a JSON object to pass in a parameterized query along with the values. + * @param options optional query options. + * @param callback optional callback for the operation. If no callback is provided, any error in the operation will be thrown. + */ + queryDocuments(collectionLink: string, + filterQuery: string, + options?: IFeedOptions, + callback?: (error: IFeedCallbackError, resources: Array, options: IFeedCallbackOptions) => void): boolean; + queryDocuments(collectionLink: string, + filterQuery: string, + options?: IFeedOptions, + callback?: (error: IFeedCallbackError, resources: Array, options: IFeedCallbackOptions) => void): boolean; + queryDocuments(collectionLink: string, + filterQuery: IParameterizedQuery, + options?: IFeedOptions, + callback?: (error: IFeedCallbackError, resources: Array, options: IFeedCallbackOptions) => void): boolean; + queryDocuments(collectionLink: string, + filterQuery: IParameterizedQuery, + options?: IFeedOptions, + callback?: (error: IFeedCallbackError, resources: Array, options: IFeedCallbackOptions) => void): boolean; + + /** + * Read an Attachment. + * @param attachmenLink resource link of the attachment to read + * @param options optional read options + * @param callback optional callback for the operation. If no callback is provided, any error in the operation will be thrown. + */ + readAttachment(attachmenLink: string, + options?: IReadOptions, + callback?: (error: IRequestCallbackError, resources: Object, options: IRequestCallbackOptions) => void): boolean; + + /** + * Get all attachments for the document. + * @param documentLink resource link of the document whose attachments are being read + * @param options optional read feed options + * @param callback optional callback for the operation. If no callback is provided, any error in the operation will be thrown. + */ + readAttachments(documentLink: string, + options?: IFeedOptions, + callback?: (error: IFeedCallbackError, resources: Array, options: IFeedCallbackOptions) => void): boolean; + + /** + * Read a document. + * @param documentLink resource link of the document to read + * @param options optional read options + * @param callback optional callback for the operation. If no callback is provided, any error in the operation will be thrown. + */ + readDocument(documentLink: string, + options?: IReadOptions, + callback?: (error: IRequestCallbackError, resources: Object, options: IRequestCallbackOptions) => void): boolean; + readDocument(documentLink: string, + options?: IReadOptions, + callback?: (error: IRequestCallbackError, resources: T, options: IRequestCallbackOptions) => void): boolean; + + /** + * Get all documents for the collection. + * @param collectionLink resource link of the collection whose documents are being read + * @param options optional read feed options + * @param callback optional callback for the operation. If no callback is provided, any error in the operation will be thrown. + */ + readDocuments(collectionLink: string, + options?: IFeedOptions, + callback?: (error: IFeedCallbackError, resources: Array, options: IFeedCallbackOptions) => void): boolean; + readDocuments(collectionLink: string, + options?: IFeedOptions, + callback?: (error: IFeedCallbackError, resources: Array, options: IFeedCallbackOptions) => void): boolean; + + /** + * Replace an attachment. + * @param attachmentLink resource link of the attachment to be replaced + * @param attachment new attachment body + * @param options optional replace options + * @param callback optional callback for the operation. If no callback is provided, any error in the operation will be thrown. + */ + replaceAttachment(attachmentLink: string, + attachment: Object, + options?: IReplaceOptions, + callback?: (error: IRequestCallbackError, resources: Object, options: IRequestCallbackOptions) => void): boolean; + + /** + * Replace a document. + * @param documentLink resource link of the document + * @param document new document body + * @param options optional replace options + * @param callback optional callback for the operation. If no callback is provided, any error in the operation will be thrown. + */ + replaceDocument(documentLink: string, + document: Object, + options?: IReplaceOptions, + callback?: (error: IRequestCallbackError, resources: Object, options: IRequestCallbackOptions) => void): boolean; +} + +/** Options associated with a create operation. */ +interface ICreateOptions { + /** Specifies indexing directives. */ + indexAction?: string; + /** Disables automatic generation of "id" field of the document to be created (if it is not provided) */ + disableAutomaticIdGeneration?: string; +} + +/** Options associated with a delete operation. */ +interface IDeleteOptions { + /** + * The entity tag associated with the resource. + * This is matched with the persisted resource before deletion. + */ + etag?: string; +} + +/** Will contain error information if an error occurs, undefined otherwise. */ +interface IFeedCallbackError { + /** The HTTP response code corresponding to the error. */ + number: number; + /** A string containing the error information. */ + body: string; +} + +/** Information associated with the response to the operation. */ +interface IFeedCallbackOptions { + /** Opaque token for continuing the read feed or query. */ + continuation: string; + /** Comma delimited string containing the collection's current quota metrics (storage, number of stored procedure, triggers and UDFs) after completion of the operation. */ + currentCollectionSizeInMB: string; + /** Comma delimited string containing the collection's maximum quota metrics (storage, number of stored procedure, triggers and UDFs). */ + maxCollectionSizeInMB: string; +} + +/** Options associated with a read feed or query operation. */ +interface IFeedOptions { + /** + * Max number of items to be returned in the enumeration operation. + * Value is 100 by default + */ + pageSize?: number; + /** Opaque token for continuing the enumeration. */ + continuation?: string; + /** Allow scan on the queries which couldn't be served as indexing was opted out on the requested paths (only for queryDocuments() and queryAttachments()) */ + enableScan?: boolean; + /** Allow order by with low precision (only for queryDocuments(), sortBy() and sortByDescending()) */ + enableLowPrecisionOrderBy?: boolean; +} + +/** + * Object returned from a query function, namely chain, filter, map, pluck, flatten, or value. + * If the query is part of a chained call, then this object can be used to chain further queries until the final terminating value call. + */ +interface IQueryResponse extends IQueryAPI { + /** True if the query has been queued, false if it is not queued because of a pending timeout. */ + isAccepted: boolean; +} + +/** Options associated with a read operation. */ +interface IReadOptions { + /** The conditional HTTP method ifNoneMatch value. */ + ifNoneMatch?: string; +} + +/** Options associated with a replace operation. */ +interface IReplaceOptions { + /** Specifies indexing directives. */ + indexAction?: string; + /** + * The entity tag associated with the resource. + * This is matched with the persisted resource before deletion. + */ + etag?: string; +} + +/** Will contain error information if an error occurs, undefined otherwise. */ +interface IRequestCallbackError { + /** The HTTP response code corresponding to the error. */ + number: number; + /** A string containing the error information. */ + body: string; +} + +/** Information associated with the response to the operation. */ +interface IRequestCallbackOptions { + /** Comma delimited string containing the collection's current quota metrics (storage, number of stored procedure, triggers and UDFs) after completion of the operation. */ + currentCollectionSizeInMB: string; + /** Comma delimited string containing the collection's maximum quota metrics (storage, number of stored procedure, triggers and UDFs). */ + maxCollectionSizeInMB: string; + /** Set to true if the requested resource has not been modified compared to the provided ETag in the ifNoneMatch parameter for a read request. */ + notModified: boolean; +} + +interface IAttachment extends Object { + /** MIME contentType of the attachment */ + contentType: string; + /** media link associated with the attachment content */ + media: string; +} + +interface IDocumentMeta extends Object { + id: string; + _self: string; + _ts: string; + _rid?: string; + _etag?: string; + _attachments?: string; +} + +/** + * The Request object represents the request message that was sent to the server. This includes information about HTTP headers and the body of the HTTP request sent to the server. + * For triggers, the request represents the operation that is executing when the trigger is run. For example, if the trigger is being run ("triggered") on the creation of a document, then + * the request body contains the JSON body of the document to be created. This can be accessed through the request object and (as JSON) can be natively consumed in JavaScript. + * For stored procedures, the request contains information about the request sent to execute the stored procedure. + */ +interface IRequest { + /** + * Gets the request body. + */ + getBody(): Object; + getBody(): T; + /** + * Gets a specified request header value. + * @param key the name of the header to retrieve + */ + getValue(key: string): string; + /** + * Sets the request body. + * Note: this can be only used in a pre-trigger to overwrite the existing request body. + * The overwritten request body will then be used in the operation associated with this pre-trigger. + * @param value the value to set in the request body + */ + setBody(value: string): void; + setBody(value: Object): void; + /** + * Sets a specified request header value. + * Note: this method cannot be used to create new headers. + * @param key the name of the header + * @param value the value of the header + */ + setValue(key: string, value: string): void; +} + +/** + * The Response object represents the response message that will be sent from the server in response to the requested operation. This includes information about the HTTP headers and body of the response from the server. + * The Response object is not present in pre-triggers because they are run before the response is generated. + * For post-triggers, the response represents the operation that was executed before the trigger. For example, if the post-trigger is being run ("triggered") after the creation of a document, then + * the response body contains the JSON body of the document that was created. This can be accessed through the response object and (as JSON) can be natively consumed in JavaScript. + * For stored procedures, the response can be manipulated to send output back to the client-side. + * Note: this object not available in pre-triggers + */ +interface IResponse { + /** + * Gets the response body. + */ + getBody(): Object; + getBody(): T; + /** + * Gets a maximum quota allowed for the resource associated with a post-trigger + * Note: this method is only available in post-triggers + */ + getMaxResourceQuota(): string; + /** + * Gets a current quota usage for the resource associated with a post-trigger + * Note: this method is only available in post-triggers + */ + getResourceQuotaCurrentUsage(): string; + /** + * Gets a specified response header value. + * @param key the name of the header to retrieve + */ + getValue(key: string): string; + /** + * Sets the response body. + * Note: This cannot be done in pre-triggers. + * In post-triggers, the response body is already set with the requested resource and will be overwritten with this call. + * In stored procedures, this call can be used to set the response message body as output to the calling client. + */ + setBody(value: string): void; + setBody(value: Object): void; + /** + * Sets a specified response header value. + * Note: this method cannot be used to create new headers. + * @param key the name of the header + * @param value the value of the header + */ + getValue(key: string, value: string): void; + + appendBody(value: string): void; + appendBody(value: Object): void; +} + +/** Can be used as the query parameter in queryAttachments and queryDocuments. */ +interface IParameterizedQuery { + /** SQL query string. */ + query: string; + /** Parameters */ + parameters: Array; +} + +/** Parameter interface for parameterized queries */ +interface IQueryParam { + /** Name to use in the query */ + name: string; + /** Value of the parameter */ + value: any; +} + +/** List of error codes returned by database operations in the RequestCallback and FeedCallback. See the corresponding error message for more details. */ +interface IErrorCodes { + // Client error + /** (400) Request failed due to bad inputs **/ + BadRequest: number; + /** (403) Request was denied access to the resource **/ + Forbidden: number; + /** (404) Request tried to access a resource which doesn't exist **/ + NotFound: number; + /** (409) Resource with the specified id already exists **/ + Conflict: number; + /** (412) Conditions specified in the request options were not met **/ + PreconditionFailed: number; + /** (413) Request failed because it was too large **/ + RequestEntityTooLarge: number; + /** (449) Request conflicted with the current state of a resource and must be retried from a new transaction from the client side **/ + RetryWith: number; + // Server error + /** (500) Server encountered an unexpected error in processing the request **/ + InternalServerError: number; +} + +declare function getContext(): IContext; +declare var __: I__Object; +declare var ErrorCodes: IErrorCodes; \ No newline at end of file diff --git a/dropzone/dropzone.d.ts b/dropzone/dropzone.d.ts index 50dd433e3..93f9ca25b 100644 --- a/dropzone/dropzone.d.ts +++ b/dropzone/dropzone.d.ts @@ -41,7 +41,7 @@ interface DropzoneOptions { filesizeBase?: number; maxFiles?: number; params?: {}; - headers?: {}, + headers?: {}; clickable?: boolean|string|HTMLElement|(string|HTMLElement)[]; ignoreHiddenFiles?: boolean; acceptedFiles?: string; diff --git a/ejs/ejs-tests.ts b/ejs/ejs-tests.ts new file mode 100644 index 000000000..fd03dd1e0 --- /dev/null +++ b/ejs/ejs-tests.ts @@ -0,0 +1,4 @@ +/// +import ejs = require("ejs"); +var people = ['geddy', 'neil', 'alex']; +var html = ejs.render('<%= people.join(", "); %>', { people: people }); diff --git a/ejs/ejs.d.ts b/ejs/ejs.d.ts new file mode 100644 index 000000000..56e755a46 --- /dev/null +++ b/ejs/ejs.d.ts @@ -0,0 +1,91 @@ +// Type definitions for ejs.js v2.3.3 +// Project: http://ejs.co/ +// Definitions by: Ben Liddicott +// Definitions: https://github.com/borisyankov/DefinitelyTyped + + +declare module "ejs" { + namespace Ejs { + type Data = { [name: string]: any }; + type Dependencies = string[]; + var cache: Cache; + var localsName: string; + function resolveInclude(name: string, filename: string): string; + function compile(template: string, opts?: Options): (TemplateFunction); + function render(template: string, data?: Data, opts?: Options): string; + function renderFile(path: string, data?: Data, opts?: Options, cb?: Function): any;// TODO RenderFileCallback return type + function clearCache(): any; + + function TemplateFunction(data: Data): any; + interface TemplateFunction { + dependencies: Dependencies; + } + interface Options { + cache?: any; + filename?: string; + context?: any; + compileDebug?: boolean; + client?: boolean; + delimiter?: string; + debug?: any; + _with?: boolean; + } + class Template { + constructor(text: string, opts: Options); + opts: Options; + templateText: string; + mode: string; + truncate: boolean; + currentLine: number; + source: string; + dependencies: Dependencies; + createRegex(): RegExp; + compile(): TemplateFunction; + generateSource(): any; + parseTemplateText(): string[]; + scanLine(line: string): any; + + } + module Template { + interface MODES { + EVAL: string; + ESCAPED: string; + RAW: string; + COMMENT: string; + LITERAL: string; + } + } + function escapeRegexChars(s: string): string; + function escapeXML(markup: string): string; + function shallowCopy(to: T1, fro: any): T1; + interface Cache { + _data: { [name: string]: any }; + set(key: string, val: any): any; + get(key: string): any; + } + var cache: Cache; + function resolve(from1: string, to: string): string; + function resolve(from1: string, from2: string, to: string): string; + function resolve(from1: string, from2: string, from3: string, to: string): string; + function resolve(from1: string, from2: string, from3: string, from4: string, to: string): string; + function resolve(from1: string, from2: string, from3: string, from4: string, from5: string, to: string): string; + function resolve(from1: string, from2: string, from3: string, from4: string, from5: string, from6: string, to: string): string; + function resolve(from1: string, from2: string, from3: string, from4: string, from5: string, from6: string, from7: string, to: string): string; + function resolve(from1: string, from2: string, from3: string, from4: string, from5: string, from6: string, from7: string, from8: string, to: string): string; + function resolve(from1: string, from2: string, from3: string, from4: string, from5: string, from6: string, from7: string, from8: string, from9: string, to: string): string; + function resolve(...args: string[]): string; + function normalize(path: string): string; + function isAbsolute(path: string): boolean; + function join(...args: string[]): string; + function relative(from: string, to: string): string; + var sep: string; + var delimiter: string; + function dirname(path: string): string; + function basename(path: string): string; + function extname(path: string): string; + function filter(xs: any, f: any): any; // TODO WHUT? + + + } + export = Ejs; +} \ No newline at end of file diff --git a/express-jwt/express-jwt.d.ts b/express-jwt/express-jwt.d.ts index 615afd2ac..77f296b1f 100644 --- a/express-jwt/express-jwt.d.ts +++ b/express-jwt/express-jwt.d.ts @@ -12,12 +12,22 @@ declare module "express-jwt" { function jwt(options: jwt.Options): jwt.RequestHandler; + interface IDoneCallback { + (err: Error, result: T): void; + } + + type ICallback = (req: express.Request, payload: T, done: IDoneCallback) => void; + module jwt { export interface Options { - secret: string; + secret: string|ICallback; userProperty?: string; skip?: string[]; credentialsRequired?: boolean; + isRevoked?: boolean; + requestProperty?: string; + getToken?: ICallback; + [property: string]: any; } export interface RequestHandler extends express.RequestHandler { unless?: typeof unless; diff --git a/faker/faker-tests.ts b/faker/faker-tests.ts index 94cb3b30a..db953fd83 100644 --- a/faker/faker-tests.ts +++ b/faker/faker-tests.ts @@ -1,156 +1,173 @@ /// +let resultStr: string; +let resultBool: boolean; +let resultNum: number; +let resultStrArr: string[]; +let resultDate: Date; + import faker = require('faker'); +faker.locale = 'en'; -faker.address.zipCode(); -faker.address.zipCode('###'); -faker.address.city(); -faker.address.city(0); -faker.address.cityPrefix(); -faker.address.citySuffix(); -faker.address.streetName(); -faker.address.streetAddress(); -faker.address.streetAddress(false);; -faker.address.streetSuffix(); -faker.address.streetPrefix(); -faker.address.secondaryAddress(); -faker.address.county(); -faker.address.country(); -faker.address.countryCode(); -faker.address.state(); -faker.address.state(false); -faker.address.stateAbbr(); -faker.address.latitude(); -faker.address.longitude(); +resultStr = faker.address.zipCode(); +resultStr = faker.address.zipCode('###'); +resultStr = faker.address.city(); +resultStr = faker.address.city(0); +resultStr = faker.address.cityPrefix(); +resultStr = faker.address.citySuffix(); +resultStr = faker.address.streetName(); +resultStr = faker.address.streetAddress(); +resultStr = faker.address.streetAddress(false);; +resultStr = faker.address.streetSuffix(); +resultStr = faker.address.streetPrefix(); +resultStr = faker.address.secondaryAddress(); +resultStr = faker.address.county(); +resultStr = faker.address.country(); +resultStr = faker.address.countryCode(); +resultStr = faker.address.state(); +resultStr = faker.address.state(false); +resultStr = faker.address.stateAbbr(); +resultStr = faker.address.latitude(); +resultStr = faker.address.longitude(); -faker.commerce.color(); -faker.commerce.department(); -faker.commerce.productName(); -faker.commerce.price(); -faker.commerce.price(0, 0, 0, '#'); -faker.commerce.productAdjective(); -faker.commerce.productMaterial(); -faker.commerce.product(); +resultStr = faker.commerce.color(); +resultStr = faker.commerce.department(); +resultStr = faker.commerce.productName(); +resultStr = faker.commerce.price(); +resultStr = faker.commerce.price(0, 0, 0, '#'); +resultStr = faker.commerce.productAdjective(); +resultStr = faker.commerce.productMaterial(); +resultStr = faker.commerce.product(); -faker.company.suffixes(); -faker.company.companyName(); -faker.company.companyName(0); -faker.company.companySuffix(); -faker.company.catchPhrase(); -faker.company.bs(); -faker.company.catchPhraseAdjective(); -faker.company.catchPhraseDescriptor(); -faker.company.catchPhraseNoun(); -faker.company.bsAdjective(); -faker.company.bsBuzz(); -faker.company.bsNoun(); +resultStrArr = faker.company.suffixes(); +resultStr = faker.company.companyName(); +resultStr = faker.company.companyName(0); +resultStr = faker.company.companySuffix(); +resultStr = faker.company.catchPhrase(); +resultStr = faker.company.bs(); +resultStr = faker.company.catchPhraseAdjective(); +resultStr = faker.company.catchPhraseDescriptor(); +resultStr = faker.company.catchPhraseNoun(); +resultStr = faker.company.bsAdjective(); +resultStr = faker.company.bsBuzz(); +resultStr = faker.company.bsNoun(); -faker.date.past(); -faker.date.future(); -faker.date.between('foo', 'bar'); -faker.date.between(new Date(), new Date()); -faker.date.recent(); -faker.date.recent(100); -faker.date.month(); -faker.date.month({ +resultDate = faker.date.past(); +resultDate = faker.date.future(); +resultDate = faker.date.between('foo', 'bar'); +resultDate = faker.date.between(new Date(), new Date()); +resultDate = faker.date.recent(); +resultDate = faker.date.recent(100); +resultStr = faker.date.month(); +resultStr = faker.date.month({ abbr: true, context: true }); -faker.date.weekday(); -faker.date.weekday({ +resultStr = faker.date.weekday(); +resultStr = faker.date.weekday({ abbr: true, context: true }); -faker.finance.account(); -faker.finance.account(0); -faker.finance.accountName(); -faker.finance.mask(); -faker.finance.mask(0, false, false); -faker.finance.amount(); -faker.finance.amount(0, 0, 0, '#'); -faker.finance.transactionType(); -faker.finance.currencyCode(); -faker.finance.currencyName(); -faker.finance.currencySymbol(); +resultStr = faker.finance.account(); +resultStr = faker.finance.account(0); +resultStr = faker.finance.accountName(); +resultStr = faker.finance.mask(); +resultStr = faker.finance.mask(0, false, false); +resultStr = faker.finance.amount(); +resultStr = faker.finance.amount(0, 0, 0, '#'); +resultStr = faker.finance.transactionType(); +resultStr = faker.finance.currencyCode(); +resultStr = faker.finance.currencyName(); +resultStr = faker.finance.currencySymbol(); -faker.hacker.abbreviation(); -faker.hacker.adjective(); -faker.hacker.noun(); -faker.hacker.verb(); -faker.hacker.ingverb(); -faker.hacker.phrase(); +resultStr = faker.hacker.abbreviation(); +resultStr = faker.hacker.adjective(); +resultStr = faker.hacker.noun(); +resultStr = faker.hacker.verb(); +resultStr = faker.hacker.ingverb(); +resultStr = faker.hacker.phrase(); -faker.helpers.randomize(); -faker.helpers.randomize([1,2,3,4]); -faker.helpers.randomize(['foo', 'bar', 'quux']); -faker.helpers.slugify('foo bar quux'); -faker.helpers.replaceSymbolWithNumber('foo# bar#'); -faker.helpers.replaceSymbols('foo# bar? quux#'); -faker.helpers.shuffle(['foo', 'bar', 'quux']); -faker.helpers.mustache('{{foo}}{{bar}}', {foo: 'x', bar: 'y'}); -faker.helpers.createCard(); -faker.helpers.contextualCard(); -faker.helpers.userCard(); +resultStr = faker.helpers.randomize(); +resultNum = faker.helpers.randomize([1,2,3,4]); +resultStr = faker.helpers.randomize(['foo', 'bar', 'quux']); +resultStr = faker.helpers.slugify('foo bar quux'); +resultStr = faker.helpers.replaceSymbolWithNumber('foo# bar#'); +resultStr = faker.helpers.replaceSymbols('foo# bar? quux#'); +resultStrArr = faker.helpers.shuffle(['foo', 'bar', 'quux']); +resultStr = faker.helpers.mustache('{{foo}}{{bar}}', {foo: 'x', bar: 'y'}); -faker.internet.avatar(); -faker.internet.email(); -faker.internet.email('foo', 'bar', 'quux'); -faker.internet.protocol(); -faker.internet.url(); -faker.internet.domainName(); -faker.internet.domainSuffix(); -faker.internet.domainWord(); -faker.internet.ip(); -faker.internet.userAgent(); -faker.internet.color(); -faker.internet.color(0, 0, 0); -faker.internet.mac(); -faker.internet.password(); -faker.internet.password(0, false, '#', 'foo'); +const card = faker.helpers.createCard(); +resultStr = card.name; +resultStr = card.address.streetA; +const contextualCard = faker.helpers.contextualCard(); +resultStr = contextualCard.name; +resultStr = contextualCard.address.suite; +const userCard = faker.helpers.userCard(); +resultStr = userCard.name; +resultStr = userCard.address.suite; -faker.lorem.words(); -faker.lorem.words(0); -faker.lorem.sentence(); -faker.lorem.sentence(0, 0); -faker.lorem.sentences(); -faker.lorem.sentences(0); -faker.lorem.paragraph(); -faker.lorem.paragraph(0); -faker.lorem.paragraphs(); -faker.lorem.paragraphs(0, ''); +resultStr = faker.internet.avatar(); +resultStr = faker.internet.email(); +resultStr = faker.internet.email('foo', 'bar', 'quux'); +resultStr = faker.internet.protocol(); +resultStr = faker.internet.url(); +resultStr = faker.internet.domainName(); +resultStr = faker.internet.domainSuffix(); +resultStr = faker.internet.domainWord(); +resultStr = faker.internet.ip(); +resultStr = faker.internet.userAgent(); +resultStr = faker.internet.color(); +resultStr = faker.internet.color(0, 0, 0); +resultStr = faker.internet.mac(); +resultStr = faker.internet.password(); +resultStr = faker.internet.password(0, false, '#', 'foo'); -faker.name.firstName(); -faker.name.firstName(0); -faker.name.lastName(); -faker.name.lastName(0); -faker.name.findName(); -faker.name.findName('', '', 0); -faker.name.jobTitle(); -faker.name.prefix(); -faker.name.suffix(); -faker.name.title(); -faker.name.jobDescriptor(); -faker.name.jobArea(); -faker.name.jobType(); +resultStrArr = faker.lorem.words(); +resultStrArr = faker.lorem.words(0); +resultStr = faker.lorem.sentence(); +resultStr = faker.lorem.sentence(0, 0); +resultStr = faker.lorem.sentences(); +resultStr = faker.lorem.sentences(0); +resultStr = faker.lorem.paragraph(); +resultStr = faker.lorem.paragraph(0); +resultStr = faker.lorem.paragraphs(); +resultStr = faker.lorem.paragraphs(0, ''); -faker.phone.phoneNumber(); -faker.phone.phoneNumber('#'); -faker.phone.phoneNumberFormat(); +resultStr = faker.name.firstName(); +resultStr = faker.name.firstName(0); +resultStr = faker.name.lastName(); +resultStr = faker.name.lastName(0); +resultStr = faker.name.findName(); +resultStr = faker.name.findName('', '', 0); +resultStr = faker.name.jobTitle(); +resultStr = faker.name.prefix(); +resultStr = faker.name.suffix(); +resultStr = faker.name.title(); +resultStr = faker.name.jobDescriptor(); +resultStr = faker.name.jobArea(); +resultStr = faker.name.jobType(); + +resultStr = faker.phone.phoneNumber(); +resultStr = faker.phone.phoneNumber('#'); +resultStr = faker.phone.phoneNumberFormat(); // https://github.com/Marak/faker.js/blob/master/lib/phone_number.js#L9-L13 -faker.phone.phoneNumberFormat(0); -faker.phone.phoneFormats(); +resultStr = faker.phone.phoneNumberFormat(0); +resultStr = faker.phone.phoneFormats(); -faker.random.number(); -faker.random.number(0); -faker.random.number({ +resultNum = faker.random.number(); +resultNum = faker.random.number(0); +resultNum = faker.random.number({ min: 0, max: 0, precision: 0 }); -faker.random.arrayElement(); -faker.random.arrayElement(['foo', 'bar', 'quux']) -faker.random.objectElement(); -faker.random.objectElement({foo: 'bar', field: 'foo'}); -faker.random.uuid(); -faker.random.boolean(); \ No newline at end of file +resultStr = faker.random.arrayElement(); +resultStr = faker.random.arrayElement(['foo', 'bar', 'quux']) +resultStr = faker.random.objectElement(); +resultStr = faker.random.objectElement({foo: 'bar', field: 'foo'}); +resultStr = faker.random.uuid(); +resultBool = faker.random.boolean(); + +import fakerEn = require('faker/locale/en'); +resultStr = faker.name.firstName(); diff --git a/faker/faker.d.ts b/faker/faker.d.ts index b337c093e..6397dd993 100644 --- a/faker/faker.d.ts +++ b/faker/faker.d.ts @@ -1,58 +1,223 @@ // Type definitions for faker // Project: http://marak.com/faker.js/ -// Definitions by: Bas Pennings +// Definitions by: Bas Pennings , Yuki Kokubun // Definitions: https://github.com/borisyankov/DefinitelyTyped +declare var fakerStatic: Faker.FakerStatic; + declare module Faker { + interface FakerStatic { + locale: string; + + address: { + zipCode(format?: string): string; + city(format?: number): string; + cityPrefix(): string; + citySuffix(): string; + streetName(): string; + streetAddress(useFullAddress?: boolean): string; + streetSuffix(): string; + streetPrefix(): string; + secondaryAddress(): string; + county(): string; + country(): string; + countryCode(): string; + state(useAbbr?: boolean): string; + stateAbbr(): string; + latitude(): string; + longitude(): string; + }; + + commerce: { + color(): string; + department(): string; + productName(): string; + price(min?: number, max?: number, dec?: number, symbol?: string): string; + productAdjective(): string; + productMaterial(): string; + product(): string; + }; + + company: { + suffixes(): string[]; + companyName(format?: number): string; + companySuffix(): string; + catchPhrase(): string; + bs(): string; + catchPhraseAdjective(): string; + catchPhraseDescriptor(): string; + catchPhraseNoun(): string; + bsAdjective(): string; + bsBuzz(): string; + bsNoun(): string; + }; + + date: { + past(years?: number, refDate?: string|Date): Date; + future(years?: number, refDate?: string|Date): Date; + between(from: string|number|Date, to: string|Date): Date; + recent(days?: number): Date; + month(options?: { abbr?: boolean, context?: boolean }): string; + weekday(options?: { abbr?: boolean, context?: boolean }): string; + }; + + fake(str: string): string; + + finance: { + account(length?: number): string; + accountName(): string; + mask(length?: number, parens?: boolean, elipsis?: boolean): string; + amount(min?:number, max?: number, dec?: number, symbol?: string): string; + transactionType(): string; + currencyCode(): string; + currencyName(): string; + currencySymbol(): string; + }; + + hacker: { + abbreviation(): string; + adjective(): string; + noun(): string; + verb(): string; + ingverb(): string; + phrase(): string; + }; + + helpers: { + randomize(array: T[]): T; + randomize(): string; + slugify(string?: string): string; + replaceSymbolWithNumber(string?: string, symbol?: string): string; + replaceSymbols(string?: string): string; + shuffle(o: T[]): T[]; + shuffle(): string[]; + mustache(str: string, data: { [key: string]: string|((substring: string, ...args: any[]) => string) }): string; + createCard(): Faker.Card; + contextualCard(): Faker.ContextualCard; + userCard(): Faker.UserCard; + createTransaction(): Faker.Transaction; + }; + + + image: { + image(): string; + avatar(): string; + imageUrl(width?: number, height?: number, category?: string): string; + abstract(width?: number, height?: number): string; + animals(width?: number, height?: number): string; + business(width?: number, height?: number): string; + cats(width?: number, height?: number): string; + city(width?: number, height?: number): string; + food(width?: number, height?: number): string; + nightlife(width?: number, height?: number): string; + fashion(width?: number, height?: number): string; + people(width?: number, height?: number): string; + nature(width?: number, height?: number): string; + sports(width?: number, height?: number): string; + technics(width?: number, height?: number): string; + transport(width?: number, height?: number): string; + }; + + internet: { + avatar(): string; + email(firstName?: string, lastName?: string, provider?: string): string; + userName(firstName?: string, lastName?: string): string; + protocol(): string; + url(): string; + domainName(): string; + domainSuffix(): string; + domainWord(): string; + ip(): string; + userAgent(): string; + color(baseRed255?: number, baseGreen255?: number, baseBlue255?: number): string; + mac(): string; + password(len?: number, memorable?: boolean, pattern?: string|RegExp, prefix?: string): string; + }; + + lorem: { + words(num?: number): string[]; + sentence(wordCount?: number, range?: number): string; + sentences(sentenceCount?: number): string; + paragraph(sentenceCount?: number): string; + paragraphs(paragraphCount?: number, separator?: string): string; + }; + + name: { + firstName(gender?: number): string; + lastName(gender?: number): string; + findName(firstName?: string, lastName?: string, gender?: number): string; + jobTitle(): string; + prefix(): string; + suffix(): string; + title(): string; + jobDescriptor(): string; + jobArea(): string; + jobType(): string; + }; + + phone: { + phoneNumber(format?: string): string; + phoneNumberFormat(phoneFormatsArrayIndex?: number): string; + phoneFormats(): string; + }; + + random: { + number(max: number): number; + number(options?: { min?: number, max?: number, precision?: number }): number; + arrayElement(): string; + arrayElement(array: T[]): T; + objectElement(object?: { [key: string]: any }, field?: "key"): string; + objectElement(object?: { [key: string]: T }, field?: any): T; + uuid(): string; + boolean(): boolean; + }; + } + + interface Card { + name: string; + username: string; + email: string; + address: FullAddress; + phone: string; + website: string; + company: Company; + posts: Post[]; + accountHistory: string[]; + } + + interface FullAddress { + streetA: string; + streetB: string; + streetC: string; + streetD: string; + city: string; + state: string; + county: string; + zipcode: string; + geo: Geo; + } + + interface Geo { + lat: string; + lng: string; + } + + interface Company { + name: string; + catchPhrase: string; + bs: string; + } + interface Post { words: string; sentence: string; sentences: string; paragraph: string; } - - interface Address { - street: string; - suite: string; - city: string; - zipcode: string; - geo: { - lat: string; - lon: string - } - } - - interface Transaction { - amount: number, - date: Date, - business: string, - name: string, - type: string, - account: string - } - - interface Company { - name: string; - catchPhrase: string; - bs: string; - } - - interface Card { - name: string; - username: string; - email: string; - address: Address; - phone: string, - website: string, - company: Company; - posts: Post[], - accountHistory: Transaction[] - } - + interface ContextualCard { name: string; username: string; - avatar: string; email: string; dob: Date; phone: string; @@ -60,7 +225,16 @@ declare module Faker { website: string; company: Company; } - + + interface Address { + street: string; + suite: string; + city: string; + state: string; + zipcode: string; + geo: Geo; + } + interface UserCard { name: string; username: string; @@ -70,191 +244,157 @@ declare module Faker { website: string; company: Company; } - - interface AddressGenerators { - zipCode(format?: string): string; - city(format?: number): string; - cityPrefix(): string; - citySuffix(): string; - streetName(): string; - streetAddress(useFullAddress?: boolean): string; - streetSuffix(): string; - streetPrefix(): string; - secondaryAddress(): string; - county(): string; - country(): string; - countryCode(): string; - state(useAbbr?: boolean): string; - stateAbbr(): string; - latitude(): string; - longitude(): string; + + interface Transaction { + amount: string; + date: Date; + business: string; + name: string; + type: string; + account: string; } - - interface CommerceGenerators { - color(): string; - department(): string; - productName(): string; - price(min?: number, max?: number, dec?: number, symbol?: string): string; - productAdjective(): string; - productMaterial(): string; - product(): string; - } - - interface CompanyGenerators { - suffixes(): string[]; - companyName(format?: number): string; - companySuffix(): string; - catchPhrase(): string; - bs(): string; - catchPhraseAdjective(): string; - catchPhraseDescriptor(): string; - catchPhraseNoun(): string; - bsAdjective(): string; - bsBuzz(): string; - bsNoun(): string; - } - - interface DateGenerators { - past(years?: number, refDate?: Date|string): Date; - future(years?: number, refDate?: Date|string): Date; - between(from: Date|string, to: Date|string): Date; - recent(days?: number): Date; - month(options?: { - abbr?: boolean, - context?: boolean - }): string; - weekday(options?: { - abbr?: boolean, - context?: boolean - }): string; - } - - interface FinanceGenerators { - account(length?: number): string; - accountName(): string; - mask(length?: number, parens?: boolean, elipsis?: boolean): string; - amount(min?: number, max?: number, dec?: number, symbol?: string): string; - transactionType(): string; - currencyCode(): string; - currencyName(): string; - currencySymbol(): string; - } - - interface HackerGenerators { - abbreviation(): string; - adjective(): string; - noun(): string; - verb(): string; - ingverb(): string; - phrase(): string; - } - - interface Helpers { - randomize(array?: Array): T; - slugify(str: string): string; - replaceSymbolWithNumber(s: string, symbol?: string): string; - replaceSymbols(str: string): string; - shuffle(array: Array): Array; - mustache(str: string, data: Object): string; - createCard(): Card; - contextualCard(): Card; - userCard(): UserCard; - createTransaction(): Transaction; - } - - interface ImageGenerators { - image(): string; - avator(): string; - imageUrl(width?: number, height?: number, category?: string): string; - abstract(width?: number, height?: number): string; - animals(width?: number, height?: number): string; - business(width?: number, height?: number): string; - cats(width?: number, height?: number): string; - city(width?: number, height?: number): string; - food(width?: number, height?: number): string; - nightlife(width?: number, height?: number): string; - fashion(width?: number, height?: number): string; - people(width?: number, height?: number): string; - nature(width?: number, height?: number): string; - sports(width?: number, height?: number): string; - technics(width?: number, height?: number): string; - transport(width?: number, height?: number): string; - } - - interface InternetGenerators { - avatar(): string; - email(firstName?: string, lastName?: string, provider?: string): string; - userName(firstName?: string, lastName?: string): string; - protocol(): string; - url(): string; - domainName(): string; - domainSuffix(): string; - domainWord(): string; - ip(): string; - userAgent(): string; - color(baseRed255?: number, baseGreen255?: number, baseBlue255?: number): string; - mac(): string; - password(len?: number, memorable?: boolean, pattern?: string, prefix?: string): string; - } - - interface LoremGenerators { - words(num?: number): string[]; - sentence(wordCount?: number, range?: number): string; - sentences(sentenceCount?: number): string; - paragraph(sentenceCount?: number): string; - paragraphs(paragraphCount?: number, separator?: string): string; - } - - interface NameGenerators { - firstName(gender?: number): string; - lastName(gender?: number): string; - findName(firstName?: string, lastName?: string, gender?: number): string; - jobTitle(): string; - prefix(): string; - suffix(): string; - title(): string; - jobDescriptor(): string; - jobArea(): string; - jobType(): string; - } - - interface PhoneGenerators { - phoneNumber(format?: string): string; - // https://github.com/Marak/faker.js/blob/master/lib/phone_number.js#L9-L13 - phoneNumberFormat(phoneFormatsArrayIndex?: number): string; - phoneFormats(): string; - } - - interface RandomGenerators { - number(max: number): number; - number(options?: { - min?: number, - max?: number, - precision?: number - }): number; - arrayElement(array?: Array): T; - objectElement(object?: Object, field?: string): any; - uuid(): string; - boolean(): boolean; - } } declare module "faker" { - var faker: { - address: Faker.AddressGenerators; - commerce: Faker.CommerceGenerators; - company: Faker.CompanyGenerators; - date: Faker.DateGenerators; - finance: Faker.FinanceGenerators; - hacker: Faker.HackerGenerators; - helpers: Faker.Helpers; - image: Faker.ImageGenerators; - internet: Faker.InternetGenerators; - lorem: Faker.LoremGenerators; - name: Faker.NameGenerators; - phone: Faker.PhoneGenerators; - random: Faker.RandomGenerators; - } - - export = faker; + export = fakerStatic; +} + +declare module "faker/locale/de" { + export = fakerStatic; +} + +declare module "faker/locale/de_AT" { + export = fakerStatic; +} + +declare module "faker/locale/de_CH" { + export = fakerStatic; +} + +declare module "faker/locale/el_GR" { + export = fakerStatic; +} + +declare module "faker/locale/en" { + export = fakerStatic; +} + +declare module "faker/locale/en_AU" { + export = fakerStatic; +} + +declare module "faker/locale/en_BORK" { + export = fakerStatic; +} + +declare module "faker/locale/en_CA" { + export = fakerStatic; +} + +declare module "faker/locale/en_GB" { + export = fakerStatic; +} + +declare module "faker/locale/en_IE" { + export = fakerStatic; +} + +declare module "faker/locale/en_IND" { + export = fakerStatic; +} + +declare module "faker/locale/en_US" { + export = fakerStatic; +} + +declare module "faker/locale/en_au_ocker" { + export = fakerStatic; +} + +declare module "faker/locale/es" { + export = fakerStatic; +} + +declare module "faker/locale/es_MX" { + export = fakerStatic; +} + +declare module "faker/locale/fa" { + export = fakerStatic; +} + +declare module "faker/locale/fr" { + export = fakerStatic; +} + +declare module "faker/locale/fr_CA" { + export = fakerStatic; +} + +declare module "faker/locale/ge" { + export = fakerStatic; +} + +declare module "faker/locale/it" { + export = fakerStatic; +} + +declare module "faker/locale/ja" { + export = fakerStatic; +} + +declare module "faker/locale/ko" { + export = fakerStatic; +} + +declare module "faker/locale/nb_NO" { + export = fakerStatic; +} + +declare module "faker/locale/nep" { + export = fakerStatic; +} + +declare module "faker/locale/nl" { + export = fakerStatic; +} + +declare module "faker/locale/pl" { + export = fakerStatic; +} + +declare module "faker/locale/pt_BR" { + export = fakerStatic; +} + +declare module "faker/locale/ru" { + export = fakerStatic; +} + +declare module "faker/locale/sk" { + export = fakerStatic; +} + +declare module "faker/locale/sv" { + export = fakerStatic; +} + +declare module "faker/locale/tr" { + export = fakerStatic; +} + +declare module "faker/locale/uk" { + export = fakerStatic; +} + +declare module "faker/locale/vi" { + export = fakerStatic; +} + +declare module "faker/locale/zh_CN" { + export = fakerStatic; +} + +declare module "faker/locale/zh_TW" { + export = fakerStatic; } diff --git a/featherlight/featherlight-tests.ts b/featherlight/featherlight-tests.ts new file mode 100644 index 000000000..ed74a201e --- /dev/null +++ b/featherlight/featherlight-tests.ts @@ -0,0 +1,169 @@ +// Tests by: Kaur Kuut + +/// +/// + +// Every option as default +var defaultOptions = { + namespace: 'featherlight', + targetAttr: 'data-featherlight', + variant: null as string, + resetCss: false, + background: null as string, + openTrigger: 'click', + closeTrigger: 'click', + filter: null as string, + root: 'body', + openSpeed: 250, + closeSpeed: 250, + closeOnClick: 'background', + closeOnEsc: true, + closeIcon: '✕', + loading: '', + persist: false, + otherClose: null as string, + beforeOpen: $.noop, + beforeContent: $.noop, + beforeClose: $.noop, + afterOpen: $.noop, + afterContent: $.noop, + afterClose: $.noop, + onKeyUp: $.noop, + onResize: $.noop, + type: null as string, + contentFilters: ['jquery', 'image', 'html', 'ajax', 'iframe', 'text'] +}; + +// Every option changed +var changedOptions = { + namespace: 'foo', + targetAttr: 'foo', + variant: 'foo', + resetCss: true, + background: '
', + openTrigger: 'focus', + closeTrigger: 'blur', + filter: 'foo', + root: 'foo', + openSpeed: 'fast', + closeSpeed: 'fast', + closeOnClick: false, + closeOnEsc: false, + closeIcon: 'foo', + loading: 'foo', + persist: 'shared', + otherClose: 'foo', + beforeOpen: (e: JQueryEventObject) => false, + beforeContent: (e: JQueryEventObject) => false, + beforeClose: (e: JQueryEventObject) => false, + afterOpen: (e: JQueryEventObject) => false, + afterContent: (e: JQueryEventObject) => false, + afterClose: (e: JQueryEventObject) => false, + onKeyUp: (e: JQueryEventObject) => false, + onResize: (e: JQueryEventObject) => false, + type: 'text' +}; + +// Turn off auto bind +$.featherlight.autoBind = false; + +// Change some defaults +$.featherlight.defaults.namespace = 'foo'; +$.featherlight.defaults.openSpeed = 500; +$.featherlight.defaults.persist = true; +$.featherlight.defaults.text = 'foo'; + +// Do the simplest manual bind +$('#id').featherlight(); + +// Bind #id to open #fl +$('#id').featherlight('#fl'); + +// Bind #id to open #fl with persistance +$('#id').featherlight('#fl', {persist: true}); + +// Bind #id to open jQuery object +$('#id').featherlight($('Foo!')); + +// Bind #id to open jQuery object with persistance +$('#id').featherlight($('Foo!'), {persist: true}); + +// Bind #id to open #fl with every option set to default +$('#id').featherlight('#fl', defaultOptions); + +// Bind #id to open jQuery object with every option set to default +$('#id').featherlight($('Foo!'), defaultOptions); + +// Bind #id to open #fl with every option changed +$('#id').featherlight('#fl', changedOptions); + +// Bind #id to open jQuery object with every option changed +$('#id').featherlight($('Foo!'), changedOptions); + +// Open the default +$.featherlight(); +new $.featherlight; + +// Open just text +$.featherlight({text: 'Foo!'}).open(); +new $.featherlight({text: 'Foo!'}).open(); + +// Open #fl, and close it +$.featherlight('#fl').close(); +new $.featherlight('#fl').close(); + +// Open #fl with persistance, and close it +$.featherlight('#fl', {persist: true}).close(); +new $.featherlight('#fl', {persist: true}).close(); + +// Open jQuery object, and close it +$.featherlight($('Foo!')).close(); +new $.featherlight($('Foo!')).close(); + +// Open jQuery object with persistance, and close it +$.featherlight($('Foo!'), {persist: true}).close(); +new $.featherlight($('Foo!'), {persist: true}).close(); + +// Open #fl with every option set to default, and close it +$.featherlight('#fl', defaultOptions).close(); +new $.featherlight('#fl', defaultOptions).close(); + +// Open jQuery object with every option set to default, and close it +$.featherlight($('Foo!'), defaultOptions).close(); +new $.featherlight($('Foo!'), defaultOptions).close(); + +// Open #fl with every option changed, and close it +$.featherlight('#fl', changedOptions).close(); +new $.featherlight('#fl', changedOptions).close(); + +// Open jQuery object with every option changed, and close it +$.featherlight($('Foo!'), changedOptions).close(); +new $.featherlight($('Foo!'), changedOptions).close(); + +// Define a custom content filter +// Note: Unfortunately $.featherlight.contentFilters.feed = .. doesn't seem to work +$.featherlight.contentFilters['feed'] = { + regex: /^feed:/, + process: function(url: string) { return $('Loading...'); } +}; + +// Close the currently open fl +$.featherlight.close(); + +// Get all the opened fls and close the first +$.featherlight.opened()[0].close(); + +// Get the currently opened fl +var fl = $.featherlight.current(); + +// .. and close it +fl.close(); + +// .. and open it once more +fl.open(); + +// .. and edit its namespace +fl.namespace = 'foo'; + +// .. and add a special event handler +fl.afterClose = (e: JQueryEventObject) => false; diff --git a/featherlight/featherlight.d.ts b/featherlight/featherlight.d.ts new file mode 100644 index 000000000..ad4c1d1c2 --- /dev/null +++ b/featherlight/featherlight.d.ts @@ -0,0 +1,114 @@ +// Type definitions for Featherlight v1.3.4 +// Project: https://noelboss.github.io/featherlight/ +// Definitions by: Kaur Kuut +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module Featherlight { + interface Config { + namespace?: string; + targetAttr?: string; + variant?: string; + resetCss?: boolean; + background?: string; + openTrigger?: string; + closeTrigger?: string; + filter?: string; + root?: string; + openSpeed?: number | string; + closeSpeed?: number | string; + closeOnClick?: boolean | string; + closeOnEsc?: boolean; + closeIcon?: string; + loading?: string; + persist?: boolean | string; + otherClose?: string; + beforeOpen?: (event: JQueryEventObject) => any; + beforeContent?: (event: JQueryEventObject) => any; + beforeClose?: (event: JQueryEventObject) => any; + afterOpen?: (event: JQueryEventObject) => any; + afterContent?: (event: JQueryEventObject) => any; + afterClose?: (event: JQueryEventObject) => any; + onKeyUp?: (event: JQueryEventObject) => any; + onResize?: (event: JQueryEventObject) => any; + type?: string; + contentFilters?: any; + jquery?: JQuery; + image?: string; + html?: string; + ajax?: string; + text?: string; + } + + interface ContentFilter { + regex?: RegExp; + test?(data: JQuery | string): boolean; + process?(data: JQuery | string): JQuery | JQueryPromise; + } + + interface ContentFilters { + [name: string]: ContentFilter; + } + + interface Featherlight extends Config { + target: JQuery | string; + $instance: JQuery; + $content: JQuery; + + setup(target: JQuery, config?: Config): Featherlight; + setup(target: string, config?: Config): Featherlight; + setup(config: Config): Featherlight; + setup(): Featherlight; + + getContent(): JQuery | JQueryPromise; + setContent($content: JQuery): Featherlight; + setContent($content: JQueryPromise): Featherlight; + open(event?: JQueryEventObject): JQueryPromise; + close(event?: JQueryEventObject): JQueryPromise; + } + + interface FeatherlightStatic { + ($content: JQuery, config?: Config): Featherlight; + ($content: string, config?: Config): Featherlight; + (config: Config): Featherlight; + (): Featherlight; + + new($content: JQuery, config?: Config): Featherlight; + new($content: string, config?: Config): Featherlight; + new(config: Config): Featherlight; + new(): Featherlight; + + attach($source: JQuery, $content: JQuery, config?: Config): JQuery; + attach($source: JQuery, $content: string, config?: Config): JQuery; + attach($source: JQuery, config: Config): JQuery; + attach($source: JQuery): JQuery; + + id: number; + autoBind: boolean | string; + defaults: Config; + contentFilters: ContentFilters; + functionAttributes: string[]; + + readElementConfig(element: HTMLElement, namespace: string): any; + extend(child: any, defaults: any): any; + current(): Featherlight; + opened(): Featherlight[]; + close(): JQueryPromise; + } + + interface JQueryExtension { + ($content: JQuery, config?: Config): JQuery; + ($content: string, config?: Config): JQuery; + (config: Config): JQuery; + (): JQuery; + } +} + +interface JQueryStatic { + featherlight: Featherlight.FeatherlightStatic; +} + +interface JQuery { + featherlight: Featherlight.JQueryExtension; +} diff --git a/geoip-lite/geoip-lite-tests.ts b/geoip-lite/geoip-lite-tests.ts new file mode 100644 index 000000000..fb809369b --- /dev/null +++ b/geoip-lite/geoip-lite-tests.ts @@ -0,0 +1,19 @@ +/// + +// require geoip-lite +import geoip = require('geoip-lite'); + +// lookup an IP addres +var geo = geoip.lookup('199.16.156.125'); + +// convert the ip block range to string +if (geo) { + let rangeStart = geoip.pretty(geo.range[0]); + let rangeEnd = geoip.pretty(geo.range[1]); +} + +// start the data update watcher +geoip.startWatchingDataUpdate(); + +// stop the data update watcher +geoip.stopWatchingDataUpdate(); diff --git a/geoip-lite/geoip-lite.d.ts b/geoip-lite/geoip-lite.d.ts new file mode 100644 index 000000000..7e5057d49 --- /dev/null +++ b/geoip-lite/geoip-lite.d.ts @@ -0,0 +1,22 @@ +// Type definitions for GeoIP-lite 1.1.6 +// Project: https://github.com/bluesmoon/node-geoip +// Definitions by: Yuce Tekol +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module 'geoip-lite' { + module mod { + export interface Lookup { + range: Array; // range start, end + country: string; + region: string; + city: string; + ll: Array; // latitude, longitude + } + + export function lookup(ip: string): Lookup; + export function pretty(ip: number): string; + export function startWatchingDataUpdate(): void; + export function stopWatchingDataUpdate(): void; + } + export = mod; +} diff --git a/gulp-task-listing/gulp-task-listing-tests.ts b/gulp-task-listing/gulp-task-listing-tests.ts new file mode 100644 index 000000000..7d2c293d3 --- /dev/null +++ b/gulp-task-listing/gulp-task-listing-tests.ts @@ -0,0 +1,15 @@ +/// +/// + +import gulp = require('gulp'); +import gulpTaskListing = require('gulp-task-listing'); + +gulp.task('help-default', gulpTaskListing); +gulp.task('help-subTaskRegexFilter', gulpTaskListing.withFilters(/\d+/)); +gulp.task('help-subTaskFunctionFilter', gulpTaskListing.withFilters(task => task.length > 3)); +gulp.task('help-excludeRegexFilter', gulpTaskListing.withFilters(null, /\w+/)); +gulp.task('help-excludeFunctionFilter', gulpTaskListing.withFilters(null, task => task.length < 2)); +gulp.task('help-bothFilters1', gulpTaskListing.withFilters(/\d+/, /\w+/)); +gulp.task('help-bothFilters2', gulpTaskListing.withFilters(/\d+/, task => task.length > 3)); +gulp.task('help-bothFilters3', gulpTaskListing.withFilters(task => task.length < 2, /\w+/)); +gulp.task('help-bothFilters4', gulpTaskListing.withFilters(task => task.length < 2, task => task.length > 3)); \ No newline at end of file diff --git a/gulp-task-listing/gulp-task-listing.d.ts b/gulp-task-listing/gulp-task-listing.d.ts new file mode 100644 index 000000000..8409f4b80 --- /dev/null +++ b/gulp-task-listing/gulp-task-listing.d.ts @@ -0,0 +1,40 @@ +// Type definitions for gulp-task-listing +// Project: https://github.com/OverZealous/gulp-task-listing +// Definitions by: Joe Skeen +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/** + * Provides an easy way to get a listing of your tasks from your gulpfile. By default, the + * output groups tasks based on whether or not they contain a hyphen (-), underscore (_), + * or colon (:) in their name. + * + * You can optionally override the Regexp used to determine whether a task is a primary or + * subtask, as well as filter out tasks you don't want to see in the output. + */ +declare module 'gulp-task-listing' { + + /** + * Provides an easy way to get a listing of your tasks from your gulpfile. By default, the + * output groups tasks based on whether or not they contain a hyphen (-), underscore (_), + * or colon (:) in their name. + * + * You can optionally override the Regexp used to determine whether a task is a primary or + * subtask, as well as filter out tasks you don't want to see in the output. + */ + interface GulpTaskListing { + (cb: Function): void; + /** + * Allows for custom filtering of Gulp tasks in the listing + * + * @param subTaskFilter a RegExp or Function returning whether the given task is a subtask + * @param excludeFilter a RegExp or Function returning whether the given task should be excluded from the listing + */ + withFilters(subTaskFilter: RegExp | FilterFunction, excludeFilter?: RegExp | FilterFunction): (cb: Function) => void; + } + + type FilterFunction = (task: string) => boolean; + + var gulpTaskListing: GulpTaskListing; + + export = gulpTaskListing; +} diff --git a/highcharts/highcharts.d.ts b/highcharts/highcharts.d.ts index f654b9749..16867937b 100644 --- a/highcharts/highcharts.d.ts +++ b/highcharts/highcharts.d.ts @@ -217,8 +217,11 @@ interface HighchartsChartOptions { marginLeft?: number; marginRight?: number; marginTop?: number; - plotBackGroundColor?: string | HighchartsGradient; - plotBackGroundImage?: string; + panKey?: string; + panning?: number; + pinchType?: string; + plotBackgroundColor?: string | HighchartsGradient; + plotBackgroundImage?: string; plotBorderColor?: string; plotBorderWidth?: number; plotShadow?: boolean | HighchartsShadow; @@ -229,6 +232,7 @@ interface HighchartsChartOptions { selectionMarkerFill?: string; shadow?: boolean | HighchartsShadow; showAxes?: boolean; + spacing?: number[]; spacingBottom?: number; spacingLeft?: number; spacingRight?: number; @@ -352,6 +356,11 @@ interface HighchartsLegendNavigationOptions { style?: HighchartsCSSObject; } +interface HighchartsLegendTitleOptions { + style?: HighchartsCSSObject; + text?: string; +} + interface HighchartsLegendOptions { align?: string; backgroundColor?: string | HighchartsGradient; @@ -360,6 +369,7 @@ interface HighchartsLegendOptions { borderWidth?: number; enabled?: boolean; floating?: boolean; + itemDistance?: number; itemHiddenStyle?: HighchartsCSSObject; itemHoverStyle?: HighchartsCSSObject; itemMarginBottom?: number; @@ -368,19 +378,21 @@ interface HighchartsLegendOptions { itemWidth?: number; labelFormatter?: () => string; layout?: string; - lineHeight?: string; + lineHeight?: number; margin?: number; maxHeight?: number; navigation?: HighchartsLegendNavigationOptions; padding?: number; reversed?: boolean; rtl?: boolean; - verticalAlign?: string; shadow?: boolean | HighchartsShadow; style?: HighchartsCSSObject; + symbolHeight?: number; symbolPadding?: number; symbolWidth?: number; + title?: HighchartsLegendTitleOptions; useHTML?: boolean; + verticalAlign?: string; width?: number; x?: number; y?: number; @@ -659,7 +671,7 @@ interface HighchartsBarChart { }; pointInterval?: number; pointPadding?: number; - pointPlacement?: string; // null, "on", "between" + pointPlacement?: string | number; // null, "on", "between" pointRange?: number; pointStart?: number; pointWidth?: number; @@ -864,7 +876,7 @@ interface HighchartsLineChart { events: HighchartsPointEvents; }; pointInterval?: number; - pointPlacement?: string; // null, "on", "between" + pointPlacement?: string | number; // null, "on", "between" pointStart?: number; selected?: boolean; shadow?: boolean | HighchartsShadow; @@ -888,25 +900,29 @@ interface HighchartsPieChart { borderColor?: string; borderWidth?: number; center?: string[]; - color?: string; + colors?: string[]; cursor?: string; dataLabels?: HighchartsDataLabels; + depth?: number; enableMouseTracking?: boolean; + endAngle?: number; events?: HighchartsPlotEvents; + getExtremesFromAll?: boolean; id?: string; ignoreHiddenPoint?: boolean; innerSize?: number | string; lineWidth?: number; marker?: HighchartsMarker; + minSize?: number; point?: { events: HighchartsPointEvents; }; - pointPlacement?: string; // null, "on", "between" selected?: boolean; shadow?: boolean | HighchartsShadow; showInLegend?: boolean; size?: number | string; slicedOffset?: number; + startAngle?: number; states?: { hover: HighchartsAreaStates; }; @@ -942,7 +958,7 @@ interface HighchartsScatterChart { events: HighchartsPointEvents; }; pointInterval?: number; - pointPlacement?: string; // null, "on", "between" + pointPlacement?: string | number; // null, "on", "between" pointStart?: number; selected?: boolean; shadow?: boolean | HighchartsShadow; @@ -993,7 +1009,7 @@ interface HighchartsSeriesChart { events: HighchartsPointEvents; }; pointInterval?: number; - pointPlacement?: string; // null, "on", "between" + pointPlacement?: string | number; // null, "on", "between" pointStart?: number; selected?: boolean; shadow?: boolean | HighchartsShadow; diff --git a/ionic/ionic.d.ts b/ionic/ionic.d.ts index b1b215217..1b2e3265e 100644 --- a/ionic/ionic.d.ts +++ b/ionic/ionic.d.ts @@ -205,7 +205,7 @@ declare module ionic { scrollBy(left: number, top: number, shouldAnimate?: boolean): void; zoomTo(level: number, animate?: boolean, originLeft?: number, originTop?: number): void; zoomBy(factor: number, animate?: boolean, originLeft?: number, originTop?: number): void; - getScrollPosition(): {left: number, top: number}; + getScrollPosition(): {left: number; top: number}; anchorScroll(shouldAnimate?: boolean): void; freezeScroll(shouldFreeze?: boolean): boolean; freezeAllScrolls(shouldFreeze?: boolean): boolean; diff --git a/jquery.fileupload/jquery.fileupload.d.ts b/jquery.fileupload/jquery.fileupload.d.ts index 8c9e93737..69821b0ed 100644 --- a/jquery.fileupload/jquery.fileupload.d.ts +++ b/jquery.fileupload/jquery.fileupload.d.ts @@ -204,6 +204,35 @@ interface JQueryFileInputOptions { contentType?: string; cache?: boolean; + timeout?: number; + + active?: Function; + progress?: Function; + send?: Function; + + // Other callbacks: + submit?: Function; + done?: Function; + fail?: Function; + always?: Function; + progressall?: Function; + start?: Function; + stop?: Function; + change?: Function; + paste?: Function; + drop?: Function; + dragover?: Function; + chunksend?: Function; + chunkdone?: Function; + chunkfail?: Function; + chunkalways?: Function; + + // Others + url?: string; + files?: any; + + // Cross-site XMLHttpRequest file uploads + xhrFields?: any; } @@ -213,7 +242,9 @@ interface JQueryFileUpload extends JQuery { interface JQuery { // Interface to the main method of jQuery File Upload - fileupload(settings: JQueryFileInputOptions): JQueryFileUpload; + fileupload(settings: JQueryFileInputOptions | string): JQueryFileUpload; + fileupload(action:string, settings: JQueryFileInputOptions | string): JQueryFileUpload; + fileupload(action: string, message:string, settings: JQueryFileInputOptions | string): JQueryFileUpload; } interface JQuerySupport { diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index d7688f187..3641af850 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -1998,6 +1998,10 @@ interface JQuery { */ focus(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Trigger the "focusin" event on an element. + */ + focusin(): JQuery; /** * Bind an event handler to the "focusin" JavaScript event * @@ -2012,6 +2016,10 @@ interface JQuery { */ focusin(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Trigger the "focusout" event on an element. + */ + focusout(): JQuery; /** * Bind an event handler to the "focusout" JavaScript event * diff --git a/jquerymobile/jquerymobile.d.ts b/jquerymobile/jquerymobile.d.ts index 393c3d972..ad722fdb1 100644 --- a/jquerymobile/jquerymobile.d.ts +++ b/jquerymobile/jquerymobile.d.ts @@ -171,6 +171,7 @@ interface SelectMenuOptions { iconshadow?: boolean; initSelector?: string; inline?: boolean; + hidePlaceholderMenuItems: boolean; mini?: boolean; nativeMenu?: boolean; overlayTheme?: string; @@ -463,8 +464,8 @@ interface JQuery { selectmenu(): JQuery; selectmenu(command: string): JQuery; selectmenu(command: string, update: boolean): JQuery; - selectmenu(options: CheckboxRadioOptions): JQuery; - selectmenu(events: CheckboxRadioEvents): JQuery; + selectmenu(options: SelectMenuOptions): JQuery; + selectmenu(events: SelectMenuEvents): JQuery; listview(): JQuery; listview(command: string): JQuery; diff --git a/js-cookie/js-cookie.d.ts b/js-cookie/js-cookie.d.ts index fc3e95c02..7fc1a5125 100644 --- a/js-cookie/js-cookie.d.ts +++ b/js-cookie/js-cookie.d.ts @@ -90,3 +90,7 @@ declare module Cookies { } declare var Cookies: Cookies.CookiesStatic; + +declare module 'js-cookie' { + export = Cookies; +} diff --git a/kefir/kefir-tests.ts b/kefir/kefir-tests.ts index c423a3dfe..a0d0a9618 100644 --- a/kefir/kefir-tests.ts +++ b/kefir/kefir-tests.ts @@ -48,7 +48,7 @@ import { Observable, ObservablePool, Stream, Property, Event, Emitter } from 'ke { let property01: Property = Kefir.constant(1); let property02: Property = Kefir.constantError(1); - let property03: Property = Kefir.fromPromise(new Promise(fulfill => fulfill(1))); + //let property03: Property = Kefir.fromPromise(new Promise(fulfill => fulfill(1))); } // Convert observables @@ -69,7 +69,7 @@ import { Observable, ObservablePool, Stream, Property, Event, Emitter } from 'ke Kefir.sequentially(1000, [1, 2]).offAny(event => console.log('event:', event)); Kefir.sequentially(1000, [1, 2]).log('my stream'); Kefir.sequentially(1000, [1, 2]).offLog('my stream'); - Kefir.sequentially(1000, [1, 2]).toPromise().then(x => console.log('fulfilled with:', x)); + Kefir.sequentially(1000, [1, 2]).toPromise().then((x: number) => console.log('fulfilled with:', x)); } // Modify an observable diff --git a/kefir/kefir.d.ts b/kefir/kefir.d.ts index 6a9544a7c..9e3303f01 100644 --- a/kefir/kefir.d.ts +++ b/kefir/kefir.d.ts @@ -4,9 +4,9 @@ // Definitions: https://github.com/borisyankov/DefinitelyTyped /// -/// declare module "kefir" { + export interface Observable { // Subscribe / add side effects onValue(callback: (value: T) => void): void; @@ -19,7 +19,7 @@ declare module "kefir" { offAny(callback: (event: Event) => void): void; log(name?: string): void; offLog(name?: string): void; - toPromise(PromiseConstructor?: typeof Promise): Promise; + toPromise(PromiseConstructor?: any): any; } export interface Stream extends Observable { @@ -163,7 +163,7 @@ declare module "kefir" { // Create a property export function constant(value: T): Property; export function constantError(error: T): Property; - export function fromPromise(promise: Promise): Property; + export function fromPromise(promise: any): Property; // Combine observables export function combine(obss: Observable[], passiveObss: Observable[], combinator?: (...values: T[]) => U): Observable; diff --git a/knex/knex-test.ts b/knex/knex-test.ts index d15786736..081f98867 100644 --- a/knex/knex-test.ts +++ b/knex/knex-test.ts @@ -353,6 +353,7 @@ knex.transaction(function(trx) { knex.schema.createTable('users', function (table) { table.increments(); table.string('name'); + table.enu('favorite_color', ['red', 'blue', 'green']); table.timestamps(); }); diff --git a/knex/knex.d.ts b/knex/knex.d.ts index 82dda6bf2..82c26cfec 100644 --- a/knex/knex.d.ts +++ b/knex/knex.d.ts @@ -326,8 +326,8 @@ declare module "knex" { timestamp(columnName: string): ColumnBuilder; timestamps(): ColumnBuilder; binary(columnName: string): ColumnBuilder; - enum(columnName: string): ColumnBuilder; - enu(columnName: string): ColumnBuilder; + enum(columnName: string, values: Value[]): ColumnBuilder; + enu(columnName: string, values: Value[]): ColumnBuilder; json(columnName: string): ColumnBuilder; uuid(columnName: string): ColumnBuilder; comment(val: string): TableBuilder; diff --git a/knockout.validation/knockout.validation.d.ts b/knockout.validation/knockout.validation.d.ts index 3ce139a99..5581261d3 100644 --- a/knockout.validation/knockout.validation.d.ts +++ b/knockout.validation/knockout.validation.d.ts @@ -17,7 +17,7 @@ interface KnockoutValidationConfiguration { insertMessages?: boolean; parseInputAttributes?: boolean; writeInputAttributes?: boolean; - decorateElement?: boolean; + decorateInputElement?: boolean; errorClass?: string; errorElementClass?: string; errorMessageClass?: string; diff --git a/ko.plus/ko.plus-tests.ts b/ko.plus/ko.plus-tests.ts index 992332e2b..7dd1053b2 100644 --- a/ko.plus/ko.plus-tests.ts +++ b/ko.plus/ko.plus-tests.ts @@ -43,6 +43,8 @@ function CommandTests() { action: () => { return "Hello cmd4"; } }); + // initialize command with action with typed argument + var cmd5 = ko.command((message: string) => { return message; }); // test execute the command cmd1(); diff --git a/ko.plus/ko.plus.d.ts b/ko.plus/ko.plus.d.ts index 65301aa7c..dacf6121f 100644 --- a/ko.plus/ko.plus.d.ts +++ b/ko.plus/ko.plus.d.ts @@ -23,7 +23,7 @@ // interface KnockoutStatic { // create a command - two overloads - command: (param: KoPlus.Callback | KoPlus.CommandOptions) => KoPlus.Command; + command: (param: Function | KoPlus.CommandOptions) => KoPlus.Command; editable: KoPlus.EditableStatic; editableArray: KoPlus.EditableArrayStatic; @@ -60,8 +60,6 @@ interface KnockoutBindingHandlers { // namespace for ko.plus types // declare module KoPlus { - // predefine a callback type - export type Callback = () => void; //#region Command types @@ -91,9 +89,9 @@ declare module KoPlus { fail: (callback: (error: string) => void) => Command; - always: (callback: Callback) => Command; + always: (callback: Function) => Command; - then: (resolve: Callback, reject: Callback) => Command; + then: (resolve: Function, reject: Function) => Command; } // @@ -102,7 +100,7 @@ declare module KoPlus { // export interface CommandOptions { // [required] sets the command action method - action: Callback; + action: Function; // [optional] function to determine if command can be executed canExecute?: () => boolean; diff --git a/leaflet/leaflet-tests.ts b/leaflet/leaflet-tests.ts index 6ab018a4e..0ea66d32e 100755 --- a/leaflet/leaflet-tests.ts +++ b/leaflet/leaflet-tests.ts @@ -148,6 +148,11 @@ map.closePopup(); map.addControl(L.control.attribution({position: 'bottomright'})); map.removeControl(L.control.attribution({ position: 'bottomright' })); +L.control.layers({'Base': layer}).addTo(map); +map.on('baseLayerChange', function(e: L.LeafletLayersControlEvent) { + alert(e.name); +}); + map.latLngToLayerPoint(map.layerPointToLatLng(L.point(0, 0))); map.latLngToContainerPoint(map.containerPointToLatLng(L.point(0, 0))); map.containerPointToLayerPoint(L.point(0, 0)); diff --git a/leaflet/leaflet.d.ts b/leaflet/leaflet.d.ts index 760ecd283..110bdd6f7 100755 --- a/leaflet/leaflet.d.ts +++ b/leaflet/leaflet.d.ts @@ -1838,6 +1838,22 @@ declare namespace L { declare namespace L { + export interface LeafletLayersControlEvent extends LeafletEvent { + + /** + * The layer that was added or removed. + */ + layer: ILayer; + + /** + * The name of the layer that was added or removed. + */ + name: string; + } +} + +declare module L { + export interface LeafletLocationEvent extends LeafletEvent { /** diff --git a/libxmljs/libxmljs-tests.ts b/libxmljs/libxmljs-tests.ts index bf73a6d98..fbc862818 100644 --- a/libxmljs/libxmljs-tests.ts +++ b/libxmljs/libxmljs-tests.ts @@ -10,7 +10,7 @@ var xml = '' + 'with content!' + ''; -var xmlDoc = libxmljs.parseXmlString(xml); +var xmlDoc = libxmljs.parseXml(xml); // xpath queries var gchild = xmlDoc.get('//grandchild'); diff --git a/libxmljs/libxmljs.d.ts b/libxmljs/libxmljs.d.ts index bb0f5ba29..045e43f10 100644 --- a/libxmljs/libxmljs.d.ts +++ b/libxmljs/libxmljs.d.ts @@ -1,9 +1,16 @@ -// Type definitions for Libxmljs +// Type definitions for Libxmljs v0.14.2 // Project: https://github.com/polotek/libxmljs // Definitions by: François de Campredon // Definitions: https://github.com/borisyankov/DefinitelyTyped +/// + declare module "libxmljs" { + + import events = require('events'); + + export function parseXml(source:string):XMLDocument; + export function parseHtml(source:string):HTMLDocument; export function parseXmlString(source:string):XMLDocument; export function parseHtmlString(source:string):HTMLDocument; @@ -20,6 +27,8 @@ declare module "libxmljs" { node(name:string, content:string):Element; root():Element; toString():string; + validate(xsdDoc:XMLDocument): boolean; + validationErrors: XmlError[]; version():Number; } @@ -34,25 +43,25 @@ declare module "libxmljs" { name(newName:string):void; text():string; attr(name:string):string; - attr(attr:Attribute); + attr(attr:Attribute):void; attr(attrObject:{[key:string]:string;}):void; attrs():Attribute[]; parent():Element; doc():XMLDocument; child(idx:number):Element; childNodes():Element[]; - addChild(child:Element); + addChild(child:Element):Element; nextSibling():Element; nextElement():Element; addNextSibling(siblingNode:Element):Element; prevSibling():Element; prevElement():Element; - addPrevSibling(siblingNode:Element); + addPrevSibling(siblingNode:Element):Element; find(xpath:string):Element[]; find(xpath:string, ns_uri:string):Element[]; get(xpath:string, ns_uri:string):Element; find(xpath:string, namespaces:{[key:string]:string;}):Element[]; - get(xpath, ns_uri:{[key:string]:string;}):Element; + get(xpath:string, ns_uri:{[key:string]:string;}):Element; defineNamespace(href:string):Namespace; defineNamespace(prefix:string, href:string):Namespace; namespace():Namespace; @@ -84,28 +93,22 @@ declare module "libxmljs" { prefix():string; } - export class SaxParser { + export class SaxParser extends events.EventEmitter { parseString(source:string):boolean; - addListener(event: string, listener: Function); - on(event: string, listener: Function): any; - once(event: string, listener: Function): void; - removeListener(event: string, listener: Function): void; - removeAllListener(event: string): void; - setMaxListeners(n: number): void; - listeners(event: string): { Function; }[]; - emit(event: string, arg1?: any, arg2?: any): void; } - export class SaxPushParser { + export class SaxPushParser extends events.EventEmitter { push(source:string):boolean; - addListener(event: string, listener: Function); - on(event: string, listener: Function): any; - once(event: string, listener: Function): void; - removeListener(event: string, listener: Function): void; - removeAllListener(event: string): void; - setMaxListeners(n: number): void; - listeners(event: string): { Function; }[]; - emit(event: string, arg1?: any, arg2?: any): void; } -} \ No newline at end of file + + export interface XmlError { + domain: number; + code: number; + message: string; + level: number; + file?: string; + column: number; + line: number; + } +} diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 8bc80cb68..1d5525300 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -155,17 +155,24 @@ result = _([1, 2, 3]).run(); result = <_.Dictionary>_(<{ [index: string]: string; }>{ 'key1': 'test1', 'key2': 'test2' }).toJSON(); result = <_.Dictionary>_({ a: 1, b: 2}).mapValues(function(num: number) { return num * 2; }).valueOf(); -// /************* -// * Arrays * -// *************/ -result = _.chunk([1, '2', '3', false]); -result = <_.LoDashArrayWrapper>_([1, '2', '3', false]).chunk(); -result = _.chunk([1, '2', '3', false], 2); -result = <_.LoDashArrayWrapper>_([1, '2', '3', false]).chunk(2); -result = _.chunk([1, 2, 3, 4]); -result = <_.LoDashArrayWrapper>_([1, 2, 3, 4]).chunk(); -result = _.chunk([1, 2, 3, 4], 2); -result = <_.LoDashArrayWrapper>_([1, 2, 3, 4]).chunk(2); +/********* + * Array * + *********/ + +// _.chunk +module TestChunk { + let array: TResult[]; + let list: _.List; + let result: TResult[][]; + result = _.chunk(array); + result = _.chunk(array, 42); + result = _.chunk(list); + result = _.chunk(list, 42); + result = _(array).chunk().value(); + result = _(array).chunk(42).value(); + result = _(list).chunk().value(); + result = _(list).chunk(42).value(); +} result = _.compact([0, 1, false, 2, '', 3]); result = <_.LoDashArrayWrapper>_([0, 1, false, 2, '', 3]).compact(); @@ -208,6 +215,21 @@ result = <_.LoDashArrayWrapper>_([0, 1, false, 2, '', 3]).compact(); result = _(testDropList).drop(42).value(); } +// _.dropRight +module TestDropRight { + let array: TResult[]; + let list: _.List; + let result: TResult[]; + result = _.dropRight(array); + result = _.dropRight(array, 42); + result = _.dropRight(list); + result = _.dropRight(list, 42); + result = _(array).dropRight().value(); + result = _(array).dropRight(42).value(); + result = _(list).dropRight().value(); + result = _(list).dropRight(42).value(); +} + result = _.rest([1, 2, 3]); result = _.rest([1, 2, 3], 2); result = _.rest([1, 2, 3], (num) => num < 3) @@ -242,37 +264,16 @@ result = _.findLastIndex(['apple', 'banana', 'beet'], function (f: strin result = _.findLastIndex(['apple', 'banana', 'beet'], 'apple'); result = _.findLastIndex([{ food: 'apple' }, { food: 'banana' }, { food: 'beet' }], { food: 'apple' }); -result = _.first([1, 2, 3]); -result = _.first([1, 2, 3], 2); -result = _.first([1, 2, 3], function (num) { - return num < 3; -}); -result = _.first(foodsOrganic, 'organic'); -result = _.first(foodsType, { 'type': 'fruit' }); - -result = _([1, 2, 3]).first(); -result = _([1, 2, 3]).first(2).value(); -result = _([1, 2, 3]).first(function (num) { - return num < 3; -}).value(); -result = _(foodsOrganic).first('organic').value(); -result = _(foodsType).first({ 'type': 'fruit' }).value(); - -result = _.head([1, 2, 3]); -result = _.head([1, 2, 3], 2); -result = _.head([1, 2, 3], function (num) { - return num < 3; -}); -result = _.head(foodsOrganic, 'organic'); -result = _.head(foodsType, { 'type': 'fruit' }); - -result = _([1, 2, 3]).head(); -result = _([1, 2, 3]).head(2).value(); -result = _([1, 2, 3]).head(function (num) { - return num < 3; -}).value(); -result = _(foodsOrganic).head('organic').value(); -result = _(foodsType).head({ 'type': 'fruit' }).value(); +// _.first +module TestFirst { + let array: TResult[]; + let list: _.List; + let result: TResult; + result = _.first(array); + result = _.first(list); + result = _(array).first(); + result = _(list).first(); +} result = _.take([1, 2, 3]); result = _.take([1, 2, 3], 2); @@ -305,6 +306,17 @@ result = <_.LoDashArrayWrapper>_([1, [2], [3, [[4]]]]).flatten(true); result = <_.LoDashArrayWrapper>_([1, [2], [3, [[4]]]]).flattenDeep(); +// _.head +module TestHead { + let array: TResult[]; + let list: _.List; + let result: TResult; + result = _.head(array); + result = _.head(list); + result = _(array).head(); + result = _(list).head(); +} + result = _.indexOf([1, 2, 3, 1, 2, 3], 2); result = _.indexOf([1, 2, 3, 1, 2, 3], 2, 3); result = _.indexOf([1, 1, 2, 2, 3, 3], 2, true); @@ -652,6 +664,51 @@ result = _([1, 2]).zipWith([1, 2], [1, 2], [1, 2], [1, 2], [1, result = _(testAtDictionary).at(0, '1', [2], ['3'], [4, '5']).value(); } +// _.collect +module TestCollect { + let array: number[]; + let list: _.List; + let dictionary: _.Dictionary; + let listIterator: {(value: number, index: number, collection: _.List): TResult}; + let dictionaryIterator: {(value: number, key: string, collection: _.Dictionary): TResult}; + { + let result: TResult[]; + result = _.collect(array); + result = _.collect(array, listIterator); + result = _.collect(array, listIterator, any); + result = _.collect(array, ''); + result = _.collect(list); + result = _.collect(list, listIterator); + result = _.collect(list, listIterator, any); + result = _.collect(list, ''); + result = _.collect(dictionary); + result = _.collect(dictionary, dictionaryIterator); + result = _.collect(dictionary, dictionaryIterator, any); + result = _.collect(dictionary, ''); + result = _(array).collect().value(); + result = _(array).collect(listIterator).value(); + result = _(array).collect(listIterator, any).value(); + result = _(array).collect('').value(); + result = _(list).collect().value(); + result = _(list).collect(listIterator).value(); + result = _(list).collect(listIterator, any).value(); + result = _(list).collect('').value(); + result = _(dictionary).collect().value(); + result = _(dictionary).collect(dictionaryIterator).value(); + result = _(dictionary).collect(dictionaryIterator, any).value(); + result = _(dictionary).collect('').value(); + } + { + let result: boolean[]; + result = _.collect(array, {}); + result = _.collect(list, {}); + result = _.collect(dictionary, {}); + result = _(array).collect<{}>({}).value(); + result = _(list).collect<{}>({}).value(); + result = _(dictionary).collect<{}>({}).value(); + } +} + result = _.contains([1, 2, 3], 1); result = _.contains([1, 2, 3], 1, 2); result = _.contains({ 'moe': 30, 'larry': 40, 'curly': 67 }, 40); @@ -797,21 +854,60 @@ result = <_.Dictionary>_.indexBy(keys, function (key) { this.fromCharCode( result = _.invoke([[5, 1, 7], [3, 2, 1]], 'sort'); result = _.invoke([123, 456], String.prototype.split, ''); -result = _.map([1, 2, 3], function (num) { return num * 3; }); -result = _.map({ 'one': 1, 'two': 2, 'three': 3 }, function (num) { return num * 3; }); -result = _.map(stoogesAges, 'name'); +// _.map +module TestMap { + let array: number[]; + let list: _.List; + let dictionary: _.Dictionary; -result = _([1, 2, 3]).map(function (num) { return num * 3; }).value(); -result = _({ 'one': 1, 'two': 2, 'three': 3 }).map(function (num: number) { return num * 3; }).value(); -result = _(stoogesAges).map('name').value(); + let listIterator: (value: number, index: number, collection: _.List) => TResult; + let dictionaryIterator: (value: number, key: string, collection: _.Dictionary) => TResult; -result = _.collect([1, 2, 3], function (num) { return num * 3; }); -result = _.collect({ 'one': 1, 'two': 2, 'three': 3 }, function (num) { return num * 3; }); -result = _.collect(stoogesAges, 'name'); + { + let result: TResult[]; -result = _([1, 2, 3]).collect(function (num) { return num * 3; }).value(); -result = _({ 'one': 1, 'two': 2, 'three': 3 }).collect(function (num: number) { return num * 3; }).value(); -result = _(stoogesAges).collect('name').value(); + result = _.map(array); + result = _.map(array, listIterator); + result = _.map(array, listIterator, any); + result = _.map(array, ''); + + result = _.map(list); + result = _.map(list, listIterator); + result = _.map(list, listIterator, any); + result = _.map(list, ''); + + result = _.map(dictionary); + result = _.map(dictionary, dictionaryIterator); + result = _.map(dictionary, dictionaryIterator, any); + result = _.map(dictionary, ''); + + result = _(array).map().value(); + result = _(array).map(listIterator).value(); + result = _(array).map(listIterator, any).value(); + result = _(array).map('').value(); + + result = _(list).map().value(); + result = _(list).map(listIterator).value(); + result = _(list).map(listIterator, any).value(); + result = _(list).map('').value(); + + result = _(dictionary).map().value(); + result = _(dictionary).map(dictionaryIterator).value(); + result = _(dictionary).map(dictionaryIterator, any).value(); + result = _(dictionary).map('').value(); + } + { + let result: boolean[]; + + result = _.map(array, {}); + result = _.map(list, {}); + result = _.map(dictionary, {}); + + result = _(array).map<{}>({}).value(); + result = _(list).map<{}>({}).value(); + result = _(dictionary).map<{}>({}).value(); + } +} // _.ceil result = _.ceil(4.006); @@ -1794,6 +1890,54 @@ result = _({ 'one': 1, 'two': 2, 'three': 3 }).keys().value(); result = _.keysIn({ 'one': 1, 'two': 2, 'three': 3 }); result = _({ 'one': 1, 'two': 2, 'three': 3 }).keysIn().value(); +// _.mapKeys +module TestMapKeys { + let array: TResult[]; + let list: _.List; + let dictionary: _.Dictionary; + + let listIterator: (value: TResult, index: number, collection: _.List) => string; + let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary) => string; + + let result: _.Dictionary; + + result = _.mapKeys(array); + result = _.mapKeys(array, listIterator); + result = _.mapKeys(array, listIterator, any); + result = _.mapKeys(array, ''); + result = _.mapKeys(array, {}); + + result = _.mapKeys(list); + result = _.mapKeys(list, listIterator); + result = _.mapKeys(list, listIterator, any); + result = _.mapKeys(list, ''); + result = _.mapKeys(list, {}); + + result = _.mapKeys(dictionary); + result = _.mapKeys(dictionary, dictionaryIterator); + result = _.mapKeys(dictionary, dictionaryIterator, any); + result = _.mapKeys(dictionary, ''); + result = _.mapKeys(dictionary, {}); + + result = _(array).mapKeys().value(); + result = _(array).mapKeys(listIterator).value(); + result = _(array).mapKeys(listIterator, any).value(); + result = _(array).mapKeys('').value(); + result = _(array).mapKeys<{}>({}).value(); + + result = _(list).mapKeys().value(); + result = _(list).mapKeys(listIterator).value(); + result = _(list).mapKeys(listIterator, any).value(); + result = _(list).mapKeys('').value(); + result = _(list).mapKeys({}).value(); + + result = _(dictionary).mapKeys().value(); + result = _(dictionary).mapKeys(dictionaryIterator).value(); + result = _(dictionary).mapKeys(dictionaryIterator, any).value(); + result = _(dictionary).mapKeys('').value(); + result = _(dictionary).mapKeys({}).value(); +} + var mergeNames = { 'stooges': [ { 'name': 'moe' }, @@ -1884,17 +2028,71 @@ interface TestPickFn { result = _(testSetObject).set([testSetPath], any).value(); } -result = _.transform([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], function (r: number[], num: number) { - num *= num; - if (num % 2) { - return r.push(num) < 3; - } -}); -// → [1, 9, 25] +// _.transform +module TestTransform { + let array: number[]; + let dictionary: _.Dictionary; -result = <{ a: number; b: number; c: number; }>_.transform(<{ [index: string]: number; }>{ 'a': 1, 'b': 2, 'c': 3 }, function (r: any, num: number, key: string) { - r[key] = num * 3; -}); + { + let iterator: (acc: TResult[], curr: number, index?: number, arr?: number[]) => void; + let accumulator: TResult[]; + let result: TResult[]; + + result = _.transform(array); + result = _.transform(array, iterator); + result = _.transform(array, iterator, accumulator); + result = _.transform(array, iterator, accumulator, any); + + result = _(array).transform().value(); + result = _(array).transform(iterator).value(); + result = _(array).transform(iterator, accumulator).value(); + result = _(array).transform(iterator, accumulator, any).value(); + } + + { + let iterator: (acc: _.Dictionary, curr: number, index?: number, arr?: number[]) => void; + let accumulator: _.Dictionary; + let result: _.Dictionary; + + result = _.transform(array, iterator); + result = _.transform(array, iterator, accumulator); + result = _.transform(array, iterator, accumulator, any); + + result = _(array).transform(iterator).value(); + result = _(array).transform(iterator, accumulator).value(); + result = _(array).transform(iterator, accumulator, any).value(); + } + + { + let iterator: (acc: _.Dictionary, curr: number, key?: string, dict?: _.Dictionary) => void; + let accumulator: _.Dictionary; + let result: _.Dictionary; + + result = _.transform(dictionary); + result = _.transform(dictionary, iterator); + result = _.transform(dictionary, iterator, accumulator); + result = _.transform(dictionary, iterator, accumulator, any); + + result = _(dictionary).transform().value(); + result = _(dictionary).transform(iterator).value(); + result = _(dictionary).transform(iterator, accumulator).value(); + result = _(dictionary).transform(iterator, accumulator, any).value(); + } + + { + let iterator: (acc: TResult[], curr: number, key?: string, dict?: _.Dictionary) => void; + let accumulator: TResult[]; + let result: TResult[]; + + result = _.transform(dictionary, iterator); + result = _.transform(dictionary, iterator, accumulator); + result = _.transform(dictionary, iterator, accumulator, any); + + result = _(dictionary).transform(iterator).value(); + result = _(dictionary).transform(iterator, accumulator).value(); + result = _(dictionary).transform(iterator, accumulator, any).value(); + } +} // _.values class TestValues { diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 172a25050..102811a16 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -313,33 +313,39 @@ declare module _ { } /********* - * Arrays * - **********/ + * Array * + *********/ //_.chunk interface LoDashStatic { /** - * Creates an array of elements split into groups the length of size. If collection can't be - * split evenly, the final chunk will be the remaining elements. - * @param array The array to process. - * @param size The length of each chunk. - * @return Returns the new array containing chunks. - **/ - chunk(array: Array, size?: number): T[][]; - - /** - * @see _.chunk - **/ - chunk(array: List, size?: number): T[][]; + * Creates an array of elements split into groups the length of size. If collection can’t be split evenly, the + * final chunk will be the remaining elements. + * + * @param array The array to process. + * @param size The length of each chunk. + * @return Returns the new array containing chunks. + */ + chunk( + array: List, + size?: number + ): T[][]; } interface LoDashArrayWrapper { /** - * @see _.chunk - **/ + * @see _.chunk + */ chunk(size?: number): LoDashArrayWrapper; } + interface LoDashObjectWrapper { + /** + * @see _.chunk + */ + chunk(size?: number): LoDashArrayWrapper; + } + //_.compact interface LoDashStatic { /** @@ -419,6 +425,35 @@ declare module _ { drop(n?: number): LoDashArrayWrapper; } + //_.dropRight + interface LoDashStatic { + /** + * Creates a slice of array with n elements dropped from the end. + * + * @param array The array to query. + * @param n The number of elements to drop. + * @return Returns the slice of array. + */ + dropRight( + array: List, + n?: number + ): T[]; + } + + interface LoDashArrayWrapper { + /** + * @see _.dropRight + */ + dropRight(n?: number): LoDashArrayWrapper; + } + + interface LoDashObjectWrapper { + /** + * @see _.dropRight + */ + dropRight(n?: number): LoDashArrayWrapper; + } + //_.findIndex interface LoDashStatic { /** @@ -527,162 +562,31 @@ declare module _ { //_.first interface LoDashStatic { /** - * Gets the first element or first n elements of an array. If a callback is provided - * elements at the beginning of the array are returned as long as the callback returns - * truey. The callback is bound to thisArg and invoked with three arguments; (value, - * index, array). - * - * If a property name is provided for callback the created "_.pluck" style callback - * will return the property value of the given element. - * - * If an object is provided for callback the created "_.where" style callback will return ] - * true for elements that have the properties of the given object, else false. - * @param array Retrieves the first element of this array. - * @return Returns the first element of `array`. - **/ - first(array?: Array): T; + * Gets the first element of array. + * + * @alias _.head + * + * @param array The array to query. + * @return Returns the first element of array. + */ + first(array: List): T; + } + interface LoDashArrayWrapper { /** - * @see _.first - **/ - first(array?: List): T; + * @see _.first + */ + first(): T; + } + interface LoDashObjectWrapper { /** - * @see _.first - * @param n The number of elements to return. - **/ - first( - array: Array, - n: number): T[]; - - /** - * @see _.first - * @param n The number of elements to return. - **/ - first( - array: List, - n: number): T[]; - - /** - * @see _.first - * @param callback The function called per element. - * @param [thisArg] The this binding of callback. - **/ - first( - array: Array, - callback: ListIterator, - thisArg?: any): T[]; - - /** - * @see _.first - * @param callback The function called per element. - * @param [thisArg] The this binding of callback. - **/ - first( - array: List, - callback: ListIterator, - thisArg?: any): T[]; - - /** - * @see _.first - * @param pluckValue "_.pluck" style callback value - **/ - first( - array: Array, - pluckValue: string): T[]; - - /** - * @see _.first - * @param pluckValue "_.pluck" style callback value - **/ - first( - array: List, - pluckValue: string): T[]; - - /** - * @see _.first - * @param whereValue "_.where" style callback value - **/ - first( - array: Array, - whereValue: W): T[]; - - /** - * @see _.first - * @param whereValue "_.where" style callback value - **/ - first( - array: List, - whereValue: W): T[]; - - /** - * @see _.first - **/ - head(array: Array): T; - - /** - * @see _.first - **/ - head(array: List): T; - - /** - * @see _.first - **/ - head( - array: Array, - n: number): T[]; - - /** - * @see _.first - **/ - head( - array: List, - n: number): T[]; - - /** - * @see _.first - **/ - head( - array: Array, - callback: ListIterator, - thisArg?: any): T[]; - - /** - * @see _.first - **/ - head( - array: List, - callback: ListIterator, - thisArg?: any): T[]; - - /** - * @see _.first - **/ - head( - array: Array, - pluckValue: string): T[]; - - /** - * @see _.first - **/ - head( - array: List, - pluckValue: string): T[]; - - /** - * @see _.first - **/ - head( - array: Array, - whereValue: W): T[]; - - /** - * @see _.first - **/ - head( - array: List, - whereValue: W): T[]; + * @see _.first + */ + first(): TResult; + } + interface LoDashStatic { /** * @see _.first **/ @@ -741,70 +645,6 @@ declare module _ { } interface LoDashArrayWrapper { - /** - * @see _.first - **/ - first(): T; - - /** - * @see _.first - * @param n The number of elements to return. - **/ - first(n: number): LoDashArrayWrapper; - - /** - * @see _.first - * @param callback The function called per element. - * @param [thisArg] The this binding of callback. - **/ - first( - callback: ListIterator, - thisArg?: any): LoDashArrayWrapper; - - /** - * @see _.first - * @param pluckValue "_.pluck" style callback value - **/ - first(pluckValue: string): LoDashArrayWrapper; - - /** - * @see _.first - * @param whereValue "_.where" style callback value - **/ - first(whereValue: W): LoDashArrayWrapper; - - /** - * @see _.first - **/ - head(): T; - - /** - * @see _.first - * @param n The number of elements to return. - **/ - head(n: number): LoDashArrayWrapper; - - /** - * @see _.first - * @param callback The function called per element. - * @param [thisArg] The this binding of callback. - **/ - head( - callback: ListIterator, - thisArg?: any): LoDashArrayWrapper; - - /** - * @see _.first - * @param pluckValue "_.pluck" style callback value - **/ - head(pluckValue: string): LoDashArrayWrapper; - - /** - * @see _.first - * @param whereValue "_.where" style callback value - **/ - head(whereValue: W): LoDashArrayWrapper; - /** * @see _.first **/ @@ -897,6 +737,28 @@ declare module _ { flattenDeep(): LoDashArrayWrapper; } + //_.head + interface LoDashStatic { + /** + * @see _.first + */ + head(array: List): T; + } + + interface LoDashArrayWrapper { + /** + * @see _.first + */ + head(): T; + } + + interface LoDashObjectWrapper { + /** + * @see _.first + */ + head(): TResult; + } + //_.indexOf interface LoDashStatic { /** @@ -2172,6 +2034,107 @@ declare module _ { at(...props: Array>): LoDashArrayWrapper; } + //_.collect + interface LoDashStatic { + /** + * @see _.map + */ + collect( + collection: List, + iteratee?: ListIterator, + thisArg?: any + ): TResult[]; + + /** + * @see _.map + */ + collect( + collection: Dictionary, + iteratee?: DictionaryIterator, + thisArg?: any + ): TResult[]; + + /** + * @see _.map + */ + collect( + collection: List, + iteratee?: string + ): TResult[]; + + /** + * @see _.map + */ + collect( + collection: Dictionary, + iteratee?: string + ): TResult[]; + + /** + * @see _.map + */ + collect( + collection: List, + iteratee?: TObject + ): boolean[]; + + /** + * @see _.map + */ + collect( + collection: Dictionary, + iteratee?: TObject + ): boolean[]; + } + + interface LoDashArrayWrapper { + /** + * @see _.map + */ + collect( + iteratee?: ListIterator, + thisArg?: any + ): LoDashArrayWrapper; + + /** + * @see _.map + */ + collect( + iteratee?: string + ): LoDashArrayWrapper; + + /** + * @see _.map + */ + collect( + iteratee?: TObject + ): LoDashArrayWrapper; + } + + interface LoDashObjectWrapper { + /** + * @see _.map + */ + collect( + iteratee?: ListIterator|DictionaryIterator, + thisArg?: any + ): LoDashArrayWrapper; + + /** + * @see _.map + */ + collect( + iteratee?: string + ): LoDashArrayWrapper; + + /** + * @see _.map + */ + collect( + iteratee?: TObject + ): LoDashArrayWrapper; + } + //_.contains interface LoDashStatic { /** @@ -3632,143 +3595,127 @@ declare module _ { //_.map interface LoDashStatic { /** - * Creates an array of values by running each element in the collection through the callback. - * The callback is bound to thisArg and invoked with three arguments; (value, index|key, - * collection). - * - * If a property name is provided for callback the created "_.pluck" style callback will return - * the property value of the given element. - * - * If an object is provided for callback the created "_.where" style callback will return true - * for elements that have the properties of the given object, else false. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param theArg The this binding of callback. - * @return The mapped array result. - **/ - map( - collection: Array, - callback: ListIterator, - thisArg?: any): TResult[]; - - /** - * @see _.map - **/ + * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to + * thisArg and invoked with three arguments: (value, index|key, collection). + * + * If a property name is provided for iteratee the created _.property style callback returns the property value + * of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for iteratee the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, + * _.reject, and _.some. + * + * The guarded methods are: + * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, + * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, + * sample, some, sum, uniq, and words + * + * @alias _.collect + * + * @param collection The collection to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns the new mapped array. + */ map( collection: List, - callback: ListIterator, - thisArg?: any): TResult[]; + iteratee?: ListIterator, + thisArg?: any + ): TResult[]; /** - * @see _.map - * @param object The object to iterate over. - * @param callback The function called per iteration. - * @param thisArg `this` object in `iterator`, optional. - * @return The mapped object result. - **/ + * @see _.map + */ map( - object: Dictionary, - callback: DictionaryIterator, - thisArg?: any): TResult[]; + collection: Dictionary, + iteratee?: DictionaryIterator, + thisArg?: any + ): TResult[]; /** - * @see _.map - * @param pluckValue _.pluck style callback - **/ - map( - collection: Array, - pluckValue: string): TResult[]; - - /** - * @see _.map - * @param pluckValue _.pluck style callback - **/ + * @see _.map + */ map( collection: List, - pluckValue: string): TResult[]; + iteratee?: string + ): TResult[]; /** - * @see _.map - **/ - collect( - collection: Array, - callback: ListIterator, - thisArg?: any): TResult[]; + * @see _.map + */ + map( + collection: Dictionary, + iteratee?: string + ): TResult[]; /** - * @see _.map - **/ - collect( + * @see _.map + */ + map( collection: List, - callback: ListIterator, - thisArg?: any): TResult[]; + iteratee?: TObject + ): boolean[]; /** - * @see _.map - **/ - collect( - object: Dictionary, - callback: DictionaryIterator, - thisArg?: any): TResult[]; - - /** - * @see _.map - **/ - collect( - collection: Array, - pluckValue: string): TResult[]; - - /** - * @see _.map - **/ - collect( - collection: List, - pluckValue: string): TResult[]; + * @see _.map + */ + map( + collection: Dictionary, + iteratee?: TObject + ): boolean[]; } interface LoDashArrayWrapper { /** - * @see _.map - **/ + * @see _.map + */ map( - callback: ListIterator, - thisArg?: any): LoDashArrayWrapper; + iteratee?: ListIterator, + thisArg?: any + ): LoDashArrayWrapper; /** - * @see _.map - * @param pluckValue _.pluck style callback - **/ + * @see _.map + */ map( - pluckValue: string): LoDashArrayWrapper; + iteratee?: string + ): LoDashArrayWrapper; /** - * @see _.map - **/ - collect( - callback: ListIterator, - thisArg?: any): LoDashArrayWrapper; - - /** - * @see _.map - **/ - collect( - pluckValue: string): LoDashArrayWrapper; + * @see _.map + */ + map( + iteratee?: TObject + ): LoDashArrayWrapper; } interface LoDashObjectWrapper { /** - * @see _.map - **/ - map( - callback: ObjectIterator, - thisArg?: any): LoDashArrayWrapper; + * @see _.map + */ + map( + iteratee?: ListIterator|DictionaryIterator, + thisArg?: any + ): LoDashArrayWrapper; /** - * @see _.map - **/ - collect( - callback: ObjectIterator, - thisArg?: any): LoDashArrayWrapper; + * @see _.map + */ + map( + iteratee?: string + ): LoDashArrayWrapper; + + /** + * @see _.map + */ + map( + iteratee?: TObject + ): LoDashArrayWrapper; } //_.ceil @@ -7403,6 +7350,97 @@ declare module _ { keysIn(): LoDashArrayWrapper } + //_.mapKeys + interface LoDashStatic { + /** + * The opposite of _.mapValues; this method creates an object with the same values as object and keys generated + * by running each own enumerable property of object through iteratee. + * + * @param object The object to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns the new mapped object. + */ + mapKeys( + object: List, + iteratee?: ListIterator, + thisArg?: any + ): Dictionary; + + /** + * @see _.mapKeys + */ + mapKeys( + object: Dictionary, + iteratee?: DictionaryIterator, + thisArg?: any + ): Dictionary; + + /** + * @see _.mapKeys + */ + mapKeys( + object: List|Dictionary, + iteratee?: TObject + ): Dictionary; + + /** + * @see _.mapKeys + */ + mapKeys( + object: List|Dictionary, + iteratee?: string + ): Dictionary; + } + + interface LoDashArrayWrapper { + /** + * @see _.mapKeys + */ + mapKeys( + iteratee?: ListIterator, + thisArg?: any + ): LoDashObjectWrapper>; + + /** + * @see _.mapKeys + */ + mapKeys( + iteratee?: TObject + ): LoDashObjectWrapper>; + + /** + * @see _.mapKeys + */ + mapKeys( + iteratee?: string + ): LoDashObjectWrapper>; + } + + interface LoDashObjectWrapper { + /** + * @see _.mapKeys + */ + mapKeys( + iteratee?: ListIterator|DictionaryIterator, + thisArg?: any + ): LoDashObjectWrapper>; + + /** + * @see _.mapKeys + */ + mapKeys( + iteratee?: TObject + ): LoDashObjectWrapper>; + + /** + * @see _.mapKeys + */ + mapKeys( + iteratee?: string + ): LoDashObjectWrapper>; + } + //_.mapValues interface LoDashStatic { /** @@ -7690,64 +7728,93 @@ declare module _ { //_.transform interface LoDashStatic { /** - * An alternative to _.reduce this method transforms object to a new accumulator object which is - * the result of running each of its elements through a callback, with each callback execution - * potentially mutating the accumulator object. The callback is bound to thisArg and invoked with - * four arguments; (accumulator, value, key, object). Callbacks may exit iteration early by - * explicitly returning false. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator The custom accumulator value. - * @param thisArg The this binding of callback. - * @return The accumulated value. - **/ - transform( - collection: Array, - callback: MemoVoidIterator, - accumulator: Acc, - thisArg?: any): Acc; + * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of + * running each of its own enumerable properties through iteratee, with each invocation potentially mutating + * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, + * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. + * + * @param object The object to iterate over. + * @param iteratee The function invoked per iteration. + * @param accumulator The custom accumulator value. + * @param thisArg The this binding of iteratee. + * @return Returns the accumulated value. + */ + transform( + object: T[], + iteratee?: MemoVoidArrayIterator, + accumulator?: TResult[], + thisArg?: any + ): TResult[]; /** - * @see _.transform - **/ - transform( - collection: List, - callback: MemoVoidIterator, - accumulator: Acc, - thisArg?: any): Acc; + * @see _.transform + */ + transform( + object: T[], + iteratee?: MemoVoidArrayIterator>, + accumulator?: Dictionary, + thisArg?: any + ): Dictionary; /** - * @see _.transform - **/ - transform( - collection: Dictionary, - callback: MemoVoidIterator, - accumulator: Acc, - thisArg?: any): Acc; + * @see _.transform + */ + transform( + object: Dictionary, + iteratee?: MemoVoidDictionaryIterator>, + accumulator?: Dictionary, + thisArg?: any + ): Dictionary; /** - * @see _.transform - **/ - transform( - collection: Array, - callback?: MemoVoidIterator, - thisArg?: any): Acc; + * @see _.transform + */ + transform( + object: Dictionary, + iteratee?: MemoVoidDictionaryIterator, + accumulator?: TResult[], + thisArg?: any + ): TResult[]; + } + + interface LoDashArrayWrapper { + /** + * @see _.transform + */ + transform( + iteratee?: MemoVoidArrayIterator, + accumulator?: TResult[], + thisArg?: any + ): LoDashArrayWrapper; /** - * @see _.transform - **/ - transform( - collection: List, - callback?: MemoVoidIterator, - thisArg?: any): Acc; + * @see _.transform + */ + transform( + iteratee?: MemoVoidArrayIterator>, + accumulator?: Dictionary, + thisArg?: any + ): LoDashObjectWrapper>; + } + + interface LoDashObjectWrapper { + /** + * @see _.transform + */ + transform( + iteratee?: MemoVoidDictionaryIterator>, + accumulator?: Dictionary, + thisArg?: any + ): LoDashObjectWrapper>; /** - * @see _.transform - **/ - transform( - collection: Dictionary, - callback?: MemoVoidIterator, - thisArg?: any): Acc; + * @see _.transform + */ + transform( + iteratee?: MemoVoidDictionaryIterator, + accumulator?: TResult[], + thisArg?: any + ): LoDashArrayWrapper; } //_.values @@ -8712,7 +8779,7 @@ declare module _ { } interface ListIterator { - (value: T, index: number, collection: T[]): TResult; + (value: T, index: number, collection: List): TResult; } interface DictionaryIterator { @@ -8729,14 +8796,13 @@ declare module _ { interface MemoIterator { (prev: TResult, curr: T, indexOrKey?: any, list?: T[]): TResult; } - /* - interface MemoListIterator { - (prev: TResult, curr: T, index: number, list?: T[]): TResult; + + interface MemoVoidArrayIterator { + (acc: TResult, curr: T, index?: number, arr?: T[]): void; } - interface MemoObjectIterator { - (prev: TResult, curr: T, index: string, object?: Dictionary): TResult; + interface MemoVoidDictionaryIterator { + (acc: TResult, curr: T, key?: string, dict?: Dictionary): void; } - */ //interface Collection {} diff --git a/mailcheck/mailcheck-tests.ts b/mailcheck/mailcheck-tests.ts index 4a5caa12a..b3152b1d9 100644 --- a/mailcheck/mailcheck-tests.ts +++ b/mailcheck/mailcheck-tests.ts @@ -14,6 +14,7 @@ var superStringDistance = function(string1: string, string2: string): number { $('#email').on('blur', function() { $(this).mailcheck({ + email: 'nonoptional@example.com', domains: domains, // optional secondLevelDomains: secondLevelDomains, // optional topLevelDomains: topLevelDomains, // optional @@ -28,6 +29,7 @@ $('#email').on('blur', function() { }); Mailcheck.run({ + email: 'nonoptional@example.com', domains: domains, // optional secondLevelDomains: secondLevelDomains, // optional topLevelDomains: topLevelDomains, // optional @@ -41,6 +43,7 @@ Mailcheck.run({ }); MC.run({ + email: 'nonoptional@example.com', domains: domains, // optional secondLevelDomains: secondLevelDomains, // optional topLevelDomains: topLevelDomains, // optional diff --git a/mailcheck/mailcheck.d.ts b/mailcheck/mailcheck.d.ts index 64b5f93c4..66d90ba0c 100644 --- a/mailcheck/mailcheck.d.ts +++ b/mailcheck/mailcheck.d.ts @@ -46,6 +46,7 @@ declare module MailcheckModule { } export interface IOptions { + email: string; domains?: string[]; secondLevelDomains?: string[]; topLevelDomains?: string[]; diff --git a/maker.js/makerjs-tests.ts b/maker.js/makerjs-tests.ts index ca2aea17b..be5b53229 100644 --- a/maker.js/makerjs-tests.ts +++ b/maker.js/makerjs-tests.ts @@ -25,6 +25,7 @@ function test() { } function testAngle() { + makerjs.angle.areEqual(12, 13); makerjs.angle.mirror(45, true, false); makerjs.angle.noRevolutions(90); makerjs.angle.ofArcEnd(paths.arc); @@ -63,12 +64,15 @@ function test() { } function testModel(){ + makerjs.model.combine(model, model, true, false, true, false); makerjs.model.convertUnits(model, makerjs.unitType.Centimeter); + makerjs.model.getSimilarPathId(model, 'foo'); makerjs.model.mirror(model, false, true); makerjs.model.move(makerjs.model.originate(model, [9,9]), [0,0]); makerjs.model.moveRelative(model, [1,1]); makerjs.model.originate(model); makerjs.model.rotate(makerjs.model.scale(model, 6), 45, [0,0]); + makerjs.model.walkPaths(model, (modelContext: MakerJs.IModel, pathId: string, pathContext: MakerJs.IPath) => {}); } function testModels(): MakerJs.IModel[] { @@ -83,11 +87,13 @@ function test() { new makerjs.models.Ring(7, 7), new makerjs.models.RoundRectangle(2, 2, 0), new makerjs.models.SCurve(5, .9), - new makerjs.models.Square(8) + new makerjs.models.Square(8), + new makerjs.models.Star(5, 10, 5) ]; } function testPath() { + makerjs.path.areEqual(paths.line, paths.circle); makerjs.path.breakAtPoint(paths.arc, [0,0]).type; makerjs.path.dogbone(paths.line, paths.line, 7); makerjs.path.fillet(paths.arc, paths.line, 4); @@ -121,6 +127,7 @@ function test() { makerjs.point.closest([0,0], [p1, p2]); makerjs.point.fromAngleOnCircle(22, paths.circle); makerjs.point.fromArc(paths.arc); + makerjs.point.fromPathEnds(paths.line); makerjs.point.fromPolar(Math.PI, 7); makerjs.point.middle(paths.line); makerjs.point.mirror(p1, true, false); diff --git a/maker.js/makerjs.d.ts b/maker.js/makerjs.d.ts index 2d5c3419a..bcba375f8 100644 --- a/maker.js/makerjs.d.ts +++ b/maker.js/makerjs.d.ts @@ -37,6 +37,12 @@ declare module MakerJs { * @param accuracy Optional exemplar of number of decimal places. */ function round(n: number, accuracy?: number): number; + /** + * Clone an object. + * + * @param objectToClone The object to clone. + * @returns A new clone of the original object. + */ function cloneObject(objectToClone: T): T; /** * Copy the properties from one object to another object. @@ -294,6 +300,14 @@ declare module MakerJs { function isModel(item: any): boolean; } declare module MakerJs.angle { + /** + * Find out if two angles are equal. + * + * @param a First angle. + * @param b Second angle. + * @returns true if angles are the same, false if they are not + */ + function areEqual(angle1: number, angle2: number): boolean; /** * Ensures an angle is not greater than 360 * @@ -388,7 +402,7 @@ declare module MakerJs.point { * @param b Second point. * @returns true if points are the same, false if they are not */ - function areEqualRounded(a: IPoint, b: IPoint): boolean; + function areEqualRounded(a: IPoint, b: IPoint, accuracy?: number): boolean; /** * Clone a point into a new point. * @@ -426,14 +440,21 @@ declare module MakerJs.point { * @returns Array with 2 elements: [0] is the point object corresponding to the start angle, [1] is the point object corresponding to the end angle. */ function fromArc(arc: IPathArc): IPoint[]; + /** + * Get the two end points of a path. + * + * @param pathContext The path object. + * @returns Array with 2 elements: [0] is the point object corresponding to the origin, [1] is the point object corresponding to the end. + */ + function fromPathEnds(pathContext: IPath): IPoint[]; /** * Get the middle point of a path. Currently only supports Arc and Line paths. * - * @param path The path object. + * @param pathContext The path object. * @param ratio Optional ratio (between 0 and 1) of point along the path. Default is .5 for middle. * @returns Point on the path, in the middle of the path. */ - function middle(path: IPath, ratio?: number): IPoint; + function middle(pathContext: IPath, ratio?: number): IPoint; /** * Create a clone of a point, mirrored on either or both x and y axes. * @@ -477,6 +498,14 @@ declare module MakerJs.point { function zero(): IPoint; } declare module MakerJs.path { + /** + * Find out if two paths are equal. + * + * @param a First path. + * @param b Second path. + * @returns true if paths are the same, false if they are not + */ + function areEqual(path1: IPath, path2: IPath): boolean; /** * Create a clone of a path, mirrored on either or both x and y axes. * @@ -600,6 +629,13 @@ declare module MakerJs.paths { } } declare module MakerJs.model { + /** + * Get an unused id in the paths map with the same prefix. + * + * @param modelContext The model containing the paths map. + * @param pathId The pathId to use directly (if unused), or as a prefix. + */ + function getSimilarPathId(modelContext: IModel, pathId: string): string; /** * Moves all of a model's children (models and paths, recursively) in reference to a single common origin. Useful when points between children need to connect to each other. * @@ -658,6 +694,33 @@ declare module MakerJs.model { * @returns The scaled model (for chaining). */ function convertUnits(modeltoConvert: IModel, destUnitType: string): IModel; + /** + * Callback signature for walkPaths. + */ + interface IModelPathCallback { + (modelContext: IModel, pathId: string, pathContext: IPath): void; + } + /** + * Recursively walk through all paths for a given model. + * + * @param modelContext The model to walk. + * @param callback Callback for each path. + */ + function walkPaths(modelContext: IModel, callback: IModelPathCallback): void; +} +declare module MakerJs.model { + /** + * Combine 2 models. The models should be originated. + * + * @param modelA First model to combine. + * @param modelB Second model to combine. + * @param includeAInsideB Flag to include paths from modelA which are inside of modelB. + * @param includeAOutsideB Flag to include paths from modelA which are outside of modelB. + * @param includeBInsideA Flag to include paths from modelB which are inside of modelA. + * @param includeBOutsideA Flag to include paths from modelB which are outside of modelA. + * @param farPoint Optional point of reference which is outside the bounds of both models. + */ + function combine(modelA: IModel, modelB: IModel, includeAInsideB: boolean, includeAOutsideB: boolean, includeBInsideA: boolean, includeBOutsideA: boolean, farPoint?: IPoint): void; } declare module MakerJs.units { /** @@ -1023,6 +1086,18 @@ declare module MakerJs.exporter { viewBox: boolean; } } +declare module MakerJs.models { + class ConnectTheDots implements IModel { + paths: IPathMap; + constructor(isClosed: boolean, points: IPoint[]); + } +} +declare module MakerJs.models { + class Polygon extends ConnectTheDots { + constructor(numberOfSides: number, radius: number, firstCornerAngleInDegrees?: number); + static getPoints(numberOfSides: number, radius: number, firstCornerAngleInDegrees?: number): IPoint[]; + } +} declare module MakerJs.models { class BoltCircle implements IModel { paths: IPathMap; @@ -1035,12 +1110,6 @@ declare module MakerJs.models { constructor(width: number, height: number, holeRadius: number); } } -declare module MakerJs.models { - class ConnectTheDots implements IModel { - paths: IPathMap; - constructor(isClosed: boolean, points: IPoint[]); - } -} declare module MakerJs.models { class RoundRectangle implements IModel { paths: IPathMap; @@ -1058,12 +1127,6 @@ declare module MakerJs.models { constructor(startAngle: number, endAngle: number, sweepRadius: number, slotRadius: number); } } -declare module MakerJs.models { - class Polygon extends ConnectTheDots { - constructor(numberOfSides: number, radius: number, firstCornerAngleInDegrees?: number); - static getPoints(numberOfSides: number, radius: number, firstCornerAngleInDegrees?: number): IPoint[]; - } -} declare module MakerJs.models { class Rectangle extends ConnectTheDots { constructor(width: number, height: number); @@ -1086,3 +1149,10 @@ declare module MakerJs.models { constructor(side: number); } } +declare module MakerJs.models { + class Star implements IModel { + paths: IPathMap; + constructor(numberOfPoints: number, outerRadius: number, innerRadius?: number, skipPoints?: number); + static InnerRadiusRatio(numberOfPoints: number, skipPoints: number): number; + } +} diff --git a/material-ui/material-ui-tests.tsx b/material-ui/material-ui-tests.tsx new file mode 100644 index 000000000..eed734d95 --- /dev/null +++ b/material-ui/material-ui-tests.tsx @@ -0,0 +1,476 @@ +/// +/// + +import * as React from "react/addons"; +import mui = require("material-ui"); +import Colors = require("material-ui/lib/styles/colors"); +import AppBar = require("material-ui/lib/app-bar"); +import IconButton = require("material-ui/lib/icon-button"); +import FlatButton = require("material-ui/lib/flat-button"); +import Avatar = require("material-ui/lib/avatar"); +import FontIcon = require("material-ui/lib/font-icon"); +import Typography = require("material-ui/lib/styles/typography"); +import RaisedButton = require("material-ui/lib/raised-button"); +import FloatingActionButton = require("material-ui/lib/floating-action-button"); +import Card = require("material-ui/lib/card/card"); +import CardHeader = require("material-ui/lib/card/card-header"); +import CardText = require("material-ui/lib/card/card-text"); +import CardActions = require("material-ui/lib/card/card-actions"); +import Dialog = require("material-ui/lib/dialog"); +import DropDownMenu = require("material-ui/lib/drop-down-menu"); +import RadioButtonGroup = require("material-ui/lib/radio-button-group"); +import RadioButton = require("material-ui/lib/radio-button"); +import Toggle = require("material-ui/lib/toggle"); +import TextField = require("material-ui/lib/text-field"); +import SelectField = require("material-ui/lib/select-field"); +import IconMenu = require("material-ui/lib/menus/icon-menu"); +import Menu = require('material-ui/lib/menus/menu'); +import MenuItem = require('material-ui/lib/menus/menu-item'); +import MenuDivider = require('material-ui/lib/menus/menu-divider'); + +import NavigationClose = require("material-ui/lib/svg-icon"); // TODO: Should actually import the actual "material-ui/lib/svg-icons/navigation/close", but they aren't defined yet. +import FileFolder = require("material-ui/lib/svg-icon"); // TODO: Should actually import the actual "material-ui/lib/svg-icons/file/folder", but they aren't defined yet. +import ToggleStar = require("material-ui/lib/svg-icon"); // TODO: Should actually import the actual "material-ui/lib/svg-icons/toggle/star", but they aren't defined yet. +import ActionGrade = require("material-ui/lib/svg-icon"); // TODO: Should actually import the actual "material-ui/lib/svg-icons/action/grade", but they aren't defined yet. +import ToggleStarBorder = require("material-ui/lib/svg-icon"); // TODO: Should actually import the actual "material-ui/lib/svg-icons/toggle/star-border", but they aren't defined yet. +import ArrowDropRight = require("material-ui/lib/svg-icon"); // TODO: Should actually import the actual "material-ui/lib/svg-icons/toggle/star-border", but they aren't defined yet. + +class MaterialUiTests extends React.Component<{}, {}> implements React.LinkedStateMixin { + + // injected with mixin + linkState: (key: string) => React.ReactLink; + dialog: mui.Dialog; + //dialog2: Dialog; // can't get type directly from require("material-ui/lib/dialog"); + + private touchTapEventHandler(e: __MaterialUI.TouchTapEvent) { + this.dialog.show(); + //this.dialog2.show(); + } + private formEventHandler(e: React.FormEvent) { + } + private selectFieldChangeHandler(e: __MaterialUI.TouchTapEvent, si: number, mi: any) { + } + + render() { + + // "http://material-ui.com/#/customization/themes" + let ThemeManager = new mui.Styles.ThemeManager(); + ThemeManager.setTheme(ThemeManager.types.LIGHT); + ThemeManager.setTheme(ThemeManager.types.DARK); + let muiTheme = ThemeManager.getCurrentTheme(); + ThemeManager.setComponentThemes({ + toggle: { + thumbOnColor: "#00bcd4", + trackOnColor: "LightCyan", + } + }); + + // "http://material-ui.com/#/customization/inline-styles" + let Checkbox = mui.Checkbox; + let element: React.ReactElement; + element = + element = React.createElement<__MaterialUI.CheckboxProps>(Checkbox, { + id: "checkboxId1", name: "checkboxName1", value: "checkboxValue1", label: "went for a run today", style: { + width: '50%', + margin: '0 auto' + }, iconStyle: { + fill: '#FF4081' + } + }); + + // "http://material-ui.com/#/customization/colors" + ThemeManager.setComponentThemes({ + toggle: { + thumbOnColor: Colors.cyan200, + thumbOffColor: Colors.grey400, + } + }); + + // "http://material-ui.com/#/components/appbar" + element = + element = } + iconElementRight={} />; + + // "http://material-ui.com/#/components/avatars" + //image avatar + element = ; + //SvgIcon avatar + element = } />; + //SvgIcon avatar with custom colors + element = } + color={Colors.orange200} + backgroundColor={Colors.pink400} />; + //FontIcon avatar + element = + } />; + //FontIcon avatar with custom colors + element = } + color={Colors.blue300} + backgroundColor={Colors.indigo900} />; + //Letter avatar + element = A; + //Letter avatar with custom colors + element = + + + + // "http://material-ui.com/#/components/buttons" + element = + + ; + element = + + ; + element = + + ; + + // "http://material-ui.com/#/components/cards" + element = + A} + showExpandableButton={true}> + + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. + + + + + + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. + + ; + + // "http://material-ui.com/#/components/date-picker" + + + // "http://material-ui.com/#/components/dialog" + let standardActions = [ + { text: 'Cancel' }, + { text: 'Submit', onTouchTap: this.touchTapEventHandler, ref: 'submit' } + ]; + + element = + The actions in this window are created from the json that's passed in. + ; + + //Custom Actions + let customActions = [ + , + + ]; + + element = + The actions in this window were passed in as an array of react objects. + ; + + + // "http://material-ui.com/#/components/dropdown-menu" + let menuItems = [ + { payload: '1', text: 'Never' }, + { payload: '2', text: 'Every Night' }, + { payload: '3', text: 'Weeknights' }, + { payload: '4', text: 'Weekends' }, + { payload: '5', text: 'Weekly' }, + ]; + element = ; + + // "http://material-ui.com/#/components/icons" + element = home; + + // "http://material-ui.com/#/components/icon-buttons" + //Method 1: muidocs-icon-github is defined in a style sheet. + element = ; + //Method 2: ActionGrade is a component created using mui.SvgIcon. + element = + + ; + //Method 3: Manually creating a mui.FontIcon component within IconButton + element = + + ; + //Method 4: Using Google material-icons + element = settings_system_daydream; + + // "http://material-ui.com/#/components/icon-menus" + element = }> + + + + + + ; + + // "http://material-ui.com/#/components/left-nav" + + + // "http://material-ui.com/#/components/lists" + + + // "http://material-ui.com/#/components/menus" + element = + + + + + ; + element = + + + + + + + + } /> + } /> + } /> + } /> + } /> + + + ; + + // "http://material-ui.com/#/components/paper" + + + // "http://material-ui.com/#/components/progress" + + + // "http://material-ui.com/#/components/refresh-indicator" + + + // "http://material-ui.com/#/components/sliders" + + + // "http://material-ui.com/#/components/switches" + element = ; + element = ; + element = } + unCheckedIcon={} + label="custom icon" />; + + element = + ; + ; + + ; + + element = ; + + element = ; + + element = ; + + // "http://material-ui.com/#/components/snackbar" + + + // "http://material-ui.com/#/components/table" + + + // "http://material-ui.com/#/components/tabs" + + + // "http://material-ui.com/#/components/text-fields" + element = ; + element = ; + element = ; + element = ; + element = ('valueLinkValue') } />; + element = ; + element = ; + element = ; + element = ; + element = ; + element = ; + element = ; + + //Select Fields + let arbitraryArrayMenuItems = [ + { + id: 0, + name: "zero", + }, + ]; + element = ; + element = ; + element = ; + element = ; + + //Floating Hint Text Labels + element = ; + element = ; + element = ; + element = ('floatingValueLinkValue') } />; + element = ; + element = ; + element = ; + element = ; + element = ; + element = ; + + + // "http://material-ui.com/#/components/time-picker" + + + // "http://material-ui.com/#/components/toolbars" + + return element; + } +} \ No newline at end of file diff --git a/material-ui/material-ui.d.ts b/material-ui/material-ui.d.ts new file mode 100644 index 000000000..c5c37ee91 --- /dev/null +++ b/material-ui/material-ui.d.ts @@ -0,0 +1,2096 @@ +// Type definitions for material-ui v0.11.1 +// Project: https://github.com/callemall/material-ui +// Definitions by: Nathan Brown +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "material-ui" { + // The reason for exporting the namespace types (__MaterialUI.*) is to also export the type for casting variable. + + export import AppBar = __MaterialUI.AppBar; // require('material-ui/lib/app-bar'); + export import AppCanvas = __MaterialUI.AppCanvas; // require('material-ui/lib/app-canvas'); + export import Avatar = __MaterialUI.Avatar; // require('material-ui/lib/avatar'); + export import BeforeAfterWrapper = __MaterialUI.BeforeAfterWrapper; // require('material-ui/lib/before-after-wrapper'); + export import Card = __MaterialUI.Card.Card; // require('material-ui/lib/card/card'); + export import CardActions = __MaterialUI.Card.CardActions; // require('material-ui/lib/card/card-actions'); + export import CardExpandable = __MaterialUI.Card.CardExpandable; // require('material-ui/lib/card/card-expandable'); + export import CardHeader = __MaterialUI.Card.CardHeader; // require('material-ui/lib/card/card-header'); + export import CardMedia = __MaterialUI.Card.CardMedia; // require('material-ui/lib/card/card-media'); + export import CardText = __MaterialUI.Card.CardText; // require('material-ui/lib/card/card-text'); + export import CardTitle = __MaterialUI.Card.CardTitle; // require('material-ui/lib/card/card-title'); + export import Checkbox = __MaterialUI.Checkbox; // require('material-ui/lib/checkbox'); + export import CircularProgress = __MaterialUI.CircularProgress; // require('material-ui/lib/circular-progress'); + export import ClearFix = __MaterialUI.ClearFix; // require('material-ui/lib/clearfix'); + export import DatePicker = __MaterialUI.DatePicker.DatePicker; // require('material-ui/lib/date-picker/date-picker'); + export import DatePickerDialog = __MaterialUI.DatePicker.DatePickerDialog; // require('material-ui/lib/date-picker/date-picker-dialog'); + export import Dialog = __MaterialUI.Dialog // require('material-ui/lib/dialog'); + export import DropDownIcon = __MaterialUI.DropDownIcon; // require('material-ui/lib/drop-down-icon'); + export import DropDownMenu = __MaterialUI.DropDownMenu; // require('material-ui/lib/drop-down-menu'); + export import EnhancedButton = __MaterialUI.EnhancedButton; // require('material-ui/lib/enhanced-button'); + export import FlatButton = __MaterialUI.FlatButton; // require('material-ui/lib/flat-button'); + export import FloatingActionButton = __MaterialUI.FloatingActionButton; // require('material-ui/lib/floating-action-button'); + export import FontIcon = __MaterialUI.FontIcon; // require('material-ui/lib/font-icon'); + export import IconButton = __MaterialUI.IconButton; // require('material-ui/lib/icon-button'); + export import IconMenu = __MaterialUI.Menus.IconMenu; // require('material-ui/lib/menus/icon-menu'); + export import LeftNav = __MaterialUI.LeftNav; // require('material-ui/lib/left-nav'); + export import LinearProgress = __MaterialUI.LinearProgress; // require('material-ui/lib/linear-progress'); + export import List = __MaterialUI.Lists.List; // require('material-ui/lib/lists/list'); + export import ListDivider = __MaterialUI.Lists.ListDivider; // require('material-ui/lib/lists/list-divider'); + export import ListItem = __MaterialUI.Lists.ListItem; // require('material-ui/lib/lists/list-item'); + export import Menu = __MaterialUI.Menu.Menu; // require('material-ui/lib/menu/menu'); + export import MenuItem = __MaterialUI.Menu.MenuItem; // require('material-ui/lib/menu/menu-item'); + export import Mixins = __MaterialUI.Mixins; // require('material-ui/lib/mixins/'); + export import Overlay = __MaterialUI.Overlay; // require('material-ui/lib/overlay'); + export import Paper = __MaterialUI.Paper; // require('material-ui/lib/paper'); + export import RadioButton = __MaterialUI.RadioButton; // require('material-ui/lib/radio-button'); + export import RadioButtonGroup = __MaterialUI.RadioButtonGroup; // require('material-ui/lib/radio-button-group'); + export import RaisedButton = __MaterialUI.RaisedButton; // require('material-ui/lib/raised-button'); + export import RefreshIndicator = __MaterialUI.RefreshIndicator; // require('material-ui/lib/refresh-indicator'); + export import Ripples = __MaterialUI.Ripples; // require('material-ui/lib/ripples/'); + export import SelectField = __MaterialUI.SelectField; // require('material-ui/lib/select-field'); + export import Slider = __MaterialUI.Slider; // require('material-ui/lib/slider'); + export import SvgIcon = __MaterialUI.SvgIcon; // require('material-ui/lib/svg-icon'); + + import NavigationMenu = require('material-ui/lib/svg-icons/navigation/menu'); + import NavigationChevronLeft = require('material-ui/lib/svg-icons/navigation/chevron-left'); + import NavigationChevronRight = require('material-ui/lib/svg-icons/navigation/chevron-right'); + export var Icons: { + NavigationMenu: __MaterialUI.NavigationMenu; + NavigationChevronLeft: __MaterialUI.NavigationChevronLeft; + NavigationChevronRight: __MaterialUI.NavigationChevronRight; + }; + + export import Styles = __MaterialUI.Styles; // require('material-ui/lib/styles/'); + export import Snackbar = __MaterialUI.Snackbar; // require('material-ui/lib/snackbar'); + export import Tab = __MaterialUI.Tabs.Tab; // require('material-ui/lib/tabs/tab'); + export import Tabs = __MaterialUI.Tabs.Tabs; // require('material-ui/lib/tabs/tabs'); + export import Table = __MaterialUI.Table.Table; // require('material-ui/lib/table/table'); + export import TableBody = __MaterialUI.Table.TableBody; // require('material-ui/lib/table/table-body'); + export import TableFooter = __MaterialUI.Table.TableFooter; // require('material-ui/lib/table/table-footer'); + export import TableHeader = __MaterialUI.Table.TableHeader; // require('material-ui/lib/table/table-header'); + export import TableHeaderColumn = __MaterialUI.Table.TableHeaderColumn; // require('material-ui/lib/table/table-header-column'); + export import TableRow = __MaterialUI.Table.TableRow; // require('material-ui/lib/table/table-row'); + export import TableRowColumn = __MaterialUI.Table.TableRowColumn; // require('material-ui/lib/table/table-row-column'); + export import Theme = __MaterialUI.Theme; // require('material-ui/lib/theme'); + export import Toggle = __MaterialUI.Toggle; // require('material-ui/lib/toggle'); + export import TimePicker = __MaterialUI.TimePicker; // require('material-ui/lib/time-picker'); + export import TextField = __MaterialUI.TextField; // require('material-ui/lib/text-field'); + export import Toolbar = __MaterialUI.Toolbar.Toolbar; // require('material-ui/lib/toolbar/toolbar'); + export import ToolbarGroup = __MaterialUI.Toolbar.ToolbarGroup; // require('material-ui/lib/toolbar/toolbar-group'); + export import ToolbarSeparator = __MaterialUI.Toolbar.ToolbarSeparator; // require('material-ui/lib/toolbar/toolbar-separator'); + export import ToolbarTitle = __MaterialUI.Toolbar.ToolbarTitle; // require('material-ui/lib/toolbar/toolbar-title'); + export import Tooltip = __MaterialUI.Tooltip; // require('material-ui/lib/tooltip'); + export import Utils = __MaterialUI.Utils; // require('material-ui/lib/utils/'); + + // export type definitions + export import TouchTapEvent = __MaterialUI.TouchTapEvent; + export import TouchTapEventHandler = __MaterialUI.TouchTapEventHandler; + export import DialogAction = __MaterialUI.DialogAction; +} + +declare namespace __MaterialUI { + import React = __React; + + // ReactLink is from "react/addons" + interface ReactLink { + value: T; + requestChange(newValue: T): void; + } + + // What's common between React.TouchEvent and React.MouseEvent + interface TouchTapEvent extends React.SyntheticEvent { + altKey: boolean; + ctrlKey: boolean; + getModifierState(key: string): boolean; + metaKey: boolean; + shiftKey: boolean; + } + + // What's common between React.TouchEventHandler and React.MouseEventHandler + interface TouchTapEventHandler extends React.EventHandler { } + + // more specific than React.HTMLAttributes + + interface AppBarProps extends React.Props { + iconClassNameLeft?: string; + iconClassNameRight?: string; + iconElementLeft?: React.ReactElement; + iconElementRight?: React.ReactElement; + iconStyleRight?: string; + style?: React.CSSProperties; + showMenuIconButton?: boolean; + title?: React.ReactNode; + zDepth?: number; + + onLeftIconButtonTouchTap?: TouchTapEventHandler; + onRightIconButtonTouchTap?: TouchTapEventHandler; + } + export class AppBar extends React.Component{ + } + + interface AppCanvasProps extends React.Props { + } + export class AppCanvas extends React.Component { + } + + interface AvatarProps extends React.Props { + icon?: React.ReactElement; + backgroundColor?: string; + color?: string; + size?: number; + src?: string; + style?: React.CSSProperties; + } + export class Avatar extends React.Component { + } + + interface BeforeAfterWrapperProps extends React.Props { + beforeStyle?: React.CSSProperties; + afterStyle?: React.CSSProperties; + beforeElementType?: string; + afterElementType?: string; + elementType?: string; + } + export class BeforeAfterWrapper extends React.Component { + } + + namespace Card { + + interface CardProps extends React.Props { + expandable?: boolean; + initiallyExpanded?: boolean; + onExpandedChange?: (isExpanded: boolean) => void; + style?: React.CSSProperties; + } + export class Card extends React.Component { + } + + interface CardActionsProps extends React.Props { + expandable?: boolean; + showExpandableButton?: boolean; + } + export class CardActions extends React.Component { + } + + interface CardExpandableProps extends React.Props { + onExpanding?: (isExpanded: boolean) => void; + expanded?: boolean; + } + export class CardExpandable extends React.Component { + } + + interface CardHeaderProps extends React.Props { + expandable?: boolean; + showExpandableButton?: boolean; + title?: string | React.ReactElement; + titleColor?: string; + titleStyle?: React.CSSProperties; + subtitle?: string | React.ReactElement; + subtitleColor?: string; + subtitleStyle?: React.CSSProperties; + textStyle?: React.CSSProperties; + style?: React.CSSProperties; + avatar: React.ReactElement | string; + } + export class CardHeader extends React.Component { + } + + interface CardMediaProps extends React.Props { + expandable?: boolean; + overlay?: React.ReactNode; + overlayStyle?: React.CSSProperties; + overlayContainerStyle?: React.CSSProperties; + overlayContentStyle?: React.CSSProperties; + mediaStyle?: React.CSSProperties; + style?: React.CSSProperties; + } + export class CardMedia extends React.Component { + } + + interface CardTextProps extends React.Props { + expandable?: boolean; + color?: string; + style?: React.CSSProperties; + } + export class CardText extends React.Component { + } + + interface CardTitleProps extends React.Props { + expandable?: boolean; + showExpandableButton?: boolean; + title?: string | React.ReactElement; + titleColor?: string; + titleStyle?: React.CSSProperties; + subtitle?: string | React.ReactElement; + subtitleColor?: string; + subtitleStyle?: React.CSSProperties; + textStyle?: React.CSSProperties; + style?: React.CSSProperties; + } + export class CardTitle extends React.Component { + } + } + + // what's not commonly overridden by Checkbox, RadioButton, or Toggle + interface CommonEnhancedSwitchProps extends React.HTMLAttributesBase { + // is root element + id?: string; + iconStyle?: React.CSSProperties; + labelStyle?: React.CSSProperties; + rippleStyle?: React.CSSProperties; + thumbStyle?: React.CSSProperties; + trackStyle?: React.CSSProperties; + name?: string; + value?: string; + label?: string; + required?: boolean; + disabled?: boolean; + defaultSwitched?: boolean; + disableFocusRipple?: boolean; + disableTouchRipple?: boolean; + } + + interface EnhancedSwitchProps extends CommonEnhancedSwitchProps { + // is root element + inputType: string; + switchElement: React.ReactElement; + onParentShouldUpdate: (isInputChecked: boolean) => void; + switched: boolean; + rippleColor?: string; + onSwitch?: (e: React.MouseEvent, isInputChecked: boolean) => void; + labelPosition?: string; + } + export class EnhancedSwitch extends React.Component { + isSwitched(): boolean; + setSwitched(newSwitchedValue: boolean): void; + getValue(): any; + isKeyboardFocused(): boolean; + } + + interface CheckboxProps extends CommonEnhancedSwitchProps { + // is root element + checkedIcon?: React.ReactElement<{ style?: React.CSSProperties }>; // Normally an SvgIcon + defaultChecked?: boolean; + iconStyle?: React.CSSProperties; + label?: string; + labelStyle?: React.CSSProperties; + labelPosition?: string; + style?: React.CSSProperties; + checked?: boolean; + unCheckedIcon?: React.ReactElement<{ style?: React.CSSProperties }>; // Normally an SvgIcon + + disabled?: boolean; + valueLink?: ReactLink; + checkedLink?: ReactLink; + + onCheck?: (event: React.MouseEvent, checked: boolean) => void; + } + export class Checkbox extends React.Component { + isChecked(): void; + setChecked(newCheckedValue: boolean): void; + } + + interface CircularProgressProps extends React.Props { + mode?: string; + value?: number; + min?: number; + max?: number; + size?: number; + color?: string; + innerStyle?: React.CSSProperties; + + } + export class CircularProgress extends React.Component { + } + + interface ClearFixProps extends React.Props { + } + export class ClearFix extends React.Component { + } + + namespace DatePicker { + interface DatePickerProps extends React.Props { + autoOk?: boolean; + defaultDate?: Date; + formatDate?: string; + hideToolbarYearChange?: boolean; + maxDate?: Date; + minDate?: Date; + mode?: string; + onDismiss?: () => void; + + // e is always null + onChange?: (e: any, d: Date) => void; + + onFocus?: React.FocusEventHandler; + onShow?: () => void; + onTouchTap?: React.TouchEventHandler; + shouldDisableDate?: (day: Date) => boolean; + showYearSelector?: boolean; + textFieldStyle?: React.CSSProperties; + } + export class DatePicker extends React.Component { + } + + interface DatePickerDialogProps extends React.Props { + disableYearSelection?: boolean; + initialDate?: Date; + maxDate?: Date; + minDate?: Date; + onAccept?: (d: Date) => void; + onClickAway?: () => void; + onDismiss?: () => void; + onShow?: () => void; + shouldDisableDate?: (day: Date) => boolean; + showYearSelector?: boolean; + } + export class DatePickerDialog extends React.Component { + } + } + + export interface DialogAction { + text: string; + ref?: string; + + onTouchTap?: TouchTapEventHandler; + onClick?: React.MouseEventHandler; + } + interface DialogProps extends React.Props { + actions?: Array>; + actionFocus?: string; + autoDetectWindowHeight?: boolean; + autoScrollBodyContent?: boolean; + bodyStyle?: React.CSSProperties; + contentClassName?: string; + contentInnerStyle?: React.CSSProperties; + contentStyle?: React.CSSProperties; + modal?: boolean; + openImmediately?: boolean; + repositionOnUpdate?: boolean; + title?: React.ReactNode; + + onClickAway?: () => void; + onDismiss?: () => void; + onShow?: () => void; + } + export class Dialog extends React.Component { + dismiss(): void; + show(): void; + } + + interface DropDownIconProps extends React.Props { + menuItems: Menu.MenuItemRequest[]; + closeOnMenuItemTouchTap?: boolean; + iconStyle?: React.CSSProperties; + iconClassName?: string; + iconLigature?: string; + + onChange?: Menu.ItemTapEventHandler; + } + export class DropDownIcon extends React.Component { + } + + interface DropDownMenuProps extends React.Props { + displayMember?: string; + valueMember?: string; + autoWidth?: boolean; + menuItems: Menu.MenuItemRequest[]; + menuItemStyle?: React.CSSProperties; + selectedIndex?: number; + underlineStyle?: React.CSSProperties; + iconStyle?: React.CSSProperties; + labelStyle?: React.CSSProperties; + style?: React.CSSProperties; + disabled?: boolean; + valueLink?: ReactLink; + value?: number; + + onChange?: Menu.ItemTapEventHandler; + } + export class DropDownMenu extends React.Component { + } + + // non generally overridden elements of EnhancedButton + interface SharedEnhancedButtonProps extends React.HTMLAttributesBase { + centerRipple?: boolean; + containerElement?: string | React.ReactElement; + disabled?: boolean; + disableFocusRipple?: boolean; + disableKeyboardFocus?: boolean; + disableTouchRipple?: boolean; + keyboardFocused?: boolean; + linkButton?: boolean; + focusRippleColor?: string; + focusRippleOpacity?: number; + touchRippleOpacity?: number; + tabIndex?: number; + + onBlur?: React.FocusEventHandler; + onFocus?: React.FocusEventHandler; + onKeyboardFocus?: (e: React.FocusEvent, isKeyboardFocused: boolean) => void; + onKeyDown?: React.KeyboardEventHandler; + onKeyUp?: React.KeyboardEventHandler; + onMouseEnter?: React.MouseEventHandler; + onMouseLeave?: React.MouseEventHandler; + onTouchStart?: React.TouchEventHandler; + onTouchEnd?: React.TouchEventHandler; + onTouchTap?: TouchTapEventHandler; + } + + interface EnhancedButtonProps extends SharedEnhancedButtonProps { + touchRippleColor?: string; + focusRippleColor?: string; + style?: React.CSSProperties; + } + export class EnhancedButton extends React.Component { + } + + interface FlatButtonProps extends SharedEnhancedButtonProps { + hoverColor?: string; + label?: string; + labelPosition?: string; + labelStyle?: React.CSSProperties; + linkButton?: boolean; + primary?: boolean; + secondary?: boolean; + rippleColor?: string; + style?: React.CSSProperties; + } + export class FlatButton extends React.Component { + } + + interface FloatingActionButtonProps extends SharedEnhancedButtonProps { + backgroundColor?: string; + disabled?: boolean; + disabledColor?: string; + iconClassName?: string; + iconStyle?: React.CSSProperties; + mini?: boolean; + secondary?: boolean; + style?: React.CSSProperties; + } + export class FloatingActionButton extends React.Component { + } + + interface FontIconProps extends React.Props { + color?: string; + hoverColor?: string; + onMouseLeave?: React.MouseEventHandler; + onMouseEnter?: React.MouseEventHandler; + style?: React.CSSProperties; + className?: string; + } + export class FontIcon extends React.Component { + } + + interface IconButtonProps extends SharedEnhancedButtonProps { + iconClassName?: string; + iconStyle?: React.CSSProperties; + style?: React.CSSProperties; + tooltip?: string; + tooltipPosition?: string; + tooltipStyles?: React.CSSProperties; + touch?: boolean; + + onBlur?: React.FocusEventHandler; + onFocus?: React.FocusEventHandler; + } + export class IconButton extends React.Component { + } + + interface LeftNavProps extends React.Props { + disableSwipeToOpen?: boolean; + docked?: boolean; + header?: React.ReactElement; + menuItems: Menu.MenuItemRequest[]; + onChange?: Menu.ItemTapEventHandler; + onNavOpen?: () => void; + onNavClose?: () => void; + openRight?: Boolean; + selectedIndex?: number; + menuItemClassName?: string; + menuItemClassNameSubheader?: string; + menuItemClassNameLink?: string; + } + export class LeftNav extends React.Component { + } + + interface LinearProgressProps extends React.Props { + mode?: string; + value?: number; + min?: number; + max?: number; + } + export class LinearProgress extends React.Component { + } + + namespace Lists { + interface ListProps extends React.Props { + insetSubheader?: boolean; + subheader?: string; + subheaderStyle?: React.CSSProperties; + zDepth?: number; + } + export class List extends React.Component { + } + + interface ListDividerProps extends React.Props { + inset?: boolean; + } + export class ListDivider extends React.Component { + } + + interface ListItemProps extends React.Props { + autoGenerateNestedIndicator?: boolean; + disableKeyboardFocus?: boolean; + initiallyOpen?: boolean; + innerDivStyle?: React.CSSProperties; + insetChildren?: boolean; + innerStyle?: React.CSSProperties; + leftAvatar?: React.ReactElement; + leftCheckbox?: React.ReactElement; + leftIcon?: React.ReactElement; + nestedLevel?: number; + nestedItems?: React.ReactElement[]; + onKeyboardFocus?: React.FocusEventHandler; + onNestedListToggle?: (item: ListItem) => void; + rightAvatar?: React.ReactElement; + rightIcon?: React.ReactElement; + rightIconButton?: React.ReactElement; + rightToggle?: React.ReactElement; + primaryText?: React.ReactNode; + secondaryText?: React.ReactNode; + secondaryTextLines?: number; + } + export class ListItem extends React.Component { + } + } + + // Old menu implementation. Being replaced by new "menus". + namespace Menu { + interface ItemTapEventHandler { + (e: TouchTapEvent, index: number, menuItem: MenuItemRequest): void; + } + + // almost extends MenuItemProps, but certain required items are generated in Menu and not passed here. + interface MenuItemRequest extends React.Props { + // use value from MenuItem.Types.* + type?: string; + + text?: string; + data?: string; + payload?: string; + icon?: React.ReactElement; + attribute?: string; + number?: string; + toggle?: boolean; + onTouchTap?: TouchTapEventHandler; + isDisabled?: boolean; + + // for MenuItems.Types.NESTED + items?: MenuItemRequest[]; + + // for custom text or payloads + [propertyName: string]: any; + } + + interface MenuProps extends React.Props { + index: number; + text?: string; + menuItems: MenuItemRequest[]; + zDepth?: number; + active?: boolean; + onItemTap?: ItemTapEventHandler; + menuItemStyle?: React.CSSProperties; + } + export class Menu extends React.Component { + } + + interface MenuItemProps extends React.Props { + index: number; + icon?: React.ReactElement; + iconClassName?: string; + iconRightClassName?: string; + iconStyle?: React.CSSProperties; + iconRightStyle?: React.CSSProperties; + attribute?: string; + number?: string; + data?: string; + toggle?: boolean; + onTouchTap?: (e: React.MouseEvent, key: number) => void; + onToggle?: (e: React.MouseEvent, key: number, toggled: boolean) => void; + selected?: boolean; + active?: boolean; + } + export class MenuItem extends React.Component { + static Types: { LINK: string, SUBHEADER: string, NESTED: string, } + } + } + + export namespace Mixins { + interface ClickAwayable extends React.Mixin { + } + var ClickAwayable: ClickAwayable; + + interface WindowListenable extends React.Mixin { + } + var WindowListenable: WindowListenable; + + interface StylePropable extends React.Mixin { + } + var StylePropable: StylePropable + + interface StyleResizable extends React.Mixin { + } + var StyleResizable: StyleResizable + } + + interface OverlayProps extends React.Props { + autoLockScrolling?: boolean; + show?: boolean; + transitionEnabled?: boolean; + } + export class Overlay extends React.Component { + } + + interface PaperProps extends React.Props { + circle?: boolean; + rounded?: boolean; + transitionEnabled?: boolean; + zDepth?: number; + } + export class Paper extends React.Component { + } + + interface RadioButtonProps extends CommonEnhancedSwitchProps { + // is root element + defaultChecked?: boolean; + iconStyle?: React.CSSProperties; + label?: string; + labelStyle?: React.CSSProperties; + labelPosition?: string; + style?: React.CSSProperties; + value?: string; + + onCheck?: (e: React.FormEvent, selected: string) => void; + } + export class RadioButton extends React.Component { + } + + interface RadioButtonGroupProps extends React.Props { + defaultSelected?: string; + labelPosition?: string; + name: string; + style?: React.CSSProperties; + valueSelected?: string; + + onChange?: (e: React.FormEvent, selected: string) => void; + } + export class RadioButtonGroup extends React.Component { + getSelectedValue(): string; + setSelectedValue(newSelectionValue: string): void; + clearValue(): void; + } + + interface RaisedButtonProps extends SharedEnhancedButtonProps { + className?: string; + disabled?: boolean; + label?: string; + primary?: boolean; + secondary?: boolean; + labelStyle?: React.CSSProperties; + backgroundColor?: string; + labelColor?: string; + disabledBackgroundColor?: string; + disabledLabelColor?: string; + fullWidth?: boolean; + } + export class RaisedButton extends React.Component { + } + + interface RefreshIndicatorProps extends React.Props { + left: number; + percentage?: number; + size?: number; + status?: string; + top: number; + } + export class RefreshIndicator extends React.Component { + } + + namespace Ripples { + interface CircleRippleProps extends React.Props { + color?: string; + opacity?: number; + } + export class CircleRipple extends React.Component { + } + + interface FocusRippleProps extends React.Props { + color?: string; + innerStyle?: React.CSSProperties; + opacity?: number; + show?: boolean; + } + export class FocusRipple extends React.Component { + } + + interface TouchRippleProps extends React.Props { + centerRipple?: boolean; + color?: string; + opacity?: number; + } + export class TouchRipple extends React.Component { + } + } + + interface SelectFieldProps extends React.Props { + // passed to TextField + errorStyle?: React.CSSProperties; + errorText?: string; + floatingLabelText?: string; + floatingLabelStyle?: React.CSSProperties; + fullWidth?: boolean; + hintText?: string | React.ReactElement; + + // passed to DropDownMenu + displayMember?: string; + valueMember?: string; + autoWidth?: boolean; + menuItems: Menu.MenuItemRequest[]; + menuItemStyle?: React.CSSProperties; + selectedIndex?: number; + underlineStyle?: React.CSSProperties; + iconStyle?: React.CSSProperties; + labelStyle?: React.CSSProperties; + style?: React.CSSProperties; + disabled?: boolean; + valueLink?: ReactLink; + value?: number; + + onChange?: Menu.ItemTapEventHandler; + onEnterKeyDown?: React.KeyboardEventHandler; + + // own properties + selectFieldRoot?: string; + multiLine?: boolean; + type?: string; + rows?: number; + inputStyle?: React.CSSProperties; + } + export class SelectField extends React.Component { + } + + interface SliderProps extends React.Props { + name: string; + defaultValue?: number; + description?: string; + error?: string; + max?: number; + min?: number; + required?: boolean; + step?: number; + value?: number; + } + export class Slider extends React.Component { + } + + interface SvgIconProps extends React.Props { + color?: string; + hoverColor?: string; + viewBox?: string; + } + export class SvgIcon extends React.Component { + } + + interface NavigationMenuProps extends React.Props { + } + export class NavigationMenu extends React.Component { + } + + interface NavigationChevronLeftProps extends React.Props { + } + export class NavigationChevronLeft extends React.Component { + } + + interface NavigationChevronRightProps extends React.Props { + } + export class NavigationChevronRight extends React.Component { + } + + export namespace Styles { + interface AutoPrefix { + all(styles: React.CSSProperties): React.CSSProperties; + set(style: React.CSSProperties, key: string, value: string | number): void; + single(key: string): string; + singleHyphened(key: string): string; + } + export var AutoPrefix: AutoPrefix; + + interface Spacing { + iconSize?: number; + + desktopGutter?: number; + desktopGutterMore?: number; + desktopGutterLess?: number; + desktopGutterMini?: number; + desktopKeylineIncrement?: number; + desktopDropDownMenuItemHeight?: number; + desktopDropDownMenuFontSize?: number; + desktopLeftNavMenuItemHeight?: number; + desktopSubheaderHeight?: number; + desktopToolbarHeight?: number; + } + interface ThemePalette { + primary1Color?: string, + primary2Color?: string, + primary3Color?: string, + accent1Color?: string, + accent2Color?: string, + accent3Color?: string, + textColor?: string, + canvasColor?: string, + borderColor?: string, + disabledColor?: string + } + interface Theme { + appBar?: { + color?: string, + textColor?: string, + height?: number + }, + button?: { + height?: number, + minWidth?: number, + iconButtonSize?: number + }, + checkbox?: { + boxColor?: string, + checkedColor?: string, + requiredColor?: string, + disabledColor?: string, + labelColor?: string, + labelDisabledColor?: string + }, + datePicker?: { + color?: string, + textColor?: string, + calendarTextColor?: string, + selectColor?: string, + selectTextColor?: string, + }, + dropDownMenu?: { + accentColor?: string, + }, + flatButton?: { + color?: string, + textColor?: string, + primaryTextColor?: string, + secondaryTextColor?: string, + disabledColor?: string + }, + floatingActionButton?: { + buttonSize?: number, + miniSize?: number, + color?: string, + iconColor?: string, + secondaryColor?: string, + secondaryIconColor?: string, + disabledColor?: string, + disabledTextColor?: string + }, + leftNav?: { + width?: number, + color?: string, + }, + menu?: { + backgroundColor?: string, + containerBackgroundColor?: string, + }, + menuItem?: { + dataHeight?: number, + height?: number, + hoverColor?: string, + padding?: number, + selectedTextColor?: string, + }, + menuSubheader?: { + padding?: number, + borderColor?: string, + textColor?: string, + }, + paper?: { + backgroundColor?: string, + }, + radioButton?: { + borderColor?: string, + backgroundColor?: string, + checkedColor?: string, + requiredColor?: string, + disabledColor?: string, + size?: number, + labelColor?: string, + labelDisabledColor?: string + }, + raisedButton?: { + color?: string, + textColor?: string, + primaryColor?: string, + primaryTextColor?: string, + secondaryColor?: string, + secondaryTextColor?: string, + disabledColor?: string, + disabledTextColor?: string + }, + slider?: { + trackSize?: number, + trackColor?: string, + trackColorSelected?: string, + handleSize?: number, + handleSizeActive?: number, + handleSizeDisabled?: number, + handleColorZero?: string, + handleFillColor?: string, + selectionColor?: string, + rippleColor?: string, + }, + snackbar?: { + textColor?: string, + backgroundColor?: string, + actionColor?: string, + }, + toggle?: { + thumbOnColor?: string, + thumbOffColor?: string, + thumbDisabledColor?: string, + thumbRequiredColor?: string, + trackOnColor?: string, + trackOffColor?: string, + trackDisabledColor?: string, + trackRequiredColor?: string, + labelColor?: string, + labelDisabledColor?: string + }, + toolbar?: { + backgroundColor?: string, + height?: number, + titleFontSize?: number, + iconColor?: string, + separatorColor?: string, + menuHoverColor?: string, + } + } + interface CustomTheme { + spacing?: Spacing; + contentFontFamily?: string; + getPalette(): ThemePalette; + getComponentThemes(palette: ThemePalette, spacing: Spacing): Theme; + } + + export class ThemeManager { + static: boolean; + spacing: Spacing; + palette: ThemePalette; + component: Theme; + contentFontFamily: string; + template: CustomTheme; + types: { + LIGHT: CustomTheme; + DARK: CustomTheme; + }; + + getCurrentTheme(): ThemeManager; + setContentFontFamily(newContentFontFamily: string): void; + setTheme(newTheme: CustomTheme): void; + setSpacing(newSpacing: Spacing): void; + setPalette(newPalette: ThemePalette): void; + setComponentThemes(overrides: Theme): void; + setIsRtl(isRtl: boolean): void; + } + + interface Transitions { + easeOut(duration?: string, property?: string | string[], delay?: string, easeFunction?: string): string; + create(duration?: string, property?: string, delay?: string, easeFunction?: string): string; + easeOutFunction: string; + easeInOutFunction: string; + } + export var Transitions: Transitions; + + interface Typography { + textFullBlack:string; + textDarkBlack: string; + textLightBlack: string; + textMinBlack: string; + textFullWhite: string; + textDarkWhite: string; + textLightWhite: string; + + // font weight + fontWeightLight: number; + fontWeightNormal: number; + fontWeightMedium: number; + + fontStyleButtonFontSize: number; + } + export var Typography: Typography; + } + + interface SnackbarProps extends React.Props { + message: string; + action?: string; + autoHideDuration?: number; + onActionTouchTap?: React.TouchEventHandler; + onShow?: () => void; + onDismiss?: () => void; + openOnMount?: boolean; + } + export class Snackbar extends React.Component { + } + + namespace Tabs { + interface TabProps extends React.Props { + label?: string; + value?: string; + selected?: boolean; + width?: string; + + // Called by Tabs component + onActive?: (tab: Tab) => void; + + onTouchTap?: (value: string, e: TouchTapEvent, tab: Tab) => void; + } + export class Tab extends React.Component { + } + + interface TabsProps extends React.Props { + contentContainerStyle?: React.CSSProperties; + initialSelectedIndex?: number; + inkBarStyle?: React.CSSProperties; + style?: React.CSSProperties; + tabItemContainerStyle?: React.CSSProperties; + tabWidth?: number; + value?: string | number; + + onChange?: (value: string | number, e: React.FormEvent, tab: Tab) => void; + } + export class Tabs extends React.Component { + } + } + + namespace Table { + interface TableProps extends React.Props { + allRowsSelected?: boolean; + fixedFooter?: boolean; + fixedHeader?: boolean; + height?: string; + multiSelectable?: boolean; + onCellClick?: (row: number, column: number) => void; + onCellHover?: (row: number, column: number) => void; + onCellHoverExit?: (row: number, column: number) => void; + onRowHover?: (row: number) => void; + onRowHoverExit?: (row: number) => void; + onRowSelection?: (selectedRows: number[])=> void; + selectable?: boolean; + } + export class Table extends React.Component { + } + + interface TableBodyProps extends React.Props { + allRowsSelected?: boolean; + deselectOnClickaway?: boolean; + displayRowCheckbox?: boolean; + multiSelectable?: boolean; + onCellClick?: (row: number, column: number) => void; + onCellHover?: (row: number, column: number) => void; + onCellHoverExit?: (row: number, column: number) => void; + onRowHover?: (row: number) => void; + onRowHoverExit?: (row: number) => void; + onRowSelection?: (selectedRows: number[])=> void; + preScanRows?: boolean; + selectable?: boolean; + showRowHover?: boolean; + stripedRows?: boolean; + } + export class TableBody extends React.Component { + } + + interface TableFooterProps extends React.Props { + adjustForCheckbox?: boolean; + } + export class TableFooter extends React.Component { + } + + interface TableHeaderProps extends React.Props { + adjustForCheckbox?: boolean; + displaySelectAll?: boolean; + enableSelectAll?: boolean; + onSelectAll?: (event: React.MouseEvent) => void; + selectAllSelected?: boolean; + } + export class TableHeader extends React.Component { + } + + interface TableHeaderColumnProps extends React.Props { + columnNumber?: number; + onClick?: (e: React.MouseEvent, column: number) => void; + tooltip?: string; + tooltipStyle?: React.CSSProperties; + } + export class TableHeaderColumn extends React.Component { + } + + interface TableRowProps extends React.Props { + displayBorder?: boolean; + hoverable?: boolean; + onCellClick?: (e: React.MouseEvent, row: number, column: number) => void; + onCellHover?: (e: React.MouseEvent, row: number, column: number) => void; + onCellHoverExit?: (e: React.MouseEvent, row: number, column: number) => void; + onRowClick?: (e: React.MouseEvent, row: number) => void; + onRowHover?: (e: React.MouseEvent, row: number) => void; + onRowHoverExit?: (e: React.MouseEvent, row: number) => void; + rowNumber?: number; + selectable?: boolean; + selected?: boolean; + striped?: boolean; + } + export class TableRow extends React.Component { + } + + interface TableRowColumnProps extends React.Props { + columnNumber?: number; + hoverable?: boolean; + onHover?: (e: React.MouseEvent, column: number) => void; + onHoverExit?: (e: React.MouseEvent, column: number) => void; + } + export class TableRowColumn extends React.Component { + } + } + + interface ThemeProps extends React.Props { + theme: Styles.CustomTheme; + } + export class Theme extends React.Component { + static theme(customTheme: Styles.CustomTheme):

(Component: React.ComponentClass

) => React.ComponentClass

; + } + + interface ToggleProps extends CommonEnhancedSwitchProps { + // is root element + + elementStyle?: React.CSSProperties; + labelStyle?: React.CSSProperties; + onToggle?: (e: React.MouseEvent, isInputChecked: boolean) => void; + toggled?: boolean; + defaultToggled?: boolean; + } + export class Toggle extends React.Component { + isToggled(): boolean; + setToggled(newToggledValue: boolean): void; + } + + interface TimePickerProps extends React.Props { + defaultTime?: Date; + format?: string; + pedantic?: boolean; + onFocus?: React.FocusEventHandler; + onTouchTap?: TouchTapEventHandler; + onChange?: (e: any, time: Date) => void; + onShow?: () => void; + onDismiss?: () => void; + } + export class TimePicker extends React.Component { + } + + interface TextFieldProps extends React.Props { + errorStyle?: React.CSSProperties; + errorText?: string; + floatingLabelText?: string; + floatingLabelStyle?: React.CSSProperties; + fullWidth?: boolean; + hintText?: string | React.ReactElement; + id?: string; + inputStyle?: React.CSSProperties; + multiLine?: boolean; + onEnterKeyDown?: React.KeyboardEventHandler; + style?: React.CSSProperties; + rows?: number, + underlineStyle?: React.CSSProperties; + underlineFocusStyle?: React.CSSProperties; + underlineDisabledStyle?: React.CSSProperties; + type?: string; + + disabled?: boolean; + isRtl?: boolean; + value?: string; + defaultValue?: string; + valueLink?: ReactLink; + + onBlur?: React.FocusEventHandler; + onChange?: React.FormEventHandler; + onFocus?: React.FocusEventHandler; + onKeyDown?: React.KeyboardEventHandler; + } + export class TextField extends React.Component { + blur(): void; + clearValue(): void; + focus(): void; + getValue(): string; + setErrorText(newErrorText: string): void; + setValue(newValue: string): void; + } + + namespace Toolbar { + interface ToolbarProps extends React.Props { + } + export class Toolbar extends React.Component { + } + + interface ToolbarGroupProps extends React.Props { + float?: string; + } + export class ToolbarGroup extends React.Component { + } + + interface ToolbarSeparatorProps extends React.Props { + } + export class ToolbarSeparator extends React.Component { + } + + interface ToolbarTitleProps extends React.Props { + text?: string; + } + export class ToolbarTitle extends React.Component { + } + } + + interface TooltipProps extends React.Props { + label: string; + show?: boolean; + touch?: boolean; + verticalPosition?: string; + horizontalPosition?: string; + } + export class Tooltip extends React.Component { + } + + export namespace Utils { + interface ContrastLevel { + range: [number, number]; + color: string; + } + interface ColorManipulator { + fade(color: string, amount: string|number): string; + lighten(color: string, amount: string|number): string; + darken(color: string, amount: string|number): string; + contrastRatio(background: string, foreground: string): number; + contrastRatioLevel(background: string, foreground: string): ContrastLevel; + } + export var ColorManipulator: ColorManipulator; + + interface CssEvent { + transitionEndEventName(): string; + animationEndEventName(): string; + onTransitionEnd(el: Element, callback: () => void): void; + onAnimationEnd(el: Element, callback: () => void): void; + } + export var CssEvent: CssEvent; + + interface Dom { + isDescendant(parent: Node, child: Node): boolean; + offset(el: Element): { top: number, left: number }; + getStyleAttributeAsNumber(el: HTMLElement, attr: string): number; + addClass(el: Element, className: string): void; + removeClass(el: Element, className: string): void; + hasClass(el: Element, className: string): boolean; + toggleClass(el: Element, className: string): void; + forceRedraw(el: HTMLElement): void; + withoutTransition(el: HTMLElement, callback: () => void): void; + } + export var Dom: Dom; + + interface Events { + once(el: Element, type: string, callback: EventListener): void; + on(el: Element, type: string, callback: EventListener): void; + off(el: Element, type: string, callback: EventListener): void; + isKeyboard(e: Event): boolean; + } + export var Events: Events; + + function Extend(base: T, override: S1): (T & S1); + + interface ImmutabilityHelper { + merge(base: any, ...args: any[]): any; + mergeItem(obj: any, key: any, newValueObject: any): any; + push(array: any[], obj: any): any[]; + shift(array: any[]): any[]; + } + export var ImmutabilityHelper: ImmutabilityHelper; + + interface KeyCode { + DOWN: number; + ESC: number; + ENTER: number; + LEFT: number; + RIGHT: number; + SPACE: number; + TAB: number; + UP: number; + } + var KeyCode: KeyCode; + + interface KeyLine { + Desktop: { + GUTTER: number; + GUTTER_LESS: number; + INCREMENT: number; + MENU_ITEM_HEIGHT: number; + }; + + getIncrementalDim(dim: number): number; + } + export var KeyLine: KeyLine; + + interface UniqueId { + generate(): string; + } + export var UniqueId: UniqueId; + + interface Styles { + mergeAndPrefix(base: any, ...args: any[]): React.CSSProperties; + } + export var Styles: Styles; + } + + // New menus available only through requiring directly to the end file + namespace Menus { + interface IconMenuProps extends React.Props { + closeOnItemTouchTap?: boolean; + desktop?: boolean; + iconButtonElement: React.ReactElement; + openDirection?: string; + menuStyle?: React.CSSProperties; + multiple?: boolean; + value?: string | Array; + width?: string | number; + touchTapCloseDelay?: number; + + onKeyboardFocus?: React.FocusEventHandler; + onItemTouchTap?: (e: TouchTapEvent, item: React.ReactElement) => void; + onChange?: (e: React.FormEvent, value: string | Array) => void; + } + export class IconMenu extends React.Component { + } + + interface MenuProps extends React.Props

{ + animated?: boolean; + autoWidth?: boolean; + desktop?: boolean; + listStyle?: React.CSSProperties; + maxHeight?: number; + multiple?: boolean; + openDirection?: string; + value?: string | Array; + width?: string | number; + zDepth?: number; + } + export class Menu extends React.Component{ + } + + interface MenuItemProps extends React.Props { + checked?: boolean; + desktop?: boolean; + disabled?: boolean; + innerDivStyle?: React.CSSProperties; + insetChildren?: boolean; + leftIcon?: React.ReactElement; + primaryText?: string | React.ReactElement; + rightIcon?: React.ReactElement; + secondaryText?: React.ReactNode; + value?: string; + + onEscKeyDown?: React.KeyboardEventHandler; + onItemTouchTap?: (e: TouchTapEvent, item: React.ReactElement) => void; + onChange?: (e: React.FormEvent, value: string) => void; + } + export class MenuItem extends React.Component{ + } + + interface MenuDividerProps extends React.Props { + inset?: boolean; + style?: React.CSSProperties; + } + export class MenuDivider extends React.Component{ + } + } +} // __MaterialUI + +declare module 'material-ui/lib/app-bar' { + export = __MaterialUI.AppBar; +} + +declare module 'material-ui/lib/app-canvas' { + export = __MaterialUI.AppCanvas; +} + +declare module 'material-ui/lib/avatar' { + export = __MaterialUI.Avatar; +} + +declare module 'material-ui/lib/before-after-wrapper' { + export = __MaterialUI.BeforeAfterWrapper; +} + +declare module 'material-ui/lib/card/card' { + export = __MaterialUI.Card.Card; +} + +declare module 'material-ui/lib/card/card-actions' { + export = __MaterialUI.Card.CardActions; +} + +declare module 'material-ui/lib/card/card-expandable' { + export = __MaterialUI.Card.CardExpandable; +} + +declare module 'material-ui/lib/card/card-header' { + export = __MaterialUI.Card.CardHeader; +} + +declare module 'material-ui/lib/card/card-media' { + export = __MaterialUI.Card.CardMedia; +} + +declare module 'material-ui/lib/card/card-text' { + export = __MaterialUI.Card.CardText; +} + +declare module 'material-ui/lib/card/card-title' { + export = __MaterialUI.Card.CardTitle; +} + +declare module 'material-ui/lib/checkbox' { + export = __MaterialUI.Checkbox; +} + +declare module 'material-ui/lib/circular-progress' { + export = __MaterialUI.CircularProgress; +} + +declare module 'material-ui/lib/clearfix' { + export = __MaterialUI.ClearFix; +} + +declare module 'material-ui/lib/date-picker/date-picker' { + export = __MaterialUI.DatePicker.DatePicker; +} + +declare module 'material-ui/lib/date-picker/date-picker-dialog' { + export = __MaterialUI.DatePicker.DatePickerDialog; +} + +declare module 'material-ui/lib/dialog' { + export = __MaterialUI.Dialog; +} + +declare module 'material-ui/lib/drop-down-icon' { + export = __MaterialUI.DropDownIcon; +} + +declare module 'material-ui/lib/drop-down-menu' { + export = __MaterialUI.DropDownMenu; +} + +declare module 'material-ui/lib/enhanced-button' { + export = __MaterialUI.EnhancedButton; +} + +declare module 'material-ui/lib/flat-button' { + export = __MaterialUI.FlatButton; +} + +declare module 'material-ui/lib/floating-action-button' { + export = __MaterialUI.FloatingActionButton; +} + +declare module 'material-ui/lib/font-icon' { + export = __MaterialUI.FontIcon; +} + +declare module 'material-ui/lib/icon-button' { + export = __MaterialUI.IconButton; +} + +declare module 'material-ui/lib/left-nav' { + export = __MaterialUI.LeftNav; +} + +declare module 'material-ui/lib/linear-progress' { + export = __MaterialUI.LinearProgress; +} + +declare module 'material-ui/lib/lists/list' { + export = __MaterialUI.Lists.List; +} + +declare module 'material-ui/lib/lists/list-divider' { + export = __MaterialUI.Lists.ListDivider; +} + +declare module 'material-ui/lib/lists/list-item' { + export = __MaterialUI.Lists.ListItem; +} + +declare module 'material-ui/lib/menu/menu' { + export = __MaterialUI.Menu.Menu; +} + +declare module 'material-ui/lib/menu/menu-item' { + export = __MaterialUI.Menu.MenuItem; +} + +declare module 'material-ui/lib/mixins/' { + export import ClickAwayable = __MaterialUI.Mixins.ClickAwayable; // require('material-ui/lib/mixins/click-awayable'); + export import WindowListenable = __MaterialUI.Mixins.WindowListenable; // require('material-ui/lib/mixins/window-listenable'); + export import StylePropable = __MaterialUI.Mixins.StylePropable; // require('material-ui/lib/mixins/style-propable'); + export import StyleResizable = __MaterialUI.Mixins.StyleResizable; // require('material-ui/lib/mixins/style-resizable'); +} + +declare module 'material-ui/lib/mixins/click-awayable' { + export = __MaterialUI.Mixins.ClickAwayable; +} + +declare module 'material-ui/lib/mixins/window-listenable' { + export = __MaterialUI.Mixins.WindowListenable; +} + +declare module 'material-ui/lib/mixins/style-propable' { + export = __MaterialUI.Mixins.StylePropable; +} + +declare module 'material-ui/lib/mixins/style-resizable' { + export = __MaterialUI.Mixins.StyleResizable; +} + +declare module 'material-ui/lib/overlay' { + export = __MaterialUI.Overlay; +} + +declare module 'material-ui/lib/paper' { + export = __MaterialUI.Paper; +} + +declare module 'material-ui/lib/radio-button' { + export = __MaterialUI.RadioButton; +} + +declare module 'material-ui/lib/radio-button-group' { + export = __MaterialUI.RadioButtonGroup; +} + +declare module 'material-ui/lib/raised-button' { + export = __MaterialUI.RaisedButton; +} + +declare module 'material-ui/lib/refresh-indicator' { + export = __MaterialUI.RefreshIndicator; +} + +declare module 'material-ui/lib/ripples/' { + export import CircleRipple = __MaterialUI.Ripples.CircleRipple; + export import FocusRipple = __MaterialUI.Ripples.FocusRipple; + export import TouchRipple = __MaterialUI.Ripples.TouchRipple; +} + +declare module 'material-ui/lib/select-field' { + export = __MaterialUI.SelectField; +} + +declare module 'material-ui/lib/slider' { + export = __MaterialUI.Slider; +} + +declare module 'material-ui/lib/svg-icon' { + export = __MaterialUI.SvgIcon; +} + +declare module 'material-ui/lib/svg-icons/navigation/menu' { + export = __MaterialUI.NavigationMenu; +} + +declare module 'material-ui/lib/svg-icons/navigation/chevron-left' { + export = __MaterialUI.NavigationChevronLeft; +} + +declare module 'material-ui/lib/svg-icons/navigation/chevron-right' { + export = __MaterialUI.NavigationChevronRight; +} + +declare module 'material-ui/lib/styles/' { + export import AutoPrefix = __MaterialUI.Styles.AutoPrefix; // require('material-ui/lib/styles/auto-prefix'); + export import Colors = __MaterialUI.Styles.Colors; // require('material-ui/lib/styles/colors'); + export import Spacing = require('material-ui/lib/styles/spacing'); + export import ThemeManager = __MaterialUI.Styles.ThemeManager; // require('material-ui/lib/styles/theme-manager'); + export import Transitions = __MaterialUI.Styles.Transitions; // require('material-ui/lib/styles/transitions'); + export import Typography = __MaterialUI.Styles.Typography; // require('material-ui/lib/styles/typography'); +} + +declare module 'material-ui/lib/styles/auto-prefix' { + export = __MaterialUI.Styles.AutoPrefix; +} + +declare module 'material-ui/lib/styles/spacing' { + var Spacing: __MaterialUI.Styles.Spacing; + export = Spacing; +} + +declare module 'material-ui/lib/styles/theme-manager' { + export = __MaterialUI.Styles.ThemeManager; +} + +declare module 'material-ui/lib/styles/transitions' { + export = __MaterialUI.Styles.Transitions; +} + +declare module 'material-ui/lib/styles/typography' { + export = __MaterialUI.Styles.Typography; +} + +declare module 'material-ui/lib/snackbar' { + export = __MaterialUI.Snackbar; +} + +declare module 'material-ui/lib/tabs/tab' { + export = __MaterialUI.Tabs.Tab; +} + +declare module 'material-ui/lib/tabs/tabs' { + export = __MaterialUI.Tabs.Tabs; +} + +declare module 'material-ui/lib/table/table' { + export = __MaterialUI.Table.Table; +} + +declare module 'material-ui/lib/table/table-body' { + export = __MaterialUI.Table.TableBody; +} + +declare module 'material-ui/lib/table/table-footer' { + export = __MaterialUI.Table.TableFooter; +} + +declare module 'material-ui/lib/table/table-header' { + export = __MaterialUI.Table.TableHeader; +} + +declare module 'material-ui/lib/table/table-header-column' { + export = __MaterialUI.Table.TableHeaderColumn; +} + +declare module 'material-ui/lib/table/table-row' { + export = __MaterialUI.Table.TableRow; +} + +declare module 'material-ui/lib/table/table-row-column' { + export = __MaterialUI.Table.TableRowColumn; +} + +declare module 'material-ui/lib/theme' { + export = __MaterialUI.Theme; +} + +declare module 'material-ui/lib/toggle' { + export = __MaterialUI.Toggle; +} + +declare module 'material-ui/lib/time-picker' { + export = __MaterialUI.TimePicker; +} + +declare module 'material-ui/lib/text-field' { + export = __MaterialUI.TextField; +} + +declare module 'material-ui/lib/toolbar/toolbar' { + export = __MaterialUI.Toolbar.Toolbar; +} + +declare module 'material-ui/lib/toolbar/toolbar-group' { + export = __MaterialUI.Toolbar.ToolbarGroup; +} + +declare module 'material-ui/lib/toolbar/toolbar-separator' { + export = __MaterialUI.Toolbar.ToolbarSeparator; +} + +declare module 'material-ui/lib/toolbar/toolbar-title' { + export = __MaterialUI.Toolbar.ToolbarTitle; +} + +declare module 'material-ui/lib/tooltip' { + export = __MaterialUI.Tooltip; +} + +declare module 'material-ui/lib/utils/' { + export import ColorManipulator = __MaterialUI.Utils.ColorManipulator; // require('material-ui/lib/utils/color-manipulator'); + export import CssEvent = __MaterialUI.Utils.CssEvent; // require('material-ui/lib/utils/css-event'); + export import Dom = __MaterialUI.Utils.Dom; // require('material-ui/lib/utils/dom'); + export import Events = __MaterialUI.Utils.Events; // require('material-ui/lib/utils/events'); + export import Extend = __MaterialUI.Utils.Extend; // require('material-ui/lib/utils/extend'); + export import ImmutabilityHelper = __MaterialUI.Utils.ImmutabilityHelper; // require('material-ui/lib/utils/immutability-helper'); + export import KeyCode = __MaterialUI.Utils.KeyCode; // require('material-ui/lib/utils/key-code'); + export import KeyLine = __MaterialUI.Utils.KeyLine; // require('material-ui/lib/utils/key-line'); + export import UniqueId = __MaterialUI.Utils.UniqueId; // require('material-ui/lib/utils/unique-id'); + export import Styles = __MaterialUI.Utils.Styles; // require('material-ui/lib/utils/styles'); +} + +declare module 'material-ui/lib/utils/color-manipulator' { + export = __MaterialUI.Utils.ColorManipulator; +} + +declare module 'material-ui/lib/utils/css-event' { + export = __MaterialUI.Utils.CssEvent; +} + +declare module 'material-ui/lib/utils/dom' { + export = __MaterialUI.Utils.Dom; +} + +declare module 'material-ui/lib/utils/events' { + export = __MaterialUI.Utils.Events; +} + +declare module 'material-ui/lib/utils/extend' { + export = __MaterialUI.Utils.Extend; +} + +declare module 'material-ui/lib/utils/immutability-helper' { + export = __MaterialUI.Utils.ImmutabilityHelper; +} + +declare module 'material-ui/lib/utils/key-code' { + export = __MaterialUI.Utils.KeyCode; +} + +declare module 'material-ui/lib/utils/key-line' { + export = __MaterialUI.Utils.KeyLine; +} + +declare module 'material-ui/lib/utils/unique-id' { + export = __MaterialUI.Utils.UniqueId; +} + +declare module 'material-ui/lib/utils/styles' { + export = __MaterialUI.Utils.Styles; +} + +declare module "material-ui/lib/menus/icon-menu" { + export = __MaterialUI.Menus.IconMenu; +} + +declare module "material-ui/lib/menus/menu" { + export = __MaterialUI.Menus.Menu; +} + +declare module "material-ui/lib/menus/menu-item" { + export = __MaterialUI.Menus.MenuItem; +} + +declare module "material-ui/lib/menus/menu-divider" { + export = __MaterialUI.Menus.MenuDivider; +} + +declare module "material-ui/lib/styles/colors" { + export = __MaterialUI.Styles.Colors; +} + +declare namespace __MaterialUI.Styles { + interface Colors { + red50: string; + red100: string; + red200: string; + red300: string; + red400: string; + red500: string; + red600: string; + red700: string; + red800: string; + red900: string; + redA100: string; + redA200: string; + redA400: string; + redA700: string; + + pink50: string; + pink100: string; + pink200: string; + pink300: string; + pink400: string; + pink500: string; + pink600: string; + pink700: string; + pink800: string; + pink900: string; + pinkA100: string; + pinkA200: string; + pinkA400: string; + pinkA700: string; + + purple50: string; + purple100: string; + purple200: string; + purple300: string; + purple400: string; + purple500: string; + purple600: string; + purple700: string; + purple800: string; + purple900: string; + purpleA100: string; + purpleA200: string; + purpleA400: string; + purpleA700: string; + + deepPurple50: string; + deepPurple100: string; + deepPurple200: string; + deepPurple300: string; + deepPurple400: string; + deepPurple500: string; + deepPurple600: string; + deepPurple700: string; + deepPurple800: string; + deepPurple900: string; + deepPurpleA100: string; + deepPurpleA200: string; + deepPurpleA400: string; + deepPurpleA700: string; + + indigo50: string; + indigo100: string; + indigo200: string; + indigo300: string; + indigo400: string; + indigo500: string; + indigo600: string; + indigo700: string; + indigo800: string; + indigo900: string; + indigoA100: string; + indigoA200: string; + indigoA400: string; + indigoA700: string; + + blue50: string; + blue100: string; + blue200: string; + blue300: string; + blue400: string; + blue500: string; + blue600: string; + blue700: string; + blue800: string; + blue900: string; + blueA100: string; + blueA200: string; + blueA400: string; + blueA700: string; + + lightBlue50: string; + lightBlue100: string; + lightBlue200: string; + lightBlue300: string; + lightBlue400: string; + lightBlue500: string; + lightBlue600: string; + lightBlue700: string; + lightBlue800: string; + lightBlue900: string; + lightBlueA100: string; + lightBlueA200: string; + lightBlueA400: string; + lightBlueA700: string; + + cyan50: string; + cyan100: string; + cyan200: string; + cyan300: string; + cyan400: string; + cyan500: string; + cyan600: string; + cyan700: string; + cyan800: string; + cyan900: string; + cyanA100: string; + cyanA200: string; + cyanA400: string; + cyanA700: string; + + teal50: string; + teal100: string; + teal200: string; + teal300: string; + teal400: string; + teal500: string; + teal600: string; + teal700: string; + teal800: string; + teal900: string; + tealA100: string; + tealA200: string; + tealA400: string; + tealA700: string; + + green50: string; + green100: string; + green200: string; + green300: string; + green400: string; + green500: string; + green600: string; + green700: string; + green800: string; + green900: string; + greenA100: string; + greenA200: string; + greenA400: string; + greenA700: string; + + lightGreen50: string; + lightGreen100: string; + lightGreen200: string; + lightGreen300: string; + lightGreen400: string; + lightGreen500: string; + lightGreen600: string; + lightGreen700: string; + lightGreen800: string; + lightGreen900: string; + lightGreenA100: string; + lightGreenA200: string; + lightGreenA400: string; + lightGreenA700: string; + + lime50: string; + lime100: string; + lime200: string; + lime300: string; + lime400: string; + lime500: string; + lime600: string; + lime700: string; + lime800: string; + lime900: string; + limeA100: string; + limeA200: string; + limeA400: string; + limeA700: string; + + yellow50: string; + yellow100: string; + yellow200: string; + yellow300: string; + yellow400: string; + yellow500: string; + yellow600: string; + yellow700: string; + yellow800: string; + yellow900: string; + yellowA100: string; + yellowA200: string; + yellowA400: string; + yellowA700: string; + + amber50: string; + amber100: string; + amber200: string; + amber300: string; + amber400: string; + amber500: string; + amber600: string; + amber700: string; + amber800: string; + amber900: string; + amberA100: string; + amberA200: string; + amberA400: string; + amberA700: string; + + orange50: string; + orange100: string; + orange200: string; + orange300: string; + orange400: string; + orange500: string; + orange600: string; + orange700: string; + orange800: string; + orange900: string; + orangeA100: string; + orangeA200: string; + orangeA400: string; + orangeA700: string; + + deepOrange50: string; + deepOrange100: string; + deepOrange200: string; + deepOrange300: string; + deepOrange400: string; + deepOrange500: string; + deepOrange600: string; + deepOrange700: string; + deepOrange800: string; + deepOrange900: string; + deepOrangeA100: string; + deepOrangeA200: string; + deepOrangeA400: string; + deepOrangeA700: string; + + brown50: string; + brown100: string; + brown200: string; + brown300: string; + brown400: string; + brown500: string; + brown600: string; + brown700: string; + brown800: string; + brown900: string; + + blueGrey50: string; + blueGrey100: string; + blueGrey200: string; + blueGrey300: string; + blueGrey400: string; + blueGrey500: string; + blueGrey600: string; + blueGrey700: string; + blueGrey800: string; + blueGrey900: string; + + grey50: string; + grey100: string; + grey200: string; + grey300: string; + grey400: string; + grey500: string; + grey600: string; + grey700: string; + grey800: string; + grey900: string; + + black: string; + white: string; + + transparent: string; + fullBlack: string; + darkBlack: string; + lightBlack: string; + minBlack: string; + faintBlack: string; + fullWhite: string; + darkWhite: string; + lightWhite: string; + } + export var Colors: Colors; +} diff --git a/mithril/mithril.d.ts b/mithril/mithril.d.ts index e01dbcc02..3cd0e21e4 100644 --- a/mithril/mithril.d.ts +++ b/mithril/mithril.d.ts @@ -8,19 +8,15 @@ interface MithrilStatic { (selector: string, attributes: Object, children?: any): MithrilVirtualElement; (selector: string, children?: any): MithrilVirtualElement; - prop(value?: T): (value?: T) => T; - prop(promise: MithrilPromise): MithrilPromiseProperty; + prop(value?: T): (value?: T) => T; + prop(promise: MithrilPromise): MithrilPromiseProperty; withAttr(property: string, callback: (value: any) => void): (e: Event) => any; module(rootElement: Node, module: MithrilModule): void; trust(html: string): String; render(rootElement: Element, children?: any): void; render(rootElement: HTMLDocument, children?: any): void; redraw: MithrilRedraw; - route(rootElement: Element, defaultRoute: string, routes: { [key: string]: MithrilModule }): void; - route(rootElement: HTMLDocument, defaultRoute: string, routes: { [key: string]: MithrilModule }): void; - route(path: string, params?: any, shouldReplaceHistory?: boolean): void; - route(): string; - route(element: Element, isInitialized: boolean): void; + route: MithrilRoute; request(options: MithrilXHROptions): MithrilPromise; deferred(): MithrilDeferred; sync(promises: MithrilPromise[]): MithrilPromise; @@ -28,6 +24,22 @@ interface MithrilStatic { endComputation(): void; } +interface MithrilRoute { + (rootElement: Element, defaultRoute: string, routes: { [key: string]: MithrilModule }): void; + (rootElement: HTMLDocument, defaultRoute: string, routes: { [key: string]: MithrilModule }): void; + (path: string, params?: any, shouldReplaceHistory?: boolean): void; + (element: Element, isInitialized: boolean): void; + (): string; + mode: string; + param: MithrilParam; + buildQueryString(data: Object): string; + parseQueryString(queryString: string): Object; +} + +interface MithrilParam { + (param: string): string; +} + interface MithrilRedraw { (): void; strategy: (value?: string) => string; @@ -40,26 +52,26 @@ interface MithrilVirtualElement { } interface MithrilModule { - controller: Function; - view: (controller?: any) => MithrilVirtualElement; + controller: Function; + view: (controller?: any) => MithrilVirtualElement; } interface MithrilDeferred { - resolve(value?: T): void; - reject(value?: any): void; - promise: MithrilPromise; + resolve(value?: T): void; + reject(value?: any): void; + promise: MithrilPromise; } interface MithrilPromise { - (value?: T): T; - then(successCallback?: (value: T) => R, errorCallback?: (value: any) => any): MithrilPromise; - then(successCallback?: (value: T) => MithrilPromise, errorCallback?: (value: any) => any): MithrilPromise; + (value?: T): T; + then(successCallback?: (value: T) => R, errorCallback?: (value: any) => any): MithrilPromise; + then(successCallback?: (value: T) => MithrilPromise, errorCallback?: (value: any) => any): MithrilPromise; } interface MithrilPromiseProperty extends MithrilPromise { - (): T; - (value: T): T; - toJSON(): T; + (): T; + (value: T): T; + toJSON(): T; } interface MithrilXHROptions { diff --git a/mobservable-react/mobservable-react-tests.ts b/mobservable-react/mobservable-react-tests.ts new file mode 100644 index 000000000..7b39dbb7f --- /dev/null +++ b/mobservable-react/mobservable-react-tests.ts @@ -0,0 +1,61 @@ +/// +/// + +import {reactiveComponent} from 'mobservable-react'; + +{ + let c1 = reactiveComponent(React.createClass({ + getDefaultProps() { + return { + test: "hi" + }; + }, + + render: function() { + return React.createElement("div"); + } + })); + + let c1Factory = React.createFactory(c1); + React.render(c1Factory({ + test: "hello" + }), null); +} + +@reactiveComponent +class TestComponent extends React.Component<{ test: string },{}> { + render() { + return React.createElement("div"); + } +} + +{ + let c2Factory = React.createFactory(TestComponent); + React.render(c2Factory({ + test: "hello" + }) , null); +} + +{ + var c3 = reactiveComponent((props: { test: string }) => React.createElement("div")); + var c3Factory = React.createFactory(c3); //without JSX + React.render(c3Factory({ + test: "hello" + }), null); +} + + +class TestComponent2 extends React.Component<{ test: string },{}> { + render() { + return React.createElement("div"); + } +} +{ + // Does not work properly in typescript 1.6.2 without cast :'( + // Argument of type 'typeof TestComponent2 | void' is not assignable to parameter of type 'ComponentClass<{ test: string; }>'. + // Type 'void' is not assignable to type 'ComponentClass<{ test: string; }>'. + let c4Factory = React.createFactory(> reactiveComponent(TestComponent2)); + React.render(c4Factory({ + test: "hello" + }) , null); +} \ No newline at end of file diff --git a/mobservable-react/mobservable-react-tests.ts.tscparams b/mobservable-react/mobservable-react-tests.ts.tscparams new file mode 100644 index 000000000..3f1358357 --- /dev/null +++ b/mobservable-react/mobservable-react-tests.ts.tscparams @@ -0,0 +1 @@ +--noImplicitAny --module commonjs --target es5 --experimentalDecorators \ No newline at end of file diff --git a/mobservable-react/mobservable-react.d.ts b/mobservable-react/mobservable-react.d.ts new file mode 100644 index 000000000..f42627a85 --- /dev/null +++ b/mobservable-react/mobservable-react.d.ts @@ -0,0 +1,16 @@ +// Type definitions for mobservable v0.1.8 +// Project: https://github.com/mweststrate/mobservable-react +// Definitions by: Michel Weststrate +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "mobservable-react" { + /** + * Turns a React component or stateless render function into a reactive component. + */ + export function reactiveComponent

(clazz: React.ClassicComponentClass

): React.ClassicComponentClass

; + export function reactiveComponent

(clazz: React.ComponentClass

): React.ComponentClass

; + export function reactiveComponent>(target: TFunction): TFunction | void; // decorator signature + export function reactiveComponent

(renderFunction: (props: P) => React.ReactElement): React.ClassicComponentClass

; +} \ No newline at end of file diff --git a/mobservable/mobservable-tests.ts b/mobservable/mobservable-tests.ts new file mode 100644 index 000000000..2966128fe --- /dev/null +++ b/mobservable/mobservable-tests.ts @@ -0,0 +1,57 @@ +/// +import mobservable = require('mobservable'); +import {observable} from "mobservable"; + +var v = mobservable(3); +v.observe(() => {}); + +var a = mobservable([1,2,3]); + +class Order { + @observable price:number = 3; + @observable amount:number = 2; + @observable orders:string[] = []; + + @observable get total() { + return this.amount * this.price * (1 + this.orders.length); + } +} + +export function testObservable() { + var a = mobservable(3); + var b = mobservable(() => a() * 2); +} + +export function testAnnotations() { + var order1totals:number[] = []; + var order1 = new Order(); + var order2 = new Order(); + + var disposer = mobservable.observe(() => { + order1totals.push(order1.total) + }); + + order2.price = 4; + order1.amount = 1; + + order2.orders.push('bla'); + + order1.orders.splice(0,0,'boe', 'hoi'); + + disposer(); + order1.orders.pop(); +}; + +export function testTyping() { + var ar:Mobservable.IObservableArray = mobservable.makeReactive([1,2]); + ar.observe((d:Mobservable.IArrayChange|Mobservable.IArraySplice) => { + console.log(d.type); + }); + + var ar2:Mobservable.IObservableArray = mobservable([1,2]); + ar2.observe((d:Mobservable.IArrayChange|Mobservable.IArraySplice) => { + console.log(d.type); + }); + + var x:Mobservable.IObservableValue = mobservable(3); +} \ No newline at end of file diff --git a/mobservable/mobservable-tests.ts.tscparams b/mobservable/mobservable-tests.ts.tscparams new file mode 100644 index 000000000..77f208cc0 --- /dev/null +++ b/mobservable/mobservable-tests.ts.tscparams @@ -0,0 +1 @@ +--noImplicitAny --module commonjs --target es5 --experimentalDecorators diff --git a/mobservable/mobservable.d.ts b/mobservable/mobservable.d.ts new file mode 100644 index 000000000..d98c34454 --- /dev/null +++ b/mobservable/mobservable.d.ts @@ -0,0 +1,189 @@ +// Type definitions for mobservable v0.6.10 +// Project: https://mweststrate.github.io/mobservable +// Definitions by: Michel Weststrate +// Definitions: https://github.com/borisyankov/DefinitelyTyped + + +interface _IMobservableStatic { + /** + * Turns an object, array or function into a reactive structure. + * @param value the value which should become observable. + */ + makeReactive: IMakeReactive; + + /** + * Extends an object with reactive capabilities. + * @param target the object to which reactive properties should be added + * @param properties the properties that should be added and made reactive + * @returns targer + */ + extendReactive(target: Object, properties: Object):Object; + + /** + * Returns true if the provided value is reactive. + * @param value object, function or array + * @param propertyName if propertyName is specified, checkes whether value.propertyName is reactive. + */ + isReactive(value: any, propertyName?:string): boolean; + + /** + * Can be used in combination with makeReactive / extendReactive. + * Enforces that a reference to 'value' is stored as property, + * but that 'value' itself is not turned into something reactive. + * Future assignments to the same property will inherit this behavior. + * @param value initial value of the reactive property that is being defined. + */ + asReference(value: any):{value:T}; + + /** + * ES6 / Typescript decorator which can to make class properties and getter functions reactive. + */ + observable(target: Object, key: string):any; // decorator / annotation + + /** + * Creates a reactive view and keeps it alive, so that the view is always + * updated if one of the dependencies changes, even when the view is not further used by something else. + * @param func The reactive view + * @param scope (optional) + * @returns disposer function, which can be used to stop the view from being updated in the future. + */ + observe(func: Mobservable.Lambda, scope?: any): Mobservable.Lambda; + + /** + * Deprecated, use mobservable.observe instead. + */ + sideEffect(func: Mobservable.Lambda, scope?: any): Mobservable.Lambda; + + /** + * Similar to 'observer', observes the given predicate until it returns true. + * Once it returns true, the 'effect' function is invoked an the observation is cancelled. + * @param predicate + * @param effect + * @param scope (optional) + * @returns disposer function to prematurely end the observer. + */ + observeUntil(predicate: ()=>boolean, effect: Mobservable.Lambda, scope?: any): Mobservable.Lambda; + + /** + * During a transaction no views are updated until the end of the transaction. + * The transaction will be run synchronously nonetheless. + * @param action a function that updates some reactive state + * @returns any value that was returned by the 'action' parameter. + */ + transaction(action: ()=>T): T; + + /** + * Converts a reactive structure into a non-reactive structure. + * Basically a deep-clone. + */ + toJSON(value: T): T; + + /** + * Sets the reporting level Defaults to 1. Use 0 for production or 2 for increased verbosity. + */ + logLevel: number; // 0 = production, 1 = development, 2 = debugging + + extras: { + getDependencyTree(thing:any, property?:string): Mobservable.IDependencyTree; + + getObserverTree(thing:any, property?:string): Mobservable.IObserverTree; + + trackTransitions(extensive?:boolean, onReport?:(lines:Mobservable.ITransitionEvent) => void) : Mobservable.Lambda; + } +} + +interface IMakeReactive { + (value: T[], opts?: Mobservable.IMakeReactiveOptions): Mobservable.IObservableArray; + (value: ()=>T, opts?: Mobservable.IMakeReactiveOptions): Mobservable.IObservableValue; + (value: T, opts?: Mobservable.IMakeReactiveOptions): Mobservable.IObservableValue; + (value: Object, opts?: Mobservable.IMakeReactiveOptions): T; +} + +interface IMobservableStatic extends _IMobservableStatic, IMakeReactive { +} + +declare module Mobservable { + interface IMakeReactiveOptions { + as?: string /* "auto" | "reference" | TODO: see #8 "structure" */ + scope?: Object, + context?: Object, + recurse?: boolean; + name?: string; + // protected: boolean TODO: see #9 + } + + export interface IContextInfoStruct { + object: Object; + name: string; + } + + export type IContextInfo = IContextInfoStruct | string; + + interface Lambda { + (): void; + name?: string; + } + + interface IObservable { + observe(callback: (...args: any[])=>void, fireImmediately?: boolean): Lambda; + } + + interface IObservableValue extends IObservable { + (): T; + (value: T):void; + observe(callback: (newValue: T, oldValue: T)=>void, fireImmediately?: boolean): Lambda; + } + + interface IObservableArray extends IObservable, Array { + spliceWithArray(index: number, deleteCount?: number, newItems?: T[]): T[]; + observe(listener: (changeData: IArrayChange|IArraySplice)=>void, fireImmediately?: boolean): Lambda; + clear(): T[]; + replace(newItems: T[]): T[]; + find(predicate: (item: T,index: number,array: IObservableArray)=>boolean,thisArg?: any,fromIndex?: number): T; + remove(value: T): boolean; + } + + interface IArrayChange { + type: string; // Always: 'update' + object: IObservableArray; + index: number; + oldValue: T; + } + + interface IArraySplice { + type: string; // Always: 'splice' + object: IObservableArray; + index: number; + removed: T[]; + addedCount: number; + } + + interface IDependencyTree { + id: number; + name: string; + context: any; + dependencies?: IDependencyTree[]; + } + + interface IObserverTree { + id: number; + name: string; + context: any; + observers?: IObserverTree[]; + listeners?: number; // amount of functions manually attached using an .observe method + } + + interface ITransitionEvent { + id: number; + name: string; + context: Object; + state: string; + changed: boolean; + newValue: string; + } +} + +declare module "mobservable" { + var m : IMobservableStatic; + export = m; +} \ No newline at end of file diff --git a/msportalfx-test/msportalfx-test-tests.ts b/msportalfx-test/msportalfx-test-tests.ts index 4bf402d1b..98f86dcd4 100644 --- a/msportalfx-test/msportalfx-test-tests.ts +++ b/msportalfx-test/msportalfx-test-tests.ts @@ -34,6 +34,7 @@ function TestPortal() { var bladePromise = testFx.portal.openResourceBlade(resourceId, summaryBlade.title, 20000) var stringPromise = testFx.portal.takeScreenshot("TestPortal"); var stringArrayPromise = testFx.portal.getBrowserLogs(testFx.LogLevel.All); + anyPromise = testFx.portal.waitUntilElementDoesNotContainAttribute(testFx.Locators.By.className('part'), 'class', 'invalid'); } function TestBlades() { @@ -41,14 +42,16 @@ function TestBlades() { blade.clickCommand('Delete'); var createBlade = new testFx.Blades.CreateBlade(bladeTitle); - voidPromise = createBlade.actionBar.clickCreate(); - voidPromise = createBlade.actionBar.clickDelete(); + voidPromise = createBlade.actionBar.createButton.click(); var browseBlade = new testFx.Blades.BrowseResourceBlade(bladeTitle); voidPromise = browseBlade.selectResource(resourceName); var pickerBlade = new testFx.Blades.PickerBlade(bladeTitle); pickerBlade.pickItem('abc'); + + var specPickerBlade = new testFx.Blades.SpecPickerBlade(bladeTitle); + specPickerBlade.pickSpec('S2'); } function TestParts() { @@ -60,6 +63,9 @@ function TestParts() { var resourceSummary = new testFx.Parts.ResourceSummaryPart(summaryBlade.getLocator()); var count = resourceSummary.properties.length; + + var pricingTier = new testFx.Parts.PricingTierPart(summaryBlade.getLocator()); + voidPromise = pricingTier.click(); } function TestControls() { @@ -75,7 +81,13 @@ function TestControls() { } function TestActionBars() { - var bar = new testFx.ActionBars.ActionBar(summaryBlade.getLocator()); - voidPromise = bar.clickCreate(); - voidPromise = bar.clickDelete(); + var createBar = new testFx.ActionBars.CreateActionBar(summaryBlade.getLocator()); + voidPromise = createBar.createButton.click(); + + var deleteBar = new testFx.ActionBars.DeleteActionBar(summaryBlade.getLocator()); + voidPromise = deleteBar.deleteButton.click(); + voidPromise = deleteBar.cancelButton.click(); + + var pickerBar = new testFx.ActionBars.PickerActionBar(summaryBlade.getLocator()); + voidPromise = pickerBar.selectButton.click(); } \ No newline at end of file diff --git a/msportalfx-test/msportalfx-test.d.ts b/msportalfx-test/msportalfx-test.d.ts index cb0d6de41..5ba413484 100644 --- a/msportalfx-test/msportalfx-test.d.ts +++ b/msportalfx-test/msportalfx-test.d.ts @@ -38,16 +38,35 @@ declare module MsPortalTestFx { static partialLinkText(value: string): Locator; static tagName(value: string): Locator; static xpath(value: string): Locator; + static text(value: string): Locator; static chained(...values: Locator[]): Locator; static content(...values: Locator[]): Locator; } } export module ActionBars { - export class ActionBar extends MsPortalTestFx.PortalElement { + export class ActionBarButton extends PortalElement { + constructor(parentLocator?: Locators.Locator, baseLocator?: Locators.Locator); + click(): Q.Promise; + } + + export class CreateActionBar extends PortalElement { + public createButton: ActionBarButton; + + constructor(parentLocator?: Locators.Locator); + } + + export class DeleteActionBar extends PortalElement { + public deleteButton: ActionBarButton; + public cancelButton: ActionBarButton; + + constructor(parentLocator?: Locators.Locator); + } + + export class PickerActionBar extends PortalElement { + public selectButton: ActionBarButton; + constructor(parentLocator?: Locators.Locator); - clickCreate(): Q.Promise; - clickDelete(): Q.Promise; } } @@ -60,7 +79,7 @@ declare module MsPortalTestFx { } export class CreateBlade extends Blade { - public actionBar: ActionBars.ActionBar; + public actionBar: ActionBars.CreateActionBar; } export class BrowseResourceBlade extends Blade { @@ -70,9 +89,12 @@ declare module MsPortalTestFx { } export class PickerBlade extends Blade { - constructor(title: string); pickItem(item: string): Q.Promise; } + + export class SpecPickerBlade extends Blade { + pickSpec(specCode: string): Q.Promise; + } } export module Controls { @@ -137,6 +159,9 @@ declare module MsPortalTestFx { constructor(parentLocator?: Locators.Locator); } + class PricingTierPart extends Part { + } + export class Tile extends MsPortalTestFx.PortalElement { public progressLocator: Locators.Locator; @@ -201,6 +226,7 @@ declare module MsPortalTestFx { getAttribute(locator: Locators.Locator, attributeName: string, timeout?: number): Q.Promise; waitForElementNotVisible(locator: Locators.Locator, timeout?: number): Q.Promise; waitUntilElementContainsAttribute(locator: Locators.Locator, attributeName: string, attributeValue: string, timeout?: number): Q.Promise; + waitUntilElementDoesNotContainAttribute(locator: Locators.Locator, attributeName: string, attributeValue: string, timeout?: number): Q.Promise; waitForElementLocated(locator: Locators.Locator, timeout?: number): Q.Promise; takeScreenshot(filePrefix?: string): Q.Promise; goHome(timeout?: number): Q.Promise; diff --git a/node-mysql-wrapper/my-meteor.d.ts b/node-mysql-wrapper/my-meteor.d.ts new file mode 100644 index 000000000..18ec6dde9 --- /dev/null +++ b/node-mysql-wrapper/my-meteor.d.ts @@ -0,0 +1,84 @@ +// Type definitions for meteorjs for node-mysql-wrapper which helps in development +// Project: https://github.com/nodets/node-mysql-wrapper +// Definitions by: Makis Maropoulos +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module Mongo { + var Collection: CollectionStatic; + interface CollectionStatic { + new (name: string, options?: { + connection?: Object; + idGeneration?: string; + transform?: Function; + }): Collection; + } + interface Collection { + allow(options: { + insert?: (userId: string, doc: T) => boolean; + update?: (userId: string, doc: T, fieldNames: string[], modifier: any) => boolean; + remove?: (userId: string, doc: T) => boolean; + fetch?: string[]; + transform?: Function; + }): boolean; + deny(options: { + insert?: (userId: string, doc: T) => boolean; + update?: (userId: string, doc: T, fieldNames: string[], modifier: any) => boolean; + remove?: (userId: string, doc: T) => boolean; + fetch?: string[]; + transform?: Function; + }): boolean; + find(selector?: any, options?: { + sort?: any; + skip?: number; + limit?: number; + fields?: any; + reactive?: boolean; + transform?: Function; + }): Mongo.Cursor; + findOne(selector?: any, options?: { + sort?: any; + skip?: number; + fields?: any; + reactive?: boolean; + transform?: Function; + }): T; + insert(doc: T, callback?: Function): string; + rawCollection():any; + rawDatabase():any; + remove(selector: any, callback?: Function): void; + update(selector: any, modifier: any, options?: { + multi?: boolean; + upsert?: boolean; + }, callback?: Function): number; + upsert(selector: any, modifier: any, options?: { + multi?: boolean; + }, callback?: Function): { numberAffected?: number; insertedId?: string; }; + _ensureIndex(indexName: string, options?: { [key: string]: any }): void; + } + + var Cursor: CursorStatic; + interface CursorStatic { + new (): Cursor; + } + interface Cursor { + count(): number; + fetch(): Array; + forEach(callback: (doc: T, index: number, cursor: Mongo.Cursor) => void, thisArg?: any): void; + map(callback: (doc: T, index: number, cursor: Mongo.Cursor) => U, thisArg?: any): Array; + observe(callbacks: Object): any; + observeChanges(callbacks: Object): any; + } + + var ObjectID: ObjectIDStatic; + interface ObjectIDStatic { + new (hexString: string): ObjectID; + } + interface ObjectID { + } + +} + +declare module Meteor { + var isServer: boolean; + var isClient: boolean; +} diff --git a/node-mysql-wrapper/node-mysql-wrapper.d.ts b/node-mysql-wrapper/node-mysql-wrapper.d.ts index af100bbf4..1de3ca1b2 100644 --- a/node-mysql-wrapper/node-mysql-wrapper.d.ts +++ b/node-mysql-wrapper/node-mysql-wrapper.d.ts @@ -5,6 +5,8 @@ /// /// +/// + declare module "node-mysql-wrapper" { import * as Mysql from 'mysql'; @@ -34,6 +36,8 @@ declare module "node-mysql-wrapper" { type TableToSearchPart = { tableName: string, propertyName: string }; + type PropertyChangedCallback = (args: PropertyChangedArgs) => any; + interface Map { [index: string]: T; } @@ -95,12 +99,12 @@ declare module "node-mysql-wrapper" { /** * Iterate object's keys and return their values to the callback. - * @param {Map} map the object. + * @param {} map the object. * @param {valueCallback} * @returnType {U} * @return {U} */ - static forEachValue(map: Map, callback: (value: T) => U): U; + static forEachValue(map: T, callback: (value: T) => U): U; /** * Iterate object's keys and return their names to the callback. @@ -285,22 +289,179 @@ declare module "node-mysql-wrapper" { } class SaveQuery implements IQuery { - _table: Table constructor(_table: Table); - execute(criteriaRawJsObject: any, callback?: (_result: T | any) => any): Promise; } class DeleteQuery implements IQuery{ - _table: Table constructor(_table: Table); - execute(criteriaOrID: any | number | string, callback?: (_result: DeleteAnswer) => any): Promise; } + class PropertyChangedArgs { + propertyName: string; + oldValue: any; + constructor(propertyName: string, oldValue: any); + } + + class ObservableObject { + + /** Property names that your row couldn't have: + * "propertyChangedListeners", "notifyPropertyChanged", "onPropertyChanged", "toJSON", "makeObservable", "_forget" + */ + static RESERVED_PROPERTY_NAMES: string[]; + + private propertyChangedListeners: PropertyChangedCallback[]; + + /** Make the obj observable. Used in constructor or extend this class and use it. */ + private makeObservable(obj: any): void; + + constructor(); + constructor(obj?: any); + + /**Add a listener/observer to watch for changes in this object's properties */ + onPropertyChanged(listener: PropertyChangedCallback): void; + + /** If developer wants manualy notify for property changed */ + notifyPropertyChanged(propertyName: string, oldValue: any): void; + + /**Remove property changed listeners */ + _forget(): void; + + toJSON(...excludeProperties: string[]): any; + + } + + enum CollectionChangedAction { + INSERT, DELETE, RESET//for now I will use only add, remove and reset . replace and move is for future., REPLACE, MOVE + } + + class CollectionChangedEventArgs { + action: CollectionChangedAction; + oldItems: (T | (T & ObservableObject))[]; + newItems: (T | (T & ObservableObject))[]; + oldStartingIndex: number; + newStartingIndex: number; + + constructor(action: CollectionChangedAction, oldItems?: (T | (T & ObservableObject))[], newItems?: (T | (T & ObservableObject))[], oldStartingIndex?: number, newStartingIndex?: number); + } + + + class BaseCollection {//T=result type of Table + private list: (T | (T & ObservableObject))[]; + listeners: ((eventArgs: CollectionChangedEventArgs) => void)[]; + constructor(table: Table); + length: number; + items: (T | (T & ObservableObject))[]; + indexOf(item: T | string | number): number; + findItem(itemId: string | number): T; + getItem(index: number): T; + getItemObservable(index: number): T & ObservableObject; + addItem(...items: (T | (T & ObservableObject))[]): (T | (T & ObservableObject)); + removeItem(...items: (T | (T & ObservableObject))[]): BaseCollection; + removeItemById(id: number | string): BaseCollection; + forgetItem(...items: (T | (T & ObservableObject))[]): BaseCollection; + reset(): BaseCollection; + notifyCollectionChanged(evtArgs: CollectionChangedEventArgs): void; + onCollectionChanged(callback: (eventArgs: CollectionChangedEventArgs) => void): void; + } + + class ObservableCollection { //auti i klasi 9a xrisimopoieite ws Collection me kapoies paralages mesa sto index.ts. + local: BaseCollection; + private _items: (T & ObservableObject)[]; + + constructor(table: Table, fetchAllFromDatabase?: boolean, callbackWhenReady?: Function); + + items: (T & ObservableObject)[]; + + onCollectionChanged(callback: (eventArgs: CollectionChangedEventArgs) => void): void; + + startListeningToDatabase(): void; + + find(criteriaRawJsObject?: any, callback?: (_results: T[]) => any): Promise; + + findOne(criteriaRawJsObject: any, callback?: (_result: T) => any): Promise; + + findById(id: number | string, callback?: (result: T) => any): Promise; + + findAll(tableRules?: RawRules, callback?: (_results: T[]) => any): Promise; + + /** + * .insert() and .update() do the same thing: .save(); + */ + insert(criteriaRawJsObject: any, callback?: (_result: any) => any): Promise; + + update(criteriaRawJsObject: any, callback?: (_result: any) => any): Promise; + + save(criteriaRawJsObject: any, callback?: (_result: any) => any): Promise; + + remove(criteriaOrID: any | number | string, callback?: (_result: DeleteAnswer) => any): Promise; + + /** + * same thing as .remove(); + */ + delete(criteriaOrID: any | number | string, callback?: (_result: DeleteAnswer) => any): Promise; + + + } + + class MeteorCollection { + private collection: Mongo.Collection; + protected table: Table; + + constructor(table: Table, name?: string); + + startListeningToDatabase(): void; + + rawCollection: Mongo.Collection; + + fill(criteriaRawJsObject: any): void; + + fillAll(): void; + + fillOne(criteriaRawJsObject: any): void; + + //ONLY MONGO/METEOR COLLECTION METHODS START + allow(options: { + insert?: (userId: string, doc: T) => boolean; + update?: (userId: string, doc: T, fieldNames: string[], modifier: any) => boolean; + remove?: (userId: string, doc: T) => boolean; + fetch?: string[]; + transform?: Function; + }): boolean; + + deny(options: { + insert?: (userId: string, doc: T) => boolean; + update?: (userId: string, doc: T, fieldNames: string[], modifier: any) => boolean; + remove?: (userId: string, doc: T) => boolean; + fetch?: string[]; + transform?: Function; + }): boolean; + + find(selector?: any, options?: { + sort?: any; + skip?: number; + limit?: number; + fields?: any; + reactive?: boolean; + transform?: Function; + }): Mongo.Cursor; + + findOne(selector?: any, options?: { + sort?: any; + skip?: number; + fields?: any; + reactive?: boolean; + transform?: Function; + }): T; + + //ONLY MONGO/METEOR COLLECTION METHODS FINISH. + + } + class Connection extends EventEmitter { @@ -324,15 +485,15 @@ declare module "node-mysql-wrapper" { */ tables: Table[]; - constructor(connection: string | Mysql.IConnection); + constructor(connection: string | Mysql.IConnection | Mysql.IConnectionConfig); /** * Creates the MysqlConnection from the connection url or the real connection object. - * @param {string | Mysql.IConnection} connection the connection url or the real connection object. + * @param {string | Mysql.IConnection | Mysql.IConnectionConfig} connection the connection url or the real connection object. * @returnType {nothing} * @return {nothing} */ - create(connection: string | Mysql.IConnection): void; + create(connection: string | Mysql.IConnection | Mysql.IConnectionConfig): void; /** * Attach a real connection. @@ -356,6 +517,13 @@ declare module "node-mysql-wrapper" { */ destroy(): void; + /** + * Clear all binary logs from the whole database. + * When finish returns a promise, use it with .then(function(){}); + * @return Promise + */ + clearBinaryLogs(): Promise; + /** * Link the real connection with this MysqlConnection object. * @param {function} readyCallback when the link operation is done this callback is executed. @@ -377,7 +545,7 @@ declare module "node-mysql-wrapper" { * @returnType {Promise} * @return {Promise} */ - fetchDatabaseInfornation(): Promise; + fetchDatabaseInformation(): Promise; /** * Escape the query column's value and return it. @@ -391,21 +559,21 @@ declare module "node-mysql-wrapper" { * Call when must notify the Database events, SAVE(INSERT,UPDATE), REMOVE(DELETE). * @param {string} tableWhichCalled the table name which event is coming from. * @param {string} queryStr the full parsed query string which used to determinate the type of event to notify. - * @param {any[]} parsedResults the parsed results (results after a method parse/edit/export them as objects), these are passing to the watch listener(s). + * @param {any[]} rawRows the raw rows results (results before a method parse/edit/export them as objects), these are passing to the watch listener(s). * @returnType {nothing} * @return {nothing} */ - notice(tableWhichCalled: string, queryStr: string, parsedResults: any[]): void; + notice(tableWhichCalled: string, queryStr: string, rawRows: any[]): void; /** * Adds an event listener/watcher on a table for a 'database event'. * @param {string} tableName the table name which you want to add the event listener. * @param {string or string[]} evtType the event(s) type you want to watch, one of these(string) or an array of them(string[]): ["INSERT", "UPDATE", "REMOVE", "SAVE"]. - * @param {function} callback Callback which has one parameter(typeof any[]) which filled by the parsedResults (results after query executed and exports to object(s)). + * @param {function} callback Callback which has one parameter(typeof any[]) which filled by the rawRows (results after query executed and before parsed to object(s)). * @returnType {nothing} * @return {nothing} */ - watch(tableName: string, evtType: any, callback: (parsedResults: any[]) => void): void; + watch(tableName: string, evtType: any, callback: (rawRows: any[]) => void): void; /** * Removes an event listener/watcher from a table for a specific event type. @@ -415,7 +583,7 @@ declare module "node-mysql-wrapper" { * @returnType {nothing} * @return {nothing} */ - unwatch(tableName: string, evtType: string, callbackToRemove: (parsedResults: any[]) => void): void; + unwatch(tableName: string, evtType: string, callbackToRemove: (rawResults: any[]) => void): void; /** * Executes a database query. @@ -437,7 +605,11 @@ declare module "node-mysql-wrapper" { table(tableName: string): Table; } - class Table { + class Table { + /** Private keywords here are useless but I put them. + * If the developer wants to see the properties of the Table class, he/she just comes here. + */ + private _name: string; private _connection: Connection; private _columns: string[]; @@ -449,6 +621,8 @@ declare module "node-mysql-wrapper" { private _deleteQuery: DeleteQuery; constructor(tableName: string, connection: Connection); + + /** * An array of all columns' names inside this table. */ @@ -491,11 +665,11 @@ declare module "node-mysql-wrapper" { /** * Adds or turn on an event listener/watcher on a table for a 'database event'. * @param {string} evtType the event type you want to watch, one of these: ["INSERT", "UPDATE", "REMOVE", "SAVE"]. - * @param {function} callback Callback which has one parameter(typeof any[]) which filled by the parsedResults (results after query executed and exports to object(s)). + * @param {function} callback Callback which has one parameter(typeof any[]) which filled by the rawResults (results after query executed and before exports to object(s)). * @returnType {nothing} * @return {nothing} */ - on(evtType: string, callback: (parsedResults: any[]) => void): void; + on(evtType: string, callback: (rawResults: any[]) => void): void; /** * Removes or turn off an event listener/watcher from a table for a specific event type. @@ -504,8 +678,8 @@ declare module "node-mysql-wrapper" { * @returnType {nothing} * @return {nothing} */ - off(evtType: string, callbackToRemove: (parsedResults: any[]) => void): void; - + off(evtType: string, callbackToRemove: (rawResults: any[]) => void): void; + /** * Use it when you want to check if extended function is exists here. * @param {string} extendedFunctionName the name of the function you want to check. @@ -564,7 +738,7 @@ declare module "node-mysql-wrapper" { findSingle(criteriaRawJsObject: any, callback?: (_result: T) => any): Promise; - findById(id: number|string): Promise; // without callback + findById(id: number | string): Promise; // without callback findById(id: number | string, callback?: (result: T) => any): Promise; findAll(): Promise; // only criteria and promise @@ -581,8 +755,25 @@ declare module "node-mysql-wrapper" { } - class Wrapper { + class MeteorTable{ + public table: Table; + constructor(table: Table); + + insert(doc: T, callback?: (_result: T) => void): T; + + remove(selector: any, callback?: () => DeleteAnswer): DeleteAnswer; + + update(selector: any, modifier: any, options?: { + multi?: boolean; + upsert?: boolean; + }, callback?: (result: T) => any): number; + + collection(nameOfCollection?: string, fillWithCriteria?: any): Mongo.Collection; + } + + class Database { connection: Connection; + isReady: boolean; readyListenerCallbacks: Function[]; constructor(connection?: Connection); static when(..._promises: Promise[]): Promise; @@ -597,7 +788,7 @@ declare module "node-mysql-wrapper" { useOnly(...useTables: any[]): void; has(tableName: string, functionName?: string): boolean; - ready(callback: () => void): void; + ready(callback?: () => void): void; table(tableName: string): Table; noticeReady(): void; removeReadyListener(callback: () => void): void; @@ -621,7 +812,19 @@ declare module "node-mysql-wrapper" { buildRules(): SelectQueryRules; buildRules(parentRules?: SelectQueryRules): SelectQueryRules; + + collection(tableName: string, callbackWhenReady?: Function): ObservableCollection; + + /**Meteor js feature only: Returns a table which it's collection can make synchronization with the client */ + meteorTable(tableName: string): MeteorTable; } - function wrap(mysqlUrlOrObjectOrMysqlAlreadyConnection: Mysql.IConnection | string, ...useTables: any[]): Wrapper; + function wrap(mysqlUrlOrObjectOrMysqlAlreadyConnection: Mysql.IConnection | string, ...useTables: any[]): Database; + + /** For meteor js only + * Same as wrap but it's sync mode - autoconnect to the database without need to use database.ready(callback). + */ + function connect(mysqlUrlOrObjectOrMysqlAlreadyConnection: Mysql.IConnection | string, ...useTables: any[]): Database; + + function observable(obj: T): T & ObservableObject; } diff --git a/node-notifier/node-notifier.d.ts b/node-notifier/node-notifier.d.ts index d003001a3..9e612453e 100644 --- a/node-notifier/node-notifier.d.ts +++ b/node-notifier/node-notifier.d.ts @@ -3,7 +3,6 @@ // Definitions by: Qubo // Definitions: https://github.com/borisyankov/DefinitelyTyped -/// /// declare module "node-notifier" { diff --git a/node/node.d.ts b/node/node.d.ts index 7498e401f..140a72c74 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -193,8 +193,7 @@ declare module NodeJS { export interface WritableStream extends EventEmitter { writable: boolean; - write(buffer: Buffer, cb?: Function): boolean; - write(str: string, cb?: Function): boolean; + write(buffer: Buffer|string, cb?: Function): boolean; write(str: string, encoding?: string, cb?: Function): boolean; end(): void; end(buffer: Buffer, cb?: Function): void; @@ -1772,6 +1771,7 @@ declare module "util" { export function isDate(object: any): boolean; export function isError(object: any): boolean; export function inherits(constructor: any, superConstructor: any): void; + export function debuglog(key:string): (msg:string,...param: any[])=>void; } declare module "assert" { diff --git a/os-locale/os-locale-tests.ts b/os-locale/os-locale-tests.ts index 65763a112..bcf5b0129 100644 --- a/os-locale/os-locale-tests.ts +++ b/os-locale/os-locale-tests.ts @@ -5,4 +5,8 @@ import osLocale, { sync } from 'os-locale'; osLocale((err: any, locale: string) => { }); -var locale: string = sync(); +osLocale({spawn: false}, (err: any, locale: string) => { +}); + +var locale1: string = sync(); +var locale2: string = sync({spawn: false}); diff --git a/os-locale/os-locale.d.ts b/os-locale/os-locale.d.ts index 17933ae67..74b2d6922 100644 --- a/os-locale/os-locale.d.ts +++ b/os-locale/os-locale.d.ts @@ -1,12 +1,14 @@ -// Type definitions for os-locale 1.2.1 +// Type definitions for os-locale 1.4.0 // Project: https://github.com/sindresorhus/os-locale // Definitions by: Aya Morisawa // Definitions: https://github.com/borisyankov/DefinitelyTyped declare module "os-locale" { + function osLocale(options: {spawn?: boolean}, cb: (err: any, locale: string) => void): void; function osLocale(cb: (err: any, locale: string) => void): void; function osLocaleSync(): string; - + function osLocaleSync(options: {spawn?: boolean}): string; + export { osLocaleSync as sync }; export default osLocale; } diff --git a/phonegap-facebook-plugin/phonegap-facebook-plugin-tests.ts b/phonegap-facebook-plugin/phonegap-facebook-plugin-tests.ts new file mode 100644 index 000000000..405325510 --- /dev/null +++ b/phonegap-facebook-plugin/phonegap-facebook-plugin-tests.ts @@ -0,0 +1,114 @@ +/// + +facebookConnectPlugin.api("a", ["b", "c"]); +facebookConnectPlugin.api("a", ["b", "c"], (result: any) => {}); +facebookConnectPlugin.api("a", ["b", "c"], (result: any) => {}, (error: string) => {}); + +facebookConnectPlugin.getAccessToken((token: string) => {}); +facebookConnectPlugin.getAccessToken((token: string) => {}, (error: string) => {}); + +facebookConnectPlugin.getLoginStatus(); +facebookConnectPlugin.getLoginStatus((status: PhonegapFacebookPlugin.LoginResult) => { + var accessToken: string = status.authResponse.accessToken; + var expiresIn: string = status.authResponse.expiresIn; + var secret: string = status.authResponse.secret; + var session_key: boolean = status.authResponse.session_key; + var sig: string = status.authResponse.sig; + var userID: string = status.authResponse.userID; + var status1: string = status.status; +}, (error: string) => {}); + +facebookConnectPlugin.logEvent("a"); +facebookConnectPlugin.logEvent("a", {}); +facebookConnectPlugin.logEvent("a", {}, 42); +facebookConnectPlugin.logEvent("a", {}, 42, () => {}); +facebookConnectPlugin.logEvent("a", {}, 42, () => {}, (error: string) => {}); + +facebookConnectPlugin.logPurchase(42, "a"); +facebookConnectPlugin.logPurchase(42, "a", () => {}); +facebookConnectPlugin.logPurchase(42, "a", () => {}, (error: string) => {}); + +facebookConnectPlugin.login(["a", "b"], (result: PhonegapFacebookPlugin.LoginResult) => { + var accessToken: string = result.authResponse.accessToken; + var expiresIn: string = result.authResponse.expiresIn; + var secret: string = result.authResponse.secret; + var session_key: boolean = result.authResponse.session_key; + var sig: string = result.authResponse.sig; + var userID: string = result.authResponse.userID; + var status: string = result.status; +}, (error: string) => {}); + +facebookConnectPlugin.logout(); +facebookConnectPlugin.logout(() => {}); +facebookConnectPlugin.logout(() => {}, (error: string) => {}); + +//#region BaseDialog + +var baseDialogOptions: PhonegapFacebookPlugin.BaseDialogOptions = { + method: "a" +}; + +facebookConnectPlugin.showDialog(baseDialogOptions, (status: PhonegapFacebookPlugin.BaseDialogResult) => {}, (error: string) => {}); + +//#endregion + +//#region Feed Dialog + +var feedDialogOptions: PhonegapFacebookPlugin.FeedDialogOptions = { + method: "feed", + from: "a", + to: "b", + link: "c", + picture: "d", + source: "e", + name: "f", + caption: "g", + description: "h", + ref: "i" +}; + +facebookConnectPlugin.showDialog(feedDialogOptions, (status: PhonegapFacebookPlugin.FeedDialogResult) => { + var post_id: string = status.post_id; +}, (error: string) => {}); + +//#endregion + +//#region Send Dialog + +var sendDialogOptions: PhonegapFacebookPlugin.SendDialogOptions = { + method: "send", + to: "a", + link: "b" +}; + +facebookConnectPlugin.showDialog(sendDialogOptions, (status: PhonegapFacebookPlugin.SendDialogResult) => { +}, (error: string) => {}); + +//#endregion + +//#region Share Dialog + +var shareDialogOptions: PhonegapFacebookPlugin.ShareDialogOptions = { + method: "share", + href: "a" +}; + +facebookConnectPlugin.showDialog(shareDialogOptions, (status: PhonegapFacebookPlugin.ShareDialogResult) => { + var post_id: string = status.post_id; +}, (error: string) => {}); + +//#endregion + +//#region Share Open Graph Dialog + +var shareOpenGraphDialogOptions: PhonegapFacebookPlugin.ShareOpenGraphDialogOptions = { + method: "share_open_graph", + action_type: "a", + action_properties: "b" +}; + +facebookConnectPlugin.showDialog(shareOpenGraphDialogOptions, (status: PhonegapFacebookPlugin.ShareDialogResult) => { + var post_id: string = status.post_id; +}, (error: string) => {}); + +//#endregion \ No newline at end of file diff --git a/phonegap-facebook-plugin/phonegap-facebook-plugin.d.ts b/phonegap-facebook-plugin/phonegap-facebook-plugin.d.ts new file mode 100644 index 000000000..02544b3b8 --- /dev/null +++ b/phonegap-facebook-plugin/phonegap-facebook-plugin.d.ts @@ -0,0 +1,292 @@ +// Type definitions for phonegap-facebook-plugin 0.11.0 +// Project: https://github.com/Wizcorp/phonegap-facebook-plugin +// Definitions by: Justin Unterreiner +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module PhonegapFacebookPlugin { + + //#region API Methods + + interface FacebookConnectPluginStatic { + + /** + * Allows access to the Facebook Graph API. This API allows for additional permission because, unlike login, the Graph API can + * accept multiple permissions. In order to make calls to the Graph API on behalf of a user, the user has to be logged into your + * app using Facebook login. + * + * @param graphPath The graph API path to use for the query. + * @param permissions The permissions to request. + * @param successCallback The callback to be executed when the call completes successfully. + * @param failureCallback The callback to be executed when the call fails. + */ + api: (graphPath: string, permissions: string[], successCallback?: (result: any) => void, failureCallback?: (error: string) => void) => void; + + /** + * Used to retreive the access token for the current user. + * + * @param successCallback The callback to be executed when the call completes successfully. + * @param failureCallback The callback to be executed when the call fails. + */ + getAccessToken: (successCallback?: (token: string) => void, failureCallback?: (error: string) => void) => void; + + /** + * Used to get the login status for the current user. + * + * @param successCallback The callback to be executed when the call completes successfully. + * @param failureCallback The callback to be executed when the call fails. + */ + getLoginStatus: (successCallback?: (status: LoginResult) => void, failureCallback?: (error: string) => void) => void; + + /** + * Used to log an event. + * + * @param name Name of the event. + * @param params Extra data to log with the event (optional). + * @param valueToSum a property which is an arbitrary number that can represent any value (e.g., a price or a quantity). + * When reported, all of the valueToSum properties will be summed together. For example, if 10 people each purchased + * one item that cost $10 (and passed in valueToSum) then they would be summed to report a number of $100. (optional) + * @param successCallback The callback to be executed when the call completes successfully. + * @param failureCallback The callback to be executed when the call fails. + */ + logEvent: (name: string, params?: any, valueToSum?: number, successCallback?: () => void, failureCallback?: (error: string) => void) => void; + + /** + * Used to log a purchase. + * + * @param value The value of the purchase. + * @param currency An ISO-4217 currency code. + * @param successCallback The callback to be executed when the call completes successfully. + * @param failureCallback The callback to be executed when the call fails. + */ + logPurchase: (value: number, currency: string, successCallback?: () => void, failureCallback?: (error: string) => void) => void; + + /** + * Used to log the user in via Facebook. Calling this will result in a Facebook login dialog (or external + * webpage) launching. Once the user completes the flow, one of the two callbacks will be executed. + * + * @param permissions The permissions to request during login. + * @param successCallback The callback to be executed when the call completes successfully. + * @param failureCallback The callback to be executed when the call fails. + */ + login: (permissions: string[], successCallback?: (result: LoginResult) => void, failureCallback?: (error: string) => void) => void; + + /** + * Used to log the user out of Facebook. This will invalidate their access token. + * + * @param successCallback The callback to be executed when the call completes successfully. + * @param failureCallback The callback to be executed when the call fails. + */ + logout: (successCallback?: () => void, failureCallback?: (error: string) => void) => void; + + /** + * Used to open a Facebook dialog. + * + * @param options The options that control the dialog and it's behavior. + * @param successCallback The callback to be executed when the call completes successfully. + * @param failureCallback The callback to be executed when the call fails. + */ + showDialog: (options: BaseDialogOptions, successCallback?: (status: BaseDialogResult) => void, failureCallback?: (error: string) => void) => void; + } + + //#endregion + + //#region Method Parameters + + interface BaseDialogOptions { + + /** + * The type of dialog to show, can be one of the following. + * + * Depeneding on the type, a different options object will be used: + * + * Method Options Type + * feed FeedDialogOptions + * send SendDialogOptions + * share ShareDialogOptions + * share_open_graph ShareOpenGraphDialogOptions + */ + method: string; + } + + /** + * You can add the Feed Dialog to your app so people can publish individual stories to their timeline. This + * includes captions that your app manages and a personal comment from the person sharing the content. + * + * For use with showDialog() of method type 'feed'. + */ + interface FeedDialogOptions extends BaseDialogOptions { + + /** + * The ID of the person posting the message. If this is unspecified, it defaults to the current person. + * If specified, it must be the ID of the person or of a page that the person administers. + */ + from?: string; + + /** + * The ID of the profile that this story will be published to. If this is unspecified, it defaults to + * the value of from. The ID must be a friend who also uses your app. + */ + to?: string; + + /** + * The link attached to this post. + */ + link?: string; + + /** + * The URL of a picture attached to this post. The picture must be at least 200px by 200px. + */ + picture?: string; + + /** + * The URL of a media file (either SWF or MP3) attached to this post. If SWF, you must also specify + * 'picture' to provide a thumbnail for the video. + */ + source?: string; + + /** + * The name of the link attachment. + */ + name?: string; + + /** + * The caption of the link (appears beneath the link name). If not specified, this field is automatically + * populated with the URL of the link. + */ + caption?: string; + + /** + * The description of the link (appears beneath the link caption). If not specified, this field is + * automatically populated by information scraped from the link, typically the title of the page. + */ + description?: string; + + /** + * This argument is a comma-separated list, consisting of at most 5 distinct items, each of length at + * least 1 and at most 15 characters drawn from the set + * '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_'. + * Each category is used in Facebook Insights to help you measure the performance of different types + * of post. + */ + ref?: string; + } + + /** + * The Send Dialog lets people privately send content to specific friends. They'll have the option to privately + * share a link as a Facebook message or group post. The Send Dialog does not require any extended permissions. + * + * For use with showDialog() of method type 'send'. + */ + interface SendDialogOptions extends BaseDialogOptions { + + /** + * A user ID of a recipient. Once the dialog comes up, the sender can specify additional people, and groups + * addresses as recipients. Sending content to a Facebook group will post it to the group's wall. + */ + to: string; + + /** + * Required parameter. The URL that is being sent in the message. + */ + link: string; + } + + /** + * The Share dialog prompts a person to publish an individual story or an Open Graph story to their timeline. + * This does not require Facebook Login or any extended permissions, so it is the easiest way to enable + * sharing on web. + * + * For use with showDialog() of method type 'share'. + */ + interface ShareDialogOptions extends BaseDialogOptions { + + /** + * The link attached to this post. Required when using method share. Include open graph meta tags in the + * page at this URL to customize the story that is shared. + */ + href: string; + } + + /** + * The Share dialog prompts a person to publish an individual story or an Open Graph story to their timeline. + * This does not require Facebook Login or any extended permissions, so it is the easiest way to enable + * sharing on web. + * + * For use with showDialog() of method type 'share_open_graph'. + */ + interface ShareOpenGraphDialogOptions extends BaseDialogOptions { + + /** + * A string specifying which Open Graph action type to publish, e.g., og.likes for the built in like type. + * The dialog also supports approved custom types. + */ + action_type: string; + + /** + * A JSON object of key/value pairs specifying parameters which correspond to the action_type being used. + * Valid key/value pairs are the same parameters that can be used when publishing Open Graph Actions using + * the API. + */ + action_properties: string; + } + + //#endregion + + //#region Callback Results + + /** + * Result for the login() and getLoginStatus() success callbacks. + */ + interface LoginResult { + authResponse: { + accessToken: string; + expiresIn: string; + secret: string; + session_key: boolean; + sig: string; + userID: string; + }, + status: string; + } + + /** + * The base result type for all showDialog() success callbacks. + */ + interface BaseDialogResult { + error_code: string; + error_message: string; + } + + /** + * The response object returned from a success callback for showDialog() of type 'feed'. + */ + interface FeedDialogResult extends BaseDialogResult { + + /** + * The ID of the posted story, if the person chose to publish. + */ + post_id: string; + } + + /** + * The response object returned from a success callback for showDialog() of type 'send'. + */ + interface SendDialogResult extends BaseDialogResult { + } + + /** + * The response object returned from a success callback for showDialog() of type 'share' or 'share_open_graph'. + */ + interface ShareDialogResult extends BaseDialogResult { + + /** + * Only available if the user is logged into your app using Facebook and has granted publish_actions. + * If present, this is the ID of the published Open Graph story. + */ + post_id: string; + } + + //#endregion +} + +declare var facebookConnectPlugin: PhonegapFacebookPlugin.FacebookConnectPluginStatic; \ No newline at end of file diff --git a/react-dnd/react-dnd-tests.ts b/react-dnd/react-dnd-tests.ts index d270a041d..ef51367e8 100644 --- a/react-dnd/react-dnd-tests.ts +++ b/react-dnd/react-dnd-tests.ts @@ -11,6 +11,7 @@ var r = React.DOM; import DragSource = ReactDnd.DragSource; import DropTarget = ReactDnd.DropTarget; +import DragLayer = ReactDnd.DragLayer; import DragDropContext = ReactDnd.DragDropContext; import HTML5Backend = require('react-dnd/modules/backends/HTML5'); import TestBackend = require('react-dnd/modules/backends/Test'); @@ -197,6 +198,32 @@ module BoardSquare { export var create = React.createFactory(DndBoardSquare); } +// Custom Drag Layer Component +// ---------------------------------------------------------------------- +module CustomDragLayer { + interface CustomDragLayerP extends React.Props { + isDragging?: boolean; + item?: Object; + } + + function dragLayerCollect(monitor: ReactDnd.DragLayerMonitor) { + return { + isDragging: monitor.isDragging(), + item: monitor.getItem(), + }; + } + + export class CustomDragLayer extends React.Component { + render() { + return r.div(null, this.props.isDragging ? this.props.item : null); + } + } + + export var dragLayer = DragLayer(dragLayerCollect)(CustomDragLayer); + + export var create = React.createFactory(dragLayer); +} + // Board Component // ---------------------------------------------------------------------- @@ -237,13 +264,18 @@ module Board { } return r.div({ - style: { - width: '100%', - height: '100%', - display: 'flex', - flexWrap: 'wrap' - }, - children: squares + children: [ + CustomDragLayer.create(), + r.div({ + style: { + width: '100%', + height: '100%', + display: 'flex', + flexWrap: 'wrap' + }, + children: squares + }) + ] }); } } diff --git a/react-dnd/react-dnd.d.ts b/react-dnd/react-dnd.d.ts index d86af3b8b..151f0a404 100644 --- a/react-dnd/react-dnd.d.ts +++ b/react-dnd/react-dnd.d.ts @@ -53,10 +53,10 @@ declare module __ReactDnd { backend: Backend ): (componentClass: React.ComponentClass

) => ContextComponentClass

; - // TODO: Add exported function for DragLayer. - // The React DnD docs say that this is an advanced feature that is only - // necessary when performing custom rendering or when using a custom - // backend. + export function DragLayer

( + collect: (monitor: DragLayerMonitor) => Object, + options?: DndOptions

+ ): (componentClass: React.ComponentClass

) => DndComponentClass

; // Shared // ---------------------------------------------------------------------- @@ -148,6 +148,20 @@ declare module __ReactDnd { type ConnectDropTarget =

(elementOrNode: React.ReactElement

) => React.ReactElement

; + /// DragLayerMonitor + // ---------------------------------------------------------------------- + + class DragLayerMonitor { + isDragging(): boolean; + getItemType(): Identifier; + getItem(): Object; + getInitialClientOffset(): ClientOffset; + getInitialSourceClientOffset(): ClientOffset; + getClientOffset(): ClientOffset; + getDifferenceFromInitialOffset(): ClientOffset; + getSourceClientOffset(): ClientOffset; + } + /// Backend /// --------------------------------------------------------------------- diff --git a/react-redux/react-redux-tests.tsx b/react-redux/react-redux-tests.tsx new file mode 100644 index 000000000..9bd662295 --- /dev/null +++ b/react-redux/react-redux-tests.tsx @@ -0,0 +1,244 @@ +/// +/// +/// +/// +/// + +import { Component } from 'react'; +import * as React from 'react'; +import * as Router from 'react-router'; +import { Route, RouterState } from 'react-router'; +import { Store, Dispatch, bindActionCreators } from 'redux'; +import { connect, Provider } from 'react-redux'; +import objectAssign = require('object-assign'); + +// +// Quick Start +// https://github.com/rackt/react-redux/blob/master/docs/quick-start.md#quick-start +// + +interface CounterState { + counter: number; +} +declare var increment: Function; + +class Counter extends Component { + render() { + return ( + + ); + } +} + +function mapStateToProps(state: CounterState) { + return { + value: state.counter + }; +} + +// Which action creators does it want to receive by props? +function mapDispatchToProps(dispatch: Dispatch) { + return { + onIncrement: () => dispatch(increment()) + }; +} + +connect( + mapStateToProps, + mapDispatchToProps +)(Counter); + + +@connect(mapStateToProps) +class CounterContainer extends Component { + +} + +class App extends Component { + render(): JSX.Element { + // ... + return null; + } +} + +const targetEl = document.getElementById('root'); + +React.render(( + + {() => } + +), targetEl); + +// +// API +// https://github.com/rackt/react-redux/blob/master/docs/api.md +// +declare var routes: Route; +declare var store: Store; +declare var routerState: RouterState; +class MyRootComponent extends Component { + +} +class TodoApp extends Component { + +} +interface TodoState { + todos: string[]|string; +} +interface TodoProps { + userId: number; +} +interface DispatchProps { + addTodo(userId: number, text: string): void; +} +declare var actionCreators: () => { + action: Function; +} +declare var addTodo: () => { type: string; }; +declare var todoActionCreators: { [type: string]: (...args: any[]) => any; }; +declare var counterActionCreators: { [type: string]: (...args: any[]) => any; }; + +React.render( + + {() => } + , + document.body +); + +Router.run(routes, Router.HistoryLocation, (Handler, routerState) => { // note "routerState" here + React.render( + + {/* + //TODO: error TS2339: Property 'routerState' does not exist on type 'RouteProp'. + {() => } // note "routerState" here: important to pass it down + */} + , + document.getElementById('root') + ); +}); + +//TODO: for React Router 1.0 +//TODO: error TS2604: JSX element type 'Router' does not have any construct or call signatures. +//React.render( +// +// {() => ...} +// , +// targetEl +//); + +// Inject just dispatch and don't listen to store + +connect()(TodoApp); + +// Inject dispatch and every field in the global state + +connect((state: TodoState) => state)(TodoApp); + +// Inject dispatch and todos + +function mapStateToProps2(state: TodoState) { + return { todos: state.todos }; +} + +export default connect(mapStateToProps2)(TodoApp); + +// Inject todos and all action creators (addTodo, completeTodo, ...) + +//function mapStateToProps(state) { +// return { todos: state.todos }; +//} + +connect(mapStateToProps2, actionCreators)(TodoApp); + +// Inject todos and all action creators (addTodo, completeTodo, ...) as actions + +//function mapStateToProps(state) { +// return { todos: state.todos }; +//} + +function mapDispatchToProps2(dispatch: Dispatch) { + return { actions: bindActionCreators(actionCreators, dispatch) }; +} + +connect(mapStateToProps2, mapDispatchToProps2)(TodoApp); + +// Inject todos and a specific action creator (addTodo) + +//function mapStateToProps(state) { +// return { todos: state.todos }; +//} + +function mapDispatchToProps3(dispatch: Dispatch) { + return bindActionCreators({ addTodo }, dispatch); +} + +connect(mapStateToProps2, mapDispatchToProps3)(TodoApp); + +// Inject todos, todoActionCreators as todoActions, and counterActionCreators as counterActions + +//function mapStateToProps(state) { +// return { todos: state.todos }; +//} + +function mapDispatchToProps4(dispatch: Dispatch) { + return { + todoActions: bindActionCreators(todoActionCreators, dispatch), + counterActions: bindActionCreators(counterActionCreators, dispatch) + }; +} + +connect(mapStateToProps2, mapDispatchToProps4)(TodoApp); + +// Inject todos, and todoActionCreators and counterActionCreators together as actions + +//function mapStateToProps(state) { +// return { todos: state.todos }; +//} + +function mapDispatchToProps5(dispatch: Dispatch) { + return { + actions: bindActionCreators(objectAssign({}, todoActionCreators, counterActionCreators), dispatch) + }; +} + +connect(mapStateToProps2, mapDispatchToProps5)(TodoApp); + +// Inject todos, and all todoActionCreators and counterActionCreators directly as props + +//function mapStateToProps(state) { +// return { todos: state.todos }; +//} + +function mapDispatchToProps6(dispatch: Dispatch) { + return bindActionCreators(objectAssign({}, todoActionCreators, counterActionCreators), dispatch); +} + +connect(mapStateToProps2, mapDispatchToProps6)(TodoApp); + +// Inject todos of a specific user depending on props + +function mapStateToProps3(state: TodoState, ownProps: TodoProps): TodoState { + return { todos: state.todos[ownProps.userId] }; +} + +connect(mapStateToProps3)(TodoApp); + +// Inject todos of a specific user depending on props, and inject props.userId into the action + +//function mapStateToProps(state) { +// return { todos: state.todos }; +//} + +function mergeProps(stateProps: TodoState, dispatchProps: DispatchProps, ownProps: TodoProps): DispatchProps & TodoState { + return objectAssign({}, ownProps, { + todos: stateProps.todos[ownProps.userId], + addTodo: (text: string) => dispatchProps.addTodo(ownProps.userId, text) + }); +} + +connect(mapStateToProps2, actionCreators, mergeProps)(TodoApp); + + + diff --git a/react-redux/react-redux-tests.tsx.tscparams b/react-redux/react-redux-tests.tsx.tscparams new file mode 100644 index 000000000..c90abf04f --- /dev/null +++ b/react-redux/react-redux-tests.tsx.tscparams @@ -0,0 +1 @@ +--target es5 --noImplicitAny --experimentalDecorators --jsx react diff --git a/react-redux/react-redux.d.ts b/react-redux/react-redux.d.ts new file mode 100644 index 000000000..f1ef5458e --- /dev/null +++ b/react-redux/react-redux.d.ts @@ -0,0 +1,68 @@ +// Type definitions for react-redux 2.1.2 +// Project: https://github.com/rackt/react-redux +// Definitions by: Qubo +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare module "react-redux" { + import { Component } from 'react'; + import { Store, Dispatch, ActionCreator } from 'redux'; + + export interface ClassDecorator { + (target: TFunction): TFunction|void; + } + + /** + * Connects a React component to a Redux store. + * @param mapStateToProps + * @param mapDispatchToProps + * @param mergeProps + * @param options + */ + export function connect(mapStateToProps?: MapStateToProps, + mapDispatchToProps?: MapDispatchToPropsFunction|MapDispatchToPropsObject, + mergeProps?: MergeProps, + options?: Options): ClassDecorator; + + interface MapStateToProps { + (state: any, ownProps?: any): any; + } + + interface MapDispatchToPropsFunction { + (dispatch: Dispatch, ownProps?: any): any; + } + + interface MapDispatchToPropsObject { + [name: string]: ActionCreator; + } + + interface MergeProps { + (stateProps: any, dispatchProps: any, ownProps: any): any; + } + + interface Options { + /** + * If true, implements shouldComponentUpdate and shallowly compares the result of mergeProps, + * preventing unnecessary updates, assuming that the component is a “pure” component + * and does not rely on any input or state other than its props and the selected Redux store’s state. + * Defaults to true. + * @default true + */ + pure: boolean; + } + + export interface Property { + /** + * The single Redux store in your application. + */ + store?: Store; + children?: Function; + } + + /** + * Makes the Redux store available to the connect() calls in the component hierarchy below. + */ + export class Provider extends Component { } +} diff --git a/react-spinkit/react-spinkit-tests.tsx b/react-spinkit/react-spinkit-tests.tsx new file mode 100644 index 000000000..eb84781e4 --- /dev/null +++ b/react-spinkit/react-spinkit-tests.tsx @@ -0,0 +1,7 @@ +/// +/// + +import Spinner from 'react-spinkit'; +import * as React from 'react'; + +let spinner = ; diff --git a/react-spinkit/react-spinkit.d.ts b/react-spinkit/react-spinkit.d.ts new file mode 100644 index 000000000..666def38e --- /dev/null +++ b/react-spinkit/react-spinkit.d.ts @@ -0,0 +1,19 @@ +// Type definitions for react-spinkit 1.1.4 +// Project: https://github.com/KyleAMathews/react-spinkit +// Definitions by: Qubo +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "react-spinkit" { + import { Component } from 'react'; + + interface Props { + spinnerName?: string; + } + + class Spinner extends Component { } + + export default Spinner; +} + diff --git a/react/react.d.ts b/react/react.d.ts index 8d5b621e0..a529c34f5 100644 --- a/react/react.d.ts +++ b/react/react.d.ts @@ -572,6 +572,7 @@ declare namespace __React { stroke?: string; strokeDasharray?: string; strokeLinecap?: string; + strokeMiterlimit?: string; strokeOpacity?: number | string; strokeWidth?: number | string; textAnchor?: string; @@ -1373,6 +1374,7 @@ declare module "react/addons" { stroke?: string; strokeDasharray?: string; strokeLinecap?: string; + strokeMiterlimit?: string; strokeOpacity?: number | string; strokeWidth?: number | string; textAnchor?: string; diff --git a/redux-action-utils/redux-action-utils-tests.ts b/redux-action-utils/redux-action-utils-tests.ts new file mode 100644 index 000000000..d3994a153 --- /dev/null +++ b/redux-action-utils/redux-action-utils-tests.ts @@ -0,0 +1,62 @@ +/// +/// + +import { actionCreator, optionsActionCreator } from 'redux-action-utils'; +import { Action, ActionCreator } from 'redux-action-utils'; + +let types = { + ADD_LESSON: 'ADD_LESSON', + IMPORT_LESSONS: 'IMPORT_LESSONS', + UPDATE_LESSON: 'UPDATE_LESSON' +}; +var type: string; + +export default { + addLesson: actionCreator(types.ADD_LESSON), + importLessons: actionCreator(types.IMPORT_LESSONS, 'lessons'), + updateLesson: optionsActionCreator(types.UPDATE_LESSON, 'id', 'update') +}; + +var ac = actionCreator(types.ADD_LESSON); +var action: Action = ac(); +type = action.type; + + +class ImportLesson { + lessons: string[]; +} + +const importLessonAction = actionCreator(types.IMPORT_LESSONS, 'lessons'); +var importLesson = importLessonAction(['lesson 1', 'lesson 2']); +// → {type: 'IMPORT_LESSONS', lessons: ['lesson 1', 'lesson 2']} + +var lessons: string[] = importLesson.lessons; +type = importLesson.type; + + +class UpdateLesson { + id: number; + update: { + text: string + } +} + +const updateLessonAction = optionsActionCreator(types.UPDATE_LESSON, 'id', 'update'); +let updateLesson = updateLessonAction({ + id: 1, + update: { + text: '## Lesson 1' + } +}); +/* → + { + type: 'UPDATE_LESSON', + id: 1, + update: { + text: '## Lesson 1' + } + } + */ + +let id: number = updateLesson.id; +type = updateLesson.type; diff --git a/redux-action-utils/redux-action-utils.d.ts b/redux-action-utils/redux-action-utils.d.ts new file mode 100644 index 000000000..8e565902d --- /dev/null +++ b/redux-action-utils/redux-action-utils.d.ts @@ -0,0 +1,37 @@ +// Type definitions for redux-action-utils 2.0.0 +// Project: https://github.com/insin/redux-action-utils +// Definitions by: Qubo +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "redux-action-utils" { + export interface Action { + type: string; + } + + export interface ActionCreator { + (...data: any[]): Action & T; + } + + export interface OptionsActionCreator { + (data: T): Action & T; + } + + /** + * Creates an action creator which will create an action object with the given type. + */ + export function actionCreator(type: string, ...props: string[]): ActionCreator; + /** + * Creates an action creator which will create an action object with the given type. + */ + export function actionCreator(type: string, props: string[]): ActionCreator; + + /** + * Creates an action creator which takes a single object argument and adds its properties to the action object. + */ + export function optionsActionCreator(type: string, ...props: string[]): OptionsActionCreator; + /** + * Creates an action creator which takes a single object argument and adds its properties to the action object. + */ + export function optionsActionCreator(type: string, props: string[]): OptionsActionCreator; +} + diff --git a/redux-devtools/redux-devtools-tests.tsx b/redux-devtools/redux-devtools-tests.tsx new file mode 100644 index 000000000..c17aa38ab --- /dev/null +++ b/redux-devtools/redux-devtools-tests.tsx @@ -0,0 +1,62 @@ +/// +/// +/// + +import { compose, createStore, applyMiddleware, Middleware, Reducer } from 'redux'; +import { devTools, persistState } from 'redux-devtools'; +import { DevTools, DebugPanel, LogMonitor } from 'redux-devtools/lib/react'; +import * as React from 'react'; +import { Component } from 'react'; + +declare var m1: Middleware; +declare var m2: Middleware; +declare var m3: Middleware; +declare var reducer: Reducer; +class CounterApp extends Component { }; +class Provider extends Component<{ store: any }, any> { }; + +const finalCreateStore = compose( + // Enables your middleware: + applyMiddleware(m1, m2, m3), // any Redux middleware, e.g. redux-thunk + // Provides support for DevTools: + devTools(), + // Lets you write ?debug_session= in address bar to persist debug sessions + persistState(window.location.href.match(/[?&]debug_session=([^&]+)\b/)) +)(createStore); +const store = finalCreateStore(reducer); + +class Root extends Component { + render() { + return ( +

+ + {() => } + + + + +
+ ); + } +} + +// +// https://github.com/gaearon/redux-devtools/blob/master/examples/counter/containers/App.js +// + +class App extends Component { + render() { + return ( +
+ + {() => } + + + + +
+ ); + } +} diff --git a/redux-devtools/redux-devtools-tests.tsx.tscparams b/redux-devtools/redux-devtools-tests.tsx.tscparams new file mode 100644 index 000000000..c90abf04f --- /dev/null +++ b/redux-devtools/redux-devtools-tests.tsx.tscparams @@ -0,0 +1 @@ +--target es5 --noImplicitAny --experimentalDecorators --jsx react diff --git a/redux-devtools/redux-devtools.d.ts b/redux-devtools/redux-devtools.d.ts new file mode 100644 index 000000000..7612adb7c --- /dev/null +++ b/redux-devtools/redux-devtools.d.ts @@ -0,0 +1,109 @@ +// Type definitions for redux-devtools 2.1.4 +// Project: https://github.com/gaearon/redux-devtools +// Definitions by: Qubo +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare module "redux-devtools" { + export function devTools(): Function; + export function persistState(sessionId: any, stateDeserializer?: Function, actionDeserializer?: Function): Function; +} + +declare module "redux-devtools/lib/react" { + import * as React from 'react'; + + export class DevTools extends React.Component { + + } + + export interface DevToolsProps { + monitor: Function; + store: Store; + } + + export interface Store { + devToolStore: DevToolStore; + } + + export class DevToolStore extends React.Component { + dispatch: Function; + } + + export class DebugPanel extends React.Component { } + + export interface DebugPanelProps { + position?: string; + zIndex?: number; + fontSize?: string; + overflow?: string; + opacity?: number; + color?: string; + left?: boolean|number; + right?: boolean|number; + top?: boolean|number; + bottom?: boolean|number; + maxHeight?: string; + maxWidth?: string; + wordWrap?: string; + boxSizing?: string; + boxShadow?: string; + getStyle?: () => DebugPanelProps; + } + + export class LogMonitor extends React.Component { } + + export interface LogMonitorProps { + computedStates?: ComputedState[]; + currentStateIndex?: number; + monitorState?: MonitorState; + stagedActions?: Action[]; + skippedActions?: boolean[]; + reset?: Function; + commit?: Function; + rollback?: Function; + sweep?: Function; + toggleAction?: Function; + jumpToState?: Function; + setMonitorState?: Function; + select?: Function; + visibleOnLoad?: boolean; + theme?: Theme|string; + } + + export interface ComputedState { + state?: any; + error?: string; + } + + export interface MonitorState { + isViaible?: boolean; + } + + export interface Action { + type: string; + } + + export interface Theme { + scheme: string; + author: string; + base00: string; + base01: string; + base02: string; + base03: string; + base04: string; + base05: string; + base06: string; + base07: string; + base08: string; + base09: string; + base0A: string; + base0B: string; + base0C: string; + base0D: string; + base0E: string; + base0F: string; + } +} + diff --git a/redux-logger/redux-logger-tests.ts b/redux-logger/redux-logger-tests.ts index c57e72177..b5dd3232f 100644 --- a/redux-logger/redux-logger-tests.ts +++ b/redux-logger/redux-logger-tests.ts @@ -6,12 +6,14 @@ import { applyMiddleware, createStore } from 'redux' let logger = createLogger(); let loggerWithOpts = createLogger({ + actionTransformer: actn => actn, collapsed: true, - level: 'warn', - logger: console.log, - timestamp: false, - transformer: state => state, - predicate: (getState, action) => true + duration: true, + level: 'error', + logger: console, + predicate: (getState, action) => true, + timestamp: true, + transformer: state => state }); let createStoreWithMiddleware = applyMiddleware( diff --git a/redux-logger/redux-logger.d.ts b/redux-logger/redux-logger.d.ts index 6bc7775f9..7f9cab9d7 100644 --- a/redux-logger/redux-logger.d.ts +++ b/redux-logger/redux-logger.d.ts @@ -1,4 +1,4 @@ -// Type definitions for redux-logger v1.0.6 +// Type definitions for redux-logger v2.0.0 // Project: https://github.com/fcomb/redux-logger // Definitions by: Alexander Rusakov // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -8,13 +8,15 @@ declare module 'redux-logger' { interface ReduxLoggerOptions { + actionTransformer?: (action: any) => any; collapsed?: boolean; + duration?: boolean; level?: string; logger?: any; + predicate?: (getState: Function, action: any) => boolean; timestamp?: boolean; - transformer?: (state:any)=>any; - predicate?: (getState:Function, action:any)=>boolean; + transformer?: (state:any) => any; } - export default function createLogger(options?:ReduxLoggerOptions):Redux.Middleware; + export default function createLogger(options?: ReduxLoggerOptions): Redux.Middleware; } diff --git a/request/request.d.ts b/request/request.d.ts index a4507a6e2..4827bc7a6 100644 --- a/request/request.d.ts +++ b/request/request.d.ts @@ -62,6 +62,7 @@ declare module 'request' { uri?: string; callback?: (error: any, response: http.IncomingMessage, body: any) => void; jar?: any; // CookieJar + formData?: any; // Object form?: any; // Object or string auth?: AuthOptions; oauth?: OAuthOptions; @@ -141,6 +142,7 @@ declare module 'request' { pass?: string; password?: string; sendImmediately?: boolean; + bearer?: string; } export interface OAuthOptions { diff --git a/rest-io/rest-io-tests.ts b/rest-io/rest-io-tests.ts new file mode 100644 index 000000000..5f558b77a --- /dev/null +++ b/rest-io/rest-io-tests.ts @@ -0,0 +1,18 @@ +/// + +import express = require('express'); +import restIO = require('rest-io'); +import mongoose = require('mongoose'); + +var app = express(); + +// register the express app with rest.io +restIO.restIO(app, { + resources: __dirname + '/resources' +}); + +mongoose.connect('mongodb://localhost:27017/test'); +app.listen(3000, function () { + console.log('Server has started under port: 3000'); +}); +module.exports = app; \ No newline at end of file diff --git a/rest-io/rest-io.d.ts b/rest-io/rest-io.d.ts new file mode 100644 index 000000000..a2dac465b --- /dev/null +++ b/rest-io/rest-io.d.ts @@ -0,0 +1,148 @@ +// Type definitions for rest-io 4.0 +// Project: https://github.com/EnoF/rest-io +// Definitions by: Andy Tang , Stefan Schacherl +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + + +declare module 'rest-io' { +import {Router, Application, Response, Request} from 'express'; + +import {Mongoose, Schema, Model, Document, Types, Promise} from 'mongoose'; + + function restIO(app: Application, config?: IRestIOConfig): RestIO; + + export interface RestIO { + resource: ResourceModule + } + + export interface IRestIOConfig { + resources: string; + db?: Mongoose; + } + + export interface ResourceModule { + Resource: Resource; + AuthorizedResource: AuthorizedResource; + authorizedResource: AuthorizedResourceModule; + UserResource: UserResource; + SubResource: SubResource; + } + + export class Resource { + baseUrl: string; + url: string; + parameterizedUrl: string; + model: Model; + resDef: IResource; + parentResource: Resource; + router: Router; + app: Application; + db: Mongoose; + paramId: string; + parentRef: string; + populate: string; + + constructor(resDef: IResource); + + createModel(resDef: IResource): Model; + + toClassName(name: string): string; + + setupRoutes(): void; + + getAll(req: Request, res: Response): void; + + buildParentSearch(req: Request): any; + + getById(req: Request, res: Response): void; + + create(req: Request, res: Response): void; + + update(req: Request, res: Response): void; + + del(req: Request, res: Response): void; + + errorHandler(err: Error, res: Response): void; + } + + export interface IResource { + name: string; + model: any; + parentRef?: string; + populate?: string; + plural?: string; + parentResource?: Resource; + } + + export interface AuthorizedResourceModule { + AuthorizedResource: AuthorizedResource + ROLES: Roles + } + + export interface Roles { + USER: string; + SUPER_USER: string; + MODERATOR: string; + ADMIN: string; + } + + export class AuthorizedResource extends Resource { + methodAccess: IMethodAccess; + + maxDays: number; + + permissions: IMethodAccess; + + isTokenExpired(createdAt: Date): boolean; + + getRoles(id: string): Promise; + + hasAuthorizedRole(roles: Array, authorizedRoles: Array): boolean; + + hasAccessRightsDefined(req: Request, authorizedRoles: Array): boolean; + + isAuthorized(req: Request, authorizedRoles: Array): boolean; + + sendUnauthorized(error: Error, res: Response): void; + } + + export interface IMethodAccess { + getAll: Array; + getById: Array; + create: Array; + update: Array; + del: Array; + } + + export class UserResource extends AuthorizedResource { + ensureBaseUserModel(model: any): void; + + createRoleModel(): void; + + isSelf(req: Request): boolean; + + login(req: Request, res: Response): void; + } + + export class SubResource extends Resource { + constructor(resDef: ISubResource); + + createProjectionQuery(req: Request): any; + + createPullQuery(req: Request): any; + + createFindQuery(req: Request): any; + + createSubUpdateQuery(req: Request): any; + } + + export interface ISubResource { + name: string; + plural?: string; + parentResource: Resource; + populate?: string; + } +} \ No newline at end of file diff --git a/restangular/restangular-tests.ts b/restangular/restangular-tests.ts index 33c46a421..9b5a9c30b 100644 --- a/restangular/restangular-tests.ts +++ b/restangular/restangular-tests.ts @@ -92,7 +92,8 @@ myApp.controller('TestCtrl', ( Restangular.setMethodOverriders(["put", "patch"]); Restangular.setErrorInterceptor(function (response) { - console.error('' + response.status + ' ' + response.data); + let location: string = response.headers('Location'); + console.error('' + response.status + ' ' + response.data + ' ' + location); }); Restangular.setRequestSuffix('.json'); diff --git a/restangular/restangular.d.ts b/restangular/restangular.d.ts index bce357482..b09e4affd 100644 --- a/restangular/restangular.d.ts +++ b/restangular/restangular.d.ts @@ -43,6 +43,7 @@ declare module restangular { interface IResponse { status: number; data: any; + headers(name: string): string; config: { method: string; url: string; diff --git a/restful.js/restful.js-tests.ts b/restful.js/restful.js-tests.ts new file mode 100644 index 000000000..80f3bd187 --- /dev/null +++ b/restful.js/restful.js-tests.ts @@ -0,0 +1,198 @@ +/// + +import restful, { + Api, MemberResponse, CollectionResponse, ResponseBody, CollectionEndpoint, MemberEndpoint, +} from 'restful.js'; + +class Article { + title: string; + body: string; +} +class Comment { + body: string; +} +class Author { + name: string; +} + +var api: Api; + +api = restful('api.example.com'); + +// +// Usage +// + +api = restful('api.example.com') + .header('AuthToken', 'test') // set global header + .prefixUrl('v1') + .protocol('https') + .port(8080); +// resource now targets `https://api.example.com:8080/v1` + + +var articlesCollection = api.all('articles'); // http://api.example.com/articles +var articleMember = api.one('articles', 1); // http://api.example.com/articles/1 +var articleMember = api.one('articles', 1); // http://api.example.com/articles/1 +var commentsCollection = articleMember.all('comments'); // http://api.example.com/articles/1/comments + +var articleMember = api.oneUrl('articles', 'http://custom.url/article?id=1'); // http://custom.url/article?id=1 +var articlesCollection = api.allUrl('articles', 'http://custom.url/article/list'); // http://custom.url/article/list + +articleMember = api.one('articles', 1); // http://api.example.com/articles/1 +articleMember.get().then((response: MemberResponse
) => { + var articleEntity = response.body(); + + var article = articleEntity.data(); + console.log(article.title); // hello, world! +}); + +commentsCollection = articleMember.all('comments'); // http://api.example.com/articles/1/comments +commentsCollection.getAll().then((response: CollectionResponse) => { + var commentEntities = response.body(); + + commentEntities.forEach((commentEntity: ResponseBody) => { + var comment = commentEntity.data(); + console.log(comment.body); + }) +}); + +// fetch http://api.example.com/articles/1/comments/4 +articleMember = api.one('articles', 1); +let commentMember = articleMember.one('comments', 4); +commentMember.get().then((response) => { + // +}); +// equivalent to +commentsCollection = articleMember.all('comments'); +commentsCollection.get(4).then((response) => { + // +}); + +// +// Entity Data +// + +var articleCollection = api.all('articles'); // http://api.example.com/articles + +// http://api.example.com/articles/1 +api.one('articles', 1).get().then((response: MemberResponse
) => { + var articleEntity = response.body(); + + // if the server response was { id: 1, title: 'test', body: 'hello' } + var article = articleEntity.data(); + article.title; // returns `test` + article.body; // returns `hello` + // You can also edit it + article.title = 'test2'; + // Finally you can easily update it or delete it + articleEntity.save(); // will perform a PUT request + articleEntity.remove(); // will perform a DELETE request +}, (response: any) => { + // The reponse code is not >= 200 and < 400 + throw new Error('Invalid response'); +}); + +articleMember = api.one('articles', 1); // http://api.example.com/articles/1 +commentMember = articleMember.one('comments', 3); // http://api.example.com/articles/1/comments/3 +commentMember.get() + .then((response: MemberResponse) => { + var commentEntity = response.body(); + + // You can also call `all` and `one` on an entity + return commentEntity.all('authors').getAll(); // http://api.example.com/articles/1/comments/3/authors +}).then((response: CollectionResponse) => { + var authorEntities = response.body(); + + authorEntities.forEach((authorEntity: ResponseBody) => { + var author = authorEntity.data(); + console.log(author.name); + }); +}); + +// configure the api +api.header('AuthToken', 'test'); + +articlesCollection = api.all('articles'); +articlesCollection.get(1); // will send the `AuthToken` header +// You can configure articlesCollection, too +articlesCollection.header('foo', 'bar'); + +//TODO: The line below was written in README.md but actually incorrect invocation, hence commented out +//articlesCollection.one('comments', 1).get(); // will send both the AuthToken and foo headers + + +// http://api.example.com/articles/1/comments/2/authors +let authorsCollection = api.one('articles', 1).one('comments', 2).all('authors'); +authorsCollection.getAll().then(function(authorEntities) { /* */ }); +authorsCollection.get(1).then(function(authorEntity) { /* */ }); + + +// +// Interceptors +// + +var resource: Api; + +resource.addRequestInterceptor((data: any, headers: any, method: string, url: string) => { + // to edit the headers, just edit the headers object + + // You always must return the data object + return data; +}); + +resource.addFullRequestInterceptor(function(params, headers, data, method, url) { + //... + + // all args had been modified + return { + params: params, + headers: headers, + data: data, + method: method, + url: url + }; + + // just return modified arguments + return { + headers: headers, + data: data + }; +}); + +resource.addFullResponseInterceptor(function(data, headers, method, url) { + // all args had been modified (method and url is read only) + return { + headers: headers, + data: data + }; + + // just return modified arguments + return { + headers: headers + }; +}); + +// +// Response methods +// + +// http://api.example.com/articles/1/comments/2 +commentMember = api.one('articles', 1).one('comments', 2); +commentMember.get().then(function(response) { + let commentEntity = response.body(); + commentEntity.save(); + commentEntity.remove(); +}); + +// +// Error Handling +// + +commentMember = resource.one('articles', 1).one('comments', 2); +commentMember + .get() + .then(function(commentEntity) { /* */ }) + .catch(function(err) { + // deal with the error +}); diff --git a/restful.js/restful.js.d.ts b/restful.js/restful.js.d.ts new file mode 100644 index 000000000..2d62f113c --- /dev/null +++ b/restful.js/restful.js.d.ts @@ -0,0 +1,245 @@ +// Type definitions for restful.js 0.6.2 +// Project: https://github.com/marmelab/restful.js +// Definitions by: Qubo +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "restful.js" { + export interface Headers { + [key: string]: any + } + + export interface Api extends Endpoint { + all(name: string): CollectionEndpoint; + allUrl(name: string, url: string): CollectionEndpoint; + one(name: string, id: any): MemberEndpoint; + oneUrl(name: string, url: string): MemberEndpoint; + protocol(protocol: string): Api; + protocol(): string; + baseUrl(protocol: string): Api; + baseUrl(): string; + port(port: number): Api; + port(): number; + prefixUrl(prefix: string): Api; + prefixUrl(): string; + customUrl(url: string): Api; + customUrl(): string; + } + + export interface MemberEndpoint extends Endpoint { + /** + * Target a child collection name. + * @param name + */ + all(name: string): CollectionEndpoint; + allUrl(name: string, url: string): CollectionEndpoint; + /** + * Target a child member in a collection name. + * @param name + * @param id + */ + one(name: string, id: any): MemberEndpoint; + oneUrl(name: string, url: string): MemberEndpoint; + /** + * Get a member. Returns a promise with an entity. + * @param params + * @param headers + */ + get(params?: any, headers?: Headers): Promise>; + /** + * Update a member. Returns a promise with the response. + * @param data + * @param headers + */ + put(data: any, headers?: Headers): Promise>; + /** + * Delete a member. Returns a promise with the response. + * @param data + * @param headers + */ + delete(data?: any, headers?: Headers): Promise>; + /** + * Patch a member. Returns a promise with the response. + * @param data + * @param headers + */ + patch(data: any, headers?: Headers): Promise>; + /** + * Perform a HEAD request on a member. Returns a promise with the response. + * @param headers + */ + head(headers?: any): Promise>; + customUrl(url: string): MemberEndpoint; + customUrl(): string; + } + + export interface CollectionEndpoint extends Endpoint { + /** + * Get a member in a collection. Returns a promise with an entity. + * @param id + */ + get(id: any, params?: any, headers?: Headers): Promise>; + /** + * Get a full collection. Returns a promise with an array of entities. + */ + getAll(params?: any, headers?: Headers): Promise>; + /** + * Create a member in a collection. Returns a promise with the response. + */ + post(data: any, headers?: Headers): Promise>; + /** + * Update a member in a collection. Returns a promise with the response. + * @param id + * @param data + * @param headers + */ + put(id: any, data: any, headers?: Headers): Promise>; + /** + * Delete a member in a collection. Returns a promise with the response. + * @param id + * @param data + * @param headers + */ + delete(id: any, data?: any, headers?: Headers): Promise>; + /** + * Patch a member in a collection. Returns a promise with the response. + * @param id + * @param data + * @param headers + */ + patch(id: any, data: any, headers?: Headers): Promise>; + /** + * Perform a HEAD request on a member in a collection. Returns a promise with the response. + * @param id + * @param headers + */ + head(id: any, headers?: Headers): Promise>; + } + + export interface Endpoint { + /** + * Get the url. + */ + url(): string; + /** + * Add a response interceptor. You can only alter data and headers. + */ + addResponseInterceptor(interceptor: ResponseInterceptor): Self; + responseInterceptors(): ResponseInterceptor[]; + /** + * Add a request interceptor. + */ + addRequestInterceptor(interceptor: RequestInterceptor): Self; + requestInterceptors(): RequestInterceptor[]; + /** + * Add a full response interceptor. You can alter data and headers. + */ + addFullResponseInterceptor(interceptor: ResponseInterceptor): Self; + fullResponseInterceptors(): ResponseInterceptor[]; + /** + * Add a full request interceptor. You can alter params, headers, data, method and url. + */ + addFullRequestInterceptor(interceptor: FullRequestInterceptor): Self; + fullRequestInterceptors(): FullRequestInterceptor[]; + /** + * Add a header. + * @param name + * @param value + */ + header(name: string, value: any): Self; + headers(): Headers; + } + + export interface MemberResponse extends ResponseBase { + (): { + data: T; + headers: Headers; + status: number; + statusText: string; + } + body(): ResponseBody; + } + + export interface CollectionResponse extends ResponseBase { + (): { + data: T[]; + headers: Headers; + status: number; + statusText: string; + } + body(): ResponseBody[]; + } + + export interface ResponseBase { + status(): number; + headers(): Headers; + config(): any; + } + + export interface ResponseBody { + /** + * Get the JS object unserialized from the response body (which must be in JSON) + */ + data(): T; + (): T; + /** + * Query a collection child of the entity. + * @param entity + */ + all(entity: string): CollectionEndpoint; + /** + * Query a member child of the entity. + * @param entity + * @param id + */ + one(entity: string, id: any): MemberEndpoint; + /** + * Update the member link to the entity. Returns a promise with the response. + * @param headers + */ + save(headers?: Headers): void; + /** + * Delete the member link to the entity. Returns a promise with the response. + */ + remove(headers?: Headers): void; + /** + * Get the entity url. + */ + url(): string; + /** + * Get the id of the entity. + */ + id(): any; + } + + export interface RequestInterceptor { + (data: any, headers: Headers, method: string, url: string): any; + } + + export interface FullRequestInterceptor { + (params: any, headers: Headers, data: any, method: string, url: string): FullRequestInterceptorReturnValue; + } + + export interface FullRequestInterceptorReturnValue { + params?: any; + headers?: Headers; + data?: any; + method?: string; + url?: string; + } + + export interface ResponseInterceptor { + (data: any, headers: Headers, method: string, url: string): ResponseInterceptorReturnValue; + } + + export interface ResponseInterceptorReturnValue { + headers?: Headers; + data?: any; + method?: string; + url?: string; + } + + export default function restful(endpoint: string): Api; +} + diff --git a/rosie/rosie-tests.ts b/rosie/rosie-tests.ts new file mode 100644 index 000000000..740f1e40c --- /dev/null +++ b/rosie/rosie-tests.ts @@ -0,0 +1,32 @@ +/// + +let resultObj: Object; +let resultFactory: rosie.IFactory; + +declare var Factory:rosie.IFactoryStatic; + +resultFactory = Factory.define('person').attr('name', 'John').sequence('id'); +resultObj = Factory.build('person'); + +resultFactory = Factory.define('some').sequence('id').attr('name', ['id'], (id: number) => { return 'Name ' + id.toString() }); +resultObj = Factory.build('some'); + +Factory.define('coach') + .option('buildPlayer', false) + .sequence('id') + .attr('players', ['id', 'buildPlayer'], function(id: any, buildPlayer: boolean) { + if (buildPlayer) { + return [Factory.build('player', {coach_id: id})]; + } + }) + .after(function(coach: any, options: any) { + if (options.buildPlayer) { + console.log('built player:', coach.players[0]); + } + }); + +Factory.build('coach', {}, {buildPlayer: true}); + +import rosie = require('rosie'); + +var Factory = rosie.Factory; diff --git a/rosie/rosie.d.ts b/rosie/rosie.d.ts new file mode 100644 index 000000000..31c7aa6f9 --- /dev/null +++ b/rosie/rosie.d.ts @@ -0,0 +1,201 @@ +// Type definitions for rosie +// Project: https://github.com/rosiejs/rosie +// Definitions by: Abner Oliveira +// Definitions: https://github.com/borisyankov/DefinitelyTyped +declare module rosie { + interface IFactoryStatic { + + + /** + * Defines a factory by name and constructor function. Call #attr and #option + * on the result to define the properties of this factory. + * + * @param {!string} name + * @param {function(object): *=} constructor + * @return {Factory} + */ + define(name: String, constructor?: Function): IFactory; + + /** + * Locates a factory by name and calls #build on it. + * + * @param {string} name + * @param {object=} attributes + * @param {object=} options + * @return {*} + */ + build(name: string, attributes?: any, options?: Object): Object; + + /** + * Builds a collection of objects using the named factory. + * + * @param {string} name + * @param {number} size + * @param {object=} attributes + * @param {object=} options + * @return {Array.<*>} + */ + buildList(name: string, size: number, attributes?: any, options?: Object): Object[]; + + /** + * Locates a factory by name and calls #attributes on it. + * + * @param {string} name + * @param {object} attributes + * @param {object} options + * @return {object} + */ + attributes(name: string, attributes: Object, options?: Object): Object; + } + + interface IFactory { + /** + * Define an attribute on this factory. Attributes can optionally define a + * default value, either as a value (e.g. a string or number) or as a builder + * function. For example: + * + * // no default value for age + * Factory.define('Person').attr('age') + * + * // static default value for age + * Factory.define('Person').attr('age', 18) + * + * // dynamic default value for age + * Factory.define('Person').attr('age', function() { + * return Math.random() * 100; + * }) + * + * Attributes with dynamic default values can depend on options or other + * attributes: + * + * Factory.define('Person').attr('age', ['name'], function(name) { + * return name === 'Brian' ? 30 : 18; + * }); + * + * By default if the consumer of your factory provides a value for an + * attribute your builder function will not be called. You can override this + * behavior by declaring that your attribute depends on itself: + * + * Factory.define('Person').attr('spouse', ['spouse'], function(spouse) { + * return Factory.build('Person', spouse); + * }); + * + * As in the example above, this can be a useful way to fill in + * partially-specified child objects. + * + * @param {string} attr + * @param {Array.=} | any dependenciesOrValue + * @param any + * @return {Factory} + */ + attr(name: string, dependenciesOrValue: any | string[], value?: any): IFactory; + + /** + * Define an option for this factory. Options are values that may inform + * dynamic attribute behavior but are not included in objects built by the + * factory. Like attributes, options may have dependencies. Unlike + * attributes, options may only depend on other options. + * + * Factory.define('Person') + * .option('includeRelationships', false) + * .attr( + * 'spouse', + * ['spouse', 'includeRelationships'], + * function(spouse, includeRelationships) { + * return includeRelationships ? + * Factory.build('Person', spouse) : + * null; + * }); + * + * Factory.build('Person', null, { includeRelationships: true }); + * + * Options may have either static or dynamic default values, just like + * attributes. Options without default values must have a value specified + * when building. + * + * @param {string} opt + * @param {Array.=} | any dependencies or value + * @param {*=} value + * @return {Factory} + */ + option(name: string, dependenciesOrValue: any | string[], value?: any): IFactory; + + /** + * Defines an attribute that, by default, simply has an auto-incrementing + * numeric value starting at 1. You can provide your own builder function + * that accepts the number of the sequence and returns whatever value you'd + * like it to be. + * + * Sequence values are inherited such that a factory derived from another + * with a sequence will share the state of that sequence and they will never + * conflict. + * + * Factory.define('Person').sequence('id'); + * + * @param {string} attr + * @param {Array.=} dependencies + * @param {function(number): *=} builder + * @return {Factory} + */ + sequence(name: string, dependencies?: string[], builder?: Function) : IFactory; + + /** + * Sets a post-processor callback that will receive built objects and the + * options for the build just before they are returned from the #build + * function. + * + * @param {function(object, ?object)} callback + * @return {Factory} + */ + after(functionArg: Function): IFactory; + + /** + * Sets the constructor for this factory to be another factory. This can be + * used to create more specific sub-types of factories. + * + * @param {Factory} parentFactory + * @return {Factory} + */ + inherits(functionArg: Function): IFactory; + + /** + * Builds a plain object containing values for each of the declared + * attributes. The result of this is the same as the result when using #build + * when there is no constructor registered. + * + * @param {object=} attributes + * @param {object=} options + * @return {object} + */ + attributes(attributes:Object, options: Object): Object; + + /** + * Generates values for all the registered options using the values given. + * + * @private + * @param {object} options + * @return {object} + */ + options(options: Object): Object; + + /** + * Builds objects by getting values for all attributes and optionally passing + * the result to a constructor function. + * + * @param {object=} attributes + * @param {object=} options + * @return {*} + */ + build(attributes: Object, options: Object): Object; + + buildList(size: number, attributes: Object, options: Object): Object[]; + + } + +} + +declare var rosie: { Factory: rosie.IFactoryStatic }; + +declare module 'rosie' { + export = rosie; +} diff --git a/rx-angular/rx.angular.d.ts b/rx-angular/rx.angular.d.ts index 2b82e529a..8b1b94d84 100644 --- a/rx-angular/rx.angular.d.ts +++ b/rx-angular/rx.angular.d.ts @@ -12,6 +12,16 @@ declare module Rx { interface IObservable { safeApply($scope: ng.IScope, callback: (data: T) => void): Rx.Observable; } + + export interface ScopeScheduler extends IScheduler { + constructor(scope: ng.IScope) : ScopeScheduler; + } + + export interface ScopeSchedulerStatic extends SchedulerStatic { + new ($scope: angular.IScope): ScopeScheduler; + } + + export var ScopeScheduler: ScopeSchedulerStatic; } declare module rx.angular { diff --git a/sammyjs/sammyjs.d.ts b/sammyjs/sammyjs.d.ts index 1af796e41..5d980a09f 100644 --- a/sammyjs/sammyjs.d.ts +++ b/sammyjs/sammyjs.d.ts @@ -276,6 +276,10 @@ declare module Sammy { } } +declare module "sammy" { + export = Sammy; +} + interface JQueryStatic { sammy: Sammy.SammyFunc; log: Function; diff --git a/sharepoint/SharePoint.d.ts b/sharepoint/SharePoint.d.ts index 2981718eb..181c40491 100644 --- a/sharepoint/SharePoint.d.ts +++ b/sharepoint/SharePoint.d.ts @@ -7159,7 +7159,7 @@ declare module SP { /** Y coordinate of the dialog box. */ y?: number; /** The dialog will be maximized when shown. */ - showMaximized?: number; + showMaximized?: boolean; /** url of the page which is shown in the modal dialog. You should use either html or url attribute, but not both. */ url?: string; /** specifies if close button should be shown on the dialog */ @@ -7191,7 +7191,7 @@ declare module SP { /** Y coordinate of the dialog box. */ y: number; /** The dialog will be maximized when shown. */ - showMaximized: number; + showMaximized: boolean; /** url of the page which is shown in the modal dialog. You should use either html or url attribute, but not both. */ url: string; /** specifies if close button should be shown on the dialog */ diff --git a/should/should.d.ts b/should/should.d.ts index a787b622c..ba32f571b 100644 --- a/should/should.d.ts +++ b/should/should.d.ts @@ -49,6 +49,10 @@ interface ShouldAssertion { matchEach(other: (val: any) => any, description?: string): ShouldAssertion; matchEach(regexp: RegExp, description?: string): ShouldAssertion; matchEach(other: any, description?: string): ShouldAssertion; + matchAny(other: {}, description?: string): ShouldAssertion; + matchAny(other: (val: any) => any, description?: string): ShouldAssertion; + matchAny(regexp: RegExp, description?: string): ShouldAssertion; + matchAny(other: any, description?: string): ShouldAssertion; length(n: number, description?: string): ShouldAssertion; property(name: string, description?: string): ShouldAssertion; property(name: string, val: any, description?: string): ShouldAssertion; diff --git a/static-eval/static-eval-tests.ts b/static-eval/static-eval-tests.ts new file mode 100644 index 000000000..fe42c3d4d --- /dev/null +++ b/static-eval/static-eval-tests.ts @@ -0,0 +1,17 @@ +/// +/// + +import evaluate = require('static-eval'); +import esprima = require('esprima'); +var parse = esprima.parse; + + +var src = '[1,2,3+4*10+n,foo(3+5),obj[""+"x"].y]'; + +var ast = ((parse(src).body[0])).expression; + +console.log(evaluate(ast, { + n: 6, + foo: function (x: number) { return x * 100 }, + obj: { x: { y: 555 } } +})); \ No newline at end of file diff --git a/static-eval/static-eval.d.ts b/static-eval/static-eval.d.ts new file mode 100644 index 000000000..e44294c27 --- /dev/null +++ b/static-eval/static-eval.d.ts @@ -0,0 +1,16 @@ +// Type definitions for static-eval v0.2.4 +// Project: https://github.com/substack/static-eval +// Definitions by: Ben Liddicott +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module 'static-eval' { + /** + * Evaluates the given ESTree.Expression, with the given named variables in place. + * @param ast [ESTree.Expression] An esprima expression derived from parse.body[].expression + * @param vars Named variables, objects or functions which may be referenced in the expression. + */ + function evaluate(ast : ESTree.Expression, vars: { [name: string]: any }): any; + export =evaluate; +} diff --git a/stripe-checkout/stripe-checkout.d.ts b/stripe-checkout/stripe-checkout.d.ts index f648a1bb3..8be22cab1 100644 --- a/stripe-checkout/stripe-checkout.d.ts +++ b/stripe-checkout/stripe-checkout.d.ts @@ -15,12 +15,13 @@ interface StripeCheckoutHandler { } interface StripeCheckoutOptions { - key: string; - token: (token: StripeTokenResponse) => void; + key?: string; + token?: (token: StripeTokenResponse) => void; image?: string; name?: string; description?: string; amount?: number; + locale?: string; currency?: string; panelLabel?: string; zipCode?: boolean; @@ -32,4 +33,4 @@ interface StripeCheckoutOptions { closed?: () => void; } -declare var StripeCheckout: StripeCheckoutStatic; \ No newline at end of file +declare var StripeCheckout: StripeCheckoutStatic; diff --git a/swaggerize-express/swaggerize-express-tests.ts b/swaggerize-express/swaggerize-express-tests.ts new file mode 100644 index 000000000..03a0807ef --- /dev/null +++ b/swaggerize-express/swaggerize-express-tests.ts @@ -0,0 +1,25 @@ +/// +import http = require('http'); +import express = require('express'); +import swaggerize = require('swaggerize-express'); + +var app = express(); +app.use(swaggerize({ + api: { + swagger: "2.0", + host: "localhost:8080", + info: { + title: "swaggerize-express.d.ts test", + version: "1" + }, + paths: { + + } + }, + docspath: '/api-docs', + handlers: './handlers' +})); + +var server = app.listen(18888, 'localhost', function () { + (app).swagger.api.host = server.address().address + ':' + server.address().port; +}); diff --git a/swaggerize-express/swaggerize-express.d.ts b/swaggerize-express/swaggerize-express.d.ts new file mode 100644 index 000000000..0f62b1088 --- /dev/null +++ b/swaggerize-express/swaggerize-express.d.ts @@ -0,0 +1,289 @@ +// Type definitions for swaggerize-express 4.x +// Project: https://github.com/krakenjs/swaggerize-express +// Definitions by: TANAKA Koichi +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/* =================== USAGE =================== + + import express = require('express'); + import swaggerize = require('swaggerize-express'); + var app = express(); + app.use(swaggerize({ + api: require('./api.json'), + docspath: '/api-docs', + handlers: './handlers' + }); + + =============================================== */ + +/// + +declare module "swaggerize-express" { + import express = require('express'); + function swaggerize(options: swaggerize.Options): express.RequestHandler; + + module swaggerize { + export module Swagger { + export interface ApiDefinition { + swagger: string + info: InfoObject + host?: string + basePath?: string + schemes?: string[] + consumes?: MimeTypes + produces?: MimeTypes + paths: PathsObject + definitions?: DefinitionsObject + parameters?: ParametersDefinitionsObject + responses?: ResponsesDefinitionsObject + securityDefinitions?: SecurityDefinitionsObject + security?: SecurityRequirementObject[] + tags?: TagObject[] + externalDocs?: ExternalDocumentationObject + } + + type MimeTypes = string[] + + export interface InfoObject { + title: string + description?: string + termsOfService?: string + contact?: ContactObject + license?: LicenseObject + version: string + } + + export interface ContactObject { + name?: string + url?: string + email?: string + } + + export interface LicenseObject { + name: string + url?: string + } + + export interface PathsObject { + [index: string]: PathItemObject|any + } + + export interface PathItemObject { + $ref?: string + get?: OperationObject + put?: OperationObject + post?: OperationObject + 'delete'?: OperationObject + options?: OperationObject + head?: OperationObject + patch?: OperationObject + parameters?: Parameters + } + + export interface OperationObject { + tags?: string[] + summary?: string + description?: string + externalDocs?: ExternalDocumentationObject + operationId?: string + consumes?: MimeTypes + produces?: MimeTypes + parameters?: Parameters + responses: ResponsesObject + schemes?: string[] + deprecated?: boolean + security?: SecurityRequirementObject[] + } + + export interface DefinitionsObject { + [index: string]: SchemaObject + } + + export interface ResponsesObject { + [index: string]: Response|any + 'default': Response + } + + type Response = ResponseObject|ReferenceObject + + export interface ResponsesDefinitionsObject { + [index: string]: ResponseObject + } + + export interface ResponseObject { + description: string + schema?: SchemaObject + headers?: HeadersObject + examples?: ExampleObject + } + + export interface HeadersObject { + [index: string]: HeaderObject + } + + export interface HeaderObject extends ItemsObject { + } + + export interface ExampleObject { + [index: string]: any + } + + export interface SecurityDefinitionsObject { + [index: string]: SecuritySchemeObject + } + + export interface SecuritySchemeObject { + type: string + description?: string + name: string + 'in': string + flow: string + authorizationUrl: string + tokenUrl: string + scopes: ScopesObject + } + + export interface ScopesObject { + [index: string]: any + } + + export interface SecurityRequirementObject { + [index: string]: string[] + } + + export interface TagObject { + name: string + description?: string + externalDocs?: ExternalDocumentationObject + } + + export interface ItemsObject { + type: string + format?: string + items?: ItemsObject + collectionFormat?: string + 'default'?: any + maximum?: number + exclusiveMaximum: boolean + minimum?: number + exclusiveMinimum?: boolean + maxLength?: number + minLength?: number + pattern?: string + maxItems?: number + minItems?: number + uniqueItems?: boolean + 'enum'?: any[] + multipleOf?: number + } + + export interface ParametersDefinitionsObject { + [index: string]: ParameterObject + } + + type Parameters = (ParameterObject|ReferenceObject)[] + + export interface ParameterObject { + name: string + 'in': string + description?: string + required?: boolean + } + + export interface InBodyParameterObject extends ParameterObject { + schema: SchemaObject + } + + export interface GeneralParameterObject extends ParameterObject, ItemsObject { + allowEmptyValue?: boolean + } + + export interface ReferenceObject { + $ref: string + } + + export interface ExternalDocumentationObject { + [index: string]: any + description?: string + url: string + } + + export interface SchemaObject extends IJsonSchema { + [index: string]: any + discriminator?: string + readOnly?: boolean + xml?: XMLObject + externalDocs: ExternalDocumentationObject + example: any + } + + export interface XMLObject { + [index: string]: any + name?: string + namespace?: string + prefix?: string + attribute?: boolean + wrapped?: boolean + } + } + + export interface Options { + api: Swagger.ApiDefinition + docspath: String + handlers: String + } + + export interface IConfig { + api: Swagger.ApiDefinition + routes: express.IRoute[] + } + + export interface SwaggerizedExpress extends express.Express { + swagger: IConfig + } + } + + interface IJsonSchema { + id?: string + $schema?: string + title?: string + description?: string + multipleOf?: number + maximum?: number + exclusiveMaximum?: boolean + minimum?: number + exclusiveMinimum?: boolean + maxLength?: number + minLength?: number + pattern?: string + additionalItems?: boolean | IJsonSchema + items?: IJsonSchema | IJsonSchema[] + maxItems?: number + minItems?: number + uniqueItems?: boolean + maxProperties?: number + minProperties?: number + required?: string[] + additionalProperties?: boolean | IJsonSchema + definitions?: { + [name: string]: IJsonSchema + } + properties?: { + [name: string]: IJsonSchema + } + patternProperties?: { + [name: string]: IJsonSchema + } + dependencies?: { + [name: string]: IJsonSchema | string[] + } + 'enum'?: any[] + type?: string | string[] + allOf?: IJsonSchema[] + anyOf?: IJsonSchema[] + oneOf?: IJsonSchema[] + not?: IJsonSchema + } + + export = swaggerize; +} diff --git a/tether-shepherd/tether-shepherd-tests.ts b/tether-shepherd/tether-shepherd-tests.ts index 7325a8464..085da575b 100644 --- a/tether-shepherd/tether-shepherd-tests.ts +++ b/tether-shepherd/tether-shepherd-tests.ts @@ -46,6 +46,9 @@ var step2Options: TetherShepherd.IShepherdTourStepOptions = { destroy: () => { console.log('Destroyed the Step 2'); } + }, + showOn: () => { + return true; } }; @@ -55,4 +58,4 @@ var queriedStep = tour.getById('test-step-2'); queriedStep.destroy(); -tour.start(); \ No newline at end of file +tour.start(); diff --git a/tether-shepherd/tether-shepherd.d.ts b/tether-shepherd/tether-shepherd.d.ts index eeee87104..413d569ed 100644 --- a/tether-shepherd/tether-shepherd.d.ts +++ b/tether-shepherd/tether-shepherd.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Tether-Shepherd v1.1.2 +// Type definitions for Tether-Shepherd v1.2.0 // Project: http://github.hubspot.com/shepherd/ // Definitions by: Matt Gibbs // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -149,6 +149,7 @@ declare module TetherShepherd { showCancelLink?: boolean; scrollTo?: boolean; when?: any; + showOn?: () => boolean; // TODO: Tie this in with the tether.d.ts tetherOptions?: any; diff --git a/ui-grid/ui-grid.d.ts b/ui-grid/ui-grid.d.ts index 2b6397122..7124e0983 100644 --- a/ui-grid/ui-grid.d.ts +++ b/ui-grid/ui-grid.d.ts @@ -232,7 +232,7 @@ declare module uiGrid { getOnlyDataColumns(): Array>; /** * returns the GridRow that contains the rowEntity - * @param {any} rowEntity the gridOptionms.data array element instance + * @param {TEntity} rowEntity the gridOptionms.data array element instance * @param {Array} rows The rows to look in. if not provided then it looks in grid.rows */ getRow(rowEntity: TEntity, rows?: Array>): IGridRowOf; @@ -442,7 +442,7 @@ declare module uiGrid { /** * Scroll the grid such that the specified * row and column is in view - * @param {any} rowEntity gridOptions.data[] array element to make visible + * @param {TEntity} rowEntity gridOptions.data[] array element to make visible * @param {IColumnDef} colDef to make visible * @returns {ng.IPromise} a promise that is resolved after any scrolling is finished */ @@ -811,10 +811,10 @@ declare module uiGrid { /** * By default, rows are compared using object equality. This option can be overridden * to compare on any data item property or function - * @param {IGridRow} entityA First Data Item to compare - * @param {IGridRow} entityB Second Data Item to compare + * @param {TEntity} entityA First Data Item to compare + * @param {TEntity} entityB Second Data Item to compare */ - rowEquality?(entityA: IGridRowOf, entityB: IGridRowOf): boolean; + rowEquality?(entityA: TEntity, entityB: TEntity): boolean; /** * This function is used to get and, if necessary, set the value uniquely identifying this row * (i.e. if an identity is not present it will set one). @@ -860,7 +860,7 @@ declare module uiGrid { * If the row is currently invisible then sets it to visible and calls * both grid refresh and emits the rowsVisibleChanged event * TODO: if a filter is active then we can't just set it to visible? - * @param {any} rowEntity gridOptions.data[] array instance + * @param {TEntity} rowEntity gridOptions.data[] array instance */ clearRowInvisible(rowEntity: TEntity): void; /** @@ -929,7 +929,7 @@ declare module uiGrid { /** * Scroll the grid such that the specified * row and column is in view - * @param {any} entity gridOptions.data[] array instance to make visible + * @param {TEntity} entity gridOptions.data[] array instance to make visible * @param {IColumnDef} colDef to make visible * @returns {ng.IPromise} a promise that is resolved after any scrolling is finished */ @@ -1128,7 +1128,7 @@ declare module uiGrid { rowColSelectIndex(rowCol: IRowCol): number; /** * Brings the specified row and column into view, and sets focus to that cell - * @param {any} rowEntity gridOptions.data[] array instance to make visible and set focus + * @param {TEntity} rowEntity gridOptions.data[] array instance to make visible and set focus * @param {IColumnDef} colDef Column definition to make visible and set focus */ scrollToFocus(rowEntity: TEntity, colDef: IColumnDef): ng.IPromise; @@ -1387,7 +1387,7 @@ declare module uiGrid { export interface afterCellEditHandler { /** * raised when cell editing is complete - * @param {any} rowEntity the options.data element that was edited + * @param {TEntity} rowEntity the options.data element that was edited * @param {IColumnDef} colDef The column that was edited * @param {any} newValue New Value * @param {any} oldValue Old Value @@ -1397,7 +1397,7 @@ declare module uiGrid { /** * raised when cell editing starts on a cell - * @param {any} rowEntity the options.data element that was edited + * @param {TEntity} rowEntity the options.data element that was edited * @param {IColumnDef} colDef The column that was edited * @param {JQueryEventObject} triggerEvent the event that triggered the edit. Useful to prevent losing * keystrokes on some complex editors @@ -1408,7 +1408,7 @@ declare module uiGrid { /** * raised when cell editing is cancelled on a cell - * @param {any} rowEntity the options.data element that was edited + * @param {TEntity} rowEntity the options.data element that was edited * @param {IColumnDef} colDef The column that was edited */ export interface cancelCellEditHandler { @@ -1480,7 +1480,7 @@ declare module uiGrid { toggleAllRows(): void; /** * Toggle a specific row - * @param {any} rowEntity The data entity for the row you want to expand + * @param {TEntity} rowEntity The data entity for the row you want to expand */ toggleRowExpansion(rowEntity: TEntity): void; @@ -2008,8 +2008,8 @@ declare module uiGrid { * This callback can be used to change the decoded value back into a code. * Defaults to angular.identity. * @param {IGridInstance} grid The grid - * @param {any} newObject The new object as importer has created it. Modify it and return modified version - * @returns {any} The modified object + * @param {TEntity} newObject The new object as importer has created it. Modify it and return modified version + * @returns {TEntity} The modified object * @default angular.identity */ importerObjectCallback?: (grid: IGridInstanceOf, newObject: TEntity) => TEntity; @@ -2528,9 +2528,9 @@ declare module uiGrid { export interface saveRowHandler { /** * Callback method for save row - * @param {any} rowEntity The options.data element that was edited + * @param {TEntity} rowEntity The options.data element that was edited */ - (rowEntity: Array): void; + (rowEntity: TEntity): void; } } diff --git a/urijs/URIjs-tests.ts b/urijs/URIjs-tests.ts index 2dfd15618..3501a6efc 100644 --- a/urijs/URIjs-tests.ts +++ b/urijs/URIjs-tests.ts @@ -34,3 +34,7 @@ URI('').setSearch('foo', 'bar'); URI('').setSearch({ foo: 'bar' }); var uri: uri.URI = $('a').uri(); + +URI('http://example.org/foo/hello.html').segment('bar'); +URI('http://example.org/foo/hello.html').segment(0, 'bar'); +URI('http://example.org/foo/hello.html').segment(['foo', 'bar', 'foobar.html']); \ No newline at end of file diff --git a/urijs/URIjs.d.ts b/urijs/URIjs.d.ts index 7bab32074..a41e06cbf 100644 --- a/urijs/URIjs.d.ts +++ b/urijs/URIjs.d.ts @@ -95,10 +95,10 @@ declare module uri { search(qry: boolean): any; search(qry: Object): URI; segment(): string[]; - segment(segments: string[]): string; + segment(segments: string[]): URI; segment(position: number): string; - segment(position: number, level: string): string; - segment(level: string): string; + segment(position: number, level: string): URI; + segment(segment: string): URI; setQuery(key: string, value: string): URI; setQuery(qry: Object): URI; setSearch(key: string, value: string): URI; diff --git a/videojs/videojs.d.ts b/videojs/videojs.d.ts index f6897627a..e29f3b43d 100644 --- a/videojs/videojs.d.ts +++ b/videojs/videojs.d.ts @@ -12,6 +12,10 @@ interface VideoJSOptions { height?: number; defaultVolume?: number; children?: Object; + controls?: boolean; + src?: string; + autoplay?: boolean; + preload?: string; } interface VideoJSSource { diff --git a/webgl-ext/webgl-ext-tests.ts b/webgl-ext/webgl-ext-tests.ts new file mode 100644 index 000000000..9ddcd22f9 --- /dev/null +++ b/webgl-ext/webgl-ext-tests.ts @@ -0,0 +1,102 @@ +/// + +var canvas = document.createElement("canvas"); +var gl = canvas.getContext("webgl"); +var ext: any; +var t: any; + +if (ext = gl.getExtension("ANGLE_instanced_arrays")) { + t = ext.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE; +} + +if (ext = gl.getExtension("EXT_blend_minmax")) { + t = ext.MIN_EXT; +} + +if (ext = gl.getExtension("EXT_color_buffer_half_float")) { + t = ext.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT; +} + +if (ext = gl.getExtension("EXT_frag_depth")) { + // no fields +} + +if (ext = gl.getExtension("EXT_sRGB")) { + t = ext.SRGB8_ALPHA8_EXT; +} + +if (ext = gl.getExtension("EXT_shader_texture_lod")) { + // no fields +} + +if (ext = gl.getExtension("EXT_texture_filter_anisotropic")) { + t = ext.MAX_TEXTURE_MAX_ANISOTROPY_EXT; +} + +if (ext = gl.getExtension("OES_element_index_uint")) { + // no fields +} + +if (ext = gl.getExtension("OES_standard_derivatives")) { + t = ext.FRAGMENT_SHADER_DERIVATIVE_HINT_OES; +} + +if (ext = gl.getExtension("OES_texture_float")) { + // no fields +} + +if (ext = gl.getExtension("OES_texture_float_linear")) { + // no fields +} + +if (ext = gl.getExtension("OES_texture_half_float")) { + t = ext.HALF_FLOAT_OES; +} + +if (ext = gl.getExtension("OES_texture_half_float_linear")) { + // no fields +} + +if (ext = gl.getExtension("OES_vertex_array_object")) { + t = ext.createVertexArrayOES; // just get fn ref, don't call +} + +if (ext = gl.getExtension("WEBGL_color_buffer_float")) { + t = ext.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT; +} + +if (ext = gl.getExtension("WEBGL_compressed_texture_atc")) { + t = ext.COMPRESSED_RGB_ATC_WEBGL; +} + +if (ext = gl.getExtension("WEBGL_compressed_texture_etc1")) { + t = ext.COMPRESSED_RGB_ETC1_WEBGL; +} + +if (ext = gl.getExtension("WEBGL_compressed_texture_pvrtc")) { + t = ext.COMPRESSED_RGB_PVRTC_4BPPV1_IMG; +} + +if (ext = gl.getExtension("WEBGL_compressed_texture_s3tc")) { + t = ext.COMPRESSED_RGBA_S3TC_DXT5_EXT; +} + +if (ext = gl.getExtension("WEBGL_debug_renderer_info")) { + t = ext.UNMASKED_VENDOR_WEBGL; +} + +if (ext = gl.getExtension("WEBGL_debug_shaders")) { + t = ext.getTranslatedShaderSource; // just get fn ref, don't call +} + +if (ext = gl.getExtension("WEBGL_depth_texture")) { + t = ext.UNSIGNED_INT_24_8_WEBGL; +} + +if (ext = gl.getExtension("WEBGL_draw_buffers")) { + t = ext.MAX_COLOR_ATTACHMENTS_WEBGL; +} + +if (ext = gl.getExtension("WEBGL_lose_context")) { + t = ext.loseContext; // just get fn ref, don't call +} diff --git a/webgl-ext/webgl-ext.d.ts b/webgl-ext/webgl-ext.d.ts new file mode 100644 index 000000000..c6a8cb34a --- /dev/null +++ b/webgl-ext/webgl-ext.d.ts @@ -0,0 +1,214 @@ +// Type definitions for WebGL Extensions +// Project: http://webgl.org/ +// Definitions by: Arthur Langereis +// Definitions: https://github.com/borisyankov/DefinitelyTyped/webgl-ext + +// These definitions go beyond those already defined in TS 1.6.2 stdlib +// All non-draft WebGL 1.0 extensions and prefixed extension names are +// covered. + +interface HTMLCanvasElement { + getContext(contextId: "webgl"): WebGLRenderingContext; +} + +interface WebGLRenderingContext { + getExtension(name: "ANGLE_instanced_arrays"): ANGLEInstancedArrays; + + getExtension(name: "EXT_blend_minmax"): EXTBlendMinMax; + getExtension(name: "EXT_color_buffer_half_float"): EXTColorBufferHalfFloat; + getExtension(name: "EXT_frag_depth"): EXTFragDepth; + getExtension(name: "EXT_sRGB"): EXTsRGB; + getExtension(name: "EXT_shader_texture_lod"): EXTShaderTextureLOD; + getExtension(name: "EXT_texture_filter_anisotropic"): EXTTextureFilterAnisotropic; + + getExtension(name: "OES_element_index_uint"): OESElementIndexUint; + getExtension(name: "OES_standard_derivatives"): OESStandardDerivatives; + getExtension(name: "OES_texture_float"): OESTextureFloat; + getExtension(name: "OES_texture_float_linear"): OESTextureFloatLinear; + getExtension(name: "OES_texture_half_float"): OESTextureHalfFloat; + getExtension(name: "OES_texture_half_float_linear"): OESTextureHalfFloatLinear; + getExtension(name: "OES_vertex_array_object"): OESVertexArrayObject; + + getExtension(name: "WEBGL_color_buffer_float"): WebGLColorBufferFloat; + getExtension(name: "WEBGL_compressed_texture_atc"): WebGLCompressedTextureATC; + getExtension(name: "WEBGL_compressed_texture_etc1"): WebGLCompressedTextureETC1; + getExtension(name: "WEBGL_compressed_texture_pvrtc"): WebGLCompressedTexturePVRTC; + getExtension(name: "WEBGL_compressed_texture_s3tc"): WebGLCompressedTextureS3TC; + getExtension(name: "WEBGL_debug_renderer_info"): WebGLDebugRendererInfo; + getExtension(name: "WEBGL_debug_shaders"): WebGLDebugShaders; + getExtension(name: "WEBGL_depth_texture"): WebGLDepthTexture; + getExtension(name: "WEBGL_draw_buffers"): WebGLDrawBuffers; + getExtension(name: "WEBGL_lose_context"): WebGLLoseContext; + + // Prefixed versions appearing in the wild as per September 2015 + + getExtension(name: "WEBKIT_EXT_texture_filter_anisotropic"): EXTTextureFilterAnisotropic; + getExtension(name: "WEBKIT_WEBGL_compressed_texture_atc"): WebGLCompressedTextureATC; + getExtension(name: "WEBKIT_WEBGL_compressed_texture_pvrtc"): WebGLCompressedTexturePVRTC; + getExtension(name: "WEBKIT_WEBGL_compressed_texture_s3tc"): WebGLCompressedTextureS3TC; + getExtension(name: "WEBKIT_WEBGL_depth_texture"): WebGLDepthTexture; + getExtension(name: "WEBKIT_WEBGL_lose_context"): WebGLLoseContext; + + getExtension(name: "MOZ_WEBGL_compressed_texture_s3tc"): WebGLCompressedTextureS3TC; + getExtension(name: "MOZ_WEBGL_depth_texture"): WebGLDepthTexture; + getExtension(name: "MOZ_WEBGL_lose_context"): WebGLLoseContext; +} + +interface ANGLEInstancedArrays { + VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number; + + drawArraysInstancedANGLE(mode: number, first: number, count: number, primcount: number): void; + drawElementsInstancedANGLE(mode: number, count: number, type: number, offset: number, primcount: number): void; + vertexAttribDivisorANGLE(index: number, divisor: number): void; +} + +interface EXTBlendMinMax { + MIN_EXT: number; + MAX_EXT: number; +} + +interface EXTColorBufferHalfFloat { + RGBA16F_EXT: number; + RGB16F_EXT: number; + FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: number; + UNSIGNED_NORMALIZED_EXT: number; +} + +interface EXTFragDepth { +} + +interface EXTsRGB { + SRGB_EXT: number; + SRGB_ALPHA_EXT: number; + SRGB8_ALPHA8_EXT: number; + FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT: number; +} + +interface EXTShaderTextureLOD { +} + +interface EXTTextureFilterAnisotropic { + TEXTURE_MAX_ANISOTROPY_EXT: number; + MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; +} + +interface OESElementIndexUint { +} + +interface OESStandardDerivatives { + FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; +} + +interface OESTextureFloat { +} + +interface OESTextureFloatLinear { +} + +interface OESTextureHalfFloat { + HALF_FLOAT_OES: number; +} + +interface OESTextureHalfFloatLinear { +} + +interface WebGLVertexArrayObjectOES extends WebGLObject { +} + +interface OESVertexArrayObject { + VERTEX_ARRAY_BINDING_OES: number; + + createVertexArrayOES(): WebGLVertexArrayObjectOES; + deleteVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES): void; + isVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES): boolean; + bindVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES): void; +} + +interface WebGLColorBufferFloat { + RGBA32F_EXT: number; + FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: number; + UNSIGNED_NORMALIZED_EXT: number; +} + +interface WebGLCompressedTextureATC { + COMPRESSED_RGB_ATC_WEBGL: number; + COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL: number; + COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL: number; +} + +interface WebGLCompressedTextureETC1 { + COMPRESSED_RGB_ETC1_WEBGL: number; +} + +interface WebGLCompressedTexturePVRTC { + COMPRESSED_RGB_PVRTC_4BPPV1_IMG: number; + COMPRESSED_RGB_PVRTC_2BPPV1_IMG: number; + COMPRESSED_RGBA_PVRTC_4BPPV1_IMG: number; + COMPRESSED_RGBA_PVRTC_2BPPV1_IMG: number; +} + +interface WebGLCompressedTextureS3TC { + COMPRESSED_RGB_S3TC_DXT1_EXT: number; + COMPRESSED_RGBA_S3TC_DXT1_EXT: number; + COMPRESSED_RGBA_S3TC_DXT3_EXT: number; + COMPRESSED_RGBA_S3TC_DXT5_EXT: number; +} + +interface WebGLDebugRendererInfo { + UNMASKED_VENDOR_WEBGL: number; + UNMASKED_RENDERER_WEBGL: number; +} + +interface WebGLDebugShaders { + getTranslatedShaderSource(shader: WebGLShader): string; +} + +interface WebGLDepthTexture { + UNSIGNED_INT_24_8_WEBGL: number; +} + +interface WebGLDrawBuffers { + COLOR_ATTACHMENT0_WEBGL: number; + COLOR_ATTACHMENT1_WEBGL: number; + COLOR_ATTACHMENT2_WEBGL: number; + COLOR_ATTACHMENT3_WEBGL: number; + COLOR_ATTACHMENT4_WEBGL: number; + COLOR_ATTACHMENT5_WEBGL: number; + COLOR_ATTACHMENT6_WEBGL: number; + COLOR_ATTACHMENT7_WEBGL: number; + COLOR_ATTACHMENT8_WEBGL: number; + COLOR_ATTACHMENT9_WEBGL: number; + COLOR_ATTACHMENT10_WEBGL: number; + COLOR_ATTACHMENT11_WEBGL: number; + COLOR_ATTACHMENT12_WEBGL: number; + COLOR_ATTACHMENT13_WEBGL: number; + COLOR_ATTACHMENT14_WEBGL: number; + COLOR_ATTACHMENT15_WEBGL: number; + + DRAW_BUFFER0_WEBGL: number; + DRAW_BUFFER1_WEBGL: number; + DRAW_BUFFER2_WEBGL: number; + DRAW_BUFFER3_WEBGL: number; + DRAW_BUFFER4_WEBGL: number; + DRAW_BUFFER5_WEBGL: number; + DRAW_BUFFER6_WEBGL: number; + DRAW_BUFFER7_WEBGL: number; + DRAW_BUFFER8_WEBGL: number; + DRAW_BUFFER9_WEBGL: number; + DRAW_BUFFER10_WEBGL: number; + DRAW_BUFFER11_WEBGL: number; + DRAW_BUFFER12_WEBGL: number; + DRAW_BUFFER13_WEBGL: number; + DRAW_BUFFER14_WEBGL: number; + DRAW_BUFFER15_WEBGL: number; + + MAX_COLOR_ATTACHMENTS_WEBGL: number; + MAX_DRAW_BUFFERS_WEBGL: number; + + drawBuffersWEBGL(buffers: number[]): void; +} + +interface WebGLLoseContext { + loseContext(): void; + restoreContext(): void; +} diff --git a/webpack/webpack-tests.ts b/webpack/webpack-tests.ts new file mode 100644 index 000000000..27a4a5385 --- /dev/null +++ b/webpack/webpack-tests.ts @@ -0,0 +1,388 @@ +/// + +import * as webpack from 'webpack'; + +var configuration: webpack.Configuration; +var loader: webpack.Loader; +var plugin: webpack.Plugin; +declare var __dirname: string; + +// +// https://webpack.github.io/docs/using-loaders.html +// + +configuration = { + module: { + loaders: [ + { test: /\.jade$/, loader: "jade" }, + // => "jade" loader is used for ".jade" files + + { test: /\.css$/, loader: "style!css" }, + // => "style" and "css" loader is used for ".css" files + // Alternative syntax: + { test: /\.css$/, loaders: ["style", "css"] }, + ] + } +}; + +loader = { test: /\.png$/, loader: "url-loader?mimetype=image/png" }; + +loader = { + test: /\.png$/, + loader: "url-loader", + query: { mimetype: "image/png" } +}; + +// +// https://webpack.github.io/docs/using-plugins.html +// + +configuration = { + plugins: [ + new webpack.ResolverPlugin([ + new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin("bower.json", ["main"]) + ], ["normal", "loader"]) + ] +}; + +// +// http://webpack.github.io/docs/tutorials/getting-started/ +// + +configuration = { + entry: "./entry.js", + output: { + path: __dirname, + filename: "bundle.js" + }, + module: { + loaders: [ + { test: /\.css$/, loader: "style!css" } + ] + } +}; + +// +// https://webpack.github.io/docs/code-splitting.html +// + +configuration = { + entry: { + app: "./app.js", + vendor: ["jquery", "underscore"], + }, + output: { + filename: "bundle.js" + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin(/* chunkName= */"vendor", /* filename= */"vendor.bundle.js") + ] +}; + +configuration = { + entry: { a: "./a", b: "./b" }, + output: { filename: "[name].js" }, + plugins: [ new webpack.optimize.CommonsChunkPlugin("init.js") ] +}; + +// +// https://webpack.github.io/docs/stylesheets.html +// + +configuration = { + // ... + module: { + loaders: [ + { test: /\.css$/, loader: "style-loader!css-loader" } + ] + } +}; + +class ExtractTextPlugin implements webpack.Plugin { + static extract(...loaders: string[]): string { return null; } + constructor(...args: any[]) {} +} + +configuration = { + // The standard entry point and output config + entry: { + posts: "./posts", + post: "./post", + about: "./about" + }, + output: { + filename: "[name].js", + chunkFilename: "[id].js" + }, + module: { + loaders: [ + // Extract css files + { + test: /\.css$/, + loader: ExtractTextPlugin.extract("style-loader", "css-loader") + }, + // Optionally extract less files + // or any other compile-to-css language + { + test: /\.less$/, + loader: ExtractTextPlugin.extract("style-loader", "css-loader!less-loader") + } + // You could also use other loaders the same way. I. e. the autoprefixer-loader + ] + }, + // Use the plugin to specify the resulting filename (and add needed behavior to the compiler) + plugins: [ + new ExtractTextPlugin("[name].css") + ] +}; + +configuration = { + // ... + plugins: [ + new ExtractTextPlugin("style.css", { + allChunks: true + }) + ] +}; + +configuration = { + // ... + plugins: [ + new webpack.optimize.CommonsChunkPlugin("commons", "commons.js"), + new ExtractTextPlugin("[name].css") + ] +}; + +// +// https://webpack.github.io/docs/optimization.html +// + +configuration = { + entry: { + p1: "./page1", + p2: "./page2", + p3: "./page3" + }, + output: { + filename: "[name].entry.chunk.js" + } +}; + +let CommonsChunkPlugin = webpack.optimize.CommonsChunkPlugin; +configuration = { + entry: { + p1: "./page1", + p2: "./page2", + p3: "./page3" + }, + output: { + filename: "[name].entry.chunk.js" + }, + plugins: [ + new CommonsChunkPlugin("commons.chunk.js") + ] +}; + +configuration = { + entry: { + p1: "./page1", + p2: "./page2", + p3: "./page3", + ap1: "./admin/page1", + ap2: "./admin/page2" + }, + output: { + filename: "[name].js" + }, + plugins: [ + new CommonsChunkPlugin("admin-commons.js", ["ap1", "ap2"]), + new CommonsChunkPlugin("commons.js", ["p1", "p2", "admin-commons.js"]) + ] +}; +//