Merge branch 'master' into handleExtraObjectLiteralProperties2

This commit is contained in:
Daniel Rosenwasser 2015-08-17 12:33:22 -07:00
commit 3f3e719d60
241 changed files with 45691 additions and 6536 deletions

View File

@ -13,9 +13,11 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](amcharts/AmCharts.d.ts) [amCharts](http://www.amcharts.com) by [aleksey-bykov](https://github.com/aleksey-bykov)
* [:link:](amplifyjs/amplifyjs.d.ts) [AmplifyJs](http://amplifyjs.com) by [Jonas Eriksson](https://github.com/joeriks)
* [:link:](amqp-rpc/amqp-rpc.d.ts) [amqp-rpc](https://github.com/demchenkoe/node-amqp-rpc) by [Wonshik Kim](https://github.com/wokim)
* [:link:](angular2/router.d.ts) [Angular](http://angular.io) by [angular team](https://github.com/angular)
* [:link:](amqplib/amqplib.d.ts) [amqplib 0.3.x](https://github.com/squaremo/amqp.node) by [Michael Nahkies](https://github.com/mnahkies)
* [:link:](angular2/angular2.d.ts) [Angular](http://angular.io) by [angular team](https://github.com/angular)
* [:link:](angular2/router.d.ts) [Angular](http://angular.io) by [angular team](https://github.com/angular)
* [:link:](angular-file-upload/angular-file-upload.d.ts) [Angular File Upload](https://github.com/danialfarid/ng-file-upload) by [John Reilly](https://github.com/johnnyreilly)
* [:link:](ng-file-upload/ng-file-upload.d.ts) [Angular File Upload](https://github.com/danialfarid/ng-file-upload) by [John Reilly](https://github.com/johnnyreilly)
* [:link:](angular-growl-v2/angular-growl-v2.d.ts) [Angular Growl 2 v.0.7.3](http://janstevens.github.io/angular-growl-2) by [Tadeusz Hucal](https://github.com/mkp05)
* [:link:](angularjs/angular.d.ts) [Angular JS](http://angularjs.org) by [Diego Vilar](http://github.com/diegovilar)
* [:link:](angularjs/angular-animate.d.ts) [Angular JS (ngAnimate module)](http://angularjs.org) by [Michel Salib](https://github.com/michelsalib), [Adi Dahiya](https://github.com/adidahiya), [Raphael Schweizer](https://github.com/rasch), [Cody Schaaf](https://github.com/codyschaaf)
@ -29,6 +31,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](angular-material/angular-material.d.ts) [Angular Material (angular.material module)](https://github.com/angular/material) by [Matt Traynham](https://github.com/mtraynham)
* [:link:](angular-protractor/angular-protractor.d.ts) [Angular Protractor](https://github.com/angular/protractor) by [Bill Armstrong](https://github.com/BillArmstrong)
* [:link:](angular-scenario/angular-scenario.d.ts) [Angular Scenario Testing (ngScenario module)](http://angularjs.org) by [RomanoLindano](https://github.com/RomanoLindano)
* [:link:](angular-toasty/angular-toasty.d.ts) [Angular Toasty](https://github.com/invertase/angular-toasty) by [Dominik Muench](https://github.com/muenchdo)
* [:link:](angular-translate/angular-translate.d.ts) [Angular Translate (pascalprecht.translate module)](https://github.com/PascalPrecht/angular-translate) by [Michel Salib](https://github.com/michelsalib)
* [:link:](angular-ui-bootstrap/angular-ui-bootstrap.d.ts) [Angular UI Bootstrap](https://github.com/angular-ui/bootstrap) by [Brian Surowiec](https://github.com/xt0rted)
* [:link:](angular-wizard/angular-wizard.d.ts) [Angular Wizard](https://github.com/mgonto/angular-wizard) by [Marko Jurisic](https://github.com/mjurisic)
@ -43,6 +46,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](angular-notifications/angular-notifications.d.ts) [angular-notifications](https://github.com/DerekRies/angular-notifications) by [Tomasz Ducin](https://github.com/ducin/DefinitelyTyped)
* [:link:](angular-notify/angular-notify.d.ts) [angular-notify](https://github.com/cgross/angular-notify) by [Suwato](https://github.com/Suwato/DefinitelyTyped)
* [:link:](angular-scroll/angular-scroll.d.ts) [angular-scroll](https://github.com/oblador/angular-scroll) by [Sam Herrmann](https://github.com/samherrmann)
* [:link:](angular-signalr-hub/angular-signalr-hub.d.ts) [angular-signalr-hub](https://github.com/JustMaier/angular-signalr-hub) by [Adam Santaniello](https://github.com/AdamSantaniello)
* [:link:](angular-spinner/angular-spinner.d.ts) [angular-spinner.js](https://github.com/urish/angular-spinner) by [Marcin Biegała](https://github.com/Biegal)
* [:link:](angular-storage/angular-storage.d.ts) [angular-storage](https://github.com/auth0/angular-storage) by [Matthew DeKrey](https://github.com/mdekrey)
* [:link:](angular.throttle/angular.throttle.d.ts) [angular.throttle](https://github.com/BaggersIO/angular.throttle) by [Stefan Steinhart](https://github.com/reppners)
@ -115,8 +119,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](bootstrap-slider/bootstrap-slider.d.ts) [bootstrap-slider.js](https://github.com/seiyria/bootstrap-slider) by [Daniel Beckwith](https://github.com/dbeckwith)
* [:link:](bootstrap.datepicker/bootstrap.datepicker.d.ts) [bootstrap.datepicker](https://github.com/eternicode/bootstrap-datepicker) by [Boris Yankov](https://github.com/borisyankov)
* [:link:](bootstrap.paginator/bootstrap.paginator.d.ts) [bootstrap.paginator](https://github.com/lyonlai/bootstrap-paginator) by [derikwhittaker](https://github.com/derikwhittaker)
* [:link:](bootstrap.timepicker/bootstrap.timepicker.d.ts) [bootstrap.timepicker](https://github.com/jdewit/bootstrap-timepicker) by [derikwhittaker](https://github.com/derikwhittaker)
* [:link:](box2d/box2dweb.d.ts) [bootstrap.timepicker](http://code.google.com/p/box2dweb) by [jbaldwin](https://github.com/jbaldwin)
* [:link:](bootstrap.timepicker/bootstrap.timepicker.d.ts) [bootstrap.timepicker](https://github.com/jdewit/bootstrap-timepicker) by [derikwhittaker](https://github.com/derikwhittaker)
* [:link:](breeze/breeze.d.ts) [Breeze 1.5.x](http://www.breezejs.com) by [Boris Yankov](https://github.com/borisyankov), [IdeaBlade](https://github.com/IdeaBlade/Breeze)
* [:link:](browser-harness/browser-harness.d.ts) [Browser Harness](https://github.com/scriby/browser-harness) by [Chris Scribner](https://github.com/scriby)
* [:link:](browser-sync/browser-sync.d.ts) [browser-sync](http://www.browsersync.io) by [Asana](https://asana.com)
@ -183,6 +187,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](cordova-ionic/plugins/keyboard.d.ts) [Cordova Keyboard plugin](https://github.com/driftyco/ionic-plugins-keyboard) by [Hendrik Maus](https://github.com/hendrikmaus)
* [:link:](cordovarduino/cordovarduino.d.ts) [Cordovarduino plugin](https://github.com/stereolux/cordovarduino) by [Hendrik Maus](https://github.com/hendrikmaus)
* [:link:](core-js/core-js.d.ts) [core-js](https://github.com/zloirock/core-js) by [Ron Buckton](http://github.com/rbuckton)
* [:link:](cors/cors.d.ts) [cors](https://github.com/troygoode/node-cors) by [Mihhail Lapushkin](https://github.com/mihhail-lapushkin)
* [:link:](couchbase/couchbase.d.ts) [Couchbase Couchnode](https://github.com/couchbase/couchnode) by [Basarat Ali Syed](https://github.com/basarat)
* [:link:](createjs/createjs.d.ts) [CreateJS](http://www.createjs.com) by [Pedro Ferreira](https://bitbucket.org/drk4), [Chris Smith](https://github.com/evilangelist), [Satoru Kimura](https://github.com/gyohk)
* [:link:](cron/cron.d.ts) [cron](https://www.npmjs.com/package/cron) by [Hiroki Horiuchi](https://github.com/horiuchi)
@ -202,6 +207,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](dagre/dagre.d.ts) [dagre](https://github.com/cpettitt/dagre) by [Qinfeng Chen](https://github.com/qinfchen)
* [:link:](dagre-d3/dagre-d3.d.ts) [dagre-d3.core.js](https://github.com/cpettitt/dagre-d3) by [Mark Wong Siang Kai](https://github.com/markwongsk)
* [:link:](dat-gui/dat-gui.d.ts) [dat.GUI](https://github.com/dataarts/dat.gui) by [Satoru Kimura](https://github.com/gyohk)
* [:link:](data-driven/data-driven.d.ts) [data-driven.js](https://github.com/fluentsoftware/data-driven) by [Adam Babcock](https://github.com/mrhen)
* [:link:](DataStream.js/DataStream.js.d.ts) [DataStream.js](https://github.com/kig/DataStream.js) by [Tat](https://github.com/tatchx)
* [:link:](date.format.js/date.format.d.ts) [Date Format](http://blog.stevenlevithan.com/archives/date-time-format) by [Rob Stutton](https://github.com/balrob)
* [:link:](datejs/datejs.d.ts) [DateJS](http://www.datejs.com) by [David Khristepher Santos](http://github.com/rupertavery)
@ -219,6 +225,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](dhtmlxscheduler/dhtmlxscheduler.d.ts) [dhtmlxScheduler](http://dhtmlx.com/docs/products/dhtmlxScheduler) by [Maksim Kozhukh](http://github.com/mkozhukh)
* [:link:](di-lite/di-lite.d.ts) [di-lite](https://github.com/NickQiZhu/di.js) by [Timothy Morris](https://github.com/dcrusader)
* [:link:](diff/diff.d.ts) [diff](https://github.com/kpdecker/jsdiff) by [vvakame](https://github.com/vvakame)
* [:link:](diff-match-patch/diff-match-patch.d.ts) [diff-match-patch](https://www.npmjs.com/package/diff-match-patch) by [Asana](https://asana.com)
* [:link:](docCookies/docCookies.d.ts) [docCookies](https://developer.mozilla.org/en-US/docs/Web/API/document.cookie) by [Jon Egerton](https://github.com/jonegerton)
* [:link:](dock-spawn/dock-spawn.d.ts) [Dock Spawn](http://dockspawn.com) by [Drew Noakes](https://drewnoakes.com)
* [:link:](documentdb/documentdb.d.ts) [DocumentDB](https://github.com/Azure/azure-documentdb-node) by [Noel Abrahams](https://github.com/NoelAbrahams), [Brett Gutstein](https://github.com/brettferdosi)
@ -231,9 +238,10 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](dot-case/dot-case.d.ts) [dot-case](https://github.com/blakeembrey/dot-case) by [Sam Saint-Pettersen](https://github.com/stpettersens)
* [:link:](dotdotdot/dotdotdot.d.ts) [dotdotdot](http://dotdotdot.frebsite.nl) by [Milan Jaros](https://github.com/milanjaros)
* [:link:](doublearray/doublearray.d.ts) [doublearray](https://github.com/takuyaa/doublearray) by [MIZUSHIMA Junki](https://github.com/mzsm)
* [:link:](dragula/dragula.d.ts) [dragula](http://bevacqua.github.io/dragula) by [Paul Welter](https://github.com/pwelter34)
* [:link:](drop/drop.d.ts) [Drop](http://github.hubspot.com/drop) by [Adi Dahiya](https://github.com/adidahiya)
* [:link:](dropboxjs/dropboxjs.d.ts) [dropbox-js](https://github.com/dropbox/dropbox-js) by [Steve Fenton](https://github.com/Steve-Fenton), [Pedro Casaubon](https://github.com/xperiments)
* [:link:](dropzone/dropzone.d.ts) [Dropzone](http://www.dropzonejs.com) by [Natan Vivo](https://github.com/nvivo)
* [:link:](dropzone/dropzone.d.ts) [Dropzone](http://www.dropzonejs.com) by [Natan Vivo](https://github.com/nvivo), [Andy Hawkins](https://github.com/a904guy/,http://a904guy.com/,http://www.bmbsqd.com)
* [:link:](dsv/dsv.d.ts) [dsv](https://www.npmjs.com/package/dsv) by [Jason Swearingen](https://jasonswearingen.github.io)
* [:link:](dts-bundle/dts-bundle.d.ts) [dts-bundle](https://github.com/TypeStrong/dts-bundle) by [Asana](https://asana.com)
* [:link:](durandal/durandal.d.ts) [Durandal](http://durandaljs.com) by [Blue Spire](https://github.com/BlueSpire)
@ -243,8 +251,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](easy-jsend/easy-jsend.d.ts) [easy-jsend](https://github.com/DeadAlready/easy-jsend) by [Karl Düüna](https://github.com/DeadAlready)
* [:link:](easy-session/easy-session.d.ts) [easy-session](https://github.com/DeadAlready/node-easy-session) by [Karl Düüna](https://github.com/DeadAlready)
* [:link:](easy-table/easy-table.d.ts) [easy-table](https://github.com/eldargab/easy-table) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](easy-x-headers/easy-x-headers.d.ts) [easy-x-headers](https://github.com/DeadAlready/easy-x-headers) by [Karl Düüna](https://github.com/DeadAlready)
* [:link:](easy-xapi-supertest/easy-xapi-supertest.d.ts) [easy-x-headers](https://github.com/DeadAlready/easy-x-headers) by [Karl Düüna](https://github.com/DeadAlready)
* [:link:](easy-x-headers/easy-x-headers.d.ts) [easy-x-headers](https://github.com/DeadAlready/easy-x-headers) by [Karl Düüna](https://github.com/DeadAlready)
* [:link:](easy-xapi/easy-xapi.d.ts) [easy-xapi](https://github.com/DeadAlready/easy-xapi) by [Karl Düüna](https://github.com/DeadAlready)
* [:link:](easystarjs/easystarjs.d.ts) [EasyStar.js](http://easystarjs.com) by [Magnus Gustafsson](https://github.com/borundin)
* [:link:](egg.js/egg.js.d.ts) [Egg.js](https://github.com/mikeflynn/egg.js) by [Markus Peloso](https://github.com/ToastHawaii)
@ -274,7 +282,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](eventemitter3/eventemitter3.d.ts) [EventEmitter3](https://github.com/primus/eventemitter3) by [Yuichi Murata](https://github.com/mrk21)
* [:link:](evernote/evernote.d.ts) [evernote v](https://www.npmjs.com/package/evernote) by [Zachary Collins](https://github.com/corps)
* [:link:](exit/exit.d.ts) [exit](https://github.com/cowboy/node-exit) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](expect.js/expect.js.d.ts) [expect.js](https://github.com/LearnBoost/expect.js) by [Teppei Sato](https://github.com/teppeis)
* [:link:](expect.js/expect.js.d.ts) [expect.js](https://github.com/Automattic/expect.js) by [Teppei Sato](https://github.com/teppeis)
* [:link:](expectations/expectations.d.ts) [expectations.js](https://github.com/spmason/expectations) by [vvakame](https://github.com/vvakame)
* [:link:](express/express.d.ts) [Express 4.x](http://expressjs.com) by [Boris Yankov](https://github.com/borisyankov)
* [:link:](express-debug/express-debug.d.ts) [express-debug](https://github.com/devoidfury/express-debug) by [Federico Bond](https://github.com/federicobond)
@ -305,6 +313,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](fingerprintjs/fingerprint.d.ts) [fingerprintjs](https://github.com/Valve/fingerprintjs) by [Shunsuke Ohtani](https://github.com/zaneli)
* [:link:](state-machine/state-machine.d.ts) [Finite State Machine](https://github.com/jakesgordon/javascript-state-machine) by [Boris Yankov](https://github.com/borisyankov), [Maarten Docter](https://github.com/mdocter), [William Sears](https://github.com/MrBigDog2U)
* [:link:](firebase/firebase.d.ts) [Firebase API](https://www.firebase.com/docs/javascript/firebase) by [Vincent Botone](https://github.com/vbortone), [Shin1 Kashimura](https://github.com/in-async)
* [:link:](firebase-client/firebase-client.d.ts) [Firebase Client](https://www.github.com/jpstevens/firebase-client) by [Andrew Breen](https://github.com/fpsscarecrow)
* [:link:](firebase/firebase-simplelogin.d.ts) [Firebase Simple Login](https://www.firebase.com/docs/security/simple-login-overview.html) by [Wilker Lucio](http://github.com/wilkerlucio)
* [:link:](first-mate/first-mate.d.ts) [first-mate](https://github.com/atom/first-mate) by [Vadim Macagon](https://github.com/enlight)
* [:link:](flexSlider/flexSlider.d.ts) [FlexSlider 2 jquery plugin](https://github.com/woothemes/FlexSlider) by [Diullei Gomes](https://github.com/diullei)
@ -363,14 +372,15 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](greensock/greensock.d.ts) [GreenSock Animation Platform](http://www.greensock.com/get-started-js) by [Robert S](https://github.com/codebelt)
* [:link:](gridfs-stream/gridfs-stream.d.ts) [gridfs-stream](https://github.com/aheckmann/gridfs-stream) by [Lior Mualem](https://github.com/liorm)
* [:link:](gruntjs/gruntjs.d.ts) [Grunt 0.4.x](http://gruntjs.com) by [Jeff May](https://github.com/jeffmay), [Basarat Ali Syed](https://github.com/basarat)
* [:link:](gsap/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:](gsap/Core.d.ts) [GSAP](http://greensock.com) by [VILIC VANE](https://vilic.github.io)
* [:link:](gulp/gulp.d.ts) [Gulp v3.8.x](http://gulpjs.com) by [Drew Noakes](https://drewnoakes.com)
* [:link:](gulp-autoprefixer/gulp-autoprefixer.d.ts) [gulp-autoprefixer](https://github.com/sindresorhus/gulp-autoprefixer) by [Asana](https://asana.com)
* [:link:](gulp-cached/gulp-cached.d.ts) [gulp-cached](https://github.com/wearefractal/gulp-cached) by [Thomas Corbière](https://github.com/tomc974)
* [:link:](gulp-concat/gulp-concat.d.ts) [gulp-concat](http://github.com/wearefractal/gulp-concat) by [Keita Kagurazaka](https://github.com/k-kagurazaka)
* [:link:](gulp-csso/gulp-csso.d.ts) [gulp-csso](https://github.com/ben-eb/gulp-csso) by [Tanguy Krotoff](https://github.com/tkrotoff)
* [:link:](gulp-rev/gulp-rev.d.ts) [gulp-csso](https://github.com/sindresorhus/gulp-rev) by [Tanguy Krotoff](https://github.com/tkrotoff)
* [:link:](gulp-csso/gulp-csso.d.ts) [gulp-csso](https://github.com/ben-eb/gulp-csso) by [Tanguy Krotoff](https://github.com/tkrotoff)
* [:link:](gulp-debug/gulp-debug.d.ts) [gulp-debug](https://github.com/sindresorhus/gulp-debug) by [Tanguy Krotoff](https://github.com/tkrotoff)
* [:link:](gulp-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)
@ -379,10 +389,12 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](gulp-istanbul/gulp-istanbul.d.ts) [gulp-istanbul](https://github.com/SBoudrias/gulp-istanbul) by [Asana](https://asana.com)
* [:link:](gulp-jasmine-browser/gulp-jasmine-browser.d.ts) [gulp-jasmine-browser](https://github.com/jasmine/gulp-jasmine-browser) by [Tanguy Krotoff](https://github.com/tkrotoff)
* [:link:](gulp-less/gulp-less.d.ts) [gulp-less](https://github.com/plus3network/gulp-less) by [Keita Kagurazaka](https://github.com/k-kagurazaka)
* [:link:](gulp-load-plugins/gulp-load-plugins.d.ts) [gulp-load-plugins](https://github.com/jackfranklin/gulp-load-plugins) by [Joe Skeen](http://github.com/joeskeen)
* [:link:](gulp-minify-css/gulp-minify-css.d.ts) [gulp-minify-css](https://github.com/jonathanepollack/gulp-minify-css) by [Keita Kagurazaka](https://github.com/k-kagurazaka)
* [:link:](gulp-minify-html/gulp-minify-html.d.ts) [gulp-minify-html](https://github.com/murphydanger/gulp-minify-html) by [Tanguy Krotoff](https://github.com/tkrotoff)
* [:link:](gulp-mocha/gulp-mocha.d.ts) [gulp-mocha](https://github.com/sindresorhus/gulp-mocha) by [Asana](https://asana.com)
* [:link:](gulp-protractor/gulp-protractor.d.ts) [gulp-protractor](https://github.com/mllrsohn/gulp-protractor) by [Tanguy Krotoff](https://github.com/tkrotoff)
* [:link:](gulp-remember/gulp-remember.d.ts) [gulp-remember](https://github.com/ahaurw01/gulp-remember) by [Thomas Corbière](https://github.com/tomc974)
* [:link:](gulp-rename/gulp-rename.d.ts) [gulp-rename](https://github.com/hparra/gulp-rename) by [Asana](https://asana.com)
* [:link:](gulp-replace/gulp-replace.d.ts) [gulp-replace](https://github.com/lazd/gulp-replace) by [Asana](https://asana.com)
* [:link:](gulp-rev-replace/gulp-rev-replace.d.ts) [gulp-rev-replace](https://github.com/jamesknelson/gulp-rev-replace) by [Tanguy Krotoff](https://github.com/tkrotoff)
@ -393,7 +405,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](gulp-tsd/gulp-tsd.d.ts) [gulp-tsd](https://github.com/moznion/gulp-tsd) by [Keita Kagurazaka](https://github.com/k-kagurazaka)
* [:link:](gulp-tslint/gulp-tslint.d.ts) [gulp-tslint](https://github.com/panuhorsmalahti/gulp-tslint) by [Asana](https://asana.com)
* [:link:](gulp-typedoc/gulp-typedoc.d.ts) [gulp-typedoc](https://github.com/rogierschouten/gulp-typedoc) by [Asana](https://asana.com)
* [:link:](gulp-typescript/gulp-typescript.d.ts) [gulp-typescript](https://github.com/ivogabe/gulp-typescript) by [Asana](https://asana.com)
* [:link:](gulp-typescript/gulp-typescript.d.ts) [gulp-typescript](https://github.com/ivogabe/gulp-typescript) by [Asana](https://asana.com), [Thomas Corbière](https://github.com/tomc974)
* [:link:](gulp-uglify/gulp-uglify.d.ts) [gulp-uglify](https://github.com/terinjokes/gulp-uglify) by [Christopher Haws](https://github.com/ChristopherHaws)
* [:link:](gulp-useref/gulp-useref.d.ts) [gulp-useref](https://github.com/jonkemp/gulp-useref) by [Tanguy Krotoff](https://github.com/tkrotoff)
* [:link:](gulp-util/gulp-util.d.ts) [gulp-util v3.0.x](https://github.com/gulpjs/gulp-util) by [jedmao](https://github.com/jedmao)
@ -432,6 +444,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](icheck/icheck.d.ts) [iCheck](http://damirfoy.com/iCheck) by [Dániel Tar](https://github.com/qcz)
* [:link:](imagemagick/imagemagick.d.ts) [imagemagick](http://github.com/rsms/node-imagemagick) by [Carlos Ballesteros Velasco](https://github.com/soywiz)
* [:link:](imagemagick-native/imagemagick-native.d.ts) [imagemagick-native](https://www.npmjs.org/package/imagemagick-native) by [Hiroki Horiuchi](https://github.com/horiuchi)
* [:link:](imagesloaded/imagesloaded.d.ts) [imagesLoaded](https://github.com/desandro/imagesloaded) by [Chris Charabaruk](http://github.com/coldacid)
* [:link:](imap/imap.d.ts) [imap](https://www.npmjs.com/package/imap) by [Peter Snider](https://github.com/psnider)
* [:link:](imgur-rest-api/imgur-rest-api.d.ts) [Imgur REST API v3](https://api.imgur.com) by [Luke William Westby](http://github.com/lukewestby)
* [:link:](impress/impress.d.ts) [Impress.js](https://github.com/bartaz/impress.js) by [Boris Yankov](https://github.com/borisyankov)
@ -442,6 +455,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](interactjs/interact.d.ts) [Interacting for interact.js](https://github.com/taye/interact.js) by [Douglas Eichelberger](https://github.com/dduugg), [Adi Dahiya](https://github.com/adidahiya), [Tom Hasner](https://github.com/thasner)
* [:link:](intercomjs/intercom.d.ts) [intercom.js](https://github.com/diy/intercom.js) by [spencerwi](http://github.com/spencerwi)
* [:link:](inversify/inversify.d.ts) [inversify](https://github.com/inversify/InversifyJS) by [inversify](https://github.com/inversify)
* [:link:](ionic/ionic.d.ts) [Ionic](http://ionicframework.com) by [Spencer Williams](https://github.com/spencerwi)
* [:link:](cordova-ionic/cordova-ionic.d.ts) [Ionic Cordova plugins](https://github.com/driftyco) by [Hendrik Maus](https://github.com/hendrikmaus)
* [:link:](irc/irc.d.ts) [irc](https://github.com/martynsmith/node-irc) by [phillips1012](https://github.com/phillips1012)
* [:link:](is-lower-case/is-lower-case.d.ts) [is-lower-case](https://github.com/blakeembrey/is-lower-case) by [Sam Saint-Pettersen](https://github.com/stpettersens)
@ -472,7 +486,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](jjve/jjve.d.ts) [JJVE](https://github.com/silas/jjve) by [Wim Looman](https://github.com/Nemo157)
* [:link:](joData/joData.d.ts) [joData](https://github.com/mccow002/joData) by [Chris Wrench](https://github.com/cgwrench)
* [:link:](johnny-five/johnny-five.d.ts) [johnny-five](https://github.com/rwaldron/johnny-five) by [Toshiya Nakakura](https://github.com/nakakura)
* [:link:](joi/joi.d.ts) [joi](https://github.com/spumko/joi) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](joi/joi.d.ts) [joi](https://github.com/spumko/joi) by [Bart van der Schoor](https://github.com/Bartvds), [Laurence Dougal Myers](https://github.com/laurence-myers)
* [:link:](jointjs/jointjs.d.ts) [Joint JS](http://www.jointjs.com) by [Aidan Reel](http://github.com/areel), [David Durman](http://github.com/DavidDurman), [Ewout Van Gossum](https://github.com/DenEwout)
* [:link:](jqrangeslider/jqrangeslider.d.ts) [jQRangeSlider](http://ghusse.github.com/jQRangeSlider) by [Dániel Tar](https://github.com/qcz)
* [:link:](jquery/jquery.d.ts) [jQuery 1.10.x / 2.0.x](http://jquery.com) by [Boris Yankov](https://github.com/borisyankov), [Christian Hoffmeister](https://github.com/choffmeister), [Steve Fenton](https://github.com/Steve-Fenton), [Diullei Gomes](https://github.com/Diullei), [Tass Iliopoulos](https://github.com/tasoili), [Jason Swearingen](https://github.com/jasons-novaleaf), [Sean Hill](https://github.com/seanski), [Guus Goossens](https://github.com/Guuz), [Kelly Summerlin](https://github.com/ksummerlin), [Basarat Ali Syed](https://github.com/basarat), [Nicholas Wolverson](https://github.com/nwolverson), [Derek Cicerone](https://github.com/derekcicerone), [Andrew Gaspar](https://github.com/AndrewGaspar), [James Harrison Fisher](https://github.com/jameshfisher), [Seikichi Kondo](https://github.com/seikichi), [Benjamin Jackman](https://github.com/benjaminjackman), [Poul Sorensen](https://github.com/s093294), [Josh Strobl](https://github.com/JoshStrobl), [John Reilly](https://github.com/johnnyreilly), [Dick van den Brink](https://github.com/DickvdBrink)
@ -527,7 +541,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](jquery.jsignature/jquery.jsignature.d.ts) [jQuery.jsignature v2](https://github.com/willowsystems/jSignature) by [Patrick Magee](https://github.com/pjmagee)
* [:link:](jquery-jsonrpcclient/jquery-jsonrpcclient.d.ts) [jquery.jsonrpc](https://github.com/Textalk/jquery.jsonrpcclient.js) by [Maksim Karelov](https://github.com/Ty3uK)
* [:link:](jquery.noty/jquery.noty.d.ts) [jQuery.noty](http://needim.github.io/noty) by [Aaron King](https://github.com/kingdango)
* [:link:](jquery.payment/jquery.payment.d.ts) [jQuery.payment](https://github.com/stripe/jquery.payment) by [Eric J. Smith](https://github.com/ejsmith)
* [:link:](jquery.payment/jquery.payment.d.ts) [jQuery.payment](https://github.com/stripe/jquery.payment) by [Eric J. Smith](https://github.com/ejsmith), [John Rutherford](https://github.com/johnrutherford)
* [:link:](jquery.pjax.falsandtru/jquery.pjax.d.ts) [jquery.pjax.ts by falsandtru](https://github.com/falsandtru/jquery.pjax.js) by [新ゝ月 NewNotMoon](http://new.not-moon.net)
* [:link:](jquery.placeholder/jquery.placeholder.d.ts) [jquery.placeholder.js](https://github.com/mathiasbynens/jquery-placeholder) by [Peter Gill](https://github.com/majorsilence), [Neil Culver](https://github.com/EnableSoftware)
* [:link:](jquery.pnotify/jquery.pnotify.d.ts) [jquery.pnotify 2.x](https://github.com/sciactive/pnotify) by [David Sichau](https://github.com/DavidSichau)
@ -545,6 +559,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](jquery.total-storage/jquery.total-storage.d.ts) [jQueryTotalStorage](https://github.com/Upstatement/jquery-total-storage) by [Jeremy Brooks](https://github.com/JeremyCBrooks)
* [:link:](jqueryui/jqueryui.d.ts) [jQueryUI](http://jqueryui.com) by [Boris Yankov](https://github.com/borisyankov), [John Reilly](https://github.com/johnnyreilly)
* [:link:](js-cookie/js-cookie.d.ts) [js-cookie](https://github.com/js-cookie/js-cookie) by [Theodore Brown](https://github.com/theodorejb)
* [:link:](ua-parser-js/ua-parser-js.d.ts) [js-cookie](https://github.com/faisalman/ua-parser-js) by [Viktor Miroshnikov](https://github.com/superduper)
* [:link:](js-fixtures/fixtures.d.ts) [js-fixtures](https://github.com/badunk/js-fixtures) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid)
* [:link:](js-git/js-git.d.ts) [js-git](https://github.com/creationix/js-git) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](js-signals/js-signals.d.ts) [JS-Signals](http://millermedeiros.github.io/js-signals) by [Diullei Gomes](https://github.com/diullei)
@ -583,6 +598,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](kafka-node/kafka-node.d.ts) [kafka-node](https://github.com/SOHU-Co/kafka-node) by [Daniel Imrie-Situnayake](https://github.com/dansitu)
* [:link:](karma/karma.d.ts) [karma](https://github.com/karma-runner/karma) by [Tanguy Krotoff](https://github.com/tkrotoff)
* [:link:](karma-jasmine/karma-jasmine.d.ts) [karma-jasmine plugin](https://github.com/karma-runner/karma-jasmine) by [Michel Salib](https://github.com/michelsalib)
* [:link:](katex/katex.d.ts) [KaTeX v.0.5.0](http://khan.github.io/KaTeX) by [Michael Randolph](https://github.com/mrand01)
* [:link:](kendo-ui/kendo-ui.d.ts) [Kendo UI Professional](http://www.telerik.com/kendo-ui) by [Telerik](https://github.com/telerik)
* [:link:](keyboardjs/keyboardjs.d.ts) [KeyboardJS](https://github.com/RobertWHurst/KeyboardJS) by [Vincent Bortone](https://github.com/vbortone)
* [:link:](keymaster/keymaster.d.ts) [keymaster](https://github.com/madrobby/keymaster) by [Martin W. Kirst](https://github.com/nitram509)
@ -616,6 +632,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](ladda/ladda.d.ts) [Ladda](https://github.com/hakimel/Ladda) by [Danil Flores](https://github.com/dflor003), [Michael Lee](https://github.com/leemicw)
* [:link:](later/later.d.ts) [LaterJS](http://bunkat.github.io/later) by [Jason D Dryhurst-Smith](http://jasonds.co.uk)
* [:link:](lazy.js/lazy.js.d.ts) [Lazy.js](https://github.com/dtao/lazy.js) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](lazypipe/lazypipe.d.ts) [lazypipe](https://github.com/OverZealous/lazypipe) by [Thomas Corbière](https://github.com/tomc974)
* [:link:](leaflet/leaflet.d.ts) [Leaflet.js](https://github.com/Leaflet/Leaflet) by [Vladimir Zotov](https://github.com/rgripper)
* [:link:](leaflet-label/leaflet-label.d.ts) [Leaflet.label](https://github.com/Leaflet/Leaflet.label) by [Wim Looman](https://github.com/Nemo157)
* [:link:](jquery.leanModal/jquery.leanModal.d.ts) [leanModal.js](http://leanmodal.finelysliced.com.au) by [FinelySliced](https://github.com/FinelySliced)
@ -651,6 +668,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](magic-number/magic-number.d.ts) [magic-number](https://github.com/stpettersens/node-magic-number) by [Sam Saint-Pettersen](https://github.com/stpettersens)
* [:link:](magicsuggest/magicsuggest.d.ts) [MagicSuggest](http://nicolasbize.com/magicsuggest) by [Leonardo Chaia](http://github.com/leonardochaia)
* [:link:](mailcheck/mailcheck.d.ts) [Mailcheck](https://github.com/mailcheck/mailcheck) by [Paulo Cesar](http://github.com/pocesar)
* [:link:](maildev/maildev.d.ts) [maildev](https://github.com/djfarrelly/maildev) by [Cyril Schumacher](https://github.com/cyrilschumacher)
* [:link:](main-bower-files/main-bower-files.d.ts) [main-bower-files](https://github.com/ck86/main-bower-files) by [Keita Kagurazaka](https://github.com/k-kagurazaka)
* [:link:](maker.js/makerjs.d.ts) [Maker.js](https://github.com/Microsoft/maker.js) by [Dan Marshall](https://github.com/danmarshall)
* [:link:](mandrill-api/mandrill-api.d.ts) [Mandrill API 1.x](http://mandrill.com) by [Paulo Cesar](https://github.com/pocesar)
@ -672,10 +690,10 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](messenger/messenger.d.ts) [Messenger.js](https://github.com/HubSpot/messenger) by [Derek Cicerone](https://github.com/derekcicerone)
* [:link:](meteor/meteor.d.ts) [Meteor](http://www.meteor.com) by [Dave Allen](https://github.com/fullflavedave)
* [:link:](method-override/method-override.d.ts) [method-override](https://github.com/expressjs/method-override) by [Santi Albo](https://github.com/santialbo)
* [:link:](metismenu/metismenu.d.ts) [metisMenu](http://github.com/onokumus/metisMenu) by [onokums](https://github.com/onokumus)
* [:link:](microsoft-ajax/microsoft.ajax.d.ts) [Microsoft ASP.NET Ajax client side library](http://msdn.microsoft.com/en-us/library/ee341002(v=vs.100).aspx) by [Patrick Magee](https://github.com/pjmagee)
* [:link:](xrm/xrm.d.ts) [Microsoft Dynamics xRM API](http://www.microsoft.com/en-us/download/details.aspx?id=44567) by [David Berry](https://github.com/6ix4our), [Matt Ngan](https://github.com/mattngan)
* [:link:](xrm/xrm-6.d.ts) [Microsoft Dynamics xRM API v6](http://msdn.microsoft.com/en-us/library/gg328255.aspx) by [David Berry](https://github.com/6ix4our)
* [:link:](xrm/clientglobalcontext.d.ts) [Microsoft Dynamics xRM ClientGlobalContext.js.aspx](http://msdn.microsoft.com/en-us/library/gg328255.aspx) by [David Berry](https://github.com/6ix4our)
* [:link:](jquery-validation-unobtrusive/jquery-validation-unobtrusive.d.ts) [Microsoft jQuery Unobtrusive Validation](http://aspnetwebstack.codeplex.com) by [Matt Brooks](https://github.com/EnableSoftware)
* [:link:](microsoft-live-connect/microsoft-live-connect.d.ts) [Microsoft Live Connect](http://msdn.microsoft.com/en-us/library/live/hh243643.aspx) by [John Vilk](https://github.com/jvilk)
* [:link:](xrm/parature.d.ts) [Microsoft Parature extentions to Xrm.Page - available for CRM Online Only](http://msdn.microsoft.com/en-us/library/gg328255.aspx) by [David Berry](https://github.com/6ix4our)
@ -698,15 +716,15 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](mkdirp/mkdirp.d.ts) [mkdirp](http://github.com/substack/node-mkdirp) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](mkpath/mkpath.d.ts) [mkpath](https://www.npmjs.com/package/mkpath) by [Jared Klopper](https://github.com/optical)
* [:link:](mobile-detect/mobile-detect.d.ts) [mobile-detect](http://hgoebl.github.io/mobile-detect.js) by [Martin McWhorter](https://github.com/martinmcwhorter)
* [:link:](mocha/mocha.d.ts) [mocha](http://mochajs.org) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid), [otiai10](https://github.com/otiai10), [jt000](https://github.com/jt000), [Vadim Macagon](https://github.com/enlight)
* [:link:](mocha/mocha-node.d.ts) [mocha](http://mochajs.org) by [Vadim Macagon](https://github.com/enlight), [vvakame](https://github.com/vvakame)
* [:link:](mocha/mocha.d.ts) [mocha](http://mochajs.org) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid), [otiai10](https://github.com/otiai10), [jt000](https://github.com/jt000), [Vadim Macagon](https://github.com/enlight)
* [:link:](mocha-phantomjs/mocha-phantomjs.d.ts) [mocha-phantomjs](http://metaskills.net/mocha-phantomjs) by [Erik Schierboom](https://github.com/ErikSchierboom)
* [:link:](mock-fs/mock-fs.d.ts) [mock-fs](https://github.com/tschaub/mock-fs) by [Wim Looman](https://github.com/Nemo157)
* [:link:](mockery/mockery.d.ts) [mockery](https://github.com/mfncooper/mockery) by [jt000](https://github.com/jt000)
* [:link:](modernizr/modernizr.d.ts) [Modernizr](http://modernizr.com) by [Boris Yankov](https://github.com/borisyankov), [Theodore Brown](https://github.com/theodorejb)
* [:link:](moment-timezone/moment-timezone.d.ts) [moment-timezone.js](http://momentjs.com/timezone) by [Michel Salib](https://github.com/michelsalib)
* [:link:](moment/moment-node.d.ts) [Moment.js](https://github.com/timrwood/moment) by [Michael Lakerveld](https://github.com/Lakerfield), [Aaron King](https://github.com/kingdango), [Hiroki Horiuchi](https://github.com/horiuchi), [Dick van den Brink](https://github.com/DickvdBrink), [Adi Dahiya](https://github.com/adidahiya)
* [:link:](moment/moment.d.ts) [Moment.js](https://github.com/timrwood/moment) by [Michael Lakerveld](https://github.com/Lakerfield), [Aaron King](https://github.com/kingdango), [Hiroki Horiuchi](https://github.com/horiuchi), [Dick van den Brink](https://github.com/DickvdBrink), [Adi Dahiya](https://github.com/adidahiya)
* [:link:](moment/moment-node.d.ts) [Moment.js](https://github.com/timrwood/moment) by [Michael Lakerveld](https://github.com/Lakerfield), [Aaron King](https://github.com/kingdango), [Hiroki Horiuchi](https://github.com/horiuchi), [Dick van den Brink](https://github.com/DickvdBrink), [Adi Dahiya](https://github.com/adidahiya), [Matt Brooks](https://github.com/EnableSoftware)
* [:link:](moment/moment.d.ts) [Moment.js](https://github.com/timrwood/moment) by [Michael Lakerveld](https://github.com/Lakerfield), [Aaron King](https://github.com/kingdango), [Hiroki Horiuchi](https://github.com/horiuchi), [Dick van den Brink](https://github.com/DickvdBrink), [Adi Dahiya](https://github.com/adidahiya), [Matt Brooks](https://github.com/EnableSoftware)
* [:link:](moment-range/moment-range.d.ts) [Moment.js](https://github.com/gf3/moment-range) by [Bart van den Burg](https://github.com/Burgov), [Wilgert Velinga](https://github.com/wilgert)
* [:link:](mongodb/mongodb.d.ts) [MongoDB](https://github.com/mongodb/node-mongodb-native) by [Boris Yankov](https://github.com/borisyankov)
* [:link:](mongoose/mongoose.d.ts) [Mongoose](http://mongoosejs.com) by [horiuchi](https://github.com/horiuchi)
@ -735,6 +753,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](ng-command/ng-command.d.ts) [ng-command](https://github.com/stephenlautier/ng-command) by [Stephen Lautier](https://github.com/stephenlautier)
* [:link:](ng-grid/ng-grid.d.ts) [ng-grid](http://angular-ui.github.io/ng-grid) by [Ken Smith](https://github.com/smithkl42), [Roland Zwaga](https://github.com/rolandzwaga), [Kent Cooper](https://github.com/kentcooper)
* [:link:](angular-idle/angular-idle.d.ts) [ng-idle](http://hackedbychinese.github.io/ng-idle) by [mthamil](https://github.com/mthamil)
* [:link:](ngkookies/ngkookies.d.ts) [ngKookes](https://github.com/voronianski/ngKookies) by [Martin McWhorter](https://github.com/martinmcwhorter)
* [:link:](ngprogress/ngprogress.d.ts) [ngProgress](http://victorbjelkholm.github.io/ngProgress) by [Martin McWhorter](https://github.com/martinmcwhorter)
* [:link:](ngprogress-lite/ngprogress-lite.d.ts) [ngprogress-lite](https://github.com/voronianski/ngprogress-lite) by [Luke Forder](https://github.com/LukeForder)
* [:link:](nightmare/nightmare.d.ts) [Nightmare](https://github.com/segmentio/nightmare) by [horiuchi](https://github.com/horiuchi)
@ -755,10 +774,12 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](ip/ip.d.ts) [node-ip](https://github.com/indutny/node-ip) by [Peter Harris](https://github.com/codeanimal)
* [:link:](multiparty/multiparty.d.ts) [node-multiparty](https://github.com/andrewrk/node-multiparty) by [Ken Fukuyama](https://github.com/kenfdev)
* [:link:](mysql/mysql.d.ts) [node-mysql](https://github.com/felixge/node-mysql) by [William Johnston](https://github.com/wjohnsto)
* [:link:](node-mysql-wrapper/node-mysql-wrapper.d.ts) [node-mysql-wrapper](https://github.com/kataras/node-mysql-wrapper) by [Makis Maropoulos](https://github.com/kataras)
* [:link:](node-persist/node-persist.d.ts) [node-persist](https://github.com/simonlast/node-persist) by [Spencer Williams](http://spencerwi.com)
* [:link:](node-polyglot/node-polyglot.d.ts) [node-polyglot](https://github.com/airbnb/polyglot.js) by [Tim Jackson-Kiely](https://github.com/timjk)
* [:link:](promptly/promptly.d.ts) [node-promptly](https://github.com/IndigoUnited/node-promptly) by [Dan Spencer](https://github.com/danrspencer)
* [:link:](radius/radius.d.ts) [node-radius](https://github.com/retailnext/node-radius) by [Peter Harris](https://github.com/codeanimal)
* [:link:](node-schedule/node-schedule.d.ts) [node-schedule](https://github.com/tejasmanohar/node-schedule) by [Cyril Schumacher](https://github.com/cyrilschumacher)
* [:link:](stack-trace/stack-trace.d.ts) [node-stack-trace](https://github.com/felixge/node-stack-trace) by [Exceptionless](https://github.com/exceptionless)
* [:link:](node-uuid/node-uuid.d.ts) [node-uuid.js](https://github.com/broofa/node-uuid) by [Jeff May](https://github.com/jeffmay)
* [:link:](node-webkit/node-webkit.d.ts) [node-webkit](https://github.com/rogerwang/node-webkit) by [Pedro Casaubon](https://github.com/xperiments)
@ -770,8 +791,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](mdns/mdns.d.ts) [node_mdns](https://github.com/agnat/node_mdns) by [Stefan Steinhart](https://github.com/reppners)
* [:link:](node_redis/node_redis.d.ts) [node_redis](https://github.com/mranney/node_redis) by [Boris Yankov](https://github.com/borisyankov)
* [:link:](each/each.d.ts) [NodeEach](http://www.adaltas.com/projects/node-each) by [Michael Zabka](https://github.com/misak113)
* [:link:](nodemailer/nodemailer.d.ts) [Nodemailer](https://github.com/andris9/Nodemailer) by [Rogier Schouten](https://github.com/rogierschouten)
* [:link:](nodemailer/nodemailer-types.d.ts) [Nodemailer](https://github.com/andris9/Nodemailer) by [Rogier Schouten](https://github.com/rogierschouten)
* [:link:](nodemailer/nodemailer.d.ts) [Nodemailer](https://github.com/andris9/Nodemailer) by [Rogier Schouten](https://github.com/rogierschouten)
* [:link:](nodemailer-direct-transport/nodemailer-direct-transport.d.ts) [nodemailer-direct-transport](https://github.com/andris9/nodemailer-direct-transport) by [Rogier Schouten](https://github.com/rogierschouten)
* [:link:](nodemailer-pickup-transport/nodemailer-pickup-transport.d.ts) [nodemailer-pickup-transport](https://www.npmjs.com/package/nodemailer-pickup-transport) by [Peter Snider](https://github.com/psnider)
* [:link:](nodemailer-smtp-pool/nodemailer-smtp-pool.d.ts) [nodemailer-smtp-pool](https://github.com/andris9/nodemailer-smtp-pool) by [Rogier Schouten](https://github.com/rogierschouten)
@ -781,7 +802,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](nopt/nopt.d.ts) [nopt](https://github.com/npm/nopt) by [jbondc](https://github.com/jbondc)
* [:link:](notifyjs/notifyjs.d.ts) [notify.js](https://github.com/alexgibson/notify.js) by [soundTricker](https://github.com/soundTricker)
* [:link:](notify/notify.d.ts) [Notify.js](https://github.com/jpillora/notifyjs) by [Xiaohan Zhang](https://github.com/hellochar)
* [:link:](nouislider/nouislider.d.ts) [nouislider](https://github.com/leongersen/noUiSlider) by [Corey Jepperson](https://github.com/acoreyj)
* [:link:](nouislider/nouislider.d.ts) [nouislider](https://github.com/leongersen/noUiSlider) by [Patrick Davies](https://github.com/bleuarg)
* [:link:](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)
@ -807,6 +828,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](param-case/param-case.d.ts) [param-case](https://github.com/blakeembrey/param-case) by [Sam Saint-Pettersen](https://github.com/stpettersens)
* [:link:](parse/parse.d.ts) [Parse](https://parse.com) by [Ullisen Media Group](http://ullisenmedia.com)
* [:link:](parsimmon/parsimmon.d.ts) [Parsimmon](https://github.com/jneen/parsimmon) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](pascal-case/pascal-case.d.ts) [pascal-case](https://github.com/blakeembrey/pascal-case) by [Sam Saint-Pettersen](https://github.com/stpettersens)
* [:link:](passport/passport.d.ts) [Passport](http://passportjs.org) by [Horiuchi_H](https://github.com/horiuchi)
* [:link:](passport-strategy/passport-strategy.d.ts) [Passport Strategy module](https://github.com/jaredhanson/passport-strategy) by [Lior Mualem](https://github.com/liorm)
* [:link:](passport-twitter/passport-twitter.d.ts) [passport-facebook](https://github.com/jaredhanson/passport-facebook) by [James Roland Cabresos](https://github.com/staticfunction)
@ -814,10 +836,12 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](passport-facebook/passport-facebook.d.ts) [passport-facebook](https://github.com/jaredhanson/passport-facebook) by [James Roland Cabresos](https://github.com/staticfunction)
* [:link:](passport-facebook-token/passport-facebook-token.d.ts) [passport-facebook-token](https://github.com/drudge/passport-facebook-token) by [Ray Martone](https://github.com/rmartone)
* [:link:](passport-local/passport-local.d.ts) [passport-local](https://github.com/jaredhanson/passport-local) by [Maxime LUCE](https://github.com/SomaticIT)
* [:link:](path-case/path-case.d.ts) [path-case](https://github.com/blakeembrey/path-case) by [Sam Saint-Pettersen](https://github.com/stpettersens)
* [:link:](path-exists/path-exists.d.ts) [path-exists](https://github.com/sindresorhus/path-exists) by [Shogo Iwano](https://github.com/shiwano)
* [:link:](path-to-regexp/path-to-regexp.d.ts) [path-to-regexp](https://github.com/pillarjs/path-to-regexp) by [xica](https://github.com/xica)
* [:link:](pathjs/pathjs.d.ts) [Pathjs](https://github.com/mtrpcic/pathjs) by [Lokesh Peta](https://github.com/lokeshpeta)
* [:link:](pathwatcher/pathwatcher.d.ts) [pathwatcher](https://github.com/atom/node-pathwatcher) by [vvakame](https://github.com/vvakame)
* [:link:](PayPal-Cordova-Plugin/PayPal-Cordova-Plugin.d.ts) [PayPal-Cordova-Plugin](https://github.com/paypal/PayPal-Cordova-Plugin) by [Justin Unterreiner](https://github.com/Justin-Credible)
* [:link:](pdf/pdf.d.ts) [PDF.js](https://github.com/mozilla/pdf.js) by [Josh Baldwin](https://github.com/jbaldwin)
* [:link:](pdfkit/pdfkit.d.ts) [Pdfkit](http://pdfkit.org) by [Eric Hillah](https://github.com/erichillah)
* [:link:](peerjs/peerjs.d.ts) [PeerJS](http://peerjs.com) by [Toshiya Nakakura](https://github.com/nakakura)
@ -834,7 +858,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](pickadate/pickadate.d.ts) [pickadate.js](https://github.com/amsul/pickadate.js) by [Theodore Brown](https://github.com/theodorejb)
* [:link:](pikaday/pikaday.d.ts) [pikaday](https://github.com/dbushell/Pikaday) by [Rudolph Gottesheim](http://midnight-design.at)
* [:link:](piwik-tracker/piwik-tracker.d.ts) [PiwikTracker](https://www.npmjs.com/package/piwik-tracker) by [Guilherme Bernal](https://github.com/lbguilherme)
* [:link:](pixi/pixi.d.ts) [PIXI](https://github.com/GoodBoyDigital/pixi.js) by [xperiments](http://github.com/xperiments)
* [:link:](pixi-spine/pixi-spine.d.ts) [pixi-spine](https://github.com/pixijs/pixi-spine) by [martijncroezen](https://github.com/pixijs/pixi-typescript)
* [:link:](pixi.js/pixi.js.d.ts) [Pixi.js](https://github.com/GoodBoyDigital/pixi.js) by [clark-stevenson](https://github.com/pixijs/pixi-typescript)
* [:link:](platform/platform.d.ts) [Platform](https://github.com/bestiejs/platform.js) by [Jake Hickman](https://github.com/JakeH)
* [:link:](playerframework/playerFramework.d.ts) [Player Framework (MMPPF)](https://playerframework.codeplex.com) by [Ricardo Sabino](https://github.com/ricardosabino)
* [:link:](pleasejs/please.d.ts) [PleaseJS](http://www.checkman.io/please) by [Toshiya Nakakura](https://github.com/nakakura)
@ -846,7 +871,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](polyline/polyline.d.ts) [Polyline](https://github.com/mapbox/polyline) by [Arseniy Maximov](https://github.com/Kern0)
* [:link:](polymer/polymer.d.ts) [polymer](https://github.com/Polymer/polymer) by [Louis Grignon](https://github.com/lgrignon), [Suguru Inatomi](https://github.com/laco0416)
* [:link:](popcorn/popcorn.d.ts) [Popcorn](https://github.com/mozilla/popcorn-js) by [grapswiz](https://github.com/grapswiz)
* [:link:](postal/postal.d.ts) [Postal](https://github.com/postaljs/postal.js) by [Lokesh Peta](https://github.com/lokeshpeta)
* [:link:](postal/postal.d.ts) [Postal](https://github.com/postaljs/postal.js) by [Lokesh Peta](https://github.com/lokeshpeta), [Paul Jolly](https://github.com/myitcv)
* [:link:](pouchDB/pouch.d.ts) [Pouch](http://pouchdb.com) by [Bill Sears](https://github.com/MrBigDog2U)
* [:link:](power-assert/power-assert.d.ts) [power-assert](https://github.com/twada/power-assert) by [vvakame](https://github.com/vvakame)
* [:link:](power-assert-formatter/power-assert-formatter.d.ts) [power-assert-formatter](https://github.com/twada/power-assert-formatter) by [vvakame](https://github.com/vvakame)
@ -878,12 +903,15 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](raygun4js/raygun4js.d.ts) [raygun4js](https://github.com/MindscapeHQ/raygun4js) by [Brian Surowiec](https://github.com/xt0rted)
* [:link:](react/react.d.ts) [React (external module)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com)
* [:link:](react/react-global.d.ts) [React (internal module)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com)
* [:link:](react-dnd/react-dnd.d.ts) [React DnD](https://github.com/gaearon/react-dnd) by [Asana](https://asana.com)
* [:link:](react-router/react-router.d.ts) [React Router](https://github.com/rackt/react-router) by [Yuichi Murata](https://github.com/mrk21), [Václav Ostrožlík](https://github.com/vasek17)
* [:link:](react-swf/react-swf.d.ts) [react-swf](https://github.com/syranide/react-swf) by [Stepan Mikhaylyuk](https://github.com/stepancar)
* [:link:](react/react-addons.d.ts) [ReactWithAddons (external module)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com)
* [:link:](react/react-addons-global.d.ts) [ReactWithAddons (internal module)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com)
* [:link:](readdir-stream/readdir-stream.d.ts) [readdir-stream](https://github.com/logicalparadox/readdir-stream) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](recursive-readdir/recursive-readdir.d.ts) [recursive-readdir](https://github.com/jergason/recursive-readdir) by [Elisée Maurer](https://github.com/elisee)
* [:link:](redis/redis.d.ts) [redis](https://github.com/mranney/node_redis) by [Carlos Ballesteros Velasco](https://github.com/soywiz), [Peter Harris](https://github.com/CodeAnimal)
* [:link:](redux/redux.d.ts) [Redux](https://github.com/rackt/redux) by [William Buchwalter](https://github.com/wbuchwalter), [Vincent Prouillet](https://github.com/Keats)
* [:link:](ref/ref.d.ts) [ref](https://github.com/TooTallNate/ref) by [Paul Loyd](https://github.com/loyd)
* [:link:](ref-array/ref-array.d.ts) [ref-array](https://github.com/TooTallNate/ref-array) by [Paul Loyd](https://github.com/loyd)
* [:link:](ref-struct/ref-struct.d.ts) [ref-struct](https://github.com/TooTallNate/ref-struct) by [Paul Loyd](https://github.com/loyd)
@ -891,6 +919,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](request/request.d.ts) [request](https://github.com/mikeal/request) by [Carlos Ballesteros Velasco](https://github.com/soywiz), [bonnici](https://github.com/bonnici), [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](request-promise/request-promise.d.ts) [request-promise](https://www.npmjs.com/package/request-promise) by [Christopher Glantschnig](https://github.com/cglantschnig)
* [:link:](requirejs/require.d.ts) [RequireJS](http://requirejs.org) by [Josh Baldwin](https://github.com/jbaldwin)
* [:link:](resemblejs/resemblejs.d.ts) [Resemble.js](http://huddle.github.io/Resemble.js) by [Tim Perry](https://github.com/pimterry)
* [:link:](response-time/response-time.d.ts) [response-time](https://github.com/expressjs/response-time) by [Uros Smolnik](https://github.com/urossmolnik)
* [:link:](rest/rest.d.ts) [rest.js](https://github.com/cujojs/rest) by [Wim Looman](https://github.com/Nemo157)
* [:link:](restangular/restangular.d.ts) [Restangular](https://github.com/mgonto/restangular) by [Boris Yankov](https://github.com/borisyankov)
@ -902,6 +931,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](rivets/rivets.d.ts) [rivets](http://rivetsjs.com) by [Trevor Baron](https://github.com/TrevorDev)
* [:link:](route-recognizer/route-recognizer.d.ts) [route-recognizer](https://github.com/tildeio/route-recognizer) by [Dave Keen](http://www.keendevelopment.ch)
* [:link:](routie/routie.d.ts) [routie](https://github.com/jgallen23/routie) by [Adilson](https://github.com/Adilson)
* [:link:](rsmq/rsmq.d.ts) [rsmq](http://smrchy.github.io/rsmq) by [Qubo](https://github.com/MugeSo)
* [:link:](rsmq-worker/rsmq-worker.d.ts) [rsmq-worker](http://smrchy.github.io/rsmq/rsmq-worker) by [Qubo](https://github.com/MugeSo)
* [:link:](rtree/rtree.d.ts) [rtree](https://github.com/leaflet-extras/RTree) by [Omede Firouz](https://github.com/oefirouz)
* [:link:](run-sequence/run-sequence.d.ts) [run-sequence](https://github.com/OverZealous/run-sequence) by [Keita Kagurazaka](https://github.com/k-kagurazaka)
* [:link:](rx/rx.d.ts) [RxJS](http://rx.codeplex.com) by [gsino](http://www.codeplex.com/site/users/view/gsino), [Igor Oleinikov](https://github.com/Igorbek)
@ -932,7 +963,9 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](selenium-webdriver/selenium-webdriver.d.ts) [Selenium WebDriverJS](https://code.google.com/p/selenium) by [Bill Armstrong](https://github.com/BillArmstrong)
* [:link:](semver/semver.d.ts) [semver](https://github.com/isaacs/node-semver) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](sendgrid/sendgrid.d.ts) [sendgrid](https://github.com/sendgrid/sendgrid-nodejs) by [Maxime LUCE](https://github.com/SomaticIT)
* [:link:](sentence-case/sentence-case.d.ts) [sentence-case](https://github.com/blakeembrey/sentence-case) by [Sam Saint-Pettersen](https://github.com/stpettersens)
* [:link:](sequelize/sequelize.d.ts) [Sequelize 2.0.0 dev13](http://sequelizejs.com) by [samuelneff](https://github.com/samuelneff), [Peter Harris](https://github.com/codeanimal)
* [:link:](sequelize-fixtures/sequelize-fixtures.d.ts) [Sequelize-Fixtures](https://github.com/domasx2/sequelize-fixtures) by [Christian Schwarz](https://github.com/cschwarz)
* [:link:](on-headers/on-headers.d.ts) [serve-favicon](https://github.com/jshttp/on-headers) by [John Jeffery](https://github.com/jjeffery)
* [:link:](serve-favicon/serve-favicon.d.ts) [serve-favicon](https://github.com/expressjs/serve-favicon) by [Uros Smolnik](https://github.com/urossmolnik)
* [:link:](serve-static/serve-static.d.ts) [serve-static](https://github.com/expressjs/serve-static) by [Uros Smolnik](https://github.com/urossmolnik)
@ -960,6 +993,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](slickgrid/slick.headerbuttons.d.ts) [SlickGrid HeaderButtons Plugin](https://github.com/mleibman/SlickGrid) by [Derek Cicerone](https://github.com/derekcicerone)
* [:link:](slickgrid/slick.rowselectionmodel.d.ts) [SlickGrid RowSelectionModel Plugin](https://github.com/mleibman/SlickGrid) by [Derek Cicerone](https://github.com/derekcicerone)
* [:link:](smoothie/smoothie.d.ts) [Smoothie Charts](https://github.com/joewalnes/smoothie) by [Drew Noakes](https://drewnoakes.com), [Mike H. Hawley](https://github.com/mikehhawley)
* [:link:](snake-case/snake-case.d.ts) [snake-case](https://github.com/blakeembrey/snake-case) by [Sam Saint-Pettersen](https://github.com/stpettersens)
* [:link:](snapsvg/snapsvg.d.ts) [Snap-SVG](https://github.com/adobe-webplatform/Snap.svg) by [Lars Klein](https://github.com/lhk)
* [:link:](socket.io/socket.io.d.ts) [socket.io](http://socket.io) by [PROGRE](https://github.com/progre), [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)
@ -1000,9 +1034,11 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](svg2png/svg2png.d.ts) [svg2png node package](https://github.com/domenic/svg2png) by [hans windhoff](https://github.com/hansrwindhoff)
* [:link:](svgjs.draggable/svgjs.draggable.d.ts) [svgjs.draggable](http://www.svgjs.com) by [Luigi Trabacchin](https://github.com/LiFeleSs)
* [:link:](swag/swag.d.ts) [swag](https://github.com/elving/swag) by [Shogo Iwano](https://github.com/shiwano)
* [:link:](swap-case/swap-case.d.ts) [swap-case](https://github.com/blakeembrey/swap-case) by [Sam Saint-Pettersen](https://github.com/stpettersens)
* [:link:](sweetalert/sweetalert.d.ts) [SweetAlert](https://github.com/t4t5/sweetalert) by [Markus Peloso](https://github.com/ToastHawaii)
* [:link:](swfobject/swfobject.d.ts) [swfobject](https://code.google.com/p/swfobject) by [rou](https://github.com/rou)
* [:link:](swig/swig.d.ts) [swig](http://github.com/paularmstrong/swig) by [Peter Harris](https://github.com/CodeAnimal), [Carlos Ballesteros Velasco](https://github.com/soywiz)
* [:link:](swig-email-templates/swig-email-templates.d.ts) [swig-email-templates](https://github.com/andrewrk/swig-email-templates) by [Adam Babcock](https://github.com/mrhen)
* [:link:](swipe/swipe.d.ts) [Swipe](https://github.com/thebird/Swipe) by [Andrey Kurdyumov](https://github.com/kant2002)
* [:link:](swiper/swiper.d.ts) [Swiper](https://github.com/nolimits4web/Swiper) by [Sebastián Galiano](https://github.com/sgaliano)
* [:link:](swipeview/swipeview.d.ts) [SwipeView](http://cubiq.org/swipeview) by [Boris Yankov](https://github.com/borisyankov)
@ -1013,10 +1049,12 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](tape/tape.d.ts) [tape](https://github.com/substack/tape) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](tar/tar.d.ts) [tar](https://github.com/npm/node-tar) by [Maxime LUCE](https://github.com/SomaticIT)
* [:link:](tcomb/tcomb.d.ts) [tcomb](http://gcanti.github.io/tcomb/guide/index.html) by [Hans Windhoff](https://github.com/hansrwindhoff)
* [:link:](tea-merge/tea-merge.d.ts) [tea-merge](https://github.com/qualiancy/tea-merge) by [Mihhail Lapushkin](https://github.com/mihhail-lapushkin)
* [:link:](tedious/tedious.d.ts) [tedious](https://pekim.github.io/tedious) by [Rogier Schouten](https://github.com/rogierschouten)
* [:link:](tedious-connection-pool/tedious-connection-pool.d.ts) [tedious-connection-pool](https://github.com/pekim/tedious-connection-pool) by [Cyprien Autexier](https://github.com/sandorfr)
* [:link:](teechart/teechart.d.ts) [TeeChart](http://www.steema.com) by [Steema Software](https://steema.com)
* [:link:](tether/tether.d.ts) [Tether](http://github.hubspot.com/tether) by [Adi Dahiya](https://github.com/adidahiya)
* [:link:](tether-shepherd/tether-shepherd.d.ts) [Tether-Shepherd](http://github.hubspot.com/shepherd) by [Matt Gibbs](https://github.com/mtgibbs)
* [:link:](text-buffer/text-buffer.d.ts) [text-buffer](https://github.com/atom/text-buffer) by [vvakame](https://github.com/vvakame)
* [:link:](text-encoding/text-encoding.d.ts) [text-encoding](https://github.com/inexorabletash/text-encoding) by [MIZUNE Pine](https://github.com/pine613)
* [:link:](github-electron/github-electron-main.d.ts) [the Electron 0.25.2 main process](http://electron.atom.io) by [jedmao](https://github.com/jedmao)
@ -1032,6 +1070,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](threejs/three-renderpass.d.ts) [three.js (RenderPass.js)](https://github.com/mrdoob/three.js/blob/r68/examples/js/postprocessing/RenderPass.js) by [Satoru Kimura](https://github.com/gyohk)
* [:link:](threejs/three-shaderpass.d.ts) [three.js (ShaderPass.js)](https://github.com/mrdoob/three.js/blob/r68/examples/js/postprocessing/ShaderPass.js) by [Satoru Kimura](https://github.com/gyohk)
* [:link:](threejs/three-trackballcontrols.d.ts) [three.js (TrackballControls.js)](https://github.com/mrdoob/three.js/blob/master/examples/js/controls/TrackballControls.js) by [Satoru Kimura](https://github.com/gyohk)
* [:link:](threejs/three-transformcontrols.d.ts) [three.js (TransformControls.js)](https://github.com/mrdoob/three.js/blob/master/examples/js/controls/TransformControls.js) by [Stefan Profanter](https://github.com/Pro)
* [:link:](threejs/three-vrcontrols.d.ts) [three.js (VRControls.js)](https://github.com/mrdoob/three.js/blob/master/examples/js/controls/VRControls.js) by [Toshiya Nakakura](https://github.com/nakakura)
* [:link:](threejs/three-vreffect.d.ts) [three.js (VREffect.js)](https://github.com/mrdoob/three.js/blob/master/examples/js/effects/VREffect.js) by [Toshiya Nakakura](https://github.com/nakakura)
* [:link:](threejs/three.d.ts) [three.js r71](http://mrdoob.github.com/three.js) by [Kon](http://phyzkit.net), [Satoru Kimura](https://github.com/gyohk)
@ -1070,6 +1109,9 @@ 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:](umbraco/umbraco-resources.d.ts) [Umbraco](https://github.com/umbraco) by [DeCareSystemsIreland](https://github.com/DeCareSystemsIreland)
* [:link:](umbraco/umbraco-services.d.ts) [Umbraco](https://github.com/umbraco) by [DeCareSystemsIreland](https://github.com/DeCareSystemsIreland)
* [:link:](umbraco/umbraco.d.ts) [Umbraco](https://github.com/umbraco) by [DeCareSystemsIreland](https://github.com/DeCareSystemsIreland)
* [:link:](underscore/underscore.d.ts) [Underscore](http://underscorejs.org) by [Boris Yankov](https://github.com/borisyankov), [Josh Baldwin](https://github.com/jbaldwin)
* [:link:](underscore-ko/underscore-ko.d.ts) [Underscore-ko 1.2.2 with underscore](https://github.com/kamranayub/UnderscoreKO) by [Maurits Elbers](https://github.com/MagicMau)
* [:link:](underscore.string/underscore.string.d.ts) [underscore.string](https://github.com/epeli/underscore.string) by [Ry Racherbaumer](http://github.com/rygine)
@ -1083,12 +1125,14 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](js-url/js-url.d.ts) [url](https://github.com/websanova/js-url) by [MIZUNE Pine](https://github.com/pine613)
* [:link:](urlrouter/urlrouter.d.ts) [urlrouter](https://github.com/fengmk2/urlrouter) by [soywiz](https://github.com/soywiz)
* [:link:](urlsafe-base64/urlsafe-base64.d.ts) [urlsafe-base64](https://github.com/RGBboy/urlsafe-base64) by [Tanguy Krotoff](https://github.com/tkrotoff)
* [:link:](usage/usage.d.ts) [usage](https://github.com/arunoda/node-usage) by [Pascal Vomhoff](https://github.com/pvomhoff)
* [:link:](UUID/UUID.d.ts) [UUID.js core](https://github.com/LiosK/UUID.js) by [Jason Jarrett](https://github.com/staxmanade)
* [:link:](valerie/valerie.d.ts) [valerie](https://github.com/davewatts/valerie) by [Howard Richards](https://github.com/conficient)
* [:link:](validator/validator.d.ts) [validator.js](https://github.com/chriso/validator.js) by [tgfjt](https://github.com/tgfjt)
* [:link:](vega/vega.d.ts) [Vega](http://trifacta.github.io/vega) by [Tom Crockett](http://github.com/pelotom)
* [:link:](velocity-animate/velocity-animate.d.ts) [Velocity](http://velocityjs.org) by [Greg Smith](https://github.com/smrq)
* [:link:](vex-js/vex-js.d.ts) [Vex](https://github.com/HubSpot/vex) by [Greg Cohan](https://github.com/gdcohan)
* [:link:](vexflow/vexflow.d.ts) [VexFlow](http://vexflow.com) by [Roman Quiring](https://github.com/rquiring)
* [:link:](victor/victor.d.ts) [Victor.js](http://victorjs.org) by [Ivane Gegia](https://twitter.com/ivanegegia)
* [:link:](videojs/videojs.d.ts) [Video.js](https://github.com/zencoder/video-js) by [Vincent Bortone](https://github.com/vbortone)
* [:link:](vimeo/froogaloop.d.ts) [Vimeo](http://developer.vimeo.com/player/js-api) by [Daz Wilkin](https://github.com/DazWilkin)
@ -1097,6 +1141,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](vinyl-source-stream/vinyl-source-stream.d.ts) [vinyl-source-stream](https://github.com/hughsk/vinyl-source-stream) by [Asana](https://asana.com)
* [:link:](virtual-dom/virtual-dom.d.ts) [virtual-dom](https://github.com/Matt-Esch/virtual-dom) by [Christopher Brown](https://github.com/chbrown)
* [:link:](vortex-web-client/vortex-web-client.d.ts) [Vortex Web 1.2.0p1](http://www.prismtech.com/vortex/vortex-web) by [Stefan Profanter](https://github.com/Pro)
* [:link:](vso-node-api/vso-node-api.d.ts) [vso-node-api](https://github.com/Microsoft/vso-node-api) by [Teddy Ward](https://github.com/teddyward)
* [:link:](vue/vue.d.ts) [vuejs](https://github.com/yyx990803/vue) by [odangosan](https://github.com/odangosan)
* [:link:](watch/watch.d.ts) [watch](https://github.com/mikeal/watch) by [Carlos Ballesteros Velasco](https://github.com/soywiz)
* [:link:](jquery.watermark/jquery.watermark.d.ts) [Watermark plugin for jQuery](http://jquery-watermark.googlecode.com) by [Anwar Javed](https://github.com/anwarjaved)
@ -1144,7 +1189,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](node_zeromq/zmq.d.ts) [ZeroMQ Node](https://github.com/JustinTulloss/zeromq.node) by [Dave McKeown](http://github.com/davemckeown)
* [:link:](zip.js/zip.js.d.ts) [zip.js 2.x](https://github.com/gildas-lormeau/zip.js) by [Louis Grignon](https://github.com/lgrignon)
* [:link:](scroller/easyscroller.d.ts) [Zynga EasyScroller](https://github.com/zynga/scroller) by [Boris Yankov](https://github.com/borisyankov)
* [:link:](zynga-scroller/zynga-scroller.d.ts) [Zynga Scroller](http://zynga.github.com/scroller) by [Marcelo Haskell Camargo](https://github.com/haskellcamargo)
* [:link:](scroller/scroller.d.ts) [Zynga Scroller](https://github.com/zynga/scroller) by [Boris Yankov](https://github.com/borisyankov)
* [:link:](zynga-scroller/zynga-scroller.d.ts) [Zynga Scroller](http://zynga.github.com/scroller) by [Marcelo Haskell Camargo](https://github.com/haskellcamargo)
* [:link:](viewporter/viewporter.d.ts) [Zynga Viewporter](https://github.com/zynga/viewporter) by [Boris Yankov](https://github.com/borisyankov)

View File

@ -0,0 +1,115 @@
/// <reference path="PayPal-Cordova-Plugin.d.ts"/>
var item: PayPalItem;
item = new PayPalItem("name", 10, "25.00", "USD");
item = new PayPalItem("name", 10, "25.00", "USD", null);
item = new PayPalItem("name", 10, "25.00", "USD", "SKU_ID");
var item_name: string = item.name;
var item_quantity: number = item.quantity;
var item_price: string = item.price;
var item_currency: string = item.currency;
var item_sku: string = item.sku;
var paymentDetails: PayPalPaymentDetails;
paymentDetails = new PayPalPaymentDetails("10.50", "2.50", "1.25");
var paymentDetails_subtotal: string = paymentDetails.subtotal;
var paymentDetails_shipping: string = paymentDetails.shipping;
var paymentDetails_tax: string = paymentDetails.tax;
var shippingAddress: PayPalShippingAddress;
shippingAddress = new PayPalShippingAddress("name", "line1", "line2", "city", "state", "postalCode", "countryCode");
var shippingAddress_recipientName: string = shippingAddress.recipientName;
var shippingAddress_line1: string = shippingAddress.line1;
var shippingAddress_line2: string = shippingAddress.line2;
var shippingAddress_city: string = shippingAddress.city;
var shippingAddress_state: string = shippingAddress.state;
var shippingAddress_postalCode: string = shippingAddress.postalCode;
var shippingAddress_countryCode: string = shippingAddress.countryCode;
var payment: PayPalPayment;
payment = new PayPalPayment("10.00", "USD", "description", "Auth");
payment = new PayPalPayment("10.00", "USD", "description", "Auth", paymentDetails);
var payment_amount: string = payment.amount;
var payment_currency: string = payment.currency;
var payment_shortDescription: string = payment.shortDescription;
var payment_intent: string = payment.intent;
var payment_details: PayPalPaymentDetails = payment.details;
var payment_invoiceNumber: string = payment.invoiceNumber;
var payment_custom: string = payment.custom;
var payment_softDescriptor: string = payment.softDescriptor;
var payment_bnCode: string = payment.bnCode;
var payment_items: PayPalItem[] = [item, item, item];
var payment_shippingAddress: PayPalShippingAddress = shippingAddress;
var configOptions: PayPalConfigurationOptions = {
defaultUserEmail: "email",
defaultUserPhoneCountryCode: "countryCode",
defaultUserPhoneNumber: "phoneNumber",
merchantName: "merchantName",
merchantPrivacyPolicyURL: "merchantPrivacyPolicyURL",
merchantUserAgreementURL: "merchantUserAgreementURL",
acceptCreditCards: true,
payPalShippingAddressOption: 10,
rememberUser: true,
languageOrLocale: "languageOrLocal",
disableBlurWhenBackgrounding: true,
presentingInPopover: true,
forceDefaultsInSandbox: true,
sandboxUserPassword: "sandboxUserPassword",
sandboxUserPin: "sandboxUserPin"
};
var config: PayPalConfiguration;
config = new PayPalConfiguration();
config = new PayPalConfiguration(null);
config = new PayPalConfiguration(configOptions);
var config_defaultUserEmail: string = config.defaultUserEmail;
var config_defaultUserPhoneCountryCode: string = config.defaultUserPhoneCountryCode;
var config_defaultUserPhoneNumber: string = config.defaultUserPhoneNumber;
var config_merchantName: string = config.merchantName;
var config_merchantPrivacyPolicyURL: string = config.merchantPrivacyPolicyURL;
var config_merchantUserAgreementURL: string = config.merchantUserAgreementURL;
var config_acceptCreditCards: boolean = config.acceptCreditCards;
var config_payPalShippingAddressOption: number = config.payPalShippingAddressOption;
var config_rememberUser: boolean = config.rememberUser;
var config_languageOrLocale: string = config.languageOrLocale;
var config_disableBlurWhenBackgrounding: boolean = config.disableBlurWhenBackgrounding;
var config_presentingInPopover: boolean = config.presentingInPopover;
var config_forceDefaultsInSandbox: boolean = config.forceDefaultsInSandbox;
var config_sandboxUserPasword: string = config.sandboxUserPassword;
var config_sandboxUserPin: string = config.sandboxUserPin;
var clientIds: PayPalCordovaPlugin.PayPalClientIds = {
PayPalEnvironmentProduction: "",
PayPalEnvironmentSandbox: ""
};
var apiModule: PayPalCordovaPlugin.PayPalMobileStatic = PayPalMobile;
apiModule.version((result: string) => {});
apiModule.init(clientIds, () => {});
apiModule.prepareToRender("environment", config, () => {});
apiModule.renderSinglePaymentUI(payment, (result: any) => {}, (cancelReason: string) => {});
apiModule.applicationCorrelationIDForEnvironment("environment", (applicationCorrelationId: string) => {});
apiModule.clientMetadataID((clientMetadataId: string) => {});
apiModule.renderFuturePaymentUI((result: any) => {}, (cancelReason: string) => {});
apiModule.renderProfileSharingUI(["openid", "profile", "email"], (result: any) => {}, (cancelReason: string) => {});

View File

@ -0,0 +1,615 @@
// Type definitions for PayPal-Cordova-Plugin 3.1.10
// Project: https://github.com/paypal/PayPal-Cordova-Plugin
// Definitions by: Justin Unterreiner <https://github.com/Justin-Credible>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
//#region paypal-mobile-js-helper.js
/**
* The PayPalItem class defines an optional itemization for a payment.
*
* @see https://developer.paypal.com/docs/api/#item-object for more details.
*/
declare class PayPalItem {
/**
* @param name Name of the item. 127 characters max.
* @param quantity Number of units. 10 characters max.
* @param price Unit price for this item 10 characters max.
* May be negative for "coupon" etc.
* @param currency ISO standard currency code.
* @param sku The stock keeping unit for this item. 50 characters max (optional).
*/
constructor(name: string, quantity: number, price: string, currency: string, sku?: string);
/**
* Name of the item. 127 characters max.
*/
name: string;
/**
* Number of units. 10 characters max.
*/
quantity: number;
/**
* Unit price for this item 10 characters max.
* May be negative for "coupon" etc.
*/
price: string;
/**
* ISO standard currency code.
*/
currency: string;
/**
* The stock keeping unit for this item. 50 characters max (optional).
*/
sku: string;
}
/**
* The PayPalPaymentDetails class defines optional amount details.
*
* @see https://developer.paypal.com/webapps/developer/docs/api/#details-object for more details.
*/
declare class PayPalPaymentDetails {
/**
* @param subtotal Sub-total (amount) of items being paid for. 10 characters max with support for 2 decimal places.
* @param shipping Amount charged for shipping. 10 characters max with support for 2 decimal places.
* @param tax Amount charged for tax. 10 characters max with support for 2 decimal places.
*/
constructor(subtotal: string, shipping: string, tax: string);
/**
* Sub-total (amount) of items being paid for. 10 characters max with support for 2 decimal places.
*/
subtotal: string;
/**
* Amount charged for shipping. 10 characters max with support for 2 decimal places.
*/
shipping: string;
/**
* Amount charged for tax. 10 characters max with support for 2 decimal places.
*/
tax: string;
}
/**
* Convenience constructor. Returns a PayPalPayment with the specified amount, currency code, and short description.
*/
declare class PayPalPayment {
/**
* @param amount The amount of the payment.
* @param currencyCode The ISO 4217 currency for the payment.
* @param shortDescription A short descripton of the payment.
* @param intent  "Sale" for an immediate payment.
*  "Auth" for payment authorization only, to be captured separately at a later time.
* "Order" for taking an order, with authorization and capture to be done separately at a later time.
* @param details PayPalPaymentDetails object (optional).
*/
constructor(amount: string, currency: string, shortDescription: string, intent: string, details?: PayPalPaymentDetails);
/**
* The amount of the payment.
*/
amount: string;
/**
* The ISO 4217 currency for the payment.
*/
currency: string;
/**
* A short descripton of the payment.
*/
shortDescription: string;
/**
* "Sale" for an immediate payment.
*  "Auth" for payment authorization only, to be captured separately at a later time.
*  "Order" for taking an order, with authorization and capture to be done separately at a later time.
*/
intent: string;
/**
* PayPalPaymentDetails object (optional).
*/
details: PayPalPaymentDetails;
/**
* Optional invoice number, for your tracking purposes. (up to 256 characters).
*/
invoiceNumber: string;
/**
* Optional text, for your tracking purposes. (up to 256 characters).
*/
custom: string;
/**
* Optional text which will appear on the customer's credit card statement. (up to 22 characters).
*/
softDescriptor: string;
/**
* Optional Build Notation code ("BN code"), obtained from partnerprogram@paypal.com, for your tracking purposes.
*/
bnCode: string;
/**
* Optional array of PayPalItem objects.
* @see PayPalItem
* @note If you provide one or more items, be sure that the various prices correctly sum to the payment `amount` or to `paymentDetails.subtotal`.
*/
items: PayPalItem[];
/**
* Optional customer shipping address, if your app wishes to provide this to the SDK.
* @note make sure to set `payPalShippingAddressOption` in PayPalConfiguration to 1 or 3.
*/
shippingAddress: PayPalShippingAddress;
}
declare class PayPalShippingAddress {
/**
* @param recipientName Name of the recipient at this address. 50 characters max.
* @param line1 Line 1 of the address (e.g., Number, street, etc). 100 characters max.
* @param line2 Line 2 of the address (e.g., Suite, apt #, etc). 100 characters max. Optional.
* @param city City name. 50 characters max.
* @param state 2-letter code for US states, and the equivalent for other countries. 100 characters max. Required in certain countries.
* @param postalCode ZIP code or equivalent is usually required for countries that have them. 20 characters max. Required in certain countries.
* @param countryCode 2-letter country code. 2 characters max.
*/
constructor(recipientName: string, line1: string, line2: string, city: string, state: string, postalCode: string, countryCode: string);
/**
* Name of the recipient at this address. 50 characters max.
*/
recipientName: string;
/**
* Line 1 of the address (e.g., Number, street, etc). 100 characters max.
*/
line1: string;
/**
* Line 2 of the address (e.g., Suite, apt #, etc). 100 characters max. Optional.
*/
line2: string;
/**
* City name. 50 characters max.
*/
city: string;
/**
* 2-letter code for US states, and the equivalent for other countries. 100 characters max. Required in certain countries.
*/
state: string;
/**
* ZIP code or equivalent is usually required for countries that have them. 20 characters max. Required in certain countries.
*/
postalCode: string;
/**
* 2-letter country code. 2 characters max.
*/
countryCode: string;
}
declare class PayPalConfiguration {
/**
* @param options A set of options to use. Any options not specified will assume default values.
*/
constructor(options?: PayPalConfigurationOptions);
/**
* Will be overridden by email used in most recent PayPal login.
*/
defaultUserEmail: string;
/**
* Will be overridden by phone country code used in most recent PayPal login
*/
defaultUserPhoneCountryCode: string;
/**
* Will be overridden by phone number used in most recent PayPal login.
* @note If you set defaultUserPhoneNumber, be sure to also set defaultUserPhoneCountryCode.
*/
defaultUserPhoneNumber: string;
/**
* Your company name, as it should be displayed to the user
* when requesting consent via a PayPalFuturePaymentViewController.
*/
merchantName: string;
/**
* URL of your company's privacy policy, which will be offered to the user
* when requesting consent via a PayPalFuturePaymentViewController.
*/
merchantPrivacyPolicyURL: string;
/**
* URL of your company's user agreement, which will be offered to the user
* when requesting consent via a PayPalFuturePaymentViewController.
*/
merchantUserAgreementURL: string;
/**
* If set to false, the SDK will only support paying with PayPal, not with credit cards.
* This applies only to single payments (via PayPalPaymentViewController).
* Future payments (via PayPalFuturePaymentViewController) always use PayPal.
* Defaults to true.
*/
acceptCreditCards: boolean;
/**
* For single payments, options for the shipping address.
*
* - 0 - PayPalShippingAddressOptionNone: no shipping address applies.
*
* - 1 - PayPalShippingAddressOptionProvided: shipping address will be provided by your app,
* in the shippingAddress property of PayPalPayment.
*
* - 2 - PayPalShippingAddressOptionPayPal: user will choose from shipping addresses on file
* for their PayPal account.
*
* - 3 - PayPalShippingAddressOptionBoth: user will choose from the shipping address provided by your app,
* in the shippingAddress property of PayPalPayment, plus the shipping addresses on file for the user's PayPal account.
*
* Defaults to 0 (PayPalShippingAddressOptionNone).
*/
payPalShippingAddressOption: number;
/**
* If set to true, then if the user pays via their PayPal account,
* the SDK will remember the user's PayPal username or phone number;
* if the user pays via their credit card, then the SDK will remember
* the PayPal Vault token representing the user's credit card.
*
* If set to false, then any previously-remembered username, phone number, or
* credit card token will be erased, and subsequent payment information will
* not be remembered.
*
* Defaults to true.
*/
rememberUser: boolean;
/**
* If not set, or if set to nil, defaults to the device's current language setting.
*
* Can be specified as a language code ("en", "fr", "zh-Hans", etc.) or as a locale ("en_AU", "fr_FR", "zh-Hant_HK", etc.).
* If the library does not contain localized strings for a specified locale, then will fall back to the language. E.g., "es_CO" -> "es".
* If the library does not contain localized strings for a specified language, then will fall back to American English.
*
* If you specify only a language code, and that code matches the device's currently preferred language,
* then the library will attempt to use the device's current region as well.
* E.g., specifying "en" on a device set to "English" and "United Kingdom" will result in "en_GB".
*
* These localizations are currently included:
* da,de,en,en_AU,en_GB,en_SV,es,es_MX,fr,he,it,ja,ko,nb,nl,pl,pt,pt_BR,ru,sv,tr,zh-Hans,zh-Hant_HK,zh-Hant_TW.
*/
languageOrLocale: string;
/**
* Normally, the SDK blurs the screen when the app is backgrounded,
* to obscure credit card or PayPal account details in the iOS-saved screenshot.
* If your app already does its own blurring upon backgrounding, you might choose to disable this.
* Defaults to false.
*/
disableBlurWhenBackgrounding: boolean;
/**
* If you will present the SDK's view controller within a popover, then set this property to true.
* Defaults to false. (iOS only)
*/
presentingInPopover: boolean;
/**
* Sandbox credentials can be difficult to type on a mobile device. Setting this flag to true will
* cause the sandboxUserPassword and sandboxUserPin to always be pre-populated into login fields.
*
* This setting will have no effect if the operation mode is production.
* Defaults to false.
*/
forceDefaultsInSandbox: boolean;
/**
* Password to use for sandbox if 'forceDefaultsInSandbox' is set.
*/
sandboxUserPassword: string;
/**
* PIN to use for sandbox if 'forceDefaultsInSandbox' is set.
*/
sandboxUserPin: string;
}
/**
* Describes the options that can be passed into the PayPalConfiguration class constructor.
*/
interface PayPalConfigurationOptions {
/**
* Will be overridden by email used in most recent PayPal login.
*/
defaultUserEmail?: string;
/**
* Will be overridden by phone country code used in most recent PayPal login
*/
defaultUserPhoneCountryCode?: string;
/**
* Will be overridden by phone number used in most recent PayPal login.
* @note If you set defaultUserPhoneNumber, be sure to also set defaultUserPhoneCountryCode.
*/
defaultUserPhoneNumber?: string;
/**
* Your company name, as it should be displayed to the user
* when requesting consent via a PayPalFuturePaymentViewController.
*/
merchantName?: string;
/**
* URL of your company's privacy policy, which will be offered to the user
* when requesting consent via a PayPalFuturePaymentViewController.
*/
merchantPrivacyPolicyURL?: string;
/**
* URL of your company's user agreement, which will be offered to the user
* when requesting consent via a PayPalFuturePaymentViewController.
*/
merchantUserAgreementURL?: string;
/**
* If set to false, the SDK will only support paying with PayPal, not with credit cards.
* This applies only to single payments (via PayPalPaymentViewController).
* Future payments (via PayPalFuturePaymentViewController) always use PayPal.
* Defaults to true.
*/
acceptCreditCards?: boolean;
/**
* For single payments, options for the shipping address.
*
* - 0 - PayPalShippingAddressOptionNone?: no shipping address applies.
*
* - 1 - PayPalShippingAddressOptionProvided?: shipping address will be provided by your app,
* in the shippingAddress property of PayPalPayment.
*
* - 2 - PayPalShippingAddressOptionPayPal?: user will choose from shipping addresses on file
* for their PayPal account.
*
* - 3 - PayPalShippingAddressOptionBoth?: user will choose from the shipping address provided by your app,
* in the shippingAddress property of PayPalPayment, plus the shipping addresses on file for the user's PayPal account.
*
* Defaults to 0 (PayPalShippingAddressOptionNone).
*/
payPalShippingAddressOption?: number;
/**
* If set to true, then if the user pays via their PayPal account,
* the SDK will remember the user's PayPal username or phone number;
* if the user pays via their credit card, then the SDK will remember
* the PayPal Vault token representing the user's credit card.
*
* If set to false, then any previously-remembered username, phone number, or
* credit card token will be erased, and subsequent payment information will
* not be remembered.
*
* Defaults to true.
*/
rememberUser?: boolean;
/**
* If not set, or if set to nil, defaults to the device's current language setting.
*
* Can be specified as a language code ("en", "fr", "zh-Hans", etc.) or as a locale ("en_AU", "fr_FR", "zh-Hant_HK", etc.).
* If the library does not contain localized strings for a specified locale, then will fall back to the language. E.g., "es_CO" -> "es".
* If the library does not contain localized strings for a specified language, then will fall back to American English.
*
* If you specify only a language code, and that code matches the device's currently preferred language,
* then the library will attempt to use the device's current region as well.
* E.g., specifying "en" on a device set to "English" and "United Kingdom" will result in "en_GB".
*
* These localizations are currently included:
* da,de,en,en_AU,en_GB,en_SV,es,es_MX,fr,he,it,ja,ko,nb,nl,pl,pt,pt_BR,ru,sv,tr,zh-Hans,zh-Hant_HK,zh-Hant_TW.
*/
languageOrLocale?: string;
/**
* Normally, the SDK blurs the screen when the app is backgrounded,
* to obscure credit card or PayPal account details in the iOS-saved screenshot.
* If your app already does its own blurring upon backgrounding, you might choose to disable this.
* Defaults to false.
*/
disableBlurWhenBackgrounding?: boolean;
/**
* If you will present the SDK's view controller within a popover, then set this property to true.
* Defaults to false. (iOS only)
*/
presentingInPopover?: boolean;
/**
* Sandbox credentials can be difficult to type on a mobile device. Setting this flag to true will
* cause the sandboxUserPassword and sandboxUserPin to always be pre-populated into login fields.
*
* This setting will have no effect if the operation mode is production.
* Defaults to false.
*/
forceDefaultsInSandbox?: boolean;
/**
* Password to use for sandbox if 'forceDefaultsInSandbox' is set.
*/
sandboxUserPassword?: string;
/**
* PIN to use for sandbox if 'forceDefaultsInSandbox' is set.
*/
sandboxUserPin?: string;
}
//#endregion
//#region cdv-plugin-paypal-mobile-sdk.js
declare module PayPalCordovaPlugin {
export interface PayPalClientIds {
PayPalEnvironmentProduction: string;
PayPalEnvironmentSandbox: string;
}
/**
* Represents the portion of an object that is common to all responses.
*/
export interface BaseResult {
client: Client;
response_type: string;
}
/**
* Represents the client portion of the response.
*/
export interface Client {
paypal_sdk_version: string;
environment: string;
platform: string;
product_name: string;
}
/**
* Represents the response for a successful callback from renderSinglePaymentUI().
*/
export interface SinglePaymentResult extends BaseResult {
response: {
intent: string;
id: string;
state: string;
authorization_id: string;
create_time: string;
};
}
/**
* Represents the response for a successful callback from renderFuturePaymentUI().
*/
export interface FuturePaymentResult extends BaseResult {
response: {
code: string;
};
}
export interface PayPalMobileStatic {
/**
* Retrieve the version of the PayPal iOS SDK library. Useful when contacting support.
*
* @param completionCallback a callback function accepting a string
*/
version(completionCallback: (result: string) => void): void;
/**
* You MUST call this method to initialize the PayPal Mobile SDK.
*
* The PayPal Mobile SDK can operate in different environments to facilitate development and testing.
*
* @param clientIdsForEnvironments set of client ids for environments
* Example: var clientIdsForEnvironments = {
* PayPalEnvironmentProduction : @"my-client-id-for-Production",
* PayPalEnvironmentSandbox : @"my-client-id-for-Sandbox"
* }
* @param completionCallback a callback function on success
*/
init(clientIdsForEnvironments: PayPalCordovaPlugin.PayPalClientIds, completionCallback: () => void): void;
/**
* You must preconnect to PayPal to prepare the device for processing payments.
* This improves the user experience, by making the presentation of the
* UI faster. The preconnect is valid for a limited time, so
* the recommended time to preconnect is on page load.
*
* @param environment available options are "PayPalEnvironmentNoNetwork", "PayPalEnvironmentProduction" and "PayPalEnvironmentSandbox"
* @param configuration PayPalConfiguration object, for Future Payments merchantName, merchantPrivacyPolicyURL
* and merchantUserAgreementURL must be set be set
* @param completionCallback a callback function on success
*/
prepareToRender(environment: string, configuration: PayPalConfiguration, completionCallback: () => void): void;
/**
* Start PayPal UI to collect payment from the user.
* See https://developer.paypal.com/webapps/developer/docs/integration/mobile/ios-integration-guide/
* for more documentation of the params.
*
* @param payment PayPalPayment object
* @param completionCallback a callback function accepting a js object, called when the user has completed payment
* @param cancelCallback a callback function accepting a reason string, called when the user cancels the payment
*/
renderSinglePaymentUI(payment: PayPalPayment, completionCallback: (result: PayPalCordovaPlugin.SinglePaymentResult) => void, cancelCallback: (cancelReason: string) => void): void;
/**
* @deprecated
* Once a user has consented to future payments, when the user subsequently initiates a PayPal payment
* from their device to be completed by your server, PayPal uses a Correlation ID to verify that the
* payment is originating from a valid, user-consented device+application.
* This helps reduce fraud and decrease declines.
* This method MUST be called prior to initiating a pre-consented payment (a "future payment") from a mobile device.
* Pass the result to your server, to include in the payment request sent to PayPal.
* Do not otherwise cache or store this value.
*
* @param environment available options are "PayPalEnvironmentNoNetwork", "PayPalEnvironmentProduction" and "PayPalEnvironmentSandbox"
* @param callback applicationCorrelationID Your server will send this to PayPal in a 'Paypal-Application-Correlation-Id' header.
*/
applicationCorrelationIDForEnvironment(environment: string, completionCallback: (applicationCorrelationId: string) => void): void;
/**
* Once a user has consented to future payments, when the user subsequently initiates a PayPal payment
* from their device to be completed by your server, PayPal uses a Correlation ID to verify that the
* payment is originating from a valid, user-consented device+application.
* This helps reduce fraud and decrease declines.
* This method MUST be called prior to initiating a pre-consented payment (a "future payment") from a mobile device.
* Pass the result to your server, to include in the payment request sent to PayPal.
* Do not otherwise cache or store this value.
*
* @param callback clientMetadataID Your server will send this to PayPal in a 'PayPal-Client-Metadata-Id' header.
*/
clientMetadataID(completionCallback: (clientMetadataId: string) => void): void;
/**
* Please Read Docs on Future Payments at https://github.com/paypal/PayPal-iOS-SDK#future-payments
*
* @param completionCallback a callback function accepting a js object with future payment authorization
* @param cancelCallback a callback function accepting a reason string, called when the user canceled without agreement
*/
renderFuturePaymentUI(completionCallback: (result: PayPalCordovaPlugin.FuturePaymentResult) => void, cancelCallback: (cancelReason: string) => void): void;
/**
* Please Read Docs on Profile Sharing at https://github.com/paypal/PayPal-iOS-SDK#profile-sharing
*
* @param scopes scopes Set of requested scope-values. Accepted scopes are: openid, profile, address, email, phone, futurepayments and paypalattributes
* See https://developer.paypal.com/docs/integration/direct/identity/attributes/ for more details
* @param completionCallback a callback function accepting a js object with future payment authorization
* @param cancelCallback a callback function accepting a reason string, called when the user canceled without agreement
*/
renderProfileSharingUI(scopes: string[], completionCallback: (result: any) => void, cancelCallback: (cancelReason: string) => void): void;
}
}
declare var PayPalMobile: PayPalCordovaPlugin.PayPalMobileStatic;
//#endregion

View File

@ -1 +0,0 @@

21
amqplib/amqplib-tests.ts Normal file
View File

@ -0,0 +1,21 @@
/// <reference path="amqplib.d.ts" />
import amqp = require("amqplib");
var msg = "Hello World";
amqp.connect("amqp://localhost")
.then(connection => {
return connection.createChannel()
.tap(channel => channel.checkQueue("myQueue"))
.then(channel => channel.sendToQueue("myQueue", new Buffer(msg)))
.ensure(() => connection.close());
});
amqp.connect("amqp://localhost")
.then(connection => {
return connection.createChannel()
.tap(channel => channel.checkQueue("myQueue"))
.then(channel => channel.consume("myQueue", newMsg => console.log("New Message: " + newMsg.content.toString())))
.ensure(() => connection.close());
});

144
amqplib/amqplib.d.ts vendored Normal file
View File

@ -0,0 +1,144 @@
// Type definitions for amqplib 0.3.x
// Project: https://github.com/squaremo/amqp.node
// Definitions by: Michael Nahkies <https://github.com/mnahkies>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../when/when.d.ts" />
/// <reference path="../node/node.d.ts" />
declare module "amqplib" {
import events = require("events");
import when = require("when");
interface Connection extends events.EventEmitter {
close(): when.Promise<void>;
createChannel(): when.Promise<Channel>;
createConfirmChannel(): when.Promise<Channel>;
}
module Replies {
interface Empty {
}
interface AssertQueue {
queue: string;
messageCount: number;
consumerCount: number;
}
interface DeleteQueue {
messageCount: number;
}
interface AssertExchange {
exchange: string;
}
interface Consume {
consumerTag: string;
}
}
module Options {
interface AssertQueue {
exclusive?: boolean;
durable?: boolean;
autoDelete?: boolean;
arguments?: any;
messageTtl?: number;
expires?: number;
deadLetterExchange?: string;
maxLength?: number;
}
interface DeleteQueue {
ifUnused?: boolean;
ifEmpty?: boolean;
}
interface AssertExchange {
durable?: boolean;
internal?: boolean;
autoDelete?: boolean;
alternateExchange?: string;
arguments?: any;
}
interface DeleteExchange {
ifUnused?: boolean;
}
interface Publish {
expiration?: string;
userId?: string;
CC?: string | string[];
mandatory?: boolean;
persistent?: boolean;
deliveryMode?: boolean | number;
BCC?: string | string[];
contentType?: string;
contentEncoding?: string;
headers?: Object;
priority?: number;
correlationId?: string;
replyTo?: string;
messageId?: string;
timestamp?: number;
type?: string;
appId?: string;
}
interface Consume {
consumerTag?: string;
noLocal?: boolean;
noAck?: boolean;
exclusive?: boolean;
priority?: number;
arguments?: Object;
}
interface Get {
noAck?: boolean;
}
}
interface Message {
content: Buffer;
fields: Object;
properties: Object;
}
interface Channel extends events.EventEmitter {
close(): when.Promise<void>;
assertQueue(queue: string, options?: Options.AssertQueue): when.Promise<Replies.AssertQueue>;
checkQueue(queue: string): when.Promise<Replies.AssertQueue>;
deleteQueue(queue: string, options?: Options.DeleteQueue): when.Promise<Replies.DeleteQueue>;
purgeQueue(queue: string): when.Promise<Replies.DeleteQueue>;
bindQueue(queue: string, source: string, pattern: string, args?: any): when.Promise<Replies.Empty>;
unbindQueue(queue: string, source: string, pattern: string, args?: any): when.Promise<Replies.Empty>;
assertExchange(exchange: string, type: string, options?: Options.AssertExchange): when.Promise<Replies.AssertExchange>;
checkExchange(exchange: string): when.Promise<Replies.Empty>;
deleteExchange(exchange: string, options?: Options.DeleteExchange): when.Promise<Replies.Empty>;
bindExchange(destination: string, source: string, pattern: string, args?: any): when.Promise<Replies.Empty>;
unbindExchange(destination: string, source: string, pattern: string, args?: any): when.Promise<Replies.Empty>;
publish(exchange: string, routingKey: string, content: Buffer, options?: Options.Publish): boolean;
sendToQueue(queue: string, content: Buffer, options?: Options.Publish): boolean;
consume(queue: string, onMessage: (msg: Message) => any, options?: Options.Consume): when.Promise<Replies.Consume>;
cancel(consumerTag: string): when.Promise<Replies.Empty>;
get(queue: string, options?: Options.Get): when.Promise<Message | boolean>;
ack(message: Message, allUpTo?: boolean): void;
ackAll(): void;
nack(message: Message, allUpTo?: boolean, requeue?: boolean): void;
nackAll(requeue?: boolean): void;
reject(message: Message, requeue?: boolean): void;
prefetch(count: number, global?: boolean): when.Promise<Replies.Empty>;
recover(): when.Promise<Replies.Empty>;
}
function connect(url: string, socketOptions?: any): when.Promise<Connection>;
}

View File

@ -3,30 +3,6 @@
// Definitions by: John Reilly <https://github.com/johnnyreilly>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
/// <reference path="../ng-file-upload/ng-file-upload.d.ts" />
declare module angular.angularFileUpload {
interface IUploadService {
http<T>(config: IRequestConfig): IUploadPromise<T>;
upload<T>(config: IFileUploadConfig): IUploadPromise<T>;
}
interface IUploadPromise<T> extends IHttpPromise<T> {
abort(): IUploadPromise<T>;
progress(callback: IHttpPromiseCallback<T>): IUploadPromise<T>;
xhr(callback: IHttpPromiseCallback<T>): IUploadPromise<T>;
}
interface IFileUploadConfig extends IRequestConfig {
file: File;
fileName?: string;
}
interface IFileProgressEvent extends ProgressEvent {
config: IFileUploadConfig;
}
}
// THIS FILE WILL REMOVE IF angular-file-upload.d.ts incoming.

View File

@ -124,3 +124,18 @@ $localForage.iterate(function (value, key) {
}
}).then(function (data) {
});
$localForage.bind($rootScope, 'key').then(function(data) {
});
$localForage.bind($rootScope, {key: 'key'}).then(function(data) {
});
$localForage.bind($rootScope, {key: 'key', defaultValue: 'defaultValue'}).then(function(data) {
});
$localForage.bind($rootScope, {key: 'key', scopeKey: 'scopeKey'}).then(function(data) {
});
$localForage.bind($rootScope, {key: 'key', name: 'name'}).then(function(data) {
});

View File

@ -46,14 +46,14 @@ declare module angular.localForage {
iterate<T>(iteratorCallback:(value:string | number, key:string)=>T):angular.IPromise<T>;
bind($scope:ng.IScope, key:string):void;
bind($scope:ng.IScope, key:string):angular.IPromise<any>;
bind($scope:ng.IScope, config:{
key:string;
defaultValue:any;
scopeKey:string;
name:string;
}):void;
defaultValue?:any;
scopeKey?:string;
name?:string;
}):angular.IPromise<any>;
unbind($scope:ng.IScope, key:string, scopeKey?:string):void;

View File

@ -122,6 +122,7 @@ declare module angular.material {
theme(theme: string): T;
hideDelay(delay: number): T;
position(position: string): T;
parent(parent?: string|Element|JQuery): T; // default: root node
}
interface ISimpleToastPreset extends IToastPreset<ISimpleToastPreset> {

View File

@ -0,0 +1,77 @@
/// <reference path='angular-signalr-hub.d.ts' />
/// <reference path='../angularjs/angular.d.ts' />
angular
.module('app', ['SignalR'])
.factory('Employees', ngSignalrTest.EmployeesFactory);
module ngSignalrTest {
export class EmployeesFactory {
static $inject = ['$rootScope', 'Hub', '$timeout'];
private hub: ngSignalr.Hub;
public all: Array<Employee>;
constructor($rootScope: ng.IRootScopeService, Hub: ngSignalr.HubFactory, $timeout: ng.ITimeoutService) {
// declaring the hub connection
this.hub = new Hub('employee', {
// client-side methods
listeners: {
'lockEmployee': (id: number) => {
var employee = this.find(id);
employee.Locked = true;
$rootScope.$apply();
},
'unlockEmployee': (id: number) => {
var employee = this.find(id);
employee.Locked = false;
$rootScope.$apply();
}
},
// server-side methods
methods: ['lock', 'unlock'],
// query params sent on initial connection
queryParams:{
'token': 'exampletoken'
},
// handle connection error
errorHandler: (message: string) => {
console.error(message);
},
stateChanged: (state: SignalRStateChange) => {
// your code here
}
});
}
private find(id: number) {
for (var i = 0; i < this.all.length; i++) {
if (this.all[i].Id === id) return this.all[i];
}
return null;
}
public edit = (employee: Employee) => {
employee.Edit = true;
this.hub.invoke('lock', employee.Id);
};
public done = (employee: Employee) => {
employee.Edit = false;
this.hub.invoke('unlock', employee.Id);
}
}
interface Employee {
Id: number;
Name: string;
Email: string;
Salary: number;
Edit: boolean;
Locked: boolean;
}
}

View File

@ -0,0 +1,73 @@
// Type definitions for angular-signalr-hub v1.5.0
// Project: https://github.com/JustMaier/angular-signalr-hub
// Definitions by: Adam Santaniello <https://github.com/AdamSantaniello>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path='../signalr/signalr.d.ts' />
declare module ngSignalr {
interface HubFactory {
/**
* Creates a new Hub connection
*/
new(hubName: string, options: HubOptions) : Hub
}
class Hub {
hubName: string;
connection: SignalR;
proxy: HubProxy;
on(event: string, fn: ((...args: any[]) => void)): void;
invoke(method: string, ...args: any[]): JQueryDeferred<any>;
disconnect(): void;
connect(): JQueryPromise<any>;
}
interface HubOptions {
/**
* Collection of client side callbacks
*/
listeners?: { [index: string] : (...args: any[]) => void };
/**
* String array of server side methods which the client can call
*/
methods?: Array<string>;
/**
* Sets the root path for the SignalR web service
*/
rootPath?: string;
/**
* Object representing additional query params to be sent on connection
*/
queryParams?: { [index: string] : string };
/**
* Function to handle hub connection errors
*/
errorHandler?: (error: string) => void;
/**
* Enable/disable logging
*/
logging?: boolean;
/**
* Use a shared global connection or create a new one just for this hub, defaults to true
*/
useSharedConnection?: boolean;
/**
* Sets transport method (e.g 'longPolling' or ['webSockets', 'longPolling'] )
*/
transport?: any;
/**
* Function to handle hub connection state changed event
*/
stateChanged?: (state: SignalRStateChange) => void;
}
}

View File

@ -0,0 +1,76 @@
/// <reference path="angular-toasty.d.ts" />
interface AngularToastyTestControllerScope extends ng.IScope {
button:string;
options:toasty.IToastyConfig;
runToasts(): void;
runQuickToasts(): void;
newToast(): void;
clearToasts(): void;
}
class AngularToastyTestController {
static $inject = ['$scope', 'toasty'];
constructor($scope:AngularToastyTestControllerScope, toasty:toasty.IToastyService) {
var options: toasty.IToastyConfig = {
title: 'Toast It!',
msg: 'Mmmm, tasties...',
showClose: true,
clickToClose: false,
timeout: 5000,
sound: true,
html: false,
shake: false,
theme: 'bootstrap',
onAdd: function () {
console.log('Toasty ' + this.id + ' has been added!', this);
},
onRemove: function () {
console.log('Toasty ' + this.id + ' has been removed!', this);
},
onClick: function () {
console.log('Toasty ' + this.id + ' has been clicked!', this);
}
};
$scope.runToasts = function () {
toasty(options);
toasty.default(options);
toasty.info(options);
toasty.success(options);
toasty.wait(options);
toasty.error(options);
toasty.warning(options);
};
$scope.runQuickToasts = function () {
var title = 'Toast it!'
toasty(title);
toasty.default(title);
toasty.info(title);
toasty.success(title);
toasty.wait(title);
toasty.error(title);
toasty.warning(title);
};
$scope.clearToasts = function () {
toasty.clear();
};
}
};
angular
.module('main', ['angular-toasty'])
.config(['toastyConfigProvider', (toastyConfigProvider:toasty.IToastyConfigProvider) => {
toastyConfigProvider.setConfig({
title: 'global',
limit: 10,
sound: false,
shake: true
});
}])
.controller('MainController', AngularToastyTestController);

251
angular-toasty/angular-toasty.d.ts vendored Normal file
View File

@ -0,0 +1,251 @@
// Type definitions for Angular Toasty v1.0.2
// Project: https://github.com/invertase/angular-toasty
// Definitions by: Dominik Muench <https://github.com/muenchdo>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare module toasty {
interface IToastyService {
/**
* Create a toast with the given options and type.
* @param options
* @param type
*/
(options: IToastyConfig, type?: string): void;
/**
* Create a default "quick toast" with the given title.
* @param title
*/
(title: string|number): void;
/**
* Create a default toast with the given options.
* @param options
*/
default(options: IToastyConfig): void;
/**
* Create a default "quick toast" with the given title.
* @param title
*/
default(title: string|number): void;
/**
* Create an info toast with the given options.
* @param options
*/
info(options: IToastyConfig): void;
/**
* Create an info "quick toast" with the given title.
* @param title
*/
info(title: string|number): void;
/**
* Create a wait toast with the given options.
* @param options
*/
wait(options: IToastyConfig): void;
/**
* Create a wait "quick toast" with the given title.
* @param title
*/
wait(title: string|number): void;
/**
* Create a success toast with the given options.
* @param options
*/
success(options: IToastyConfig): void;
/**
* Create a success "quick toast" with the given title.
* @param title
*/
success(title: string|number): void;
/**
* Create an error toast with the given options.
* @param options
*/
error(options: IToastyConfig): void;
/**
* Create an error "quick toast" with the given title.
* @param title
*/
error(title: string|number): void;
/**
* Create a warning toast with the given options.
* @param options
*/
warning(options: IToastyConfig): void;
/**
* Create a warning "quick toast" with the given title.
* @param title
*/
warning(title: string|number): void;
/**
* Clear toast(s).
* @param id Optional ID to clear a specific toast.
*/
clear(id?: number): void;
/**
* Get the global config.
*/
getGlobalConfig(): IGlobalConfig;
}
interface IToastyConfig {
/**
* The toast's title.
*/
title: string;
/**
* The toast's message.
*/
msg?: string;
/**
* Whether to show the 'X' icon to close the toast.
*/
showClose?: boolean;
/**
* Whether clicking the toast closes it.
*/
clickToClose?: boolean;
/**
* How long (in milliseconds) the toast shows before it's removed. Set to false to disable.
*/
timeout?: number;
/**
* Whether to play a sound when a toast is added.
*/
sound?: boolean;
/**
* Whether HTML is allowed in toasts.
*/
html?: boolean;
/**
* Whether to shake the toasts.
*/
shake?: boolean;
/**
* What theme to use.
* - 'default'
* - 'material'
* - 'bootstrap'
*/
theme?: string;
/**
* The toast's type:
* - 'default'
* - 'info'
* - 'success'
* - 'wait'
* - 'error'
* - 'warning'
*/
type?: string;
/**
* Add event handler.
*/
onAdd?: Function;
/**
* Remove event handler.
*/
onRemove?: Function;
/**
* Click event handler.
*/
onClick?: Function;
}
interface IGlobalConfig {
/**
* Maximum number of toasts to show at once.
*/
limit?: number;
/**
* The toast's title.
*/
title?: string;
/**
* The toast's message.
*/
msg?: string;
/**
* Whether to show the 'X' icon to close the toast.
*/
showClose?: boolean;
/**
* Whether clicking the toast closes it.
*/
clickToClose?: boolean;
/**
* The window position where the toast pops up.
*
*/
position?: string;
/**
* How long (in miliseconds) the toast shows before it's removed. Set to false to disable.
*/
timeout?: number|boolean;
/**
* Whether to play a sound when a toast is added.
*/
sound?: boolean;
/**
* Whether HTML is allowed in toast.
*/
html?: boolean;
/**
* Whether to shake the toast.
*/
shake?: boolean;
/**
* What theme to use.
* - 'default'
* - 'material'
* - 'bootstrap'
*/
theme?: string;
}
interface IToastyConfigProvider {
setConfig(override: IGlobalConfig): void;
$get(): IGlobalConfig;
}
}

View File

@ -13,7 +13,7 @@ declare module "angular-translate" {
declare module angular.translate {
interface ITranslationTable {
[key: string]: string;
[key: string]: any;
}
interface ILanguageKeyAlias {

View File

@ -31,18 +31,23 @@ testApp.config((
/**
* $datepickerConfig tests
*/
$datepickerConfig.dayFormat = 'd';
$datepickerConfig.dayHeaderFormat = 'E';
$datepickerConfig.dayTitleFormat = 'dd-MM-yyyy';
$datepickerConfig.datepickerMode = 'month';
$datepickerConfig.formatDay = 'd';
$datepickerConfig.formatDayHeader = 'E';
$datepickerConfig.formatDayTitle = 'dd-MM-yyyy';
$datepickerConfig.formatMonth = 'M';
$datepickerConfig.formatMonthTitle = 'yy';
$datepickerConfig.formatYear = 'y';
$datepickerConfig.maxDate = '1389586124979';
$datepickerConfig.maxMode = 'month';
$datepickerConfig.minDate = '1389586124979';
$datepickerConfig.monthFormat = 'M';
$datepickerConfig.monthTitleFormat = 'yy';
$datepickerConfig.minMode = 'month';
$datepickerConfig.shortcutPropagation = true;
$datepickerConfig.showWeeks = false;
$datepickerConfig.startingDay = 1;
$datepickerConfig.yearFormat = 'y';
$datepickerConfig.yearRange = 10;
$datepickerConfig.shortcutPropagation = true;
/**
@ -53,9 +58,12 @@ testApp.config((
$datepickerPopupConfig.clearText = 'Reset Selection';
$datepickerPopupConfig.closeOnDateSelection = false;
$datepickerPopupConfig.closeText = 'Finished';
$datepickerPopupConfig.dateFormat = 'dd-MM-yyyy';
$datepickerPopupConfig.datepickerPopup = 'dd-MM-yyyy';
$datepickerPopupConfig.datepickerPopupTemplateUrl = 'template.html';
$datepickerPopupConfig.datepickerTemplateUrl = 'template.html';
$datepickerPopupConfig.html5Types.date = 'MM-dd-yyyy';
$datepickerPopupConfig.onOpenFocus = false;
$datepickerPopupConfig.showButtonBar = false;
$datepickerPopupConfig.toggleWeeksText = 'Show Weeks';
/**
@ -72,9 +80,13 @@ testApp.config((
$paginationConfig.firstText = 'First Page';
$paginationConfig.itemsPerPage = 25;
$paginationConfig.lastText = 'Last Page';
$paginationConfig.maxSize = 13;
$paginationConfig.numPages = 13;
$paginationConfig.nextText = 'Next Page';
$paginationConfig.previousText = 'Previous Page';
$paginationConfig.rotate = false;
$paginationConfig.templateUrl = 'template.html';
$paginationConfig.totalItems = 13;
/**
@ -121,7 +133,8 @@ testApp.config((
placement: 'bottom',
animation: false,
popupDelay: 1000,
appendToBody: true
appendToBody: true,
trigger: 'mouseenter hover',
useContentExp: true
});
$tooltipProvider.setTriggers({
@ -148,6 +161,7 @@ testApp.controller('TestCtrl', (
controller: 'ModalTestCtrl',
controllerAs: 'vm',
keyboard: true,
openedClass: 'modal-open my-modal',
resolve: {
items: ()=> {
return [1, 2, 3, 4, 5];

View File

@ -1,4 +1,4 @@
// Type definitions for Angular UI Bootstrap 0.13.2
// Type definitions for Angular UI Bootstrap 0.13.3
// Project: https://github.com/angular-ui/bootstrap
// Definitions by: Brian Surowiec <https://github.com/xt0rted>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@ -36,42 +36,63 @@ declare module angular.ui.bootstrap {
*
* @default 'dd'
*/
dayFormat?: string;
formatDay?: string;
/**
* Format of month in year.
*
* @default 'MMM'
*/
monthFormat?: string;
formatMonth?: string;
/**
* Format of year in year range.
*
* @default 'yyyy'
*/
yearFormat?: string;
formatYear?: string;
/**
* Format of day in week header.
*
* @default 'EEE'
*/
dayHeaderFormat?: string;
formatDayHeader?: string;
/**
* Format of title when selecting day.
*
* @default 'MMM yyyy'
*/
dayTitleFormat?: string;
formatDayTitle?: string;
/**
* Format of title when selecting month.
*
* @default 'yyyy'
*/
monthTitleFormat?: string;
formatMonthTitle?: string;
/**
* Current mode of the datepicker (day|month|year). Can be used to initialize datepicker to specific mode.
*
* @default 'day'
*/
datepickerMode?: string;
/**
* Set a lower limit for mode.
*
* @default 'day'
*/
minMode?: string;
/**
* Set an upper limit for mode.
*
* @default 'year'
*/
maxMode?: string;
/**
* Whether to display week numbers.
@ -122,7 +143,30 @@ declare module angular.ui.bootstrap {
*
* @default 'yyyy-MM-dd'
*/
dateFormat?: string;
datepickerPopup?: string;
/**
* Allows overriding of default template of the popup.
*
* @default 'template/datepicker/popup.html'
*/
datepickerPopupTemplateUrl?: string;
/**
* Allows overriding of default template of the datepicker used in popup.
*
* @default 'template/datepicker/popup.html'
*/
datepickerTemplateUrl?: string;
/**
* Allows overriding of the default format for html5 date inputs.
*/
html5Types?: {
date?: string;
'datetime-local'?: string;
month?: string;
};
/**
* The text to display for the current day button.
@ -131,13 +175,6 @@ declare module angular.ui.bootstrap {
*/
currentText?: string;
/**
* The text to display for the toggling week numbers button.
*
* @default 'Weeks'
*/
toggleWeeksText?: string;
/**
* The text to display for the clear button.
*
@ -172,6 +209,13 @@ declare module angular.ui.bootstrap {
* @default true
*/
showButtonBar?: boolean;
/**
* Whether to focus the datepicker popup upon opening.
*
* @default true
*/
onOpenFocus?: boolean;
}
@ -318,6 +362,13 @@ declare module angular.ui.bootstrap {
* a path to a template overriding modal's window template
*/
windowTemplateUrl?: string;
/**
* The class added to the body element when the modal is opened.
*
* @default 'model-open'
*/
openedClass?: string;
}
interface IModalStackService {
@ -354,11 +405,6 @@ declare module angular.ui.bootstrap {
interface IPaginationConfig {
/**
* Current page number. First page is 1.
*/
page?: number;
/**
* Total number of items in all pages.
*/
@ -392,13 +438,6 @@ declare module angular.ui.bootstrap {
*/
rotate?: boolean;
/**
* An optional expression called when a page is selected having the page number as argument.
*
* @default null
*/
onSelectPage?(page: number): void;
/**
* Whether to display Previous / Next buttons.
*
@ -440,6 +479,13 @@ declare module angular.ui.bootstrap {
* @default 'Last'
*/
lastText?: string;
/**
* Override the template for the component with a custom provided template.
*
* @default 'template/pagination/pagination.html'
*/
templateUrl?: string;
}
interface IPagerConfig {
@ -450,16 +496,6 @@ declare module angular.ui.bootstrap {
*/
align?: boolean;
/**
* Current page number. First page is 1.
*/
page?: number;
/**
* Total number of items in all pages.
*/
totalItems?: number;
/**
* Maximum number of items per page. A value less than one indicates all items on one page.
*
@ -467,20 +503,6 @@ declare module angular.ui.bootstrap {
*/
itemsPerPage?: number;
/**
* An optional expression assigned the total number of pages to display.
*
* @default angular.noop
*/
numPages?: number;
/**
* An optional expression called when a page is selected having the page number as argument.
*
* @default null
*/
onSelectPage?(page: number): void;
/**
* Text for Previous button.
*
@ -654,7 +676,7 @@ declare module angular.ui.bootstrap {
appendToBody?: boolean;
/**
* Determines the default open triggers for tooltips and popovers
* What should trigger a show of the tooltip? Supports a space separated list of event names.
*
* @default 'mouseenter' for tooltip, 'click' for popover
*/

6564
angular2/angular2-2.0.0-alpha.34.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

568
angular2/angular2.d.ts vendored
View File

@ -1,4 +1,4 @@
// Type definitions for Angular v2.0.0-alpha.33
// Type definitions for Angular v2.0.0-alpha.34
// Project: http://angular.io/
// Definitions by: angular team <https://github.com/angular/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@ -20,12 +20,6 @@ interface Map<K,V> {}
interface StringMap<K,V> extends Map<K,V> {}
declare module ng {
type SetterFn = typeof Function;
type int = number;
interface Type extends Function {
new (...args: any[]): any;
}
// See https://github.com/Microsoft/TypeScript/issues/1168
class BaseException /* extends Error */ {
message: string;
@ -183,7 +177,7 @@ declare module ng {
* When a component is instantiated, Angular
* - creates a shadow DOM for the component.
* - loads the selected template into the shadow DOM.
* - creates all the injectable objects configured with `hostInjector` and `viewInjector`.
* - creates all the injectable objects configured with `bindings` and `viewBindings`.
*
* All template expressions and statements are then evaluated against the component instance.
*
@ -251,7 +245,7 @@ declare module ng {
*
* @Component({
* selector: 'greet',
* viewInjector: [
* viewBindings: [
* Greeter
* ]
* })
@ -264,7 +258,7 @@ declare module ng {
*
* ```
*/
viewInjector: List<any>;
viewBindings: List<any>;
}
@ -318,11 +312,9 @@ declare module ng {
*
* To inject other directives, declare the constructor parameter as:
* - `directive:DirectiveType`: a directive on the current element only
* - `@Ancestor() directive:DirectiveType`: any directive that matches the type between the current
* - `@Host() directive:DirectiveType`: any directive that matches the type between the current
* element and the
* Shadow DOM root. Current element is not included in the resolution, therefore even if it could
* resolve it, it will
* be ignored.
* Shadow DOM root.
* - `@Query(DirectiveType) query:QueryList<DirectiveType>`: A live collection of direct child
* directives.
* - `@QueryDescendants(DirectiveType) query:QueryList<DirectiveType>`: A live collection of any
@ -429,21 +421,19 @@ declare module ng {
* ### Injecting a directive from any ancestor elements
*
* Directives can inject other directives declared on any ancestor element (in the current Shadow
* DOM), i.e. on the
* parent element and its parents. By definition, a directive with an `@Ancestor` annotation does
* not attempt to
* resolve dependencies for the current element, even if this would satisfy the dependency.
*
* DOM), i.e. on the current element, the
* parent element, or its parents.
* ```
* @Directive({ selector: '[my-directive]' })
* class MyDirective {
* constructor(@Ancestor() dependency: Dependency) {
* constructor(@Host() dependency: Dependency) {
* expect(dependency.id).toEqual(2);
* }
* }
* ```
*
* `@Ancestor` checks the parent, as well as its parents recursively. If `dependency="2"` didn't
* `@Host` checks the current element, the parent, as well as its parents recursively. If
* `dependency="2"` didn't
* exist on the direct parent, this injection would
* have returned
* `dependency="1"`.
@ -982,7 +972,7 @@ declare module ng {
*
* @Directive({
* selector: 'greet',
* hostInjector: [
* bindings: [
* Greeter
* ]
* })
@ -995,7 +985,7 @@ declare module ng {
* }
* ```
*/
hostInjector: List<any>;
bindings: List<any>;
/**
@ -1078,7 +1068,7 @@ declare module ng {
/**
* Specifies an inline template for an angular component.
* Specifies a template URL for an angular component.
*
* NOTE: either `templateUrl` or `template` should be used, but not both.
*/
@ -1086,7 +1076,7 @@ declare module ng {
/**
* Specifies a template URL for an angular component.
* Specifies an inline template for an angular component.
*
* NOTE: either `templateUrl` or `template` should be used, but not both.
*/
@ -1132,8 +1122,9 @@ declare module ng {
/**
* Specify how the template and the styles should be encapsulated.
* The default is {@link ViewEncapsulation.EMULATED} if the view has styles,
* otherwise {@link ViewEncapsulation.NONE}.
* The default is {@link ViewEncapsulation#EMULATED `ViewEncapsulation.EMULATED`} if the view
* has styles,
* otherwise {@link ViewEncapsulation#NONE `ViewEncapsulation.NONE`}.
*/
encapsulation: ViewEncapsulation;
}
@ -1207,8 +1198,9 @@ declare module ng {
/**
* Defines lifecycle method [onAllChangesDone ] called when the bindings of all its children have
* been changed.
* Defines lifecycle method
* {@link annotations/LifeCycleEvent#onAllChangesDone `LifeCycleEvent.onAllChangesDone`}
* called when the bindings of all its children have been changed.
*/
interface OnAllChangesDone {
@ -1217,8 +1209,8 @@ declare module ng {
/**
* Defines lifecycle method [onChange] called after all of component's bound
* properties are updated.
* Defines lifecycle method {@link annotations/LifeCycleEvent#onChange `LifeCycleEvent.onChange`}
* called after all of component's bound properties are updated.
*/
interface OnChange {
@ -1227,7 +1219,8 @@ declare module ng {
/**
* Defines lifecycle method [onDestroy] called when a directive is being destroyed.
* Defines lifecycle method {@link annotations/LifeCycleEvent#onDestroy `LifeCycleEvent.onDestroy`}
* called when a directive is being destroyed.
*/
interface OnDestroy {
@ -1236,7 +1229,8 @@ declare module ng {
/**
* Defines lifecycle method [onInit] called when a directive is being checked the first time.
* Defines lifecycle method {@link annotations/LifeCycleEvent#onInit `LifeCycleEvent.onInit`}
* called when a directive is being checked the first time.
*/
interface OnInit {
@ -1245,7 +1239,8 @@ declare module ng {
/**
* Defines lifecycle method [onCheck] called when a directive is being checked.
* Defines lifecycle method {@link annotations/LifeCycleEvent#onCheck `LifeCycleEvent.onCheck`}
* called when a directive is being checked.
*/
interface OnCheck {
@ -1362,21 +1357,6 @@ declare module ng {
}
/**
* An interface implemented by all Angular parameter decorators, which allows them to be used as ES7
* decorators.
*/
interface ParameterDecorator {
/**
* Invoke as ES7 decorator.
*/
(cls: Type, unusedKey: any, index: number): void;
}
/**
* An interface implemented by all Angular type decorators, which allows them to be used as ES7
* decorators as well as
@ -1565,10 +1545,10 @@ declare module ng {
events?: List<string>,
host?: StringMap<string, string>,
lifecycle?: List<LifecycleEvent>,
hostInjector?: List<any>,
bindings?: List<any>,
exportAs?: string,
compileChildren?: boolean,
viewInjector?: List<any>,
viewBindings?: List<any>,
changeDetection?: string,
}): ComponentAnnotation;
@ -1579,10 +1559,10 @@ declare module ng {
events?: List<string>,
host?: StringMap<string, string>,
lifecycle?: List<LifecycleEvent>,
hostInjector?: List<any>,
bindings?: List<any>,
exportAs?: string,
compileChildren?: boolean,
viewInjector?: List<any>,
viewBindings?: List<any>,
changeDetection?: string,
}): ComponentDecorator;
@ -1648,15 +1628,15 @@ declare module ng {
new(obj: {
selector?: string, properties?: List<string>, events?: List<string>,
host?: StringMap<string, string>, lifecycle?: List<LifecycleEvent>,
hostInjector?: List<any>, exportAs?: string, compileChildren?: boolean;
host?: StringMap<string, string>, lifecycle?: List<LifecycleEvent>, bindings?: List<any>,
exportAs?: string, compileChildren?: boolean;
}): DirectiveAnnotation;
(obj: {
selector?: string, properties?: List<string>, events?: List<string>,
host?: StringMap<string, string>, lifecycle?: List<LifecycleEvent>,
hostInjector?: List<any>, exportAs?: string, compileChildren?: boolean;
host?: StringMap<string, string>, lifecycle?: List<LifecycleEvent>, bindings?: List<any>,
exportAs?: string, compileChildren?: boolean;
}): DirectiveDecorator;
}
@ -1892,6 +1872,48 @@ declare module ng {
location: string;
}
interface ChangeDetector {
parent: ChangeDetector;
mode: string;
addChild(cd: ChangeDetector): void;
addShadowDomChild(cd: ChangeDetector): void;
removeChild(cd: ChangeDetector): void;
removeShadowDomChild(cd: ChangeDetector): void;
remove(): void;
hydrate(context: any, locals: Locals, directives: any, pipes: any): void;
dehydrate(): void;
markPathToRootAsCheckOnce(): void;
detectChanges(): void;
checkNoChanges(): void;
}
class Locals {
parent: Locals;
current: Map<any, any>;
contains(name: string): boolean;
get(name: string): any;
set(name: string, value: any): void;
clearValues(): void;
}
/**
* Controls change detection.
@ -1938,6 +1960,8 @@ declare module ng {
wrapped: any;
}
const defaultPipes : Pipes ;
/**
* An interface which all pipes must implement.
@ -1985,7 +2009,7 @@ declare module ng {
* 'json': [jsonPipeFactory]
* }
* @Component({
* viewInjector: [
* viewBindings: [
* bind(Pipes).toValue(new Pipes(pipesConfig))
* ]
* })
@ -1996,6 +2020,64 @@ declare module ng {
get(type: string, obj: any, cdRef?: ChangeDetectorRef, existingPipe?: Pipe): Pipe;
}
/**
* A repository of different iterable diffing strategies used by NgFor, NgClass, and others.
*/
class IterableDiffers {
factories: IterableDifferFactory[];
find(iterable: Object): IterableDifferFactory;
}
interface IterableDiffer {
diff(object: Object): any;
onDestroy(): void;
}
/**
* Provides a factory for {@link IterableDiffer}.
*/
interface IterableDifferFactory {
supports(objects: Object): boolean;
create(cdRef: ChangeDetectorRef): IterableDiffer;
}
/**
* A repository of different Map diffing strategies used by NgClass, NgStyle, and others.
*/
class KeyValueDiffers {
factories: KeyValueDifferFactory[];
find(kv: Object): KeyValueDifferFactory;
}
interface KeyValueDiffer {
diff(object: Object): void;
onDestroy(): void;
}
/**
* Provides a factory for {@link KeyValueDiffer}.
*/
interface KeyValueDifferFactory {
supports(objects: Object): boolean;
create(cdRef: ChangeDetectorRef): KeyValueDiffer;
}
interface PipeFactory {
supports(obs: any): boolean;
@ -2097,6 +2179,18 @@ declare module ng {
}
/**
* Runtime representation of a type.
*
* In JavaScript a Type is a constructor function.
*/
interface Type extends Function {
new(args: any): any;
}
/**
* Specifies app root url for the application.
*
@ -2606,6 +2700,59 @@ declare module ng {
}
/**
* Provides access to explicitly trigger change detection in an application.
*
* By default, `Zone` triggers change detection in Angular on each virtual machine (VM) turn. When
* testing, or in some
* limited application use cases, a developer can also trigger change detection with the
* `lifecycle.tick()` method.
*
* Each Angular application has a single `LifeCycle` instance.
*
* # Example
*
* This is a contrived example, since the bootstrap automatically runs inside of the `Zone`, which
* invokes
* `lifecycle.tick()` on your behalf.
*
* ```javascript
* bootstrap(MyApp).then((ref:ComponentRef) => {
* var lifeCycle = ref.injector.get(LifeCycle);
* var myApp = ref.instance;
*
* ref.doSomething();
* lifecycle.tick();
* });
* ```
*/
class LifeCycle {
/**
* @private
*/
registerWith(zone: NgZone, changeDetector?: ChangeDetector): void;
/**
* Invoke this method to explicitly process change detection and its side-effects.
*
* In development mode, `tick()` also performs a second change detection cycle to ensure that no
* further
* changes are detected. If additional changes are picked up during this second cycle, bindings
* in
* the app have
* side-effects that cannot be resolved in a single change detection pass. In this case, Angular
* throws an error,
* since an Angular application can only have one change detection pass during which all change
* detection must
* complete.
*/
tick(): void;
}
/**
* Reference to the element.
*
@ -3099,21 +3246,6 @@ declare module ng {
}
/**
* Specifies how injector should resolve a dependency.
*
* See {@link Self}, {@link Ancestor}, {@link Unbounded}.
*/
class VisibilityMetadata {
crossBoundaries: boolean;
includeSelf: boolean;
toString(): string;
}
/**
* Specifies that an injector should retrieve a dependency from itself.
*
@ -3132,14 +3264,15 @@ declare module ng {
* expect(nd.dependency).toBeAnInstanceOf(Dependency);
* ```
*/
class SelfMetadata extends VisibilityMetadata {
class SelfMetadata {
toString(): string;
}
/**
* Specifies that an injector should retrieve a dependency from any ancestor from the same boundary.
* Specifies that an injector should retrieve a dependency from any injector until reaching the
* closest host.
*
* ## Example
*
@ -3148,65 +3281,52 @@ declare module ng {
* }
*
* class NeedsDependency {
* constructor(public @Ancestor() dependency:Dependency) {}
* constructor(public @Host() dependency:Dependency) {}
* }
*
* var parent = Injector.resolveAndCreate([
* bind(Dependency).toClass(AncestorDependency)
* bind(Dependency).toClass(HostDependency)
* ]);
* var child = parent.resolveAndCreateChild([]);
* var grandChild = child.resolveAndCreateChild([NeedsDependency, Depedency]);
* var nd = grandChild.get(NeedsDependency);
* expect(nd.dependency).toBeAnInstanceOf(AncestorDependency);
* ```
*
* You can make an injector to retrive a dependency either from itself or its ancestor by setting
* self to true.
*
* ```
* class NeedsDependency {
* constructor(public @Ancestor({self:true}) dependency:Dependency) {}
* }
* expect(nd.dependency).toBeAnInstanceOf(HostDependency);
* ```
*/
class AncestorMetadata extends VisibilityMetadata {
class HostMetadata {
toString(): string;
}
/**
* Specifies that an injector should retrieve a dependency from any ancestor, crossing boundaries.
* Specifies that the dependency resolution should start from the parent injector.
*
* ## Example
*
*
* ```
* class Dependency {
* class Service {}
*
* class ParentService implements Service {
* }
*
* class NeedsDependency {
* constructor(public @Ancestor() dependency:Dependency) {}
* class ChildService implements Service {
* constructor(public @SkipSelf() parentService:Service) {}
* }
*
* var parent = Injector.resolveAndCreate([
* bind(Dependency).toClass(AncestorDependency)
* bind(Service).toClass(ParentService)
* ]);
* var child = parent.resolveAndCreateChild([]);
* var grandChild = child.resolveAndCreateChild([NeedsDependency, Depedency]);
* var nd = grandChild.get(NeedsDependency);
* expect(nd.dependency).toBeAnInstanceOf(AncestorDependency);
* ```
*
* You can make an injector to retrive a dependency either from itself or its ancestor by setting
* self to true.
*
* ```
* class NeedsDependency {
* constructor(public @Ancestor({self:true}) dependency:Dependency) {}
* }
* var child = parent.resolveAndCreateChild([
* bind(Service).toClass(ChildSerice)
* ]);
* var s = child.get(Service);
* expect(s).toBeAnInstanceOf(ChildService);
* expect(s.parentService).toBeAnInstanceOf(ParentService);
* ```
*/
class UnboundedMetadata extends VisibilityMetadata {
class SkipSelfMetadata {
toString(): string;
}
@ -3243,8 +3363,6 @@ declare module ng {
token: void;
}
const DEFAULT_VISIBILITY : VisibilityMetadata ;
/**
* Allows to refer to references which are not yet defined.
@ -3749,7 +3867,9 @@ declare module ng {
optional: boolean;
visibility: VisibilityMetadata;
lowerBoundVisibility: any;
upperBoundVisibility: any;
properties: List<any>;
}
@ -3971,27 +4091,27 @@ declare module ng {
/**
* Factory for creating {@link AncestorMetadata}.
* Factory for creating {@link HostMetadata}.
*/
interface AncestorFactory {
interface HostFactory {
new(visibility?: {self: boolean}): AncestorMetadata;
new(): HostMetadata;
(visibility?: {self: boolean}): any;
(): any;
}
/**
* Factory for creating {@link UnboundedMetadata}.
* Factory for creating {@link SkipSelfMetadata}.
*/
interface UnboundedFactory {
interface SkipSelfFactory {
new(visibility?: {self: boolean}): UnboundedMetadata;
new(): SkipSelfMetadata;
(visibility?: {self: boolean}): any;
(): any;
}
@ -4021,15 +4141,15 @@ declare module ng {
/**
* Factory for creating {@link AncestorMetadata}.
* Factory for creating {@link HostMetadata}.
*/
var Ancestor : AncestorFactory ;
var Host : HostFactory ;
/**
* Factory for creating {@link UnboundedMetadata}.
* Factory for creating {@link SkipSelfMetadata}.
*/
var Unbounded : UnboundedFactory ;
var SkipSelf : SkipSelfFactory ;
/**
@ -4142,7 +4262,7 @@ declare module ng {
templateRef: TemplateRef;
pipes: Pipes;
iterableDiffers: IterableDiffers;
cdr: ChangeDetectorRef;
@ -4855,7 +4975,7 @@ declare module ng {
* ```
* import {Http, MyNodeBackend, httpInjectables, BaseRequestOptions} from 'angular2/http';
* @Component({
* viewInjector: [
* viewBindings: [
* httpInjectables,
* bind(Http).toFactory((backend, options) => {
* return new Http(backend, options);
@ -4944,7 +5064,7 @@ declare module ng {
*
* ```
* import {Http, httpInjectables} from 'angular2/http';
* @Component({selector: 'http-app', viewInjector: [httpInjectables]})
* @Component({selector: 'http-app', viewBindings: [httpInjectables]})
* @View({templateUrl: 'people.html'})
* class PeopleComponent {
* constructor(http: Http) {
@ -5226,7 +5346,7 @@ declare module ng {
*
* ```
* import {httpInjectables, Http} from 'angular2/http';
* @Component({selector: 'http-app', viewInjector: [httpInjectables]})
* @Component({selector: 'http-app', viewBindings: [httpInjectables]})
* @View({template: '{{data}}'})
* class MyApp {
* constructor(http:Http) {
@ -6029,7 +6149,7 @@ declare module ng {
*
* @Component({
* selector: 'login-comp',
* viewInjector: [
* viewBindings: [
* FormBuilder
* ]
* })
@ -6093,6 +6213,82 @@ declare module ng {
const formInjectables : List<Type> ;
class DirectiveMetadata {
id: any;
selector: string;
compileChildren: boolean;
events: List<string>;
properties: List<string>;
readAttributes: List<string>;
type: number;
callOnDestroy: boolean;
callOnChange: boolean;
callOnCheck: boolean;
callOnInit: boolean;
callOnAllChangesDone: boolean;
changeDetection: string;
exportAs: string;
hostListeners: Map<string, string>;
hostProperties: Map<string, string>;
hostAttributes: Map<string, string>;
hostActions: Map<string, string>;
}
class DomRenderer extends Renderer {
createRootHostView(hostProtoViewRef: RenderProtoViewRef, fragmentCount: number, hostElementSelector: string): RenderViewWithFragments;
createView(protoViewRef: RenderProtoViewRef, fragmentCount: number): RenderViewWithFragments;
destroyView(viewRef: RenderViewRef): void;
getNativeElementSync(location: RenderElementRef): any;
getRootNodes(fragment: RenderFragmentRef): List<Node>;
attachFragmentAfterFragment(previousFragmentRef: RenderFragmentRef, fragmentRef: RenderFragmentRef): void;
attachFragmentAfterElement(elementRef: RenderElementRef, fragmentRef: RenderFragmentRef): void;
detachFragment(fragmentRef: RenderFragmentRef): void;
hydrateView(viewRef: RenderViewRef): void;
dehydrateView(viewRef: RenderViewRef): void;
setElementProperty(location: RenderElementRef, propertyName: string, propertyValue: any): void;
setElementAttribute(location: RenderElementRef, attributeName: string, attributeValue: string): void;
setElementClass(location: RenderElementRef, className: string, isAdd: boolean): void;
setElementStyle(location: RenderElementRef, styleName: string, styleValue: string): void;
invokeElementMethod(location: RenderElementRef, methodName: string, args: List<any>): void;
setText(viewRef: RenderViewRef, textNodeIndex: number, text: string): void;
setEventDispatcher(viewRef: RenderViewRef, dispatcher: any): void;
}
/**
* A dispatcher for all events happening in a view.
@ -6236,41 +6432,21 @@ declare module ng {
fragmentRefs: RenderFragmentRef[];
}
class DomRenderer extends Renderer {
class ViewDefinition {
createRootHostView(hostProtoViewRef: RenderProtoViewRef, fragmentCount: number, hostElementSelector: string): RenderViewWithFragments;
componentId: string;
createView(protoViewRef: RenderProtoViewRef, fragmentCount: number): RenderViewWithFragments;
templateAbsUrl: string;
destroyView(viewRef: RenderViewRef): void;
template: string;
getNativeElementSync(location: RenderElementRef): any;
directives: List<DirectiveMetadata>;
getRootNodes(fragment: RenderFragmentRef): List<Node>;
styleAbsUrls: List<string>;
attachFragmentAfterFragment(previousFragmentRef: RenderFragmentRef, fragmentRef: RenderFragmentRef): void;
styles: List<string>;
attachFragmentAfterElement(elementRef: RenderElementRef, fragmentRef: RenderFragmentRef): void;
detachFragment(fragmentRef: RenderFragmentRef): void;
hydrateView(viewRef: RenderViewRef): void;
dehydrateView(viewRef: RenderViewRef): void;
setElementProperty(location: RenderElementRef, propertyName: string, propertyValue: any): void;
setElementAttribute(location: RenderElementRef, attributeName: string, attributeValue: string): void;
setElementClass(location: RenderElementRef, className: string, isAdd: boolean): void;
setElementStyle(location: RenderElementRef, styleName: string, styleValue: string): void;
invokeElementMethod(location: RenderElementRef, methodName: string, args: List<any>): void;
setText(viewRef: RenderViewRef, textNodeIndex: number, text: string): void;
setEventDispatcher(viewRef: RenderViewRef, dispatcher: any): void;
encapsulation: ViewEncapsulation;
}
const DOCUMENT_TOKEN : OpaqueToken ;
@ -6283,6 +6459,84 @@ declare module ng {
const DOM_REFLECT_PROPERTIES_AS_ATTRIBUTES : OpaqueToken ;
/**
* Defines when a compiled template should be stored as a string
* rather than keeping its Nodes to preserve memory.
*/
const MAX_IN_MEMORY_ELEMENTS_PER_TEMPLATE_TOKEN : OpaqueToken ;
/**
* Create trace scope.
*
* Scopes must be strictly nested and are analogous to stack frames, but
* do not have to follow the stack frames. Instead it is recommended that they follow logical
* nesting. You may want to use
* [Event
* Signatures](http://google.github.io/tracing-framework/instrumenting-code.html#custom-events)
* as they are defined in WTF.
*
* Used to mark scope entry. The return value is used to leave the scope.
*
* final myScope = wtfCreateScope('MyClass#myMethod(ascii someVal)');
*
* someMethod() {
* var s = myScope('Foo'); // 'Foo' gets stored in tracing UI
* // DO SOME WORK HERE
* return wtfLeave(s, 123); // Return value 123
* }
*
* Note, adding try-finally block around the work to ensure that `wtfLeave` gets called can
* negatively impact the performance of your application. For this reason we recommend that
* you don't add them to ensure that `wtfLeave` gets called. In production `wtfLeave` is a noop and
* so try-finally block has no value. When debugging perf issues, skipping `wtfLeave`, do to
* exception, will produce incorrect trace, but presence of exception signifies logic error which
* needs to be fixed before the app should be profiled. Add try-finally only when you expect that
* an exception is expected during normal execution while profiling.
*/
var wtfCreateScope : WtfScopeFn ;
/**
* Used to mark end of Scope.
*
* - `scope` to end.
* - `returnValue` (optional) to be passed to the WTF.
*
* Returns the `returnValue for easy chaining.
*/
var wtfLeave : <T>(scope: any, returnValue?: T) => T ;
/**
* Used to mark Async start. Async are similar to scope but they don't have to be strictly nested.
* The return value is used in the call to [endAsync]. Async ranges only work if WTF has been
* enabled.
*
* someMethod() {
* var s = wtfStartTimeRange('HTTP:GET', 'some.url');
* var future = new Future.delay(5).then((_) {
* wtfEndTimeRange(s);
* });
* }
*/
var wtfStartTimeRange : (rangeType: string, action: string) => any ;
/**
* Ends a async time range operation.
* [range] is the return value from [wtfStartTimeRange] Async ranges only work if WTF has been
* enabled.
*/
var wtfEndTimeRange : (range: any) => void ;
interface WtfScopeFn {
(arg0?: any, arg1?: any): any;
}
var ChangeDetectorRef: InjectableReference;
var ApplicationRef: InjectableReference;
@ -6303,8 +6557,8 @@ declare module ng {
}
declare module "angular2/angular2" {
export = ng;
}

469
angular2/router-2.0.0-alpha.34.d.ts vendored Normal file
View File

@ -0,0 +1,469 @@
// Type definitions for Angular v2.0.0-alpha.34
// Project: http://angular.io/
// Definitions by: angular team <https://github.com/angular/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// ***********************************************************
// This file is generated by the Angular build process.
// Please do not create manual edits or send pull requests
// modifying this file.
// ***********************************************************
///<reference path="./angular2-2.0.0-alpha.34.d.ts"/>
/**
* @module
* @description
* Maps application URLs into application states, to support deep-linking and navigation.
*/
declare module ng {
/**
* # Router
* The router is responsible for mapping URLs to components.
*
* You can see the state of the router by inspecting the read-only field `router.navigating`.
* This may be useful for showing a spinner, for instance.
*
* ## Concepts
* Routers and component instances have a 1:1 correspondence.
*
* The router holds reference to a number of "outlets." An outlet is a placeholder that the
* router dynamically fills in depending on the current URL.
*
* When the router navigates from a URL, it must first recognizes it and serialize it into an
* `Instruction`.
* The router uses the `RouteRegistry` to get an `Instruction`.
*/
class Router {
navigating: boolean;
lastNavigationAttempt: string;
registry: RouteRegistry;
parent: Router;
hostComponent: any;
/**
* Constructs a child router. You probably don't need to use this unless you're writing a reusable
* component.
*/
childRouter(hostComponent: any): Router;
/**
* Register an object to notify of route changes. You probably don't need to use this unless
* you're writing a reusable component.
*/
registerOutlet(outlet: RouterOutlet): Promise<boolean>;
/**
* Dynamically update the routing configuration and trigger a navigation.
*
* # Usage
*
* ```
* router.config([
* { 'path': '/', 'component': IndexComp },
* { 'path': '/user/:id', 'component': UserComp },
* ]);
* ```
*/
config(definitions: List<RouteDefinition>): Promise<any>;
/**
* Navigate to a URL. Returns a promise that resolves when navigation is complete.
*
* If the given URL begins with a `/`, router will navigate absolutely.
* If the given URL does not begin with `/`, the router will navigate relative to this component.
*/
navigate(url: string, _skipLocationChange?: boolean): Promise<any>;
/**
* Updates this router and all descendant routers according to the given instruction
*/
commit(instruction: Instruction, _skipLocationChange?: boolean): Promise<any>;
/**
* Subscribe to URL updates from the router
*/
subscribe(onNext: (value: any) => void): void;
/**
* Removes the contents of this router's outlet and all descendant outlets
*/
deactivate(instruction: Instruction): Promise<any>;
/**
* Given a URL, returns an instruction representing the component graph
*/
recognize(url: string): Promise<Instruction>;
/**
* Navigates to either the last URL successfully navigated to, or the last URL requested if the
* router has yet to successfully navigate.
*/
renavigate(): Promise<any>;
/**
* Generate a URL from a component name and optional map of parameters. The URL is relative to the
* app's base href.
*/
generate(linkParams: List<any>): string;
}
class RootRouter extends Router {
commit(instruction: Instruction, _skipLocationChange?: boolean): Promise<any>;
}
/**
* A router outlet is a placeholder that Angular dynamically fills based on the application's route.
*
* ## Use
*
* ```
* <router-outlet></router-outlet>
* ```
*/
class RouterOutlet {
childRouter: Router;
/**
* Given an instruction, update the contents of this outlet.
*/
commit(instruction: Instruction): Promise<any>;
/**
* Called by Router during recognition phase
*/
canDeactivate(nextInstruction: Instruction): Promise<boolean>;
/**
* Called by Router during recognition phase
*/
canReuse(nextInstruction: Instruction): Promise<boolean>;
deactivate(nextInstruction: Instruction): Promise<any>;
}
/**
* The RouterLink directive lets you link to specific parts of your app.
*
* Consider the following route configuration:
*
* ```
* @RouteConfig([
* { path: '/user', component: UserCmp, as: 'user' }
* ]);
* class MyComp {}
* ```
*
* When linking to this `user` route, you can write:
*
* ```
* <a [router-link]="['./user']">link to user component</a>
* ```
*
* RouterLink expects the value to be an array of route names, followed by the params
* for that level of routing. For instance `['/team', {teamId: 1}, 'user', {userId: 2}]`
* means that we want to generate a link for the `team` route with params `{teamId: 1}`,
* and with a child route `user` with params `{userId: 2}`.
*
* The first route name should be prepended with `/`, `./`, or `../`.
* If the route begins with `/`, the router will look up the route from the root of the app.
* If the route begins with `./`, the router will instead look in the current component's
* children for the route. And if the route begins with `../`, the router will look at the
* current component's parent.
*/
class RouterLink {
visibleHref: string;
routeParams: void;
onClick(): boolean;
}
class RouteParams {
params: StringMap<string, string>;
get(param: string): string;
}
/**
* The RouteRegistry holds route configurations for each component in an Angular app.
* It is responsible for creating Instructions from URLs, and generating URLs based on route and
* parameters.
*/
class RouteRegistry {
/**
* Given a component and a configuration object, add the route to this registry
*/
config(parentComponent: any, config: RouteDefinition, isRootLevelRoute?: boolean): void;
/**
* Reads the annotations of a component and configures the registry based on them
*/
configFromComponent(component: any, isRootComponent?: boolean): void;
/**
* Given a URL and a parent component, return the most specific instruction for navigating
* the application into the state specified by the url
*/
recognize(url: string, parentComponent: any): Promise<Instruction>;
/**
* Given a normalized list with component names and params like: `['user', {id: 3 }]`
* generates a url with a leading slash relative to the provided `parentComponent`.
*/
generate(linkParams: List<any>, parentComponent: any): string;
}
class LocationStrategy {
path(): string;
pushState(ctx: any, title: string, url: string): void;
forward(): void;
back(): void;
onPopState(fn: (_: any) => any): void;
getBaseHref(): string;
}
class HashLocationStrategy extends LocationStrategy {
onPopState(fn: EventListener): void;
getBaseHref(): string;
path(): string;
pushState(state: any, title: string, url: string): void;
forward(): void;
back(): void;
}
class HTML5LocationStrategy extends LocationStrategy {
onPopState(fn: EventListener): void;
getBaseHref(): string;
path(): string;
pushState(state: any, title: string, url: string): void;
forward(): void;
back(): void;
}
/**
* This is the service that an application developer will directly interact with.
*
* Responsible for normalizing the URL against the application's base href.
* A normalized URL is absolute from the URL host, includes the application's base href, and has no
* trailing slash:
* - `/my/app/user/123` is normalized
* - `my/app/user/123` **is not** normalized
* - `/my/app/user/123/` **is not** normalized
*/
class Location {
path(): string;
normalize(url: string): string;
normalizeAbsolutely(url: string): string;
go(url: string): void;
forward(): void;
back(): void;
subscribe(onNext: (value: any) => void, onThrow?: (exception: any) => void, onReturn?: () => void): void;
}
const appBaseHrefToken : OpaqueToken ;
/**
* Responsible for performing each step of navigation.
* "Steps" are conceptually similar to "middleware"
*/
class Pipeline {
steps: List<Function>;
process(instruction: Instruction): Promise<any>;
}
/**
* Defines route lifecycle method [onActivate]
*/
interface OnActivate {
onActivate(nextInstruction: Instruction, prevInstruction: Instruction): any;
}
/**
* Defines route lifecycle method [onDeactivate]
*/
interface OnDeactivate {
onDeactivate(nextInstruction: Instruction, prevInstruction: Instruction): any;
}
/**
* Defines route lifecycle method [onReuse]
*/
interface OnReuse {
onReuse(nextInstruction: Instruction, prevInstruction: Instruction): any;
}
/**
* Defines route lifecycle method [canDeactivate]
*/
interface CanDeactivate {
canDeactivate(nextInstruction: Instruction, prevInstruction: Instruction): any;
}
/**
* Defines route lifecycle method [canReuse]
*/
interface CanReuse {
canReuse(nextInstruction: Instruction, prevInstruction: Instruction): any;
}
var CanActivate : (hook: (next: Instruction, prev: Instruction) => Promise<boolean>| boolean) => ClassDecorator ;
/**
* An `Instruction` represents the component hierarchy of the application based on a given route
*/
class Instruction {
accumulatedUrl: string;
reuse: boolean;
specificity: number;
component: any;
capturedUrl: string;
child: Instruction;
params(): StringMap<string, string>;
}
const routerDirectives : List<any> ;
var routerInjectables : List<any> ;
class Route implements RouteDefinition {
path: string;
component: Type;
as: string;
loader: Function;
redirectTo: string;
}
class Redirect implements RouteDefinition {
path: string;
redirectTo: string;
as: string;
}
class AsyncRoute implements RouteDefinition {
path: string;
loader: Function;
as: string;
}
interface RouteDefinition {
path: string;
component?: Type | ComponentDefinition;
loader?: Function;
redirectTo?: string;
as?: string;
}
var RouteConfig : (configs: List<RouteDefinition>) => ClassDecorator ;
interface ComponentDefinition {
type: string;
loader?: Function;
component?: Type;
}
}
declare module "angular2/router" {
export = ng;
}

372
angular2/router.d.ts vendored
View File

@ -1,4 +1,4 @@
// Type definitions for Angular v2.0.0-alpha.31
// Type definitions for Angular v2.0.0-alpha.34
// Project: http://angular.io/
// Definitions by: angular team <https://github.com/angular/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@ -18,120 +18,56 @@
* Maps application URLs into application states, to support deep-linking and navigation.
*/
declare module ng {
interface List<T> extends Array<T> {}
interface Map<K,V> {}
interface StringMap<K,V> extends Map<K,V> {}
export class Instruction {
// "capturedUrl" is the part of the URL captured by this instruction
// "accumulatedUrl" is the part of the URL captured by this instruction and all children
accumulatedUrl: string;
reuse: boolean;
specificity: number;
private _params: StringMap<string, string>;
constructor (component: any, capturedUrl: string,
_recognizer: PathRecognizer, child: Instruction);
params(): StringMap<string, string>;
}
class TouchMap {
map: StringMap<string, string>;
keys: StringMap<string, boolean>;
constructor(map: StringMap<string, any>);
get(key: string): string;
getUnused(): StringMap<string, any>;
}
export class Segment {
name: string;
regex: string;
generate(params: TouchMap): string;
}
export class PathRecognizer {
segments: List<Segment>;
regex: RegExp;
specificity: number;
terminal: boolean;
path: string;
handler: RouteHandler;
constructor(path: string, handler: RouteHandler);
parseParams(url: string): StringMap<string, string>;
generate(params: StringMap<string, any>): string;
resolveComponentType(): Promise<any>;
}
export interface RouteHandler {
componentType: Function;
resolveComponentType(): Promise<any>;
}
/**
* # Router
* The router is responsible for mapping URLs to components.
*
*
* You can see the state of the router by inspecting the read-only field `router.navigating`.
* This may be useful for showing a spinner, for instance.
*
*
* ## Concepts
* Routers and component instances have a 1:1 correspondence.
*
*
* The router holds reference to a number of "outlets." An outlet is a placeholder that the
* router dynamically fills in depending on the current URL.
*
*
* When the router navigates from a URL, it must first recognizes it and serialize it into an
* `Instruction`.
* The router uses the `RouteRegistry` to get an `Instruction`.
*/
class Router {
navigating: boolean;
lastNavigationAttempt: string;
registry: RouteRegistry;
parent: Router;
hostComponent: any;
/**
* Constructs a child router. You probably don't need to use this unless you're writing a reusable
* component.
*/
childRouter(hostComponent: any): Router;
/**
* Register an object to notify of route changes. You probably don't need to use this unless
* you're writing a reusable component.
*/
registerOutlet(outlet: RouterOutlet): Promise<boolean>;
/**
* Dynamically update the routing configuration and trigger a navigation.
*
*
* # Usage
*
* ```
* router.config({ 'path': '/', 'component': IndexCmp});
* ```
*
* Or:
*
*
* ```
* router.config([
* { 'path': '/', 'component': IndexComp },
@ -139,48 +75,48 @@ declare module ng {
* ]);
* ```
*/
config(config: StringMap<string, any>| List<StringMap<string, any>>): Promise<any>;
config(definitions: List<RouteDefinition>): Promise<any>;
/**
* Navigate to a URL. Returns a promise that resolves when navigation is complete.
*
*
* If the given URL begins with a `/`, router will navigate absolutely.
* If the given URL does not begin with `/`, the router will navigate relative to this component.
*/
navigate(url: string): Promise<any>;
navigate(url: string, _skipLocationChange?: boolean): Promise<any>;
/**
* Updates this router and all descendant routers according to the given instruction
*/
commit(instruction: Instruction): Promise<any>;
commit(instruction: Instruction, _skipLocationChange?: boolean): Promise<any>;
/**
* Subscribe to URL updates from the router
*/
subscribe(onNext: any): void;
subscribe(onNext: (value: any) => void): void;
/**
* Removes the contents of this router's outlet and all descendant outlets
*/
deactivate(instruction: Instruction): Promise<any>;
/**
* Given a URL, returns an instruction representing the component graph
*/
recognize(url: string): Promise<Instruction>;
/**
* Navigates to either the last URL successfully navigated to, or the last URL requested if the
* router has yet to successfully navigate.
*/
renavigate(): Promise<any>;
/**
* Generate a URL from a component name and optional map of parameters. The URL is relative to the
@ -188,71 +124,71 @@ declare module ng {
*/
generate(linkParams: List<any>): string;
}
class RootRouter extends Router {
commit(instruction: any): Promise<any>;
commit(instruction: Instruction, _skipLocationChange?: boolean): Promise<any>;
}
/**
* A router outlet is a placeholder that Angular dynamically fills based on the application's route.
*
*
* ## Use
*
*
* ```
* <router-outlet></router-outlet>
* ```
*/
class RouterOutlet {
childRouter: Router;
/**
* Given an instruction, update the contents of this outlet.
*/
commit(instruction: Instruction): Promise<any>;
/**
* Called by Router during recognition phase
*/
canDeactivate(nextInstruction: Instruction): Promise<boolean>;
/**
* Called by Router during recognition phase
*/
canReuse(nextInstruction: Instruction): Promise<boolean>;
deactivate(nextInstruction: Instruction): Promise<any>;
}
/**
* The RouterLink directive lets you link to specific parts of your app.
*
*
* Consider the following route configuration:
*
*
* ```
* @RouteConfig({
* path: '/user', component: UserCmp, as: 'user'
* });
* @RouteConfig([
* { path: '/user', component: UserCmp, as: 'user' }
* ]);
* class MyComp {}
* ```
*
*
* When linking to this `user` route, you can write:
*
*
* ```
* <a [router-link]="['./user']">link to user component</a>
* ```
*
*
* RouterLink expects the value to be an array of route names, followed by the params
* for that level of routing. For instance `['/team', {teamId: 1}, 'user', {userId: 2}]`
* means that we want to generate a link for the `team` route with params `{teamId: 1}`,
* and with a child route `user` with params `{userId: 2}`.
*
*
* The first route name should be prepended with `/`, `./`, or `../`.
* If the route begins with `/`, the router will look up the route from the root of the app.
* If the route begins with `./`, the router will instead look in the current component's
@ -260,21 +196,21 @@ declare module ng {
* current component's parent.
*/
class RouterLink {
visibleHref: string;
routeParams: void;
onClick(): boolean;
}
class RouteParams {
params: StringMap<string, string>;
get(param: string): string;
}
/**
* The RouteRegistry holds route configurations for each component in an Angular app.
@ -282,26 +218,26 @@ declare module ng {
* parameters.
*/
class RouteRegistry {
/**
* Given a component and a configuration object, add the route to this registry
*/
config(parentComponent: any, config: StringMap<string, any>): void;
config(parentComponent: any, config: RouteDefinition, isRootLevelRoute?: boolean): void;
/**
* Reads the annotations of a component and configures the registry based on them
*/
configFromComponent(component: any): void;
configFromComponent(component: any, isRootComponent?: boolean): void;
/**
* Given a URL and a parent component, return the most specific instruction for navigating
* the application into the state specified by the url
*/
recognize(url: string, parentComponent: any): Promise<Instruction>;
/**
* Given a normalized list with component names and params like: `['user', {id: 3 }]`
@ -309,56 +245,56 @@ declare module ng {
*/
generate(linkParams: List<any>, parentComponent: any): string;
}
class LocationStrategy {
path(): string;
pushState(ctx: any, title: string, url: string): void;
forward(): void;
back(): void;
onPopState(fn: any): void;
onPopState(fn: (_: any) => any): void;
getBaseHref(): string;
}
class HashLocationStrategy extends LocationStrategy {
onPopState(fn: EventListener): void;
getBaseHref(): string;
path(): string;
pushState(state: any, title: string, url: string): void;
forward(): void;
back(): void;
}
class HTML5LocationStrategy extends LocationStrategy {
onPopState(fn: EventListener): void;
getBaseHref(): string;
path(): string;
pushState(state: any, title: string, url: string): void;
forward(): void;
back(): void;
}
/**
* This is the service that an application developer will directly interact with.
*
*
* Responsible for normalizing the URL against the application's base href.
* A normalized URL is absolute from the URL host, includes the application's base href, and has no
* trailing slash:
@ -367,93 +303,167 @@ declare module ng {
* - `/my/app/user/123/` **is not** normalized
*/
class Location {
path(): string;
normalize(url: string): string;
normalizeAbsolutely(url: string): string;
go(url: string): void;
forward(): void;
back(): void;
subscribe(onNext: any, onThrow?: any, onReturn?: any): void;
subscribe(onNext: (value: any) => void, onThrow?: (exception: any) => void, onReturn?: () => void): void;
}
var appBaseHrefToken : OpaqueToken ;
const appBaseHrefToken : OpaqueToken ;
/**
* Responsible for performing each step of navigation.
* "Steps" are conceptually similar to "middleware"
*/
class Pipeline {
steps: List<Function>;
process(instruction: Instruction): Promise<any>;
}
/**
* Defines route lifecycle method [onActivate]
*/
interface OnActivate {
onActivate(nextInstruction: Instruction, prevInstruction: Instruction): any;
}
/**
* Defines route lifecycle method [onDeactivate]
*/
interface OnDeactivate {
onDeactivate(nextInstruction: Instruction, prevInstruction: Instruction): any;
}
/**
* Defines route lifecycle method [onReuse]
*/
interface OnReuse {
onReuse(nextInstruction: Instruction, prevInstruction: Instruction): any;
}
/**
* Defines route lifecycle method [canDeactivate]
*/
interface CanDeactivate {
canDeactivate(nextInstruction: Instruction, prevInstruction: Instruction): any;
}
/**
* Defines route lifecycle method [canReuse]
*/
interface CanReuse {
canReuse(nextInstruction: Instruction, prevInstruction: Instruction): any;
}
var CanActivate : (hook: (next: Instruction, prev: Instruction) => Promise<boolean>| boolean) => ClassDecorator ;
var CanActivate:any;
var routerDirectives : List<any> ;
/**
* An `Instruction` represents the component hierarchy of the application based on a given route
*/
class Instruction {
accumulatedUrl: string;
reuse: boolean;
specificity: number;
component: any;
capturedUrl: string;
child: Instruction;
params(): StringMap<string, string>;
}
const routerDirectives : List<any> ;
var routerInjectables : List<any> ;
var RouteConfig:any;
class Route implements RouteDefinition {
path: string;
component: Type;
as: string;
loader: Function;
redirectTo: string;
}
class Redirect implements RouteDefinition {
path: string;
redirectTo: string;
as: string;
}
class AsyncRoute implements RouteDefinition {
path: string;
loader: Function;
as: string;
}
interface RouteDefinition {
path: string;
component?: Type | ComponentDefinition;
loader?: Function;
redirectTo?: string;
as?: string;
}
var RouteConfig : (configs: List<RouteDefinition>) => ClassDecorator ;
interface ComponentDefinition {
type: string;
loader?: Function;
component?: Type;
}
}
declare module "angular2/router" {
export = ng;
}

58
angularjs/angular-tests.ts Executable file → Normal file
View File

@ -30,7 +30,7 @@ class AuthService {
'$rootScope', '$injector', <any>function($rootScope: ng.IScope, $injector: ng.auto.IInjectorService) {
var $http: ng.IHttpService; //initialized later because of circular dependency problem
function retry(config: ng.IRequestConfig, deferred: ng.IDeferred<any>) {
$http = $http || $injector.get('$http');
$http = $http || $injector.get<ng.IHttpService>('$http');
$http(config).then(function (response) {
deferred.resolve(response);
});
@ -242,6 +242,18 @@ foo.then((x) => {
x.toFixed();
});
// $q signature tests
module TestQ {
var $q: ng.IQService;
var promise1: ng.IPromise<any>;
var promise2: ng.IPromise<any>;
// $q.all
$q.all([promise1, promise2]).then((results: any[]) => {});
$q.all<number>([promise1, promise2]).then((results: number[]) => {});
$q.all({a: promise1, b: promise2}).then((results: {[id: string]: any;}) => {});
$q.all<{a: number; b: string;}>({a: promise1, b: promise2}).then((results: {a: number; b: string;}) => {});
}
var httpFoo: ng.IHttpPromise<number>;
httpFoo.then((x) => {
@ -260,6 +272,48 @@ httpFoo.success((data, status, headers, config) => {
hs["content-type"].charAt(1);
});
// Promise signature tests
module TestPromise {
var result: any;
var any: any;
interface TResult {
a: number;
b: string;
c: boolean;
}
var promise: angular.IPromise<TResult>;
interface IPromiseSuccessCallback<T, U> {
(promiseValue: T): angular.IHttpPromise<U>|angular.IPromise<U>|U|angular.IPromise<void>;
}
var successCallbackAnyFn: IPromiseSuccessCallback<TResult, any>;
var successCallbackTResultFn: IPromiseSuccessCallback<TResult, TResult>;
interface IPromiseErrorCallback<T> {
(error: any): angular.IHttpPromise<T>|angular.IPromise<T>|T;
}
var errorCallbackAnyFn: IPromiseErrorCallback<any>;
var errorCallbackTResultFn: IPromiseErrorCallback<TResult>;
// promise.then
result = <angular.IPromise<any>>promise.then(successCallbackAnyFn);
result = <angular.IPromise<any>>promise.then(successCallbackAnyFn, (any) => any);
result = <angular.IPromise<any>>promise.then(successCallbackAnyFn, (any) => any, (any) => any);
result = <angular.IPromise<TResult>>promise.then<TResult>(successCallbackTResultFn);
result = <angular.IPromise<TResult>>promise.then<TResult>(successCallbackTResultFn, (any) => any);
result = <angular.IPromise<TResult>>promise.then<TResult>(successCallbackTResultFn, (any) => any, (any) => any);
// promise.catch
result = <angular.IPromise<any>>promise.catch(errorCallbackAnyFn);
result = <angular.IPromise<TResult>>promise.catch<TResult>(errorCallbackTResultFn);
// promise.finally
result = <angular.IPromise<any>>promise.finally(() => any);
result = <angular.IPromise<TResult>>promise.finally<TResult>(() => any);
}
function test_angular_forEach() {
var values: { [key: string]: string } = { name: 'misko', gender: 'male' };
var log: string[] = [];
@ -285,7 +339,7 @@ test_IAttributes({
$addClass: function (classVal){},
$removeClass: function(classVal){},
$set: function(key, value){},
$observe: function(name, fn){
$observe: function(name: any, fn: any){
return fn;
},
$attr: {}

24
angularjs/angular.d.ts vendored Executable file → Normal file
View File

@ -237,7 +237,7 @@ declare module angular {
forEach(obj: any, iterator: (value: any, key: any) => any, context?: any): any;
fromJson(json: string): any;
identity(arg?: any): any;
identity<T>(arg?: T): T;
injector(modules?: any[], strictDi?: boolean): auto.IInjectorService;
isArray(value: any): boolean;
isDate(value: any): boolean;
@ -453,7 +453,7 @@ declare module angular {
* following compilation. The observer is then invoked whenever the
* interpolated value changes.
*/
$observe(name: string, fn: (value?: any) => any): Function;
$observe<T>(name: string, fn: (value?: T) => any): Function;
/**
* A map of DOM element attribute names to the normalized name. This is needed
@ -725,7 +725,7 @@ declare module angular {
// see http://docs.angularjs.org/api/ng.$timeout
///////////////////////////////////////////////////////////////////////////
interface ITimeoutService {
(func: Function, delay?: number, invokeApply?: boolean): IPromise<any>;
<T>(func: (...args: any[]) => T, delay?: number, invokeApply?: boolean): IPromise<T>;
cancel(promise: IPromise<any>): boolean;
}
@ -996,8 +996,7 @@ declare module angular {
* See http://docs.angularjs.org/api/ng/service/$q
*/
interface IQService {
new (resolver: (resolve: IQResolveReject<any>) => any): IPromise<any>;
new (resolver: (resolve: IQResolveReject<any>, reject: IQResolveReject<any>) => any): IPromise<any>;
new <T>(resolver: (resolve: IQResolveReject<T>) => any): IPromise<T>;
new <T>(resolver: (resolve: IQResolveReject<T>, reject: IQResolveReject<any>) => any): IPromise<T>;
/**
@ -1007,7 +1006,7 @@ declare module angular {
*
* @param promises An array of promises.
*/
all(promises: IPromise<any>[]): IPromise<any[]>;
all<T>(promises: IPromise<any>[]): IPromise<T[]>;
/**
* Combines multiple promises into a single promise that is resolved when all of the input promises are resolved.
*
@ -1016,6 +1015,7 @@ declare module angular {
* @param promises A hash of promises.
*/
all(promises: { [id: string]: IPromise<any>; }): IPromise<{ [id: string]: any; }>;
all<T extends {}>(promises: { [id: string]: IPromise<any>; }): IPromise<T>;
/**
* Creates a Deferred object which represents a task which will finish in the future.
*/
@ -1156,7 +1156,7 @@ declare module angular {
*
* @param key the key of the data to be retrieved
*/
get(key: string): any;
get<T>(key: string): T;
/**
* Removes an entry from the Cache object.
@ -1227,8 +1227,8 @@ declare module angular {
///////////////////////////////////////////////////////////////////////////
interface IControllerService {
// Although the documentation doesn't state this, locals are optional
(controllerConstructor: Function, locals?: any): any;
(controllerName: string, locals?: any): any;
(controllerConstructor: Function, locals?: any, bindToController?: any): any;
(controllerName: string, locals?: any, bindToController?: any): any;
}
interface IControllerProvider extends IServiceProvider {
@ -1587,7 +1587,7 @@ declare module angular {
scope: IScope,
instanceElement: IAugmentedJQuery,
instanceAttributes: IAttributes,
controller: any,
controller: {},
transclude: ITranscludeFunction
): void;
}
@ -1682,9 +1682,9 @@ declare module angular {
interface IInjectorService {
annotate(fn: Function): string[];
annotate(inlineAnnotatedFunction: any[]): string[];
get(name: string): any;
get<T>(name: string): T;
has(name: string): boolean;
instantiate(typeConstructor: Function, locals?: any): any;
instantiate<T>(typeConstructor: Function, locals?: any): T;
invoke(inlineAnnotatedFunction: any[]): any;
invoke(func: Function, context?: any, locals?: any): any;
}

View File

@ -9,7 +9,7 @@ declare module Microsoft.Maps.AdvancedShapes {
export class EntityCollection {
constructor(options: EntityCollectionOptions);
constructor(options?: EntityCollectionOptions);
clear(): void;
get(index: number): Entity;
@ -24,10 +24,6 @@ declare module Microsoft.Maps.AdvancedShapes {
removeAt(index: number): Entity;
setOptions(options: EntityCollectionOptions): void;
toString(): string;
entityAdded: (args: EntityChangeArgs) => any;
entityChanged: (args: EntityChangeArgs) => any;
entityRemoved: (args: EntityChangeArgs) => any;
}
export class Polygon implements Entity {
@ -43,15 +39,6 @@ declare module Microsoft.Maps.AdvancedShapes {
setLocations(locations: Location[]): void;
setOptions(options: PolylineOptions): void;
toString(): string;
click: (eventArgs: MouseEventArgs) => void;
dbclick: (eventArgs: MouseEventArgs) => void;
entitychanged: (entity: Entity) => void;
mousedown: (eventArgs: MouseEventArgs) => void;
mouseout: (eventArgs: MouseEventArgs) => void;
mouseover: (eventArgs: MouseEventArgs) => void;
mouseup: (eventArgs: MouseEventArgs) => void;
rightclick: (eventArgs: MouseEventArgs) => void;
}
}

View File

@ -79,10 +79,6 @@ declare module Microsoft.Maps.Directions {
isExactLocation(): boolean;
isViapoint(): boolean;
setOptions(options: WaypointOptions): void;
changed: (args: WaypointEventArgs) => void;
geocoded: (args: WaypointEventArgs) => void;
reverseGeocoded: (args: WaypointEventArgs) => void;
}
export interface DirectionsRenderOptions {
@ -185,27 +181,6 @@ declare module Microsoft.Maps.Directions {
setMapView(): void;
setRenderOptions(options: DirectionsRenderOptions): void;
setRequestOptions(options: DirectionsRequestOptions): void;
afterRouteSelectorRender: (args: RouteSelectorRenderEventArgs) => void;
afterStepRender: (args: DirectionsStepRenderEventArgs) => void;
afterSummaryRender: (args: RouteSummaryRenderEventArgs) => void;
afterWaypointRender: (args: WaypointRenderEventArgs) => void;
beforeDisambiguationRender: (args: DisambiguationRenderEventArgs) => void;
beforeRouteSelectorRender: (args: RouteSelectorRenderEventArgs) => void;
beforeStepRender: (args: DirectionsStepRenderEventArgs) => void;
beforeSummaryRender: (args: RouteSummaryRenderEventArgs) => void;
beforeWaypointRender: (args: WaypointRenderEventArgs) => void;
directionsError: (args: DirectionsErrorEventArgs) => void;
directionsUpdated: (args: DirectionsEventArgs) => void;
dragDropCompleted: () => void;
itineraryStepClicked: (args: DirectionsStepEventArgs) => void;
mouseEnterRouteSelector: (args: RouteSelectorEventArgs) => void;
mouseEnterStep: (args: DirectionsStepEventArgs) => void;
mouseLeaveRouteSelector: (args: RouteSelectorEventArgs) => void;
mouseLeaveStep: (args: DirectionsStepEventArgs) => void;
routeSelectorClicked: (args: RouteSelectorEventArgs) => void;
waypointAdded: (args: WaypointEventArgs) => void;
waypointRemoved: (args: WaypointEventArgs) => void;
}
export interface DirectionsStepEventArgs {

View File

@ -6,7 +6,7 @@
/// <reference path="Microsoft.Maps.d.ts"/>
declare module Microsoft.Maps.Search {
export interface Address {
addressLine: string;
adminDistrict: string;
@ -25,12 +25,12 @@ declare module Microsoft.Maps.Search {
}
export interface GeocodeRequestOptions {
bounds: LocationRect;
callback: (result: GeocodeResult, userData: any) => any;
bounds?: LocationRect;
callback?: (result: GeocodeResult, userData: any) => any;
count: number;
errorCallback: (options: GeocodeRequestOptions) => any;
timeout: number;
userData: any;
errorCallback?: (options: GeocodeRequestOptions) => any;
timeout?: number;
userData?: any;
where:string;
}
@ -71,15 +71,15 @@ declare module Microsoft.Maps.Search {
}
export interface ReverseGeocodeRequestOptions {
callback: (result: PlaceResult, userData: any) => any;
errorCallback: (options: ReverseGeocodeRequestOptions) => any;
location: Location;
timeout: number;
userData:any;
callback?: (result: PlaceResult, userData: any) => any;
errorCallback?: (options: ReverseGeocodeRequestOptions) => any;
location?: Location;
timeout?: number;
userData?:any;
}
export class SearchManager {
constructor(map: Map);
geocode(request: GeocodeRequestOptions): void;
@ -104,16 +104,16 @@ declare module Microsoft.Maps.Search {
}
export interface SearchRequestOptions {
callback:(result: SearchResponse, userData: any)=>any;
callback?:(result: SearchResponse, userData: any)=>any;
count: number;
errorCallback:(options: SearchRequestOptions)=>any;
query: string;
startIndex: number;
timeout: number;
entityType: string;
userData: any;
what: string;
where:string;
errorCallback?:(options: SearchRequestOptions)=>any;
query?: string;
startIndex?: number;
timeout?: number;
entityType?: string;
userData?: any;
what?: string;
where?:string;
}
export interface SearchResponse {
@ -149,4 +149,4 @@ declare module Microsoft.Maps.Search {
website:string;
}
}
}

View File

@ -11,20 +11,23 @@ declare module Microsoft.Maps.VenueMaps {
eventArgs: MouseEventArgs;
}
export interface PrimitiveResponse {
eventArgs: Primitive;
}
export interface Directory {
addToDOM(div: HTMLElement, sortOrder: DirectorySortOrder, to_group_or_not: DirectoryGrouping): void;
createUIElements(): void;
handleMouseClick(response: MouseResponse): void;
handleMouseOut(response: MouseResponse): void;
handleMouseOver(response: MouseResponse): void;
handleMouseClick(e: (response: MouseResponse) => void): void;
handleMouseClick(e: (response: PrimitiveResponse) => void): void;
handleMouseOut(e: (response: MouseResponse) => void): void;
handleMouseOut(e: (response: PrimitiveResponse) => void): void;
handleMouseOver(e: (response: MouseResponse) => void): void;
handleMouseOver(e: (response: PrimitiveResponse) => void): void;
isInDOM(): boolean;
removeFromDOM(): void;
setHeight(height: number): void;
click: (eventArgs: MouseEventArgs) => any;
mouseOut: (eventArgs: MouseEventArgs) => any;
mouseOver: (eventArgs: MouseEventArgs) => any;
}
export enum DirectoryGrouping {
@ -67,10 +70,10 @@ declare module Microsoft.Maps.VenueMaps {
}
export interface NearbyVenueOptions {
callback: (maps: Array<VenueMap>) => any;
location: Location;
map: Map;
radius: number;
callback?: (maps: Array<VenueMap>) => any;
location?: Location;
map?: Map;
radius?: number;
}
export interface Polygon {
@ -116,12 +119,6 @@ declare module Microsoft.Maps.VenueMaps {
hide(): void;
setActiveFloor(floor: string): void;
show(): void;
click: (eventArgs: Primitive) => any;
close: () => any;
footprintclick: (eventArgs: Primitive) => any;
mouseout: (eventArgs: Primitive) => any;
mouseover: (eventArgs: Primitive) => any;
}
export interface VenueMapCreationOptions {
@ -138,4 +135,4 @@ declare module Microsoft.Maps.VenueMaps {
getNearbyVenues(options: NearbyVenueOptions): void;
}
}
}

View File

@ -45,7 +45,7 @@ declare module Microsoft.Maps {
getNorth(): number;
getNorthwest(): Location;
getSouth(): number;
getSouthEast(): Location;
getSoutheast(): Location;
getWest(): number;
intersects(rect: LocationRect): boolean;
toString(): string;
@ -96,7 +96,8 @@ declare module Microsoft.Maps {
export class Map {
constructor(containerElement: HTMLElement, options: MapOptions);
constructor(containerElement: HTMLElement, options?: MapOptions);
constructor(containerElement: HTMLElement, options?: ViewOptions);
entities: EntityCollection;
@ -137,39 +138,25 @@ declare module Microsoft.Maps {
setMapType(mapTypeId: MapTypeId): void;
setOptions(options: MapOptions): void;
setView(options: ViewOptions): void;
tryLocationToPixel(locations: Array<Location>, reference?: PixelReference): any;
tryPixelToLocation(points: Array<Point>, reference?: PixelReference): any;
click: (eventArgs: MouseEventArgs) => void;
copyrightchanged: () => void;
dblclick: (eventArgs: MouseEventArgs) => void;
imagerychanged: () => void;
keydown: (eventArgs: KeyEventArgs) => void;
keypress: (eventArgs: KeyEventArgs) => void;
keyup: (eventArgs: KeyEventArgs) => void;
maptypechanged: () => void;
mousedown: (eventArgs: MouseEventArgs) => void;
mousemove: (eventArgs: MouseEventArgs) => void;
mouseout: (eventArgs: MouseEventArgs) => void;
mouseover: (eventArgs: MouseEventArgs) => void;
mouseup: (eventArgs: MouseEventArgs) => void;
mousewheel: (eventArgs: MouseEventArgs) => void;
rightlick: (eventArgs: MouseEventArgs) => void;
targetviewchanged: () => void;
tiledownloadcomplete: () => void;
viewchange: () => void;
viewchangeend: () => void;
viewchangestart: () => void;
tryLocationToPixel(locations: Location, reference?: PixelReference): Point;
tryLocationToPixel(locations: Array<Location>, reference?: PixelReference): Array<Point>;
tryPixelToLocation(points: Point, reference?: PixelReference): Location;
tryPixelToLocation(points: Array<Point>, reference?: PixelReference): Array<Location>;
}
export class MapMode {
getDrawShapesInSingleLayer(): boolean;
getShouldClipPolygons(): boolean;
setOptions(options: MapOptions): void;
setOptions(options: MapModeOptions): void;
setViewChangeEndDelay(delay: number): void;
}
export interface MapModeOptions {
shouldClipPolygons?: boolean;
drawShapesInSingleLayer?:boolean;
}
export interface MapOptions {
backgroundColor?: Color;
@ -272,14 +259,14 @@ declare module Microsoft.Maps {
}
export interface EntityCollectionOptions {
bubble: boolean;
visible: boolean;
zIndex: number;
bubble?: boolean;
visible?: boolean;
zIndex?: number;
}
export class EntityCollection {
constructor(options: EntityCollectionOptions);
constructor(options?: EntityCollectionOptions);
clear(): void;
get(index: number): Entity;
@ -295,9 +282,6 @@ declare module Microsoft.Maps {
setOptions(options: EntityCollectionOptions): void;
toString(): string;
entityAdded: (args: EntityChangeArgs) => any;
entityChanged: (args: EntityChangeArgs) => any;
entityRemoved: (args: EntityChangeArgs) => any;
}
export class Infobox {
@ -325,11 +309,6 @@ declare module Microsoft.Maps {
setLocation(location: Location): void;
setOptions(options: InfoboxOptions): void;
toString(): string;
click: (eventArgs: MouseEventArgs) => void;
entitychanged: (entity: Entity) => void;
mouseenter: (eventArgs: MouseEventArgs) => void;
mouseleave: (eventArgs: MouseEventArgs) => void;
}
export interface Action {
@ -378,15 +357,11 @@ declare module Microsoft.Maps {
setLocations(locations: Array<Location>): void;
setOptions(options: PolylineOptions): void;
toString(): string;
}
click: (eventArgs: MouseEventArgs) => void;
dblclick: (eventArgs: MouseEventArgs) => void;
entitychanged: (entity: Entity) => void;
mousedown: (eventArgs: MouseEventArgs) => void;
mouseout: (eventArgs: MouseEventArgs) => void;
mouseover: (eventArgs: MouseEventArgs) => void;
mouseup: (eventArgs: MouseEventArgs) => void;
rightclick: (eventArgs: MouseEventArgs) => void;
export class Position {
coords: Coordinates;
timestamp: string;
}
export interface PolylineOptions {
@ -409,20 +384,11 @@ declare module Microsoft.Maps {
setLocations(locations: Location[]): void;
setOptions(options: PolylineOptions): void;
toString(): string;
click: (eventArgs: MouseEventArgs) => void;
dbclick: (eventArgs: MouseEventArgs) => void;
entitychanged: (entity: Entity) => void;
mousedown: (eventArgs: MouseEventArgs) => void;
mouseout: (eventArgs: MouseEventArgs) => void;
mouseover: (eventArgs: MouseEventArgs) => void;
mouseup: (eventArgs: MouseEventArgs) => void;
rightclick: (eventArgs: MouseEventArgs) => void;
}
export interface PolygonOptions {
fillColor?: Color;
infoBox?: Infobox;
infobox?: Infobox;
strokeColor?: Color;
strokeDashArray?: string;
strokeThickness?: number;
@ -446,18 +412,6 @@ declare module Microsoft.Maps {
setLocation(location: Location): void;
setOptions(options: PushpinOptions): void;
toString(): string;
click: (eventArgs: MouseEventArgs) => void;
dblclick: (eventArgs: MouseEventArgs) => void;
drag: (object: Pushpin) => any;
dragend: (eventArgs: MouseEventArgs) => void;
dragstart: (eventArgs: MouseEventArgs) => void;
entitychanged: (object: { entity: Entity; }) => any;
mousedown: (eventArgs: MouseEventArgs) => void;
mouseout: (eventArgs: MouseEventArgs) => void;
mouseover: (eventArgs: MouseEventArgs) => void;
mouseup: (eventArgs: MouseEventArgs) => void;
rightclick: (eventArgs: MouseEventArgs) => void;
}
export enum EntityState {
@ -487,13 +441,11 @@ declare module Microsoft.Maps {
constructor(options: TileLayerOptions);
getOpacty(): number;
getOpacity(): number;
getTileSource(projection: string): TileSource;
getZIndex(): number;
setOptions(options: TileLayerOptions): void;
toString(): string;
tiledownloadcomplete: () => void;
}
export class TileSource {
@ -509,7 +461,7 @@ declare module Microsoft.Maps {
export interface TileSourceOptions {
height?: number;
uriConstructor: string;
uriConstructor: any;
width?: number;
}
@ -550,9 +502,18 @@ declare module Microsoft.Maps {
removeAccuracyCircle(): void;
}
export interface PositionOptionsErrorCallbackResult {
internalError: PositionError;
errorCode:number;
}
export interface PositionOptions {
enableHighAccuracy?: boolean;
errorCallback?:(result:PositionOptionsErrorCallbackResult)=>void;
}
export interface PositionCircleOptions {
polygonOptions: PolygonOptions;
showOnMap: boolean;
showOnMap?: boolean;
}
export class PositionError {
@ -567,7 +528,7 @@ declare module Microsoft.Maps {
homeRegion?: string;
}
export function loadModule(moduleKey: string, options: ModuleOptions): void;
export function loadModule(moduleKey: string, options?: ModuleOptions): void;
export function moduleLoaded(moduleKey: string): void;
export function registerModule(moduleKey: string, scriptUrl: string, options?: ModuleOptions): void;
}

View File

@ -20,8 +20,7 @@ declare class Promise<R> implements Promise.Thenable<R> {
/**
* Create a new promise. The passed in function will receive functions `resolve` and `reject` as its arguments which can be called to seal the fate of the created promise.
*/
constructor(callback: (resolve: (thenable: Promise.Thenable<R>) => void, reject: (error: any) => void) => void);
constructor(callback: (resolve: (result: R) => void, reject: (error: any) => void) => void);
constructor(callback: (resolve: (thenableOrResult: R | Promise.Thenable<R>) => void, reject: (error: any) => void) => void);
/**
* Promises/A+ `.then()` with progress handler. Returns a new promise chained from this promise. The new promise will be rejected or resolved dedefer on the passed `fulfilledHandler`, `rejectedHandler` and the state of this promise.

View File

@ -144,6 +144,10 @@ var BlueBird: typeof Promise;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
var nodeCallbackFunc = (callback: (err: any, result: string) => void) => {}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
fooThen = fooProm;
barThen = barProm;
@ -616,6 +620,7 @@ func = Promise.promisify(f, obj);
;
obj = Promise.promisifyAll(obj);
anyProm = Promise.fromNode(callback => nodeCallbackFunc(callback));
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -20,8 +20,7 @@ declare class Promise<R> implements Promise.Thenable<R>, Promise.Inspection<R> {
/**
* Create a new promise. The passed in function will receive functions `resolve` and `reject` as its arguments which can be called to seal the fate of the created promise.
*/
constructor(callback: (resolve: (thenable: Promise.Thenable<R>) => void, reject: (error: any) => void) => void);
constructor(callback: (resolve: (result: R) => void, reject: (error: any) => void) => void);
constructor(callback: (resolve: (thenableOrResult: R | Promise.Thenable<R>) => void, reject: (error: any) => void) => void);
/**
* Promises/A+ `.then()` with progress handler. Returns a new promise chained from this promise. The new promise will be rejected or resolved dedefer on the passed `fulfilledHandler`, `rejectedHandler` and the state of this promise.
@ -416,7 +415,13 @@ declare class Promise<R> implements Promise.Thenable<R>, Promise.Inspection<R> {
* Note that the original methods on the object are not overwritten but new methods are created with the `Async`-postfix. For example, if you `promisifyAll()` the node.js `fs` object use `fs.statAsync()` to call the promisified `stat` method.
*/
// TODO how to model promisifyAll?
static promisifyAll(target: Object): Object;
static promisifyAll(target: Object, options?: Object): Object;
/**
* Returns a promise that is resolved by a node style callback function.
*/
static fromNode(resolver: (callback: (err: any, result: any) => void) => void): Promise<any>;
/**
* Returns a function that can use `yield` to run asynchronous code synchronously. This feature requires the support of generators which are drafted in the next version of the language. Node version greater than `0.11.2` is required and needs to be executed with the `--harmony-generators` (or `--harmony`) command-line switch.

View File

@ -6,7 +6,7 @@
/// <reference path="../express/express.d.ts" />
declare module "body-parser" {
import express = require('express');
import * as express from "express";
/**
* bodyParser: use individual json/urlencoded middlewares

3
boom/boom.d.ts vendored
View File

@ -6,7 +6,8 @@
/// <reference path="../node/node.d.ts" />
declare module Boom {
interface BoomError {
export interface BoomError {
data: any;
reformat: () => void;
isBoom: boolean;

3
bunyan/bunyan.d.ts vendored
View File

@ -18,6 +18,7 @@ declare module "bunyan" {
child(obj:Object, simple?:boolean):Logger;
reopenFileStreams():void;
level():string|number;
level(value: number | string):void;
levels(name: number | string, value: number | string):void;
@ -50,7 +51,7 @@ declare module "bunyan" {
interface LoggerOptions {
name: string;
streams?: Stream[];
level?: string;
level?: string | number;
stream?: WritableStream;
serializers?: Serializers;
src?: boolean;

2
chance/chance.d.ts vendored
View File

@ -127,7 +127,7 @@ declare module Chance {
guid(): string;
hash(opts?: Options): string;
n<T>(generator: () => T, count: number, opts?: Options): T[];
normal(opts?: Options): string;
normal(opts?: Options): number;
radio(opts?: Options): string;
rpg(dice: string): number[];
rpg(dice: string, opts?: Options): number[]|number;

View File

@ -74,6 +74,8 @@ interface Cheerio {
children(selector?: string): Cheerio;
contents(): Cheerio;
each(func: (index: number, element: CheerioElement) => any): Cheerio;
map(func: (index: number, element: CheerioElement) => any): Cheerio;

View File

@ -1,4 +1,4 @@
/// <reference path="chocolatechipjs.d.ts" />
/// <reference path="../chocolatechipjs/chocolatechipjs.d.ts" />
// ChocolateChipStatic -- DOM creation, etc.
$(function() {
alert('Ready to do stuff!');
@ -16,7 +16,6 @@ var nodeName = divTag2[0].nodeName;
var version = $.version;
var libraryName = $.libraryName;
var els = $('li');
var listItems = $.slice(els);
var madeEls = $.make('<p>Stuff</p>');
var moreEls = $.html('<p>Stuff</p>');
var oldTag = $('#oldTag');
@ -44,7 +43,7 @@ $.isInteger(123);
$.isInteger(123.123); // should return false
$.isFloat(123.123); // should return true
var newUuid = $.makeUuid();
$.each(['a', 'b', 'c'], function(ctx, idx) {
$.each(['a', 'b', 'c'], function(ctx: string, idx: number) {
console.log(ctx);
console.log(idx);
});
@ -241,109 +240,145 @@ var myPromise = new Promise(function(resolve, reject) {
myPromise.then(function(value) {
// Success:
console.log(value);
},
// Opps! There was a problem:
function(reason) {
console.log(reason);
});
},
// Opps! There was a problem:
function(reason) {
console.log(reason);
});
// Ajax:
$.ajax({
url: "announcement.html",
dataType: "html",
success: function(data) {
// Insert the fragment into the page:
$("#content").html(data);
},
error: function(data) {
$("#content").html("<h4>There was an error while trying to get the file.</h4>");
}
// Fetch API
//===========
// GET:
interface WineObject {
data: Array<WineInterface>;
}
interface WineInterface {
wine: {
name: string;
}
}
fetch('../data/wines.json')
.then($.json)
.then(function<WineObject>(obj: any):any {
$('#message_ajax').empty();
obj.data.forEach(function(wine: any) {
$('#message_ajax').append('<li>' + wine.name + '</li>');
})
});
$.ajax({
url: "me.json",
success: function(data) {
// Before using a JSON object, you need to parse it.
// Here we parse it and assign it to a variable:
var me = JSON.parse(data);
// Here we access the properties of the JSON object:
$("#content").html(me.firstName + " " + me.lastName);
},
error: function(data) {
$('#content').html("<h4>There was an error while trying to get the file.</h4>");
}
});
var myData = {
"name": "Bozo the Clown",
"occupation": "Clown"
};
var mySuccessCallback = function() {
console.log('The post was a success!');
};
var myErrorCallback = function() {
console.log('Ooops! There was a problem posting this.');
};
$.ajax({
url: "/path/to/controller",
method: 'POST',
headers: {
"Content-Type": "application/x-www-form-urlencoded",
"async": true,
"Access-Control-Allow-Origin": "*",
"Accept": "text/plain"
},
data: myData,
success: mySuccessCallback,
error: myErrorCallback
});
$.get('http://my.com/data/stuff.html')
.then(function(response) {
console.log("Success!", response);
}, function(error) {
console.error("Failed!", error);
});
$.get('http://my.com/data/stuff.html')
.then(function(response) {
console.log("Success!", response);
})
.catch(function(error) {
console.error("Failed!", error);
});
$.get('story.json')
.then(JSON.parse)
.then(function(response) {
console.log("Yey JSON!", response);
});
$.getJSON('/data/deserts.json', function(desserts: Array<any>) {
desserts.forEach(function(dessert) {
$('#deserts').append('<li>' + dessert.name + '</li>');
});
});
$.post("updateUser.php",
{ "name": "Joe", "time": "10PM" },
function() {
console.log('The POST was successful.')
},
"json"
);
$.JSONP({ url: 'https://api.github.com/users/yui?callback=?' })
.then(function(users) {
$('.list').append('<li><h3>The name of the library</h3><h4>' + users.data.name + '</h4></li>');
})
.catch(function(err) {
console.log('Unable to get data.')
});
$.JSONP({
url: 'http://www.geonames.org/postalCodeLookupJSON?postalcode=94102&'
// POST:
interface postData {
email: string;
name: string;
msg: string;
}
var formData = $.serialize($('form')[0]);
fetch('../controllers/php-post.php', {
method: 'post',
headers: {
"Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
},
body: formData
})
.then(function(data) {
$('.list').append('<li><h3>My Location</h3><h4>' + data.postalcodes[0].adminName2 + ', ' + data.postalcodes[0].adminName1 + '</h4></li>');
.then($.json)
.then(function<postData>(data: any): any {
if(data.email_check == "valid"){
$("#message_ajax").html("<div class='successMessage'>" + data.email + " is a valid e-mail address. Thank you, " + data.name + ".</div>");
$("#message_ajax").append('<p>' + data.msg + '</p>');
} else {
$("#message_ajax").html("<div class='errorMessage'>Sorry " + data.name + ", " + data.email + " is NOT a valid e-mail address. Try again.</div>");
}
});
// PUT:
interface putData {
base: string;
result: string;
fileName: string;
}
var putData = $('#fileText').val();
fetch('../controllers/php-put.php', {
method: 'put',
headers: {
"Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
},
body: putData
})
.then($.json)
.then(function<putData>(data:any): any {
console.dir(data.base);
$("#message_ajax").append('<p>' + data.result + '</p>');
$("#message_ajax").append('<p>The file name is: ' + data.fileName + '</p>');
})
.catch(function(error:Error) {
console.log(error);
$("#message_ajax").html("<div class='errorMessage'>Sorry, put was not successful.</div>");
});
// DELETE:
interface deleteData {
result: string;
}
var file = $('#fileName').val();
fetch('../controllers/php-delete.php', {
method: 'delete',
headers: {
"Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
},
body: file
})
.then($.json)
.then(function<deleteData>(data: any): any {
$("#message_ajax").html("<div>DELETE was sent to the server successfully.</div>");
$("#message_ajax").append('<p>' + data.result + '</p>');
},
function(data: any) {
console.log('PROBLEM')
console.log(data);
})
.catch(function(error: any) {
$("#message_ajax").html("<div class='errorMessage'>Sorry, 'DELETE' was not successful.</div>");
error.reject();
});
// Timeout:
var formData2 = $.serialize($('form')[0]);
fetch('../controllers/php-post.php', {
method: 'post',
headers: {
"Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
},
body: formData,
// Set timeout:
timeout: 10000
})
.then($.json)
.then(function <postData>(data: any): any {
if (data.email_check == "valid") {
$("#message_ajax").html("<div class='successMessage'>" + data.email + " is a valid e-mail address. Thank you, " + data.name + ".</div>");
$("#message_ajax").append('<p>' + data.msg + '</p>');
} else {
$("#message_ajax").html("<div class='errorMessage'>Sorry " + data.name + ", " + data.email + " is NOT a valid e-mail address. Try again.</div>");
}
})
.catch(function(err) {
console.log('Unable to get data.')
// Catch timeout:
.catch(function(error) {
console.log(error);
});
// $.jsonp:
$.jsonp('https://api.github.com/users/rbiggs/repos?name=chipper', {timeout: 10000})
.then($.json)
.then(function(obj: any): any {
console.log(obj);
obj.data.forEach(function(repo: any): any {
$('#message_ajax').append("<li>" + repo.name + "</li>");
});
})
.catch(function(error: any): any {
$('#message_ajax').append("<li>" + error.message + "</li>")
});
// Templates:
var myTemplate = '<li>Name: [[= data.name]]</li>';
var userInfo = {
@ -375,13 +410,16 @@ var repeaterTmplate2 = '<li>[[= data.firstName ]], [[= data.lastName]]</li>';
// Pass in the array of persons:
$.template.repeater($('#objectArrayList'), repeaterTmplate2, luminaries.persons);
// Code for declarative repeater:
$.template.data['myRepeater'] = [{ name: "Joe" }, { name: "Sally" }, {name: "Tom" }];
$.template.repeater();
// Pub/Sub:
var arraySubscriber = function(topic: string, data: any) {
var arraySubscriber = function(topic: string, data: any): any {
$('.list').append('<li><h3>' + topic + '</h3><h4>' + data + '</h4></li>');
var newsSubscription = $.subscribe('news/update', arraySubscriber);
};
var newsSubscription = $.subscribe('news/update', arraySubscriber);
$.publish('news/update', 'The New York Stock Exchange rose an unprecedented 1000 points in just three minutes. Analysts and investors are confused and uncertain how to respond.');
$.unsubscribe('news/update');
// Due to being unsubscribed above, this does nothing:
$.publish('news/update', 'We have nothing further to comment at this time.');

File diff suppressed because it is too large Load Diff

2
chrome/chrome.d.ts vendored
View File

@ -1822,7 +1822,7 @@ declare module chrome.tabCapture {
videoConstraints?: MediaTrackConstraints;
}
export function capture(options: CaptureOptions, callback: (stream: LocalMediaStream) => void): void;
export function capture(options: CaptureOptions, callback: (stream: MediaStream) => void): void;
export function getCapturedTabs(callback: (result: CaptureInfo[]) => void): void;
}

View File

@ -1,4 +1,4 @@
/// <reference path="../chocolatechipjs/chocolatechipjs.d.ts"/>
/// <reference path="../jquery/jquery.d.ts"/>
/// <reference path="chui.d.ts"/>
$(function() {
@ -7,10 +7,10 @@ $(function() {
* Test static methods:
*/
var concatenatedText = $.concat("This", "is", "text", "to", "contatenate.");
$.forEach([1,2,3], function(ctx) {
$.forEach([1,2,3], function(ctx: number) {
return ctx;
});
$.forEach([1,2,3], function(ctx, idx) {
$.forEach([1,2,3], function(ctx: number, idx: number) {
return idx;
});
@ -53,13 +53,13 @@ $(function() {
$.UISheet({id: "mySheet", listClass: "specialList", background: 'red', handle: false});
$.UIShowSheet("#mySheet");
$.UIHideSheet();
$.UISlideout({position: "right", dynamic: false, callback: $.noop});
$.UISlideout({dynamic: false, callback: $.noop});
var myStepper = $('#myStepper');
$.UIResetStepper(myStepper);
$.UICreateSwitch({id: "mySwitch", value: 5, checked: "true", callback: $.noop});
$.UITabbar({ tabs: 3, labels: ["one", "two", "three"], selected: 2 });
$.UISearch({ articleId: "#main", placeholder: "Looking?", results: 10 });
var carouselPanels = $('li');
var carouselPanels = $("<li>1</li><li>2</li><li>3</li>");
$.UISetupCarousel({target: "#carousel", panels: carouselPanels});
$.UIBindData();
$.UIBindData("#myBoundData");

1649
chui/chui.d.ts vendored

File diff suppressed because it is too large Load Diff

View File

@ -7,8 +7,8 @@ declare function CodeMirror(host: HTMLElement, options?: CodeMirror.EditorConfig
declare function CodeMirror(callback: (host: HTMLElement) => void , options?: CodeMirror.EditorConfiguration): CodeMirror.Editor;
declare module CodeMirror {
export var Doc : CodeMirror.Doc;
export var Pos: CodeMirror.Position;
export var Doc : CodeMirror.DocConstructor;
export var Pos: CodeMirror.PositionConstructor;
export var Pass: any;
function fromTextArea(host: HTMLTextAreaElement, options?: EditorConfiguration): CodeMirror.EditorFromTextArea;
@ -88,84 +88,84 @@ declare module CodeMirror {
or the line the widget is on require the widget to be redrawn. */
function on(line: LineWidget, eventName: 'redraw', handler: () => void ): void;
function off(line: LineWidget, eventName: 'redraw', handler: () => void ): void;
/** Various CodeMirror-related objects emit events, which allow client code to react to various situations.
Handlers for such events can be registered with the on and off methods on the objects that the event fires on.
/** Various CodeMirror-related objects emit events, which allow client code to react to various situations.
Handlers for such events can be registered with the on and off methods on the objects that the event fires on.
To fire your own events, use CodeMirror.signal(target, name, args...), where target is a non-DOM-node object. */
function signal(target: any, name: string, ...args: any[]): void;
interface Editor {
/** Tells you whether the editor currently has focus. */
hasFocus(): boolean;
/** Used to find the target position for horizontal cursor motion.start is a { line , ch } object,
amount an integer(may be negative), and unit one of the string "char", "column", or "word".
Will return a position that is produced by moving amount times the distance specified by unit.
When visually is true , motion in right - to - left text will be visual rather than logical.
When the motion was clipped by hitting the end or start of the document, the returned value will have a hitSide property set to true. */
findPosH(start: CodeMirror.Position, amount: number, unit: string, visually: boolean): { line: number; ch: number; hitSide?: boolean; };
/** Similar to findPosH , but used for vertical motion.unit may be "line" or "page".
The other arguments and the returned value have the same interpretation as they have in findPosH. */
findPosV(start: CodeMirror.Position, amount: number, unit: string): { line: number; ch: number; hitSide?: boolean; };
/** Change the configuration of the editor. option should the name of an option, and value should be a valid value for that option. */
setOption(option: string, value: any): void;
/** Retrieves the current value of the given option for this editor instance. */
getOption(option: string): any;
/** Attach an additional keymap to the editor.
This is mostly useful for add - ons that need to register some key handlers without trampling on the extraKeys option.
Maps added in this way have a higher precedence than the extraKeys and keyMap options, and between them,
the maps added earlier have a lower precedence than those added later, unless the bottom argument was passed,
in which case they end up below other keymaps added with this method. */
addKeyMap(map: any, bottom?: boolean): void;
/** Disable a keymap added with addKeyMap.Either pass in the keymap object itself , or a string,
which will be compared against the name property of the active keymaps. */
removeKeyMap(map: any): void;
/** Enable a highlighting overlay.This is a stateless mini - mode that can be used to add extra highlighting.
For example, the search add - on uses it to highlight the term that's currently being searched.
mode can be a mode spec or a mode object (an object with a token method). The options parameter is optional. If given, it should be an object.
Currently, only the opaque option is recognized. This defaults to off, but can be given to allow the overlay styling, when not null,
to override the styling of the base mode entirely, instead of the two being applied together. */
addOverlay(mode: any, options?: any): void;
/** Pass this the exact argument passed for the mode parameter to addOverlay to remove an overlay again. */
removeOverlay(mode: any): void;
/** Retrieve the currently active document from an editor. */
getDoc(): CodeMirror.Doc;
/** Attach a new document to the editor. Returns the old document, which is now no longer associated with an editor. */
swapDoc(doc: CodeMirror.Doc): CodeMirror.Doc;
/** Sets the gutter marker for the given gutter (identified by its CSS class, see the gutters option) to the given value.
Value can be either null, to clear the marker, or a DOM element, to set it. The DOM element will be shown in the specified gutter next to the specified line. */
setGutterMarker(line: any, gutterID: string, value: HTMLElement): CodeMirror.LineHandle;
/** Remove all gutter markers in the gutter with the given ID. */
clearGutter(gutterID: string): void;
/** Set a CSS class name for the given line.line can be a number or a line handle.
where determines to which element this class should be applied, can can be one of "text" (the text element, which lies in front of the selection),
"background"(a background element that will be behind the selection),
or "wrap" (the wrapper node that wraps all of the line's elements, including gutter elements).
class should be the name of the class to apply. */
addLineClass(line: any, where: string, _class_: string): CodeMirror.LineHandle;
/** Remove a CSS class from a line.line can be a line handle or number.
where should be one of "text", "background", or "wrap"(see addLineClass).
class can be left off to remove all classes for the specified node, or be a string to remove only a specific class. */
removeLineClass(line: any, where: string, class_: string): CodeMirror.LineHandle;
/** Returns the line number, text content, and marker status of the given line, which can be either a number or a line handle. */
lineInfo(line: any): {
line: any;
@ -179,12 +179,12 @@ declare module CodeMirror {
/** Array of line widgets attached to this line. */
widgets: any;
};
/** Puts node, which should be an absolutely positioned DOM node, into the editor, positioned right below the given { line , ch } position.
When scrollIntoView is true, the editor will ensure that the entire node is visible (if possible).
To remove the widget again, simply use DOM methods (move it somewhere else, or call removeChild on its parent). */
addWidget(pos: CodeMirror.Position, node: HTMLElement, scrollIntoView: boolean): void;
/** Adds a line widget, an element shown below a line, spanning the whole of the editor's width, and moving the lines below it downwards.
line should be either an integer or a line handle, and node should be a DOM node, which will be displayed below the given line.
options, when given, should be an object that configures the behavior of the widget.
@ -199,16 +199,16 @@ declare module CodeMirror {
/** When true, will cause the widget to be rendered even if the line it is associated with is hidden. */
showIfHidden: boolean;
}): CodeMirror.LineWidget;
/** Programatically set the size of the editor (overriding the applicable CSS rules).
width and height height can be either numbers(interpreted as pixels) or CSS units ("100%", for example).
You can pass null for either of them to indicate that that dimension should not be changed. */
setSize(width: any, height: any): void;
/** Scroll the editor to a given(pixel) position.Both arguments may be left as null or undefined to have no effect. */
scrollTo(x: number, y: number): void;
/** Get an { left , top , width , height , clientWidth , clientHeight } object that represents the current scroll position, the size of the scrollable area,
and the size of the visible area(minus scrollbars). */
getScrollInfo(): {
@ -219,53 +219,53 @@ declare module CodeMirror {
clientWidth: any;
clientHeight: any;
}
/** Scrolls the given element into view. pos is a { line , ch } position, referring to a given character, null, to refer to the cursor.
The margin parameter is optional. When given, it indicates the amount of pixels around the given area that should be made visible as well. */
scrollIntoView(pos: CodeMirror.Position, margin?: number): void;
/** Scrolls the given element into view. pos is a { left , top , right , bottom } object, in editor-local coordinates.
The margin parameter is optional. When given, it indicates the amount of pixels around the given area that should be made visible as well. */
scrollIntoView(pos: { left: number; top: number; right: number; bottom: number; }, margin: number): void;
/** Returns an { left , top , bottom } object containing the coordinates of the cursor position.
If mode is "local" , they will be relative to the top-left corner of the editable document.
If it is "page" or not given, they are relative to the top-left corner of the page.
where is a boolean indicating whether you want the start(true) or the end(false) of the selection. */
cursorCoords(where: boolean, mode: string): { left: number; top: number; bottom: number; };
/** Returns an { left , top , bottom } object containing the coordinates of the cursor position.
If mode is "local" , they will be relative to the top-left corner of the editable document.
If it is "page" or not given, they are relative to the top-left corner of the page.
where specifies the precise position at which you want to measure. */
cursorCoords(where: CodeMirror.Position, mode: string): { left: number; top: number; bottom: number; };
/** Returns the position and dimensions of an arbitrary character.pos should be a { line , ch } object.
This differs from cursorCoords in that it'll give the size of the whole character,
rather than just the position that the cursor would have when it would sit at that position. */
charCoords(pos: CodeMirror.Position, mode: string): { left: number; right: number; top: number; bottom: number; };
/** Given an { left , top } object , returns the { line , ch } position that corresponds to it.
The optional mode parameter determines relative to what the coordinates are interpreted. It may be "window" , "page"(the default) , or "local". */
coordsChar(object: { left: number; top: number; }, mode?: string): CodeMirror.Position;
/** Returns the line height of the default font for the editor. */
defaultTextHeight(): number;
/** Returns the pixel width of an 'x' in the default font for the editor.
(Note that for non - monospace fonts , this is mostly useless, and even for monospace fonts, non - ascii characters might have a different width). */
defaultCharWidth(): number;
/** Returns a { from , to } object indicating the start (inclusive) and end (exclusive) of the currently rendered part of the document.
In big documents, when most content is scrolled out of view, CodeMirror will only render the visible part, and a margin around it.
See also the viewportChange event. */
getViewport(): { from: number; to: number };
/** If your code does something to change the size of the editor element (window resizes are already listened for), or unhides it,
you should probably follow up by calling this method to ensure CodeMirror is still looking as intended. */
refresh(): void;
/** Retrieves information about the token the current mode found before the given position (a {line, ch} object). */
getTokenAt(pos: CodeMirror.Position): {
/** The character(on the given line) at which the token starts. */
@ -277,20 +277,20 @@ declare module CodeMirror {
/** The token type the mode assigned to the token, such as "keyword" or "comment" (may also be null). */
type: string;
/** The mode's state at the end of this token. */
state: any;
state: any;
};
/** Returns the mode's parser state, if any, at the end of the given line number.
If no line number is given, the state at the end of the document is returned.
This can be useful for storing parsing errors in the state, or getting other kinds of contextual information for a line. */
getStateAfter(line?: number): any;
/** CodeMirror internally buffers changes and only updates its DOM structure after it has finished performing some operation.
If you need to perform a lot of operations on a CodeMirror instance, you can call this method with a function argument.
It will call the function, buffering up all changes, and only doing the expensive update after the function returns.
This can be a lot faster. The return value from this method will be the return value of your function. */
operation<T>(fn: ()=> T): T;
/** Adjust the indentation of the given line.
The second argument (which defaults to "smart") may be one of:
"prev" Base indentation on the indentation of the previous line.
@ -298,35 +298,42 @@ declare module CodeMirror {
"add" Increase the indentation of the line by one indent unit.
"subtract" Reduce the indentation of the line. */
indentLine(line: number, dir?: string): void;
/** Give the editor focus. */
focus(): void;
/** Returns the hidden textarea used to read input. */
getInputField(): HTMLTextAreaElement;
/** Returns the DOM node that represents the editor, and controls its size. Remove this from your tree to delete an editor instance. */
getWrapperElement(): HTMLElement;
/** Returns the DOM node that is responsible for the scrolling of the editor. */
getScrollerElement(): HTMLElement;
/** Fetches the DOM node that contains the editor gutters. */
getGutterElement(): HTMLElement;
/** Events are registered with the on method (and removed with the off method).
These are the events that fire on the instance object. The name of the event is followed by the arguments that will be passed to the handler.
The instance argument always refers to the editor instance. */
on(eventName: string, handler: (instance: CodeMirror.Editor) => void ): void;
off(eventName: string, handler: (instance: CodeMirror.Editor) => void ): void;
/** Fires every time the content of the editor is changed. */
on(eventName: 'change', handler: (instance: CodeMirror.Editor, change: CodeMirror.EditorChangeLinkedList) => void ): void;
off(eventName: 'change', handler: (instance: CodeMirror.Editor, change: CodeMirror.EditorChangeLinkedList) => void ): void;
/** Like the "change" event, but batched per operation, passing an
* array containing all the changes that happened in the operation.
* This event is fired after the operation finished, and display
* changes it makes will trigger a new operation. */
on(eventName: 'changes', handler: (instance: CodeMirror.Editor, change: CodeMirror.EditorChangeLinkedList[]) => void ): void;
off(eventName: 'changes', handler: (instance: CodeMirror.Editor, change: CodeMirror.EditorChangeLinkedList[]) => void ): void;
/** This event is fired before a change is applied, and its handler may choose to modify or cancel the change.
The changeObj never has a next property, since this is fired for each individual change, and not batched per operation.
Note: you may not do anything from a "beforeChange" handler that would cause changes to the document or its visualization.
@ -334,64 +341,67 @@ declare module CodeMirror {
probably cause the editor to become corrupted. */
on(eventName: 'beforeChange', handler: (instance: CodeMirror.Editor, change: CodeMirror.EditorChangeCancellable) => void ): void;
off(eventName: 'beforeChange', handler: (instance: CodeMirror.Editor, change: CodeMirror.EditorChangeCancellable) => void ): void;
/** Will be fired when the cursor or selection moves, or any change is made to the editor content. */
on(eventName: 'cursorActivity', handler: (instance: CodeMirror.Editor) => void ): void;
off(eventName: 'cursorActivity', handler: (instance: CodeMirror.Editor) => void ): void;
/** This event is fired before the selection is moved. Its handler may modify the resulting selection head and anchor.
Handlers for this event have the same restriction as "beforeChange" handlers <EFBFBD> they should not do anything to directly update the state of the editor. */
on(eventName: 'beforeSelectionChange', handler: (instance: CodeMirror.Editor, selection: { head: CodeMirror.Position; anchor: CodeMirror.Position; }) => void ): void;
off(eventName: 'beforeSelectionChange', handler: (instance: CodeMirror.Editor, selection: { head: CodeMirror.Position; anchor: CodeMirror.Position; }) => void ): void;
/** Fires whenever the view port of the editor changes (due to scrolling, editing, or any other factor).
The from and to arguments give the new start and end of the viewport. */
on(eventName: 'viewportChange', handler: (instance: CodeMirror.Editor, from: number, to: number) => void ): void;
off(eventName: 'viewportChange', handler: (instance: CodeMirror.Editor, from: number, to: number) => void ): void;
/** Fires when the editor gutter (the line-number area) is clicked. Will pass the editor instance as first argument,
the (zero-based) number of the line that was clicked as second argument, the CSS class of the gutter that was clicked as third argument,
and the raw mousedown event object as fourth argument. */
on(eventName: 'gutterClick', handler: (instance: CodeMirror.Editor, line: number, gutter: string, clickEvent: Event) => void ): void;
off(eventName: 'gutterClick', handler: (instance: CodeMirror.Editor, line: number, gutter: string, clickEvent: Event) => void ): void;
/** Fires whenever the editor is focused. */
on(eventName: 'focus', handler: (instance: CodeMirror.Editor) => void ): void;
off(eventName: 'focus', handler: (instance: CodeMirror.Editor) => void ): void;
/** Fires whenever the editor is unfocused. */
on(eventName: 'blur', handler: (instance: CodeMirror.Editor) => void ): void;
off(eventName: 'blur', handler: (instance: CodeMirror.Editor) => void ): void;
/** Fires when the editor is scrolled. */
on(eventName: 'scroll', handler: (instance: CodeMirror.Editor) => void ): void;
off(eventName: 'scroll', handler: (instance: CodeMirror.Editor) => void ): void;
/** Will be fired whenever CodeMirror updates its DOM display. */
on(eventName: 'update', handler: (instance: CodeMirror.Editor) => void ): void;
off(eventName: 'update', handler: (instance: CodeMirror.Editor) => void ): void;
/** Fired whenever a line is (re-)rendered to the DOM. Fired right after the DOM element is built, before it is added to the document.
The handler may mess with the style of the resulting element, or add event handlers, but should not try to change the state of the editor. */
on(eventName: 'renderLine', handler: (instance: CodeMirror.Editor, line: number, element: HTMLElement) => void ): void;
off(eventName: 'renderLine', handler: (instance: CodeMirror.Editor, line: number, element: HTMLElement) => void ): void;
}
interface EditorFromTextArea extends Editor {
/** Copy the content of the editor into the textarea. */
save(): void;
/** Remove the editor, and restore the original textarea (with the editor's current content). */
toTextArea(): void;
/** Returns the textarea that the instance was based on. */
getTextArea(): HTMLTextAreaElement;
}
interface Doc {
new (text: string, mode?: any, firstLineNumber?: number): Doc;
interface DocConstructor {
new (text: string, mode?: any, firstLineNumber?: number, lineSep?: string): Doc;
(text: string, mode?: any, firstLineNumber?: number, lineSep?: string): Doc;
}
interface Doc {
/** Get the current editor content. You can pass it an optional argument to specify the string to be used to separate lines (defaults to "\n"). */
getValue(seperator?: string): string;
@ -461,6 +471,10 @@ declare module CodeMirror {
It may be "start" , "end" , "head"(the side of the selection that moves when you press shift + arrow),
or "anchor"(the fixed side of the selection).Omitting the argument is the same as passing "head".A { line , ch } object will be returned. */
getCursor(start?: string): CodeMirror.Position;
/** Retrieves a list of all current selections. These will always be sorted, and never overlap (overlapping selections are merged).
Each object in the array contains anchor and head properties referring to {line, ch} objects. */
listSelections(): { anchor: CodeMirror.Position; head: CodeMirror.Position }[];
/** Return true if any text is selected. */
somethingSelected(): boolean;
@ -551,7 +565,7 @@ declare module CodeMirror {
/** Returns an array of all the bookmarks and marked ranges present at the given position. */
findMarksAt(pos: CodeMirror.Position): TextMarker[];
/** Returns an array containing all marked ranges in the document. */
getAllMarks(): CodeMirror.TextMarker[];
@ -602,7 +616,7 @@ declare module CodeMirror {
/** Array of strings representing the text that replaced the changed range (split by line). */
text: string[];
/** Text that used to be between from and to, which is overwritten by this change. */
removed: string;
removed: string[];
/** String representing the origin of the change event and wether it can be merged with history */
origin: string;
}
@ -619,8 +633,12 @@ declare module CodeMirror {
cancel(): void;
}
interface Position {
interface PositionConstructor {
new (line: number, ch: number): Position;
(line: number, ch: number): Position;
}
interface Position {
ch: number;
line: number;
}
@ -654,7 +672,7 @@ declare module CodeMirror {
/** Configures whether the editor should re-indent the current line when a character is typed
that might change its proper indentation (only works if the mode supports indentation). Default is true. */
electricChars?: boolean;
/** Determines whether horizontal cursor movement through right-to-left (Arabic, Hebrew) text
is visual (pressing the left arrow moves the cursor left)
or logical (pressing the left arrow moves to the next lower index in the string, which is visually right in right-to-left text).
@ -664,16 +682,16 @@ declare module CodeMirror {
/** Configures the keymap to use. The default is "default", which is the only keymap defined in codemirror.js itself.
Extra keymaps are found in the keymap directory. See the section on keymaps for more information. */
keyMap?: string;
/** Can be used to specify extra keybindings for the editor, alongside the ones defined by keyMap. Should be either null, or a valid keymap value. */
extraKeys?: any;
/** Whether CodeMirror should scroll or wrap for long lines. Defaults to false (scroll). */
lineWrapping?: boolean;
/** Whether to show line numbers to the left of the editor. */
lineNumbers?: boolean;
/** At which number to start counting lines. Default is 1. */
firstLineNumber?: number;
@ -686,23 +704,23 @@ declare module CodeMirror {
May include the CodeMirror-linenumbers class, in order to explicitly set the position of the line number gutter
(it will default to be to the right of all other gutters). These class names are the keys passed to setGutterMarker. */
gutters?: string[];
/** Determines whether the gutter scrolls along with the content horizontally (false)
or whether it stays fixed during horizontal scrolling (true, the default). */
fixedGutter?: boolean;
/** boolean|string. This disables editing of the editor content by the user. If the special value "nocursor" is given (instead of simply true), focusing of the editor is also disallowed. */
readOnly?: any;
/**Whether the cursor should be drawn when a selection is active. Defaults to false. */
showCursorWhenSelecting?: boolean;
/** The maximum number of undo levels that the editor stores. Defaults to 40. */
undoDepth?: number;
/** The period of inactivity (in milliseconds) that will cause a new history event to be started when typing or deleting. Defaults to 500. */
historyEventDelay?: number;
/** The tab index to assign to the editor. If not given, no tab index will be assigned. */
tabindex?: number;
@ -766,73 +784,73 @@ declare module CodeMirror {
This affects the amount of updates needed when scrolling, and the amount of work that such an update does.
You should usually leave it at its default, 10. Can be set to Infinity to make sure the whole document is always rendered,
and thus the browser's text search works on it. This will have bad effects on performance of big documents. */
viewportMargin?: number;
/** Optional lint configuration to be used in conjunction with CodeMirror's linter addon. */
viewportMargin?: number;
/** Optional lint configuration to be used in conjunction with CodeMirror's linter addon. */
lint?: LintOptions;
}
interface TextMarkerOptions {
/** Assigns a CSS class to the marked stretch of text. */
className?: string;
/** Determines whether text inserted on the left of the marker will end up inside or outside of it. */
inclusiveLeft?: boolean;
/** Like inclusiveLeft , but for the right side. */
inclusiveRight?: boolean;
/** Atomic ranges act as a single unit when cursor movement is concerned i.e. it is impossible to place the cursor inside of them.
In atomic ranges, inclusiveLeft and inclusiveRight have a different meaning they will prevent the cursor from being placed
/** Atomic ranges act as a single unit when cursor movement is concerned i.e. it is impossible to place the cursor inside of them.
In atomic ranges, inclusiveLeft and inclusiveRight have a different meaning they will prevent the cursor from being placed
respectively directly before and directly after the range. */
atomic?: boolean;
/** Collapsed ranges do not show up in the display.Setting a range to be collapsed will automatically make it atomic. */
collapsed?: boolean;
/** When enabled, will cause the mark to clear itself whenever the cursor enters its range.
This is mostly useful for text - replacement widgets that need to 'snap open' when the user tries to edit them.
The "clear" event fired on the range handle can be used to be notified when this happens. */
clearOnEnter?: boolean;
/** Determines whether the mark is automatically cleared when it becomes empty. Default is true. */
clearWhenEmpty?: boolean;
/** Determines whether the mark is automatically cleared when it becomes empty. Default is true. */
clearWhenEmpty?: boolean;
/** Use a given node to display this range.Implies both collapsed and atomic.
The given DOM node must be an inline element(as opposed to a block element). */
replacedWith?: HTMLElement;
/** When replacedWith is given, this determines whether the editor will
* capture mouse and drag events occurring in this widget. Default is
* falsethe events will be left alone for the default browser handler,
* or specific handlers on the widget, to capture. */
handleMouseEvents?: boolean;
/** When replacedWith is given, this determines whether the editor will
* capture mouse and drag events occurring in this widget. Default is
* falsethe events will be left alone for the default browser handler,
* or specific handlers on the widget, to capture. */
handleMouseEvents?: boolean;
/** A read - only span can, as long as it is not cleared, not be modified except by calling setValue to reset the whole document.
Note: adding a read - only span currently clears the undo history of the editor,
because existing undo events being partially nullified by read - only spans would corrupt the history (in the current implementation). */
readOnly?: boolean;
/** When set to true (default is false), adding this marker will create an event in the undo history that can be individually undone(clearing the marker). */
addToHistory?: boolean;
/** Can be used to specify an extra CSS class to be applied to the leftmost span that is part of the marker. */
startStyle?: string;
/** Equivalent to startStyle, but for the rightmost span. */
endStyle?: string;
/** A string of CSS to be applied to the covered text. For example "color: #fe3". */
css?: string;
/** When given, will give the nodes created for this span a HTML title attribute with the given value. */
title?: string;
/** A string of CSS to be applied to the covered text. For example "color: #fe3". */
css?: string;
/** When given, will give the nodes created for this span a HTML title attribute with the given value. */
title?: string;
/** When the target document is linked to other documents, you can set shared to true to make the marker appear in all documents.
By default, a marker appears only in its target document. */
shared?: boolean;
}
interface StringStream {
lastColumnPos: number;
lastColumnValue: number;
@ -1027,48 +1045,48 @@ declare module CodeMirror {
* Both modes get to parse all of the text, but when both assign a non-null style to a piece of code, the overlay wins, unless
* the combine argument was true and not overridden, or state.overlay.combineTokens was true, in which case the styles are combined.
*/
function overlayMode<T, S>(base: Mode<T>, overlay: Mode<S>, combine?: boolean): Mode<any>
/**
* async specifies that the lint process runs asynchronously. hasGutters specifies that lint errors should be displayed in the CodeMirror
* gutter, note that you must use this in conjunction with [ "CodeMirror-lint-markers" ] as an element in the gutters argument on
* initialization of the CodeMirror instance.
*/
interface LintStateOptions {
async: boolean;
hasGutters: boolean;
}
/**
* Adds the getAnnotations callback to LintStateOptions which may be overridden by the user if they choose use their own
* linter.
*/
interface LintOptions extends LintStateOptions {
getAnnotations: AnnotationsCallback;
}
/**
* A function that calls the updateLintingCallback with any errors found during the linting process.
*/
interface AnnotationsCallback {
(content: string, updateLintingCallback: UpdateLintingCallback, options: LintStateOptions, codeMirror: Editor): void;
}
/**
* A function that, given an array of annotations, updates the CodeMirror linting GUI with those annotations
*/
interface UpdateLintingCallback {
(codeMirror: Editor, annotations: Annotation[]): void;
}
/**
* An annotation contains a description of a lint error, detailing the location of the error within the code, the severity of the error,
* and an explaination as to why the error was thrown.
*/
interface Annotation {
from: Position;
message?: string;
severity?: string;
to?: Position;
function overlayMode<T, S>(base: Mode<T>, overlay: Mode<S>, combine?: boolean): Mode<any>
/**
* async specifies that the lint process runs asynchronously. hasGutters specifies that lint errors should be displayed in the CodeMirror
* gutter, note that you must use this in conjunction with [ "CodeMirror-lint-markers" ] as an element in the gutters argument on
* initialization of the CodeMirror instance.
*/
interface LintStateOptions {
async: boolean;
hasGutters: boolean;
}
/**
* Adds the getAnnotations callback to LintStateOptions which may be overridden by the user if they choose use their own
* linter.
*/
interface LintOptions extends LintStateOptions {
getAnnotations: AnnotationsCallback;
}
/**
* A function that calls the updateLintingCallback with any errors found during the linting process.
*/
interface AnnotationsCallback {
(content: string, updateLintingCallback: UpdateLintingCallback, options: LintStateOptions, codeMirror: Editor): void;
}
/**
* A function that, given an array of annotations, updates the CodeMirror linting GUI with those annotations
*/
interface UpdateLintingCallback {
(codeMirror: Editor, annotations: Annotation[]): void;
}
/**
* An annotation contains a description of a lint error, detailing the location of the error within the code, the severity of the error,
* and an explaination as to why the error was thrown.
*/
interface Annotation {
from: Position;
message?: string;
severity?: string;
to?: Position;
}
}

View File

@ -32,7 +32,7 @@ interface Contacts {
*/
find(fields: string[],
onSuccess: (contacts: Contact[]) => void,
onError: (error: ContactError) => void,
onError?: (error: ContactError) => void,
options?: ContactFindOptions): void;
/**
* The navigator.contacts.pickContact method launches the Contact Picker to select a single contact.

Binary file not shown.

11
cors/cors-tests.ts Normal file
View File

@ -0,0 +1,11 @@
/// <reference path="cors.d.ts" />
import express = require('express');
import cors = require('cors');
var app = express();
app.use(cors());
app.use(cors({
maxAge: 100,
credentials: true
}));

24
cors/cors.d.ts vendored Normal file
View File

@ -0,0 +1,24 @@
// Type definitions for cors
// Project: https://github.com/troygoode/node-cors/
// Definitions by: Mihhail Lapushkin <https://github.com/mihhail-lapushkin/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../express/express.d.ts" />
declare module "cors" {
import express = require('express');
module e {
interface CorsOptions {
origin?: any;
methods?: any;
allowedHeaders?: any;
exposedHeaders?: any;
credentials?: boolean;
maxAge?: number;
}
}
function e(options?: e.CorsOptions): express.RequestHandler;
export = e;
}

View File

@ -1 +0,0 @@

View File

@ -1 +0,0 @@

View File

@ -1 +0,0 @@

2
d3/d3.d.ts vendored
View File

@ -830,7 +830,7 @@ declare module d3 {
style(name: string, value: (datum: Datum, index: number, outerIndex: number) => Primitive, priority?: string): Transition<Datum>;
style(obj: { [key: string]: Primitive | ((datum: Datum, index: number, outerIndex: number) => Primitive) }, priority?: string): Transition<Datum>;
styleTween(name: string, tween: (datum: Datum, index: number, attr: string) => Primitive, priority?: string): Transition<Datum>;
styleTween(name: string, tween: (datum: Datum, index: number, attr: string) => (t: number) => Primitive, priority?: string): Transition<Datum>;
text(value: Primitive): Transition<Datum>;
text(value: (datum: Datum, index: number, outerIndex: number) => Primitive): Transition<Datum>;

View File

@ -0,0 +1,8 @@
/// <reference path="data-driven.d.ts" />
import data_driven = require('data-driven');
data_driven([
{key:"value"},
{key:"foobar"}
],() => {});

9
data-driven/data-driven.d.ts vendored Normal file
View File

@ -0,0 +1,9 @@
// Type definitions for data-driven.js
// Project: https://github.com/fluentsoftware/data-driven
// Definitions by: Adam Babcock <https://github.com/mrhen>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "data-driven" {
function data_driven<T>(data:T[], callback:()=>any):any;
export = data_driven
}

View File

@ -0,0 +1,32 @@
///<reference path="./diff-match-patch.d.ts" />
import DiffMatchPatch = require("diff-match-patch");
var oldValue = "hello world, how are you?";
var newValue = "hello again world. how have you been?";
var diffEngine = new DiffMatchPatch.diff_match_patch();
var diffs = diffEngine.diff_main(oldValue, newValue);
diffEngine.diff_cleanupSemantic(diffs);
var changes = "";
var pattern = "";
diffs.forEach(function(diff) {
var operation = diff[0]; // Operation (insert, delete, equal)
var text = diff[1]; // Text of change
switch (operation) {
case DiffMatchPatch.DIFF_INSERT:
pattern += "I";
break;
case DiffMatchPatch.DIFF_DELETE:
pattern += "D";
break;
case DiffMatchPatch.DIFF_EQUAL:
pattern += "E";
break;
}
changes += text;
});

39
diff-match-patch/diff-match-patch.d.ts vendored Normal file
View File

@ -0,0 +1,39 @@
// Type definitions for diff-match-patch v1.0.0
// Project: https://www.npmjs.com/package/diff-match-patch
// Definitions by: Asana <https://asana.com>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "diff-match-patch" {
type Diff = [number, string];
export class diff_match_patch {
static new (): diff_match_patch;
Diff_Timeout: number;
Diff_EditCost: number;
Match_Threshold: number;
Match_Distance: number;
Patch_DeleteThreshold: number;
Patch_Margin: number;
Match_MaxBits: number;
diff_main(text1: string, text2: string, opt_checklines?: boolean, opt_deadline?: number): Diff[];
diff_commonPrefix(text1: string, text2: string): number;
diff_commonSuffix(text1: string, text2: string): number;
diff_cleanupSemantic(diffs: Diff[]): void;
diff_cleanupSemanticLossless(diffs: Diff[]): void;
diff_cleanupEfficiency(diffs: Diff[]): void;
diff_cleanupMerge(diffs: Diff[]): void;
diff_xIndex(diffs: Diff[], loc: number): number;
diff_prettyHtml(diffs: Diff[]): string;
diff_text1(diffs: Diff[]): string;
diff_text2(diffs: Diff[]): string;
diff_levenshtein(diffs: Diff[]): number;
diff_toDelta(diffs: Diff[]): string;
diff_fromDelta(text1: string, delta: string): Diff[];
}
export var DIFF_DELETE: number;
export var DIFF_INSERT: number;
export var DIFF_EQUAL: number;
}

View File

@ -0,0 +1,37 @@
import dragula = require("dragula");
// containers
var d1 = dragula([document.querySelector('#left'), document.querySelector('#right')]);
// all options
var d2 = dragula({
isContainer: function (el) {
return false;
},
moves: function (el, container, handle) {
return true;
},
accepts: function (el, target, source, sibling) {
return true;
},
invalid: function (el, target) {
return el.tagName === 'A' || el.tagName === 'BUTTON';
},
direction: 'vertical',
copy: false,
revertOnSpill: false,
removeOnSpill: false,
delay: false,
mirrorContainer: document.body
});
// empty call
var d3 = dragula();
// drake API
var drake = dragula({
copy: true
});
drake.containers.push(document.querySelector('#container'));

31
dragula/dragula-tests.ts Normal file
View File

@ -0,0 +1,31 @@
/// <reference path="dragula.d.ts" />
var d1 = dragula([document.querySelector('#left'), document.querySelector('#right')]);
var d2 = dragula({
isContainer: function (el) {
return false;
},
moves: function (el, container, handle) {
return true;
},
accepts: function (el, target, source, sibling) {
return true;
},
invalid: function (el, target) {
return el.tagName === 'A' || el.tagName === 'BUTTON';
},
direction: 'vertical',
copy: false,
revertOnSpill: false,
removeOnSpill: false,
delay: false,
mirrorContainer: document.body
});
var d3 = dragula();
var drake = dragula({
copy: true
});
drake.containers.push(document.querySelector('#container'));

46
dragula/dragula.d.ts vendored Normal file
View File

@ -0,0 +1,46 @@
// Type definitions for dragula v2.1.2
// Project: http://bevacqua.github.io/dragula/
// Definitions by: Paul Welter <https://github.com/pwelter34/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module dragula {
interface DragulaOptions {
containers?: Element[];
isContainer?: (el?: Element) => boolean;
moves?: (el?: Element, container?: Element, handle?: Element) => boolean;
accepts?: (el?: Element, target?: Element, source?: Element, sibling?: Element) => boolean;
invalid?: (el?: Element, target?: Element) => boolean;
direction?: string;
copy?: boolean;
revertOnSpill?: boolean;
removeOnSpill?: boolean;
delay?: boolean | number;
mirrorContainer?: Element;
}
interface Drake {
containers: Element[];
dragging: boolean;
start(item:Element): void;
end(): void;
cancel(revert:boolean): void;
cancel(): void;
remove(): void;
on(events: string, callback: Function): void;
destroy(): void;
}
interface Dragula {
(containers: Element[], options: DragulaOptions): Drake;
(containers: Element, options: DragulaOptions): Drake;
(containers: Element[]): Drake;
(options: DragulaOptions): Drake;
(): Drake;
}
}
declare var dragula: dragula.Dragula;
declare module "dragula" {
export = dragula;
}

179
dropzone/dropzone.d.ts vendored
View File

@ -1,95 +1,128 @@
// Type definitions for Dropzone 3.7.1
// Type definitions for Dropzone 4.0.1
// Project: http://www.dropzonejs.com/
// Definitions by: Natan Vivo <https://github.com/nvivo>
// Definitions by: Natan Vivo <https://github.com/nvivo>, Andy Hawkins <https://github.com/a904guy/,http://a904guy.com/,http://www.bmbsqd.com>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts"/>
interface DropzoneFile extends File {
previewElement: HTMLElement;
previewTemplate: HTMLElement;
previewsContainer: HTMLElement;
status: string;
accepted: boolean;
previewElement: HTMLElement;
previewTemplate: HTMLElement;
previewsContainer: HTMLElement;
status: string;
accepted: boolean;
}
interface DropzoneOptions {
url?: string;
method?: string;
withCredentials?: boolean;
parallelUploads?: number;
maxFilesize?: number;
paramName?: string;
uploadMultiple?: boolean;
headers?: any;
addRemoveLinks?: boolean;
previewsContainer?: string;
clickable?: any;
createImageThumbnails?: boolean;
maxThumbnailFilesize?: number;
thumbnailWidth?: number;
thumbnailHeight?: number;
maxFiles?: number;
resize?: (file?: any) => any;
init?: () => void;
acceptedFiles?: string;
accept?: (file: DropzoneFile, doneCallback: (...args) => void) => void;
autoProcessQueue?: boolean;
previewTemplate?: string;
forceFallback?: boolean;
fallback?: () => void;
url?: string;
method?: string;
withCredentials?: boolean;
parallelUploads?: number;
maxFilesize?: number;
paramName?: string;
uploadMultiple?: boolean;
headers?: any;
addRemoveLinks?: boolean;
previewsContainer?: string;
clickable?: any;
createImageThumbnails?: boolean;
maxThumbnailFilesize?: number;
thumbnailWidth?: number;
thumbnailHeight?: number;
maxFiles?: number;
resize?: ( file?: any ) => any;
init?: () => void;
acceptedFiles?: string;
accept?: ( file: DropzoneFile, doneCallback: ( ...args ) => void ) => void;
autoProcessQueue?: boolean;
previewTemplate?: string;
forceFallback?: boolean;
fallback?: () => void;
// dictionary options
dictDefaultMessage?: string;
dictFallbackMessage?: string;
dictFallbackText?: string;
dictInvalidFileType?: string;
dictFileTooBig?: string;
dictResponseError?: string;
dictCancelUpload?: string;
dictCancelUploadConfirmation?: string;
dictRemoveFile?: string;
dictRemoveFileConfirmation?: string;
dictMaxFilesExceeded?: string;
// dictionary options
dictDefaultMessage?: string;
dictFallbackMessage?: string;
dictFallbackText?: string;
dictInvalidFileType?: string;
dictFileTooBig?: string;
dictResponseError?: string;
dictCancelUpload?: string;
dictCancelUploadConfirmation?: string;
dictRemoveFile?: string;
dictRemoveFileConfirmation?: string;
dictMaxFilesExceeded?: string;
}
declare class Dropzone {
constructor(container: string, options?: DropzoneOptions);
constructor(container: HTMLElement, options?: DropzoneOptions);
static autoDiscover: boolean;
static options: any;
static confirm: (question: string, accepted: () => void, rejected?: () => void) => void;
constructor( container: string, options?: DropzoneOptions );
constructor( container: HTMLElement, options?: DropzoneOptions );
files: DropzoneFile[];
static autoDiscover: boolean;
static options: any;
static confirm: ( question: string, accepted: () => void, rejected?: () => void ) => void;
on(eventName, callback: (...args) => any);
off(eventName): void;
files: DropzoneFile[];
removeFile(file: DropzoneFile): void;
removeAllFiles(cancelIfNecessary?: boolean): void;
processQueue(): void;
getAcceptedFiles(): DropzoneFile[];
getRejectedFiles(): DropzoneFile[];
getQueuedFiles(): DropzoneFile[];
getUploadingFiles(): DropzoneFile[];
enable(): void;
disable(): void;
destroy(): Dropzone;
emit(eventName: string, file: DropzoneFile, str?: string);
emit(eventName: "thumbnail", file: DropzoneFile, path: string);
emit(eventName: "addedfile", file: DropzoneFile);
emit(eventName: "removedfile", file: DropzoneFile);
emit(eventName: "processing", file: DropzoneFile);
emit(eventName: "canceled", file: DropzoneFile);
emit(eventName: "complete", file: DropzoneFile);
on( eventName, callback: ( ...args ) => any );
emit(eventName: string, e: Event);
emit(eventName: "drop", e: Event);
emit(eventName: "dragstart", e: Event);
emit(eventName: "dragend", e: Event);
emit(eventName: "dragenter", e: Event);
emit(eventName: "dragover", e: Event);
emit(eventName: "dragleave", e: Event);
off( eventName ): void;
addFile( file: DropzoneFile ): void;
removeFile( file: DropzoneFile ): void;
removeAllFiles( cancelIfNecessary?: boolean ): void;
processQueue(): void;
cancelUpload( file: DropzoneFile ): void;
processFiles ( files: DropzoneFile[] ): void;
processFile( file: DropzoneFile ): void;
uploadFile( file: DropzoneFile ): void;
getAcceptedFiles(): DropzoneFile[];
getRejectedFiles(): DropzoneFile[];
getQueuedFiles(): DropzoneFile[];
getUploadingFiles(): DropzoneFile[];
accept( file: DropzoneFile, done: ( error?: string ) => {} ):void;
getActiveFiles(): DropzoneFile[];
getFilesWithStatus( status: string ): DropzoneFile[];
enqueueFile( file: DropzoneFile ): void;
enqueueFiles( file: DropzoneFile[] ): void;
createThumbnail( file: DropzoneFile, callback?: (...any) => {}): any;
createThumbnailFromUrl( file: DropzoneFile, url: string, callback?: ( ...any ) => any ): any;
emit( eventName: string, file: DropzoneFile, str?: string );
emit( eventName: "thumbnail", file: DropzoneFile, path: string );
emit( eventName: "addedfile", file: DropzoneFile );
emit( eventName: "removedfile", file: DropzoneFile );
emit( eventName: "processing", file: DropzoneFile );
emit( eventName: "canceled", file: DropzoneFile );
emit( eventName: "complete", file: DropzoneFile );
emit( eventName: string, e: Event );
emit( eventName: "drop", e: Event );
emit( eventName: "dragstart", e: Event );
emit( eventName: "dragend", e: Event );
emit( eventName: "dragenter", e: Event );
emit( eventName: "dragover", e: Event );
emit( eventName: "dragleave", e: Event );
}
interface JQuery {
dropzone(options: DropzoneOptions): Dropzone;
dropzone( options: DropzoneOptions ): Dropzone;
}
declare module "dropzone" {
export = Dropzone;
}

View File

@ -1 +0,0 @@
--noImplicitAny --module commonjs --target es5

View File

@ -1 +0,0 @@
--noImplicitAny --module commonjs --target es5

View File

@ -4,7 +4,8 @@
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module EventEmitter3 {
export class EventEmitter {
// __Base is hack for https://github.com/Microsoft/TypeScript/issues/3602
class __Base {
/**
* Minimal EventEmitter interface that is molded against the Node.js
* EventEmitter interface.
@ -13,7 +14,7 @@ declare module EventEmitter3 {
* @api public
*/
constructor();
/**
* Return a list of assigned event listeners.
*
@ -22,7 +23,7 @@ declare module EventEmitter3 {
* @api public
*/
listeners(event: string): Function[];
/**
* Emit an event to all registered event listeners.
*
@ -31,7 +32,7 @@ declare module EventEmitter3 {
* @api public
*/
emit(event: string, ...args: any[]): boolean;
/**
* Register a new EventListener for the given event.
*
@ -41,7 +42,7 @@ declare module EventEmitter3 {
* @api public
*/
on(event: string, fn: Function, context?: any): EventEmitter;
/**
* Add an EventListener that's only called once.
*
@ -51,7 +52,7 @@ declare module EventEmitter3 {
* @api public
*/
once(event: string, fn: Function, context?: any): EventEmitter;
/**
* Remove event listeners.
*
@ -61,7 +62,7 @@ declare module EventEmitter3 {
* @api public
*/
removeListener(event: string, fn: Function, once?: boolean): EventEmitter;
/**
* Remove all listeners or only the listeners for the specified event.
*
@ -69,25 +70,26 @@ declare module EventEmitter3 {
* @api public
*/
removeAllListeners(event: string): EventEmitter;
//
// Alias methods names because people roll like that.
//
off(event: string, fn: Function, once?: boolean): EventEmitter;
addListener(event: string, fn: Function, context?: any): EventEmitter;
//
// This function doesn't apply anymore.
//
setMaxListeners(): EventEmitter;
}
export class EventEmitter extends __Base { }
export module EventEmitter {
//
// Expose the module.
//
export class EventEmitter extends EventEmitter3.EventEmitter {}
export class EventEmitter2 extends EventEmitter3.EventEmitter {}
export class EventEmitter3 extends EventEmitter3.EventEmitter {}
export class EventEmitter extends __Base {}
export class EventEmitter2 extends __Base {}
export class EventEmitter3 extends __Base {}
}
}

View File

@ -103,6 +103,12 @@ function test_throwException() {
expect(fn).to.not.throwException();
}
function test_withArgs() {
var fn = () => {};
expect(fn).withArgs().to.throwException();
expect(fn).withArgs(true, 1, '').to.throwException();
}
function test_within() {
expect(1).to.be.within(0, Infinity);
}

View File

@ -101,6 +101,12 @@ function test_throwException() {
expect(fn).to.not.throwException();
}
function test_withArgs() {
var fn = () => {};
expect(fn).withArgs().to.throwException();
expect(fn).withArgs(true, 1, '').to.throwException();
}
function test_within() {
expect(1).to.be.within(0, Infinity);
}

View File

@ -1,5 +1,5 @@
// Type definitions for expect.js 0.2.0
// Project: https://github.com/LearnBoost/expect.js
// Type definitions for expect.js 0.3.1
// Project: https://github.com/Automattic/expect.js
// Definitions by: Teppei Sato <https://github.com/teppeis>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@ -12,6 +12,11 @@ declare module Expect {
*/
ok(): void;
/**
* Creates an anonymous function which calls fn with arguments.
*/
withArgs(...args: any[]): Root;
/**
* Assert that the function throws.
*

View File

@ -1,6 +1,6 @@
/// <reference path="express.d.ts" />
import express = require('express');
import * as express from 'express';
var app = express();
app.engine('jade', require('jade').__express);

View File

@ -5,7 +5,7 @@
/* =================== USAGE ===================
import express = require('express');
import * as express from "express";
var app = express();
=============================================== */
@ -24,8 +24,8 @@ declare module Express {
declare module "express" {
import http = require('http');
import serveStatic = require('serve-static');
import * as http from "http";
import * as serveStatic from "serve-static";
function e(): e.Express;
@ -40,6 +40,7 @@ declare module "express" {
delete(...handler: RequestHandler[]): IRoute;
patch(...handler: RequestHandler[]): IRoute;
options(...handler: RequestHandler[]): IRoute;
head(...handler: RequestHandler[]): IRoute;
}
interface IRouterMatcher<T> {
@ -97,6 +98,7 @@ declare module "express" {
delete: IRouterMatcher<T>;
patch: IRouterMatcher<T>;
options: IRouterMatcher<T>;
head: IRouterMatcher<T>;
route(path: string): IRoute;

View File

@ -0,0 +1,50 @@
/// <reference path="firebase-client.d.ts" />
//Class definitions for type safety
class Name{
first:string;
last:string;
}
class User{
name:Name;
}
//Connect to service
var client = new FirebaseClient({
url : "https://fb-client-test.firebaseio.com/",
auth : null
});
var newUser:User = new User();
newUser.name = {
first: "Fred",
last: "Flinstone"
};
client.push("users", newUser)
.then(function (result){
console.log(result.name);
var newUser2:User = new User();
newUser2.name = {
first: "Fred",
last: "Rockington"
}
return client.update("users/" + result.name, newUser2);
}).then(function (result){
console.log(result.name.last);
var newUser3:User = new User();
newUser3.name = {
first: "Axe",
last: "Steel"
};
return client.set("users/AXESTEEL", newUser3);
}).then(function (result){
console.log(result.name.first);
return client.get();
}).then(function (result){
console.log(result);
return client.get<User>("users/AXESTEEL")
}).then(function (result){
console.log(result.name.first);
});

75
firebase-client/firebase-client.d.ts vendored Normal file
View File

@ -0,0 +1,75 @@
// Type definitions for Firebase Client 0.1.0
// Project: https://www.github.com/jpstevens/firebase-client
// Definitions by: Andrew Breen <https://github.com/fpsscarecrow/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../q/Q.d.ts" />
interface PushResponse {
/**
* Name ref (key) of the child resource
*/
name : string;
}
interface FirebaseConfig {
/**
* path for the Firebase instance
*/
url : string;
/**
* Token for authorisation
*/
auth: string;
}
interface FirebaseClient {
/**
* Creates a new FirebaseClient given the provided configuration
*/
new (config : FirebaseConfig) : FirebaseClient;
/**
* Retrieves all objects at the base path
*/
get<T>() : Q.Promise<T>;
/**
* Retrieves an object
* @param path Relative path from the base for the resource
*/
get<T>(path : string) : Q.Promise<T>;
/**
* Returns a promise of the HTTP response from setting the value at the given path
* @param path Relative path from the base for the resource
* @param data Data to be set as the value for the given path
*/
set<T>(path : string, data : T) : Q.Promise<T>;
/**
* Update a node at a given path
* @param path Relative path from the base for the resource
* @param value Value of the response
*/
update<T>(path : string, value : T) : Q.Promise<T>;
/**
* Deletes the resource at a given path
* @param path Relative path from the base for the resource
*/
delete(path : string) : Q.Promise<void>;
/**
* @param path Relative path from the base for the resource
* @param value Object to push to the path
*/
push<T>(path : string, value : T) : Q.Promise<PushResponse>;
}
declare var FirebaseClient: FirebaseClient;
declare module 'firebase-client' {
export = FirebaseClient;
}

View File

@ -1 +0,0 @@

View File

@ -1 +0,0 @@

6
gapi/gapi.d.ts vendored
View File

@ -48,7 +48,11 @@ declare module gapi.auth {
/**
* The auth scope or scopes to authorize. Auth scopes for individual APIs can be found in their documentation.
*/
scope?: any
scope?: any;
/**
* The user to sign in as. -1 to toggle a multi-account chooser, 0 to default to the user's current account, and 1 to automatically sign in if the user is signed into Google Plus.
*/
authuser?: number;
}, callback: (token: GoogleApiOAuth2TokenObject) => any): void;
/**
* Initializes the authorization feature. Call this when the client loads to prevent popup blockers from blocking the auth window on gapi.auth.authorize calls.

View File

@ -855,6 +855,10 @@ declare module GitHubElectron {
* cleanup code will not run.
*/
terminate(): void;
/**
* Returns the current application directory.
*/
getAppPath(): string;
/**
* @param name One of: home, appData, userData, cache, userCache, temp, userDesktop, exe, module
* @returns The path to a special directory or file associated with name.

View File

@ -1 +0,0 @@

View File

@ -1 +0,0 @@

View File

@ -0,0 +1,21 @@
/// <reference path="../gulp/gulp.d.ts" />
/// <reference path="./gulp-cached.d.ts" />
import * as gulp from "gulp";
import cached = require("gulp-cached");
// Usage
gulp.src("*.ts")
.pipe(cached("ts-cache"));
gulp.src("*.ts")
.pipe(cached("ts-cache", {}));
gulp.src("*.ts")
.pipe(cached("ts-cache", { optimizeMemory: true }));
// Clearing the whole cache
cached.caches = {};
// Clearing a specific cache entry
delete cached.caches["ts-cache"];

39
gulp-cached/gulp-cached.d.ts vendored Normal file
View File

@ -0,0 +1,39 @@
// Type definitions for gulp-cached
// Project: https://github.com/wearefractal/gulp-cached
// Definitions by: Thomas Corbière <https://github.com/tomc974>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts"/>
declare module "gulp-cached"
{
interface ICacheStore
{
[name: string]: {};
}
interface IOptions
{
/**
* Uses md5 instead of storing the whole file contents.
* @default false
*/
optimizeMemory?: boolean;
}
interface IGulpCached
{
/**
* Creates a new cache hash or uses an existing one.
*/
(name: string, options?: IOptions): NodeJS.ReadWriteStream;
/**
* Cache store.
*/
caches: ICacheStore;
}
const cached: IGulpCached;
export = cached;
}

View File

@ -0,0 +1,53 @@
/// <reference path="../node/node" />
/// <reference path="../gulp/gulp" />
/// <reference path="../gulp-concat/gulp-concat" />
/// <reference path="gulp-load-plugins" />
import gulp = require('gulp');
import gulpConcat = require('gulp-concat');
import gulpLoadPlugins = require('gulp-load-plugins');
interface GulpPlugins extends IGulpPlugins {
concat: typeof gulpConcat;
}
var plugins = gulpLoadPlugins<GulpPlugins>({
pattern: ['gulp-*', 'gulp.*'],
config: 'package.json',
scope: ['dependencies', 'devDependencies', 'peerDependencies'],
replaceString: /^gulp(-|\.)/,
camelize: true,
lazy: true,
rename: {}
});
plugins = gulpLoadPlugins<GulpPlugins>();
gulp.task('taskName', () => {
gulp.src('*.*')
.pipe(plugins.concat('concatenated.js'))
.pipe(gulp.dest('output'));
});
/*
* From 0.8.0, you can pass in an object of mappings for renaming plugins. For example,
* imagine you want to load the gulp-ruby-sass plugin, but want to refer to it as just
* sass :
*/
plugins = gulpLoadPlugins<GulpPlugins>({
rename: {
'gulp-ruby-sass': 'sass'
}
});
/*
* gulp-load-plugins comes with npm scope support. The major difference is that scoped
* plugins are accessible through an object on plugins that represents the scope. For
* example, if the plugin is @myco/gulp-test-plugin then you can access the plugin as
* shown in the following example:
*/
interface GulpPlugins {
myco: {
testPlugin(): NodeJS.ReadWriteStream;
}
}
plugins.myco.testPlugin();

View File

@ -0,0 +1,42 @@
// Type definitions for gulp-load-plugins
// Project: https://github.com/jackfranklin/gulp-load-plugins
// Definitions by: Joe Skeen <http://github.com/joeskeen>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
/** Loads in any gulp plugins and attaches them to an object, freeing you up from having to manually require each gulp plugin. */
declare module 'gulp-load-plugins' {
interface IOptions {
/** the glob(s) to search for, default ['gulp-*', 'gulp.*'] */
pattern?: string[];
/** where to find the plugins, searched up from process.cwd(), default 'package.json' */
config?: string;
/** which keys in the config to look within, default ['dependencies', 'devDependencies', 'peerDependencies'] */
scope?: string[];
/** what to remove from the name of the module when adding it to the context, default /^gulp(-|\.)/ */
replaceString?: RegExp;
/** if true, transforms hyphenated plugin names to camel case, default true */
camelize?: boolean;
/** whether the plugins should be lazy loaded on demand, default true */
lazy?: boolean;
/** a mapping of plugins to rename, the key being the NPM name of the package, and the value being an alias you define */
rename?: IPluginNameMappings;
}
interface IPluginNameMappings {
[npmPackageName: string]: string
}
/** Loads in any gulp plugins and attaches them to an object, freeing you up from having to manually require each gulp plugin. */
function gulpLoadPlugins<T extends IGulpPlugins>(options?: IOptions): T;
export = gulpLoadPlugins;
}
/**
* Extend this interface to use Gulp plugins in your gulpfile.js
*/
interface IGulpPlugins {
}

View File

@ -0,0 +1,25 @@
/// <reference path="../gulp/gulp.d.ts" />
/// <reference path="./gulp-remember.d.ts" />
import * as gulp from "gulp";
import remember = require("gulp-remember");
// Usage
gulp.src("*.ts")
.pipe(remember());
gulp.src("*.ts")
.pipe(remember("ts-cache"));
// Drops a file from a remember cache
remember.forget("main.ts");
remember.forget("ts-cache", "main.ts");
// Drops all files from a remember cache
remember.forgetAll();
remember.forgetAll("ts-cache");
// Get a raw remember cache
remember.cacheFor();
remember.cacheFor("ts-cache");
remember.cacheFor("ts-cache")["main.ts"];

59
gulp-remember/gulp-remember.d.ts vendored Normal file
View File

@ -0,0 +1,59 @@
// Type definitions for gulp-remember
// Project: https://github.com/ahaurw01/gulp-remember
// Definitions by: Thomas Corbière <https://github.com/tomc974>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts"/>
declare module "gulp-remember"
{
interface ICache
{
[path: string]: NodeJS.ReadWriteStream;
}
interface IGulpRemember
{
/**
* Return a through stream that will:
* 1. Remember all files that ever pass through it.
* 2. Add all remembered files back into the stream when not present.
* @param cacheName Name to give your cache
*/
(cacheName?: string): NodeJS.ReadWriteStream;
/**
* Forget about a file.
* A warning is logged if either the named cache or file do not exist.
* @param path Path of the file to forget
*/
forget(path: string): void;
/**
* Forget about a file.
* A warning is logged if either the named cache or file do not exist.
* @param cacheName Name of the cache from which to drop the file
* @param path Path of the file to forget
*/
forget(cacheName: string, path: string): void;
/**
* Forget all files in one cache.
* A warning is logged if the cache does not exist.
*
* @param cacheName Name of the cache to wipe
*/
forgetAll(cacheName?: string): void;
/**
* Return a raw cache by name.
* Useful for checking state. Manually adding or removing files is NOT recommended.
*
* @param cacheName Name of the cache to retrieve
*/
cacheFor(cacheName?: string): ICache;
}
const remember: IGulpRemember;
export = remember;
}

View File

@ -26,6 +26,17 @@ var tsProject = typescript.createProject({
noExternalResolve: true
});
gulp.task('scripts', function() {
var tsResult = tsProject.src()
.pipe(typescript(tsProject));
return tsResult.js.pipe(gulp.dest('release'));
});
var mainTscProject = typescript.createProject("tsconfig.json", {
target: "es6"
});
gulp.task('scripts', function() {
var tsResult = gulp.src('lib/*.ts')
.pipe(typescript(tsProject));

View File

@ -1,6 +1,6 @@
// Type definitions for gulp-typescript
// Project: https://github.com/ivogabe/gulp-typescript
// Definitions by: Asana <https://asana.com>
// Definitions by: Asana <https://asana.com>, Thomas Corbière <https://github.com/tomc974>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts"/>
@ -9,7 +9,8 @@ declare module "gulp-typescript" {
function GulpTypescript(params: GulpTypescript.Params, filters?: GulpTypescript.FilterSettings, reporter?: GulpTypescript.Reporter): GulpTypescript.CompilationStream;
module GulpTypescript {
export function createProject(params: Params): Params;
export function createProject(params: Params): Project;
export function createProject(file: string, params: Params): Project;
export function filter(filters: FilterSettings): CompilationStream;
interface Params {
declarationFiles?: boolean;
@ -24,6 +25,10 @@ declare module "gulp-typescript" {
target?: string;
}
interface Project {
src(): NodeJS.ReadWriteStream
}
interface FilterSettings {
referencedFrom?: string[];
}

View File

@ -114,7 +114,7 @@ interface HighchartsAxisOptions {
minRange?: number;
minTickInterval?: number;
minorTickColor?: string;
minorTickInterval?: number;
minorTickInterval?: number|string;
minorTickLength?: number;
minorTickPosition?: string; // 'inside' 'outside'
minorTickWidth?: number;
@ -191,11 +191,11 @@ interface HighchartsChartResetZoomButton {
}
interface HighchartsChartResetZoomButtonTheme {
fill?: string; //css HEX colours.
stroke?: string;//css HEX colours.
fill?: string; //css HEX colours.
stroke?: string;//css HEX colours.
r?: number; // Radius %
states?: any; // HTML element states eg: hover, with css attributes in object.
display?: string; // css attr eg: 'none'
states?: any; // HTML element states eg: hover, with css attributes in object.
display?: string; // css attr eg: 'none'
}
interface HighchartsChartOptions {
@ -873,11 +873,11 @@ interface HighchartsLineChart {
states?: {
hover: HighchartsAreaStates;
};
step?: boolean;
step?: boolean|string;
stickyTracking?: boolean;
tooltip?: HighchartsTooltipOptions;
turboThreshold?: number;
visible?: number;
visible?: boolean;
zIndex?: number;
}
@ -911,7 +911,7 @@ interface HighchartsPieChart {
};
stickyTracking?: boolean;
tooltip?: HighchartsTooltipOptions;
visible?: number;
visible?: boolean;
zIndex?: number;
}
@ -953,7 +953,7 @@ interface HighchartsScatterChart {
stickyTracking?: boolean;
tooltip?: HighchartsTooltipOptions;
turboThreshold?: number;
visible?: number;
visible?: boolean;
zIndex?: number;
}
@ -986,7 +986,6 @@ interface HighchartsSeriesChart {
dataLabels?: HighchartsDataLabels;
enableMouseTracking?: boolean;
events?: HighchartsPlotEvents;
id?: string;
lineWidth?: number;
marker?: HighchartsMarker;
point?: {
@ -1006,7 +1005,7 @@ interface HighchartsSeriesChart {
stickyTracking?: boolean;
tooltip?: HighchartsTooltipOptions;
turboThreshold?: number;
visible?: number;
visible?: boolean;
zIndex?: number;
}
@ -1041,13 +1040,14 @@ interface HighchartsPlotOptions {
*/
interface HighchartsIndividualSeriesOptions {
data?: number[]|[number, number][]| HighchartsDataPoint[]; // [value1,value2, ... ] | [[x1,y1],[x2,y2],... ] | HighchartsDataPoint[]
id?: string;
index?: number;
legendIndex?: number;
name?: string;
stack?: any; // type doesn't matter, as long as grouped series' stack options match each other.
type?: string;
xAxis?: number;
yAxis?: number;
xAxis?: string | number;
yAxis?: string | number;
}
interface HighchartsSeriesOptions extends HighchartsIndividualSeriesOptions, HighchartsSeriesChart { }
@ -1095,8 +1095,8 @@ interface HighchartsSeriesOptions extends HighchartsSeriesChart {
legendIndex?: number;
name?: string;
stack?: string | number;
xAxis?: number;
yAxis?: number;
xAxis?: string | number;
yAxis?: string | number;
}
interface HighchartsSubtitleOptions {
@ -1180,6 +1180,7 @@ interface HighchartsAxisObject {
addPlotBand(options: HighchartsPlotBands): void;
addPlotLine(options: HighchartsPlotLines): void;
getExtremes(): HighchartsExtremes;
remove(redraw?: boolean): void;
removePlotBand(id: string): void;
removePlotLine(id: string): void;
setCategories(categories: string[]): void;
@ -1187,8 +1188,10 @@ interface HighchartsAxisObject {
setExtremes(min: number, max: number): void;
setExtremes(min: number, max: number, redraw: boolean): void;
setExtremes(min: number, max: number, redraw: boolean, animation: boolean | HighchartsAnimation): void;
setTitle(title: HighchartsAxisTitle): void;
setTitle(title: HighchartsAxisTitle, redraw: boolean): void;
setTitle(title: HighchartsAxisTitle, redraw?: boolean): void;
toPixels(value: number, paneCoordinates?: boolean): number;
toValue(pixel: number, paneCoordinates?: boolean): number;
update(options: HighchartsAxisOptions, redraw?: boolean): void;
}
interface HighchartsChartObject {
@ -1275,52 +1278,31 @@ declare var Highcharts: HighchartsStatic;
interface HighchartsPointObject {
category: string | number;
percentage: number;
remove(): void;
remove(redraw: boolean): void;
remove(redraw: boolean, animation: boolean): void;
remove(redraw: boolean, animation: HighchartsAnimation): void;
remove(redraw?: boolean, animation?: boolean|HighchartsAnimation): void;
select(): void;
select(select: boolean): void;
select(select: boolean, accumulate: boolean): void;
selected: boolean;
series: HighchartsSeriesObject;
slice(): void;
slice(sliced: boolean): void;
slice(sliced: boolean, redraw: boolean): void;
slice(sliced: boolean, redraw: boolean, animation: boolean): void;
slice(sliced: boolean, redraw: boolean, animation: HighchartsAnimation): void;
slice(sliced?: boolean, redraw?: boolean, animation?: boolean|HighchartsAnimation): void;
total: number;
update(options: any): void;
update(options: any, redraw: boolean): void;
update(options: any, redraw: boolean, animation: boolean): void;
update(options: any, redraw: boolean, animation: HighchartsAnimation): void;
update(options: number | [number, number] | HighchartsDataPoint, redraw?: boolean, animation?: boolean | HighchartsAnimation): void;
x: number;
y: number;
}
interface HighchartsSeriesObject {
addPoint(options: number |[number, number]| HighchartsDataPoint): void;
addPoint(options: number |[number, number]| HighchartsDataPoint, redraw: boolean, shift: boolean): void;
addPoint(options: number |[number, number]| HighchartsDataPoint, redraw: boolean, shift: boolean, animation: boolean): void;
addPoint(options: number |[number, number]| HighchartsDataPoint, redraw: boolean, shift: boolean, animation: HighchartsAnimation): void;
addPoint(options: number |[number, number]| HighchartsDataPoint, redraw?: boolean, shift?: boolean, animation?: boolean | HighchartsAnimation): void;
chart: HighchartsChartObject;
data: HighchartsDataPoint[];
data: HighchartsPointObject[];
hide(): void;
name: string;
options: HighchartsSeriesOptions;
remove(): void;
remove(redraw: boolean): void;
select(): void;
select(selected: boolean): void;
remove(redraw?: boolean): void;
select(selected?: boolean): void;
selected: boolean;
setData(data: number[]): void; // [value1,value2, ... ]
setData(data: number[], redraw: boolean): void;
setData(data: number[][]): void; // [[x1,y1],[x2,y2],... ]
setData(data: number[][], redraw: boolean): void;
setData(data: HighchartsDataPoint[]): void; // HighchartsDataPoint[]
setData(data: HighchartsDataPoint[], redraw: boolean): void;
setVisible(visible: boolean): void;
setVisible(visible: boolean, redraw: boolean): void;
setData(data: number[] | number[][] | HighchartsDataPoint[], redraw?: boolean, animation?: boolean | HighchartsAnimation, updatePoints?: boolean): void;
setVisible(visible: boolean, redraw?: boolean): void;
show(): void;
type: string;
update(options: HighchartsSeriesOptions, redraw?: boolean): void;

View File

@ -0,0 +1,90 @@
/// <reference path="imagesLoaded.d.ts" />
function test_ctor() {
// element
imagesLoaded(document.querySelector('#container'), function(instance) {
console.log('all images are loaded');
});
// selector string
imagesLoaded('#container', function() { console.log('all images are loaded'); });
// multiple elements
var posts = document.querySelectorAll('.post');
imagesLoaded(posts, function() { console.log('all images are loaded'); });
}
function test_events_basic() {
var elem = document.querySelector('body');
var imgLoad = imagesLoaded(elem);
function onAlways(instance: ImagesLoaded.ImagesLoaded) {
console.log('all images are loaded');
}
// bind with .on()
imgLoad.on('always', onAlways);
// unbind with .off()
imgLoad.off('always', onAlways);
}
function test_events_full() {
var elem = document.querySelector('body');
var imgLoad = imagesLoaded(elem);
// always
imgLoad.on('always', function(instance) {
console.log('ALWAYS - all images have been loaded');
});
// done
imgLoad.on('done', function(instance) {
console.log('DONE - all images have been successfully loaded');
});
// fail
imgLoad.on('fail', function(instance) {
console.log('FAIL - all images loaded, at least one is broken');
});
// progress
imgLoad.on('progress', function(instance, image) {
var result = image.isLoaded ? 'loaded' : 'broken';
console.log('image is ' + result + ' for ' + image.img.src);
});
}
function test_always_images() {
var imgLoad = imagesLoaded('#container');
imgLoad.on('always', function() {
console.log(imgLoad.images.length + ' images loaded');
// detect which image is broken
for (var i = 0, len = imgLoad.images.length; i < len; i++) {
var image = imgLoad.images[i];
var result = image.isLoaded ? 'loaded' : 'broken';
console.log('image is ' + result + ' for ' + image.img.src);
}
});
}
function test_jquery() {
$('#container').imagesLoaded(function() {
console.log('images have loaded');
});
}
function test_jquery_deferred() {
$('#container').imagesLoaded()
.always(function(instance) {
console.log('all images loaded');
})
.done(function(instance) {
console.log('all images successfully loaded');
})
.fail(function() {
console.log('all images loaded, at least one is broken');
})
.progress(function(instance, image) {
var result = image.isLoaded ? 'loaded' : 'broken';
console.log('image is ' + result + ' for ' + image.img.src);
});
}

53
imagesloaded/imagesloaded.d.ts vendored Normal file
View File

@ -0,0 +1,53 @@
// Type definitions for imagesLoaded 3.1.8+
// Project: https://github.com/desandro/imagesloaded
// Definitions by: Chris Charabaruk <http://github.com/coldacid>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
///<reference path="../jquery/jquery.d.ts" />
declare module ImagesLoaded {
type ElementSelector = Element | NodeList | Array<Element> | string;
/** interface for an image currently loading or completed */
interface LoadingImage {
img: HTMLImageElement;
isLoaded: boolean;
}
interface ImagesLoadedCallback {
(instance?: ImagesLoaded): void;
}
interface ImagesLoadedListener {
(instance: ImagesLoaded, image?: LoadingImage): void;
}
interface ImagesLoaded {
new (elem: ElementSelector, callback: ImagesLoadedCallback): ImagesLoaded;
images: Array<LoadingImage>;
// event listeners
on(event: string, listener: ImagesLoadedListener): void;
off(event: string, listener: ImagesLoadedListener): void;
}
interface ImagesLoadedConstructor {
/**
* Creates a new ImagesLoaded object with the provided callback
* @param elem Element, NodeList, Element array, or selector string for images to watch
* @param callback function triggered after all images have been loaded
*/
(elem: ElementSelector, callback?: ImagesLoadedCallback): ImagesLoaded;
}
}
declare var imagesLoaded: ImagesLoaded.ImagesLoadedConstructor;
declare module 'imagesloaded' {
export = imagesLoaded;
}
interface JQuery {
imagesLoaded(callback?: ImagesLoaded.ImagesLoadedCallback): JQueryDeferred<ImagesLoaded.ImagesLoaded>;
}

View File

@ -55,6 +55,7 @@ declare module Interact {
origin(newValue: HTMLElement): Interactable;
origin(newValue: SVGElement): Interactable;
origin(newValue: Point): Interactable;
preventDefault(newValue: boolean | string): Interactable;
rectChecker(): Function;
rectChecker(newValue: Function): Interactable;
resizable(): Interactable;

365
ionic/ionic-tests.ts Normal file
View File

@ -0,0 +1,365 @@
/// <reference path="./ionic.d.ts" />
var testIonic = angular.module('testIonic', ['ionic']);
testIonic.config(['$ionicConfigProvider', ($ionicConfigProvider: ionic.utility.IonicConfigProvider)=>{
var transition: string = $ionicConfigProvider.views.transition();
$ionicConfigProvider.views.transition("transition");
var maxCache: number = $ionicConfigProvider.views.maxCache();
$ionicConfigProvider.views.maxCache(10);
var forwardCache: boolean = $ionicConfigProvider.views.forwardCache();
$ionicConfigProvider.views.forwardCache(true);
var jsScrolling: boolean = $ionicConfigProvider.scrolling.jsScrolling();
$ionicConfigProvider.scrolling.jsScrolling(true);
var backButtonIcon: string = $ionicConfigProvider.backButton.icon();
$ionicConfigProvider.backButton.icon("icon");
var backButtonText: string = $ionicConfigProvider.backButton.text();
$ionicConfigProvider.backButton.text("back");
var usePreviousTitleText: boolean = $ionicConfigProvider.backButton.previousTitleText();
$ionicConfigProvider.backButton.previousTitleText(false);
var checkbox: string = $ionicConfigProvider.form.checkbox();
$ionicConfigProvider.form.checkbox("square");
var toggle: string = $ionicConfigProvider.form.toggle();
$ionicConfigProvider.form.toggle("small");
var spinnerIcon: string = $ionicConfigProvider.spinner.icon();
$ionicConfigProvider.spinner.icon("spiral");
var tabsStyle: string = $ionicConfigProvider.tabs.style();
$ionicConfigProvider.tabs.style("standard");
var tabsPosition: string = $ionicConfigProvider.tabs.position();
$ionicConfigProvider.tabs.position("bottom");
var maxPrefetch: number = $ionicConfigProvider.templates.maxPrefetch();
$ionicConfigProvider.templates.maxPrefetch(10);
var alignTitle: string = $ionicConfigProvider.navBar.alignTitle();
$ionicConfigProvider.navBar.alignTitle("platform");
var positionPrimaryButtons: string = $ionicConfigProvider.navBar.positionPrimaryButtons();
$ionicConfigProvider.navBar.positionPrimaryButtons("platform");
var positionSecondaryButtons: string = $ionicConfigProvider.navBar.positionSecondaryButtons();
$ionicConfigProvider.navBar.positionSecondaryButtons("platform");
}])
class IonicTestController {
public static $inject = [
'$ionicActionSheet',
'$ionicBackdrop',
'$ionicGesture',
'$ionicListDelegate',
'$ionicLoading',
'$ionicModal',
'$ionicNavBarDelegate',
'$ionicHistory',
'$ionicPlatform',
'$ionicPopover',
'$ionicPopup',
'$ionicScrollDelegate',
'$ionicSideMenuDelegate',
'$ionicSlideBoxDelegate',
'$ionicTabsDelegate',
'$ionicPosition'
];
constructor(
private $ionicActionSheet: ionic.actionSheet.IonicActionSheetService,
private $ionicBackdrop: ionic.backdrop.IonicBackdropService,
private $ionicGesture: ionic.gestures.IonicGestureService,
private $ionicListDelegate: ionic.list.IonicListDelegate,
private $ionicLoading: ionic.loading.IonicLoadingService,
private $ionicModal: ionic.modal.IonicModalService,
private $ionicNavBarDelegate: ionic.navigation.IonicNavBarDelegate,
private $ionicHistory: ionic.navigation.IonicHistoryService,
private $ionicPlatform: ionic.platform.IonicPlatformService,
private $ionicPopover: ionic.popover.IonicPopoverService,
private $ionicPopup: ionic.popup.IonicPopupService,
private $ionicScrollDelegate: ionic.scroll.IonicScrollDelegate,
private $ionicSideMenuDelegate: ionic.sideMenu.IonicSideMenuDelegate,
private $ionicSlideBoxDelegate: ionic.slideBox.IonicSlideBoxDelegate,
private $ionicTabsDelegate: ionic.tabs.IonicTabsDelegate,
private $ionicPositionService: ionic.utility.IonicPositionService
){}
private testActionSheet(): void {
var closeActionSheetFn: ()=>void = this.$ionicActionSheet.show({
buttons: [],
titleText: "titleText",
cancelText: "cancelText",
destructiveText: "destructiveText",
cancel: ()=>{ console.log("cancel"); },
buttonClicked: ()=>{ console.log("buttonClicked"); },
destructiveButtonClicked: ()=>{ console.log("destructiveButtonClicked"); },
cancelOnStateChange: true,
cssClass: "cssClass"
});
closeActionSheetFn();
}
private testBackdrop(): void {
this.$ionicBackdrop.retain();
this.$ionicBackdrop.release();
}
private testGesture(): void {
var gesture: ionic.gestures.IonicGesture = this.$ionicGesture.on(
'eventType',
(e)=>{ return e; },
angular.element("body"),
{}
);
this.$ionicGesture.off(gesture, "eventType", (e) => { return e; });
}
private testList(): void {
this.$ionicListDelegate.showReorder(true);
var showReorder: boolean = this.$ionicListDelegate.showReorder();
this.$ionicListDelegate.showDelete(true);
var showDelete: boolean = this.$ionicListDelegate.showDelete();
this.$ionicListDelegate.canSwipeItems(true);
var canSwipeItems: boolean = this.$ionicListDelegate.canSwipeItems();
this.$ionicListDelegate.closeOptionButtons();
var foo: ionic.list.IonicListDelegate = this.$ionicListDelegate.$getByHandle("handle");
}
private testLoading(): void {
this.$ionicLoading.show({
template: "template",
templateUrl: "templateUrl",
scope: {},
noBackdrop: false,
hideOnStateChange: true,
delay: 500,
duration: 8000
});
this.$ionicLoading.hide();
}
private testModal(): void {
var modalOptions: ionic.modal.IonicModalOptions = {
scope: {},
animation: "animation",
focusFirstInput: true,
backdropClickToClose: false,
hardwareBackButtonClose: true
};
var ionicModalController: ionic.modal.IonicModalController = this.$ionicModal.fromTemplate("template", modalOptions);
ionicModalController.initialize(modalOptions);
ionicModalController.show().then(() => console.log("shown modal"))
ionicModalController.hide().then(() => console.log("hid modal"))
var isShown: boolean = ionicModalController.isShown();
this.$ionicModal.fromTemplateUrl("templateUrl", modalOptions)
.then(modalCtrl => ionicModalController = modalCtrl);
}
private testNavigation(): void {
this.$ionicNavBarDelegate.align("right");
this.$ionicNavBarDelegate.showBackButton(true);
var isBackButtonShown: boolean = this.$ionicNavBarDelegate.showBackButton();
this.$ionicNavBarDelegate.showBar(true);
var isBarShown: boolean = this.$ionicNavBarDelegate.showBar();
this.$ionicNavBarDelegate.title("title");
var viewHistory = this.$ionicHistory.viewHistory();
var currentView = this.$ionicHistory.currentView();
var currentHistoryId: string = this.$ionicHistory.currentHistoryId();
this.$ionicHistory.currentTitle("currentTitle");
var currentTitle: string = this.$ionicHistory.currentTitle();
var backView = this.$ionicHistory.backView();
var backTitle: string = this.$ionicHistory.backTitle();
var forwardView = this.$ionicHistory.forwardView();
var currentStateName: string = this.$ionicHistory.currentStateName();
this.$ionicHistory.goBack(5);
this.$ionicHistory.clearHistory();
this.$ionicHistory.clearCache().then(() => console.log("done clearing cache!"));
this.$ionicHistory.nextViewOptions({
disableAnimate: true,
disableBack: true,
historyRoot: true
});
}
private testPlatform(): void {
var callback: Function = () => console.log("on!");
this.$ionicPlatform.onHardwareBackButton(callback);
this.$ionicPlatform.offHardwareBackButton(callback);
this.$ionicPlatform.registerBackButtonAction(callback, 1, "actionId");
this.$ionicPlatform.on("type", callback);
this.$ionicPlatform.ready(callback);
this.$ionicPlatform.ready().then(() => console.log("ready!"));
}
private testPopover(): void {
var popoverOptions: ionic.popover.IonicPopoverOptions = {
scope: {},
focusFirstInput: true,
backdropClickToClose: false,
hardwareBackButtonClose: true
};
var ionicPopoverController: ionic.popover.IonicPopoverController = this.$ionicPopover.fromTemplate("template", popoverOptions);
ionicPopoverController.initialize(popoverOptions);
ionicPopoverController.show(angular.element("body")).then(() => console.log("shown popover"))
ionicPopoverController.hide().then(() => console.log("hid popover"))
var isShown: boolean = ionicPopoverController.isShown();
this.$ionicPopover.fromTemplateUrl("templateUrl", popoverOptions)
.then(popoverCtrl => ionicPopoverController = popoverCtrl);
}
private testPopup(): void {
this.$ionicPopup.show({
title: "title",
subTitle: "subTitle",
cssClass: "cssClass",
template: "template",
templateUrl: "templateUrl",
scope: {},
buttons: [{text: "text", type: "type", onTap: (e) => {console.log(e)}}]
}).then(() => console.log("popover shown"));
this.$ionicPopup.show({
title: "title",
subTitle: "subTitle",
cssClass: "cssClass",
template: "template",
templateUrl: "templateUrl",
scope: {},
buttons: [{text: "text", type: "type", onTap: (e) => {console.log(e)}}]
}).close("done");
this.$ionicPopup.alert({
title: "title",
subTitle: "subTitle",
cssClass: "cssClass",
template: "template",
templateUrl: "templateUrl",
okText: "OK",
okType: "okType"
}).then(() => console.log("popover shown"))
this.$ionicPopup.alert({
title: "title",
subTitle: "subTitle",
cssClass: "cssClass",
template: "template",
templateUrl: "templateUrl",
okText: "OK",
okType: "okType"
}).close();
this.$ionicPopup.confirm({
title: "title",
subTitle: "subTitle",
cssClass: "cssClass",
template: "template",
templateUrl: "templateUrl",
okText: "OK",
okType: "okType",
cancelText: "Cancel",
cancelType: "cancelType"
}).then(() => console.log("popover shown"))
this.$ionicPopup.confirm({
title: "title",
subTitle: "subTitle",
cssClass: "cssClass",
template: "template",
templateUrl: "templateUrl",
okText: "OK",
okType: "okType",
cancelText: "Cancel",
cancelType: "cancelType"
}).close();
this.$ionicPopup.prompt({
title: "title",
subTitle: "subTitle",
cssClass: "cssClass",
template: "template",
templateUrl: "templateUrl",
okText: "OK",
okType: "okType",
cancelText: "Cancel",
cancelType: "cancelType",
inputType: "text",
inputPlaceholder: "Type some text..."
}).then(() => console.log("popover shown"))
this.$ionicPopup.prompt({
title: "title",
subTitle: "subTitle",
cssClass: "cssClass",
template: "template",
templateUrl: "templateUrl",
okText: "OK",
okType: "okType",
cancelText: "Cancel",
cancelType: "cancelType",
inputType: "text",
inputPlaceholder: "Type some text..."
}).close();
}
private testScroll(): void {
this.$ionicScrollDelegate.resize();
this.$ionicScrollDelegate.scrollTop();
this.$ionicScrollDelegate.scrollTop(true);
this.$ionicScrollDelegate.scrollBottom();
this.$ionicScrollDelegate.scrollBottom(true);
this.$ionicScrollDelegate.scrollTo(0, 0);
this.$ionicScrollDelegate.scrollTo(0, 0, true);
this.$ionicScrollDelegate.scrollBy(0, 0);
this.$ionicScrollDelegate.scrollBy(0, 0, true);
this.$ionicScrollDelegate.zoomTo(1);
this.$ionicScrollDelegate.zoomTo(1, true);
this.$ionicScrollDelegate.zoomTo(1, true, 0);
this.$ionicScrollDelegate.zoomTo(1, true, 0, 0);
this.$ionicScrollDelegate.zoomBy(0.5);
this.$ionicScrollDelegate.zoomBy(0.5, true);
this.$ionicScrollDelegate.zoomBy(0.5, true, 50);
this.$ionicScrollDelegate.zoomBy(0.5, true, 50, 50);
var {top: number, left: number} = this.$ionicScrollDelegate.getScrollPosition();
this.$ionicScrollDelegate.anchorScroll();
this.$ionicScrollDelegate.anchorScroll(true);
var isScrollFrozen: boolean = this.$ionicScrollDelegate.freezeScroll();
this.$ionicScrollDelegate.freezeScroll(false);
var areAllScrollsFrozen: boolean = this.$ionicScrollDelegate.freezeAllScrolls();
this.$ionicScrollDelegate.freezeAllScrolls(false);
var scrollView: any = this.$ionicScrollDelegate.getScrollView();
var scrollDelegate: ionic.scroll.IonicScrollDelegate = this.$ionicScrollDelegate.$getByHandle("handle");
}
private testSideMenu(): void {
this.$ionicSideMenuDelegate.toggleLeft();
this.$ionicSideMenuDelegate.toggleLeft(true);
this.$ionicSideMenuDelegate.toggleRight();
this.$ionicSideMenuDelegate.toggleRight(true);
var openRatio: number = this.$ionicSideMenuDelegate.getOpenRatio();
var isOpen: boolean = this.$ionicSideMenuDelegate.isOpen();
var isOpenLeft: boolean = this.$ionicSideMenuDelegate.isOpenLeft();
var isOpenRight: boolean = this.$ionicSideMenuDelegate.isOpenRight();
var canDragContent: boolean = this.$ionicSideMenuDelegate.canDragContent();
this.$ionicSideMenuDelegate.canDragContent(false);
var edgeDragThreshold: boolean = this.$ionicSideMenuDelegate.edgeDragThreshold();
this.$ionicSideMenuDelegate.edgeDragThreshold(true);
this.$ionicSideMenuDelegate.edgeDragThreshold(500);
var sideMenuDelegate: ionic.sideMenu.IonicSideMenuDelegate = this.$ionicSideMenuDelegate.$getByHandle("handle");
}
private testSlideBox(): void {
this.$ionicSlideBoxDelegate.update();
this.$ionicSlideBoxDelegate.slide(1);
this.$ionicSlideBoxDelegate.slide(1, 500);
var isSlideEnabled: boolean = this.$ionicSlideBoxDelegate.enableSlide();
this.$ionicSlideBoxDelegate.enableSlide(true);
this.$ionicSlideBoxDelegate.previous();
this.$ionicSlideBoxDelegate.previous(500);
this.$ionicSlideBoxDelegate.next();
this.$ionicSlideBoxDelegate.next(500);
this.$ionicSlideBoxDelegate.stop();
this.$ionicSlideBoxDelegate.start();
var currentIndex: number = this.$ionicSlideBoxDelegate.currentIndex();
var slidesCount: number = this.$ionicSlideBoxDelegate.slidesCount();
var slideBoxDelegate: ionic.slideBox.IonicSlideBoxDelegate = this.$ionicSlideBoxDelegate.$getByHandle("handle");
}
private testTabs(): void {
this.$ionicTabsDelegate.select(1);
var selectedIndex: number = this.$ionicTabsDelegate.selectedIndex();
var ionicTabsDelegate: ionic.tabs.IonicTabsDelegate = this.$ionicTabsDelegate.$getByHandle("handle");
}
private testUtility(): void {
var {top: number, left: number, width: number, height: number} = this.$ionicPositionService.position(angular.element("body"));
var {top: number, left: number, width: number, height: number} = this.$ionicPositionService.offset(angular.element("body"));
}
}
testIonic.controller('ionicTestController', IonicTestController);

290
ionic/ionic.d.ts vendored Normal file
View File

@ -0,0 +1,290 @@
// Type definitions for Ionic
// Project: http://ionicframework.com
// Definitions by: Spencer Williams <https://github.com/spencerwi/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare module ionic {
module actionSheet {
interface IonicActionSheetService {
show(options: IonicActionSheetOptions): ()=>void;
}
interface IonicActionSheetOptions {
buttons?: Array<any>;
titleText?: string;
cancelText?: string;
destructiveText?: string;
cancel?: ()=>any;
buttonClicked?: ()=>any;
destructiveButtonClicked?: ()=>any;
cancelOnStateChange?: boolean;
cssClass?: string;
}
}
module backdrop {
interface IonicBackdropService {
retain(): void;
release(): void;
}
}
module gestures {
interface IonicGestureService {
on(eventType: string, callback: (e: any)=>any, $element: ng.IAugmentedJQuery, options: any): IonicGesture;
off(gesture: IonicGesture, eventType: string, callback: (e: any)=>any): void;
}
interface IonicGesture {
element: Element;
enabled: boolean;
options: {stop_browser_behavior: string };
on(gesture: string, handler: Function): IonicGesture;
off(gesture: string, handler: Function): IonicGesture;
trigger(gesture: string, eventData: any): IonicGesture;
enable(state: boolean): IonicGesture;
}
}
module list {
interface IonicListDelegate {
showReorder(showReorder?: boolean): boolean;
showDelete(showDelete?: boolean): boolean;
canSwipeItems(canSwipeItems?: boolean): boolean;
closeOptionButtons(): void;
$getByHandle(handle: string): IonicListDelegate;
}
}
module loading {
interface IonicLoadingService {
show(opts: IonicLoadingOptions): void;
hide(): void;
}
interface IonicLoadingOptions {
template?: string;
templateUrl?: string;
scope?: any;
noBackdrop?: boolean;
hideOnStateChange?: boolean;
delay?: number;
duration?: number;
}
}
module modal {
interface IonicModalService {
fromTemplate(templateString: string, options?: IonicModalOptions): IonicModalController;
fromTemplateUrl(templateUrl: string, options?: IonicModalOptions): ng.IPromise<IonicModalController>;
}
interface IonicModalController {
initialize(options: IonicModalOptions): void;
show(): ng.IPromise<void>;
hide(): ng.IPromise<void>;
isShown(): boolean;
}
interface IonicModalOptions {
scope?: any;
animation?: string;
focusFirstInput?: boolean;
backdropClickToClose?: boolean;
hardwareBackButtonClose?: boolean;
}
}
module navigation {
interface IonicNavBarDelegate {
align(direction?: string): void;
showBackButton(show?: boolean): boolean;
showBar(show?: boolean): boolean;
title(title: string): void;
}
interface IonicHistoryService {
viewHistory(): any;
currentView(): any;
currentHistoryId(): string;
currentTitle(val?: string): string;
backView(): any;
backTitle(): string;
forwardView(): any;
currentStateName(): string;
goBack(backCount?: number): void;
clearHistory(): void;
clearCache(): ng.IPromise<any>;
nextViewOptions(options: IonicHistoryNextViewOptions): void;
}
interface IonicHistoryNextViewOptions {
disableAnimate?: boolean;
disableBack?: boolean;
historyRoot?: boolean;
}
}
module platform {
interface IonicPlatformService {
onHardwareBackButton(callback: Function): void;
offHardwareBackButton(callback: Function): void;
registerBackButtonAction(callback: Function, priority: number, actionId?: any): Function;
on(type: string, callback: Function): Function;
ready(callback?: Function): ng.IPromise<any>;
}
}
module popover {
interface IonicPopoverService {
fromTemplate(templateString: string, options: IonicPopoverOptions): IonicPopoverController;
fromTemplateUrl(templateUrl: string, options: IonicPopoverOptions): ng.IPromise<IonicPopoverController>;
}
interface IonicPopoverController {
initialize(options: IonicPopoverOptions): void;
show($event?: any): ng.IPromise<any>;
hide(): ng.IPromise<any>;
isShown(): boolean;
}
interface IonicPopoverOptions {
scope?: any;
focusFirstInput?: boolean;
backdropClickToClose?: boolean;
hardwareBackButtonClose?: boolean;
}
}
module popup {
interface IonicPopupService {
show(options: IonicPopupFullOptions): IonicPopupPromise;
alert(options: IonicPopupAlertOptions): IonicPopupPromise;
confirm(options: IonicPopupConfirmOptions): IonicPopupPromise;
prompt(options: IonicPopupPromptOptions): IonicPopupPromise;
}
interface IonicPopupPromise extends ng.IPromise<any> {
close(value?: any): any;
}
interface IonicPopupBaseOptions {
title?: string;
cssClass?: string;
subTitle?: string;
template?: string;
templateUrl?: string;
}
interface IonicPopupFullOptions extends IonicPopupBaseOptions {
scope?: any;
buttons?: Array<IonicPopupButton>;
}
interface IonicPopupButton {
text: string;
type?: string;
onTap?(event?: any): void;
}
interface IonicPopupAlertOptions extends IonicPopupBaseOptions {
okText?: string;
okType?: string;
}
interface IonicPopupConfirmOptions extends IonicPopupBaseOptions {
cancelText?: string;
cancelType?: string;
okText?: string;
okType?: string;
}
interface IonicPopupPromptOptions extends IonicPopupBaseOptions {
inputType?: string;
inputPlaceholder?: string;
cancelText?: string;
cancelType?: string;
okText?: string;
okType?: string;
}
}
module scroll {
interface IonicScrollDelegate {
resize(): void;
scrollTop(shouldAnimate?: boolean): void;
scrollBottom(shouldAnimate?: boolean): void;
scrollTo(left: number, top: number, shouldAnimate?: boolean): void;
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};
anchorScroll(shouldAnimate?: boolean): void;
freezeScroll(shouldFreeze?: boolean): boolean;
freezeAllScrolls(shouldFreeze?: boolean): boolean;
getScrollView(): any;
$getByHandle(handle: string): IonicScrollDelegate;
}
}
module sideMenu {
interface IonicSideMenuDelegate {
toggleLeft(isOpen?: boolean): void;
toggleRight(isOpen?: boolean): void;
getOpenRatio(): number;
isOpen(): boolean;
isOpenLeft(): boolean;
isOpenRight(): boolean;
canDragContent(canDrag?: boolean): boolean;
edgeDragThreshold(value?: boolean|number): boolean;
$getByHandle(handle: string): IonicSideMenuDelegate;
}
}
module slideBox {
interface IonicSlideBoxDelegate {
update(): void;
slide(to: number, speed?: number): void;
enableSlide(shouldEnable?: boolean): boolean;
previous(speed?: number): void;
next(speed?: number): void;
stop(): void;
start(): void;
currentIndex(): number;
slidesCount(): number;
$getByHandle(handle: string): IonicSlideBoxDelegate;
}
}
module tabs {
interface IonicTabsDelegate {
select(index: number): void;
selectedIndex(): number;
$getByHandle(handle: string): IonicTabsDelegate;
}
}
module utility {
interface IonicConfigProvider {
views: {
transition(transition?: string): string;
maxCache(maxNumber?: number): number;
forwardCache(value?: boolean): boolean;
};
scrolling: {
jsScrolling(value?: boolean): boolean;
};
backButton: {
icon(value?: string): string;
text(value?: string): string;
previousTitleText(value?: boolean): boolean;
};
form: {
checkbox(value?: string): string;
toggle(value?: string): string;
};
spinner: {
icon(value?: string): string;
};
tabs: {
style(value?: string): string;
position(value?: string): string;
};
templates: {
maxPrefetch(value?: number): number;
};
navBar: {
alignTitle(value?: string): string;
positionPrimaryButtons(value?: string): string;
positionSecondaryButtons(value?: string): string;
};
}
interface IonicPositionService {
position(element: any): {top: number; left: number; width: number; height: number};
offset(element: any): {top: number; left: number; width: number; height: number};
}
}
}

View File

@ -1,5 +1,18 @@
/*
The API is the same for both client-side and server-side users.
For server-side users include the module as external module:
import ISO8601Localizer = require('iso8601-localizer');
For client-side users include the module as internal module as shown below:
*/
/// <reference path="iso8601-localizer.d.ts" />
new ISO8601Localizer('2015-06-02T14:13:12').localize();
new ISO8601Localizer('2015-06-02T14:13:12').to(-5).localize();
new ISO8601Localizer('2015-06-02T14:13:12').to(-5).returnAs('object').localize();

View File

@ -1,15 +1,21 @@
// Type definitions for ISO8601-Localizer v1.0.5
// Type definitions for ISO8601-Localizer v1.2.1
// Project: https://github.com/avielfedida/ISO8601-Localizer
// Definitions by: Aviel Fedida <https://github.com/avielfedida/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface localizer {
to(offset: number): localizer,
returnAs(as: string): localizer;
localize(): string;
}
declare class ISO8601Localizer implements localizer {
constructor(userISO8601: string);
to(offset: number): localizer;
returnAs(as: string): localizer;
localize(): string;
}
declare module "iso8601-localizer" {
export = ISO8601Localizer;
}

View File

@ -721,6 +721,17 @@ describe("Manually ticking the Jasmine Clock", function () {
jasmine.clock().tick(50);
expect(timerCallback.calls.count()).toEqual(2);
});
describe("Mocking the Date object", function(){
it("mocks the Date object and sets it to a given time", function() {
var baseTime = new Date(2013, 9, 23);
jasmine.clock().mockDate(baseTime);
jasmine.clock().tick(50);
expect(new Date().getTime()).toEqual(baseTime.getTime() + 50);
});
});
});
describe("Asynchronous specs", function () {

View File

@ -56,6 +56,7 @@ validOpts = {allowUnknown: bool};
validOpts = {skipFunctions: bool};
validOpts = {stripUnknown: bool};
validOpts = {language: bool};
validOpts = {presence: str};
validOpts = {context: obj};
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
@ -65,6 +66,34 @@ var renOpts: Joi.RenameOptions = null;
renOpts = {alias: bool};
renOpts = {multiple: bool};
renOpts = {override: bool};
renOpts = {ignoreUndefined: bool};
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
var emailOpts: Joi.EmailOptions = null;
emailOpts = {errorLevel: num};
emailOpts = {errorLevel: bool};
emailOpts = {tldWhitelist: strArr};
emailOpts = {tldWhitelist: obj};
emailOpts = {minDomainAtoms: num};
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
var ipOpts: Joi.IpOptions = null;
ipOpts = {version: str};
ipOpts = {version: strArr};
ipOpts = {cidr: str};
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
var uriOpts: Joi.UriOptions = null;
uriOpts = {scheme: str};
uriOpts = {scheme: exp};
uriOpts = {scheme: strArr};
uriOpts = {scheme: expArr};
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
@ -143,15 +172,30 @@ module common {
anySchema = anySchema.valid(x);
anySchema = anySchema.valid(x, x);
anySchema = anySchema.valid([x, x, x]);
anySchema = anySchema.only(x);
anySchema = anySchema.only(x, x);
anySchema = anySchema.only([x, x, x]);
anySchema = anySchema.equal(x);
anySchema = anySchema.equal(x, x);
anySchema = anySchema.equal([x, x, x]);
anySchema = anySchema.invalid(x);
anySchema = anySchema.invalid(x, x);
anySchema = anySchema.invalid([x, x, x]);
anySchema = anySchema.disallow(x);
anySchema = anySchema.disallow(x, x);
anySchema = anySchema.disallow([x, x, x]);
anySchema = anySchema.not(x);
anySchema = anySchema.not(x, x);
anySchema = anySchema.not([x, x, x]);
anySchema = anySchema.default();
anySchema = anySchema.default(x);
anySchema = anySchema.default(x, str);
anySchema = anySchema.required();
anySchema = anySchema.optional();
anySchema = anySchema.forbidden();
anySchema = anySchema.strip();
anySchema = anySchema.description(str);
anySchema = anySchema.notes(str);
@ -165,43 +209,65 @@ module common {
anySchema = anySchema.options(validOpts);
anySchema = anySchema.strict();
anySchema = anySchema.strict(bool);
anySchema = anySchema.concat(x);
altSchema = anySchema.when(str, whenOpts);
altSchema = anySchema.when(ref, whenOpts);
anySchema = anySchema.label(str);
anySchema = anySchema.raw();
anySchema = anySchema.raw(bool);
anySchema = anySchema.empty();
anySchema = anySchema.empty(str);
anySchema = anySchema.empty(anySchema);
}
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
arrSchema = Joi.array();
arrSchema = arrSchema.sparse();
arrSchema = arrSchema.sparse(bool);
arrSchema = arrSchema.single();
arrSchema = arrSchema.single(bool);
arrSchema = arrSchema.min(num);
arrSchema = arrSchema.max(num);
arrSchema = arrSchema.length(num);
arrSchema = arrSchema.unique();
arrSchema = arrSchema.includes(numSchema);
arrSchema = arrSchema.includes(numSchema, strSchema);
arrSchema = arrSchema.includes([numSchema, strSchema]);
arrSchema = arrSchema.items(numSchema);
arrSchema = arrSchema.items(numSchema, strSchema);
arrSchema = arrSchema.items([numSchema, strSchema]);
arrSchema = arrSchema.excludes(numSchema);
arrSchema = arrSchema.excludes(numSchema, strSchema);
arrSchema = arrSchema.excludes([numSchema, strSchema]);
// - - - - - - - -
module common_copy_paste {
// use search & replace from any
anySchema = anySchema.allow(x);
anySchema = anySchema.allow(x, x);
anySchema = anySchema.allow([x, x, x]);
anySchema = anySchema.valid(x);
anySchema = anySchema.valid(x, x);
anySchema = anySchema.valid([x, x, x]);
anySchema = anySchema.invalid(x);
anySchema = anySchema.invalid(x, x);
anySchema = anySchema.invalid([x, x, x]);
anySchema = anySchema.default(x);
arrSchema = arrSchema.allow(x);
arrSchema = arrSchema.allow(x, x);
arrSchema = arrSchema.allow([x, x, x]);
arrSchema = arrSchema.valid(x);
arrSchema = arrSchema.valid(x, x);
arrSchema = arrSchema.valid([x, x, x]);
arrSchema = arrSchema.only(x);
arrSchema = arrSchema.only(x, x);
arrSchema = arrSchema.only([x, x, x]);
arrSchema = arrSchema.equal(x);
arrSchema = arrSchema.equal(x, x);
arrSchema = arrSchema.equal([x, x, x]);
arrSchema = arrSchema.invalid(x);
arrSchema = arrSchema.invalid(x, x);
arrSchema = arrSchema.invalid([x, x, x]);
arrSchema = arrSchema.disallow(x);
arrSchema = arrSchema.disallow(x, x);
arrSchema = arrSchema.disallow([x, x, x]);
arrSchema = arrSchema.not(x);
arrSchema = arrSchema.not(x, x);
arrSchema = arrSchema.not([x, x, x]);
arrSchema = arrSchema.default(x);
arrSchema = arrSchema.required();
arrSchema = arrSchema.optional();
@ -237,10 +303,22 @@ module common_copy_paste {
boolSchema = boolSchema.valid(x);
boolSchema = boolSchema.valid(x, x);
boolSchema = boolSchema.valid([x, x, x]);
boolSchema = boolSchema.only(x);
boolSchema = boolSchema.only(x, x);
boolSchema = boolSchema.only([x, x, x]);
boolSchema = boolSchema.equal(x);
boolSchema = boolSchema.equal(x, x);
boolSchema = boolSchema.equal([x, x, x]);
boolSchema = boolSchema.invalid(x);
boolSchema = boolSchema.invalid(x, x);
boolSchema = boolSchema.invalid([x, x, x]);
boolSchema = boolSchema.disallow(x);
boolSchema = boolSchema.disallow(x, x);
boolSchema = boolSchema.disallow([x, x, x]);
boolSchema = boolSchema.not(x);
boolSchema = boolSchema.not(x, x);
boolSchema = boolSchema.not([x, x, x]);
boolSchema = boolSchema.default(x);
boolSchema = boolSchema.required();
@ -269,6 +347,7 @@ module common_copy_paste {
binSchema = Joi.binary();
binSchema = binSchema.encoding(str);
binSchema = binSchema.min(num);
binSchema = binSchema.max(num);
binSchema = binSchema.length(num);
@ -280,10 +359,22 @@ module common {
binSchema = binSchema.valid(x);
binSchema = binSchema.valid(x, x);
binSchema = binSchema.valid([x, x, x]);
binSchema = binSchema.only(x);
binSchema = binSchema.only(x, x);
binSchema = binSchema.only([x, x, x]);
binSchema = binSchema.equal(x);
binSchema = binSchema.equal(x, x);
binSchema = binSchema.equal([x, x, x]);
binSchema = binSchema.invalid(x);
binSchema = binSchema.invalid(x, x);
binSchema = binSchema.invalid([x, x, x]);
binSchema = binSchema.disallow(x);
binSchema = binSchema.disallow(x, x);
binSchema = binSchema.disallow([x, x, x]);
binSchema = binSchema.not(x);
binSchema = binSchema.not(x, x);
binSchema = binSchema.not([x, x, x]);
binSchema = binSchema.default(x);
binSchema = binSchema.required();
@ -321,6 +412,14 @@ dateSchema = dateSchema.max(str);
dateSchema = dateSchema.min(num);
dateSchema = dateSchema.max(num);
dateSchema = dateSchema.min(ref);
dateSchema = dateSchema.max(ref);
dateSchema = dateSchema.format(str);
dateSchema = dateSchema.format(strArr);
dateSchema = dateSchema.iso();
module common {
dateSchema = dateSchema.allow(x);
dateSchema = dateSchema.allow(x, x);
@ -328,10 +427,22 @@ module common {
dateSchema = dateSchema.valid(x);
dateSchema = dateSchema.valid(x, x);
dateSchema = dateSchema.valid([x, x, x]);
dateSchema = dateSchema.only(x);
dateSchema = dateSchema.only(x, x);
dateSchema = dateSchema.only([x, x, x]);
dateSchema = dateSchema.equal(x);
dateSchema = dateSchema.equal(x, x);
dateSchema = dateSchema.equal([x, x, x]);
dateSchema = dateSchema.invalid(x);
dateSchema = dateSchema.invalid(x, x);
dateSchema = dateSchema.invalid([x, x, x]);
dateSchema = dateSchema.disallow(x);
dateSchema = dateSchema.disallow(x, x);
dateSchema = dateSchema.disallow([x, x, x]);
dateSchema = dateSchema.not(x);
dateSchema = dateSchema.not(x, x);
dateSchema = dateSchema.not([x, x, x]);
dateSchema = dateSchema.default(x);
dateSchema = dateSchema.required();
@ -365,8 +476,18 @@ funcSchema = Joi.func();
numSchema = Joi.number();
numSchema = numSchema.min(num);
numSchema = numSchema.min(ref);
numSchema = numSchema.max(num);
numSchema = numSchema.max(ref);
numSchema = numSchema.greater(num);
numSchema = numSchema.greater(ref);
numSchema = numSchema.less(num);
numSchema = numSchema.less(ref);
numSchema = numSchema.integer();
numSchema = numSchema.precision(num);
numSchema = numSchema.multiple(num);
numSchema = numSchema.positive();
numSchema = numSchema.negative();
module common {
numSchema = numSchema.allow(x);
@ -375,10 +496,22 @@ module common {
numSchema = numSchema.valid(x);
numSchema = numSchema.valid(x, x);
numSchema = numSchema.valid([x, x, x]);
numSchema = numSchema.only(x);
numSchema = numSchema.only(x, x);
numSchema = numSchema.only([x, x, x]);
numSchema = numSchema.equal(x);
numSchema = numSchema.equal(x, x);
numSchema = numSchema.equal([x, x, x]);
numSchema = numSchema.invalid(x);
numSchema = numSchema.invalid(x, x);
numSchema = numSchema.invalid([x, x, x]);
numSchema = numSchema.disallow(x);
numSchema = numSchema.disallow(x, x);
numSchema = numSchema.disallow([x, x, x]);
numSchema = numSchema.not(x);
numSchema = numSchema.not(x, x);
numSchema = numSchema.not([x, x, x]);
numSchema = numSchema.default(x);
numSchema = numSchema.required();
@ -417,12 +550,23 @@ objSchema = objSchema.length(num);
objSchema = objSchema.pattern(exp, schema);
objSchema = objSchema.and(str);
objSchema = objSchema.and(str, str);
objSchema = objSchema.and(str, str, str);
objSchema = objSchema.and(strArr);
objSchema = objSchema.nand(str);
objSchema = objSchema.nand(str, str);
objSchema = objSchema.nand(str, str, str);
objSchema = objSchema.nand(strArr);
objSchema = objSchema.or(str);
objSchema = objSchema.or(str, str);
objSchema = objSchema.or(str, str, str);
objSchema = objSchema.or(strArr);
objSchema = objSchema.xor(str);
objSchema = objSchema.xor(str, str);
objSchema = objSchema.xor(str, str, str);
objSchema = objSchema.xor(strArr);
@ -441,6 +585,17 @@ objSchema = objSchema.assert(ref, schema, str);
objSchema = objSchema.unknown();
objSchema = objSchema.unknown(bool);
objSchema = objSchema.type(func);
objSchema = objSchema.type(func, str);
objSchema = objSchema.requiredKeys(str);
objSchema = objSchema.requiredKeys(str, str);
objSchema = objSchema.requiredKeys(strArr);
objSchema = objSchema.optionalKeys(str);
objSchema = objSchema.optionalKeys(str, str);
objSchema = objSchema.optionalKeys(strArr);
module common {
objSchema = objSchema.allow(x);
objSchema = objSchema.allow(x, x);
@ -448,10 +603,22 @@ module common {
objSchema = objSchema.valid(x);
objSchema = objSchema.valid(x, x);
objSchema = objSchema.valid([x, x, x]);
objSchema = objSchema.only(x);
objSchema = objSchema.only(x, x);
objSchema = objSchema.only([x, x, x]);
objSchema = objSchema.equal(x);
objSchema = objSchema.equal(x, x);
objSchema = objSchema.equal([x, x, x]);
objSchema = objSchema.invalid(x);
objSchema = objSchema.invalid(x, x);
objSchema = objSchema.invalid([x, x, x]);
objSchema = objSchema.disallow(x);
objSchema = objSchema.disallow(x, x);
objSchema = objSchema.disallow([x, x, x]);
objSchema = objSchema.not(x);
objSchema = objSchema.not(x, x);
objSchema = objSchema.not([x, x, x]);
objSchema = objSchema.default(x);
objSchema = objSchema.required();
@ -482,13 +649,33 @@ strSchema = Joi.string();
strSchema = strSchema.insensitive();
strSchema = strSchema.min(num);
strSchema = strSchema.min(num, str);
strSchema = strSchema.min(ref);
strSchema = strSchema.min(ref, str);
strSchema = strSchema.max(num);
strSchema = strSchema.max(num, str);
strSchema = strSchema.max(ref);
strSchema = strSchema.max(ref, str);
strSchema = strSchema.creditCard();
strSchema = strSchema.length(num);
strSchema = strSchema.length(num, str);
strSchema = strSchema.length(ref);
strSchema = strSchema.length(ref, str);
strSchema = strSchema.regex(exp);
strSchema = strSchema.regex(exp, str);
strSchema = strSchema.replace(exp, str);
strSchema = strSchema.replace(str, str);
strSchema = strSchema.alphanum();
strSchema = strSchema.token();
strSchema = strSchema.email();
strSchema = strSchema.email(emailOpts);
strSchema = strSchema.ip();
strSchema = strSchema.ip(ipOpts);
strSchema = strSchema.uri();
strSchema = strSchema.uri(uriOpts);
strSchema = strSchema.guid();
strSchema = strSchema.hex();
strSchema = strSchema.hostname();
strSchema = strSchema.isoDate();
strSchema = strSchema.lowercase();
strSchema = strSchema.uppercase();
@ -501,10 +688,22 @@ module common {
strSchema = strSchema.valid(x);
strSchema = strSchema.valid(x, x);
strSchema = strSchema.valid([x, x, x]);
strSchema = strSchema.only(x);
strSchema = strSchema.only(x, x);
strSchema = strSchema.only([x, x, x]);
strSchema = strSchema.equal(x);
strSchema = strSchema.equal(x, x);
strSchema = strSchema.equal([x, x, x]);
strSchema = strSchema.invalid(x);
strSchema = strSchema.invalid(x, x);
strSchema = strSchema.invalid([x, x, x]);
strSchema = strSchema.disallow(x);
strSchema = strSchema.disallow(x, x);
strSchema = strSchema.disallow([x, x, x]);
strSchema = strSchema.not(x);
strSchema = strSchema.not(x, x);
strSchema = strSchema.not([x, x, x]);
strSchema = strSchema.default(x);
strSchema = strSchema.required();
@ -536,6 +735,7 @@ schema = Joi.alternatives(schema, anySchema, boolSchema);
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
Joi.validate(value, obj);
Joi.validate(value, schema);
Joi.validate(value, schema, validOpts);
Joi.validate(value, schema, validOpts, (err, value) => {
@ -565,6 +765,8 @@ Joi.validate(value, {});
schema = Joi.compile(obj);
Joi.assert(obj, schema);
Joi.assert(obj, schema, str);
Joi.assert(obj, schema, err);
ref = Joi.ref(str, refOpts);
ref = Joi.ref(str);

306
joi/joi.d.ts vendored
View File

@ -1,6 +1,6 @@
// Type definitions for joi v4.6.0
// Project: https://github.com/spumko/joi
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>, Laurence Dougal Myers <https://github.com/laurence-myers>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// TODO express type of Schema in a type-parameter (.default, .valid, .example etc)
@ -19,7 +19,9 @@ declare module 'joi' {
// when true, unknown keys are deleted (only when value is an object). Defaults to false.
stripUnknown?: boolean;
// overrides individual error messages. Defaults to no override ({}).
language?: Object
language?: Object;
// sets the default presence requirements. Supported modes: 'optional', 'required', and 'forbidden'. Defaults to 'optional'.
presence?: string;
// provides an external data set to be used in references
context?: Object;
}
@ -33,6 +35,28 @@ declare module 'joi' {
override?: boolean;
}
export interface EmailOptions {
// Numerical threshold at which an email address is considered invalid
errorLevel?: number | boolean;
// Specifies a list of acceptable TLDs.
tldWhitelist?: string[] | Object;
// Number of atoms required for the domain. Be careful since some domains, such as io, directly allow email.
minDomainAtoms?: number;
}
export interface IpOptions {
// One or more IP address versions to validate against. Valid values: ipv4, ipv6, ipvfuture
version ?: string | string[];
// Used to determine if a CIDR is allowed or not. Valid values: optional, required, forbidden
cidr?: string;
}
export interface UriOptions {
// Specifies one or more acceptable Schemes, should only include the scheme name.
// Can be an Array or String (strings are automatically escaped for use in a Regular Expression).
scheme ?: string | RegExp | Array<string | RegExp>;
}
export interface WhenOptions {
// the required condition joi type.
is: Schema;
@ -47,11 +71,16 @@ declare module 'joi' {
contextPrefix?: string;
}
export interface IPOptions {
version?: Array<string>;
cidr?: string
}
export interface ValidationError {
message: string;
details: ValidationErrorItem[];
simple (): string;
annotated (): string;
simple(): string;
annotated(): string;
}
export interface ValidationErrorItem {
@ -82,20 +111,28 @@ declare module 'joi' {
/**
* Whitelists a value
*/
allow(value: any, ...values : any[]): T;
allow(value: any, ...values: any[]): T;
allow(values: any[]): T;
/**
* Adds the provided values into the allowed whitelist and marks them as the only valid values allowed.
*/
valid(value: any, ...values : any[]): T;
valid(value: any, ...values: any[]): T;
valid(values: any[]): T;
only(value: any, ...values : any[]): T;
only(values: any[]): T;
equal(value: any, ...values : any[]): T;
equal(values: any[]): T;
/**
* Blacklists a value
*/
invalid(value: any, ...values : any[]): T;
invalid(value: any, ...values: any[]): T;
invalid(values: any[]): T;
disallow(value: any, ...values : any[]): T;
disallow(values: any[]): T;
not(value: any, ...values : any[]): T;
not(values: any[]): T;
/**
* Marks a key as required which will not allow undefined as value. All keys are optional by default.
@ -112,6 +149,11 @@ declare module 'joi' {
*/
forbidden(): T;
/**
* Marks a key to be removed from a resulting object or array after validation. Used to sanitize output.
*/
strip(): T;
/**
* Annotates the key
*/
@ -152,12 +194,28 @@ declare module 'joi' {
/**
* Sets the options.convert options to false which prevent type casting for the current key and any child keys.
*/
strict(): T;
strict(isStrict?: boolean): T;
/**
* Sets a default value if the original value is undefined.
* @param value - the value.
* value supports references.
* value may also be a function which returns the default value.
* If value is specified as a function that accepts a single parameter, that parameter will be a context
* object that can be used to derive the resulting value. This clones the object however, which incurs some
* overhead so if you don't need access to the context define your method so that it does not accept any
* parameters.
* Without any value, default has no effect, except for object that will then create nested defaults
* (applying inner defaults of that object).
*
* Note that if value is an object, any changes to the object after default() is called will change the
* reference and any future assignment.
*
* Additionally, when specifying a method you must either have a description property on your method or the
* second parameter is required.
*/
default(value: any): T;
default(value: any, description?: string): T;
default(): T;
/**
* Returns a new type that is the result of adding the rules of one type to another.
@ -169,6 +227,22 @@ declare module 'joi' {
*/
when(ref: string, options: WhenOptions): AlternativesSchema;
when(ref: Reference, options: WhenOptions): AlternativesSchema;
/**
* Overrides the key name in error messages.
*/
label(name: string): T;
/**
* Outputs the original untouched value instead of the casted value.
*/
raw(isRaw?: boolean): T;
/**
* Considers anything that matches the schema to be empty (undefined).
* @param schema - any object or joi schema to match. An undefined schema unsets that rule.
*/
empty(schema?: any) : T;
}
export interface BooleanSchema extends AnySchema<BooleanSchema> {
@ -178,18 +252,57 @@ declare module 'joi' {
export interface NumberSchema extends AnySchema<NumberSchema> {
/**
* Specifies the minimum value.
* It can also be a reference to another field.
*/
min(limit: number): NumberSchema;
min(limit: Reference): NumberSchema;
/**
* Specifies the maximum value.
* It can also be a reference to another field.
*/
max(limit: number): NumberSchema;
max(limit: Reference): NumberSchema;
/**
* Specifies that the value must be greater than limit.
* It can also be a reference to another field.
*/
greater(limit: number): NumberSchema;
greater(limit: Reference): NumberSchema;
/**
* Specifies that the value must be less than limit.
* It can also be a reference to another field.
*/
less(limit: number): NumberSchema;
less(limit: Reference): NumberSchema;
/**
* Requires the number to be an integer (no floating point).
*/
integer(): NumberSchema;
/**
* Specifies the maximum number of decimal places where:
* limit - the maximum number of decimal places allowed.
*/
precision(limit: number): NumberSchema;
/**
* Specifies that the value must be a multiple of base.
*/
multiple(base: number): NumberSchema;
/**
* Requires the number to be positive.
*/
positive(): NumberSchema;
/**
* Requires the number to be negative.
*/
negative(): NumberSchema;
}
export interface StringSchema extends AnySchema<StringSchema> {
@ -200,23 +313,47 @@ declare module 'joi' {
/**
* Specifies the minimum number string characters.
* @param limit - the minimum number of string characters required. It can also be a reference to another field.
* @param encoding - if specified, the string length is calculated in bytes using the provided encoding.
*/
min(limit: number): StringSchema;
min(limit: number, encoding?: string): StringSchema;
min(limit: Reference, encoding?: string): StringSchema;
/**
* Specifies the maximum number of string characters.
* @param limit - the maximum number of string characters allowed. It can also be a reference to another field.
* @param encoding - if specified, the string length is calculated in bytes using the provided encoding.
*/
max(limit: number): StringSchema;
max(limit: number, encoding?: string): StringSchema;
max(limit: Reference, encoding?: string): StringSchema;
/**
* Requires the number to be a credit card number (Using Lunh Algorithm).
*/
creditCard(): StringSchema;
/**
* Specifies the exact string length required
* @param limit - the required string length. It can also be a reference to another field.
* @param encoding - if specified, the string length is calculated in bytes using the provided encoding.
*/
length(limit: number): StringSchema;
length(limit: number, encoding?: string): StringSchema;
length(limit: Reference, encoding?: string): StringSchema;
/**
* Defines a regular expression rule.
* @param pattern - a regular expression object the string value must match against.
* @param name - optional name for patterns (useful with multiple patterns). Defaults to 'required'.
*/
regex(pattern: RegExp): StringSchema;
regex(pattern: RegExp, name?: string): StringSchema;
/**
* Replace characters matching the given pattern with the specified replacement string where:
* @param pattern - a regular expression object to match against, or a string of which all occurrences will be replaced.
* @param replacement - the string that will replace the pattern.
*/
replace(pattern: RegExp, replacement: string): StringSchema;
replace(pattern: string, replacement: string): StringSchema;
/**
* Requires the string value to only contain a-z, A-Z, and 0-9.
@ -231,13 +368,33 @@ declare module 'joi' {
/**
* Requires the string value to be a valid email address.
*/
email(): StringSchema;
email(options?: EmailOptions): StringSchema;
/**
* Requires the string value to be a valid ip address.
*/
ip(options?: IpOptions): StringSchema;
/**
* Requires the string value to be a valid RFC 3986 URI.
*/
uri(options?: UriOptions): StringSchema;
/**
* Requires the string value to be a valid GUID.
*/
guid(): StringSchema;
/**
* Requires the string value to be a valid hexadecimal string.
*/
hex(): StringSchema;
/**
* Requires the string value to be a valid hostname as per RFC1123.
*/
hostname(): StringSchema;
/**
* Requires the string value to be in valid ISO 8601 date format.
*/
@ -257,25 +414,34 @@ declare module 'joi' {
* Requires the string value to contain no whitespace before or after. If the validation convert option is on (enabled by default), the string will be trimmed.
*/
trim(): StringSchema;
/**
* Requires the string value to be a valid uri with the passed scheme.
*/
uri(options?: { scheme?: string }): StringSchema;
}
export interface ArraySchema extends AnySchema<ArraySchema> {
/**
* List the types allowed for the array value
* Allow this array to be sparse.
* enabled can be used with a falsy value to go back to the default behavior.
*/
includes(type: Schema, ...types: Schema[]): ArraySchema;
includes(types: Schema[]): ArraySchema;
sparse(enabled?: any): ArraySchema;
/**
* List the types forbidden for the array values.
* Allow single values to be checked against rules as if it were provided as an array.
* enabled can be used with a falsy value to go back to the default behavior.
*/
excludes(type: Schema, ...types: Schema[]): ArraySchema;
excludes(types: Schema[]): ArraySchema;
single(enabled?: any): ArraySchema;
/**
* List the types allowed for the array values.
* type can be an array of values, or multiple values can be passed as individual arguments.
* If a given type is .required() then there must be a matching item in the array.
* If a type is .forbidden() then it cannot appear in the array.
* Required items can be added multiple times to signify that multiple items must be found.
* Errors will contain the number of items that didn't match.
* Any unmatched item having a label will be mentioned explicitly.
*
* @param type - a joi schema object to validate each array item against.
*/
items(type: Schema, ...types: Schema[]): ArraySchema;
items(types: Schema[]): ArraySchema;
/**
* Specifies the minimum number of items in the array.
@ -292,6 +458,12 @@ declare module 'joi' {
*/
length(limit: number): ArraySchema;
/**
* Requires the array values to be unique.
* Be aware that a deep equality is performed on elements of the array having a type of object,
* a performance penalty is to be expected for this kind of operation.
*/
unique(): ArraySchema;
}
export interface ObjectSchema extends AnySchema<ObjectSchema> {
@ -322,20 +494,30 @@ declare module 'joi' {
/**
* Defines an all-or-nothing relationship between keys where if one of the peers is present, all of them are required as well.
* @param peers - the key names of which if one present, all are required. peers can be a single string value,
* an array of string values, or each peer provided as an argument.
*/
and(peer1: string, peer2: string, ...peers: string[]): ObjectSchema;
and(peer1: string, ...peers: string[]): ObjectSchema;
and(peers: string[]): ObjectSchema;
/**
* Defines a relationship between keys where not all peers can be present at the same time.
* @param peers - the key names of which if one present, the others may not all be present.
* peers can be a single string value, an array of string values, or each peer provided as an argument.
*/
nand(peer1: string, ...peers: string[]): ObjectSchema;
nand(peers: string[]): ObjectSchema;
/**
* Defines a relationship between keys where one of the peers is required (and more than one is allowed).
*/
or(peer1: string, peer2: string, ...peers: string[]): ObjectSchema;
or(peer1: string, ...peers: string[]): ObjectSchema;
or(peers: string[]): ObjectSchema;
/**
* Defines an exclusive relationship between a set of keys. one of them is required but not at the same time where:
*/
xor(peer1: string, peer2: string, ...peers: string[]): ObjectSchema;
xor(peer1: string, ...peers: string[]): ObjectSchema;
xor(peers: string[]): ObjectSchema;
/**
@ -364,10 +546,48 @@ declare module 'joi' {
/**
* Overrides the handling of unknown keys for the scope of the current object only (does not apply to children).
*/
unknown(allow?:boolean): ObjectSchema;
unknown(allow?: boolean): ObjectSchema;
/**
* Requires the object to be an instance of a given constructor.
*
* @param constructor - the constructor function that the object must be an instance of.
* @param name - an alternate name to use in validation errors. This is useful when the constructor function does not have a name.
*/
type(constructor: Function, name?: string): ObjectSchema;
/**
* Sets the specified children to required.
*
* @param children - can be a single string value, an array of string values, or each child provided as an argument.
*
* var schema = Joi.object().keys({ a: { b: Joi.number() }, c: { d: Joi.string() } });
* var requiredSchema = schema.requiredKeys('', 'a.b', 'c', 'c.d');
*
* Note that in this example '' means the current object, a is not required but b is, as well as c and d.
*/
requiredKeys(children: string): ObjectSchema;
requiredKeys(children: string[]): ObjectSchema;
requiredKeys(child:string, ...children: string[]): ObjectSchema;
/**
* Sets the specified children to optional.
*
* @param children - can be a single string value, an array of string values, or each child provided as an argument.
*
* The behavior is exactly the same as requiredKeys.
*/
optionalKeys(children: string): ObjectSchema;
optionalKeys(children: string[]): ObjectSchema;
optionalKeys(child:string, ...children: string[]): ObjectSchema;
}
export interface BinarySchema extends AnySchema<BinarySchema> {
/**
* Sets the string encoding format if a string input is converted to a buffer.
*/
encoding(encoding: string): BinarySchema;
/**
* Specifies the minimum length of the buffer.
*/
@ -388,17 +608,37 @@ declare module 'joi' {
/**
* Specifies the oldest date allowed.
* Notes: 'now' can be passed in lieu of date so as to always compare relatively to the current date,
* allowing to explicitly ensure a date is either in the past or in the future.
* It can also be a reference to another field.
*/
min(date: Date): DateSchema;
min(date: number): DateSchema;
min(date: string): DateSchema;
min(date: Reference): DateSchema;
/**
* Specifies the latest date allowed.
* Notes: 'now' can be passed in lieu of date so as to always compare relatively to the current date,
* allowing to explicitly ensure a date is either in the past or in the future.
* It can also be a reference to another field.
*/
max(date: Date): DateSchema;
max(date: number): DateSchema;
max(date: string): DateSchema;
max(date: Reference): DateSchema;
/**
* Specifies the allowed date format:
* @param format - string or array of strings that follow the moment.js format.
*/
format(format: string): DateSchema;
format(format: string[]): DateSchema;
/**
* Requires the string value to be in valid ISO 8601 date format.
*/
iso(): DateSchema;
}
export interface FunctionSchema extends AnySchema<FunctionSchema> {
@ -480,11 +720,15 @@ declare module 'joi' {
/**
* Validates a value against a schema and throws if validation fails.
*
* @param value - the value to validate.
* @param schema - the schema object.
* @param message - optional message string prefix added in front of the error message. may also be an Error object.
*/
export function assert(value: any, schema: Schema): void;
export function assert(value: any, schema: Schema, message?: string | Error): void;
/**
* Generates a reference to the value of the named key.
*/
export function ref(key:string, options?: ReferenceOptions): Reference;
export function ref(key: string, options?: ReferenceOptions): Reference;
}

View File

@ -1 +0,0 @@
--noImplicitAny

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