Merge branch 'master' of github.com:borisyankov/DefinitelyTyped

This commit is contained in:
Phips Peter
2015-03-07 14:18:45 -08:00
181 changed files with 14724 additions and 1598 deletions
+3
View File
@@ -32,6 +32,9 @@ _infrastructure/tests/build
#rx.js
!rx.js
#zip.js
!zip.js
node_modules
.sublimets
+53 -5
View File
@@ -25,7 +25,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](angular-translate/angular-translate.d.ts) [Angular Translate (pascalprecht.translate module)](https://github.com/PascalPrecht/angular-translate) by [Michel Salib](https://github.com/michelsalib)
* [:link:](angular-ui-bootstrap/angular-ui-bootstrap.d.ts) [Angular UI Bootstrap](https://github.com/angular-ui/bootstrap) by [Brian Surowiec](https://github.com/xt0rted)
* [:link:](angular-bootstrap-lightbox/angular-bootstrap-lightbox.d.ts) [angular-bootstrap-lightbox](https://github.com/compact/angular-bootstrap-lightbox) by [Roland Zwaga](https://github.com/rolandzwaga)
* [:link:](angular-hotkeys/angular-hotkeys.d.ts) [angular-hotkeys](https://github.com/chieffancypants/angular-hotkeys) by [Jason Zhao](https://github.com/jlz27)
* [:link:](angular-hotkeys/angular-hotkeys.d.ts) [angular-hotkeys](https://github.com/chieffancypants/angular-hotkeys) by [Jason Zhao](https://github.com/jlz27), [Stefan Steinhart](https://github.com/reppners)
* [:link:](angular-http-auth/angular-http-auth.d.ts) [angular-http-auth](https://github.com/witoldsz/angular-http-auth) by [vvakame](https://github.com/vvakame)
* [:link:](angular-local-storage/angular-local-storage.d.ts) [angular-local-storage](https://github.com/grevory/angular-local-storage) by [Ken Fukuyama](https://github.com/kenfdev)
* [:link:](angular-notify/angular-notify.d.ts) [angular-notify](https://github.com/cgross/angular-notify) by [Suwato](https://github.com/Suwato/DefinitelyTyped)
@@ -41,6 +41,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](cordova/cordova.d.ts) [Apache Cordova](http://cordova.apache.org) by [Microsoft Open Technologies Inc.](http://msopentech.com)
* [:link:](appframework/appframework.d.ts) [AppFramework](http://app-framework-software.intel.com) by [kyo_ago](https://github.com/kyo-ago)
* [:link:](arbiter/Arbiter.d.ts) [Arbiter.js](http://arbiterjs.com) by [Arash Shakery](https://github.com/arash16)
* [:link:](archy/archy.d.ts) [archy](https://github.com/substack/node-archy) by [vvakame](https://github.com/vvakame)
* [:link:](asciify/asciify.d.ts) [asciify](https://www.npmjs.org/package/asciify) by [Alan Norbauer](http://alan.norbauer.com)
* [:link:](aspnet-identity-pw/aspnet-identity-pw.d.ts) [aspnet-identity-pw](https://github.com/Syncbak-Git/aspnet-identity-pw) by [jt000](https://github.com/jt000)
* [:link:](assert/assert.d.ts) [assert and power-assert](https://github.com/Jxck/assert) by [vvakame](https://github.com/vvakame)
@@ -65,6 +66,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](bigint/bigint.d.ts) [BigInt](https://github.com/Evgenus/BigInt) by [Eugene Chernyshov](https://github.com/Evgenus)
* [:link:](big-integer/big-integer.d.ts) [BigInteger.js](https://github.com/peterolson/BigInteger.js) by [Ingo Bürk](https://github.com/Airblader), [Roel van Uden](https://github.com/Deathspike)
* [:link:](bigscreen/bigscreen.d.ts) [BigScreen](http://brad.is/coding/BigScreen) by [Douglas Eichelberger](https://github.com/dduugg)
* [:link:](bitwise-xor/bitwise-xor.d.ts) [bitwise-xor](https://github.com/czzarr/node-bitwise-xor) by [Rogier Schouten](https://github.com/rogierschouten)
* [:link:](bluebird/bluebird.d.ts) [bluebird](https://github.com/petkaantonov/bluebird) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](body-parser/body-parser.d.ts) [body-parser](http://expressjs.com) by [Santi Albo](https://github.com/santialbo), [VILIC VANE](https://vilic.info), [Jonathan Häberle](https://github.com/dreampulse)
* [:link:](boom/boom.d.ts) [boom](http://github.com/hapijs/boom) by [Igor Rogatty](http://github.com/rogatty)
@@ -76,7 +78,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](bootstrap.paginator/bootstrap.paginator.d.ts) [bootstrap.paginator](https://github.com/lyonlai/bootstrap-paginator) by [derikwhittaker](https://github.com/derikwhittaker)
* [:link:](bootstrap.timepicker/bootstrap.timepicker.d.ts) [bootstrap.timepicker](https://github.com/jdewit/bootstrap-timepicker) by [derikwhittaker](https://github.com/derikwhittaker)
* [:link:](box2d/box2dweb.d.ts) [bootstrap.timepicker](http://code.google.com/p/box2dweb) by [jbaldwin](https://github.com/jbaldwin)
* [:link:](breeze/breeze.d.ts) [Breeze](http://www.breezejs.com) by [Boris Yankov](https://github.com/borisyankov), [IdeaBlade](https://github.com/IdeaBlade/Breeze)
* [: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)
* [:link:](browserify/browserify.d.ts) [Browserify](http://browserify.org) by [Andrew Gaspar](https://github.com/AndrewGaspar)
@@ -84,6 +86,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](buffer-equal/buffer-equal.d.ts) [buffer-equal](https://github.com/substack/node-buffer-equal) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](bl/bl.d.ts) [BufferList](https://github.com/rvagg/bl) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](bufferstream/bufferstream.d.ts) [bufferstream](https://github.com/dodo/node-bufferstream) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](bunyan-prettystream/bunyan-prettystream.d.ts) [bunyan-prettystream](https://www.npmjs.com/package/bunyan-prettystream) by [Jason Swearingen](https://github.com/jasonswearingen)
* [:link:](business-rules-engine/business-rules-engine.d.ts) [business-rules-engine](https://github.com/rsamec/form) by [Roman Samec](https://github.com/rsamec)
* [:link:](byline/byline.d.ts) [byline](https://github.com/jahewson/node-byline) by [Stefan Steinhart](https://github.com/reppners)
* [:link:](camljs/camljs.d.ts) [camljs](http://camljs.codeplex.com) by [Andrey Markeev](http://markeev.com)
@@ -96,10 +99,12 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](chai-http/chai-http.d.ts) [chai-http](https://github.com/chaijs/chai-http) by [Wim Looman](https://github.com/Nemo157)
* [:link:](chai-jquery/chai-jquery.d.ts) [chai-jquery](https://github.com/chaijs/chai-jquery) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid)
* [:link:](chalk/chalk.d.ts) [chalk](https://github.com/sindresorhus/chalk) by [Diullei Gomes](https://github.com/Diullei), [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](chance/chance.d.ts) [Chance](http://chancejs.com) by [Chris Bowdon](https://github.com/cbowdon)
* [:link:](change-case/change-case.d.ts) [change-case](https://github.com/blakeembrey/change-case) by [Asana](https://asana.com)
* [:link:](chartjs/chart.d.ts) [Chart.js](https://github.com/nnnick/Chart.js) by [Steve Fenton](https://github.com/Steve-Fenton)
* [:link:](checksum/checksum.d.ts) [checksum](https://github.com/dshaw/checksum) by [Rogier Schouten](https://github.com/rogierschouten)
* [:link:](cheerio/cheerio.d.ts) [Cheerio](https://github.com/cheeriojs/cheerio) by [Bret Little](https://github.com/blittle), [VILIC VANE](http://vilic.info), [Wayne Maurer](https://github.com/wmaurer)
* [:link:](chokidar/chokidar.d.ts) [chokidar](https://github.com/paulmillr/chokidar) by [Stefan Steinhart](https://github.com/reppners)
* [:link:](chosen/chosen.jquery.d.ts) [Chosen.JQuery](http://harvesthq.github.com/chosen) by [Boris Yankov](https://github.com/borisyankov)
* [:link:](chroma-js/chroma-js.d.ts) [Chroma.js](https://github.com/gka/chroma.js) by [Sebastian Brückner](https://github.com/invliD)
* [:link:](chrome/chrome.d.ts) [Chrome extension development](http://developer.chrome.com/extensions) by [Matthew Kimber](https://github.com/matthewkimber), [otiai10](https://github.com/otiai10)
@@ -135,7 +140,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](dat-gui/dat-gui.d.ts) [dat.GUI](https://github.com/dataarts/dat.gui) by [Satoru Kimura](https://github.com/gyohk)
* [: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)
* [:link:](dcjs/dc.d.ts) [DCJS](https://github.com/dc-js) by [hans windhoff](https://github.com/hansrwindhoff)
* [:link:](dcjs/dc.d.ts) [DCJS](https://github.com/dc-js/dc.js) by [hans windhoff](https://github.com/hansrwindhoff), [matt traynham](https://github.com/mtraynham)
* [:link:](debug/debug.d.ts) [debug](https://github.com/visionmedia/debug) by [Seon-Wook Park](https://github.com/swook)
* [:link:](deep-diff/deep-diff.d.ts) [deep-diff](https://github.com/flitbit/diff) by [ZauberNerd](https://github.com/ZauberNerd)
* [:link:](deep-freeze/deep-freeze.d.ts) [deep-freeze](https://github.com/substack/deep-freeze) by [Bart van der Schoor](https://github.com/Bartvds)
@@ -156,6 +161,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](dot/dot.d.ts) [doT](https://github.com/olado/doT) by [ZombieHunter](https://github.com/ZombieHunter)
* [:link:](dotdotdot/dotdotdot.d.ts) [dotdotdot](http://dotdotdot.frebsite.nl) by [Milan Jaros](https://github.com/milanjaros)
* [:link:](doublearray/doublearray.d.ts) [doublearray](https://github.com/takuyaa/doublearray) by [MIZUSHIMA Junki](https://github.com/mzsm)
* [:link:](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:](dts-bundle/dts-bundle.d.ts) [dts-bundle](https://github.com/TypeStrong/dts-bundle) by [Asana](https://asana.com)
@@ -174,9 +180,11 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](epiceditor/epiceditor.d.ts) [EpicEditor](http://epiceditor.com) by [Boris Yankov](https://github.com/borisyankov)
* [:link:](errorhandler/errorhandler.d.ts) [errorhandler](https://github.com/expressjs/errorhandler) by [Santi Albo](https://github.com/santialbo)
* [:link:](es6-promise/es6-promise.d.ts) [es6-promise](https://github.com/jakearchibald/ES6-Promise) by [François de Campredon](https://github.com/fdecampredon), [vvakame](https://github.com/vvakame)
* [:link:](escape-latex/escape-latex.d.ts) [escape-latex](https://github.com/dangmai/escape-latex) by [Oliver Schneider](https://github.com/olsio)
* [:link:](esprima/esprima.d.ts) [Esprima](http://esprima.org) by [teppeis](https://github.com/teppeis)
* [:link:](event-loop-lag/event-loop-lag.d.ts) [event-loop-lag](https://github.com/pebble/event-loop-lag) by [Rogier Schouten](https://github.com/rogierschouten)
* [:link:](eventemitter2/eventemitter2.d.ts) [EventEmitter2](https://github.com/asyncly/EventEmitter2) by [ryiwamoto](https://github.com/ryiwamoto)
* [:link:](eventemitter3/eventemitter3.d.ts) [EventEmitter3](https://github.com/primus/eventemitter3) by [Yuichi Murata](https://github.com/mrk21)
* [: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:](expectations/expectations.d.ts) [expectations.js](https://github.com/spmason/expectations) by [vvakame](https://github.com/vvakame)
@@ -208,6 +216,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](flipsnap/flipsnap.d.ts) [flipsnap.js](http://pxgrid.github.io/js-flipsnap) by [kubosho](https://github.com/kubosho), [gsino](https://github.com/gsino), [Mayuki Sawatari](https://github.com/mayuki)
* [:link:](flot/jquery.flot.d.ts) [Flot](http://www.flotcharts.org) by [Matt Burland](https://github.com/burlandm)
* [:link:](flux/flux.d.ts) [Flux](http://facebook.github.io/flux) by [Steve Baker](https://github.com/stkb)
* [:link:](fluxxor/fluxxor.d.ts) [Fluxxor](https://github.com/BinaryMuse/fluxxor) by [Yuichi Murata](https://github.com/mrk21)
* [:link:](ion.rangeSlider/ion.rangeSlider.d.ts) [for Ion.RangeSlider](https://github.com/IonDen/ion.rangeSlider) by [Sixin Li](https://github.com/sixinli)
* [:link:](form-data/form-data.d.ts) [form-data](https://github.com/felixge/node-form-data) by [Carlos Ballesteros Velasco](https://github.com/soywiz)
* [:link:](formidable/formidable.d.ts) [Formidable](https://github.com/felixge/node-formidable) by [Wim Looman](https://github.com/Nemo157)
@@ -218,6 +227,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](ftdomdelegate/ftdomdelegate.d.ts) [ftdomdelegate](https://github.com/ftlabs/ftdomdelegate) by [Christian Holm Nielsen](https://github.com/dotnetnerd)
* [:link:](fullCalendar/fullCalendar.d.ts) [FullCalendar](http://arshaw.com/fullcalendar) by [Neil Stalker](https://github.com/nestalk)
* [:link:](fuse/fuse.d.ts) [Fuse.js](https://github.com/krisk/Fuse) by [Greg Smith](https://github.com/smrq)
* [:link:](jquery-galleria/jquery-galleria.d.ts) [galleria.js](https://github.com/aino/galleria) by [Robert Imig](https://github.com/rimig)
* [:link:](gamepad/gamepad.d.ts) [Gamepad API](http://www.w3.org/TR/gamepad) by [Kon](http://phyzkit.net)
* [:link:](gamequery/gamequery.d.ts) [gameQuery](http://gamequeryjs.com) by [David Laubreiter](https://github.com/Laubi)
* [:link:](gently/gently.d.ts) [gently](https://www.npmjs.org/package/gently) by [bonnici](https://github.com/bonnici)
@@ -236,6 +246,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](google.geolocation/google.geolocation.d.ts) [Google Geolocation](https://code.google.com/p/geo-location-javascript) by [Vincent Bortone](https://github.com/vbortone)
* [:link:](googlemaps/google.maps.d.ts) [Google Geolocation](https://developers.google.com/maps) by [Folia A/S](http://www.folia.dk)
* [:link:](gapi.pagespeedonline/gapi.pagespeedonline.d.ts) [Google Page Speed Online Api](https://developers.google.com/speed/pagespeed) by [Frank M](https://github.com/sgtfrankieboy)
* [:link:](google.picker/google.picker.d.ts) [Google Picker API](https://developers.google.com/picker) by [grapswiz](https://github.com/grapswiz)
* [:link:](recaptcha/recaptcha.d.ts) [Google Recaptcha](https://www.google.com/recaptcha) by [Brent Jenkins](https://github.com/brentj73)
* [:link:](gapi.translate/gapi.translate.d.ts) [Google Translate API](https://developers.google.com/translate) by [Frank M](https://github.com/sgtfrankieboy)
* [:link:](gapi.urlshortener/gapi.urlshortener.d.ts) [Google Url Shortener API](https://developers.google.com/url-shortener) by [Frank M](https://github.com/sgtfrankieboy)
@@ -246,16 +257,25 @@ 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/Core.d.ts) [GSAP](http://greensock.com) by [VILIC VANE](https://vilic.github.io)
* [:link:](gsap/TweenLite.d.ts) [GSAP](http://greensock.com) by [VILIC VANE](https://vilic.github.io)
* [:link:](gulp/gulp.d.ts) [Gulp v3.8.x](http://gulpjs.com) by [Drew Noakes](https://drewnoakes.com)
* [:link:](gulp-autoprefixer/gulp-autoprefixer.d.ts) [gulp-autoprefixer](https://github.com/sindresorhus/gulp-autoprefixer) by [Asana](https://asana.com)
* [:link:](gulp-concat/gulp-concat.d.ts) [gulp-concat](http://github.com/wearefractal/gulp-concat) by [Keita Kagurazaka](https://github.com/k-kagurazaka)
* [:link:](gulp-flatten/gulp-flatten.d.ts) [gulp-flatten](https://github.com/armed/gulp-flatten) by [Keita Kagurazaka](https://github.com/k-kagurazaka)
* [:link:](gulp-gh-pages/gulp-gh-pages.d.ts) [gulp-gh-pages](https://github.com/rowoot/gulp-gh-pages) by [Asana](https://asana.com)
* [:link:](gulp-if/gulp-if.d.ts) [gulp-if](https://github.com/robrich/gulp-if) by [Asana](https://asana.com)
* [:link:](gulp-inject/gulp-inject.d.ts) [gulp-inject](https://github.com/klei/gulp-inject) by [Keita Kagurazaka](https://github.com/k-kagurazaka)
* [:link:](gulp-istanbul/gulp-istanbul.d.ts) [gulp-istanbul](https://github.com/SBoudrias/gulp-istanbul) by [Asana](https://asana.com)
* [:link:](gulp-less/gulp-less.d.ts) [gulp-less](https://github.com/plus3network/gulp-less) by [Keita Kagurazaka](https://github.com/k-kagurazaka)
* [: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-mocha/gulp-mocha.d.ts) [gulp-mocha](https://github.com/sindresorhus/gulp-mocha) by [Asana](https://asana.com)
* [: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-sass/gulp-sass.d.ts) [gulp-sass](https://github.com/dlmanning/gulp-sass) by [Asana](https://asana.com)
* [:link:](gulp-sourcemaps/gulp-sourcemaps.d.ts) [gulp-sourcemaps](https://github.com/floridoo/gulp-sourcemaps) by [Asana](https://asana.com)
* [:link:](gulp-tsd/gulp-tsd.d.ts) [gulp-tsd](https://github.com/moznion/gulp-tsd) by [Keita Kagurazaka](https://github.com/k-kagurazaka)
* [:link:](gulp-tslint/gulp-tslint.d.ts) [gulp-tslint](https://github.com/panuhorsmalahti/gulp-tslint) by [Asana](https://asana.com)
* [:link:](gulp-typedoc/gulp-typedoc.d.ts) [gulp-typedoc](https://github.com/rogierschouten/gulp-typedoc) by [Asana](https://asana.com)
* [:link:](gulp-typescript/gulp-typescript.d.ts) [gulp-typescript](https://github.com/ivogabe/gulp-typescript) by [Asana](https://asana.com)
@@ -289,6 +309,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)
* [:link:](intercomjs/intercom.d.ts) [intercom.js](https://github.com/diy/intercom.js) by [spencerwi](http://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:](is_js/is_js.d.ts) [is.js](http://arasatasaygin.github.io/is.js) by [Rodrigo Cabral](https://github.com/cabralRodrigo)
* [:link:](iscroll/iscroll.d.ts) [iScroll](http://cubiq.org/iscroll-4) by [Boris Yankov](https://github.com/borisyankov), [Christiaan Rakowski](https://github.com/csrakowski)
* [:link:](iscroll/iscroll-5.d.ts) [iScroll 5](http://cubiq.org/iscroll-5-ready-for-beta-test) by [Christiaan Rakowski](https://github.com/csrakowski)
* [:link:](iscroll/iscroll-lite.d.ts) [iScroll Lite](http://cubiq.org/iscroll-4) by [Boris Yankov](https://github.com/borisyankov), [Christiaan Rakowski](https://github.com/csrakowski)
@@ -302,12 +323,14 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](jasmine-jquery/jasmine-jquery.d.ts) [Jasmine-JQuery](https://github.com/velesin/jasmine-jquery) by [Gregor Stamac](https://github.com/gstamac)
* [:link:](jasmine-matchers/jasmine-matchers.d.ts) [jasmine-matchers](https://github.com/uxebu/jasmine-matchers) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](java-applet/java-applet.d.ts) [Java Applet](https://www.java.com) by [Cyril Schumacher](https://github.com/cyrilschumacher)
* [:link:](hooker/hooker.d.ts) [JavaScript Hooker](https://github.com/cowboy/javascript-hooker) by [Michael Zabka](https://github.com/misak113)
* [:link:](jbinary/jbinary.d.ts) [jBinary](https://github.com/jDataView/jBinary) by [Tim Bureck](https://github.com/tbureck)
* [:link:](jdataview/jdataview.d.ts) [jDataView](https://github.com/jDataView/jDataView) by [Ingvar Stepanyan](https://github.com/RReverser)
* [:link:](jest/jest.d.ts) [Jest](http://facebook.github.io/jest) by [Asana](https://asana.com)
* [:link:](jjv/jjv.d.ts) [JJV](https://github.com/acornejo/jjv) by [Wim Looman](https://github.com/Nemo157)
* [:link:](jjve/jjve.d.ts) [JJVE](https://github.com/silas/jjve) by [Wim Looman](https://github.com/Nemo157)
* [:link:](joi/joi.d.ts) [joi](https://github.com/spumko/joi) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](jointjs/jointjs.d.ts) [Joint JS](http://www.jointjs.com) by [Aidan Reel](http://github.com/areel), [David Durman](http://github.com/DavidDurman)
* [:link:](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)
* [:link:](jquery.blockUI/jquery.blockUI.d.ts) [jQuery BlockUI Plugin](http://malsup.com/jquery/block) by [Jeffrey Lee](http://blog.darkthread.net)
@@ -319,6 +342,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](jquery.dataTables/jquery.dataTables.d.ts) [JQuery DataTables](http://www.datatables.net) by [Armin Sander](https://github.com/pragmatrix)
* [:link:](jquery.fileupload/jquery.fileupload.d.ts) [jQuery File Upload Plugin](https://github.com/blueimp/jQuery-File-Upload) by [Rob Alarcon](https://github.com/rob-alarcon)
* [:link:](jquery.joyride/jquery.joyride.d.ts) [jQuery JoyRide Plugin](https://github.com/zurb/joyride) by [Vincent Bortone](https://github.com/vbortone)
* [:link:](jqgrid/jqgrid.d.ts) [jQuery jqgrid Plugin](https://github.com/tonytomov/jqGrid) by [Lokesh Peta](https://github.com/lokeshpeta)
* [:link:](jquerymobile/jquerymobile.d.ts) [jQuery Mobile](http://jquerymobile.com) by [Boris Yankov](https://github.com/borisyankov)
* [:link:](jquery.notifyBar/jquery.notifyBar.d.ts) [jQuery Notify Bar](http://www.whoop.ee/posts/2013-04-05-the-resurrection-of-jquery-notify-bar) by [Shunsuke Ohtani](https://github.com/zaneli)
* [:link:](jquery.base64/jquery.base64.d.ts) [jQuery Plugin - base64 codec](https://github.com/yatt/jquery.base64) by [Shinya Mochizuki](https://github.com/enrapt-mochizuki)
@@ -378,6 +402,9 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](js-yaml/js-yaml.d.ts) [js-yaml](https://github.com/nodeca/js-yaml) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](jsbn/jsbn.d.ts) [jsbn](http://www-cs-students.stanford.edu/%7Etjw/jsbn) by [Eugene Chernyshov](https://github.com/Evgenus)
* [:link:](jscrollpane/jscrollpane.d.ts) [jScrollPane](http://jscrollpane.kelvinluck.com) by [Dániel Tar](https://github.com/qcz)
* [:link:](js-data/js-data.d.ts) [JSData](https://github.com/js-data/js-data) by [Stefan Steinhart](https://github.com/reppners)
* [:link:](js-data-http/js-data-http.d.ts) [JSData Http Adapter](https://github.com/js-data/js-data-http) by [Stefan Steinhart](https://github.com/reppners)
* [:link:](js-data-angular/js-data-angular.d.ts) [JSDataAngular](https://github.com/js-data/js-data-angular) by [Stefan Steinhart](https://github.com/reppners)
* [:link:](jsdeferred/jsdeferred.d.ts) [JSDeferred](https://github.com/cho45/jsdeferred) by [Daisuke Mino](https://github.com/minodisk)
* [:link:](jsdom/jsdom.d.ts) [jsdom](https://github.com/tmpvar/jsdom) by [Asana](https://asana.com)
* [:link:](jsesc/jsesc.d.ts) [jsesc](https://github.com/mathiasbynens/jsesc) by [Bart van der Schoor](https://github.com/Bartvds)
@@ -385,6 +412,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](jshamcrest/jshamcrest.d.ts) [JsHamcrest](https://github.com/danielfm/jshamcrest) by [David Harkness](https://github.com/dharkness)
* [:link:](hashset/hashset.d.ts) [jshashset](http://www.timdown.co.uk/jshashtable/jshashset.html) by [Sergey Gerasimov](https://github.com/gerich-home)
* [:link:](hashtable/hashtable.d.ts) [jshashtable](http://www.timdown.co.uk/jshashtable) by [Sergey Gerasimov](https://github.com/gerich-home)
* [:link:](jsnox/jsnox.d.ts) [JSnoX](https://github.com/af/jsnox) by [Steve Baker](https://github.com/stkb)
* [:link:](json-pointer/json-pointer.d.ts) [json-pointer 1.0 l](https://www.npmjs.org/package/json-pointer) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](jsoneditoronline/jsoneditoronline.d.ts) [JSONEditorOnline](https://github.com/josdejong/jsoneditoronline) by [Vincent Bortone](https://github.com/vbortone)
* [:link:](JSONStream/JSONStream.d.ts) [JSONStream](http://github.com/dominictarr/JSONStream) by [Bart van der Schoor](https://github.com/Bartvds)
@@ -412,17 +440,20 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](knockout.postbox/knockout-postbox.d.ts) [knockout-postbox](https://github.com/rniemeyer/knockout-postbox) by [Judah Gabriel Himango](https://debuggerdotbreak.wordpress.com)
* [:link:](knockout.projections/knockout.projections.d.ts) [knockout-projections](https://github.com/stevesanderson/knockout-projections) by [John Reilly](https://github.com/johnnyreilly)
* [:link:](knockout-secure-binding/knockout-secure-binding.d.ts) [knockout-secure-binding](https://github.com/brianmhunt/knockout-secure-binding) by [Pine Mizune](https://github.com/pine613)
* [:link:](knockout-transformations/knockout-transformations.d.ts) [knockout-transformations](https://github.com/One-com/knockout-transformations) by [John Reilly](https://github.com/johnnyreilly), [Wim Looman](https://github.com/Nemo157)
* [:link:](knockout.mapper/knockout.mapper.d.ts) [Knockout.Mapper](https://github.com/LucasLorentz/knockout.mapper) by [Brandon Meyer](https://github.com/BMeyerKC)
* [:link:](knockout.mapping/knockout.mapping.d.ts) [Knockout.Mapping](https://github.com/SteveSanderson/knockout.mapping) by [Boris Yankov](https://github.com/borisyankov)
* [:link:](knockout.rx/knockout.rx.d.ts) [knockout.rx](https://github.com/Igorbek/knockout.rx) by [Igor Oleinikov](https://github.com/Igorbek)
* [:link:](knockstrap/knockstrap.d.ts) [Knockstrap](http://faulknercs.github.io/Knockstrap) by [Adam Pluciński](https://github.com/adaskothebeast)
* [:link:](knockout.kogrid/ko-grid.d.ts) [ko-grid](http://knockout-contrib.github.io/KoGrid) by [huer12](https://github.com/huer12)
* [:link:](ko.plus/ko.plus.d.ts) [ko.plus](https://github.com/stevegreatrex/ko.plus) by [Howard Richards](https://github.com/conficient)
* [:link:](kolite/kolite.d.ts) [KoLite](https://github.com/CodeSeven/kolite) by [Boris Yankov](https://github.com/borisyankov)
* [:link:](kuromoji/kuromoji.d.ts) [kuromoji.js](https://github.com/takuyaa/kuromoji.js) by [MIZUSHIMA Junki](https://github.com/mzsm)
* [:link:](ladda/ladda.d.ts) [Ladda](https://github.com/hakimel/Ladda) by [Danil Flores](https://github.com/dflor003), [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:](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)
* [:link:](leapmotionTS/LeapMotionTS.d.ts) [Leap Motion TS](https://github.com/logotype/LeapMotionTS) by [Victor Norgren](https://github.com/logotype)
* [:link:](less/less.d.ts) [LESS](http://lesscss.org) by [AndrewGaspar](https://github.com/AndrewGaspar)
@@ -437,18 +468,23 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](log4javascript/log4javascript.d.ts) [log4javascript](http://log4javascript.org) by [Markus Wagner](https://github.com/Ritzlgrmft)
* [:link:](log4js/log4js.d.ts) [log4js](https://github.com/nomiddlename/log4js-node) by [Kentaro Okuno](http://github.com/armorik83)
* [:link:](logg/logg.d.ts) [logg](https://github.com/dpup/node-logg) by [Bret Little](https://github.com/blittle)
* [:link:](logrotate-stream/logrotate-stream.d.ts) [logrotate-stream](https://github.com/dstokes/logrotate-stream) by [Rogier Schouten](https://github.com/rogierschouten)
* [:link:](long/long.d.ts) [Long.js](https://github.com/dcodeIO/Long.js) by [Toshihide Hara](https://github.com/kerug)
* [:link:](lru-cache/lru-cache.d.ts) [lru-cache](https://github.com/isaacs/node-lru-cache) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](lscache/lscache.d.ts) [lscache](https://github.com/pamelafox/lscache) by [Chris Martinez](https://github.com/Chris-Martinezz)
* [:link:](lunr/lunr.d.ts) [lunr.js](https://github.com/olivernn/lunr.js) by [Sebastian Lenz](https://github.com/sebastian-lenz)
* [:link:](lz-string/lz-string.d.ts) [lz-string](https://github.com/pieroxy/lz-string) by [Roman Nikitin](https://github.com/M0ns1gn0r)
* [: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:](mapbox/mapbox.d.ts) [Mapbox](https://www.mapbox.com/mapbox.js) by [Maxime Fabre](https://github.com/anahkiasen)
* [:link:](mapsjs/mapsjs.d.ts) [Mapsjs](https://github.com/mapsjs) by [Matthew James Davis](https://github.com/davismj)
* [:link:](marionette/marionette.d.ts) [Marionette](https://github.com/marionettejs) by [Zeeshan Hamid](https://github.com/zhamid), [Natan Vivo](https://github.com/nvivo), [Sven Tschui](https://github.com/sventschui)
* [:link:](marked/marked.d.ts) [Marked](https://github.com/chjj/marked) by [William Orr](https://github.com/worr)
* [:link:](maskedinput/maskedinput.d.ts) [Masked Input plugin for jQuery](http://digitalbush.com/projects/masked-input-plugin) by [Lokesh Peta](https://github.com/lokeshpeta)
* [:link:](mathjax/mathjax.d.ts) [MathJax](https://github.com/mathjax/MathJax) by [Roland Zwaga](https://github.com/rolandzwaga)
* [:link:](mCustomScrollbar/mCustomScrollbar.d.ts) [mCustomScrollbar](https://github.com/malihu/malihu-custom-scrollbar-plugin) by [Sarah Williams](https://github.com/flurg)
* [:link:](memory-cache/memory-cache.d.ts) [memory-cache](http://github.com/ptarjan/node-cache) by [Jeff Goddard](https://github.com/jedigo)
* [:link:](merge-stream/merge-stream.d.ts) [merge-stream](https://github.com/grncdr/merge-stream) by [Keita Kagurazaka](https://github.com/k-kagurazaka)
* [:link:](mess/mess.d.ts) [mess](https://github.com/bobrik/node-mess) by [Wim Looman](https://github.com/Nemo157)
* [:link:](messenger/messenger.d.ts) [Messenger.js](https://github.com/HubSpot/messenger) by [Derek Cicerone](https://github.com/derekcicerone)
* [:link:](meteor/meteor.d.ts) [Meteor](http://www.meteor.com) by [Dave Allen](https://github.com/fullflavedave)
* [:link:](method-override/method-override.d.ts) [method-override](https://github.com/expressjs/method-override) by [Santi Albo](https://github.com/santialbo)
@@ -499,6 +535,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](needle/needle.d.ts) [needle](https://github.com/tomas/needle) by [San Chen](https://github.com/bigsan)
* [:link:](nexpect/nexpect.d.ts) [nexpect](https://github.com/nodejitsu/nexpect) by [vvakame](http://github.com/vvakame)
* [:link:](ng-grid/ng-grid.d.ts) [ng-grid](http://angular-ui.github.io/ng-grid) by [Ken Smith](https://github.com/smithkl42), [Roland Zwaga](https://github.com/rolandzwaga), [Kent Cooper](https://github.com/kentcooper)
* [:link:](angular-idle/angular-idle.d.ts) [ng-idle](http://hackedbychinese.github.io/ng-idle) by [mthamil](https://github.com/mthamil)
* [: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)
@@ -516,6 +553,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [: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-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-uuid/node-uuid.d.ts) [node-uuid.js](https://github.com/broofa/node-uuid) by [Jeff May](https://github.com/jeffmay)
@@ -530,8 +568,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](nodeunit/nodeunit.d.ts) [nodeunit](https://github.com/caolan/nodeunit) by [Jeff Goddard](https://github.com/jedigo)
* [:link:](nomnom/nomnom.d.ts) [nomnom](https://github.com/harthur/nomnom) by [Paul Vick](https://github.com/panopticoncentral)
* [:link:](nopt/nopt.d.ts) [nopt](https://github.com/npm/nopt) by [jbondc](https://github.com/jbondc)
* [:link:](notifyjs/notifyjs.d.ts) [notify.js](https://github.com/alexgibson/notify.js) by [soundTricker](https://github.com/soundTricker)
* [:link:](notify/notify.d.ts) [Notify.js](https://github.com/jpillora/notifyjs) by [Xiaohan Zhang](https://github.com/hellochar)
* [:link:](notifyjs/notifyjs.d.ts) [notify.js](https://github.com/alexgibson/notify.js) by [soundTricker](https://github.com/soundTricker)
* [:link:](noVNC/noVNC.d.ts) [noVNC](https://github.com/kanaka/noVNC) by [Ken Smith](https://github.com/smithkl42)
* [:link:](npm/npm.d.ts) [npm](https://github.com/npm/npm) by [Maxime LUCE](https://github.com/SomaticIT)
* [:link:](nprogress/nprogress.d.ts) [NProgress](https://github.com/rstacruz/nprogress) by [Judah Gabriel Himango](http://debuggerdotbreak.wordpress.com)
@@ -575,6 +613,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](power-assert-formatter/power-assert-formatter.d.ts) [power-assert-formatter](https://github.com/twada/power-assert-formatter) by [vvakame](https://github.com/vvakame)
* [:link:](precise/precise.d.ts) [precise](https://www.npmjs.org/package/precise) by [Peter Harris](https://github.com/codeanimal)
* [:link:](preloadjs/preloadjs.d.ts) [PreloadJS](http://www.createjs.com/#!/PreloadJS) by [Pedro Ferreira](https://bitbucket.org/drk4)
* [:link:](prelude-ls/prelude-ls.d.ts) [prelude.ls](http://www.preludels.com) by [Aya Morisawa](https://github.com/AyaMorisawa)
* [:link:](progressjs/progress.d.ts) [ProgressJs](http://usablica.github.io/progress.js) by [Shunsuke Ohtani](https://github.com/zaneli)
* [:link:](promise-pool/promise-pool.d.ts) [promise-pool](https://github.com/vilic/promise-pool) by [VILIC VANE](https://github.com/vilic)
* [:link:](promises-a-plus/promises-a-plus.d.ts) [promises-a-plus](http://promisesaplus.com) by [Igor Oleinikov](https://github.com/Igorbek)
@@ -590,6 +629,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](rabbit.js/rabbit.js.d.ts) [rabbit.js](https://github.com/squaremo/rabbit.js) by [Wonshik Kim](https://github.com/wokim)
* [:link:](ractive/ractive.d.ts) [Ractive 0.7.0 edge f22ab8ad0a640591b1c263f57e21d1565cb26bf5](http://ractivejs.org) by [Han Lin Yap](http://yap.nu)
* [:link:](raphael/raphael.d.ts) [Raphael](http://raphaeljs.com) by [CheCoxshall](https://github.com/CheCoxshall)
* [:link:](rappid/rappid.d.ts) [Rappid](http://jointjs.com/about-rappid) by [Ewout Van Gossum](https://github.com/DenEwout)
* [:link:](ravenjs/ravenjs.d.ts) [Raven.js](https://github.com/getsentry/raven-js) by [Santi Albo](https://github.com/santialbo)
* [:link:](react/react.d.ts) [React](http://facebook.github.io/react) 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)
@@ -610,6 +650,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](riotjs/riotjs.d.ts) [riot.js](https://github.com/moot/riotjs) by [vvakame](https://github.com/vvakame)
* [:link:](routie/routie.d.ts) [routie](https://github.com/jgallen23/routie) by [Adilson](https://github.com/Adilson)
* [: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)
* [:link:](rx/rx.aggregates.d.ts) [RxJS-Aggregates](http://rx.codeplex.com) by [Carl de Billy](http://carl.debilly.net), [Igor Oleinikov](https://github.com/Igorbek)
* [:link:](rx/rx.all.d.ts) [RxJS-All](http://rx.codeplex.com) by [Carl de Billy](http://carl.debilly.net), [Igor Oleinikov](https://github.com/Igorbek)
@@ -637,6 +678,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [: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:](sharedworker/SharedWorker.d.ts) [SharedWorker](http://www.w3.org/TR/workers) by [Toshiya Nakakura](https://github.com/nakakura)
* [:link:](shelljs/shelljs.d.ts) [ShellJS](http://shelljs.org) by [Niklas Mollenhauer](https://github.com/nikeee)
* [:link:](should-promised/should-promised.d.ts) [should-promised](https://github.com/shouldjs/promised) by [Yaroslav Admin](https://github.com/devoto13)
* [:link:](should/should.d.ts) [should.js](https://github.com/visionmedia/should.js) by [Alex Varju](https://github.com/varju), [Maxime LUCE](https://github.com/SomaticIT)
* [:link:](showdown/showdown.d.ts) [Showdown](https://github.com/coreyti/showdown) by [cbowdon](https://github.com/cbowdon)
* [:link:](siesta/siesta.d.ts) [Siesta](http://www.bryntum.com/products/siesta) by [bquarmby](https://github.com/bquarmby)
@@ -664,6 +706,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](space-pen/space-pen.d.ts) [SpacePen](https://github.com/atom/space-pen) by [vvakame](https://github.com/vvakame)
* [:link:](spectrum/spectrum.d.ts) [spectrum](https://github.com/bgrins/spectrum) by [Mordechai Zuber](https://github.com/M-Zuber)
* [:link:](spin/spin.d.ts) [Spin.js](http://fgnass.github.com/spin.js) by [Boris Yankov](https://github.com/borisyankov), [Theodore Brown](https://github.com/theodorejb)
* [:link:](split/split.d.ts) [split](https://github.com/dominictarr/split) by [Marcin Porębski](https://github.com/marcinporebski)
* [:link:](sprintf/sprintf.d.ts) [sprintff](https://github.com/maritz/node-sprintff) by [Carlos Ballesteros Velasco](https://github.com/soywiz)
* [:link:](sharepoint/SharePoint.d.ts) [sptypescript](http://sptypescript.codeplex.com) by [Stanislav Vyshchepan](http://gandjustas.blogspot.ru), [Andrey Markeev](http://markeev.com)
* [:link:](sqlite3/sqlite3.d.ts) [sqlite3](https://github.com/mapbox/node-sqlite3) by [Nick Malaguti](https://github.com/nmalaguti)
@@ -671,6 +714,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](stats/stats.d.ts) [Stats.js r12](http://github.com/mrdoob/stats.js) by [Gregory Dalton](https://github.com/gregolai)
* [:link:](status-bar/status-bar.d.ts) [status-bar](https://github.com/atom/status-bar) by [vvakame](https://github.com/vvakame)
* [:link:](storejs/storejs.d.ts) [store.js](https://github.com/marcuswestin/store.js) by [Vincent Bortone](https://github.com/vbortone)
* [:link:](stream-series/stream-series.d.ts) [stream-series](https://github.com/rschmukler/stream-series) by [Keita Kagurazaka](https://github.com/k-kagurazaka)
* [:link:](stream-to-array/stream-to-array.d.ts) [stream-to-array](https://github.com/stream-utils/stream-to-array) by [Bart van der Schoor](https://github.com/Bartvds)
* [:link:](stripe/stripe.d.ts) [stripe](https://stripe.com) by [Eric J. Smith](https://github.com/ejsmith)
* [:link:](stylus/stylus.d.ts) [stylus](https://github.com/LearnBoost/stylus) by [Maxime LUCE](https://github.com/SomaticIT)
@@ -693,6 +737,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [: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:](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:](threejs/three-canvasrenderer.d.ts) [three.js (CanvasRenderer.js)](https://github.com/mrdoob/three.js/blob/master/examples/js/renderers/CanvasRenderer.js) by [Satoru Kimura](https://github.com/gyohk)
@@ -763,12 +808,14 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](websocket/websocket.d.ts) [websocket](https://github.com/Worlize/WebSocket-Node) by [Paul Loyd](https://github.com/loyd)
* [:link:](when/when.d.ts) [When](https://github.com/cujojs/when) by [Derek Cicerone](https://github.com/derekcicerone), [Wim Looman](https://github.com/Nemo157)
* [:link:](which/which.d.ts) [which](https://github.com/isaacs/node-which) by [vvakame](https://github.com/vvakame)
* [:link:](windows-service/windows-service.d.ts) [windows-service](https://bitbucket.org/stephenwvickers/node-windows-service) by [Rogier Schouten](https://github.com/rogierschouten)
* [:link:](winjs/winjs.d.ts) [WinJS](http://try.buildwinjs.com) by [TypeScript samples](https://www.typescriptlang.org), [Adam Hewitt](https://github.com/adamhewitt627), [Craig Treasure](https://github.com/craigktreasure), [Jeff Fisher](https://github.com/xirzec)
* [:link:](winrt/winrt.d.ts) [WinRT](http://msdn.microsoft.com/en-us/library/windows/apps/br211377.aspx) by [TypeScript samples](https://www.typescriptlang.org)
* [:link:](winston/winston.d.ts) [winston](https://github.com/flatiron/winston) by [bonnici](https://github.com/bonnici), [Peter Harris](https://github.com/codeanimal)
* [:link:](wolfy87-eventemitter/wolfy87-eventemitter.d.ts) [wolfy87-eventemitter](https://github.com/Wolfy87/EventEmitter) by [ryiwamoto](https://github.com/ryiwamoto)
* [:link:](wrench/wrench.d.ts) [wrench](https://github.com/ryanmcgrath/wrench-js) by [Carlos Ballesteros Velasco](https://github.com/soywiz)
* [:link:](ws/ws.d.ts) [ws](https://github.com/einaros/ws) by [Paul Loyd](https://github.com/loyd)
* [:link:](x-editable/x-editable.d.ts) [X-Editable](http://vitalets.github.io/x-editable/index.html) by [Chris Kirby](https://github.com/sirkirby)
* [:link:](x2js/xml2json.d.ts) [x2js](https://code.google.com/p/x2js) by [Horiuchi_H](https://github.com/horiuchi)
* [:link:](jsfl/xJSFL.d.ts) [xJSFL](http://www.xjsfl.com) by [soywiz](https://github.com/soywiz)
* [:link:](xpath/xpath.d.ts) [xpath](https://github.com/goto100/xpath) by [Andrew Bradley](https://github.com/cspotcode)
@@ -784,6 +831,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](zepto/zepto.d.ts) [Zepto](http://zeptojs.com) by [Josh Baldwin](https://github.com/jbaldwin)
* [:link:](zeroclipboard/zeroclipboard.d.ts) [ZeroClipboard](https://github.com/jonrohan/ZeroClipboard) by [Eric J. Smith](https://github.com/ejsmith), [Blake Niemyjski](https://github.com/niemyjski), [György Balássy](https://github.com/balassy)
* [: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:](scroller/scroller.d.ts) [Zynga Scroller](https://github.com/zynga/scroller) by [Boris Yankov](https://github.com/borisyankov)
* [:link:](viewporter/viewporter.d.ts) [Zynga Viewporter](https://github.com/zynga/viewporter) by [Boris Yankov](https://github.com/borisyankov)
+8
View File
@@ -6,10 +6,13 @@ var hotkeyProvider: ng.hotkeys.HotkeysProvider;
var hotkeyObj: ng.hotkeys.Hotkey;
hotkeyProvider.add("mod+s", "saves a file", (event: Event, hotkey: ng.hotkeys.Hotkey) => {} );
hotkeyProvider.add(["mod+s"], "saves a file", (event: Event, hotkey: ng.hotkeys.Hotkey) => {} );
hotkeyProvider.add(hotkeyObj);
hotkeyProvider.bindTo(scope);
hotkeyProvider.del("mod+s");
hotkeyProvider.del(["mod+s"]);
hotkeyProvider.get("mod+s");
hotkeyProvider.get(["mod+s"]);
hotkeyProvider.toggleCheatSheet();
hotkeyProvider.add(hotkeyObj.combo, hotkeyObj.description ,hotkeyObj.callback);
@@ -21,5 +24,10 @@ hotkeyProvider.bindTo(scope)
combo: 'w',
description: 'blah blah',
callback: function() {}
})
.add({
combo: ['w', 'mod+w'],
description: 'blah blah',
callback: function() {}
});
+17 -7
View File
@@ -1,6 +1,6 @@
// Type definitions for angular-hotkeys
// Project: https://github.com/chieffancypants/angular-hotkeys
// Definitions by: Jason Zhao <https://github.com/jlz27>
// Definitions by: Jason Zhao <https://github.com/jlz27>, Stefan Steinhart <https://github.com/reppners>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
@@ -9,32 +9,42 @@ declare module ng.hotkeys {
interface HotkeysProvider {
template: string;
templateTitle:string;
includeCheatSheet: boolean;
cheatSheetHotkey: string;
cheatSheetDescription: string;
add(combo: string, description: string, callback: (event: Event, hotkeys: ng.hotkeys.Hotkey) => void): void;
add(combo: string|string[], callback: (event: Event, hotkey?: Hotkey) => void, action?: string, allowIn?: Array<string>, persistent?: boolean): ng.hotkeys.Hotkey;
add(hotkeyObj: ng.hotkeys.Hotkey): void;
add(combo: string|string[], description: string, callback: (event: Event, hotkey?: Hotkey) => void, action?: string, allowIn?: Array<string>, persistent?: boolean): ng.hotkeys.Hotkey;
add(hotkeyObj: ng.hotkeys.Hotkey): ng.hotkeys.Hotkey;
bindTo(scope : ng.IScope): ng.hotkeys.HotkeysProviderChained;
del(combo: string): void;
del(combo: string|string[]): void;
get(combo: string): ng.hotkeys.Hotkey;
del(hotkeyObj: ng.hotkeys.Hotkey): void;
get(combo: string|string[]): ng.hotkeys.Hotkey;
toggleCheatSheet(): void;
purgeHotkeys(): void;
}
interface HotkeysProviderChained {
add(combo: string, description: string, callback: (event: Event, hotkeys: ng.hotkeys.Hotkey) => void): HotkeysProviderChained;
add(combo: string|string[], description: string, callback: (event: Event, hotkeys: ng.hotkeys.Hotkey) => void): HotkeysProviderChained;
add(hotkeyObj: ng.hotkeys.Hotkey): HotkeysProviderChained;
}
interface Hotkey {
combo: string;
combo: string|string[];
description?: string;
callback: (event: Event, hotkey: ng.hotkeys.Hotkey) => void;
action?: string;
allowIn?: Array<string>;
persistent?: boolean;
}
}
+23
View File
@@ -0,0 +1,23 @@
/// <reference path="./angular-idle.d.ts" />
angular.module('app', ['ngIdle'])
.config(['$keepaliveProvider', '$idleProvider',
($keepaliveProvider: ng.idle.IKeepAliveProvider, $idleProvider: ng.idle.IIdleProvider) => {
$idleProvider.activeOn('mousemove keydown DOMMouseScroll mousewheel mousedown');
$idleProvider.idleDuration(5);
$idleProvider.warningDuration(5);
$idleProvider.keepalive(true)
$idleProvider.autoResume(true);
$keepaliveProvider.interval(10);
}])
.run(['$keepalive', '$idle', ($keepalive: ng.idle.IKeepAliveService, $idle: ng.idle.IIdleService) => {
$idle.watch();
if ($idle.running() || $idle.idling()) {
$idle.unwatch();
}
$keepalive.start();
$keepalive.ping();
$keepalive.stop();
}]);
+134
View File
@@ -0,0 +1,134 @@
// Type definitions for ng-idle v0.3.5
// Project: http://hackedbychinese.github.io/ng-idle/
// Definitions by: mthamil <https://github.com/mthamil>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare module ng.idle {
/**
* Used to configure the $keepalive service.
*/
interface IKeepAliveProvider extends IServiceProvider {
/**
* If configured, options will be used to issue a request using $http.
* If the value is null, no HTTP request will be issued.
* You can specify a string, which it will assume to be a URL to a simple GET request.
* Otherwise, you can use the same options $http takes. However, cache will always be false.
*
* @param value May be string or object, default is null.
*/
http(value: any): void;
/**
* This specifies how often the keepalive event is triggered and the
* HTTP request is issued.
*
* @param seconds Integer, default is 5 minutes. Must be greater than 0.
*/
interval(seconds: number): void;
}
/**
* $keepalive will use a timeout to periodically wake, broadcast a $keepalive event on the root scope,
* and optionally make an $http request. By default, the $idle service will stop and start $keepalive
* when a user becomes idle or returns from idle, respectively. It is also started automatically when
* $idle.watch() is called. This can be disabled by configuring the $idleProvider.
*/
interface IKeepAliveService {
/**
* Starts pinging periodically until stop() is called.
*/
start(): void;
/**
* Stops pinging.
*/
stop(): void;
/**
* Performs one ping only.
*/
ping(): void;
}
/**
* Used to configure the $idle service.
*/
interface IIdleProvider extends IServiceProvider {
/**
* Specifies the DOM events the service will watch to reset the idle timeout.
* Multiple events should be separated by a space.
*
* @param events string, default 'mousemove keydown DOMMouseScroll mousewheel mousedown'
*/
activeOn(events: string): void;
/**
* The idle timeout duration in seconds. After this amount of time passes without the user
* performing an action that triggers one of the watched DOM events, the user is considered
* idle.
*
* @param seconds integer, default is 20min
*/
idleDuration(seconds: number): void;
/**
* The amount of time the user has to respond (in seconds) before they have been considered
* timed out.
*
* @param seconds integer, default is 30s
*/
warningDuration(seconds: number): void;
/**
* When true, user activity will automatically interrupt the warning countdown and reset the
* idle state. If false, you will need to manually call watch() when you want to start
* watching for idleness again.
*
* @param enabled boolean, default is true
*/
autoResume(enabled: boolean): void;
/**
* When true, the $keepalive service is automatically stopped and started as needed.
*
* @param enabled boolean, default is true
*/
keepalive(enabled: boolean): void;
}
/**
* $idle, once watch() is called, will start a timeout which if expires, will enter a warning state
* countdown. Once the countdown reaches zero, idle will broadcast a timeout event indicating the
* user has timed out (where your app should log them out or whatever you like). If the user performs
* an action that triggers a watched DOM event that bubbles up to document.body, this will reset the
* idle/warning state and start the process over again.
*/
interface IIdleService {
/**
* Whether or not the watch() has been called and it is watching for idleness.
*/
running(): boolean;
/**
* Whether or not the user appears to be idle.
*/
idling(): boolean;
/**
* Starts watching for idleness, or resets the idle/warning state and continues watching.
*/
watch(): void;
/**
* Stops watching for idleness, and resets the idle/warning state.
*/
unwatch(): void;
}
}
+12 -1
View File
@@ -1,6 +1,6 @@
// Type definitions for Angular JS 1.3 (ngAnimate module)
// Project: http://angularjs.org
// Definitions by: Michel Salib <https://github.com/michelsalib>, Adi Dahiya <https://github.com/adidahiya>
// Definitions by: Michel Salib <https://github.com/michelsalib>, Adi Dahiya <https://github.com/adidahiya>, Raphael Schweizer <https://github.com/rasch>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="angular.d.ts" />
@@ -25,6 +25,17 @@ declare module ng.animate {
*/
enabled(value?: boolean, element?: JQuery): boolean;
/**
* Performs an inline animation on the element.
*
* @param element the element that will be the focus of the animation
* @param from a collection of CSS styles that will be applied to the element at the start of the animation
* @param to a collection of CSS styles that the element will animate towards
* @param className an optional CSS class that will be added to the element for the duration of the animation (the default class is 'ng-inline-animate')
* @returns the animation callback promise
*/
animate(element: JQuery, from: any, to: any, className?: string): ng.IPromise<void>;
/**
* Appends the element to the parentElement element that resides in the document and then runs the enter animation.
*
+4 -4
View File
@@ -1024,7 +1024,7 @@ declare module ng {
// Not garanteed to have, since it's a non-mandatory option
//capacity: number;
};
put(key: string, value?: any): void;
put<T>(key: string, value?: T): T;
get(key: string): any;
remove(key: string): void;
removeAll(): void;
@@ -1262,7 +1262,7 @@ declare module ng {
statusText?: string;
}
interface IHttpPromise<T> extends IPromise<T> {
interface IHttpPromise<T> extends IPromise<IHttpPromiseCallbackArg<T>> {
success(callback: IHttpPromiseCallback<T>): IHttpPromise<T>;
error(callback: IHttpPromiseCallback<any>): IHttpPromise<T>;
then<TResult>(successCallback: (response: IHttpPromiseCallbackArg<T>) => IPromise<TResult>|TResult, errorCallback?: (response: IHttpPromiseCallbackArg<any>) => any): IPromise<TResult>;
@@ -1448,7 +1448,7 @@ declare module ng {
controller?: any;
controllerAs?: string;
bindToController?: boolean;
link?: IDirectiveLinkFn;
link?: IDirectiveLinkFn | IDirectivePrePost;
name?: string;
priority?: number;
replace?: boolean;
@@ -1501,7 +1501,7 @@ declare module ng {
// see http://docs.angularjs.org/api/ng.$animate
///////////////////////////////////////////////////////////////////////
interface IAnimateService {
addClass(element: JQuery, className: string, done?: Function): void;
addClass(element: JQuery, className: string, done?: Function): IPromise<any>;
enter(element: JQuery, parent: JQuery, after: JQuery, done?: Function): void;
leave(element: JQuery, done?: Function): void;
move(element: JQuery, parent: JQuery, after: JQuery, done?: Function): void;
+32
View File
@@ -0,0 +1,32 @@
/// <reference path="./archy.d.ts" />
import archy = require("archy");
var opts: archy.Options = {
};
var data: archy.Data = {
label: 'beep',
nodes: [
'ity',
{
label: 'boop',
nodes: [
{
label: 'o_O',
nodes: [
{
label: 'oh',
nodes: ['hello', 'puny']
},
'human'
]
},
'party\ntime!'
]
}
]
};
var str = archy(data);
console.log(str);
+21
View File
@@ -0,0 +1,21 @@
// Type definitions for archy
// Project: https://github.com/substack/node-archy
// Definitions by: vvakame <https://github.com/vvakame/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "archy" {
function archy(obj: archy.Data, prefix?: string, opts?: archy.Options): string;
function archy(obj: string, prefix?: string, opts?: archy.Options): string;
module archy {
interface Data {
label: string;
nodes?: (Data | string)[];
}
interface Options {
unicode?: boolean;
}
}
export = archy;
}
+44
View File
@@ -0,0 +1,44 @@
/// <reference path="async.d.ts" />
interface StringCallback { (err: Error, result: string): void; }
interface AsyncStringGetter { (callback: StringCallback): void; }
var taskArray: AsyncStringGetter[] = [
function (callback) {
setTimeout(function () {
callback(null, 'one');
}, 200);
},
function (callback) {
setTimeout(function () {
callback(null, 'two');
}, 100);
},
];
async.series(taskArray, function (err, results) { console.log(results[0].match(/o/)) });
async.parallel(taskArray, function (err, results) { console.log(results[0].match(/o/)) });
async.parallelLimit(taskArray, 3, function (err, results) { console.log(results[0].match(/o/)) });
interface Lookup<T> { [key: string]: T; }
interface NumberCallback { (err: Error, result: number): void; }
interface AsyncNumberGetter { (callback: NumberCallback): void; }
var taskDict: Lookup<AsyncNumberGetter> = {
one: function(callback){
setTimeout(function(){
callback(null, 1);
}, 200);
},
two: function(callback){
setTimeout(function(){
callback(null, 2);
}, 100);
}
}
async.series(taskDict, function(err, results) { console.log(results['one'].toFixed(1)) });
async.parallel(taskDict, function(err, results) { console.log(results['one'].toFixed(1)) });
async.parallelLimit(taskDict, 3, function(err, results) { console.log(results['one'].toFixed(1)) });
+1
View File
@@ -0,0 +1 @@
--noImplicitAny
+64 -10
View File
@@ -67,6 +67,17 @@ async.series([
],
function (err, results) { });
async.series<string>([
function (callback) {
callback(null, 'one');
},
function (callback) {
callback(null, 'two');
},
],
function (err, results) { });
async.series({
one: function (callback) {
setTimeout(function () {
@@ -81,6 +92,21 @@ async.series({
},
function (err, results) { });
async.series<number>({
one: function (callback) {
setTimeout(function () {
callback(null, 1);
}, 200);
},
two: function (callback) {
setTimeout(function () {
callback(null, 2);
}, 100);
},
},
function (err, results) { });
async.parallel([
function (callback) {
setTimeout(function () {
@@ -95,6 +121,20 @@ async.parallel([
],
function (err, results) { });
async.parallel<string>([
function (callback) {
setTimeout(function () {
callback(null, 'one');
}, 200);
},
function (callback) {
setTimeout(function () {
callback(null, 'two');
}, 100);
},
],
function (err, results) { });
async.parallel({
one: function (callback) {
@@ -110,6 +150,20 @@ async.parallel({
},
function (err, results) { });
async.parallel<number>({
one: function (callback) {
setTimeout(function () {
callback(null, 1);
}, 200);
},
two: function (callback) {
setTimeout(function () {
callback(null, 2);
}, 100);
},
},
function (err, results) { });
var count = 0;
@@ -136,7 +190,7 @@ async.waterfall([
], function (err, result) { });
var q = async.queue(function (task: any, callback) {
var q = async.queue<any>(function (task: any, callback) {
console.log('hello ' + task.name);
callback();
}, 2);
@@ -189,29 +243,29 @@ q.resume();
q.kill();
// tests for strongly typed tasks
var q2 = async.queue(function (task: string, callback) {
var q2 = async.queue<string>(function (task: string, callback) {
console.log('Task: ' + task);
callback();
}, 1);
q2.push('task1');
q2.push('task2', function (error, results: string[]) {
console.log('Finished tasks: ' + results.join(', '));
q2.push('task2', function (error) {
console.log('Finished tasks');
});
q2.push(['task3', 'task4', 'task5'], function (error, results: string[]) {
console.log('Finished tasks: ' + results.join(', '));
q2.push(['task3', 'task4', 'task5'], function (error) {
console.log('Finished tasks');
});
q2.unshift('task1');
q2.unshift('task2', function (error, results: string[]) {
console.log('Finished tasks: ' + results.join(', '));
q2.unshift('task2', function (error) {
console.log('Finished tasks');
});
q2.unshift(['task3', 'task4', 'task5'], function (error, results: string[]) {
console.log('Finished tasks: ' + results.join(', '));
q2.unshift(['task3', 'task4', 'task5'], function (error) {
console.log('Finished tasks');
});
var filename = '';
+39 -33
View File
@@ -3,26 +3,32 @@
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface Dictionary<T> { [key: string]: T; }
interface ErrorCallback { (err?: Error): void; }
interface AsyncResultsCallback<T> { (err: Error, results: T[]): void; }
interface AsyncResultCallback<T> { (err: Error, result: T): void; }
interface AsyncTimesCallback<T> { (n: number, callback: AsyncResultsCallback<T>): void; }
interface AsyncResultArrayCallback<T> { (err: Error, results: T[]): void; }
interface AsyncResultObjectCallback<T> { (err: Error, results: Dictionary<T>): void; }
interface AsyncTimesCallback<T> { (n: number, callback: AsyncResultArrayCallback<T>): void; }
interface AsyncIterator<T> { (item: T, callback: ErrorCallback): void; }
interface AsyncResultIterator<T, R> { (item: T, callback: AsyncResultCallback<R>): void; }
interface AsyncMemoIterator<T, R> { (memo: R, item: T, callback: AsyncResultCallback<R>): void; }
interface AsyncWorker<T> { (task: T, callback: Function): void; }
interface AsyncWorker<T> { (task: T, callback: ErrorCallback): void; }
interface AsyncFunction<T> { (callback: AsyncResultCallback<T>): void; }
interface AsyncVoidFunction { (callback: ErrorCallback): void; }
interface AsyncQueue<T> {
length(): number;
concurrency: number;
started: boolean;
paused: boolean;
push(task: T, callback?: AsyncResultsCallback<T>): void;
push(task: T[], callback?: AsyncResultsCallback<T>): void;
unshift(task: T, callback?: AsyncResultsCallback<T>): void;
unshift(task: T[], callback?: AsyncResultsCallback<T>): void;
push(task: T, callback?: ErrorCallback): void;
push(task: T[], callback?: ErrorCallback): void;
unshift(task: T, callback?: ErrorCallback): void;
unshift(task: T[], callback?: ErrorCallback): void;
saturated: () => any;
empty: () => any;
drain: () => any;
@@ -38,8 +44,8 @@ interface AsyncPriorityQueue<T> {
concurrency: number;
started: boolean;
paused: boolean;
push(task: T, priority: number, callback?: AsyncResultsCallback<T>): void;
push(task: T[], priority: number, callback?: AsyncResultsCallback<T>): void;
push(task: T, priority: number, callback?: AsyncResultArrayCallback<T>): void;
push(task: T[], priority: number, callback?: AsyncResultArrayCallback<T>): void;
saturated: () => any;
empty: () => any;
drain: () => any;
@@ -56,9 +62,9 @@ interface Async {
each<T>(arr: T[], iterator: AsyncIterator<T>, callback: ErrorCallback): void;
eachSeries<T>(arr: T[], iterator: AsyncIterator<T>, callback: ErrorCallback): void;
eachLimit<T>(arr: T[], limit: number, iterator: AsyncIterator<T>, callback: ErrorCallback): void;
map<T, R>(arr: T[], iterator: AsyncResultIterator<T, R>, callback: AsyncResultsCallback<R>): any;
mapSeries<T, R>(arr: T[], iterator: AsyncResultIterator<T, R>, callback: AsyncResultsCallback<R>): any;
mapLimit<T, R>(arr: T[], limit: number, iterator: AsyncResultIterator<T, R>, callback: AsyncResultsCallback<R>): any;
map<T, R>(arr: T[], iterator: AsyncResultIterator<T, R>, callback: AsyncResultArrayCallback<R>): any;
mapSeries<T, R>(arr: T[], iterator: AsyncResultIterator<T, R>, callback: AsyncResultArrayCallback<R>): any;
mapLimit<T, R>(arr: T[], limit: number, iterator: AsyncResultIterator<T, R>, callback: AsyncResultArrayCallback<R>): any;
filter<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback: (results: T[]) => any): any;
select<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback: (results: T[]) => any): any;
filterSeries<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback: (results: T[]) => any): any;
@@ -70,34 +76,34 @@ interface Async {
foldl<T, R>(arr: T[], memo: R, iterator: AsyncMemoIterator<T, R>, callback: AsyncResultCallback<R>): any;
reduceRight<T, R>(arr: T[], memo: R, iterator: AsyncMemoIterator<T, R>, callback: AsyncResultCallback<R>): any;
foldr<T, R>(arr: T[], memo: R, iterator: AsyncMemoIterator<T, R>, callback: AsyncResultCallback<R>): any;
detect<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback: AsyncResultsCallback<T>): any;
detectSeries<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback: AsyncResultsCallback<T>): any;
sortBy<T, V>(arr: T[], iterator: AsyncResultIterator<T, V>, callback: AsyncResultsCallback<T>): any;
some<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback: AsyncResultsCallback<T>): any;
any<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback: AsyncResultsCallback<T>): any;
detect<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback: AsyncResultArrayCallback<T>): any;
detectSeries<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback: AsyncResultArrayCallback<T>): any;
sortBy<T, V>(arr: T[], iterator: AsyncResultIterator<T, V>, callback: AsyncResultArrayCallback<T>): any;
some<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback: AsyncResultArrayCallback<T>): any;
any<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback: AsyncResultArrayCallback<T>): any;
every<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback: (result: boolean) => any): any;
all<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback: (result: boolean) => any): any;
concat<T, R>(arr: T[], iterator: AsyncResultIterator<T, R[]>, callback: AsyncResultsCallback<R>): any;
concatSeries<T, R>(arr: T[], iterator: AsyncResultIterator<T, R[]>, callback: AsyncResultsCallback<R>): any;
concat<T, R>(arr: T[], iterator: AsyncResultIterator<T, R[]>, callback: AsyncResultArrayCallback<R>): any;
concatSeries<T, R>(arr: T[], iterator: AsyncResultIterator<T, R[]>, callback: AsyncResultArrayCallback<R>): any;
// Control Flow
series<T>(tasks: T[], callback?: AsyncResultsCallback<T>): void;
series<T>(tasks: T, callback?: AsyncResultsCallback<T>): void;
parallel<T>(tasks: T[], callback?: AsyncResultsCallback<T>): void;
parallel<T>(tasks: T, callback?: AsyncResultsCallback<T>): void;
parallelLimit<T>(tasks: T[], limit: number, callback?: AsyncResultsCallback<T>): void;
parallelLimit<T>(tasks: T, limit: number, callback?: AsyncResultsCallback<T>): void;
whilst(test: Function, fn: Function, callback: Function): void;
until(test: Function, fn: Function, callback: Function): void;
waterfall<T>(tasks: T[], callback?: AsyncResultsCallback<T>): void;
waterfall<T>(tasks: T, callback?: AsyncResultsCallback<T>): void;
series<T>(tasks: Array<AsyncFunction<T>>, callback?: AsyncResultArrayCallback<T>): void;
series<T>(tasks: Dictionary<AsyncFunction<T>>, callback?: AsyncResultObjectCallback<T>): void;
parallel<T>(tasks: Array<AsyncFunction<T>>, callback?: AsyncResultArrayCallback<T>): void;
parallel<T>(tasks: Dictionary<AsyncFunction<T>>, callback?: AsyncResultObjectCallback<T>): void;
parallelLimit<T>(tasks: Array<AsyncFunction<T>>, limit: number, callback?: AsyncResultArrayCallback<T>): void;
parallelLimit<T>(tasks: Dictionary<AsyncFunction<T>>, limit: number, callback?: AsyncResultObjectCallback<T>): void;
whilst(test: () => boolean, fn: AsyncVoidFunction, callback: (err: any) => void): void;
doWhilst(fn: AsyncVoidFunction, test: () => boolean, callback: (err: any) => void): void;
until(test: () => boolean, fn: AsyncVoidFunction, callback: (err: any) => void): void;
doUntil(fn: AsyncVoidFunction, test: () => boolean, callback: (err: any) => void): void;
waterfall(tasks: Function[], callback?: AsyncResultArrayCallback<any>): void;
queue<T>(worker: AsyncWorker<T>, concurrency: number): AsyncQueue<T>;
priorityQueue<T>(worker: AsyncWorker<T>, concurrency: number): AsyncPriorityQueue<T>;
// auto(tasks: any[], callback?: AsyncResultsCallback<T>): void;
auto(tasks: any, callback?: AsyncResultsCallback<any>): void;
auto(tasks: any, callback?: AsyncResultArrayCallback<any>): void;
iterator(tasks: Function[]): Function;
apply(fn: Function, ...arguments: any[]): void;
nextTick<T>(callback: Function): void;
apply(fn: Function, ...arguments: any[]): AsyncFunction<any>;
nextTick(callback: Function): void;
times<T> (n: number, callback: AsyncTimesCallback<T>): void;
timesSeries<T> (n: number, callback: AsyncTimesCallback<T>): void;
+11 -11
View File
@@ -390,11 +390,10 @@ declare module Microsoft.Maps {
}
export interface PolylineOptions {
strokeColor: Color;
strokeDashArray: string;
strokeThickness: number;
visible: boolean;
strokeColor?: Color;
strokeDashArray?: string;
strokeThickness?: number;
visible?: boolean;
}
export class Polygon implements Entity {
@@ -422,11 +421,12 @@ declare module Microsoft.Maps {
}
export interface PolygonOptions {
strokeColor: Color;
strokeDashArray: string;
strokeThickness: number;
visible: boolean;
fillColor?: Color;
infoBox?: Infobox;
strokeColor?: Color;
strokeDashArray?: string;
strokeThickness?: number;
visible?: boolean;
}
export class Pushpin implements Entity {
@@ -570,4 +570,4 @@ declare module Microsoft.Maps {
export function loadModule(moduleKey: string, options: ModuleOptions): void;
export function moduleLoaded(moduleKey: string): void;
export function registerModule(moduleKey: string, scriptUrl: string, options?: ModuleOptions): void;
}
}
+11
View File
@@ -0,0 +1,11 @@
/// <reference path="bitwise-xor.d.ts" />
"use strict";
import xor = require("bitwise-xor");
var b: Buffer;
b = xor("a", "b");
b = xor(new Buffer("a"), new Buffer("b"));
+17
View File
@@ -0,0 +1,17 @@
// Type definitions for bitwise-xor 0.0.0
// Project: https://github.com/czzarr/node-bitwise-xor
// Definitions by: Rogier Schouten <https://github.com/rogierschouten>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare module "bitwise-xor" {
/**
* Bitwise XOR between two Buffers or Strings, returns a Buffer
*/
function xor(b1: Buffer, b2: Buffer): Buffer;
function xor(s1: string, s2: string): Buffer;
export = xor;
}
+5
View File
@@ -405,6 +405,11 @@ function test_entityQuery() {
.where("toUpper(substring(CompanyName, 1, 2))", breeze.FilterQueryOp.Equals, "OM");
var q2 = query.toType("foo").orderBy("foo2");
var pred = new breeze.Predicate('items', 'any', 'serialNumber', 'contains', '12345');
var pred = new breeze.Predicate('items', breeze.FilterQueryOp.Any, 'serialNumber', breeze.FilterQueryOp.Contains, '12345');
var pred = breeze.Predicate.create('items', 'any', 'serialNumber', 'contains', '12345');
var pred = breeze.Predicate.create('items', breeze.FilterQueryOp.Any, 'serialNumber', breeze.FilterQueryOp.Contains, '12345');
var json = query.toJSON();
}
+6 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for Breeze 1.4
// Type definitions for Breeze 1.5.x
// Project: http://www.breezejs.com/
// Definitions by: Boris Yankov <https://github.com/borisyankov/>, IdeaBlade <https://github.com/IdeaBlade/Breeze/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -10,6 +10,7 @@
// Updated Aug 22 2014 for Breeze 1.4.17 and removing Q dependency - Steve Schmitt ( www.ideablade.com)
// Updated Jan 16 2015 for Breeze 1.4.17 to add support for noimplicitany - Kevin Wilson ( www.kwilson.me.uk )
// Updated Jan 20 2015 for Breeze 1.5.2 and merging changes from DefinitelyTyped
// Updated Feb 28 2015 add any/all clause on Predicate
declare module breeze.core {
@@ -770,6 +771,8 @@ declare module breeze {
constructor(property: string, operator: FilterQueryOpSymbol, value: any);
constructor(property: string, operator: string, value: { value: any; isLiteral?: boolean; dataType?: breeze.DataType });
constructor(property: string, operator: FilterQueryOpSymbol, value: { value: any; isLiteral?: boolean; dataType?: breeze.DataType });
constructor(property: string, filterop: FilterQueryOpSymbol, property2: string, filterop2: FilterQueryOpSymbol, value: any); // for any/all clauses
constructor(property: string, filterop: string, property2: string, filterop2: string, value: any); // for any/all clauses
/** Create predicate from an expression tree */
constructor(tree: Object);
@@ -798,6 +801,8 @@ declare module breeze {
(...predicates: Predicate[]): Predicate;
(property: string, operator: string, value: any, valueIsLiteral?: boolean): Predicate;
(property: string, operator: FilterQueryOpSymbol, value: any, valueIsLiteral?: boolean): Predicate;
(property: string, filterop: FilterQueryOpSymbol, property2: string, filterop2: FilterQueryOpSymbol, value: any): Predicate; // for any/all clauses
(property: string, filterop: string, property2: string, filterop2: string, value: any): Predicate; // for any/all clauses
}
class QueryOptions {
@@ -0,0 +1,4 @@
/// <reference path="bunyan-prettystream.d.ts" />
import PrettyStream = require("bunyan-prettystream");
var stream = new PrettyStream();
+14
View File
@@ -0,0 +1,14 @@
// Type definitions for bunyan-prettystream
// Project: https://www.npmjs.com/package/bunyan-prettystream
// Definitions by: Jason Swearingen <https://github.com/jasonswearingen/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare module "bunyan-prettystream" {
import stream = require("stream");
class PrettyStream extends stream.Writable {
public pipe<T extends NodeJS.WritableStream>(destination: T, options?: { end?: boolean; }): T;
}
export = PrettyStream;
}
+2 -2
View File
@@ -9,7 +9,7 @@ declare module "byline" {
import stream = require("stream");
export interface LineStreamOptions extends stream.TransformOptions {
keepEmptyLines: boolean;
keepEmptyLines?: boolean;
}
export interface LineStream extends stream.Transform {
@@ -35,4 +35,4 @@ declare module "byline" {
export function createStream(stream:NodeJS.ReadableStream, options?:LineStreamOptions):LineStream;
export var LineStream:LineStreamCreatable;
}
}
+36
View File
@@ -0,0 +1,36 @@
/// <reference path="chance.d.ts" />
// Instantiation
var globalInstance: Chance.Chance = chance;
var createYourOwn = new Chance(Math.random);
// Basic usage
var randBool: boolean = chance.bool();
var birthday: Date = chance.birthday();
var birthdayStr: Date|string = chance.birthday({ string: true });
var strArr: string[] = chance.n(chance.string, 42);
var uniqInts: number[] = chance.unique(chance.integer, 99);
var currencyPair = chance.currency_pair();
var firstCurrency = currencyPair[0];
var secondCurrency = currencyPair[1];
// Mixins can be used with on-the-fly type declaration
declare module Chance {
interface Chance {
time(): string;
}
}
chance.mixin({
time: function () {
var h = chance.hour({ twentyfour: true }),
m = chance.minute();
return `${h}:${m}`;
}
});
var timeString: string = chance.time();
+213
View File
@@ -0,0 +1,213 @@
// Type definitions for Chance 0.7.3
// Project: http://chancejs.com
// Definitions by: Chris Bowdon <https://github.com/cbowdon/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module Chance {
interface ChanceStatic {
Chance(): Chance;
new(): Chance;
new(seed: number): Chance;
new(generator: () => any): Chance;
}
interface Chance {
// Basics
bool(opts?: Options): boolean;
character(opts?: Options): string;
floating(opts?: Options): number;
integer(opts?: Options): number;
natural(opts?: Options): number;
string(opts?: Options): string;
// Text
paragraph(opts?: Options): string;
sentence(opts?: Options): string;
syllable(opts?: Options): string;
word(opts?: Options): string;
// Person
age(opts?: Options): number;
birthday(): Date;
birthday(opts?: Options): Date|string;
cpf(): string;
first(opts?: Options): string;
last(opts?: Options): string;
name(opts?: Options): string;
name_prefix(opts?: Options): string;
name_suffix(opts?: Options): string;
prefix(opts?: Options): string;
ssn(opts?: Options): string;
suffix(opts?: Options): string;
// Mobile
android_id(): string;
apple_token(): string;
bb_pin(): string;
wp7_anid(): string;
wp8_anid2(): string;
// Web
color(opts?: Options): string;
domain(opts?: Options): string;
email(opts?: Options): string;
fbid(): string;
google_analytics(): string;
hashtag(): string;
ip(): string;
ipv6(): string;
klout(): string;
tld(): string;
twitter(): string;
url(opts?: Options): string;
// Location
address(opts?: Options): string;
altitude(opts?: Options): number;
areacode(): string;
city(): string;
coordinates(opts?: Options): string;
country(opts?: Options): string;
depth(opts?: Options): number;
geohash(opts?: Options): string;
latitude(opts?: Options): number;
longitude(opts?: Options): number;
phone(opts?: Options): string;
postal(): string;
province(opts?: Options): string;
state(opts?: Options): string;
street(opts?: Options): string;
zip(opts?: Options): string;
// Time
ampm(): string;
date(): Date;
date(opts: DateOptions): Date|string;
hammertime(): number;
hour(opts?: Options): number;
millisecond(): number;
minute(): number;
month(): string;
month(opts: Options): Month;
second(): number;
timestamp(): number;
year(opts?: Options): string;
// Finance
cc(opts?: Options): string;
cc_type(): string;
cc_type(opts: Options): string|CreditCardType;
currency(): Currency;
currency_pair(): [ Currency, Currency ];
dollar(opts?: Options): string;
exp(): string;
exp(opts: Options): string|CreditCardExpiration;
exp_month(opts?: Options): string;
exp_year(opts?: Options): string;
// Helpers
capitalize(str: string): string;
mixin(desc: MixinDescriptor): any;
pad(num: number, width: number, padChar?: string): string;
pick<T>(arr: T[]): T;
pick<T>(arr: T[], count: number): T[];
set: Setter;
shuffle<T>(arr: T[]): T[];
// Miscellaneous
d4(): number;
d6(): number;
d8(): number;
d10(): number;
d12(): number;
d20(): number;
d30(): number;
d100(): number;
guid(): string;
hash(opts?: Options): string;
n<T>(generator: () => T, count: number, opts?: Options): T[];
normal(opts?: Options): string;
radio(opts?: Options): string;
rpg(dice: string): number[];
rpg(dice: string, opts?: Options): number[]|number;
tv(opts?: Options): string;
unique<T>(generator: () => T, count: number, opts?: Options): T[];
weighted<T>(values: T[], weights: number[]): T;
// "Hidden"
cc_types(): CreditCardType[];
mersenne_twister(seed?: number): any; // API return type not defined in docs
months(): Month[];
name_prefixes(): Name[];
provinces(): Name[];
states(): Name[];
street_suffix(): Name;
street_suffixes(): Name[];
}
// A more rigorous approach might be to produce
// the correct options interfaces for each method
interface Options { [id: string]: any; }
interface DateOptions {
string?: boolean;
american?: boolean;
year?: number;
month?: number;
day?: number;
}
interface Month {
name: string;
short_name: string;
numeric: string;
}
interface CreditCardType {
name: string;
short_name: string;
prefix: string;
length: number;
}
interface Currency {
code: string;
name: string;
}
interface CreditCardExpiration {
month: string;
year: string;
}
interface MixinDescriptor { [id: string]: () => any; }
interface Setter {
(key: 'firstNames', values: string[]): any;
(key: 'lastNames', values: string[]): any;
(key: 'provinces', values: string[]): any;
(key: 'us_states_and_dc', values: string[]): any;
(key: 'territories', values: string[]): any;
(key: 'armed_forces', values: string[]): any;
(key: 'street_suffixes', values: string[]): any;
(key: 'months', values: string[]): any;
(key: 'cc_types', values: string[]): any;
(key: 'currency_types', values: string[]): any;
<T>(key: string, values: T[]): any;
}
interface Name {
name: string;
abbreviation: string;
}
}
// window.chance
declare var chance: Chance.Chance;
declare var Chance: Chance.ChanceStatic;
// import Chance = require('chance');
declare module 'chance' {
export = Chance;
}
+41
View File
@@ -0,0 +1,41 @@
/// <reference path="chokidar.d.ts" />
import fs = require('fs');
import chokidar = require('chokidar');
var watcher = chokidar.watch('file, dir, or glob', {
ignored: /[\/\\]\./, persistent: true
});
var log = console.log.bind(console);
watcher
.on('add', function(path:string) { log('File', path, 'has been added'); })
.on('addDir', function(path:string) { log('Directory', path, 'has been added'); })
.on('change', function(path:string) { log('File', path, 'has been changed'); })
.on('unlink', function(path:string) { log('File', path, 'has been removed'); })
.on('unlinkDir', function(path:string) { log('Directory', path, 'has been removed'); })
.on('error', function(error:any) { log('Error happened', error); })
.on('ready', function() { log('Initial scan complete. Ready for changes.'); })
.on('raw', function(event:Event, path:string, details:any) { log('Raw event info:', event, path, details); })
// 'add', 'addDir' and 'change' events also receive stat() results as second
// argument when available: http://nodejs.org/api/fs.html#fs_class_fs_stats
watcher.on('change', function(path:string, stats:fs.Stats) {
if (stats) console.log('File', path, 'changed size to', stats.size);
});
// Watch new files.
watcher.add('new-file');
watcher.add(['new-file-2', 'new-file-3', '**/other-file*']);
// Un-watch some files.
watcher.unwatch('new-file*');
// Only needed if watching is `persistent: true`.
watcher.close();
// One-liner
require('chokidar').watch('.', {ignored: /[\/\\]\./}).on('all', function(event:string, path:string) {
console.log(event, path);
});
+42
View File
@@ -0,0 +1,42 @@
// Type definitions for chokidar 1.0.0
// Project: https://github.com/paulmillr/chokidar
// Definitions by: Stefan Steinhart <https://github.com/reppners/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare module "fs"
{
interface FSWatcher
{
add(fileDirOrGlob:string):void;
add(filesDirsOrGlobs:Array<string>):void;
unwatch(fileDirOrGlob:string):void;
unwatch(filesDirsOrGlobs:Array<string>):void;
}
}
declare module "chokidar"
{
interface WatchOptions
{
persistent?:boolean;
ignored?:any;
ignoreInitial?:boolean;
followSymlinks?:boolean;
cwd?:string;
usePolling?:boolean;
useFsEvents?:boolean;
alwaysStat?:boolean;
depth?:number;
interval?:number;
binaryInterval?:number;
ignorePermissionErrors?:boolean;
atomic?:boolean;
}
import fs = require("fs");
function watch( fileDirOrGlob:string, options?:WatchOptions ):fs.FSWatcher;
function watch( filesDirsOrGlobs:Array<string>, options?:WatchOptions ):fs.FSWatcher;
}
File diff suppressed because it is too large Load Diff
+23 -8
View File
@@ -5,6 +5,13 @@
/// <reference path='../webrtc/MediaStream.d.ts'/>
////////////////////
// Global object
////////////////////
interface Window {
chrome: typeof chrome;
}
////////////////////
// Alarms
////////////////////
@@ -1524,8 +1531,11 @@ declare module chrome.runtime {
}
interface MessageSender {
id: string;
id?: string;
tab?: chrome.tabs.Tab;
frameId?: number;
url?: string;
tlsChannelId?: string;
}
interface PlatformInfo {
@@ -1535,10 +1545,11 @@ declare module chrome.runtime {
}
interface Port {
postMessage: Function;
postMessage: (message: Object) => void;
disconnect: () => void;
sender?: MessageSender;
onDisconnect: chrome.events.Event;
onMessage: chrome.events.Event;
onMessage: PortMessageEvent;
name: string;
}
@@ -1550,6 +1561,10 @@ declare module chrome.runtime {
version: string;
}
interface PortMessageEvent extends chrome.events.Event {
addListener(callback: (message: Object, port: Port) => void): void;
}
interface ExtensionMessageEvent extends chrome.events.Event {
addListener(callback: (message: any, sender: MessageSender, sendResponse: Function) => void): void;
}
@@ -2253,20 +2268,20 @@ declare module chrome.webRequest {
interface OnCompletedDetails extends CallbackDetails {
ip?: string;
statusLine?: string;
statusLine: string;
responseHeaders?: HttpHeader[];
fromCache: boolean;
statusCode: number;
}
interface OnHeadersReceivedDetails extends CallbackDetails {
statusLine?: string;
statusLine: string;
responseHeaders?: HttpHeader[];
}
interface OnBeforeRedirectDetails extends CallbackDetails {
ip?: string;
statusLine?: string;
statusLine: string;
responseHeaders?: HttpHeader[];
fromCache: boolean;
redirectUrl: string;
@@ -2279,7 +2294,7 @@ declare module chrome.webRequest {
}
interface OnAuthRequiredDetails extends CallbackDetails {
statusLine?: string;
statusLine: string;
challenger: Challenger;
responseHeaders?: HttpHeader[];
isProxy: boolean;
@@ -2299,7 +2314,7 @@ declare module chrome.webRequest {
interface OnResponseStartedDetails extends CallbackDetails {
ip?: string;
statusLine?: string;
statusLine: string;
responseHeaders?: HttpHeader[];
fromCache: boolean;
statusCode: number;
+3
View File
@@ -544,6 +544,9 @@ declare module CodeMirror {
insertLeft?: boolean;
}): CodeMirror.TextMarker;
/** Returns an array of all the bookmarks and marked ranges found between the given positions. */
findMarks(from: CodeMirror.Position, to: CodeMirror.Position): TextMarker[];
/** Returns an array of all the bookmarks and marked ranges present at the given position. */
findMarksAt(pos: CodeMirror.Position): TextMarker[];
Vendored
+8 -7
View File
@@ -702,8 +702,9 @@ declare module D3 {
* Parse a delimited string into objects using the header row.
*
* @param string delimited formatted string to parse
* @param accessor to modify properties of each row
*/
parse(string: string): any[];
parse(string: string, accessor?: (row: any, index?: number) => any): any[];
/**
* Parse a delimited string into tuples, ignoring the header row.
*
@@ -727,7 +728,7 @@ declare module D3 {
};
classed: {
(name: string): string;
(name: string): boolean;
(name: string, value: any): Selection;
(name: string, valueFunction: (data: any, index: number) => any): Selection;
(classValueMap: Object): Selection;
@@ -778,7 +779,7 @@ declare module D3 {
filter: {
(filter: (data: any, index: number) => boolean, thisArg?: any): UpdateSelection;
//(filter: string): UpdateSelection;
(filter: string): UpdateSelection;
};
call(callback: (selection: Selection, ...args: any[]) => void, ...args: any[]): Selection;
@@ -849,7 +850,7 @@ declare module D3 {
sortKeys(comparator: (d1: any, d2: any) => number): Nest;
sortValues(comparator: (d1: any, d2: any) => number): Nest;
rollup(rollupFunction: (data: any, index: number) => any): Nest;
map(values: any[]): any;
map(values: any[], mapType?: any): any;
entries(values: any[]): NestKeyValue[];
}
@@ -1672,8 +1673,8 @@ declare module D3 {
}
export interface Symbol {
type: (string:string) => Symbol;
size: (number:number) => Symbol;
type: (symbolType: string | ((datum: any, index: number) => string)) => Symbol;
size: (size: number | ((datum: any, index: number) => number)) => Symbol;
(datum:any, index:number): string;
}
@@ -1751,7 +1752,7 @@ declare module D3 {
export interface Axis {
(selection: Selection): void;
(transition: Transition.Transition): void;
scale: {
(): any;
(scale: any): Axis;
+199
View File
@@ -0,0 +1,199 @@
// Type definitions for DCJS
// Project: https://github.com/dc-js
// Definitions by: hans windhoff <https://github.com/hansrwindhoff>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// this makes only sense together with d3 and crossfilter so you need the d3.d.ts and crossfilter.d.ts files
///<reference path="../d3/d3.d.ts" />
///<reference path="../crossfilter/crossfilter.d.ts" />
declare module dc {
// helper for get/set situation
interface IGetSet<T, V> {
(): T;
(t:T): V;
}
export interface ILegendwidget {
x: IGetSet<number, number>;
y: IGetSet<number, number>;
gap: IGetSet<number, number>;
itemHeight: IGetSet<number, number>;
horizontal: IGetSet<boolean, boolean>;
legendWidth: IGetSet<number, number>;
itemWidth: IGetSet<number, number>;
}
export interface IBaseChart<T> {
width: IGetSet<number, T>;
height: IGetSet<number, T>;
minWidth: IGetSet<number, T>;
minHeight: IGetSet<number, T>;
dimension: IGetSet<any, T>;
group: IGetSet<any, T>; // not sure here
transitionDuration: IGetSet<number, T>;
colors: IGetSet<string[], T>;
keyAccessor: IGetSet<(d:any) => number, T>;
valueAccessor: IGetSet<(d:any) => number, T>;
label: IGetSet<(l:any) => string, T>;
renderLabel: IGetSet<boolean, T>;
renderlet: (fnctn: (t:T) => void) => T;
title: IGetSet<(t:string) => string, T>;
filter: IGetSet<any, T>;
filterAll: () => void;
expireCache: () => void;
legend: (l:ILegendwidget) => T;
chartID: () => number;
options: (o:Object)=>void ;
select: (selector: D3.Selection) => D3.Selection;
selectAll: (selector: D3.Selection) => D3.Selection;
}
export interface IEvents {
trigger(fnctn: () => void, delay?: number):void;
}
export var events: IEvents;
export interface IListener<T> {
on: (eventName: string, fnctn: (c:T) => void) => T;
}
export interface ImarginObj {
top: number;
right: number;
bottom: number;
left: number;
}
export interface IMarginable<T> {
margins: IGetSet<ImarginObj, T>;
}
// abstract interfaces
export interface IAbstractColorChart<T> {
colorDomain: IGetSet<number[], T>;
}
export interface IAbstractStackableChart<T> {
stack: (group: IChartGroup, name?:string, retriever?: (d:Object)=>number) => T;
}
export interface IAbstractCoordinateGridChart<T> {
x: IGetSet<any, T>;
y: IGetSet<any, T>;
elasticY: IGetSet<boolean, T>;
xAxis: IGetSet<D3.Svg.Axis, T>;
yAxis: IGetSet<D3.Svg.Axis, T>;
yAxisPadding: IGetSet<number, T>;
xAxisPadding: IGetSet<number, T>;
renderHorizontalGridLines: IGetSet<boolean, T>;
}
export interface IAbstractBubblechart<T> {
r: IGetSet<any, T>;
radiusValueAccessor: IGetSet<(d:any) => number, T>;
}
// function interfaces
export interface columnFunction {
(rowinfo:any): string;
}
export interface sortbyFunction {
(rowinfo:any): any;
}
export interface orderFunction {
<T>(a: T, b: T): number;
}
// chart interfaces
export interface IBubblechart extends
IBaseChart<IBubblechart>,
IAbstractColorChart<IBubblechart>,
IAbstractBubblechart<IBubblechart>,
IAbstractCoordinateGridChart<IBubblechart>,
IMarginable<IBubblechart>,
IListener<IBubblechart> {
}
export interface IPiechart extends
IBaseChart<IPiechart>,
IAbstractColorChart<IPiechart>,
IAbstractBubblechart<IPiechart>,
IAbstractCoordinateGridChart<IPiechart>,
IMarginable<IPiechart>,
IListener<IPiechart> {
radius: IGetSet<number, IPiechart>;
minAngleForLabel: IGetSet<number, IPiechart>;
}
export interface IBarchart extends
IBaseChart<IBarchart>,
IAbstractStackableChart<IBarchart>,
IAbstractCoordinateGridChart<IBarchart>,
IMarginable<IBarchart>,
IListener<IBarchart> {
centerBar: (b:boolean) => IBarchart;
gap: (gapBetweenBars: number) => IBarchart;
}
export interface ILinechart extends
IBaseChart<ILinechart>,
IAbstractStackableChart<ILinechart>,
IAbstractCoordinateGridChart<ILinechart>,
IMarginable<ILinechart>,
IListener<ILinechart> {
}
export interface IDatachart extends
IBaseChart<IDatachart>,
IAbstractStackableChart<IDatachart>,
IAbstractCoordinateGridChart<IDatachart>,
IMarginable<IDatachart>,
IListener<IDatachart> {
size: IGetSet<number, IDatachart>;
columns: IGetSet<columnFunction[], IDatachart>;
sortBy: IGetSet<sortbyFunction, IDatachart>;
order: IGetSet<orderFunction, IDatachart>;
}
export interface IRowchart extends
IBaseChart<IRowchart>,
IAbstractColorChart<IRowchart>,
IAbstractStackableChart<IRowchart>,
IAbstractCoordinateGridChart<IRowchart>,
IMarginable<IRowchart>,
IListener<IRowchart> {
}
// utilities
export interface IChartGroup { }
export function filterAll(chartGroup?: IChartGroup): void;
export function renderAll(chartGroup?: IChartGroup): void;
export function redrawAll(chartGroup?: IChartGroup): void;
export function bubbleChart(cssSel: string): IBubblechart;
export function pieChart(cssSel: string): IPiechart;
export function barChart(cssSel: string): IBarchart;
export function lineChart(cssSel: string): ILinechart;
export function dataTable(cssSel: string): IDatachart;
export function rowChart(cssSel: string): IRowchart;
}
+196 -215
View File
@@ -3,240 +3,221 @@
///<reference path="dc.d.ts" />
interface IYelpData {
city: string;
review_count: number;
name: string;
neighborhoods: string[];
type: string;
business_id: string;
full_address: string;
state: string;
longitude: number;
stars: number;
latitude: number;
open: boolean;
categories: string[]
city: string;
review_count: number;
name: string;
neighborhoods: string[];
type: string;
business_id: string;
full_address: string;
state: string;
longitude: number;
stars: number;
latitude: number;
open: boolean;
categories: string[]
}
interface IYelpDataExtended {
count: number;
review_sum: number;
star_sum: number;
review_avg: number;
star_avg: number;
count: number;
review_sum: number;
star_sum: number;
review_avg: number;
star_avg: number;
}
/********************************************************
* *
* dj.js example using Yelp Kaggle Test Dataset *
* Eamonn O'Loughlin 9th May 2013 *
* *
********************************************************/
* *
* dj.js example using Yelp Kaggle Test Dataset *
* Eamonn O'Loughlin 9th May 2013 *
* *
********************************************************/
/********************************************************
* *
* Step0: Load data from json file *
* *
********************************************************/
d3.json("data/yelp_test_set_business.json", function (yelp_data:IYelpData[]) {
/********************************************************
* *
* Step1: Create the dc.js chart objects & ling to div *
* *
********************************************************/
var bubbleChart = dc.bubbleChart("#dc-bubble-graph");
var pieChart = dc.pieChart("#dc-pie-graph");
var volumeChart = dc.barChart("#dc-volume-chart");
var lineChart = dc.lineChart("#dc-line-chart");
var dataTable = dc.dataTable("#dc-table-graph");
var rowChart = dc.rowChart("#dc-row-graph");
* *
* Step0: Load data from json file *
* *
********************************************************/
d3.json("data/yelp_test_set_business.json", (yelp_data:IYelpData[]) => {
/********************************************************
* *
* Step2: Run data through crossfilter *
* *
********************************************************/
var ndx = crossfilter(yelp_data);
/********************************************************
* *
* Step3: Create Dimension that we'll need *
* *
********************************************************/
/********************************************************
* *
* Step1: Create the dc.js chart objects & ling to div *
* *
********************************************************/
var bubbleChart: DC.BubbleChart = dc.bubbleChart("#dc-bubble-graph");
var pieChart: DC.PieChart = dc.pieChart("#dc-pie-graph");
var volumeChart: DC.BarChart = dc.barChart("#dc-volume-chart");
var lineChart: DC.LineChart = dc.lineChart("#dc-line-chart");
var dataTable: DC.DataTableWidget = dc.dataTable("#dc-table-graph");
var rowChart: DC.RowChart = dc.rowChart("#dc-row-graph");
// for volumechart
var cityDimension = ndx.dimension(function (d) { return d.city; });
var cityGroup = cityDimension.group();
var cityDimensionGroup = cityDimension.group().reduce(
//add
function(p: IYelpDataExtended,v:IYelpData){
++p.count;
p.review_sum += v.review_count;
p.star_sum += v.stars;
p.review_avg = p.review_sum / p.count;
p.star_avg = p.star_sum / p.count;
return p;
},
//remove
function(p: IYelpDataExtended,v:IYelpData){
--p.count;
p.review_sum -= v.review_count;
p.star_sum -= v.stars;
p.review_avg = p.review_sum / p.count;
p.star_avg = p.star_sum / p.count;
return p;
},
//init
function(){
return {count:0, review_sum: 0, star_sum: 0, review_avg: 0, star_avg: 0};
}
);
/********************************************************
* *
* Step2: Run data through crossfilter *
* *
********************************************************/
var ndx: CrossFilter.CrossFilter<IYelpData> = crossfilter(yelp_data);
// for pieChart
var startValue = ndx.dimension(function (d) {
return d.stars*1.0;
});
var startValueGroup = startValue.group();
/********************************************************
* *
* Step3: Create Dimension that we'll need *
* *
********************************************************/
// For datatable
var businessDimension = ndx.dimension(function (d) { return d.business_id; });
/********************************************************
* *
* Step4: Create the Visualisations *
* *
********************************************************/
bubbleChart.width(650)
.height(300)
.dimension(cityDimension)
.group(cityDimensionGroup)
.transitionDuration(1500)
.colors(["#a60000","#ff0000", "#ff4040","#ff7373","#67e667","#39e639","#00cc00"])
.colorDomain([-12000, 12000])
.x(d3.scale.linear().domain([0, 5.5]))
.y(d3.scale.linear().domain([0, 5.5]))
.r(d3.scale.linear().domain([0, 2500]))
.keyAccessor(function (p) {
return p.value.star_avg;
})
.valueAccessor(function (p) {
return p.value.review_avg;
})
.radiusValueAccessor(function (p) {
return p.value.count;
})
.transitionDuration(1500)
.elasticY(true)
.yAxisPadding(1)
.xAxisPadding(1)
.label(function (p) {
return p.key;
})
.renderLabel(true)
.renderlet(function (chart) {
rowChart.filter(chart.filter());
})
.on("postRedraw", function (chart) {
dc.events.trigger(function () {
rowChart.filter(chart.filter());
});
});
;
// for volumechart
var cityDimension: CrossFilter.Dimension<IYelpData, string> = ndx.dimension((d: IYelpData) => d.city);
var cityGroup: CrossFilter.Group<IYelpData, string, string> = cityDimension.group();
var cityDimensionGroup: CrossFilter.Group<IYelpData, string, IYelpDataExtended> = cityDimension.group().reduce(
//add
(p: IYelpDataExtended, v:IYelpData) => {
++p.count;
p.review_sum += v.review_count;
p.star_sum += v.stars;
p.review_avg = p.review_sum / p.count;
p.star_avg = p.star_sum / p.count;
return p;
},
//remove
(p: IYelpDataExtended, v:IYelpData) => {
--p.count;
p.review_sum -= v.review_count;
p.star_sum -= v.stars;
p.review_avg = p.review_sum / p.count;
p.star_avg = p.star_sum / p.count;
return p;
},
//init
() => {
return {count: 0, review_sum: 0, star_sum: 0, review_avg: 0, star_avg: 0};
}
);
// for pieChart
var startValue: CrossFilter.Dimension<IYelpData, number> = ndx.dimension((d: IYelpData) => d.stars * 1.0);
var startValueGroup: CrossFilter.Group<IYelpData, number, number> = startValue.group();
pieChart.width(200)
.height(200)
.transitionDuration(1500)
.dimension(startValue)
.group(startValueGroup)
.radius(90)
.minAngleForLabel(0)
.label(function(d) { return d.data.key; })
.on("filtered", function (chart) {
dc.events.trigger(function () {
if(chart.filter()) {
console.log(chart.filter());
volumeChart.filter([chart.filter()-.25,chart.filter()-(-0.25)]);
}
else volumeChart.filterAll();
});
});
// For datatable
var businessDimension: CrossFilter.Dimension<IYelpData, string> = ndx.dimension((d: IYelpData) => d.business_id);
/********************************************************
* *
* Step4: Create the Visualisations *
* *
********************************************************/
volumeChart.width(230)
.height(200)
.dimension(startValue)
.group(startValueGroup)
.transitionDuration(1500)
.centerBar(true)
.gap(17)
.x(d3.scale.linear().domain([0.5, 5.5]))
.elasticY(true)
.on("filtered", function (chart) {
dc.events.trigger(function () {
if(chart.filter()) {
console.log(chart.filter());
lineChart.filter(chart.filter());
}
else
{lineChart.filterAll()}
});
})
.xAxis().tickFormat(function(v) {return v;});
bubbleChart
.width(650)
.height(300)
.dimension(cityDimension)
.group(cityDimensionGroup)
.transitionDuration(1500)
.colors(["#a60000","#ff0000", "#ff4040","#ff7373","#67e667","#39e639","#00cc00"])
.colorDomain([-12000, 12000])
.x(d3.scale.linear().domain([0, 5.5]))
.y(d3.scale.linear().domain([0, 5.5]))
.r(d3.scale.linear().domain([0, 2500]))
.keyAccessor((p: any) => p.value.star_avg)
.valueAccessor((p: any) => p.value.review_avg)
.radiusValueAccessor((p: any) => p.value.count)
.transitionDuration(1500)
.elasticY(true)
.yAxisPadding(1)
.xAxisPadding(1)
.label((p: any) => p.key)
.renderLabel(true)
.renderlet((chart: DC.BubbleChart) => rowChart.filter(chart.filter()))
.on("postRedraw", (chart: DC.BubbleChart) => dc.events.trigger(() => rowChart.filter(chart.filter())));
console.log(startValueGroup.top(1)[0].value);
pieChart
.width(200)
.height(200)
.transitionDuration(1500)
.dimension(startValue)
.group(startValueGroup)
.radius(90)
.minAngleForLabel(0)
.label((d: any) => d.data.key)
.on("filtered", (chart: DC.PieChart) =>
dc.events.trigger(() => {
if (chart.filter()) {
console.log(chart.filter());
volumeChart.filter([chart.filter()-.25,chart.filter()-(-0.25)]);
}
else volumeChart.filterAll();
}));
lineChart.width(230)
.height(200)
.dimension(startValue)
.group(startValueGroup)
.x(d3.scale.linear().domain([0.5, 5.5]))
.valueAccessor(function(d) {
return d.value;
})
.renderHorizontalGridLines(true)
.elasticY(true)
.xAxis().tickFormat(function(v) {return v;}); ;
volumeChart
.width(230)
.height(200)
.dimension(startValue)
.group(startValueGroup)
.transitionDuration(1500)
.centerBar(true)
.gap(17)
.x(d3.scale.linear().domain([0.5, 5.5]))
.elasticY(true)
.on("filtered", (chart: DC.BarChart) =>
dc.events.trigger(() => {
if(chart.filter()) {
console.log(chart.filter());
lineChart.filter(chart.filter());
}
else {
lineChart.filterAll()
}
}))
.xAxis()
.tickFormat((v: string) => v);
rowChart.width(340)
.height(850)
.dimension(cityDimension)
.group(cityGroup)
.renderLabel(true)
.colors(["#a60000","#ff0000", "#ff4040","#ff7373","#67e667","#39e639","#00cc00"])
.colorDomain([0, 0])
.renderlet(function (chart) {
bubbleChart.filter(chart.filter());
})
.on("filtered", function (chart) {
dc.events.trigger(function () {
bubbleChart.filter(chart.filter());
});
});
console.log(startValueGroup.top(1)[0].value);
lineChart
.width(230)
.height(200)
.dimension(startValue)
.group(startValueGroup)
.x(d3.scale.linear().domain([0.5, 5.5]))
.valueAccessor((d: any) => d.value)
.renderHorizontalGridLines(true)
.elasticY(true)
.xAxis()
.tickFormat((v: string) => v);
dataTable.width(800).height(800)
.dimension(businessDimension)
.group(function(d:Object) { return "List of all Selected Businesses"
})
.size(100)
.columns([
function(d) { return d.name; },
function(d) { return d.city; },
function(d) { return d.stars; },
function(d) { return d.review_count; },
function(d) { return '<a href=\"http://maps.google.com/maps?z=12&t=m&q=loc:' + d.latitude + '+' + d.longitude +"\" target=\"_blank\">Map</a>"}
])
.sortBy(function(d){ return d.stars; })
// (optional) sort order, :default ascending
.order(d3.ascending);
/********************************************************
* *
* Step6: Render the Charts *
* *
********************************************************/
dc.renderAll();
rowChart
.width(340)
.height(850)
.dimension(cityDimension)
.group(cityGroup)
.renderLabel(true)
.colors(["#a60000","#ff0000", "#ff4040","#ff7373","#67e667","#39e639","#00cc00"])
.colorDomain([0, 0])
.renderlet((chart: DC.RowChart) => bubbleChart.filter(chart.filter()))
.on("filtered", (chart: DC.RowChart) =>
dc.events.trigger(() =>
bubbleChart.filter(chart.filter())));
dataTable
.width(800)
.height(800)
.dimension(businessDimension)
.group((d: any) => "List of all Selected Businesses")
.size(100)
.columns([
(d: IYelpData) => d.name,
(d: IYelpData) => d.city,
(d: IYelpData) => d.stars,
(d: IYelpData) => d.review_count,
(d: IYelpData) => '<a href=\"http://maps.google.com/maps?z=12&t=m&q=loc:' + d.latitude + '+' + d.longitude +"\" target=\"_blank\">Map</a>"
])
.sortBy((d: IYelpData) => d.stars)
// (optional) sort order, :default ascending
.order(d3.ascending);
/********************************************************
* *
* Step6: Render the Charts *
* *
********************************************************/
dc.renderAll();
});
+390 -156
View File
@@ -1,6 +1,6 @@
// Type definitions for DCJS
// Project: https://github.com/dc-js
// Definitions by: hans windhoff <https://github.com/hansrwindhoff>
// Project: https://github.com/dc-js/dc.js
// Definitions by: hans windhoff <https://github.com/hansrwindhoff>, matt traynham <https://github.com/mtraynham>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// this makes only sense together with d3 and crossfilter so you need the d3.d.ts and crossfilter.d.ts files
@@ -8,192 +8,426 @@
///<reference path="../d3/d3.d.ts" />
///<reference path="../crossfilter/crossfilter.d.ts" />
declare module DC {
// helper for get/set situation
export interface IGetSet<T, V> {
(): T;
(t: T): V;
}
export interface IBiGetSet<T, R, V> {
(): T;
(t: T, r?: R): V;
}
declare module dc {
export interface Accessor<T, V> {
(datum: T, index?: number): V;
}
// helper for get/set situation
interface IGetSet<T, V> {
(): T;
(t:T): V;
}
export interface ILegendwidget {
x: IGetSet<number, number>;
y: IGetSet<number, number>;
gap: IGetSet<number, number>;
itemHeight: IGetSet<number, number>;
horizontal: IGetSet<boolean, boolean>;
legendWidth: IGetSet<number, number>;
itemWidth: IGetSet<number, number>;
}
export interface IBaseChart<T> {
width: IGetSet<number, T>;
height: IGetSet<number, T>;
minWidth: IGetSet<number, T>;
minHeight: IGetSet<number, T>;
dimension: IGetSet<any, T>;
group: IGetSet<any, T>; // not sure here
transitionDuration: IGetSet<number, T>;
colors: IGetSet<string[], T>;
keyAccessor: IGetSet<(d:any) => number, T>;
valueAccessor: IGetSet<(d:any) => number, T>;
label: IGetSet<(l:any) => string, T>;
renderLabel: IGetSet<boolean, T>;
renderlet: (fnctn: (t:T) => void) => T;
title: IGetSet<(t:string) => string, T>;
filter: IGetSet<any, T>;
filterAll: () => void;
expireCache: () => void;
legend: (l:ILegendwidget) => T;
chartID: () => number;
options: (o:Object)=>void ;
select: (selector: D3.Selection) => D3.Selection;
selectAll: (selector: D3.Selection) => D3.Selection;
}
export interface UnitFunction {
(start: number, end: number, domain?: Array<any>): number|Array<any>;
}
export interface IEvents {
trigger(fnctn: () => void, delay?: number):void;
}
export interface FloatPointUnits {
precision(precision: number): UnitFunction;
}
export var events: IEvents;
export interface Units {
integers: UnitFunction;
ordinal: UnitFunction;
fp: FloatPointUnits;
}
export interface IListener<T> {
on: (eventName: string, fnctn: (c:T) => void) => T;
}
export interface Events {
trigger(fn: () => void, delay?: number): void;
}
export interface ImarginObj {
top: number;
right: number;
bottom: number;
left: number;
}
export interface Errors {
Exception(msg: string): void;
InvalidStateException(msg: string): void;
}
export interface IMarginable<T> {
margins: IGetSet<ImarginObj, T>;
}
export interface Filter {
isFiltered(value: any): boolean;
}
// abstract interfaces
export interface IAbstractColorChart<T> {
colorDomain: IGetSet<number[], T>;
}
export interface IAbstractStackableChart<T> {
stack: (group: IChartGroup, name?:string, retriever?: (d:Object)=>number) => T;
}
export interface Filters {
RangedFilter(low: any, high: any): Filter;
TwoDimensionalFilter(arr: Array<any>): Filter;
RangedTwoDimensionalFilter(arr: Array<any>): Filter;
}
export interface IAbstractCoordinateGridChart<T> {
x: IGetSet<any, T>;
y: IGetSet<any, T>;
elasticY: IGetSet<boolean, T>;
xAxis: IGetSet<D3.Svg.Axis, T>;
yAxis: IGetSet<D3.Svg.Axis, T>;
yAxisPadding: IGetSet<number, T>;
xAxisPadding: IGetSet<number, T>;
renderHorizontalGridLines: IGetSet<boolean, T>;
}
export interface Logger {
enableDebugLog: boolean;
warn(msg: string): void;
debug(msg: string): void;
deprecate(fn: Function, msg: string): void;
}
export interface IAbstractBubblechart<T> {
r: IGetSet<any, T>;
radiusValueAccessor: IGetSet<(d:any) => number, T>;
}
export interface Printers {
filters(filters: Array<any>): string;
filter(filter: any): string;
}
export interface Round {
floor(n: number): number;
ceil(n: number): number;
round(n: number): number;
}
export interface Utils {
printSingleValue(filter: any): string;
add(l: any, r: any): any;
subtract(l: any, r: any): any;
isNumber(n: any): boolean;
isFloat(n: any): boolean;
isInteger(n: any): boolean;
isNegligible(n: any): boolean;
clamp(n: number, min: number, max: number): number;
uniqueId(): number;
nameToId(name: string): string;
appendOrSelect(parent: D3.Selection, selector: string, tag: any): D3.Selection;
safeNumber(n: any): number;
}
// function interfaces
export interface columnFunction {
(rowinfo:any): string;
}
export interface sortbyFunction {
(rowinfo:any): any;
}
export interface orderFunction {
<T>(a: T, b: T): number;
}
export interface Legend {
x: IGetSet<number, number>;
y: IGetSet<number, number>;
gap: IGetSet<number, number>;
itemHeight: IGetSet<number, number>;
horizontal: IGetSet<boolean, boolean>;
legendWidth: IGetSet<number, number>;
itemWidth: IGetSet<number, number>;
autoItemWidth: IGetSet<boolean, boolean>;
render: () => void;
}
export interface BaseMixin<T> {
width: IGetSet<number, T>;
height: IGetSet<number, T>;
minWidth: IGetSet<number, T>;
minHeight: IGetSet<number, T>;
dimension: IGetSet<any, T>;
data: IGetSet<(group: any) => Array<any>, T>;
group: IGetSet<any, T>;
ordering: IGetSet<Accessor<any, any>, T>;
filterAll(): void;
select(selector: D3.Selection|string): D3.Selection;
selectAll(selector: D3.Selection|string): D3.Selection;
anchor(anchor: BaseMixin<any>|D3.Selection|string, chartGroup?: string): D3.Selection;
anchorName(): string;
svg: IGetSet<D3.Selection, D3.Selection>;
resetSvg(): void;
filterPrinter: IGetSet<(filters: Array<any>) => string, T>;
turnOnControls(): void;
turnOffControls(): void;
transitionDuration: IGetSet<number, T>;
render(): void;
redraw(): void;
redrawGroup(): void;
hasFilterHandler: IGetSet<(filters: Array<any>, filter: any) => boolean, T>;
hasFilter(filter?: any): boolean;
removeFilterHandler: IGetSet<(filters: Array<any>) => Array<any>, T>;
addFilterHandler: IGetSet<(filters: Array<any>) => Array<any>, T>;
resetFilterHandler: IGetSet<(filters: Array<any>) => Array<any>, T>;
filter: IGetSet<any, T>;
filters(): Array<any>;
onClick(datum: any): void;
filterHandler: IGetSet<(dimension: any, filter: any) => any, T>;
keyAccessor: IGetSet<Accessor<any, any>, T>;
valueAccessor: IGetSet<Accessor<any, any>, T>;
label: IGetSet<Accessor<any, string>, T>;
renderLabel: IGetSet<boolean, T>;
title: IGetSet<Accessor<any, string>, T>;
renderTitle: IGetSet<boolean, T>;
chartGroup: IGetSet<string, T>;
expireCache(): T;
legend: IGetSet<Legend, T>;
options(optionsObject: any): T;
renderlet(fn: (chart: T) => any): T;
on(event: string, fn: (chart: T) => any): T;
}
// chart interfaces
export interface Margins {
left: number;
top: number;
right: number;
bottom: number;
}
export interface IBubblechart extends
IBaseChart<IBubblechart>,
IAbstractColorChart<IBubblechart>,
IAbstractBubblechart<IBubblechart>,
IAbstractCoordinateGridChart<IBubblechart>,
IMarginable<IBubblechart>,
IListener<IBubblechart> {
}
export interface MarginMixin<T> {
margins: IGetSet<Margins, T>
}
export interface IPiechart extends
IBaseChart<IPiechart>,
IAbstractColorChart<IPiechart>,
IAbstractBubblechart<IPiechart>,
IAbstractCoordinateGridChart<IPiechart>,
IMarginable<IPiechart>,
IListener<IPiechart> {
radius: IGetSet<number, IPiechart>;
minAngleForLabel: IGetSet<number, IPiechart>;
export interface ColorMixin<T> {
colors: IGetSet<D3.Scale.GenericScale<any>|Array<string>, T>;
ordinalColors(r: Array<string>): void;
linearColors(r: Array<number>): void;
colorAccessor: IGetSet<Accessor<any, string>, T>;
colorDomain: IGetSet<Array<any>, T>;
calculateColorDomain(): void;
getColor(datum: any, index?: number): string;
colorCalculator: IGetSet<Accessor<any, string>, T>;
}
}
export interface CoordinateGridMixin<T> extends BaseMixin<T>, MarginMixin<T>, BaseMixin<T> {
rangeChart: IGetSet<BaseMixin<any>, T>;
zoomScale: IGetSet<Array<any>, T>;
zoomOutRestrict: IGetSet<boolean, T>;
g: IGetSet<D3.Selection, T>;
mouseZoomable: IGetSet<boolean, T>;
chartBodyG(): D3.Selection;
x: IGetSet<D3.Scale.GenericScale<any>, T>;
xUnits: IGetSet<UnitFunction, T>;
xAxis: IGetSet<D3.Svg.Axis, T>;
elasticX: IGetSet<boolean, T>;
xAxisPadding: IGetSet<number, T>;
xUnitCount(): number;
useRightYAxis: IGetSet<boolean, T>;
isOrdinal(): boolean;
xAxisLabel: IBiGetSet<string, number, T>;
yAxisLabel: IBiGetSet<string, number, T>;
y: IGetSet<D3.Scale.GenericQuantitativeScale<any>, T>;
yAxis: IGetSet<D3.Svg.Axis, T>;
elasticY: IGetSet<boolean, T>;
renderHorizontalGridLines: IGetSet<boolean, T>;
renderVerticalGridLines: IGetSet<boolean, T>;
xAxisMin(): any;
xAxisMax(): any;
yAxisMin(): any;
yAxisMax(): any;
yAxisPadding: IGetSet<number, T>;
round: IGetSet<(value: any) => any, T>;
clipPadding: IGetSet<number, T>;
focus(range?: Array<any>): void;
brushOn: IGetSet<boolean, T>;
}
export interface IBarchart extends
IBaseChart<IBarchart>,
IAbstractStackableChart<IBarchart>,
IAbstractCoordinateGridChart<IBarchart>,
IMarginable<IBarchart>,
IListener<IBarchart> {
centerBar: (b:boolean) => IBarchart;
gap: (gapBetweenBars: number) => IBarchart;
}
export interface StackMixin<T> {
stack(group: any, name?: string, accessor?: Accessor<any, any>): void;
hidableStacks: IGetSet<boolean, T>;
hideStack(name: string): void;
showStack(name: string): void;
// title(stackName: string, titleFn: Accessor<any, T>);
stackLayout: IGetSet<D3.Layout.StackLayout, T>;
}
export interface ILinechart extends
IBaseChart<ILinechart>,
IAbstractStackableChart<ILinechart>,
IAbstractCoordinateGridChart<ILinechart>,
IMarginable<ILinechart>,
IListener<ILinechart> {
}
export interface CapMixin<T> {
cap: IGetSet<number, T>;
othersLabel: IGetSet<string, T>;
othersGrouper: IGetSet<(data: Array<any>) => Array<any>, T>;
}
export interface BubbleMixin<T> extends ColorMixin<T> {
r: IGetSet<D3.Scale.GenericQuantitativeScale<any>, T>;
radiusValueAccessor: IGetSet<Accessor<any, number>, T>;
minRadiusWithLabel: IGetSet<number, T>;
maxBubbleRelativeSize: IGetSet<number, T>;
}
export interface IDatachart extends
IBaseChart<IDatachart>,
IAbstractStackableChart<IDatachart>,
IAbstractCoordinateGridChart<IDatachart>,
IMarginable<IDatachart>,
IListener<IDatachart> {
size: IGetSet<number, IDatachart>;
columns: IGetSet<columnFunction[], IDatachart>;
sortBy: IGetSet<sortbyFunction, IDatachart>;
order: IGetSet<orderFunction, IDatachart>;
}
export interface PieChart extends CapMixin<PieChart>, ColorMixin<PieChart>, BaseMixin<PieChart> {
slicesCap: IGetSet<number, PieChart>;
innerRadius: IGetSet<number, PieChart>;
radius: IGetSet<number, PieChart>;
cx: IGetSet<number, PieChart>;
cy: IGetSet<number, PieChart>;
minAngleForLabel: IGetSet<number, PieChart>;
}
export interface BarChart extends StackMixin<BarChart>, CoordinateGridMixin<BarChart> {
centerBar: IGetSet<boolean, BarChart>;
barPadding: IGetSet<number, BarChart>;
outerPadding: IGetSet<number, BarChart>;
gap: IGetSet<number, BarChart>;
alwaysUseRounding: IGetSet<boolean, BarChart>;
}
export interface IRowchart extends
IBaseChart<IRowchart>,
IAbstractColorChart<IRowchart>,
IAbstractStackableChart<IRowchart>,
IAbstractCoordinateGridChart<IRowchart>,
IMarginable<IRowchart>,
IListener<IRowchart> {
}
export interface RenderDataPointOptions {
fillOpacity: number;
strokeOpacity: number;
radius: number;
}
export interface LineChart extends StackMixin<BarChart>, CoordinateGridMixin<BarChart> {
interpolate: IGetSet<string, LineChart>;
tension: IGetSet<number, LineChart>;
defined: IGetSet<Accessor<any, boolean>, LineChart>;
dashStyle: IGetSet<Array<number>, LineChart>;
renderArea: IGetSet<boolean, LineChart>;
dotRadius: IGetSet<number, LineChart>;
renderDataPoints: IGetSet<RenderDataPointOptions|any, LineChart>;
}
export interface DataCountWidgetHTML {
all: string;
some: string;
}
export interface DataCountWidget extends BaseMixin<DataCountWidget> {
html: IGetSet<DataCountWidgetHTML, DataCountWidget>;
formatNumber: IGetSet<Accessor<number, string>, DataCountWidget>;
}
// utilities
export interface IChartGroup { }
export interface DataTableWidget extends BaseMixin<DataTableWidget> {
size: IGetSet<number, DataTableWidget>;
columns: IGetSet<Array<Accessor<any, any>|string|Array<Accessor<any, any>|string>>, DataTableWidget>;
sortBy: IGetSet<Accessor<any, any>, DataTableWidget>;
order: IGetSet<(a: any, b: any) => number, DataTableWidget>;
}
export function filterAll(chartGroup?: IChartGroup): void;
export function renderAll(chartGroup?: IChartGroup): void;
export function redrawAll(chartGroup?: IChartGroup): void;
export interface DataGridWidget extends BaseMixin<DataGridWidget> {
size: IGetSet<number, DataTableWidget>;
html: IGetSet<Accessor<any, string>, DataTableWidget>;
htmlGroup: IGetSet<Accessor<any, string>, DataTableWidget>;
sortBy: IGetSet<Accessor<any, any>, DataTableWidget>;
order: IGetSet<(a: any, b: any) => number, DataTableWidget>;
}
export interface BubbleChart extends BubbleMixin<BubbleChart>, CoordinateGridMixin<BubbleChart> {
elasticRadius: IGetSet<boolean, BubbleChart>;
}
export function bubbleChart(cssSel: string): IBubblechart;
export function pieChart(cssSel: string): IPiechart;
export function barChart(cssSel: string): IBarchart;
export function lineChart(cssSel: string): ILinechart;
export function dataTable(cssSel: string): IDatachart;
export function rowChart(cssSel: string): IRowchart;
export interface CompositeChart extends CoordinateGridMixin<CompositeChart> {
useRightAxisGridLines: IGetSet<boolean, CompositeChart>;
childOptions: IGetSet<any, CompositeChart>;
rightYAxisLabel: IGetSet<string, CompositeChart>;
compose: IGetSet<Array<BaseMixin<any>>, CompositeChart>;
children(): Array<BaseMixin<any>>;
shareColors: IGetSet<boolean, CompositeChart>;
shareTitle: IGetSet<boolean, CompositeChart>;
rightY: IGetSet<D3.Scale.GenericQuantitativeScale<any>, CompositeChart>;
rightYAxis: IGetSet<D3.Svg.Axis, CompositeChart>;
}
export interface SeriesChart extends CompositeChart {
chart: IGetSet<(c: any) => BaseMixin<any>, SeriesChart>;
seriesAccessor: IGetSet<Accessor<any, any>, SeriesChart>;
seriesSort: IGetSet<(a: any, b: any) => number, SeriesChart>;
valueSort: IGetSet<(a: any, b: any) => number, SeriesChart>;
}
export interface GeoChoroplethLayer {
name: string;
keyAccessor: Accessor<any, any>;
data: any;
}
export interface GeoChoroplethChart extends ColorMixin<GeoChoroplethChart>, BaseMixin<GeoChoroplethChart> {
overlayGeoJson(json: any, name: string, keyAccessor: Accessor<any, any>): void;
projection: IGetSet<D3.Geo.Projection, GeoChoroplethChart>;
geoJsons(): Array<GeoChoroplethLayer>;
geoPath(): D3.Geo.Path;
removeGeoJson(name: string): void;
}
export interface BubbleOverlayChart extends BubbleMixin<BubbleOverlayChart>, BaseMixin<BubbleOverlayChart> {
point(name: string, x: number, y: number): void;
}
export interface RowChart extends CapMixin<RowChart>, MarginMixin<RowChart>, ColorMixin<RowChart>, BaseMixin<RowChart> {
x: IGetSet<D3.Scale.GenericQuantitativeScale<any>, RowChart>;
renderTitleLabel: IGetSet<boolean, RowChart>;
xAxis: IGetSet<D3.Svg.Axis, RowChart>;
fixedBarHeight: IGetSet<number, RowChart>;
gap: IGetSet<number, RowChart>;
elasticX: IGetSet<boolean, RowChart>;
labelOffsetX: IGetSet<number, RowChart>;
labelOffsetY: IGetSet<number, RowChart>;
titleLabelOffsetX: IGetSet<number, RowChart>;
}
export interface ScatterPlot extends CoordinateGridMixin<ScatterPlot> {
existenceAccessor: IGetSet<Accessor<any, boolean>, ScatterPlot>;
symbol: IGetSet<D3.Svg.Symbol, ScatterPlot>;
symbolSize: IGetSet<number, ScatterPlot>;
highlightedSize: IGetSet<number, ScatterPlot>;
hiddenSize: IGetSet<number, ScatterPlot>;
}
export interface NumberDisplayWidgetHTML {
one: string;
some: string;
none: string;
}
export interface NumberDisplayWidget extends BaseMixin<NumberDisplayWidget> {
html: IGetSet<NumberDisplayWidgetHTML, NumberDisplayWidget>;
value(): string;
formatNumber: IGetSet<Accessor<number, string>, NumberDisplayWidget>;
}
export interface HeatMap extends ColorMixin<HeatMap>, MarginMixin<HeatMap>, BaseMixin<HeatMap> {
colsLabel: IGetSet<Accessor<any, string>, HeatMap>;
rowsLabel: IGetSet<Accessor<any, string>, HeatMap>;
rows: IGetSet<Array<any>, HeatMap>;
cols: IGetSet<Array<any>, HeatMap>;
boxOnClick: IGetSet<(d: any) => void, HeatMap>;
xAxisOnClick: IGetSet<(d: any) => void, HeatMap>;
yAxisOnClick: IGetSet<(d: any) => void, HeatMap>;
}
export interface BoxPlot extends CoordinateGridMixin<BoxPlot> {
boxPadding: IGetSet<number, BoxPlot>;
outerPadding: IGetSet<number, BoxPlot>;
boxWidth: IGetSet<number, BoxPlot>;
tickFormat: IGetSet<Accessor<number, string>, BoxPlot>;
}
export interface ChartRegistry {
has(chart: BaseMixin<any>): boolean;
register(chart: BaseMixin<any>, group?: string): void;
deregister(chart: BaseMixin<any>, group?: string): void;
clear(group?: string): void;
list(group?: string): Array<BaseMixin<any>>;
}
export interface Base {
chartRegistry: ChartRegistry;
registerChart(chart: BaseMixin<any>, group?: string): void;
deregisterChart(chart: BaseMixin<any>, group?: string): void;
hasChart(chart: BaseMixin<any>): boolean;
deregisterAllCharts(group?: string): void;
filterAll(group?: string): void;
refocusAll(group?: string): void;
renderAll(group?: string): void;
redrawAll(group?: string): void;
disableTransitions: boolean;
transition(selections: D3.Selection, duration: number, callback: (s: D3.Selection) => void): void;
units: Units;
events: Events;
errors: Errors;
instanceOfChart(object: any): boolean;
logger: Logger;
override(object: any, fnName: string, newFn: Function): void;
printers: Printers;
pluck(n: string, f?: Accessor<any, any>): Accessor<any, any>;
round: Round;
utils: Utils;
legend(): Legend;
pieChart(parent: string, chartGroup?: string): PieChart;
barChart(parent: string, chartGroup?: string): BarChart;
lineChart(parent: string, chartGroup?: string): LineChart;
dataCount(parent: string, chartGroup?: string): DataCountWidget;
dataTable(parent: string, chartGroup?: string): DataTableWidget;
dataGrid(parent: string, chartGroup?: string): DataGridWidget;
bubbleChart(parent: string, chartGroup?: string): BubbleChart;
compositeChart(parent: string, chartGroup?: string): CompositeChart;
seriesChart(parent: string, chartGroup?: string): SeriesChart;
geoChoroplethChart(parent: string, chartGroup?: string): GeoChoroplethChart;
bubbleOverlayChart(parent: string, chartGroup?: string): BubbleOverlayChart;
rowChart(parent: string, chartGroup?: string): RowChart;
scatterPlot(parent: string, chartGroup?: string): ScatterPlot;
numberDisplay(parent: string, chartGroup?: string): NumberDisplayWidget;
heatMap(parent: string, chartGroup?: string): HeatMap;
boxPlot(parent: string, chartGroup?: string): BoxPlot;
}
}
declare var dc: DC.Base;
declare module 'dc' {
export = dc;
}
+3 -3
View File
@@ -9754,7 +9754,7 @@ declare module dojo {
* </div>
* </div>
* </div>
* </div><a href="https://docs.google.com/spreadsheet/viewform?hl=en_US&amp;formkey=dFlDcHEyaHMwbEd4MFBObkNrX0E1MFE6MQ&amp;entry_0=/api/1.9/dojo/_base/kernel.back" class="feedback">Error in the documentation? Cant find what you are looking for? Let us know!</a>
* </div><a href="https://docs.google.com/spreadsheet/viewform?hl=en_US&amp;formkey=dFlDcHEyaHMwbEd4MFBObkNrX0E1MFE6MQ&amp;entry_0=/api/1.9/dojo/_base/kernel.back" class="feedback">Error in the documentation? Can't find what you are looking for? Let us know!</a>
*/
init(): void;
}
@@ -18375,7 +18375,7 @@ declare module dojo {
* </div>
* </div>
* </div>
* </div><a href="https://docs.google.com/spreadsheet/viewform?hl=en_US&amp;formkey=dFlDcHEyaHMwbEd4MFBObkNrX0E1MFE6MQ&amp;entry_0=/api/1.9/dojo/back" class="feedback">Error in the documentation? Cant find what you are looking for? Let us know!</a>
* </div><a href="https://docs.google.com/spreadsheet/viewform?hl=en_US&amp;formkey=dFlDcHEyaHMwbEd4MFBObkNrX0E1MFE6MQ&amp;entry_0=/api/1.9/dojo/back" class="feedback">Error in the documentation? Can't find what you are looking for? Let us know!</a>
*/
init(): void;
}
@@ -25085,7 +25085,7 @@ declare module dojo {
* </div>
* </div>
* </div>
* </div><a href="https://docs.google.com/spreadsheet/viewform?hl=en_US&amp;formkey=dFlDcHEyaHMwbEd4MFBObkNrX0E1MFE6MQ&amp;entry_0=/api/1.9/dojo/main.back" class="feedback">Error in the documentation? Cant find what you are looking for? Let us know!</a>
* </div><a href="https://docs.google.com/spreadsheet/viewform?hl=en_US&amp;formkey=dFlDcHEyaHMwbEd4MFBObkNrX0E1MFE6MQ&amp;entry_0=/api/1.9/dojo/main.back" class="feedback">Error in the documentation? Can't find what you are looking for? Let us know!</a>
*/
init(): void;
}
+28
View File
@@ -0,0 +1,28 @@
///<reference path="../tether/tether.d.ts" />
///<reference path="drop.d.ts" />
var yellowBox = document.querySelector(".yellow");
var greenBox = document.querySelector(".green");
var d = new Drop({
position: "bottom left",
openOn: "click",
constrainToWindow: true,
constrainToScrollParent: true,
classes: "",
tetherOptions: {}
});
d.open();
d.close();
d.remove();
d.toggle();
d.position();
d.destroy();
d.on("open", () => null);
d.on("close", () => null);
d.once("close", () => null);
d.off("close", () => null);
d.off("open");
+48
View File
@@ -0,0 +1,48 @@
// Type definitions for Drop v0.5
// Project: http://github.hubspot.com/drop/
// Definitions by: Adi Dahiya <https://github.com/adidahiya>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
///<reference path="../tether/tether.d.ts" />
declare module drop {
interface DropStatic {
new(options: IDropOptions): Drop;
}
interface IDropOptions {
target?: Element;
content?: Element | string | (() => string);
position?: string;
openOn?: string;
constrainToWindow?: boolean;
constrainToScrollParent?: boolean;
remove?: boolean;
tetherOptions?: tether.ITetherOptions;
}
interface Drop {
content: HTMLElement;
open(): void;
close(): void;
remove(): void;
toggle(): void;
position(): void;
destroy(): void;
/*
* Drop instances fire "open" and "close" events.
*/
on(event: string, handler: Function, context?: any): void;
once(event: string, handler: Function, context?: any): void;
off(event: string, handler?: Function): void;
}
}
declare module "drop" {
export = drop;
}
declare var Drop: drop.DropStatic;
+8 -8
View File
@@ -2,9 +2,9 @@
/// <reference path="../handlebars/handlebars.d.ts" />
var App;
var App : any;
App = Em.Application.create();
App = Em.Application.create<Em.Application>();
App.president = Em.Object.create({
name: 'Barack Obama'
@@ -27,7 +27,7 @@ declare class MyPerson extends Em.Object {
}
var Person1 = Em.Object.extend<typeof MyPerson>({
say: (thing) => {
say: (thing: string) => {
alert(thing);
}
});
@@ -119,7 +119,7 @@ App.AlertView = Em.View.extend({
App.ListingView = Em.View.extend({
templateName: 'listing',
edit: (event) => {
edit: (event: any) => {
event.view.set('isEditing', true);
}
});
@@ -133,7 +133,7 @@ App.userController = Em.Object.create({
})
});
Handlebars.registerHelper('highlight', function(property, options) {
Handlebars.registerHelper('highlight', function(property: string, options: any) {
var value = Em.Handlebars.get(this, property, options);
return new Handlebars.SafeString('<span class="highlight">' + value + '</span>');
});
@@ -195,7 +195,7 @@ people2.everyProperty('isHappy', true);
people2.someProperty('isHappy', true);
// Examples taken from http://emberjs.com/api/classes/Ember.RSVP.Promise.html
var promise = new Ember.RSVP.Promise(function(resolve, reject) {
var promise = new Ember.RSVP.Promise(function(resolve: Function, reject: Function) {
// on success
resolve('ok!');
@@ -203,8 +203,8 @@ var promise = new Ember.RSVP.Promise(function(resolve, reject) {
reject('no-k!');
});
promise.then(function(value) {
promise.then(function(value: any) {
// on fulfillment
}, function(reason) {
}, function(reason: any) {
// on rejection
});
+469 -64
View File
@@ -11,15 +11,147 @@ declare var Handlebars: HandlebarsStatic;
declare module EmberStates {
interface Transition {
abort(): void;
addInitialStates(): void;
matchContextsToStates(contexts: any[]): void;
normalize(manager: Ember.StateManager, contexts: any[]): void;
removeUnchangedContexts(manager: Ember.StateManager): void;
retry(): void;
sendEvents(eventName: string, sendRecursiveArguments: boolean, isUnhandledPass: boolean): void;
sendRecursively(event: string, currentState: Ember.State, isUnhandledPass: boolean): void;
targetName: string;
urlMethod: string;
intent: any;
params: {}|any;
pivotHandler: any;
resolveIndex: number;
handlerInfos: any;
resolvedModels: {}|any;
isActive: boolean;
state: any;
queryParams: {}|any;
queryParamsOnly: boolean;
isTransition: boolean;
/**
The Transition's internal promise. Calling `.then` on this property
is that same as calling `.then` on the Transition object itself, but
this property is exposed for when you want to pass around a
Transition's promise, but not the Transition object itself, since
Transition object can be externally `abort`ed, while the promise
cannot.
*/
promise: Ember.RSVP.Promise;
/**
Custom state can be stored on a Transition's `data` object.
This can be useful for decorating a Transition within an earlier
hook and shared with a later hook. Properties set on `data` will
be copied to new transitions generated by calling `retry` on this
transition.
*/
data: any;
/**
A standard promise hook that resolves if the transition
succeeds and rejects if it fails/redirects/aborts.
Forwards to the internal `promise` property which you can
use in situations where you want to pass around a thennable,
but not the Transition itself.
@arg {Function} onFulfilled
@arg {Function} onRejected
@arg {String} label optional string for labeling the promise. Useful for tooling.
@return {Promise}
*/
then(onFulfilled: Function, onRejected: Function, label?: string): Ember.RSVP.Promise;
/**
Forwards to the internal `promise` property which you can
use in situations where you want to pass around a thennable,
but not the Transition itself.
@method catch
@arg {Function} onRejection
@arg {String} label optional string for labeling the promise.
Useful for tooling.
@return {Promise}
*/
catch(onRejection: Function, label?: string): Ember.RSVP.Promise;
/**
Forwards to the internal `promise` property which you can
use in situations where you want to pass around a thennable,
but not the Transition itself.
@method finally
@arg {Function} callback
@arg {String} label optional string for labeling the promise.
Useful for tooling.
@return {Promise}
*/
finally(callback: Function, label?: string): Ember.RSVP.Promise;
/**
Aborts the Transition. Note you can also implicitly abort a transition
by initiating another transition while a previous one is underway.
*/
abort(): EmberStates.Transition;
normalize(manager: Ember.StateManager, contexts: any[]): void;
/**
Retries a previously-aborted transition (making sure to abort the
transition if it's still active). Returns a new transition that
represents the new attempt to transition.
*/
retry(): EmberStates.Transition;
/**
Sets the URL-changing method to be employed at the end of a
successful transition. By default, a new Transition will just
use `updateURL`, but passing 'replace' to this method will
cause the URL to update using 'replaceWith' instead. Omitting
a parameter will disable the URL change, allowing for transitions
that don't update the URL at completion (this is also used for
handleURL, since the URL has already changed before the
transition took place).
@arg {String} method the type of URL-changing method to use
at the end of a transition. Accepted values are 'replace',
falsy values, or any other non-falsy value (which is
interpreted as an updateURL transition).
@return {Transition} this transition
*/
method(method: string): EmberStates.Transition;
/**
Fires an event on the current list of resolved/resolving
handlers within this transition. Useful for firing events
on route hierarchies that haven't fully been entered yet.
Note: This method is also aliased as `send`
@arg {Boolean} [ignoreFailure=false] a boolean specifying whether unhandled events throw an error
@arg {String} name the name of the event to fire
*/
trigger(ignoreFailure:boolean, eventName: string): void;
/**
Fires an event on the current list of resolved/resolving
handlers within this transition. Useful for firing events
on route hierarchies that haven't fully been entered yet.
Note: This method is also aliased as `send`
@arg {String} name the name of the event to fire
*/
trigger(eventName: string): void;
/**
Transitions are aborted and their promises rejected
when redirects occur; this method returns a promise
that will follow any redirects that occur and fulfill
with the value fulfilled by any redirecting transitions
that occur.
@return {Promise} a promise that fulfills with the same
value that the final redirecting transition fulfills with
*/
followRedirects(): Ember.RSVP.Promise;
}
}
@@ -61,7 +193,7 @@ interface String {
}
interface Array<T> {
constructor(arr: any[]);
constructor(arr: any[]): void;
activate(): void;
addArrayObserver(target: any, opts?: EnumerableConfigurationOptions): any[];
addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): any[];
@@ -88,16 +220,40 @@ interface Array<T> {
every(callback: Function, target?: any): boolean;
everyBy(key: string, value?: string): boolean;
everyProperty(key: string, value?: any): boolean;
filter(callback: Function, target: any): any[];
filter(callback: Function, target?: any): any[];
filterBy(key: string, value?: string): any[];
find(callback: Function, target: any): any;
/**
Returns the first item in the array for which the callback returns true.
This method works similar to the `filter()` method defined in JavaScript 1.6
except that it will stop working on the array once a match is found.
The callback method you provide should have the following signature (all
parameters are optional):
```javascript
function(item, index, enumerable);
```
- `item` is the current item in the iteration.
- `index` is the current index in the iteration.
- `enumerable` is the enumerable object itself.
It should return the `true` to include the item in the results, `false`
otherwise.
Note that in addition to a callback, you can also pass an optional target
object that will be set as `this` on the context. This is a good way
to give your iterator function access to the current object.
@function find
@arg callback The callback to execute
@arg {Object} [target] The target object to use
@return {Object} Found item or `undefined`.
*/
find(callback: Function, target?: any): any;
findBy(key: string, value?: string): any;
forEach(callback: Function, target?: any): any;
getEach(key: string): any[];
indexOf(object: any, startAt: number): number;
indexOf(object: any, startAt?: number): number;
insertAt(idx: number, object: any): any[];
invoke(methodName: string, ...args: any[]): any[];
lastIndexOf(object: any, startAt: number): number;
lastIndexOf(object: any, startAt?: number): number;
map(callback: Function, target?: any): any[];
mapBy(key: string): any[];
nextObject(index: number, previousObject: any, context: any): any;
objectAt(idx: number): any;
@@ -111,7 +267,7 @@ interface Array<T> {
removeArrayObserver(target: any, opts: EnumerableConfigurationOptions): any[];
removeAt(start: number, len: number): any;
removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): any[];
replace(idx: number, amt: number, objects: any[]);
replace(idx: number, amt: number, objects: any[]): void;
reverseObjects(): any[];
setEach(key: string, value?: any): any;
setObjects(objects: any[]): any[];
@@ -154,6 +310,9 @@ interface Array<T> {
toggleProperty(keyName: string): any;
copy(deep: boolean): any[];
frozenCopy(): any[];
// 1.3
isAny(key: string, value?: string): boolean;
isEvery(key: string, value?: string): boolean;
}
interface ApplicationCreateArguments {
@@ -175,7 +334,7 @@ interface ApplicationInitializerArguments {
}
interface ApplicationInitializerFunction {
(container: Ember.Container, application: Ember.Application);
(container: Ember.Container, application: Ember.Application): void;
}
interface CoreObjectArguments {
@@ -202,11 +361,11 @@ interface ItemIndexEnumerableCallbackTarget {
}
interface ItemIndexEnumerableCallback {
(item: any, index: number, enumerable: Ember.Enumerable);
(item: any, index: number, enumerable: Ember.Enumerable): void;
}
interface ReduceCallback {
(previousValue: any, item: any, index: number, enumerable: Ember.Enumerable);
(previousValue: any, item: any, index: number, enumerable: Ember.Enumerable): void;
}
interface TransitionsHash {
@@ -233,10 +392,10 @@ interface RenderOptions {
}
interface ModifyObserver {
(obj: any, path: string, target: any, method?: Function);
(obj: any, path: string, target: any, method?: string);
(obj: any, path: string, func: Function, method?: Function);
(obj: any, path: string, func: Function, method?: string);
(obj: any, path: string, target: any, method?: Function): void;
(obj: any, path: string, target: any, method?: string): void;
(obj: any, path: string, func: Function, method?: Function): void;
(obj: any, path: string, func: Function, method?: string): void;
}
declare module Ember {
@@ -399,7 +558,7 @@ declare module Ember {
everyProperty(key: string, value?: string): boolean;
filter(callback: Function, target: any): any[];
filterBy(key: string, value?: string): any[];
find(callback: Function, target: any): any;
find(callback: Function, target?: any): any;
findBy(key: string, value?: string): any;
forEach(callback: Function, target?: any): any;
getEach(key: string): any[];
@@ -495,7 +654,7 @@ declare module Ember {
static isClass: boolean;
static isMethod: boolean;
addArrayObserver(target: any, opts?: EnumerableConfigurationOptions): any[];
addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): any[];
addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable;
any(callback: Function, target?: any): boolean;
anyBy(key: string, value?: string): boolean;
arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): any[];
@@ -512,10 +671,10 @@ declare module Ember {
enumerableContentDidChange(removing: Enumerable, adding: number): any;
enumerableContentDidChange(removing: number, adding: Enumerable): any;
enumerableContentDidChange(removing: Enumerable, adding: Enumerable): any;
enumerableContentWillChange(removing: number, adding: number): any[];
enumerableContentWillChange(removing: Enumerable, adding: number): any[];
enumerableContentWillChange(removing: number, adding: Enumerable): any[];
enumerableContentWillChange(removing: Enumerable, adding: Enumerable): any[];
enumerableContentWillChange(removing: number, adding: number): Enumerable;
enumerableContentWillChange(removing: Enumerable, adding: number): Enumerable;
enumerableContentWillChange(removing: number, adding: Enumerable): Enumerable;
enumerableContentWillChange(removing: Enumerable, adding: Enumerable): Enumerable;
every(callback: Function, target?: any): boolean;
everyBy(key: string, value?: string): boolean;
everyProperty(key: string, value?: string): boolean;
@@ -543,7 +702,7 @@ declare module Ember {
rejectBy(key: string, value?: string): any[];
removeArrayObserver(target: any, opts: EnumerableConfigurationOptions): any[];
removeAt(start: number, len: number): any;
removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): any[];
removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable;
replace(idx: number, amt: number, objects: any[]): any;
replaceContent(idx: number, amt: number, objects: any[]): void;
reverseObjects(): any[];
@@ -553,10 +712,10 @@ declare module Ember {
slice(beginIndex?: number, endIndex?: number): any[];
some(callback: Function, target?: any): boolean;
toArray(): any[];
uniq(): any[];
uniq(): Enumerable;
unshiftObject(object: any): any;
unshiftObjects(objects: any[]): any[];
without(value: any): any[];
without(value: any): Enumerable;
'[]': any[];
'@each': EachProxy;
Boolean: boolean;
@@ -565,9 +724,9 @@ declare module Ember {
lastObject: any;
length: number;
addObject(object: any): any;
addObjects(objects: Enumerable): any[];
addObjects(objects: Enumerable): MutableEnumberable;
removeObject(object: any): any;
removeObjects(objects: Enumerable): any[];
removeObjects(objects: Enumerable): MutableEnumberable;
}
var BOOTED: boolean;
/**
@@ -958,8 +1117,9 @@ declare module Ember {
/**
A subclass of the JavaScript Error object for use in Ember.
**/
// Restore this to 'typeof Error' when https://github.com/Microsoft/TypeScript/issues/983 is resolved
// ReSharper disable once DuplicatingLocalDeclaration
var Error: typeof Error;
var Error: any; // typeof Error;
/**
Handles delegating browser events to their corresponding Ember.Views. For example, when you click on
a view, Ember.EventDispatcher ensures that that view's mouseDown method gets called.
@@ -1001,8 +1161,8 @@ declare module Ember {
module Handlebars {
function compile(string: string): Function;
function get(root: any, path: string, options?: {}): any;
function helper(name: string, func: Function, dependentKeys: string): void;
function helper(name: string, view: View, dependentKeys: string): void;
function helper(name: string, func: Function, dependentKeys?: string): void;
function helper(name: string, view: View, dependentKeys?: string): void;
class helpers {
action(actionName: string, context: any, options?: {}): void;
bindAttr(options?: {}): string;
@@ -1307,7 +1467,7 @@ declare module Ember {
constructor(arr: any[]);
static activate(): void;
addArrayObserver(target: any, opts?: EnumerableConfigurationOptions): any[];
addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): any[];
addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable;
any(callback: Function, target?: any): boolean;
anyBy(key: string, value?: string): boolean;
arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): any[];
@@ -1324,10 +1484,10 @@ declare module Ember {
enumerableContentDidChange(removing: Enumerable, adding: number): any;
enumerableContentDidChange(removing: number, adding: Enumerable): any;
enumerableContentDidChange(removing: Enumerable, adding: Enumerable): any;
enumerableContentWillChange(removing: number, adding: number): any[];
enumerableContentWillChange(removing: Enumerable, adding: number): any[];
enumerableContentWillChange(removing: number, adding: Enumerable): any[];
enumerableContentWillChange(removing: Enumerable, adding: Enumerable): any[];
enumerableContentWillChange(removing: number, adding: number): Enumerable;
enumerableContentWillChange(removing: Enumerable, adding: number): Enumerable;
enumerableContentWillChange(removing: number, adding: Enumerable): Enumerable;
enumerableContentWillChange(removing: Enumerable, adding: Enumerable): Enumerable;
every(callback: Function, target?: any): boolean;
everyBy(key: string, value?: string): boolean;
everyProperty(key: string, value?: any): boolean;
@@ -1354,7 +1514,7 @@ declare module Ember {
rejectBy(key: string, value?: string): any[];
removeArrayObserver(target: any, opts: EnumerableConfigurationOptions): any[];
removeAt(start: number, len: number): any;
removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): any[];
removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable;
replace(idx: number, amt: number, objects: any[]): any;
reverseObjects(): any[];
setEach(key: string, value?: any): any;
@@ -1363,10 +1523,10 @@ declare module Ember {
slice(beginIndex?: number, endIndex?: number): any[];
some(callback: Function, target?: any): boolean;
toArray(): any[];
uniq(): any[];
uniq(): Enumerable;
unshiftObject(object: any): any;
unshiftObjects(objects: any[]): any[];
without(value: any): any[];
without(value: any): Enumerable;
'[]': any[];
'@each': EachProxy;
Boolean: boolean;
@@ -1375,30 +1535,30 @@ declare module Ember {
lastObject: any;
length: number;
addObject(object: any): any;
addObjects(objects: Enumerable): any[];
addObjects(objects: Enumerable): MutableEnumberable;
removeObject(object: any): any;
removeObjects(objects: Enumerable): any[];
removeObjects(objects: Enumerable): MutableEnumberable;
addObserver: ModifyObserver;
beginPropertyChanges(): any[];
beginPropertyChanges(): Observable;
cacheFor(keyName: string): any;
decrementProperty(keyName: string, decrement?: number): number;
endPropertyChanges(): any[];
endPropertyChanges(): Observable;
get(keyName: string): any;
getProperties(...args: string[]): {};
getProperties(keys: string[]): {};
getWithDefault(keyName: string, defaultValue: any): any;
hasObserverFor(key: string): boolean;
incrementProperty(keyName: string, increment?: number): number;
notifyPropertyChange(keyName: string): any[];
propertyDidChange(keyName: string): any[];
propertyWillChange(keyName: string): any[];
removeObserver(key: string, target: any, method: string): Observable;
removeObserver(key: string, target: any, method: Function): Observable;
set(keyName: string, value: any): any[];
setProperties(hash: {}): any[];
notifyPropertyChange(keyName: string): Observable;
propertyDidChange(keyName: string): Observable;
propertyWillChange(keyName: string): Observable;
removeObserver(key: string, target: any, method: string): void;
removeObserver(key: string, target: any, method: Function): void;
set(keyName: string, value: any): Observable;
setProperties(hash: {}): Observable;
toggleProperty(keyName: string): any;
copy(deep: boolean): any[];
frozenCopy(): any[];
copy(deep: boolean): Copyable;
frozenCopy(): Copyable;
}
class NoneLocation extends Object {
static detect(obj: any): boolean;
@@ -1422,6 +1582,7 @@ declare module Ember {
Creates a subclass of the Object class.
**/
static extend<T>(arguments?: CoreObjectArguments): T;
static extend<T>(mixins? : Mixin, arguments?: CoreObjectArguments): T;
/**
Creates an instance of the class.
@param arguments A hash containing values with which to initialize the newly instantiated object.
@@ -1522,11 +1683,14 @@ declare module Ember {
notifyPropertyChange(keyName: string): Observable;
propertyDidChange(keyName: string): Observable;
propertyWillChange(keyName: string): Observable;
removeObserver(key: string, target: {}, method: string): Observable;
removeObserver(key: string, target: {}, method: Function): Observable;
removeObserver(key: string, target: {}, method: string): void;
removeObserver(key: string, target: {}, method: Function): void;
set(keyName: string, value: any): Observable;
setProperties(hash: {}): Observable;
toggleProperty(keyName: string): any;
/**
Set the value of a boolean property to the opposite of its current value.
*/
toggleProperty(keyName: string): boolean;
}
class OrderedSet {
add(obj: any): void;
@@ -1596,7 +1760,7 @@ declare module Ember {
serialize(model: {}, params: string[]): string;
setupController(controller: Controller, model: {}): void;
// ReSharper disable once InconsistentNaming
transitionTo(name: string, ...object: any[]): void;
transitionTo(name: string, ...object: any[]): EmberStates.Transition;
actions: ActionsHash;
}
class Router extends Object {
@@ -2363,9 +2527,9 @@ declare module Em {
var copy: typeof Ember.copy;
var create: typeof Ember.create;
var debug: typeof Ember.debug;
var defineProperty: typeof defineProperty;
var deprecate: typeof deprecate;
var deprecateFunc: typeof deprecateFunc;
var defineProperty: typeof Ember.defineProperty;
var deprecate: typeof Ember.deprecate;
var deprecateFunc: typeof Ember.deprecateFunc;
var destroy: typeof Ember.destroy;
var empty: typeof deprecateFunc;
var endPropertyChanges: typeof Ember.endPropertyChanges;
@@ -2382,7 +2546,248 @@ declare module Em {
var handleErrors: typeof Ember.handleErrors;
var hasListeners: typeof Ember.hasListeners;
var hasOwnProperty: typeof Ember.hasOwnProperty;
var immediateObserver: typeof immediateObserver;
var immediateObserver: typeof Ember.immediateObserver;
var imports: typeof Ember.imports;
var inspect: typeof Ember.inspect;
var instrument: typeof Ember.instrument;
var isArray: typeof Ember.isArray;
var isEmpty: typeof Ember.isEmpty;
var isEqual: typeof Ember.isEqual;
var isGlobalPath: typeof Ember.isGlobalPath;
var isNamespace: typeof Ember.isNamespace;
var isNone: typeof Ember.isNone;
var isPrototypeOf: typeof Ember.isPrototypeOf;
var isWatching: typeof Ember.isWatching;
var keys: typeof Ember.keys;
var listenersDiff: typeof Ember.listenersDiff;
var listenersFor: typeof Ember.listenersFor;
var listenersUnion: typeof Ember.listenersUnion;
var lookup: typeof Ember.lookup;
var makeArray: typeof Ember.makeArray;
var merge: typeof Ember.merge;
var meta: typeof Ember.meta;
var metaPath: typeof Ember.metaPath;
var mixin: typeof Ember.mixin;
var none: typeof Ember.none;
var normalizeTuple: typeof Ember.normalizeTuple;
var observer: typeof Ember.observer;
var observersFor: typeof Ember.observersFor;
var onLoad: typeof Ember.onLoad;
var oneWay: typeof Ember.oneWay;
var onError: typeof Ember.onError;
var overrideChains: typeof Ember.overrideChains;
var platform: typeof Ember.platform;
var propertyDidChange: typeof Ember.propertyDidChange;
var propertyIsEnumerable: typeof Ember.propertyIsEnumerable;
var propertyWillChange: typeof Ember.propertyWillChange;
var removeBeforeObserver: typeof Ember.removeBeforeObserver;
var removeChainWatcher: typeof Ember.removeChainWatcher;
var removeListener: typeof Ember.removeListener;
var removeObserver: typeof Ember.removeObserver;
var required: typeof Ember.required;
var rewatch: typeof Ember.rewatch;
var run: typeof Ember.run;
var runLoadHooks: typeof Ember.runLoadHooks;
var sendEvent: typeof Ember.sendEvent;
var set: typeof Ember.set;
var setMeta: typeof Ember.setMeta;
var setPath: typeof Ember.setPath;
var setProperties: typeof Ember.setProperties;
var subscribe: typeof Ember.subscribe;
var toLocaleString: typeof Ember.toLocaleString;
var toString: typeof Ember.toString;
var tryCatchFinally: typeof Ember.tryCatchFinally;
var tryFinally: typeof Ember.tryFinally;
var tryInvoke: typeof Ember.tryInvoke;
var trySet: typeof Ember.trySet;
var trySetPath: typeof Ember.trySetPath;
var typeOf: typeof Ember.typeOf;
var unwatch: typeof Ember.unwatch;
var unwatchKey: typeof Ember.unwatchKey;
var unwatchPath: typeof Ember.unwatchPath;
var uuid: typeof Ember.uuid;
var valueOf: typeof Ember.valueOf;
var warn: typeof Ember.warn;
var watch: typeof Ember.watch;
var watchKey: typeof Ember.watchKey;
var watchPath: typeof Ember.watchPath;
var watchedEvents: typeof Ember.watchedEvents;
var wrap: typeof Ember.wrap;
}
/**
* External ambient module - to allow "import Ember = require('Ember');" to work correctly
*/
declare module "Ember" {
var $: typeof Ember.$;
var A: typeof Ember.A;
class ActionHandlerMixin extends Ember.ActionHandlerMixin { }
class Application extends Ember.Application { }
class Array extends Ember.Array { }
class ArrayController extends Ember.ArrayController { }
var ArrayPolyfills: typeof Ember.ArrayPolyfills;
class ArrayProxy extends Ember.ArrayProxy { }
var BOOTED: typeof Ember.BOOTED;
class Binding extends Ember.Binding { }
class Button extends Ember.Button { }
class Checkbox extends Ember.Checkbox { }
class CollectionView extends Ember.CollectionView { }
class Comparable extends Ember.Comparable { }
class Component extends Ember.Component { }
class ComputedProperty extends Ember.ComputedProperty { }
class Container extends Ember.Container { }
class ContainerView extends Ember.ContainerView { }
class Controller extends Ember.Controller { }
class ControllerMixin extends Ember.ControllerMixin { }
class Copyable extends Ember.Copyable { }
class CoreObject extends Ember.CoreObject { }
class CoreView extends Ember.CoreView { }
class DAG extends Ember.DAG { }
var DEFAULT_GETTER_FUNCTION: typeof Ember.DEFAULT_GETTER_FUNCTION;
class DefaultResolver extends Ember.DefaultResolver { }
class Deffered extends Ember.Deferred { }
class DeferredMixin extends Ember.DeferredMixin { }
class Descriptor extends Ember.Descriptor { }
var EMPTY_META: typeof Ember.EMPTY_META;
var ENV: typeof Ember.ENV;
var EXTEND_PROTOTYPES: typeof Ember.EXTEND_PROTOTYPES;
class EachProxy extends Ember.EachProxy { }
class Enumerable extends Ember.Enumerable { }
var EnumerableUtils: typeof Ember.EnumerableUtils;
var Error: typeof Ember.Error;
class EventDispatcher extends Ember.EventDispatcher { }
class Evented extends Ember.Evented { }
var FROZEN_ERROR: typeof Ember.FROZEN_ERROR;
class Freezable extends Ember.Freezable { }
var GUID_KEY: typeof Ember.GUID_KEY;
module Handlebars {
var compile: typeof Ember.Handlebars.compile;
var get: typeof Ember.Handlebars.get;
var helper: typeof Ember.Handlebars.helper;
class helpers extends Ember.Handlebars.helpers { }
var precompile: typeof Ember.Handlebars.precompile;
var registerBoundHelper: typeof Ember.Handlebars.registerBoundHelper;
class Compiler extends Ember.Handlebars.Compiler { }
class JavaScriptCompiler extends Ember.Handlebars.JavaScriptCompiler { }
var registerHelper: typeof Ember.Handlebars.registerHelper;
var registerPartial: typeof Ember.Handlebars.registerPartial;
var K: typeof Ember.Handlebars.K;
var createFrame: typeof Ember.Handlebars.createFrame;
var Exception: typeof Ember.Handlebars.Exception;
class SafeString extends Ember.Handlebars.SafeString { }
var parse: typeof Ember.Handlebars.parse;
var print: typeof Ember.Handlebars.print;
var logger: typeof Ember.Handlebars.logger;
var log: typeof Ember.Handlebars.log;
}
class HashLocation extends Ember.HashLocation { }
class HistoryLocation extends Ember.HistoryLocation { }
var IS_BINDING: typeof Ember.IS_BINDING;
class Instrumentation extends Ember.Instrumentation { }
var K: typeof Ember.K;
var LOG_BINDINGS: typeof Ember.LOG_BINDINGS;
var LOG_STACKTRACE_ON_DEPRECATION: typeof Ember.LOG_STACKTRACE_ON_DEPRECATION;
var LOG_VERSION: typeof Ember.LOG_VERSION;
class LinkView extends Ember.LinkView { }
class Location extends Ember.Location { }
var Logger: typeof Ember.Logger;
var MANDATORY_SETTER_FUNCTION: typeof Ember.MANDATORY_SETTER_FUNCTION;
var META_KEY: typeof Ember.META_KEY;
class Map extends Ember.Map { }
class MapWithDefault extends Ember.MapWithDefault { }
class Mixin extends Ember.Mixin { }
class MutableArray extends Ember.MutableArray { }
class MutableEnumerable extends Ember.MutableEnumberable { }
var NAME_KEY: typeof Ember.NAME_KEY;
class Namespace extends Ember.Namespace { }
class NativeArray extends Ember.NativeArray { }
class NoneLocation extends Ember.NoneLocation { }
var ORDER_DEFINITION: typeof Ember.ORDER_DEFINITION;
class Object extends Ember.Object { }
class ObjectController extends Ember.ObjectController { }
class ObjectProxy extends Ember.ObjectProxy { }
class Observable extends Ember.Observable { }
class OrderedSet extends Ember.OrderedSet { }
module RSVP {
class Promise extends Ember.RSVP.Promise { }
}
class RenderBuffer extends Ember.RenderBuffer { }
class Route extends Ember.Route { }
class Router extends Ember.Router { }
class RouterDSL extends Ember.RouterDSL { }
var SHIM_ES5: typeof Ember.SHIM_ES5;
var STRINGS: typeof Ember.STRINGS;
class Select extends Ember.Select { }
class SelectOption extends Ember.SelectOption { }
class Set extends Ember.Set { }
class SortableMixin extends Ember.SortableMixin { }
class State extends Ember.State { }
class StateManager extends Ember.StateManager { }
module String {
var camelize: typeof Ember.String.camelize;
var capitalize: typeof Ember.String.capitalize;
var classify: typeof Ember.String.classify;
var dasherize: typeof Ember.String.dasherize;
var decamelize: typeof Ember.String.decamelize;
var fmt: typeof Ember.String.fmt;
var htmlSafe: typeof Ember.String.htmlSafe;
var loc: typeof Ember.String.loc;
var underscore: typeof Ember.String.underscore;
var w: typeof Ember.String.w;
}
var TEMPLATES: typeof Ember.TEMPLATES;
class TargetActionSupport extends Ember.TargetActionSupport { }
class Test extends Ember.Test { }
class TextArea extends Ember.TextArea { }
class TextField extends Ember.TextField { }
class TextSupport extends Ember.TextSupport { }
var VERSION: typeof Ember.VERSION;
class View extends Ember.View { }
class ViewTargetActionSupport extends Ember.ViewTargetActionSupport { }
var ViewUtils: typeof Ember.ViewUtils;
var addBeforeObserver: typeof Ember.addBeforeObserver;
var addListener: typeof Ember.addListener;
var addObserver: typeof Ember.addObserver;
var alias: typeof Ember.alias;
var aliasMethod: typeof Ember.aliasMethod;
var anyUnprocessedMixins: typeof Ember.anyUnprocessedMixins;
var assert: typeof Ember.assert;
var beforeObserver: typeof Ember.beforeObserver;
var beforeObserversFor: typeof Ember.beforeObserversFor;
var beginPropertyChanges: typeof Ember.beginPropertyChanges;
var bind: typeof Ember.bind;
var cacheFor: typeof Ember.cacheFor;
var canInvoke: typeof Ember.canInvoke;
var changeProperties: typeof Ember.changeProperties;
var compare: typeof Ember.compare;
var computed: typeof Ember.computed;
var config: typeof Ember.config;
var controllerFor: typeof Ember.controllerFor;
var copy: typeof Ember.copy;
var create: typeof Ember.create;
var debug: typeof Ember.debug;
var defineProperty: typeof Ember.defineProperty;
var deprecate: typeof Ember.deprecate;
var deprecateFunc: typeof Ember.deprecateFunc;
var destroy: typeof Ember.destroy;
var empty: typeof Ember.deprecateFunc;
var endPropertyChanges: typeof Ember.endPropertyChanges;
var exports: typeof Ember.exports;
var finishChains: typeof Ember.finishChains;
var flushPendingChains: typeof Ember.flushPendingChains;
var generateController: typeof Ember.generateController;
var generateGuid: typeof Ember.generateGuid;
var get: typeof Ember.get;
var getMeta: typeof Ember.getMeta;
var getPath: typeof Ember.getPath;
var getWithDefault: typeof Ember.getWithDefault;
var guidFor: typeof Ember.guidFor;
var handleErrors: typeof Ember.handleErrors;
var hasListeners: typeof Ember.hasListeners;
var hasOwnProperty: typeof Ember.hasOwnProperty;
var immediateObserver: typeof Ember.immediateObserver;
var imports: typeof Ember.imports;
var inspect: typeof Ember.inspect;
var instrument: typeof Ember.instrument;
+2 -2
View File
@@ -54,12 +54,12 @@ declare module Promise {
* the array passed to all can be a mixture of promise-like objects and other objects.
* The fulfillment value is an array (in order) of fulfillment values. The rejection value is the first rejection value.
*/
function all<R>(promises: Promise<R>[]): Promise<R[]>;
function all<R>(promises: (R | Thenable<R>)[]): Promise<R[]>;
/**
* Make a Promise that fulfills when any item fulfills, and rejects if any item rejects.
*/
function race<R>(promises: Promise<R>[]): Promise<R>;
function race<R>(promises: (R | Thenable<R>)[]): Promise<R>;
}
declare module 'es6-promise' {
+5
View File
@@ -0,0 +1,5 @@
/// <reference path="escape-latex.d.ts" />
import lescape = require('escape-latex');
lescape("String to be escaped here #yolo");
+9
View File
@@ -0,0 +1,9 @@
// Type definitions for escape-latex 0.1.2
// Project: https://github.com/dangmai/escape-latex
// Definitions by: Oliver Schneider <https://github.com/olsio>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module 'escape-latex' {
function lescape(texString: string): string;
export = lescape;
}
+65
View File
@@ -0,0 +1,65 @@
///<reference path='eventemitter3.d.ts' />
'use strict';
import EventEmitter = require('eventemitter3');
class EventEmitterTest {
v: EventEmitter;
constructor() {
this.v = new EventEmitter();
this.v = new EventEmitter.EventEmitter();
this.v = new EventEmitter.EventEmitter2();
this.v = new EventEmitter.EventEmitter3();
}
listeners() {
var v1: Function[] = this.v.listeners('click');
}
emit() {
var v1: boolean = this.v.emit('click');
var v2: boolean = this.v.emit('click', 1);
var v3: boolean = this.v.emit('click', 1, '1');
var v4: boolean = this.v.emit('click', 1, '1', true);
var v5: boolean = this.v.emit('click', 1, '1', true, new Date());
}
on() {
var fn = () => console.log(1);
var v1: EventEmitter = this.v.on('click', fn);
var v2: EventEmitter = this.v.on('click', fn, this);
}
once() {
var fn = () => console.log(1);
var v1: EventEmitter = this.v.once('click', fn);
var v2: EventEmitter = this.v.once('click', fn, this);
}
removeListener() {
var fn = () => console.log(1);
var v1: EventEmitter = this.v.removeListener('click', fn);
var v2: EventEmitter = this.v.removeListener('click', fn, true);
}
removeAllListeners() {
var v1: EventEmitter = this.v.removeAllListeners('click');
}
off() {
var fn = () => console.log(1);
var v1: EventEmitter = this.v.off('click', fn);
var v2: EventEmitter = this.v.off('click', fn, true);
}
addListener() {
var fn = () => console.log(1);
var v1: EventEmitter = this.v.addListener('click', fn);
var v2: EventEmitter = this.v.addListener('click', fn, this);
}
setMaxListeners() {
var v1: EventEmitter = this.v.setMaxListeners();
}
}
+100
View File
@@ -0,0 +1,100 @@
// Type definitions for EventEmitter3 0.1.6
// Project: https://github.com/primus/eventemitter3
// Definitions by: Yuichi Murata <https://github.com/mrk21>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module EventEmitter3 {
export class EventEmitter {
/**
* Minimal EventEmitter interface that is molded against the Node.js
* EventEmitter interface.
*
* @constructor
* @api public
*/
constructor();
/**
* Return a list of assigned event listeners.
*
* @param {String} event The events that should be listed.
* @returns {Array}
* @api public
*/
listeners(event: string): Function[];
/**
* Emit an event to all registered event listeners.
*
* @param {String} event The name of the event.
* @returns {Boolean} Indication if we've emitted an event.
* @api public
*/
emit(event: string, ...args: any[]): boolean;
/**
* Register a new EventListener for the given event.
*
* @param {String} event Name of the event.
* @param {Functon} fn Callback function.
* @param {Mixed} context The context of the function.
* @api public
*/
on(event: string, fn: Function, context?: any): EventEmitter;
/**
* Add an EventListener that's only called once.
*
* @param {String} event Name of the event.
* @param {Function} fn Callback function.
* @param {Mixed} context The context of the function.
* @api public
*/
once(event: string, fn: Function, context?: any): EventEmitter;
/**
* Remove event listeners.
*
* @param {String} event The event we want to remove.
* @param {Function} fn The listener that we need to find.
* @param {Boolean} once Only remove once listeners.
* @api public
*/
removeListener(event: string, fn: Function, once?: boolean): EventEmitter;
/**
* Remove all listeners or only the listeners for the specified event.
*
* @param {String} event The event want to remove all listeners for.
* @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 module EventEmitter {
//
// Expose the module.
//
export class EventEmitter extends EventEmitter3.EventEmitter {}
export class EventEmitter2 extends EventEmitter3.EventEmitter {}
export class EventEmitter3 extends EventEmitter3.EventEmitter {}
}
}
declare module 'eventemitter3' {
//
// Expose the module.
//
class EventEmitter extends EventEmitter3.EventEmitter {}
export = EventEmitter;
}
+123
View File
@@ -0,0 +1,123 @@
/// <reference path="expect.js.d.ts" />
import expect = require("expect.js");
function test_expect() {
expect();
expect(1);
expect(true);
expect({});
expect(0);
}
function test_expect_properties() {
expect(0).be.an;
expect(0).have.own;
expect(0).not.be.an;
expect(0).not.have.own;
expect(0).not.include;
expect(0).not.only.have.own;
expect(0).not.to.be;
expect(0).not.to.have.own;
expect(0).not.to.include;
expect(0).not.to.only.have.own;
expect(0).only.have.own;
expect(0).to.be.an;
expect(0).to.have.own;
expect(0).to.include;
expect(0).to.not.be.an;
expect(0).to.not.have.own;
expect(0).to.not.include;
expect(0).to.not.only.have.own;
expect(0).to.only.have.own;
expect(0).be;
}
function test_ok() {
expect(true).to.be.ok();
}
function test_be() {
expect(1).to.be(1);
}
function test_equal() {
expect(1).to.equal(1);
}
function test_eql() {
expect({ a: 'b' }).to.eql({ a: 'b' });
}
function test_a() {
// string
expect(5).to.be.a('number');
expect([]).to.be.an('array');
// constructors
expect(5).to.be.a(Number);
expect([]).to.be.an(Array);
}
function test_match() {
expect('1.2.3').to.match(/[0-9]+\.[0-9]+\.[0-9]+/);
}
function test_contain() {
// string
expect('hello world').to.contain('world');
expect('hello world').to.string('world');
// any
expect([1, 2]).to.contain(1);
expect([1, 2]).to.string(1);
}
function test_length() {
expect([1,2,3]).to.have.length(3);
}
function test_empty() {
expect([]).to.be.empty();
}
function test_property() {
expect(window).to.have.property('expect');
expect(window).to.have.property('expect', expect);
}
function test_key() {
expect({ a: 'b' }).to.have.key('a');
expect({ a: 'b' }).to.include.key('a');
expect({ a: 'b', c: 'd' }).to.only.have.keys('a', 'c');
expect({ a: 'b', c: 'd' }).to.only.have.keys(['a', 'c']);
expect({ a: 'b', c: 'd' }).to.not.only.have.key('a');
}
function test_throwException() {
var fn = () => {};
expect(fn).to.throwError();
expect(fn).to.throwException(function (e) {
expect(e).to.be.a(SyntaxError);
});
expect(fn).to.throwException(/matches the exception message/);
expect(fn).to.not.throwException();
}
function test_within() {
expect(1).to.be.within(0, Infinity);
}
function test_greaterThan() {
expect(5).to.be.greaterThan(3);
expect(3).to.be.above(0);
}
function test_lessThan() {
expect(1).to.be.lessThan(3);
expect(0).to.be.below(3);
}
function test_fail() {
expect().fail();
expect().fail('Custom failure message');
}
+2 -2
View File
@@ -28,7 +28,7 @@ function test_expect_properties() {
expect(0).to.not.include;
expect(0).to.not.only.have.own;
expect(0).to.only.have.own;
expect(0).be
expect(0).be;
}
function test_ok() {
@@ -118,4 +118,4 @@ function test_lessThan() {
function test_fail() {
expect().fail();
expect().fail('Custom failure message');
}
}
+6
View File
@@ -214,3 +214,9 @@ declare module Expect {
own: Assertion;
}
}
declare module "expect.js" {
export = expect;
}
+1 -1
View File
@@ -107,7 +107,7 @@ declare module jquery.flot {
ticks?: any; // null or number or ticks array or (fn: axis -> ticks array)
tickSize?: any; // number or array
minTickSize?: any; // number or array
tickFormatter?: (t: number) => string; // (fn: number, object -> string) or string
tickFormatter?: (t: number, a?: axis) => string; // (fn: number, object -> string) or string
tickDecimals?: number;
labelWidth?: number;
+164
View File
@@ -0,0 +1,164 @@
///<reference path='fluxxor.d.ts' />
import React = require('react');
import Fluxxor = require('fluxxor');
class DispatcherTest {
v: Fluxxor.Dispatcher;
constructor() {
var stores: Fluxxor.Store[];
this.v = new Fluxxor.Dispatcher(stores);
}
addStore() {
var store: Fluxxor.Store;
var v1: void = this.v.addStore('mystore', store);
}
dispatch() {
var fn = () => console.log(1);
var v1: void = this.v.dispatch(fn);
}
doDispatchLoop() {
var fn = () => console.log(1);
var v1: void = this.v.doDispatchLoop(fn);
}
waitForStores() {
var store: Fluxxor.Store;
var fn = () => console.log(1);
var v1: void = this.v.waitForStores(store, ['mystore1', 'mystore2'], fn);
}
}
class FluxTest {
v: Fluxxor.Flux;
constructor() {
var stores: any;
var actions: any;
this.v = new Fluxxor.Flux(stores, actions);
}
props() {
var stores: any = this.v.stores;
var actions: any = this.v.actions;
}
addActions() {
var actions: any;
var v1: void = this.v.addActions(actions);
}
addAction() {
var fn = () => console.log(1);
// first form
var v1: void = this.v.addAction('action1', fn);
var v2: void = this.v.addAction('action1', 'action2', fn);
// second form
var v3: void = this.v.addAction(['action1'], fn);
var v4: void = this.v.addAction(['action1','action2'], fn);
}
store() {
var store1: any = this.v.store('mystore');
}
addStore() {
var store: Fluxxor.Store;
var v1: void = this.v.addStore('mystore', store);
}
addStores() {
var stores: any;
var v1: void = this.v.addStores(stores);
}
}
class StoreTest {
v: Fluxxor.Store;
bindActions() {
var fn = () => console.log(1);
// first form
var v1: void = this.v.bindActions('action1', fn);
var v2: void = this.v.bindActions(
'action1', fn,
'action2', fn
);
// second form
var v3: void = this.v.bindActions([
'action1', fn,
'action2', fn,
]);
}
waitFor() {
var fn = () => console.log(1);
var v1: void = this.v.waitFor(['mystore1','mystore2'], fn);
}
}
class ContextTest {
v: Fluxxor.Context;
props() {
var v1: Fluxxor.Flux = this.v.flux;
}
}
class FluxMixinTest {
v: Fluxxor.FluxMixin;
constructor() {
this.v = Fluxxor.FluxMixin(React);
}
getFlux() {
var v1: Fluxxor.Flux = this.v.getFlux();
}
}
class FluxChildMixinTest {
v: Fluxxor.FluxChildMixin;
constructor() {
this.v = Fluxxor.FluxChildMixin(React);
}
getFlux() {
var v1: Fluxxor.Flux = this.v.getFlux();
}
}
class StoreWatchMixinTest<StoreState> {
v: Fluxxor.StoreWatchMixin<StoreState>;
constructor() {
this.v = Fluxxor.StoreWatchMixin<StoreState>('store1');
this.v = Fluxxor.StoreWatchMixin<StoreState>('store1','store2');
this.v = Fluxxor.StoreWatchMixin<StoreState>('store1','store2','store3');
}
getStateFromFlux() {
var v1: StoreState = this.v.getStateFromFlux();
}
}
new StoreWatchMixinTest();
new StoreWatchMixinTest<{ a: Fluxxor.Store; }>();
new StoreWatchMixinTest<{ b: Fluxxor.Store; }>();
function createStoreTest() {
var spec: Fluxxor.StoreSpec;
var Class: Fluxxor.StoreClass = Fluxxor.createStore(spec);
var store1: any = new Class();
var store2: any = new Class({value: 1});
}
var versionTest: string = Fluxxor.version;
+70
View File
@@ -0,0 +1,70 @@
// Type definitions for Fluxxor 1.5.2
// Project: https://github.com/BinaryMuse/fluxxor
// Definitions by: Yuichi Murata <https://github.com/mrk21>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
///<reference path='../react/react.d.ts' />
///<reference path='../eventemitter3/eventemitter3.d.ts' />
declare module Fluxxor {
class Dispatcher {
constructor(stores: any);
addStore(name: string, store: Store): void;
dispatch(action: Function): void;
doDispatchLoop(action: Function): void;
waitForStores(store: Store, stores: string[], fn: Function): void;
}
class Flux extends EventEmitter3.EventEmitter {
constructor(stores: any, actions: any);
addActions(actions: any): void;
addAction(...args: Array<string|Function>): void;
addAction(names: string[], action: Function): void;
store(name: string): any;
addStore(name: string, store: Store): void;
addStores(stores: any): void;
stores: any;
actions: any;
}
interface Store extends EventEmitter3.EventEmitter {
bindActions(...args: Array<string|Function>): void;
bindActions(args: Array<string|Function>): void;
waitFor(stores: string[], fn: Function): void;
}
interface StoreSpec {
initialize?(instance?: any, options?: {}): void;
actions?: any;
}
interface StoreClass {
new (options?: {}): any;
}
interface Context {
flux: Flux;
}
interface FluxMixin {
getFlux(): Flux;
}
interface FluxChildMixin {
getFlux(): Flux;
}
interface StoreWatchMixin<StoreState> {
getStateFromFlux(): StoreState;
}
function FluxMixin(React: React.Exports): FluxMixin;
function FluxChildMixin(React: React.Exports): FluxChildMixin;
function StoreWatchMixin<StoreState>(...storeNames: string[]): StoreWatchMixin<StoreState>;
function createStore(spec: StoreSpec): StoreClass;
var version: string;
}
declare module 'fluxxor' {
export = Fluxxor;
}
+18
View File
@@ -0,0 +1,18 @@
/// <reference path="google.picker.d.ts" />
var createPicker = () => {
var picker = new google.picker.PickerBuilder()
.addView(new google.picker.DocsUploadView())
.setOAuthToken("accessToken")
.setDeveloperKey("developerKey")
.setCallback((data:any) => {
var url = "nothing";
if (data[google.picker.Response.ACTION] == google.picker.Action.PICKED) {
var doc = data[google.picker.Response.DOCUMENTS][0];
url = doc[google.picker.Document.URL];
}
})
.setOrigin("origin")
.build();
picker.setVisible(true);
};
+224
View File
@@ -0,0 +1,224 @@
// Type definitions for Google Picker API
// Project: https://developers.google.com/picker/
// Definitions by: grapswiz <https://github.com/grapswiz>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module google {
module picker {
export class PickerBuilder {
constructor();
// Add a View to the navigation pane.
addView(viewOrId:any):PickerBuilder;
// Add a ViewGroup to the top-level navigation pane.
addViewGroup(viewGroup:any):PickerBuilder;
// Disable a picker feature.
disableFeature(feature:string):PickerBuilder;
// Enable a picker feature.
enableFeature(feature:string):PickerBuilder;
// Get the relay URL, used for gadgets.rpc.
getRelayUrl():string;
// Get the dialog title.
getTitle():string;
// Disable the title bar from being shown. To re-enable, call setTitle with a non-empty title or undefined.
hideTitleBar():PickerBuilder;
// Check if a picker Feature is enabled.
isFeatureEnabled(feature:string):boolean;
// Sets the Google Drive App ID needed to allow application to access the user's files via the Google Drive API.
setAppId(appId:string):PickerBuilder;
// Set the callback method called when the user picks and item (or items), or cancels. The callback method receives a single callback object. The structure of the callback object is described in the JSON Guide.
setCallback(method:Function):PickerBuilder;
// Sets the Browser API key obtained from Google Developers Console. See the Developer's Guide for details on how to obtain the Browser API key.
setDeveloperKey(key:string):PickerBuilder;
// Set the document.
setDocument(document:string):PickerBuilder;
// ISO 639 language code. If the language is not supported, en-US is used. This method provides an alternative to setting the locale at google.load() time. See the Developer's Guide for a list of supported locales.
setLocale(locale:string):PickerBuilder;
// Sets an OAuth token to use for authenticating the current user. Depending on the scope of the token, only certain views will display data. Valid scopes are Google Docs, Drive, Photos, YouTube.
setOAuthToken(token:string):PickerBuilder;
// Sets the origin of picker dialog. The origin should be set to the window.location.protocol + '//' + window.location.host of the top-most page, if your application is running in an iframe.
setOrigin(origin:string):PickerBuilder;
// Set the relay URL, used for gadgets.rpc.
setRelayUrl(url:string):PickerBuilder;
// Set the list of MIME types which will be selectable. Use commas to separate MIME types if more than one is required.
setSelectableMimeTypes(type:string):PickerBuilder;
// Set the preferred dialog size. The dialog will be auto-centered. It has a minimum size of (566,350) and a maximum size of (1051,650).
setSize():PickerBuilder;
// Set the dialog title.
setTitle(title:string):PickerBuilder;
// Specify an album ID for photo uploads. See Picasa Web Albums Data API documentation for more information about albums.
setUploadToAlbumId(albumId:string):PickerBuilder;
// Returns the URI generated by this builder.
toUri():string;
// Construct the Picker object. The Picker object is returned.
build():Picker;
}
/**
* Picker is the top level object representing the UI action with the user. These objects are not created directly, but instead use the PickerBuilder object.
*/
export interface Picker {
isVisible(): boolean;
setCallback():Picker;
setRelayUrl(url:string):Picker;
setVisible(visible:boolean):Picker;
}
/**
* Use DocsUploadView to upload documents to Google Drive.
*/
export class DocsUploadView {
constructor();
// Allows the user to select a folder in Google Drive to upload to.
setIncludeFolders(included:boolean):DocsUploadView;
// Sets the upload destination to the specified folder. This overrides ".setIncludeFolders" to false.
setParent(parentId:string):DocsUploadView;
}
/**
* DocsView is a subclass of View that can be used for Google Drive views.
*/
export class DocsView {
// Constructor. The ViewId must be one of the Google Drive views. Default is ViewId.DOCS.
constructor(viewId?:string);
// Show folders in the view items.
setIncludeFolders(included:boolean):DocsView;
// Allows the user to select a folder in Google Drive.
setSelectFolderEnabled(enabled:boolean):DocsView;
// Selects which mode the view will use to display the documents.
setMode(mode:string):DocsView;
// Filters the documents based on whether they are owned by the user, or shared with the user.
setOwnedByMe(me?:boolean):DocsView;
// Sets the initial parent folder to display.
setParent(parentId:string):DocsView;
// Filters the documents based on whether they are starred by the user.
setStarred(starred:boolean):DocsView;
}
/**
* DocsViewMode is an enumerated type for displaying data within a DocsView. Use these values in calls to DocsView.setMode.
*/
export var DocsViewMode:{
// Display documents in a thumbnail grid.
GRID: string;
// Display documents in a detailed list.
LIST: string;
};
export var Feature:{
// Show only documents owned by the user when showing items from Google Drive.
MINE_ONLY: string;
// Allow user to choose more than one item.
MULTISELECT_ENABLED: string;
// Hide the navigation pane. If the navigation pane is hidden, users can only select from the first view chosen.
NAV_HIDDEN: string;
// For photo uploads, controls whether per-photo selection (as opposed to per-album) selection is enabled.
SIMPLE_UPLOAD_ENABLED: string;
};
export var ViewId:{
DOCS: string;
DOCS_IMAGES: string;
DOCS_IMAGES_AND_VIDEOS: string;
DOCS_VIDEOS: string;
DOCUMENTS: string;
DRAWINGS: string;
FOLDERS: string;
FORMS: string;
IMAGE_SEARCH: string;
MAPS: string;
PDFS: string;
PHOTOS: string;
PHOTO_ALBUMS: string;
PHOTO_UPLOAD: string;
PRESENTATIONS: string;
RECENTLY_PICKED: string;
SPREADSHEETS: string;
VIDEO_SEARCH: string;
WEBCAM: string;
YOUTUBE: string;
};
export var Action:{
CANCEL: string;
PICKED: string;
};
/**
* Document is an enumerated type used to convey information about a specific picked item. Only fields which are relevant to the selected item are returned. This value will be in the Response.DOCUMENTS field in the callback data.
*/
export var Document:{
ADDRESS_LINES: string;
AUDIENCE: string;
DESCRIPTION: string;
DURATION: string;
EMBEDDABLE_URL: string;
ICON_URL: string;
ID: string;
IS_NEW: string;
LAST_EDITED_UTC: string;
LATITUDE: string;
LONGITUDE: string;
MIME_TYPE: string;
NAME: string;
NUM_CHILDREN: string;
PARENT_ID: string;
PHONE_NUMBERS: string;
SERVICE_ID: string;
THUMBNAILS: string;
TYPE: string;
URL: string;
};
/**
* Response is an enumerated type used to convey information about the user's picked items.
*/
export var Response:{
ACTION: string;
DOCUMENTS: string;
PARENTS: string;
VIEW: string;
};
export var Type:{
ALBUM: string;
DOCUMENT: string;
LOCATION: string;
PHOTO: string;
URL: string;
VIDEO: string;
};
}
}
+43
View File
@@ -722,6 +722,49 @@ declare module google {
width?: number;
}
//#endregion
//#region AnnotationChart
// https://developers.google.com/chart/interactive/docs/gallery/annotationchart
export class AnnotationChart extends CoreChartBase
{
draw(data: DataTable, options: AnnotationChartOptions): void;
draw(data: DataView, options: AnnotationChartOptions): void;
setVisibleChartRange(start: Date, end: Date): void;
getVisibleChartRange(): {start: Date; end: Date };
hideDataColumns(columnIndexes: number | number[]): void;
showDataColumns(columnIndexes: number | number[]): void;
}
// https://developers.google.com/chart/interactive/docs/gallery/annotationchart#Configuration_Options
export interface AnnotationChartOptions
{
allowHtml?: boolean;
allValuesSuffix?: string;
annotationsWidth?: number;
colors?: string[];
dateFormat?: string;
displayAnnotations?: boolean;
displayAnnotationsFilter?: boolean;
displayDateBarSeparator?: boolean;
displayExactValues?: boolean;
displayLegendDots?: boolean;
displayLegendValues?: boolean;
displayRangeSelector?: boolean;
displayZoomButtons?: boolean;
fill?: number;
legendPosition?: string;
max?: number;
min?: number;
numberFormats?: any;
scaleColumns?: number[];
scaleFormat?: string;
scaleType?: string;
thickness?: number;
zoomEndTime?: Date;
zoomStartTime?: Date;
}
//#endregion
//#region SteppedAreaChart
+16
View File
@@ -790,6 +790,22 @@ declare module grunt {
*/
registerMultiTask(taskName: string, taskFunction: Function): void
registerMultiTask(taskName: string, taskDescription: string, taskFunction: Function): void
/**
* Check with the name, if a task exists in the registered tasks.
* @param name The task name to check.
* @since 0.4.5
*/
exists(name: string): boolean;
/**
* Rename a task. This might be useful if you want to override the default behavior of a task, while retaining the old name.
* Note that if a task has been renamed, the this.name and this.nameArgs properties will change accordingly.
* @see ITask
* @param oldname The previous name of the task.
* @param newname The new name for the task.
*/
renameTask(oldname: string, newname: string): void
}
/**
+184
View File
@@ -0,0 +1,184 @@
// Type definitions for GSAP v1.16.0
// Project: http://greensock.com/
// Definitions by: VILIC VANE <https://vilic.github.io/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare class Animation {
/** Base class for all TweenLite, TweenMax, TimelineLite, and TimelineMax classes, providing core methods/properties/functionality, but there is no reason to create an instance of this class directly. */
constructor(duration?: number, vars?: any);
/** A place to store any data you want (initially populated with vars.data if it exists). */
data: any;
/** [Read-only] Parent timeline. */
timeline: SimpleTimeLine;
/** The vars object passed into the constructor which stores configuration variables like onComplete, onUpdate, etc. */
vars: any;
/** Gets or sets the animation's initial delay which is the length of time in seconds (or frames for frames-based tweens) before the animation should begin. */
delay(): number;
delay(value: number): Animation;
/** Gets or sets the animation's duration, not including any repeats or repeatDelays (which are only available in TweenMax and TimelineMax). */
duration(): number;
duration(value: number): Animation;
/** Gets or sets an event callback like "onComplete", "onUpdate", "onStart", "onReverseComplete" or "onRepeat" (onRepeat only applies to TweenMax or TimelineMax instances) along with any parameters that should be passed to that callback. */
eventCallback(type: string): Function;
eventCallback(type: string, callback: Function, params?: any[], scope?: any): Animation;
/** Clears any initialization data (like starting/ending values in tweens) which can be useful if, for example, you want to restart a tween without reverting to any previously recorded starting values. */
invalidate(): Animation;
/** Indicates whether or not the animation is currently active (meaning the virtual playhead is actively moving across this instance's time span and it is not paused, nor are any of its ancestor timelines). */
isActive(): boolean;
/** Kills the animation entirely or in part depending on the parameters. */
kill(vars?: any, target?: any): Animation;
/** Pauses the instance, optionally jumping to a specific time. */
pause(atTime?: any, suppressEvents?: boolean): Animation;
/** Gets or sets the animation's paused state which indicates whether or not the animation is currently paused. */
paused(): boolean;
paused(value: boolean): Animation;
/** Begins playing forward, optionally from a specific time (by default playback begins from wherever the playhead currently is). */
play(from?: any, suppressEvents?: boolean): Animation;
/** Gets or sets the animations's progress which is a value between 0 and 1 indicating the position of the virtual playhead (excluding repeats) where 0 is at the beginning, 0.5 is at the halfway point, and 1 is at the end (complete). */
progress(): number;
progress(value: number, suppressEvents?: boolean): Animation;
/** Restarts and begins playing forward from the beginning. */
restart(includeDelay?: boolean, suppressEvents?: boolean): Animation;
/** Resumes playing without altering direction (forward or reversed), optionally jumping to a specific time first. */
resume(from?: any, suppressEvents?: boolean): Animation;
/** Reverses playback so that all aspects of the animation are oriented backwards including, for example, a tween's ease. */
reverse(from?: any, suppressEvents?: boolean): Animation;
/** Gets or sets the animation's reversed state which indicates whether or not the animation should be played backwards. */
reversed(): boolean;
reversed(value: boolean): Animation;
/** Jumps to a specific time without affecting whether or not the instance is paused or reversed. */
seek(time: any, suppressEvents?: boolean): Animation;
/** Gets or sets the time at which the animation begins on its parent timeline (after any delay that was defined). */
startTime(): number;
startTime(value: number): Animation;
/** Gets or sets the local position of the playhead (essentially the current time), described in seconds (or frames for frames-based animations) which will never be less than 0 or greater than the animation's duration. */
time(): number;
time(value: number, suppressEvents?: boolean): Animation;
/** Factor that's used to scale time in the animation where 1 = normal speed (the default), 0.5 = half speed, 2 = double speed, etc. */
timeScale(): number;
timeScale(value: number): Animation;
/** Gets or sets the animation's total duration including any repeats or repeatDelays (which are only available in TweenMax and TimelineMax). */
totalDuration(): number;
totalDuration(value: number): Animation;
/** Gets or sets the animation's total progress which is a value between 0 and 1 indicating the position of the virtual playhead (including repeats) where 0 is at the beginning, 0.5 is at the halfway point, and 1 is at the end (complete). */
totalProgress(): number;
totalProgress(value: number, suppressEvents?: boolean): Animation;
/** Gets or sets the position of the playhead according to the totalDuration which includes any repeats and repeatDelays (only available in TweenMax and TimelineMax). */
totalTime(): number;
totalTime(time: number, suppressEvents?: boolean): Animation;
}
declare class SimpleTimeLine extends Animation {
/** SimpleTimeline is the base class for TimelineLite and TimelineMax, providing the most basic timeline functionality and it is used for the root timelines in TweenLite but is only intended for internal use in the GreenSock tweening platform. It is meant to be very fast and lightweight. */
constructor(vars?: any);
/** If true, child tweens/timelines will be removed as soon as they complete. */
autoRemoveChildren: boolean;
/** Controls whether or not child tweens/timelines are repositioned automatically (changing their startTime) in order to maintain smooth playback when properties are changed on-the-fly. */
smoothChildTiming: boolean;
/** Adds a TweenLite, TweenMax, TimelineLite, or TimelineMax instance to the timeline at a specific time. */
add(child: any, position?: any, align?: string, stagger?: number): SimpleTimeLine;
/** renders */
render(time: number, suppressEvents?: boolean, force?: boolean): SimpleTimeLine;
// INHERITANCE FROM ANIMATION
/** Gets or sets the animation's initial delay which is the length of time in seconds (or frames for frames-based tweens) before the animation should begin. */
delay(): number;
delay(value: number): SimpleTimeLine;
/** Gets or sets the animation's duration, not including any repeats or repeatDelays (which are only available in TweenMax and TimelineMax). */
duration(): number;
duration(value: number): SimpleTimeLine;
/** Gets or sets an event callback like "onComplete", "onUpdate", "onStart", "onReverseComplete" or "onRepeat" (onRepeat only applies to TweenMax or TimelineMax instances) along with any parameters that should be passed to that callback. */
eventCallback(type: string): Function;
eventCallback(type: string, callback: Function, params?: any[], scope?: any): SimpleTimeLine;
/** Clears any initialization data (like starting/ending values in tweens) which can be useful if, for example, you want to restart a tween without reverting to any previously recorded starting values. */
invalidate(): SimpleTimeLine;
/** Kills the animation entirely or in part depending on the parameters. */
kill(vars?: any, target?: any): SimpleTimeLine;
/** Pauses the instance, optionally jumping to a specific time. */
pause(atTime?: any, suppressEvents?: boolean): SimpleTimeLine;
/** Gets or sets the animation's paused state which indicates whether or not the animation is currently paused. */
paused(): boolean;
paused(value: boolean): SimpleTimeLine;
/** Begins playing forward, optionally from a specific time (by default playback begins from wherever the playhead currently is). */
play(from?: any, suppressEvents?: boolean): SimpleTimeLine;
/** Gets or sets the animations's progress which is a value between 0 and 1 indicating the position of the virtual playhead (excluding repeats) where 0 is at the beginning, 0.5 is at the halfway point, and 1 is at the end (complete). */
progress(): number;
progress(value: number, suppressEvents?: boolean): SimpleTimeLine;
/** Restarts and begins playing forward from the beginning. */
restart(includeDelay?: boolean, suppressEvents?: boolean): SimpleTimeLine;
/** Resumes playing without altering direction (forward or reversed), optionally jumping to a specific time first. */
resume(from?: any, suppressEvents?: boolean): SimpleTimeLine;
/** Reverses playback so that all aspects of the animation are oriented backwards including, for example, a tween's ease. */
reverse(from?: any, suppressEvents?: boolean): SimpleTimeLine;
/** Gets or sets the animation's reversed state which indicates whether or not the animation should be played backwards. */
reversed(): boolean;
reversed(value: boolean): SimpleTimeLine;
/** Jumps to a specific time without affecting whether or not the instance is paused or reversed. */
seek(time: any, suppressEvents?: boolean): SimpleTimeLine;
/** Gets or sets the time at which the animation begins on its parent timeline (after any delay that was defined). */
startTime(): number;
startTime(value: number): SimpleTimeLine;
/** Gets or sets the local position of the playhead (essentially the current time), described in seconds (or frames for frames-based animations) which will never be less than 0 or greater than the animation's duration. */
time(): number;
time(value: number, suppressEvents?: boolean): SimpleTimeLine;
/** Factor that's used to scale time in the animation where 1 = normal speed (the default), 0.5 = half speed, 2 = double speed, etc. */
timeScale(): number;
timeScale(value: number): SimpleTimeLine;
/** Gets or sets the animation's total duration including any repeats or repeatDelays (which are only available in TweenMax and TimelineMax). */
totalDuration(): number;
totalDuration(value: number): SimpleTimeLine;
/** Gets or sets the animation's total progress which is a value between 0 and 1 indicating the position of the virtual playhead (including repeats) where 0 is at the beginning, 0.5 is at the halfway point, and 1 is at the end (complete). */
totalProgress(): number;
totalProgress(value: number, suppressEvents?: boolean): SimpleTimeLine;
/** Gets or sets the position of the playhead according to the totalDuration which includes any repeats and repeatDelays (only available in TweenMax and TimelineMax). */
totalTime(): number;
totalTime(time: number, suppressEvents?: boolean): SimpleTimeLine;
}
+11
View File
@@ -0,0 +1,11 @@
// Type definitions for GSAP v1.16.0
// Project: http://greensock.com/
// Definitions by: VILIC VANE <https://vilic.github.io/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare class Ease {
constructor(func?: Function, extraParams?: any[], type?: number, power?: number);
/** Translates the tween's progress ratio into the corresponding ease ratio. */
getRatio(p: number): number;
}
+130
View File
@@ -0,0 +1,130 @@
// Type definitions for GSAP v1.16.0
// Project: http://greensock.com/
// Definitions by: VILIC VANE <https://vilic.github.io/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="Core.d.ts" />
/// <reference path="Ease.d.ts" />
declare class TweenLite {
constructor(target: any, duration: number, vars: any);
/** Provides An easy way to change the default easing equation. */
static defaultEase: Ease;
/** Provides An easy way to change the default overwrite mode. */
static defaultOverwrite: string;
/** The selector engine (like jQuery) that should be used when a tween receives a string as its target, like TweenLite.to("#myID", 1, {x:"100px"}). */
static selector: (query: string) => any;
/** [READ-ONLY] Target object (or array of objects) whose properties the tween affects. */
target: any;
/** The object that dispatches a "tick" event each time the engine updates, making it easy for you to add your own listener(s) to run custom logic after each update (great for game developers). */
static ticker: any;
/** Provides a simple way to call a function after a set amount of time (or frames). */
static delayedCall(delay: number, callback: Function, params?: any[], scope?: any, useFrames?: boolean): TweenLite;
/** Static method for creating a TweenLite instance that tweens backwards - you define the BEGINNING values and the current values are used as the destination values which is great for doing things like animating objects onto the screen because you can set them up initially the way you want them to look at the end of the tween and then animate in from elsewhere. */
static from(target: any, duration: number, vars: any): TweenLite;
/** Static method for creating a TweenLite instance that allows you to define both the starting and ending values (as opposed to to() and from() tweens which are based on the target's current values at one end or the other). */
static fromTo(target: any, duration: number, fromVars: any, toVars: any): TweenLite;
/** Returns an array containing all the tweens of a particular target (or group of targets) that have not been released for garbage collection yet which typically happens within a few seconds after the tween completes. */
static getTweensOf(target: any, onlyActive?: boolean): TweenLite[];
/** [override] Clears any initialization data (like starting/ending values in tweens) which can be useful if, for example, you want to restart a tween without reverting to any previously recorded starting values. */
invalidate(): TweenLite;
/** Immediately kills all of the delayedCalls to a particular function. */
static killDelayedCallsTo(func: Function): void;
/** Kills all the tweens (or specific tweening properties) of a particular object or delayedCalls to a particular function. */
static killTweensOf(target: any, onlyActive?: boolean, vars?: any): void;
/** Permits you to control what happens when too much time elapses between two ticks (updates) of the engine, adjusting the core timing mechanism to compensate and avoid "jumps". */
static lagSmoothing(threshold: number, adjustedLag: number): void;
/** Forces a render of all active tweens which can be useful if, for example, you set up a bunch of from() tweens and then you need to force an immediate render (even of "lazy" tweens) to avoid a brief delay before things render on the very next tick. */
static render(): void;
/** Immediately sets properties of the target accordingly - essentially a zero-duration to() tween with a more intuitive name. */
static set(target: any, vars: any): TweenLite;
/** Static method for creating a TweenLite instance that animates to the specified destination values (from the current values). */
static to(target: any, duration: number, vars: any): TweenLite;
// INHERITANCE FROM ANIMATION
/** Gets or sets the animation's initial delay which is the length of time in seconds (or frames for frames-based tweens) before the animation should begin. */
delay(): number;
delay(value: number): TweenLite;
/** Gets or sets the animation's duration, not including any repeats or repeatDelays (which are only available in TweenMax and TimelineMax). */
duration(): number;
duration(value: number): TweenLite;
/** Gets or sets an event callback like "onComplete", "onUpdate", "onStart", "onReverseComplete" or "onRepeat" (onRepeat only applies to TweenMax or TimelineMax instances) along with any parameters that should be passed to that callback. */
eventCallback(type: string): Function;
eventCallback(type: string, callback: Function, params?: any[], scope?: any): TweenLite;
/** Kills the animation entirely or in part depending on the parameters. */
kill(vars?: any, target?: any): TweenLite;
/** Pauses the instance, optionally jumping to a specific time. */
pause(atTime?: any, suppressEvents?: boolean): TweenLite;
/** Gets or sets the animation's paused state which indicates whether or not the animation is currently paused. */
paused(): boolean;
paused(value: boolean): TweenLite;
/** Begins playing forward, optionally from a specific time (by default playback begins from wherever the playhead currently is). */
play(from?: any, suppressEvents?: boolean): TweenLite;
/** Gets or sets the animations's progress which is a value between 0 and 1 indicating the position of the virtual playhead (excluding repeats) where 0 is at the beginning, 0.5 is at the halfway point, and 1 is at the end (complete). */
progress(): number;
progress(value: number, suppressEvents?: boolean): TweenLite;
/** Restarts and begins playing forward from the beginning. */
restart(includeDelay?: boolean, suppressEvents?: boolean): TweenLite;
/** Resumes playing without altering direction (forward or reversed), optionally jumping to a specific time first. */
resume(from?: any, suppressEvents?: boolean): TweenLite;
/** Reverses playback so that all aspects of the animation are oriented backwards including, for example, a tween's ease. */
reverse(from?: any, suppressEvents?: boolean): TweenLite;
/** Gets or sets the animation's reversed state which indicates whether or not the animation should be played backwards. */
reversed(): boolean;
reversed(value: boolean): TweenLite;
/** Jumps to a specific time without affecting whether or not the instance is paused or reversed. */
seek(time: any, suppressEvents?: boolean): TweenLite;
/** Gets or sets the time at which the animation begins on its parent timeline (after any delay that was defined). */
startTime(): number;
startTime(value: number): TweenLite;
/** Gets or sets the local position of the playhead (essentially the current time), described in seconds (or frames for frames-based animations) which will never be less than 0 or greater than the animation's duration. */
time(): number;
time(value: number, suppressEvents?: boolean): TweenLite;
/** Factor that's used to scale time in the animation where 1 = normal speed (the default), 0.5 = half speed, 2 = double speed, etc. */
timeScale(): number;
timeScale(value: number): TweenLite;
/** Gets or sets the animation's total duration including any repeats or repeatDelays (which are only available in TweenMax and TimelineMax). */
totalDuration(): number;
totalDuration(value: number): TweenLite;
/** Gets or sets the animation's total progress which is a value between 0 and 1 indicating the position of the virtual playhead (including repeats) where 0 is at the beginning, 0.5 is at the halfway point, and 1 is at the end (complete). */
totalProgress(): number;
totalProgress(value: number, suppressEvents?: boolean): TweenLite;
/** Gets or sets the position of the playhead according to the totalDuration which includes any repeats and repeatDelays (only available in TweenMax and TimelineMax). */
totalTime(): number;
totalTime(time: number, suppressEvents?: boolean): TweenLite;
}
+8
View File
@@ -0,0 +1,8 @@
/// <reference path="TweenLite.d.ts" />
var tween = TweenLite
.to(document.getElementById('some-div'), 1, {
width: '200px',
height: '200px'
})
.seek(0.5);
+23
View File
@@ -0,0 +1,23 @@
/// <reference path="./gulp-concat.d.ts" />
/// <reference path="../gulp/gulp.d.ts" />
import gulp = require("gulp");
import concat = require("gulp-concat");
gulp.task("concat:simple", () => {
gulp.src(["file*.txt"])
.pipe(concat("file.txt"))
.pipe(gulp.dest("build"));
});
gulp.task("concat:newLine", () => {
gulp.src(["file*.txt"])
.pipe(concat("file.txt", { newLine: ";" }))
.pipe(gulp.dest("build"));
});
gulp.task("concat:vinyl", () => {
gulp.src(["file*.txt"])
.pipe(concat({ path: "file.txt", stat: { mode: 0666 } }))
.pipe(gulp.dest("build"));
});
+42
View File
@@ -0,0 +1,42 @@
// Type definitions for gulp-concat
// Project: http://github.com/wearefractal/gulp-concat
// Definitions by: Keita Kagurazaka <https://github.com/k-kagurazaka>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare module "gulp-concat" {
interface IOptions {
newLine: string;
}
interface IFsStats {
dev?: number;
ino?: number;
mode?: number;
nlink?: number;
uid?: number;
gid?: number;
rdev?: number;
size?: number;
blksize?: number;
blocks?: number;
atime?: Date;
mtime?: Date;
ctime?: Date;
}
interface IVinylOptions {
cwd?: string;
base?: string;
path?: string;
stat?: IFsStats;
contents?: NodeJS.ReadableStream | Buffer;
}
function concat(filename: string, options?: IOptions): NodeJS.ReadWriteStream;
function concat(options: IVinylOptions): NodeJS.ReadWriteStream;
export = concat;
}
+17
View File
@@ -0,0 +1,17 @@
/// <reference path="./gulp-flatten.d.ts" />
/// <reference path="../gulp/gulp.d.ts" />
import gulp = require("gulp");
import flatten = require("gulp-flatten");
gulp.task("flatten:simple", () => {
gulp.src(["files/**/*.txt"])
.pipe(flatten())
.pipe(gulp.dest("build"));
});
gulp.task("flatten:newPath", () => {
gulp.src(["files/**/*.txt"])
.pipe(flatten({ newPath: "new/path" }))
.pipe(gulp.dest("build"));
});
+17
View File
@@ -0,0 +1,17 @@
// Type definitions for gulp-flatten
// Project: https://github.com/armed/gulp-flatten
// Definitions by: Keita Kagurazaka <https://github.com/k-kagurazaka>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare module "gulp-flatten" {
interface IOptions {
newPath: string;
}
function flatten(options?: IOptions): NodeJS.ReadWriteStream;
export = flatten;
}
+41
View File
@@ -0,0 +1,41 @@
/// <reference path="./gulp-inject.d.ts" />
/// <reference path="../gulp/gulp.d.ts" />
import gulp = require("gulp");
import inject = require("gulp-inject");
gulp.task("inject:simple", () => {
gulp.src("src/index.html")
.pipe(inject(gulp.src(["src/**/*.js", "src/**/*.css"], { read: false })))
.pipe(gulp.dest("build"));
});
gulp.task("inject:relative", () => {
gulp.src(["src/index.html"])
.pipe(inject(gulp.src(["src/**/*.js", "src/**/*.css"], { read: false }), { relative: true }))
.pipe(gulp.dest("build"));
});
gulp.task("inject:starttag", () => {
gulp.src(["src/index.html"])
.pipe(inject(gulp.src(["src/**/*.js", "src/**/*.css"], { read: false }), { starttag: "<!-- inject:head:{{ext}} -->" }))
.pipe(gulp.dest("build"));
});
gulp.task("inject:name", () => {
gulp.src(["src/index.html"])
.pipe(inject(gulp.src(["src/**/*.js", "src/**/*.css"], { read: false }), { name: "head" }))
.pipe(gulp.dest("build"));
});
gulp.task("inject:transform", () => {
gulp.src(["files.json"])
.pipe(inject(gulp.src(["src/**/*.js", "src/**/*.css", "src/**/*.html"], { read: false }), {
starttag: "\"{{ext}}\": [",
endtag: "]",
transform: (filepath, file, i, length) => {
return " \"" + filepath + "\"" + (i + 1 < length ? "," : "");
}
}))
.pipe(gulp.dest("build"));
});
+36
View File
@@ -0,0 +1,36 @@
// Type definitions for gulp-inject
// Project: https://github.com/klei/gulp-inject
// Definitions by: Keita Kagurazaka <https://github.com/k-kagurazaka>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
/// <reference path="../vinyl/vinyl.d.ts" />
declare module "gulp-inject" {
import File = require("vinyl");
interface ITagFunction {
(targetExt: string, sourceExt: string): string;
}
interface ITransformFunction {
(filepath: string, file?: File, index?: number, length?: number, targetFile?: File): string;
}
interface IOptions {
ignorePath?: string | string[];
relative?: boolean;
addPrefix?: string;
addRootSlash?: boolean;
name?: string;
starttag?: string | ITagFunction;
endtag?: string | ITagFunction;
transform?: ITransformFunction;
selfClosingTag?: boolean;
}
function inject(sources: NodeJS.ReadableStream, options?: IOptions): NodeJS.ReadWriteStream;
export = inject;
}
+13
View File
@@ -0,0 +1,13 @@
/// <reference path="./gulp-less.d.ts" />
/// <reference path="../gulp/gulp.d.ts" />
import gulp = require("gulp");
import less = require("gulp-less");
gulp.task("less", () => {
gulp.src("less/**/*.less")
.pipe(less({
paths: ["less/includes"]
}))
.pipe(gulp.dest("public/css"));
});
+18
View File
@@ -0,0 +1,18 @@
// Type definitions for gulp-less
// Project: https://github.com/plus3network/gulp-less
// Definitions by: Keita Kagurazaka <https://github.com/k-kagurazaka>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare module "gulp-less" {
interface IOptions {
paths: string[];
plugins?: any[];
}
function less(options?: IOptions): NodeJS.ReadWriteStream;
export = less;
}
+11
View File
@@ -0,0 +1,11 @@
/// <reference path="./gulp-minify-css.d.ts" />
/// <reference path="../gulp/gulp.d.ts" />
import gulp = require("gulp");
import minifyCSS = require("gulp-minify-css");
gulp.task("minify-css", () => {
gulp.src("css/**/*.css")
.pipe(minifyCSS({ keepBreaks: true }))
.pipe(gulp.dest("dist"));
});
+31
View File
@@ -0,0 +1,31 @@
// Type definitions for gulp-minify-css
// Project: https://github.com/jonathanepollack/gulp-minify-css
// Definitions by: Keita Kagurazaka <https://github.com/k-kagurazaka>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare module "gulp-minify-css" {
interface IOptions {
cache?: boolean;
advanced?: boolean;
aggressiveMerging?: boolean;
benchmark?: boolean;
compatibility?: string;
debug?: boolean;
inliner?: Object;
keepBreaks?: boolean;
keepSpecialComments?: string | number;
processImport?: boolean;
rebase?: boolean;
relativeTo?: string;
root?: string;
roundingPrecision?: number;
shorthandCompacting?: boolean;
}
function minifyCSS(options?: IOptions): NodeJS.ReadWriteStream;
export = minifyCSS;
}
+17
View File
@@ -0,0 +1,17 @@
/// <reference path="./gulp-tsd.d.ts" />
/// <reference path="../gulp/gulp.d.ts" />
import gulp = require("gulp");
import tsd = require("gulp-tsd");
gulp.task("tsd", () => {
gulp.src("gulp_tsd.json")
.pipe(tsd());
});
gulp.task("tsd:options", callback => {
tsd({
command: "reinstall",
config: "tsd.json"
}, callback);
});
+21
View File
@@ -0,0 +1,21 @@
// Type definitions for gulp-tsd
// Project: https://github.com/moznion/gulp-tsd
// Definitions by: Keita Kagurazaka <https://github.com/k-kagurazaka>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
/// <reference path="../gulp/gulp.d.ts" />
declare module "gulp-tsd" {
interface IOptions {
command?: string;
latest?: boolean;
config?: string;
opts?: Object;
}
function tsd(opts?: IOptions, callback?: gulp.ITaskCallback): NodeJS.ReadWriteStream;
export = tsd;
}
+9 -1
View File
@@ -191,7 +191,15 @@ interface HighchartsBoolOrShadow {
interface HighchartsChartResetZoomButton {
position: HighchartsPosition;
relativeTo?: string;
theme?: any; //TO DO
theme?: HighchartsChartResetZoomButtonTheme; //TO DO
}
interface HighchartsChartResetZoomButtonTheme {
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'
}
interface HighchartsChartOptions {
+72
View File
@@ -0,0 +1,72 @@
/// <reference path="hooker.d.ts" />
import hooker = require('hooker');
// Type definitions for JavaScript Hooker v0.2.3
// Project: https://github.com/cowboy/javascript-hooker
// Definitions by: Michael Zabka <https://github.com/misak113/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
function tests() {
var objectToHook: any = {
hello: 'world'
};
hooker.hook(objectToHook, 'hello', () => { });
hooker.hook(objectToHook, 'hello', () => {
return null;
});
hooker.hook(objectToHook, ['hello', 'foo'], () => { });
hooker.hook(objectToHook, ['hello', 'bar'], () => {
return null;
});
hooker.hook(objectToHook, 'bar', () => {
return hooker.filter(this, ['foo', 'bar']);
});
hooker.hook(objectToHook, 'bar', () => {
return hooker.override('good');
});
hooker.hook(objectToHook, 'bar', () => {
return hooker.preempt('good');
});
hooker.orig(objectToHook, 'hello');
hooker.orig(objectToHook, ['hello', 'foo']);
hooker.hook(objectToHook, 'foo', {
pre: () => { }
});
hooker.hook(objectToHook, 'foo', {
pre: () => {
return hooker.preempt(1);
}
});
hooker.hook(objectToHook, 'foo', {
pre: () => {
return hooker.override(1);
}
});
hooker.hook(objectToHook, 'foo', {
pre: () => {
return hooker.filter(1, ['abc']);
}
});
hooker.hook(objectToHook, 'foo', {
post: () => { }
});
hooker.hook(objectToHook, 'foo', {
post: () => {
return hooker.filter(1, ['abc']);
}
});
hooker.hook(objectToHook, 'foo', {
once: false
});
hooker.hook(objectToHook, 'foo', {
passName: true
});
hooker.hook(objectToHook, 'foo', {
pre: () => { },
post: () => {
return hooker.filter(this, []);
},
once: true,
passName: false
});
}
+42
View File
@@ -0,0 +1,42 @@
// Type definitions for JavaScript Hooker v0.2.3
// Project: https://github.com/cowboy/javascript-hooker
// Definitions by: Michael Zabka <https://github.com/misak113/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare type HookerPostHookFunction = (result: any, ...args: any[]) => IHookerPostHookResult|void;
declare type HookerPreHookFunction = (...args: any[]) => IHookerPreHookResult|void;
declare module "hooker" {
function hook(object: any, props: string|string[], options: IHookerOptions): void;
function hook(object: any, props: string|string[], prehookFunction: HookerPreHookFunction): void;
function unhook(object: any, props?: string|string[]): string[];
function orig(object: any, props: string|string[]): Function;
function override(value: any): HookerOverride;
function preempt(value: any): HookerPreempt;
function filter(context: any, args: any[]): HookerFilter;
}
declare class HookerOverride implements IHookerPostHookResult, IHookerPreHookResult {
value: any;
}
declare class HookerPreempt implements IHookerPreHookResult {
value: any;
}
declare class HookerFilter implements IHookerPreHookResult {
context: any;
args: any[];
}
interface IHookerPostHookResult {}
interface IHookerPreHookResult {}
interface IHookerOptions {
pre?: HookerPreHookFunction;
post?: HookerPostHookFunction;
once?: boolean;
passName?: boolean;
}
+10
View File
@@ -0,0 +1,10 @@
/// <reference path="ini.d.ts" />
/// <reference path="../node/node.d.ts" />
import fs = require("fs");
import ini = require("ini");
var ini_content = fs.readFileSync("path_to_file.ini", "utf-8");
var ini_object: any = ini.decode(ini_content);
var ini_rev_string: string = ini.encode(ini_object);
+25
View File
@@ -0,0 +1,25 @@
// Type definitions for ini v1.3.3
// Project: https://github.com/isaacs/ini
// Definitions by: Marcin Porębski <https://github.com/marcinporebski>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "ini"
{
interface EncodeOptions {
section: string
whitespace: boolean
}
function decode(inistring: string): any;
function parse(initstring: string): any;
function encode(object: any, options?: EncodeOptions): string;
function stringify(object: any, options?: EncodeOptions): string;
function safe(val: string): string;
function unsafe(val: string): string;
}
+655
View File
@@ -0,0 +1,655 @@
/// <reference path="is_js.d.ts" />
//#region Type checks
var getArguments = function () {
return arguments;
};
var arguments = getArguments();
is.arguments(arguments);
is.not.arguments({ foo: 'bar' });
is.all.arguments(arguments, 'bar');
is.any.arguments(['foo'], arguments);
is.all.arguments([arguments, 'foo', 'bar']);
is.array(['foo', 'bar', 'baz']);
is.not.array({ foo: 'bar' });
is.all.array(['foo'], 'bar');
is.any.array(['foo'], 'bar');
is.all.array([[1, 2], 'foo', 'bar']);
is.boolean(true);
is.not.boolean({ foo: 'bar' });
is.all.boolean(true, 'bar');
is.any.boolean(true, 'bar');
is.all.boolean([true, 'foo', 'bar']);
is.date(new Date());
is.not.date({ foo: 'bar' });
is.all.date(new Date(), 'bar');
is.any.date(new Date(), 'bar');
is.all.date([new Date(), 'foo', 'bar']);
is.error(new Error());
is.not.error({ foo: 'bar' });
is.all.error(new Error(), 'bar');
is.any.error(new Error(), 'bar');
is.all.error([new Error(), 'foo', 'bar']);
is.function(toString);
is.not.function({ foo: 'bar' });
is.all.function(toString, 'bar');
is.any.function(toString, 'bar');
is.all.function([toString, 'foo', 'bar']);
is.nan(NaN);
is.not.nan(42);
is.all.nan(NaN, 1);
is.any.nan(NaN, 2);
is.all.nan([NaN, 'foo', 1]);
is.null(null);
is.not.null(42);
is.all.null(null, 1);
is.any.null(null, 2);
is.all.null([null, 'foo', 1]);
is.number(42);
is.not.number('42');
is.all.number('foo', 1);
is.any.number({}, 2);
is.all.number([42, 'foo', 1]);
is.object({ foo: 'bar' });
is.object(toString);
is.not.object('foo');
is.all.object({}, 1);
is.any.object({}, 2);
is.all.object([{}, new Object()]);
is.json({ foo: 'bar' });
is.json(toString);
is.not.json([]);
is.all.json({}, 1);
is.any.json({}, 2);
is.all.json([{}, { foo: 'bar' }]);
is.regexp(/test/);
is.not.regexp(['foo']);
is.all.regexp(/test/, 1);
is.any.regexp(new RegExp('ab+c'), 2);
is.all.regexp([{}, /test/]);
is.string('foo');
is.not.string(['foo']);
is.all.string('foo', 1);
is.any.string('foo', 2);
is.all.string([{}, 'foo']);
is.char('f');
is.not.char(['foo']);
is.all.char('f', 1);
is.any.char('f', 2);
is.all.char(['f', 'o', 'o']);
is.undefined(undefined);
is.not.undefined(null);
is.all.undefined(undefined, 1);
is.any.undefined(undefined, 2);
is.all.undefined([{}, undefined]);
is.sameType(42, 7);
is.sameType(42, '7');
is.not.sameType(42, 7);
//#endregion
//#region Presence checks
is.empty({});
is.empty([]);
is.empty('');
is.not.empty(['foo']);
is.all.empty('', {}, ['foo']);
is.any.empty([], 42);
is.all.empty([{}, 'foo']);
is.existy({});
is.existy(null);
is.not.existy(undefined);
is.all.existy(null, ['foo']);
is.any.existy(undefined, 42);
is.all.existy([{}, 'foo']);
is.truthy(true);
is.truthy(null);
is.not.truthy(false);
is.all.truthy(null, true);
is.any.truthy(undefined, true);
is.all.truthy([{}, true]);
is.falsy(false);
is.falsy(null);
is.not.falsy(true);
is.all.falsy(null, false);
is.any.falsy(undefined, true);
is.all.falsy([false, true, undefined]);
is.space(' ');
is.space('foo');
is.not.space(true);
is.all.space(' ', 'foo');
is.any.space(' ', true);
is.all.space([' ', 'foo', undefined]);
//#endregion
//#region RegExp checks
is.url('http://www.test.com');
is.url('foo');
is.not.url(true);
is.all.url('http://www.test.com', 'foo');
is.any.url('http://www.test.com', true);
is.all.url(['http://www.test.com', 'foo', undefined]);
is.email('test@test.com');
is.email('foo');
is.not.email('foo');
is.all.email('test@test.com', 'foo');
is.any.email('test@test.com', 'foo');
is.all.email(['test@test.com', 'foo', undefined]);
is.creditCard(378282246310005);
is.creditCard(123);
is.not.creditCard(123);
is.all.creditCard(378282246310005, 123);
is.any.creditCard(378282246310005, 123);
is.all.creditCard([378282246310005, 123, undefined]);
is.alphaNumeric('alphaNu3er1k');
is.alphaNumeric('*?');
is.not.alphaNumeric('*?');
is.all.alphaNumeric('alphaNu3er1k', '*?');
is.any.alphaNumeric('alphaNu3er1k', '*?');
is.all.alphaNumeric(['alphaNu3er1k', '*?']);
is.timeString('13:45:30');
is.timeString('90:90:90');
is.not.timeString('90:90:90');
is.all.timeString('13:45:30', '90:90:90');
is.any.timeString('13:45:30', '90:90:90');
is.all.timeString(['13:45:30', '90:90:90']);
is.dateString('11/11/2011');
is.dateString('90/11/2011');
is.not.dateString('90/11/2011');
is.all.dateString('11/11/2011', '90/11/2011');
is.any.dateString('11/11/2011', '90/11/2011');
is.all.dateString(['11/11/2011', '90/11/2011']);
is.usZipCode('02201-1020');
is.usZipCode('123');
is.not.usZipCode('123');
is.all.usZipCode('02201-1020', '123');
is.any.usZipCode('02201-1020', '123');
is.all.usZipCode(['02201-1020', '123']);
is.caPostalCode('L8V3Y1');
is.caPostalCode('L8V 3Y1');
is.caPostalCode('123');
is.not.caPostalCode('123');
is.all.caPostalCode('L8V3Y1', '123');
is.any.caPostalCode('L8V3Y1', '123');
is.all.caPostalCode(['L8V3Y1', '123']);
is.ukPostCode('B184BJ');
is.ukPostCode('123');
is.not.ukPostCode('123');
is.all.ukPostCode('B184BJ', '123');
is.any.ukPostCode('B184BJ', '123');
is.all.ukPostCode(['B184BJ', '123']);
is.nanpPhone('609-555-0175');
is.nanpPhone('123');
is.not.nanpPhone('123');
is.all.nanpPhone('609-555-0175', '123');
is.any.nanpPhone('609-555-0175', '123');
is.all.nanpPhone(['609-555-0175', '123']);
is.eppPhone('+90.2322456789');
is.eppPhone('123');
is.not.eppPhone('123');
is.all.eppPhone('+90.2322456789', '123');
is.any.eppPhone('+90.2322456789', '123');
is.all.eppPhone(['+90.2322456789', '123']);
is.socialSecurityNumber('017-90-7890');
is.socialSecurityNumber('123');
is.not.socialSecurityNumber('123');
is.all.socialSecurityNumber('017-90-7890', '123');
is.any.socialSecurityNumber('017-90-7890', '123');
is.all.socialSecurityNumber(['017-90-7890', '123']);
is.affirmative('yes');
is.affirmative('no');
is.not.affirmative('no');
is.all.affirmative('yes', 'no');
is.any.affirmative('yes', 'no');
is.all.affirmative(['yes', 'y', 'true', 't', 'ok', 'okay']);
is.hexadecimal('f0f0f0');
is.hexadecimal(2.5);
is.not.hexadecimal('string');
is.all.hexadecimal('ff', 'f50');
is.any.hexadecimal('ff5500', true);
is.all.hexadecimal(['fff', '333', 'f50']);
is.hexColor('#333');
is.hexColor('#3333');
is.not.hexColor(0.5);
is.all.hexColor('fff', 'f50');
is.any.hexColor('ff5500', 0.5);
is.all.hexColor(['fff', '333', 'f50']);
is.ip('198.156.23.5');
is.ip('1.2..5');
is.not.ip('8:::::::7');
is.all.ip('0:1::4:ff5:54:987:C', '123.123.123.123');
is.any.ip('123.8.4.3', '0.0.0.0');
is.all.ip(['123.123.23.12', 'A:B:C:D:E:F:0:0']);
is.ipv4('198.12.3.142');
is.ipv4('1.2..5');
is.not.ipv4('8:::::::7');
is.all.ipv4('198.12.3.142', '123.123.123.123');
is.any.ipv4('255.255.255.255', '850..1.4');
is.all.ipv4(['198.12.3.142', '1.2.3']);
is.ipv6('2001:DB8:0:0:1::1');
is.ipv6('985.12.3.4');
is.not.ipv6('8:::::::7');
is.all.ipv6('2001:DB8:0:0:1::1', '1:50:198:2::1:2:8');
is.any.ipv6('255.255.255.255', '2001:DB8:0:0:1::1');
is.all.ipv6(['2001:DB8:0:0:1::1', '1.2.3']);
//#endregion
//#region String checks
is.include('Some text goes here', 'text');
is.include('test', 'text');
is.not.include('test', 'text');
is.upperCase('YEAP');
is.upperCase('nope');
is.not.upperCase('Nope');
is.all.upperCase('YEAP', 'nope');
is.any.upperCase('YEAP', 'nope');
is.all.upperCase(['YEAP', 'ALL UPPERCASE']);
is.lowerCase('yeap');
is.lowerCase('NOPE');
is.not.lowerCase('Nope');
is.all.lowerCase('yeap', 'NOPE');
is.any.lowerCase('yeap', 'NOPE');
is.all.lowerCase(['yeap', 'all lowercase']);
is.startWith('yeap', 'ye');
is.startWith('nope', 'ye');
is.not.startWith('nope not that', 'not');
is.endWith('yeap', 'ap');
is.endWith('nope', 'no');
is.not.endWith('nope not that', 'not');
is.endWith('yeap that one', 'one');
is.capitalized('Yeap');
is.capitalized('nope');
is.not.capitalized('nope not capitalized');
is.not.capitalized('nope Capitalized');
is.all.capitalized('Yeap', 'All', 'Capitalized');
is.any.capitalized('Yeap', 'some', 'Capitalized');
is.all.capitalized(['Nope', 'not']);
is.palindrome('testset');
is.palindrome('nope');
is.not.palindrome('nope not palindrome');
is.not.palindrome('tt');
is.all.palindrome('testset', 'tt');
is.any.palindrome('Yeap', 'some', 'testset');
is.all.palindrome(['Nope', 'testset']);
//#endregion
//#region Arithmetic checks
is.equal(42, 40 + 2);
is.equal('yeap', 'yeap');
is.equal(true, true);
is.not.equal('yeap', 'nope');
is.even(42);
is.not.even(41);
is.all.even(40, 42, 44);
is.any.even(39, 42, 43);
is.all.even([40, 42, 43]);
is.odd(41);
is.not.odd(42);
is.all.odd(39, 41, 43);
is.any.odd(39, 42, 44);
is.all.odd([40, 42, 43]);
is.positive(41);
is.not.positive(-42);
is.all.positive(39, 41, 43);
is.any.positive(-39, 42, -44);
is.all.positive([40, 42, -43]);
is.negative(-41);
is.not.negative(42);
is.all.negative(-39, -41, -43);
is.any.negative(-39, 42, 44);
is.all.negative([40, 42, -43]);
is.above(41, 30);
is.not.above(42, 50);
is.under(30, 35);
is.not.under(42, 30);
is.within(30, 20, 40);
is.not.within(40, 30, 35);
is.decimal(41.5);
is.not.decimal(42);
is.all.decimal(39.5, 41.5, -43.5);
is.any.decimal(-39, 42.5, 44);
is.all.decimal([40, 42.5, -43]);
is.integer(41);
is.not.integer(42.5);
is.all.integer(39, 41, -43);
is.any.integer(-39, 42.5, 44);
is.all.integer([40, 42.5, -43]);
is.finite(41);
is.not.finite(42 / 0);
is.all.finite(39, 41, -43);
is.any.finite(-39, Infinity, 44);
is.all.finite([Infinity, -Infinity, 42.5]);
is.infinite(Infinity);
is.not.infinite(42);
is.all.infinite(Infinity, -Infinity, -43 / 0);
is.any.infinite(-39, Infinity, 44);
is.all.infinite([Infinity, -Infinity, 42.5]);
//#endregion
//#region Object checks
is.propertyCount({ this: 'is', 'sample': {} }, 2);
is.propertyCount({ this: 'is', 'sample': {} }, 3);
is.not.propertyCount({}, 2);
is.propertyDefined({ yeap: 'yeap' }, 'yeap');
is.propertyDefined({ yeap: 'yeap' }, 'nope');
is.not.propertyDefined({}, 'nope');
is.windowObject(window);
is.windowObject({ nope: 'nope' });
is.not.windowObject({});
is.all.windowObject(window, { nope: 'nope' });
is.any.windowObject(window, { nope: 'nope' });
is.all.windowObject([window, { nope: 'nope' }]);
var obj = document.createElement('div');
is.domNode(obj);
is.domNode({ nope: 'nope' });
is.not.domNode({});
is.all.domNode(obj, obj);
is.any.domNode(obj, { nope: 'nope' });
is.all.domNode([obj, { nope: 'nope' }]);
//#endregion
//#region Array checks
is.inArray(2, [1, 2, 3]);
is.inArray(4, [1, 2, 3]);
is.not.inArray(4, [1, 2, 3]);
is.sorted([1, 2, 3]);
is.sorted([1, 2, 4, 3]);
is.not.sorted([5, 4, 3]);
is.all.sorted([1, 2], [3, 4]);
is.any.sorted([1, 2], [5, 4]);
is.all.sorted([[1, 2], [5, 4]]);
//#endregion
//#region Environment checks
is.ie();
is.ie(6);
is.not.ie();
is.chrome();
is.not.chrome();
is.firefox();
is.not.firefox();
is.opera();
is.not.opera();
is.safari();
is.not.safari();
is.ios();
is.not.ios();
is.iphone();
is.not.iphone();
is.ipad();
is.not.ipad();
is.ipod();
is.not.ipod();
is.android();
is.not.android();
is.androidPhone();
is.not.androidPhone();
is.androidTablet();
is.not.androidTablet();
is.blackberry();
is.not.blackberry();
is.windowsPhone();
is.not.windowsPhone();
is.windowsTablet();
is.not.windowsTablet();
is.windows();
is.not.windows();
is.mac();
is.not.mac();
is.linux();
is.not.linux();
is.desktop();
is.not.desktop();
is.mobile();
is.not.mobile();
is.tablet();
is.not.tablet();
is.online();
is.not.online();
is.offline();
is.not.offline();
//#endregion
//#region Time checks
var today = new Date();
var yesterday = new Date(new Date().setDate(new Date().getDate() - 1));
var tomorrow = new Date(new Date().setDate(new Date().getDate() + 1));
var monday = new Date('01/26/2015');
var sunday = new Date('01/25/2015');
var saturday = new Date('01/24/2015');
is.today(today);
is.today(yesterday)
is.not.today(yesterday);
is.all.today(today, today);
is.any.today(today, yesterday);
is.all.today([today, yesterday]);
is.yesterday(today);
is.yesterday(yesterday);
is.not.yesterday(today);
is.all.yesterday(yesterday, today);
is.any.yesterday(today, yesterday);
is.all.yesterday([today, yesterday]);
is.tomorrow(today);
is.tomorrow(tomorrow);
is.not.tomorrow(today);
is.all.tomorrow(tomorrow, today);
is.any.tomorrow(today, tomorrow);
is.all.tomorrow([today, tomorrow]);
is.past(yesterday);
is.past(tomorrow);
is.not.past(tomorrow);
is.all.past(tomorrow, yesterday);
is.any.past(yesterday, tomorrow);
is.all.past([yesterday, tomorrow]);
is.future(yesterday);
is.future(tomorrow);
is.not.future(yesterday);
is.all.future(tomorrow, yesterday);
is.any.future(yesterday, tomorrow);
is.all.future([yesterday, tomorrow]);
var mondayObj = new Date('01/26/2015');
var tuesdayObj = new Date('01/27/2015');
is.day(mondayObj, 'monday');
is.day(mondayObj, 'tuesday');
is.not.day(mondayObj, 'tuesday');
var januaryObj = new Date('01/26/2015');
var februaryObj = new Date('02/26/2015');
is.month(januaryObj, 'january');
is.month(februaryObj, 'january');
is.not.month(februaryObj, 'january');
var year2015 = new Date('01/26/2015');
var year2016 = new Date('01/26/2016');
is.year(year2015, 2015);
is.year(year2016, 2015);
is.not.year(year2016, 2015);
is.leapYear(2016);
is.leapYear(2015);
is.not.leapYear(2015);
is.all.leapYear(2015, 2016);
is.any.leapYear(2015, 2016);
is.all.leapYear([2016, 2080]);
is.weekend(sunday);
is.weekend(monday);
is.not.weekend(monday);
is.all.weekend(sunday, saturday);
is.any.weekend(sunday, saturday, monday);
is.all.weekend([sunday, saturday, monday]);
is.weekday(monday);
is.weekday(sunday);
is.not.weekday(sunday);
is.all.weekday(monday, saturday);
is.any.weekday(sunday, saturday, monday);
is.all.weekday([sunday, saturday, monday]);
is.inDateRange(sunday, saturday, monday);
is.inDateRange(saturday, sunday, monday);
is.not.inDateRange(saturday, sunday, monday);
var twoDaysAgo = new Date(new Date().setDate(new Date().getDate() - 2));
var nineDaysAgo = new Date(new Date().setDate(new Date().getDate() - 9));
is.inLastWeek(twoDaysAgo);
is.inLastWeek(nineDaysAgo);
is.not.inLastWeek(nineDaysAgo);
var tenDaysAgo = new Date(new Date().setDate(new Date().getDate() - 10));
var fortyDaysAgo = new Date(new Date().setDate(new Date().getDate() - 40));
is.inLastMonth(tenDaysAgo);
is.inLastMonth(fortyDaysAgo);
is.not.inLastMonth(fortyDaysAgo);
var twoMonthsAgo = new Date(new Date().setMonth(new Date().getMonth() - 2));
var thirteenMonthsAgo = new Date(new Date().setMonth(new Date().getMonth() - 13));
is.inLastYear(twoMonthsAgo);
is.inLastYear(thirteenMonthsAgo);
is.not.inLastYear(thirteenMonthsAgo);
var twoDaysLater = new Date(new Date().setDate(new Date().getDate() + 2));
var nineDaysLater = new Date(new Date().setDate(new Date().getDate() + 9));
is.inNextWeek(twoDaysLater);
is.inNextWeek(nineDaysLater);
is.not.inNextWeek(nineDaysLater);
var tenDaysLater = new Date(new Date().setDate(new Date().getDate() + 10));
var fortyDaysLater = new Date(new Date().setDate(new Date().getDate() + 40));
is.inNextMonth(tenDaysLater);
is.inNextMonth(fortyDaysLater);
is.not.inNextMonth(fortyDaysLater);
var twoMonthsLater = new Date(new Date().setMonth(new Date().getMonth() + 2));
var thirteenMonthsLater = new Date(new Date().setMonth(new Date().getMonth() + 13));
is.inNextYear(twoMonthsLater);
is.inNextYear(thirteenMonthsLater);
is.not.inNextYear(thirteenMonthsLater);
var firstQuarter = new Date('01/26/2015');
var secondQuarter = new Date('05/26/2015');
is.quarterOfYear(firstQuarter, 1);
is.quarterOfYear(secondQuarter, 1);
is.not.quarterOfYear(secondQuarter, 1);
var january1 = new Date('01/01/2015');
var june1 = new Date('06/01/2015');
is.dayLightSavingTime(june1);
is.dayLightSavingTime(january1);
is.not.dayLightSavingTime(january1);
//#endregion
//#region Configuration methods
is.url('https://www.duckduckgo.com');
is.setRegexp(/quack/, 'url');
is.url('quack');
var customName = is.setNamespace();
customName.odd(3);
//#endregion
+1323
View File
File diff suppressed because it is too large Load Diff
+16
View File
@@ -0,0 +1,16 @@
/// <reference path="jbinary.d.ts" />
var originalData = [0x05, 0x03, 0x7F, 0x1E];
var b1 = new jBinary(originalData);
console.log(b1.readAll());
console.log(b1.read('int8'));
b1.seek(4);
console.log(b1.read('int8'));
console.log(b1.tell());
b1.write('int8', 0x9A, 2);
b1.writeAll(originalData);
console.log(b1.slice(0, 2));
+32
View File
@@ -0,0 +1,32 @@
// Type definitions for jBinary
// Project: https://github.com/jDataView/jBinary
// Definitions by: Tim Bureck <https://github.com/tbureck>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Additional notes:
// Method stubs and types are taken from the official jBinary documentation, which can be found here:
// https://github.com/jDataView/jBinary/wiki/jBinary-Constructor
// https://github.com/jDataView/jBinary/wiki/jBinary-Methods
/// <reference path="../jdataview/jdataview.d.ts" />
declare class jBinary
{
constructor(data:Array<number>);
constructor(data:jDataView, typeSet:Object);
constructor(bufferSize:number, typeSet:Object);
read(type:string, offset?:number):any;
readAll():any;
write(type:string, data:any, offset?:number):number;
writeAll(data:any):number;
tell():number;
seek(position:number, callback?: (prop:jBinary, data:any) => any):number;
skip(count:number, callback?: (prop:jBinary, data:any) => any):number;
slice(start:number, end:number, forceCopy?:boolean):jBinary;
as(typeSet:Object, modifyOriginal?:boolean):jBinary;
}
+71 -84
View File
@@ -1,6 +1,6 @@
// Type definitions for Joint JS 0.6
// Type definitions for Joint JS 0.9.3
// Project: http://www.jointjs.com/
// Definitions by: Aidan Reel <http://github.com/areel>, David Durman <http://github.com/DavidDurman>
// Definitions by: Aidan Reel <http://github.com/areel>, David Durman <http://github.com/DavidDurman>, Ewout Van Gossum <https://github.com/DenEwout>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../backbone/backbone.d.ts" />
@@ -16,34 +16,36 @@ declare module joint {
}
class Graph extends Backbone.Model {
initialize();
fromJSON(json: any);
clear();
addCell(cell: Cell);
addCells(cells: Cell[]);
getConnectedLinks(cell: Cell, opt?: any): Link[];
disconnectLinks(cell: Cell);
removeLinks(cell: Cell);
addCell(cell:Cell) : void;
addCells(cells:Cell[]) : void;
initialize() : void;
fromJSON(json:any) : void;
toJSON() : Object;
clear() : void;
getConnectedLinks(cell:Cell, opt?:any):Link[];
disconnectLinks(cell:Cell) : void;
removeLinks(cell:Cell) : void;
findModelsFromPoint(point:{x : number; y: number}):Element[];
}
class Cell extends Backbone.Model {
toJSON();
remove(options?: any);
toFront();
toBack();
embed(cell: Cell);
unembed(cell: Cell);
getEmbeddedCells(): Cell[];
clone(opt?: any): Backbone.Model; // @todo: return can either be Cell or Cell[].
attr(attrs: any): Cell;
toJSON() : Object;
remove(options?:any) : void;
toFront() : void;
toBack() : void;
embed(cell:Cell) : void;
unembed(cell:Cell) : void;
getEmbeddedCells():Cell[];
clone(opt?:any):Backbone.Model; // @todo: return can either be Cell or Cell[].
attr(attrs:any):Cell;
}
class Element extends Cell {
position(x: number, y: number): Element;
translate(tx: number, ty?: number): Element;
resize(width: number, height: number): Element;
rotate(angle: number, absolute): Element;
position(x:number, y:number):Element;
translate(tx:number, ty?:number):Element;
resize(width:number, height:number):Element;
rotate(angle:number, options : {absolute : boolean; origin: {x:number;y:number}}):Element;
remove(): void;
}
interface IDefaults {
@@ -51,9 +53,10 @@ declare module joint {
}
class Link extends Cell {
defaults(): IDefaults;
disconnect(): Link;
label(idx?: number, value?: any): any; // @todo: returns either a label under idx or Link if both idx and value were passed
defaults():IDefaults;
disconnect():Link;
label(idx?:number, value?:any):any; // @todo: returns either a label under idx or Link if both idx and value were passed
remove(): void;
}
interface IOptions {
@@ -66,82 +69,66 @@ declare module joint {
}
class Paper extends Backbone.View<Backbone.Model> {
options: IOptions;
setDimensions(width: number, height: number);
scale(sx: number, sy?: number, ox?: number, oy?: number): Paper;
rotate(deg: number, ox?: number, oy?: number): Paper; // @todo not released yet though it's in the source code already
findView(el: any): CellView;
findViewByModel(modelOrId: any): CellView;
findViewsFromPoint(p: { x: number; y: number; }): CellView[];
findViewsInArea(r: { x: number; y: number; width: number; height: number; }): CellView[];
snapToGrid(p): { x: number; y: number; };
options:IOptions;
setDimensions(width:number, height:number) : void;
scale(sx:number, sy?:number, ox?:number, oy?:number):Paper;
rotate(deg:number, ox?:number, oy?:number):Paper; // @todo not released yet though it's in the source code already
findView(el:any):CellView;
findViewByModel(modelOrId:any):CellView;
findViewsFromPoint(p:{ x: number; y: number; }):CellView[];
findViewsInArea(r:{ x: number; y: number; width: number; height: number; }):CellView[];
}
class ElementView extends CellView {
scale(sx: number, sy: number);
class ElementView extends CellView {
scale(sx:number, sy:number) : void;
}
class CellView extends Backbone.View<Cell> {
getBBox(): { x: number; y: number; width: number; height: number; };
highlight(el?: any);
unhighlight(el?: any);
findMagnet(el: any);
getSelector(el: any);
getBBox():{ x: number; y: number; width: number; height: number; };
highlight(el?:any): void;
unhighlight(el?:any): void;
findMagnet(el:any): void;
getSelector(el:any): void;
pointerdblclick(evt:any, x:number, y:number):void;
pointerclick(evt:any, x:number, y:number):void;
pointerdown(evt:any, x:number, y:number):void;
pointermove(evt:any, x:number, y:number):void;
pointerup(evt:any, x:number, y:number):void;
}
class LinkView extends CellView {
getConnectionLength(): number;
getPointAtLength(length: number): { x: number; y: number; };
getConnectionLength():number;
getPointAtLength(length:number):{ x: number; y: number; };
}
}
module ui {
interface Handle {
name : string;
position : string;
icon: string;
}
class SelectionView extends Backbone.Model {
paper:joint.dia.Paper;
graph:joint.dia.Graph;
model:Backbone.Collection<joint.dia.Cell>;
constructor(opt:{
paper : joint.dia.Paper;
graph : joint.dia.Graph;
model : Backbone.Collection<joint.dia.Cell>
});
createSelectionBox(cellView:joint.dia.CellView);
destroySelectionBox(cellView:joint.dia.CellView);
startSelecting(evt:any);
cancelSelection();
addHandle(handle:Handle);
removeHandle(name:string);
changeHandle(name:string, handle:Handle);
}
}
module ui {}
module shapes {
module basic {
class Generic extends joint.dia.Element { }
class Rect extends Generic { }
class Text extends Generic { }
class Circle extends Generic { }
class Image extends Generic { }
class Generic extends joint.dia.Element {
}
class Rect extends Generic {
}
class Text extends Generic {
}
class Circle extends Generic {
}
class Image extends Generic {
}
}
}
module util {
function uuid(): string;
function guid(obj: any): string;
function mixin(objects: any[]): any;
function supplement(objects: any[]): any;
function deepMixin(objects: any[]): any;
function deepSupplement(objects: any[], defaultIndicator?: any): any;
function uuid():string;
function guid(obj:any):string;
function mixin(objects:any[]):any;
function supplement(objects:any[]):any;
function deepMixin(objects:any[]):any;
function deepSupplement(objects:any[], defaultIndicator?:any):any;
}
}
+6
View File
@@ -0,0 +1,6 @@
// Type definitions for jQuery jqgrid Plugin 1.3
// Definitions by: Lokesh Peta <https://github.com/lokeshpeta/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
///<reference path="../jquery/jquery.d.ts" />
/// <reference path="jqgrid.d.ts" />
+64
View File
@@ -0,0 +1,64 @@
// Type definitions for jQuery jqgrid Plugin 1.3
// Project: https://github.com/tonytomov/jqGrid
// Definitions by: Lokesh Peta <https://github.com/lokeshpeta/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
///<reference path="../jquery/jquery.d.ts" />
interface JQueryJqGridColumn {
name: string;
index: string;
hidden?: boolean;
sortable?: boolean;
search?: boolean;
width?: number;
formatter?: (cellvalue: any, options: any, rowObject: any) => any;
}
interface IJqGridJsonReader {
repeatitems: boolean;
root(obj: any): any;
page(obj: any): any;
total(obj: any): number;
records(obj: {data: any[]}): number;
}
interface JQueryJqGridOptions {
datatype?: string;
mtype?: string;
autoencode?: boolean;
pager?: string;
rowNum?: number;
rowList?: number[];
colNames?: string[];
colModel?: JQueryJqGridColumn[];
sortname?: string;
sortorder?: string;
multiselect?: boolean;
multiboxonly?: boolean;
forceFit?: boolean;
height?: number;
width?: number;
shrinkToFit?: boolean;
url?: string;
jsonReader?: IJqGridJsonReader;
gridComplete?:()=>void;
}
interface JQueryJqGridStatic {
(): JQuery;
(gridName: string): any;
(gridName: string, propName: string): any;
(gridName: string, obj: any): any;
(gridName: string, id: any, colname: any): any;
(options: JQueryJqGridOptions): JQuery;
}
interface JQueryStatic {
jqGrid?: JQueryJqGridStatic;
}
interface JQuery {
jqGrid?: JQueryJqGridStatic;
setGridParam(obj: any): void;
}
+1
View File
@@ -0,0 +1 @@
--noImplicitAny --module commonjs --target es5
+23
View File
@@ -0,0 +1,23 @@
/// <reference path="jquery-galleria.d.ts" />
module JqueryGalleriaTests {
var container = document.createElement("galleria");
var gOptions: GalleriaJS.GalleriaOptions;
gOptions.lightbox = true;
gOptions.autoplay = true;
Galleria.run("galleria", gOptions);
gOptions.lightbox = false;
Galleria.ready(function() {
this.configure(gOptions).refreshImage();
});
Galleria.run("galleria");
gOptions.autoplay = false;
Galleria.run();
}
+39
View File
@@ -0,0 +1,39 @@
// Type definitions for galleria.js v1.4.2
// Project: https://github.com/aino/galleria
// Definitions by: Robert Imig <https://github.com/rimig>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module GalleriaJS {
interface GalleriaOptions {
dataSource: GalleriaEntry[];
autoplay?: boolean;
lightbox?: boolean;
}
interface GalleriaEntry {
image?: string;
thumbnail?: string;
title?: string;
description?: string;
}
interface GalleriaFactory {
run(): GalleriaFactory;
run(selector: String): GalleriaFactory;
run(selector: String, options: GalleriaOptions): GalleriaFactory;
loadTheme(url : String): GalleriaFactory;
configure(options: GalleriaOptions): GalleriaFactory;
ready( method: () => any): void;
refreshImage(): GalleriaFactory;
resize(): GalleriaFactory;
load( data: GalleriaEntry[]): GalleriaFactory;
setOptions( options: GalleriaOptions): GalleriaFactory;
}
}
declare var Galleria: GalleriaJS.GalleriaFactory;
+2 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for jQuery contextMenu 1.5.25
// Type definitions for jQuery contextMenu 1.6.6
// Project: http://medialize.github.com/jQuery-contextMenu/
// Definitions by: Natan Vivo <https://github.com/nvivo/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -30,4 +30,5 @@ interface JQueryContextMenuOptions {
interface JQueryStatic {
contextMenu(options?: JQueryContextMenuOptions): JQuery;
contextMenu(type: string): JQuery;
}
+16 -13
View File
@@ -47,7 +47,6 @@ interface NotyCallbackOptions {
}
interface NotyStatic {
(notyOptions: NotyOptions);
defaults: NotyOptions;
@@ -57,23 +56,27 @@ interface NotyStatic {
closeAll();
setText(id: any, text: string);
setType(id: any, type: string);
}
interface Noty {
(notyOptions: NotyOptions);
show();
close();
setText(text: string);
setType(type: string);
setTimeout(timeout: number);
closed: boolean;
shown: boolean;
}
interface JQueryStatic {
noty: NotyStatic;
}
declare var noty: {
(notyOptions: NotyOptions);
show();
close();
setText(text: string);
setType(type: string);
setTimeout(timeout: number);
closed: boolean;
shown: boolean;
interface JQuery {
noty: Noty;
}
declare var noty: Noty;
+11 -51
View File
@@ -286,9 +286,8 @@ interface JQueryPromiseCallback<T> {
(value?: T, ...args: any[]): void;
}
interface JQueryPromiseOperator<T, R> {
(callback: JQueryPromiseCallback<T>, ...callbacks: JQueryPromiseCallback<T>[]): JQueryPromise<R>;
(callback: JQueryPromiseCallback<T>[], ...callbacks: JQueryPromiseCallback<T>[]): JQueryPromise<R>;
interface JQueryPromiseOperator<T, U> {
(callback1: JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[], ...callbacksN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryPromise<U>;
}
/**
@@ -301,28 +300,27 @@ interface JQueryPromise<T> {
* @param alwaysCallbacks1 A function, or array of functions, that is called when the Deferred is resolved or rejected.
* @param alwaysCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected.
*/
always: JQueryPromiseOperator<any, T>;
always(alwaysCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...alwaysCallbacksN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryDeferred<T>;
/**
* Add handlers to be called when the Deferred object is resolved.
*
* @param doneCallbacks1 A function, or array of functions, that are called when the Deferred is resolved.
* @param doneCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved.
*/
done: JQueryPromiseOperator<T, T>;
done(doneCallback1?: JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[], ...doneCallbackN: Array<JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[]>): JQueryDeferred<T>;
/**
* Add handlers to be called when the Deferred object is rejected.
*
* @param failCallbacks1 A function, or array of functions, that are called when the Deferred is rejected.
* @param failCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is rejected.
*/
fail: JQueryPromiseOperator<any, T>;
fail(failCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...failCallbacksN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryDeferred<T>;
/**
* Add handlers to be called when the Deferred object generates progress notifications.
*
* @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications.
*/
progress(progressCallback: JQueryPromiseCallback<T>): JQueryPromise<T>;
progress(progressCallbacks: JQueryPromiseCallback<T>[]): JQueryPromise<T>;
progress(progressCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...progressCallbackN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryDeferred<T>;
/**
* Determine the current state of a Deferred object.
@@ -356,50 +354,12 @@ interface JQueryPromise<T> {
* Interface for the JQuery deferred, part of callbacks
*/
interface JQueryDeferred<T> extends JQueryPromise<T> {
/**
* Add handlers to be called when the Deferred object is either resolved or rejected.
*
* @param alwaysCallbacks1 A function, or array of functions, that is called when the Deferred is resolved or rejected.
* @param alwaysCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected.
*/
always(alwaysCallbacks1?: JQueryPromiseCallback<T>, ...alwaysCallbacks2: JQueryPromiseCallback<T>[]): JQueryDeferred<T>;
always(alwaysCallbacks1?: JQueryPromiseCallback<T>[], ...alwaysCallbacks2: JQueryPromiseCallback<T>[]): JQueryDeferred<T>;
always(alwaysCallbacks1?: JQueryPromiseCallback<T>, ...alwaysCallbacks2: any[]): JQueryDeferred<T>;
always(alwaysCallbacks1?: JQueryPromiseCallback<T>[], ...alwaysCallbacks2: any[]): JQueryDeferred<T>;
/**
* Add handlers to be called when the Deferred object is resolved.
*
* @param doneCallbacks1 A function, or array of functions, that are called when the Deferred is resolved.
* @param doneCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved.
*/
done(doneCallbacks1?: JQueryPromiseCallback<T>, ...doneCallbacks2: JQueryPromiseCallback<T>[]): JQueryDeferred<T>;
done(doneCallbacks1?: JQueryPromiseCallback<T>[], ...doneCallbacks2: JQueryPromiseCallback<T>[]): JQueryDeferred<T>;
done(doneCallbacks1?: JQueryPromiseCallback<T>, ...doneCallbacks2: any[]): JQueryDeferred<T>;
done(doneCallbacks1?: JQueryPromiseCallback<T>[], ...doneCallbacks2: any[]): JQueryDeferred<T>;
/**
* Add handlers to be called when the Deferred object is rejected.
*
* @param failCallbacks1 A function, or array of functions, that are called when the Deferred is rejected.
* @param failCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is rejected.
*/
fail(failCallbacks1?: JQueryPromiseCallback<T>, ...failCallbacks2: JQueryPromiseCallback<T>[]): JQueryDeferred<T>;
fail(failCallbacks1?: JQueryPromiseCallback<T>[], ...failCallbacks2: JQueryPromiseCallback<T>[]): JQueryDeferred<T>;
fail(failCallbacks1?: JQueryPromiseCallback<T>, ...failCallbacks2: any[]): JQueryDeferred<T>;
fail(failCallbacks1?: JQueryPromiseCallback<T>[], ...failCallbacks2: any[]): JQueryDeferred<T>;
/**
* Add handlers to be called when the Deferred object generates progress notifications.
*
* @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications.
*/
progress(progressCallback: JQueryPromiseCallback<T>): JQueryDeferred<T>;
progress(progressCallbacks: JQueryPromiseCallback<T>[]): JQueryDeferred<T>;
/**
* Call the progressCallbacks on a Deferred object with the given args.
*
* @param args Optional arguments that are passed to the progressCallbacks.
*/
notify(...args: any[]): JQueryDeferred<T>;
notify(value?: any, ...args: any[]): JQueryDeferred<T>;
/**
* Call the progressCallbacks on a Deferred object with the given context and args.
@@ -407,21 +367,21 @@ interface JQueryDeferred<T> extends JQueryPromise<T> {
* @param context Context passed to the progressCallbacks as the this object.
* @param args Optional arguments that are passed to the progressCallbacks.
*/
notifyWith(context: any, ...args: any[]): JQueryDeferred<T>;
notifyWith(context: any, value?: any, ...args: any[]): JQueryDeferred<T>;
/**
* Reject a Deferred object and call any failCallbacks with the given args.
*
* @param args Optional arguments that are passed to the failCallbacks.
*/
reject(...args: any[]): JQueryDeferred<T>;
reject(value?: any, ...args: any[]): JQueryDeferred<T>;
/**
* Reject a Deferred object and call any failCallbacks with the given context and args.
*
* @param context Context passed to the failCallbacks as the this object.
* @param args An optional array of arguments that are passed to the failCallbacks.
*/
rejectWith(context: any, ...args: any[]): JQueryDeferred<T>;
rejectWith(context: any, value?: any, ...args: any[]): JQueryDeferred<T>;
/**
* Resolve a Deferred object and call any doneCallbacks with the given args.
@@ -437,7 +397,7 @@ interface JQueryDeferred<T> extends JQueryPromise<T> {
* @param context Context passed to the doneCallbacks as the this object.
* @param args An optional array of arguments that are passed to the doneCallbacks.
*/
resolveWith(context: any, ...args: any[]): JQueryDeferred<T>;
resolveWith(context: any, value?: T, ...args: any[]): JQueryDeferred<T>;
/**
* Return a Deferred's Promise object.
+78
View File
@@ -0,0 +1,78 @@
/// <reference path="js-data-angular.d.ts" />
interface IUser {
}
interface CustomScope extends ng.IScope {
comments: Array<any>;
user: IUser;
users: Array<IUser>;
}
angular.module('myApp')
.controller('commentsCtrl', function ($scope:CustomScope, store:JSData.DS, Comment:JSData.DSResourceDefinition<any>, User:JSData.DSResourceDefinition<any>) {
Comment.findAll().then(function (comments) {
$scope.comments = comments;
});
// shortest version
User.bindOne(1, $scope, 'user');
// short version
store.bindOne('user', 1, $scope, 'user');
// long version
$scope.$watch(function () {
return store.lastModified('user', 1);
}, function () {
$scope.user = store.get<IUser>('user', 1);
});
var params = {
where: {
age: {
'>': 30
}
}
};
// shortest verions
User.bindAll(params, $scope, 'users');
// short version
store.bindAll('user', params, $scope, 'users');
// long version
$scope.$watch(function () {
return store.lastModified('user');
}, function () {
$scope.users = store.filter('user', params);
});
});
angular.module('myApp')
.run(function (DS:JSData.DS) {
// We don't register the "User" resource
// as a service, so it can only be used
// via DS.<method>('user', ...)
// The advantage here is that this code
// is guaranteed to be executed, and you
// only ever have to inject "DS"
DS.defineResource('user');
})
.factory('Comment', function (DS:JSData.DS) {
// This code won't execute unless you actually
// inject "Comment" somewhere in your code.
// Thanks Angular...
// Some like injecting actual Resource
// definitions, instead of just "DS"
return DS.defineResource('comment');
});
angular.module('myApp')
.config(function (DSProvider:JSData.DSProvider) {
DSProvider.defaults.basePath = '/myApi'; // etc.
});
+28
View File
@@ -0,0 +1,28 @@
// Type definitions for JSDataAngular v2.1.0
// Project: https://github.com/js-data/js-data-angular
// Definitions by: Stefan Steinhart <https://github.com/reppners>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../js-data/js-data.d.ts" />
/// <reference path="../angularjs/angular.d.ts" />
declare module JSData {
interface DSProvider {
defaults:DSConfiguration;
}
interface DS {
bindAll<T>(resourceName:string, params:DSFilterParams, scope:ng.IScope, expr:string, cb?:(err:DSError, items:Array<T>)=>void):Function;
bindOne<T>(resourceName:string, id:string | number, scope:ng.IScope, expr:string, cb?:(err:DSError, item:T)=>void):Function;
}
interface DSResourceDefinition<T> {
bindAll<T>(params:DSFilterParams, scope:ng.IScope, expr:string, cb?:(err:DSError, items:Array<T>)=>void):Function;
bindOne<T>(id:string | number, scope:ng.IScope, expr:string, cb?:(err:DSError, item:T)=>void):Function;
}
}
+167
View File
@@ -0,0 +1,167 @@
/// <reference path="js-data-http.d.ts" />
var adapter = new DSHttpAdapter();
var store = new JSData.DS();
store.registerAdapter('http', adapter, { default: true });
var ADocument:JSData.DSResourceDefinition<any> = store.defineResource<any>('document');
ADocument.inject({ id: 5, author: 'John' });
// bypass the data store
adapter.update(ADocument, 5, { author: 'Johnny' }).then(function (document:any) {
document; // { id: 5, author: 'Johnny' }
// The updated document has NOT been injected into the data store because we bypassed the data store
ADocument.get(document.id); // { id: 5, author: 'John' }
});
// Normally you would just go through the data store
ADocument.update(5, { author: 'Johnny' }).then(function (document:any) {
document; // { id: 5, author: 'Johnny' }
// the updated document has been injected into the data store
ADocument.get(document.id); // { id: 5, author: 'Johnny' }
});
ADocument.inject({ id: 5, author: 'John' });
ADocument.inject({ id: 6, author: 'John' });
// bypass the data store
adapter.updateAll(ADocument, { author: 'Johnny' }, { author: 'John' }).then(function (documents) {
documents[0]; // { id: 5, author: 'Johnny' }
// The updated documents have NOT been injected into the data store because we bypassed the data store
ADocument.filter({ author: 'John' }); // [{...}, {...}]
ADocument.filter({ author: 'Johnny' }); // []
});
// Normally you would just go through the data store
ADocument.updateAll({ author: 'Johnny' }, { author: 'John' }).then(function (documents) {
documents[0]; // { id: 5, author: 'Johnny' }
// the updated documents have been injected into the data store
ADocument.filter({ author: 'John' }); // []
ADocument.filter({ author: 'Johnny' }); // [{...}, {...}]
});
adapter.PUT('/user/1', { name: 'Johnny' }).then(function (data) {
data.data; // { id: 1, name: 'Johnny', ... }
data.headers; // {...}
data.status; // 200
data.config; //{...}
});
adapter.POST('/user/1', { name: 'John' }).then(function (data) {
data.data; // { id: 1, name: 'John', ... }
data.headers; // {...}
data.status; // 200
data.config; //{...}
});
adapter.HTTP({ url: '/user/1', method: 'put', data: { name: 'Johnny' }}).then(function (data) {
data.data; // { id: 1, name: 'Johnny', ... }
data.headers; // {...}
data.status; // 200
data.config; //{...}
});
adapter.GET('/user/1').then(function (data) {
data.data; // { id: 1, ... }
data.headers; // {...}
data.status; // 200
data.config; //{...}
});
var User:JSData.DSResourceDefinition<any> = store.defineResource('user');
var params:any = {
age: {
'>': 30
}
};
// bypass the data store
adapter.findAll(User, params).then(function (users) {
// users[0].age; 55 // etc., etc.
// the users have NOT been injected into the data store because we bypassed the data store
User.filter(params); // []
});
// normally you would go through the data store
User.findAll(params).then(function (users) {
// users[0].age; 55 // etc., etc.
// the users have been injected into the data store
User.filter(params); // [{...}, {...}, ...]
});
// bypass the data store
adapter.find(ADocument, 5).then(function (document:any) {
document; // { id: 5, author: 'John Anderson' }
// the document has NOT been injected into the data store because we bypassed the data store
ADocument.get(document.id); // undefined
});
// Normally you would just go through the data store
ADocument.find(5).then(function (document:any) {
document; // { id: 5, author: 'John Anderson' }
// the document has been injected into the data store
ADocument.get(document.id); // { id: 5, author: 'John Anderson' }
});
var params:any = {
author: 'John'
};
// bypass the data store
adapter.destroyAll(ADocument, params).then(function () {
// the documents have NOT been ejected from the data store because we bypassed the data store
ADocument.filter(params); // [{...}, {...}, ...]
});
// normally you would go through the data store
ADocument.destroyAll(params).then(function () {
// the documents have been ejected from the data store
ADocument.filter(params); // []
});
ADocument.inject({ id: 5, author: 'John' });
// bypass the data store
adapter.destroy(ADocument, 5).then(function () {
// the document is still in the data store because we bypassed the data store
//ADocument.get(document.id); // { id: 5, author: 'John' }
});
// Normally you would just go through the data store
ADocument.destroy(5).then(function () {
// the document has been ejected from the data store
//ADocument.get(document.id); // undefined
});
adapter.DEL('/user/1').then(function (data) {
data.data; // 1
data.headers; // {...}
data.status; // 204
data.config; //{...}
});
// bypass the data store
adapter.create(ADocument, { author: 'John' }).then(function (document:any) {
document; // { id: 5, author: 'John' }
// The new document has NOT been injected into the data store because we bypassed the data store
ADocument.get(document.id); // undefined
});
// Normally you would just go through the data store
ADocument.create({ author: 'John' }).then(function (document:any) {
document; // { id: 5, author: 'John' }
// the new document has been injected into the data store
ADocument.get(document.id); // { id: 5, author: 'John' }
});
+40
View File
@@ -0,0 +1,40 @@
// Type definitions for JSData Http Adapter v1.2.0
// Project: https://github.com/js-data/js-data-http
// Definitions by: Stefan Steinhart <https://github.com/reppners>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../js-data/js-data.d.ts" />
declare module JSData {
interface DSHttpAdapterOptions {
serialize?: (resourceName:string, data:any)=>any;
deserialize?: (resourceName:string, data:any)=>any;
queryTransform?: (resourceName:string, params:DSFilterParams)=>any;
httpConfig?: any;
forceTrailingSlash?: boolean;
log?: boolean | ((message?:any, ...optionalParams:any[])=> void);
error?: boolean | ((message?:any, ...optionalParams:any[])=> void);
}
interface DSHttpAdapterPromiseResolveType {
data: any;
headers: any;
status: number;
config: any;
}
interface DSHttpAdapter extends IDSAdapter {
new(options?:DSHttpAdapterOptions):DSHttpAdapter;
// DSHttpAdapter uses axios so options are axios config objects.
HTTP(options?:Object):JSDataPromise<DSHttpAdapterPromiseResolveType>;
DEL(url:string, data?:Object, options?:Object):JSDataPromise<DSHttpAdapterPromiseResolveType>;
GET(url:string, data?:Object, options?:Object):JSDataPromise<DSHttpAdapterPromiseResolveType>;
POST(url:string, data?:Object, options?:Object):JSDataPromise<DSHttpAdapterPromiseResolveType>;
PUT(url:string, data?:Object, options?:Object):JSDataPromise<DSHttpAdapterPromiseResolveType>;
}
}
declare var DSHttpAdapter:JSData.DSHttpAdapter;
+17
View File
@@ -0,0 +1,17 @@
/// <reference path="js-data.d.ts" />
import JSData = require('js-data');
//TODO
//import DSRedisAdapter = require('js-data-redis')
var store = new JSData.DS();
// register and use http by default for async operations
//TODO
//store.registerAdapter('redis', new DSRedisAdapter(), {default: true});
// simplest model definition
var User = store.defineResource('user');
User.find(1).then(function (user: any) {
user; // { id: 1, name: 'John' }
});
+524
View File
@@ -0,0 +1,524 @@
/// <reference path="js-data.d.ts" />
interface IUser {
id?: number;
name?: string;
age?: number;
first?: string;
last?: string;
comments?:Array<any>;
profile?:any;
}
interface IUserWithMethod extends IUser {
fullName?: () => string;
}
interface IUserWithComputedProperty extends IUser {
fullName?: string;
}
var store = new JSData.DS();
// register and use http by default for async operations
//TODO
//store.registerAdapter('http', new DSHttpAdapter(), {default: true});
// simplest model definition
var User = store.defineResource<IUser>('user');
User.find(1).then(function (user:IUser) {
user; // { id: 1, name: 'John' }
});
var user:IUser = User.createInstance<IUser>({name: 'John'});
var store = new JSData.DS();
var User = store.defineResource('user');
var user:IUser = User.inject<IUser>({id: 1, name: 'John'});
var user2:IUser = User.inject<IUser>({id: 1, age: 30});
user; // User { id: 1, name: 'John', age: 30 }
user2; // User { id: 1, name: 'John', age: 30 }
User.get(1); // User { id: 1, name: 'John', age: 30 }
user === user2; // true
user === User.get(1); // true
user2 === User.get(1); // true
var store = new JSData.DS({
// set a default lifecycle hook
afterCreate: function () {
}
});
var User = store.defineResource<IUser>({
name: 'user',
// override the hook for this resource
afterCreate: function () {
}
});
User.create({
name: 'john'
}, {
// override the hook just for this method call
afterCreate: function () {
}
}).then(()=> {
});
var store = new JSData.DS();
var UserWithMethod = store.defineResource<IUserWithMethod>({
name: 'user',
methods: {
fullName: function () {
return this.first + ' ' + this.last;
}
}
});
var userWithMethod = UserWithMethod.createInstance<IUserWithMethod>({first: 'John', last: 'Anderson'});
userWithMethod.fullName(); // "John Anderson"
var store = new JSData.DS();
var UserWithComputedProperty = store.defineResource<IUserWithComputedProperty>({
name: 'user',
computed: {
// each function's argument list defines the fields
// that the computed property depends on
fullName: ['first', 'last', function (first:string, last:string) {
return first + ' ' + last;
}],
// shortand, use the array syntax above if you want
// you computed properties to work after you've
// minified your code. Shorthand style won't work when minified
initials: function (first:string, last:string) {
return first.toUpperCase()[0] + '. ' + last.toUpperCase()[0] + '.';
}
}
});
var userWithComputedProperty:IUserWithComputedProperty = UserWithComputedProperty.inject<IUserWithComputedProperty>({
id: 1,
first: 'John',
last: 'Anderson'
});
userWithComputedProperty.fullName; // "John Anderson"
userWithComputedProperty.first = 'Fred';
// js-data relies on dirty-checking, so the
// computed property (probably) hasn't been updated yet
userWithComputedProperty.fullName; // "John Anderson"
// If your browser supports Object.observe this will have no effect
// otherwise it will trigger the dirty-checking
store.digest();
userWithComputedProperty.fullName; // "Fred Anderson"
interface IComment {
comments?: any;
profile?: any;
}
var aComment:JSData.DSResourceDefinition<IComment> = store.defineResource<IComment>('comment');
// Get all comments where comment.userId == 5
aComment.filter({
where: {
userId: {
'==': 5
}
}
});
// Get all comments where comment.userId == 5
aComment.filter({
userId: 5
});
// Get all comments where comment.userId === 5
aComment.filter({
where: {
userId: {
'===': 5
}
}
});
// Get all comments where comment.userId != 5
aComment.filter({
where: {
userId: {
'!=': 5
}
}
});
// Get all comments where comment.userId !== 5
aComment.filter({
where: {
userId: {
'!==': 5
}
}
});
// Get all users where user.age > 30
User.filter({
where: {
age: {
'>': 30
}
}
});
// Get all users where user.age >= 30
User.filter({
where: {
age: {
'>=': 30
}
}
});
// Get all users where user.age < 30
User.filter({
where: {
age: {
'<': 30
}
}
});
// Get all users where user.name is in "John Anderson"
User.filter({
where: {
name: {
'in': 'John Anderson'
}
}
});
// Get all users where user.role is in ["admin", "owner"]
User.filter({
where: {
role: {
'in': ['admin', 'owner']
}
}
});
// Get all users where user.name is NOT in "John Anderson"
User.filter({
where: {
name: {
'notIn': 'John Anderson'
}
}
});
// Get all users where user.role is NOT in ["admin", "owner"]
User.filter({
where: {
role: {
'notIn': ['admin', 'owner']
}
}
});
// Get all users where user.name contains "John"
User.filter({
where: {
name: {
'contains': 'John'
}
}
});
// Get all users where user.roles contains "admin"
User.filter({
where: {
roles: {
'contains': 'admin'
}
}
});
// Sorts users by age in ascending order
User.filter({
orderBy: 'age'
});
// Sorts users by age in descending order
User.filter({
orderBy: ['age', 'DESC']
});
// Sorts users by age in descending order and then sort by name in ascending order to break a tie
User.filter({
orderBy: [
['age', 'DESC'],
['name', 'ASC']
]
});
var PAGE_SIZE = 20;
var currentPage = 1;
interface IPost {
}
var Post:JSData.DSResourceDefinition<IPost>;
// Grab the first "page" of posts
Post.filter({
offset: PAGE_SIZE * (currentPage - 1),
limit: PAGE_SIZE
});
var User = store.defineResource({
name: 'user',
relations: {
hasMany: {
comment: {
localField: 'comments',
foreignKey: 'userId'
}
},
hasOne: {
profile: {
localField: 'profile',
foreignKey: 'userId'
}
},
belongsTo: {
organization: {
localKey: 'organizationId',
localField: 'organization',
// if you add this to a belongsTo relation
// then js-data will attempt to use
// a nested url structure, e.g. /organization/15/user/4
parent: true
}
}
}
});
var Organization = store.defineResource({
name: 'organization',
relations: {
hasMany: {
// this is an example of multiple relations
// of the same type to the same resource
user: [
{
localField: 'users',
foreignKey: 'organizationId'
},
{
localField: 'owners',
foreignKey: 'organizationId'
}
]
}
}
});
var Profile = store.defineResource({
name: 'profile',
relations: {
belongsTo: {
user: {
localField: 'user',
localKey: 'userId'
}
}
}
});
var OtherComment = store.defineResource<IComment>({
name: 'comment',
relations: {
belongsTo: {
user: {
localField: 'user',
localKey: 'userId'
}
}
}
});
User.find(10).then(function (user:IUser) {
// let's assume the server only returned the user
user.comments; // undefined
user.profile; // undefined
User.loadRelations(user, ['comment', 'profile']).then(function (user:IUser) {
user.comments; // array
user.profile; // object
});
});
var OtherOtherComment = store.defineResource<IComment>({
name: 'comment',
relations: {
belongsTo: {
post: {
parent: true,
localKey: 'postId',
localField: 'post'
}
}
}
});
// The comment isn't in the data store yet, so js-data wouldn't know
// what the id of the parent "post" would be, so we pass it in manually
OtherOtherComment.find(5, {params: {postId: 4}}); // GET /post/4/comment/5
// vs
var promise = OtherOtherComment.find(5); // GET /comment/5
promise.then().catch().finally();
OtherOtherComment.inject({id: 1, postId: 2});
// We don't have to provide the parentKey here
// because js-data found it in the comment
OtherOtherComment.update(1, {content: 'stuff'}); // PUT /post/2/comment/1
// If you don't want the nested for just one of the calls then
// you can do the following:
OtherOtherComment.update(1, {content: 'stuff'}, {params: {postId: false}}); // PUT /comment/1
var store = new JSData.DS({
// set the default
beforeCreate: function (resource, data, cb) {
// do something general
cb(null, data);
}
});
var User = store.defineResource({
name: 'user',
// set just for this resource
beforeCreate: function (resource, data, cb) {
// do something more specific to "users"
cb(null, data);
}
});
User.create({name: 'John'}, {
// set just for this method call
beforeCreate: function (resource, data, cb) {
// do something specific for this method call
cb(null, data);
}
});
module CustomAdapterTest {
class MyCustomAdapter implements JSData.IDSAdapter {
// All of the methods shown here must return a promise
// "definition" is a resource defintion that would
// be returned by DS#defineResource
// "options" would be the options argument that
// was passed into the DS method that is calling
// the adapter method
create(definition:JSData.DSResourceDefinition<any>, attrs:Object, options:JSData.DSConfiguration):JSData.JSDataPromise<any> {
// Must resolve the promise with the created item
var promise:JSData.JSDataPromise<any>;
return promise;
}
find(definition:JSData.DSResourceDefinition<any>, id:any, options:JSData.DSConfiguration):JSData.JSDataPromise<any> {
// Must resolve the promise with the found item
var promise:JSData.JSDataPromise<any>;
return promise;
}
findAll(definition:JSData.DSResourceDefinition<any>, params:JSData.DSFilterParams, options:JSData.DSConfiguration):JSData.JSDataPromise<any> {
// Must resolve the promise with the found items
var promise:JSData.JSDataPromise<any>;
return promise;
}
update(definition:JSData.DSResourceDefinition<any>, id:any, attrs:Object, options:JSData.DSConfiguration):JSData.JSDataPromise<any> {
// Must resolve the promise with the updated items
var promise:JSData.JSDataPromise<any>;
return promise;
}
updateAll(definition:JSData.DSResourceDefinition<any>, attrs:Object, params:JSData.DSFilterParams, options:JSData.DSConfiguration):JSData.JSDataPromise<any> {
// Must resolve the promise with the updated items
var promise:JSData.JSDataPromise<any>;
return promise;
}
destroy(definition:JSData.DSResourceDefinition<any>, id:any, options:JSData.DSConfiguration):JSData.JSDataPromise<any> {
// Must return a promise
var promise:JSData.JSDataPromise<any>;
return promise;
}
destroyAll(definition:JSData.DSResourceDefinition<any>, params:JSData.DSFilterParams, options:JSData.DSConfiguration):JSData.JSDataPromise<any> {
// Must return a promise
var promise:JSData.JSDataPromise<any>;
return promise;
}
}
var store = new JSData.DS();
store.registerAdapter('mca', new MyCustomAdapter(), {default: true});
// the data store will now use your custom adapter by default
}
/**
* showing the use of open ended interface to realize typings
* on the Datastore.definitions object where all resource definitions
* are saved.
*/
interface MyCustomDataStore {
myResource: JSData.DSResourceDefinition<MyResourceDefinition>
}
interface MyResourceDefinition {
}
module JSData {
interface DS {
definitions: MyCustomDataStore;
}
}
var store = new JSData.DS();
var myResourceDefinition = store.defineResource<MyResourceDefinition>('myResource');
myResourceDefinition = store.definitions.myResource;
+285
View File
@@ -0,0 +1,285 @@
// Type definitions for JSData v1.5.4
// Project: https://github.com/js-data/js-data
// Definitions by: Stefan Steinhart <https://github.com/reppners>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
///////////////////////////////////////////////////////////////////////////////
// js-data module (js-data.js)
///////////////////////////////////////////////////////////////////////////////
// defining what exists in JSData and how it looks
declare module JSData {
interface JSDataPromise<R> {
then<U>(onFulfilled?: (value: R) => U | JSDataPromise<U>, onRejected?: (error: any) => U | JSDataPromise<U>): JSDataPromise<U>;
catch<U>(onRejected?: (error: any) => U | JSDataPromise<U>): JSDataPromise<U>;
// enhanced with finally
finally<U>(finallyCb?:() => U):JSDataPromise<U>;
}
//TODO switch to class again when typescript supports open ended class declaration
interface DS {
new(config?:DSConfiguration):DS;
// rather undocumented
errors:DSErrors;
// those are objects containing the defined resources and adapters
definitions:any;
adapters:any;
defaults:DSConfiguration;
// async
create<T>(resourceName:string, attrs:Object, options?:DSConfiguration):JSDataPromise<T>;
destroy(resourceName:string, id:string | number, options?:DSAdapterOperationConfiguration):JSDataPromise<any>;
destroyAll(resourceName:string, params?:DSFilterParams, options?:DSAdapterOperationConfiguration):JSDataPromise<any>;
find<T>(resourceName:string, id:string | number, options?:DSAdapterOperationConfiguration):JSDataPromise<T>;
findAll<T>(resourceName:string, params?:DSFilterParams, options?:DSAdapterOperationConfiguration):JSDataPromise<Array<T>>;
loadRelations<T>(resourceName:string, idOrInstance:string | number | Object, relations:string | Array<string>, options?:DSAdapterOperationConfiguration):JSDataPromise<T>;
update<T>(resourceName:string, id:string | number, attrs:Object, options?:DSSaveConfiguration):JSDataPromise<T>;
updateAll<T>(resourceName:string, attrs:Object, params?:DSFilterParams, options?:DSAdapterOperationConfiguration):JSDataPromise<Array<T>>;
reap(resourceName:string, options?:DSConfiguration):JSDataPromise<any>;
refresh<T>(resourceName:string, id:string | number, options?:DSAdapterOperationConfiguration):JSDataPromise<T>;
save<T>(resourceName:string, id:string | number, options?:DSSaveConfiguration):JSDataPromise<T>;
// sync
changeHistory(resourceName:string, id?:string | number):Array<Object>;
changes(resourceName:string, id:string | number):Object;
compute<T>(resourceName:string, idOrInstance:number | string | Object ):T;
createInstance<T>(resourceName:string, attrs?:T, options?:DSAdapterOperationConfiguration):T;
defineResource<T>(resourceNameOrDefinition:string | DSResourceDefinitionConfiguration):DSResourceDefinition<T>;
digest():void;
eject<T>(resourceName:string, id:string | number, options?:DSConfiguration):T;
ejectAll<T>(resourceName:string, params:DSFilterParams, options?:DSConfiguration):Array<T>;
filter<T>(resourceName:string, params:DSFilterParams, options?:DSConfiguration):Array<T>;
get<T>(resourceName:string, id:string | number, options?:DSConfiguration):T;
getAll<T>(resourceName:string, ids?:Array<string | number>):Array<T>;
hasChanges(resourceName:string, id:string | number):boolean;
inject<T>(resourceName:string, attrs:T, options?:DSConfiguration):T;
inject<T>(resourceName:string, items:Array<T>, options?:DSConfiguration):Array<T>;
is(resourceName:string, object:Object): boolean;
lastModified(resourceName:string, id?:string | number):number; // timestamp
lastSaved(resourceName:string, id?:string | number):number; // timestamp
link<T>(resourceName:string, id:string | number, relations?:Array<string>):T;
linkAll<T>(resourceName:string, params:DSFilterParams, relations?:Array<string>):T;
linkInverse<T>(resourceName:string, id:string | number, relations?:Array<string>):T;
previous<T>(resourceName:string, id:string | number):T;
unlinkInverse<T>(resourceName:string, id:string | number, relations?:Array<string>):T;
registerAdapter(adapterId:string, adapter:IDSAdapter, options?:{default: boolean}):void;
}
interface DSConfiguration extends IDSResourceLifecycleEventHandlers {
actions?: Object;
allowSimpleWhere?: boolean;
basePath?: string;
bypassCache?: boolean;
cacheResponse?: boolean;
defaultAdapter?: string;
defaultFilter?: (collection:Array<any>, resourceName:string, params:DSFilterParams, options:DSConfiguration)=>Array<any>;
eagerEject?: boolean;
// TODO enable when eagerInject in DS#create is implemented
//eagerInject?: boolean;
endpoint?: string;
error?: boolean | ((message?:any, ...optionalParams:any[])=> void);
fallbackAdapters?: Array<string>;
findAllFallbackAdapters?: Array<string>;
findAllStrategy?: string;
findBelongsTo?: boolean;
findFallbackAdapters?: Array<string>;
findHasOne?: boolean;
findHasMany?: boolean;
findInverseLinks?: boolean;
findStrategy?: string
idAttribute?: string;
ignoredChanges?: Array<RegExp | string>;
// TODO ignoreMissing is undocumented
//ignoreMissing: boolean;
keepChangeHistory?: boolean;
loadFromServer?: boolean;
log?: boolean | ((message?: any, ...optionalParams: any[])=> void);
maxAge?: number;
notify?: boolean;
reapAction?: string;
reapInterval?: number;
resetHistoryOnInject?: boolean;
strategy?: string;
upsert?: boolean;
useClass?: boolean;
useFilter?: boolean;
}
interface DSAdapterOperationConfiguration extends DSConfiguration {
adapter?: string
}
interface DSSaveConfiguration extends DSAdapterOperationConfiguration {
changesOnly?: boolean;
}
interface DSResourceDefinitionConfiguration extends DSConfiguration {
name: string;
computed?: any;
methods?: any;
relations?: {
hasMany?: Object;
hasOne?: Object;
belongsTo?: Object;
};
}
interface DSResourceDefinition<T> extends DSResourceDefinitionConfiguration {
//async
create<T>(attrs:Object, options?:DSConfiguration):JSDataPromise<T>;
destroy(id:string | number, options?:DSAdapterOperationConfiguration):JSDataPromise<any>;
destroyAll(params?:DSFilterParams, options?:DSAdapterOperationConfiguration):JSDataPromise<any>;
find<T>(id:string | number, options?:DSAdapterOperationConfiguration):JSDataPromise<T>;
findAll<T>(params?:DSFilterParams, options?:DSAdapterOperationConfiguration):JSDataPromise<Array<T>>;
loadRelations<T>(idOrInstance:string | number | Object, relations:string | Array<string>, options?:DSAdapterOperationConfiguration):JSDataPromise<T>;
update<T>(id:string | number, attrs:Object, options?:DSSaveConfiguration):JSDataPromise<T>;
updateAll<T>(attrs:Object, params?:DSFilterParams, options?:DSAdapterOperationConfiguration):JSDataPromise<Array<T>>;
reap(resourceNametions?:DSConfiguration):JSDataPromise<any>;
refresh<T>(id:string | number, options?:DSAdapterOperationConfiguration):JSDataPromise<T>;
save<T>(id:string | number, options?:DSSaveConfiguration):JSDataPromise<T>;
// sync
changeHistory(id?:string | number):Array<Object>;
changes(id:string | number):Object;
compute<T>(idOrInstance:number | string | Object ):T;
createInstance<T>(attrs?:T, options?:DSAdapterOperationConfiguration):T;
digest():void;
eject<T>(id:string | number, options?:DSConfiguration):T;
ejectAll<T>(params:DSFilterParams, options?:DSConfiguration):Array<T>;
filter<T>(params:DSFilterParams, options?:DSConfiguration):Array<T>;
get<T>(id:string | number, options?:DSConfiguration):T;
getAll<T>(ids?:Array<string | number>):Array<T>;
hasChanges(id:string | number):boolean;
inject<T>(attrs:T, options?:DSConfiguration):T;
inject<T>(items:Array<T>, options?:DSConfiguration):Array<T>;
is(object:Object): boolean;
lastModified(id?:string | number):number; // timestamp
lastSaved(id?:string | number):number; // timestamp
link<T>(id:string | number, relations?:Array<string>):T;
linkAll<T>(params:DSFilterParams, relations?:Array<string>):T;
linkInverse<T>(id:string | number, relations?:Array<string>):T;
previous<T>(id:string | number):T;
unlinkInverse<T>(id:string | number, relations?:Array<string>):T;
}
interface DSFilterParams {
where?: Object;
limit?: number;
skip?: number;
offset?: number;
orderBy?: string | Array<string> | Array<Array<string>>;
sort?: string | Array<string> | Array<Array<string>>;
}
interface IDSResourceLifecycleValidateEventHandlers {
beforeValidate?: (resourceName:string, data:any, cb:(err:any, data?:any)=>void)=>void;
validate?: (resourceName:string, data:any, cb:(err:any, data?:any)=>void)=>void;
afterValidate?: (resourceName:string, data:any, cb:(err:any, data?:any)=>void)=>void;
}
interface IDSResourceLifecycleCreateEventHandlers {
beforeCreate?: (resourceName:string, data:any, cb:(err:any, data?:any)=>void)=>void;
afterCreate?: (resourceName:string, data:any, cb:(err:any, data?:any)=>void)=>void;
}
interface IDSResourceLifecycleCreateInstanceEventHandlers {
beforeCreateInstance?: (resourceName:string, data:any)=>void;
afterCreateInstance?: (resourceName:string, data:any)=>void;
}
interface IDSResourceLifecycleUpdateEventHandlers {
beforeUpdate?: (resourceName:string, data:any, cb:(err:any, data?:any)=>void)=>void;
afterUpdate?: (resourceName:string, data:any, cb:(err:any, data?:any)=>void)=>void;
}
interface IDSResourceLifecycleDestroyEventHandlers {
beforeDestroy?: (resourceName:string, data:any, cb:(err:any, data?:any)=>void)=>void;
afterDestroy?: (resourceName:string, data:any, cb:(err:any, data?:any)=>void)=>void;
}
interface IDSResourceLifecycleInjectEventHandlers {
beforeInject?: (resourceName:string, data:any)=>void;
afterInject?: (resourceName:string, data:any)=>void;
}
interface IDSResourceLifecycleEjectEventHandlers {
beforeEject?: (resourceName:string, data:any)=>void;
afterEject?: (resourceName:string, data:any)=>void;
}
interface IDSResourceLifecycleReapEventHandlers {
beforeReap?: (resourceName:string, data:any)=>void;
afterReap?: (resourceName:string, data:any)=>void;
}
interface IDSResourceLifecycleEventHandlers extends IDSResourceLifecycleCreateEventHandlers,
IDSResourceLifecycleCreateInstanceEventHandlers,
IDSResourceLifecycleValidateEventHandlers,
IDSResourceLifecycleUpdateEventHandlers,
IDSResourceLifecycleDestroyEventHandlers,
IDSResourceLifecycleInjectEventHandlers,
IDSResourceLifecycleEjectEventHandlers,
IDSResourceLifecycleReapEventHandlers {
}
// errors
interface DSErrors {
// types
IllegalArgumentError:DSError;
IA:DSError;
RuntimeError:DSError;
R:DSError;
NonexistentResourceError:DSError;
NER:DSError;
}
interface DSError extends Error {
new (message?:string):DSError;
message: string;
type: string;
}
// DSAdapter interface
interface IDSAdapter {
create<T>(config:DSResourceDefinition<T>, attrs:Object, options?:DSConfiguration):JSDataPromise<T>;
destroy<T>(config:DSResourceDefinition<T>, id:string | number, options?:DSConfiguration):JSDataPromise<any>;
destroyAll<T>(config:DSResourceDefinition<T>, params:DSFilterParams, options?:DSConfiguration):JSDataPromise<any>;
find<T>(config:DSResourceDefinition<T>, id:string | number, options?:DSConfiguration):JSDataPromise<T>;
findAll<T>(config:DSResourceDefinition<T>, params?:DSFilterParams, options?:DSConfiguration):JSDataPromise<T>;
update<T>(config:DSResourceDefinition<T>, id:string | number, attrs:Object, options?:DSConfiguration):JSDataPromise<T>;
updateAll<T>(config:DSResourceDefinition<T>, attrs:Object, params?:DSFilterParams, options?:DSConfiguration):JSDataPromise<T>;
}
}
// declaring the existing global js object
declare var JSData:{
DS: JSData.DS;
DSErrors: JSData.DSErrors;
};
//Support node require
declare module 'js-data' {
export = JSData;
}
+57
View File
@@ -0,0 +1,57 @@
/// <reference path="jsnox.d.ts" />
import React = require('react');
import jsnox = require('jsnox');
var $ = jsnox(React);
interface PersonProps {
firstName: string
lastName: string
age: number
}
var Person = React.createClass<PersonProps>({
render(): React.ReactHTMLElement { return null }
});
var PersonTag = React.createFactory(Person);
var clickHandler: React.MouseEventHandler
// Tests with spec string
function spec_string () {
var result: React.ReactHTMLElement
// just spec string
result = $('div')
// No properties, just children
result = $('div', 'hello') // one string child
result = $('div', $('span', 'world')) // one element child
result = $('div', ['hello', $('span', 'world')]) // mixed array of children
// With html properties
result = $('div', { onClick: clickHandler }) // no children
result = $('div', { onClick: clickHandler }, 'hello') // one string child
result = $('div', { onClick: clickHandler }, $('span', 'world')) // one element child
result = $('div', { onClick: clickHandler }, ['hello', $('span', 'world')]) // mixed array of children
}
// Tests with react component
function react_component() {
var result: React.ReactHTMLElement
// with nothing more
result = $(Person)
// No properties, just children
result = $(Person, 'hello') // one string child
result = $(Person, $('span', 'world')) // one element child
result = $(Person, ['hello', $('span', 'world')]) // mixed array of children
// With component props
var props = { firstName: 'Bob', lastName: 'Garfield', age: 72 }
result = $(Person, props) // no children
result = $(Person, props, 'hello') // one string child
result = $(Person, props, $('span', 'world')) // one element child
result = $(Person, props, ['hello', PersonTag()]) // mixed array of children
}
+68
View File
@@ -0,0 +1,68 @@
// Type definitions for JSnoX
// Project: https://github.com/af/jsnox
// Definitions by: Steve Baker <https://github.com/stkb/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../react/react.d.ts" />
declare module 'jsnox' {
/*
* JSnoX requires an object with a createElement method.
* This will normally be the React object but could be something else
*/
interface ReactLikeObject {
createElement<P>(type: React.ComponentClass<P> | string,
props: P, children: React.ReactNode): React.ReactElement<P>;
}
interface Module {
(reactObj: ReactLikeObject): CreateElement
}
interface CreateElement {
/**
* Renders an HTML element from the given spec string, with children but without
* extra props.
* @param specString A string that defines a component in a way that resembles
* CSS selectors. Eg. "input:email#foo.bar.baz[name=email][required]"
* @param children A single React node (string or ReactElement) or array of nodes.
* Note that unlike with React itself, multiple children must be placed into an array.
*/
(specString: string, children: React.ReactNode): React.ReactHTMLElement
/**
* Renders an HTML element from the given spec string, with optional props
* and children
* @param specString A string that defines a component in a way that resembles
* CSS selectors. Eg. "input:email#foo.bar.baz[name=email][required]"
* @param props Object of html attribute key-value pairs
* @param children A single React node (string or ReactElement) or array of nodes.
* Note that unlike with React itself, multiple children must be placed into an array.
*/
(specString: string, props?: React.HTMLAttributes, children?: React.ReactNode): React.ReactHTMLElement
/**
* Renders a React component, with children but no props
* @param component A plain React component (created from React.createClass()) or
* component factory (created from React.createFactory())
* @param children A single React node (string or ReactElement) or array of nodes.
* Note that unlike with React itself, multiple children must be placed into an array.
*/
<P>(component: React.ComponentClass<P>, children: React.ReactNode): React.ReactElement<P>
/**
* Renders a React component, with optional props and children
* @param component A plain React component (created from React.createClass()) or
* component factory (created from React.createFactory())
* @param props Props object to pass to the component
* @param children A single React node (string or ReactElement) or array of nodes.
* Note that unlike with React itself, multiple children must be placed into an array.
*/
<P>(component: React.ComponentClass<P>, props?: P, children?: React.ReactNode): React.ReactElement<P>
}
var exports: Module
export = exports
}
+19 -16
View File
@@ -19,23 +19,26 @@ interface jsPlumbInstance {
addEndpoint(ep: string): any;
removeClass(el: any, clazz: string): void;
hasClass(el: any, clazz: string): void;
draggable(el: string, options?: DragOptions): jsPlumbInstance;
draggable(ids: string[], options?: DragOptions): jsPlumbInstance;
connect(connection: ConnectParams, referenceParams?: ConnectParams): Connection;
makeSource(el: string, options: SourceOptions): void;
makeTarget(el: string, options: TargetOptions): void;
repaintEverything(): void;
detachEveryConnection(): void;
draggable(el: string, options?: DragOptions): jsPlumbInstance;
draggable(ids: string[], options?: DragOptions): jsPlumbInstance;
connect(connection: ConnectParams, referenceParams?: ConnectParams): Connection;
makeSource(el: string, options: SourceOptions): void;
makeTarget(el: string, options: TargetOptions): void;
repaintEverything(): void;
detachEveryConnection(): void;
detachAllConnections(el: string): void;
removeAllEndpoints(el: string, recurse?: boolean): jsPlumbInstance;
removeAllEndpoints(el: Element, recurse?: boolean): jsPlumbInstance;
select(params: SelectParams): Connections;
getConnections(options?: any, flat?: any): any[];
deleteEndpoint(uuid: string, doNotRepaintAfterwards?: boolean): jsPlumbInstance;
deleteEndpoint(endpoint: Endpoint, doNotRepaintAfterwards?: boolean): jsPlumbInstance;
repaint(el: string): jsPlumbInstance;
repaint(el: Element): jsPlumbInstance;
removeAllEndpoints(el: string, recurse?: boolean): jsPlumbInstance;
removeAllEndpoints(el: Element, recurse?: boolean): jsPlumbInstance;
select(params: SelectParams): Connections;
getConnections(options?: any, flat?: any): any[];
deleteEndpoint(uuid: string, doNotRepaintAfterwards?: boolean): jsPlumbInstance;
deleteEndpoint(endpoint: Endpoint, doNotRepaintAfterwards?: boolean): jsPlumbInstance;
repaint(el: string): jsPlumbInstance;
repaint(el: Element): jsPlumbInstance;
getInstance(): jsPlumbInstance;
getInstance(defaults: Defaults): jsPlumbInstance;
getInstanceIndex(): number;
SVG: string;
CANVAS: string;
VML: string;
@@ -0,0 +1,206 @@
/// <reference path="../knockout/knockout.d.ts" />
/// <reference path="knockout-transformations.d.ts" />
// Test map
var sourceItems: KnockoutObservableArray<number> = ko.observableArray([1, 2, 3, 4, 5]);
var squares: KnockoutObservableArray<number> = sourceItems.map(function (x) { return x * x; });
var squaresAsStrings: KnockoutObservableArray<string> = sourceItems.map(function (x) { return (x * x).toString(); });
sourceItems.push(6);
// 'squares' has automatically updated and now contains [1, 4, 9, 16, 25, 36]
// 'squaresAsStrings' has automatically updated and now contains ['1', '4', '9', '16', '25', '36']
sourceItems.reverse();
// 'squares' now contains [36, 25, 16, 9, 4, 1]
// 'squaresAsStrings' now contains ['36', '25', '16', '9', '4', '1']
// Test Filtering
var evenSquares: KnockoutObservableArray<number> = squares.filter(function (x) { return x % 2 === 0; });
// evenSquares is now an observable containing [36, 16, 4]
sourceItems.push(9);
// This has no effect on evenSquares, because 9*9=81 is odd
sourceItems.push(10);
// evenSquares now contains [36, 16, 4, 100]
var sortedEvenSquares: KnockoutObservableArray<number> = evenSquares.sortBy(function (evenSquare, descending) {
return descending(evenSquare);
});
// sortedEvenSquares now contains [100, 36, 16, 4]
class Person {
public name: KnockoutObservable<string>;
public yearOfBirth: KnockoutObservable<number>;
constructor(name: string, yearOfBirth: number) {
this.name = ko.observable(name);
this.yearOfBirth = ko.observable(yearOfBirth);
}
}
var persons: KnockoutObservableArray<Person> = ko.observableArray([
new Person("Marilyn Monroe", 1926),
new Person("Abraham Lincoln", 1809),
new Person("Mother Teresa", 1910),
new Person("John F. Kennedy", 1917),
new Person("Martin Luther King", 1929),
new Person("Nelson Mandela", 1918),
new Person("Winston Churchill", 1874),
new Person("Bill Gates", 1955),
new Person("Muhammad Ali", 1942),
new Person("Mahatma Gandhi", 1869),
new Person("Queen Elizabeth II", 1926)
]);
// Persons sorted by name
var sortedByName: KnockoutObservableArray<Person> = persons.sortBy(function (person) {
return person.name();
});
// sortedByName now contains
// [
// new Person("Abraham Lincoln", 1809),
// new Person("Bill Gates", 1955),
// new Person("John F. Kennedy", 1917),
// new Person("Mahatma Gandhi", 1869),
// new Person("Marilyn Monroe", 1926),
// new Person("Martin Luther King", 1929),
// new Person("Mother Teresa", 1910),
// new Person("Muhammad Ali", 1942)
// new Person("Nelson Mandela", 1918),
// new Person("Queen Elizabeth II", 1926),
// new Person("Winston Churchill", 1874),
// ]
// Persons sorted by year of birth descending and then by name
var sortedByYearOfBirthAndThenName: KnockoutObservableArray<Person> = persons.sortBy(function (person, descending) {
return [descending(person.yearOfBirth()), person.name()];
});
// sortedByYearOfBirthAndThenName now contains
// [
// new Person("Abraham Lincoln", 1809),
// new Person("Mahatma Gandhi", 1869),
// new Person("Winston Churchill", 1874),
// new Person("Mother Teresa", 1910),
// new Person("John F. Kennedy", 1917),
// new Person("Nelson Mandela", 1918),
// new Person("Martin Luther King", 1929),
// new Person("Bill Gates", 1955),
// new Person("Marilyn Monroe", 1926),
// new Person("Queen Elizabeth II", 1926),
// new Person("Muhammad Ali", 1942)
// ]
var squareIndex: KnockoutObservable<{ [index: string]: number[] }> = squares.indexBy(function (square) {
return square % 2 === 0 ? 'even' : 'odd';
});
// squareIndex now contains
// { even: [36, 16, 4], odd: [25, 9, 1] }
// Persons indexed by year of birth
var personsIndexedByYearBirth: KnockoutObservable<{ [index: number]: Person[] }> = persons.indexBy(function (person) {
return person.yearOfBirth();
});
// personsIndexedByYearBirth now contains
// {
// 1809: [new Person("Abraham Lincoln", 1809)],
// 1869: [new Person("Mahatma Gandhi", 1869)],
// 1874: [new Person("Winston Churchill", 1874)],
// 1910: [new Person("Mother Teresa", 1910)],
// 1917: [new Person("John F. Kennedy", 1917)],
// 1918: [new Person("Nelson Mandela", 1918)],
// 1929: [new Person("Martin Luther King", 1929)],
// 1955: [new Person("Bill Gates", 1955)],
// 1926: [new Person("Marilyn Monroe", 1926),
// new Person("Queen Elizabeth II", 1926)],
// 1942: [new Person("Muhammad Ali", 1942)]
// }
// Persons indexed uniquely by name.
// Notice unique indexes requires items to map to distint keys;
// otherwise an exception is thrown.
var personsIndexedByName: KnockoutObservable<{ [name: string]: Person }> = persons.uniqueIndexBy(function (person) {
return person.name();
});
// personsIndexedByName now contains
// {
// "Abraham Lincoln": new Person("Abraham Lincoln", 1809),
// "Mahatma Gandhi": new Person("Mahatma Gandhi", 1869),
// "Winston Churchill": new Person("Winston Churchill", 1874),
// "Mother Teresa": new Person("Mother Teresa", 1910),
// "John F. Kennedy": new Person("John F. Kennedy", 1917),
// "Nelson Mandela": new Person("Nelson Mandela", 1918),
// "Martin Luther King": new Person("Martin Luther King", 1929),
// "Bill Gates": new Person("Bill Gates", 1955),
// "Marilyn Monroe": new Person("Marilyn Monroe", 1926),
// "Queen Elizabeth II": new Person("Queen Elizabeth II", 1926),
// "Muhammad Ali": new Person("Muhammad Ali", 1942)
// }
var texts: KnockoutObservableArray<string> = ko.observableArray(['foo', 'bar', 'baz', 'qux', 'quux']);
// Index texts by
var indexedTexts: KnockoutObservable<{ [suffixOrPrefix: string]: string[] }> = texts.indexBy(function (text) {
var firstLetter = text[0];
var lastLetter = text[text.length - 1];
return [firstLetter, lastLetter];
});
// indexedTexts now contains
// {
// f: ['foo'],
// b: ['bar', 'baz'],
// q: ['qux', 'quux'],
// o: ['foo'],
// r: ['bar'],
// z: ['baz'],
// x: ['qux', 'quux']
// }
(() => {
var sourceItems: KnockoutObservableArray<number> = ko.observableArray([1, 2, 3, 4, 5]);
var asString: KnockoutObservableArray<string>;
asString = sourceItems.map((x: number) => x.toString());
asString = sourceItems.map<string>({
mapping: (x: number) => x.toString(),
});
asString = sourceItems.map<string>({
mapping: (x: number) => x.toString(),
disposeItem: (x: string) => console.log('disposing map to', x),
});
asString = sourceItems.map<string>({
mappingWithDisposeCallback: (x: number) => ({
mappedValue: x.toString(),
dispose: () => console.log('disposing map from', x),
}),
});
asString = sourceItems.map(x => x.toString());
asString = sourceItems.map({
mapping: x => x.toString(),
});
asString = sourceItems.map<string>({
mapping: x => x.toString(),
disposeItem: x => console.log('disposing map to', x),
});
asString = sourceItems.map({
mappingWithDisposeCallback: x => ({
mappedValue: x.toString(),
dispose: () => console.log('disposing map from', x),
}),
});
});
+35
View File
@@ -0,0 +1,35 @@
// Type definitions for knockout-transformations 2.0.0
// Project: https://github.com/One-com/knockout-transformations
// Definitions by: John Reilly <https://github.com/johnnyreilly>, Wim Looman <https://github.com/Nemo157>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../knockout/knockout.d.ts" />
declare module KnockoutTransformations {
interface Mapping<T, TResult> {
(value: T): TResult;
}
interface MappingOption<T, TResult> {
mapping: Mapping<T, TResult>;
disposeItem?: (item: TResult) => void;
}
interface MappingWithDisposeCallbackOption<T, TResult> {
mappingWithDisposeCallback: (value: T) => {
mappedValue: TResult;
dispose: () => void;
};
}
}
interface KnockoutObservableArrayFunctions<T> {
map<TResult>(mapping: KnockoutTransformations.Mapping<T, TResult>): KnockoutObservableArray<TResult>;
map<TResult>(mapping: KnockoutTransformations.MappingOption<T, TResult>): KnockoutObservableArray<TResult>;
map<TResult>(mapping: KnockoutTransformations.MappingWithDisposeCallbackOption<T, TResult>): KnockoutObservableArray<TResult>;
filter(predicate: (value: T) => boolean): KnockoutObservableArray<T>;
sortBy(sorter: (value: T, descending: (sorter: any) => any) => any): KnockoutObservableArray<T>;
indexBy(indexer: (value: T) => string): KnockoutObservable<{ [index: string]: T[] }>;
indexBy(indexer: (value: T) => string[]): KnockoutObservable<{ [index: string]: T[] }>;
indexBy(indexer: (value: T) => any): KnockoutObservable<any>;
uniqueIndexBy(indexer: (value: T) => string): KnockoutObservable<{ [index: string]: T }>;
}
-1
View File
@@ -108,7 +108,6 @@ interface KnockoutValidationGroup {
interface KnockoutValidationStatic {
init(options?: KnockoutValidationConfiguration, force?: boolean): void;
configure(options: KnockoutValidationConfiguration): void;
reset(): void;
group(obj: any, options?: any): KnockoutValidationErrors;

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