Merge pull request #1 from borisyankov/master

Update
This commit is contained in:
Vasya Aksyonov
2015-03-10 20:55:15 +05:00
145 changed files with 25268 additions and 10231 deletions
+3
View File
@@ -32,6 +32,9 @@ _infrastructure/tests/build
#rx.js
!rx.js
#zip.js
!zip.js
node_modules
.sublimets
+34 -3
View File
@@ -78,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)
@@ -86,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)
@@ -98,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)
@@ -158,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)
@@ -223,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)
@@ -238,9 +243,10 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](google.analytics/ga.d.ts) [Google Analytics (Classic and Universal)](https://developers.google.com/analytics/devguides/collection/gajs) by [Ronnie Haakon Hegelund](http://ronniehegelund.blogspot.dk), [Pat Kujawa](http://patkujawa.com)
* [:link:](gapi/gapi.d.ts) [Google API Client](https://code.google.com/p/google-api-javascript-client) by [Frank M](https://github.com/sgtfrankieboy)
* [:link:](google.feeds/google.feed.api.d.ts) [Google Feed Apis](https://developers.google.com/feed) by [RodneyJT](https://github.com/RodneyJT)
* [:link:](googlemaps/google.maps.d.ts) [Google Geolocation](https://developers.google.com/maps) by [Folia A/S](http://www.folia.dk)
* [:link:](google.geolocation/google.geolocation.d.ts) [Google Geolocation](https://code.google.com/p/geo-location-javascript) by [Vincent Bortone](https://github.com/vbortone)
* [:link:](googlemaps/google.maps.d.ts) [Google Geolocation](https://developers.google.com/maps) by [Folia A/S](http://www.folia.dk)
* [:link:](gapi.pagespeedonline/gapi.pagespeedonline.d.ts) [Google Page Speed Online Api](https://developers.google.com/speed/pagespeed) by [Frank M](https://github.com/sgtfrankieboy)
* [:link:](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)
@@ -251,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)
@@ -294,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)
@@ -307,13 +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)
@@ -385,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)
@@ -454,6 +474,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [: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)
@@ -462,6 +483,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [: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)
@@ -513,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)
@@ -530,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)
@@ -589,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)
@@ -604,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)
@@ -624,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)
@@ -679,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)
@@ -686,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)
@@ -708,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)
@@ -801,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() {}
});
+6 -6
View File
@@ -14,19 +14,19 @@ declare module ng.hotkeys {
cheatSheetHotkey: string;
cheatSheetDescription: string;
add(combo: string, callback: (event: Event, hotkey?: Hotkey) => void, action?: string, allowIn?: Array<string>, persistent?: boolean): ng.hotkeys.Hotkey;
add(combo: string|string[], callback: (event: Event, hotkey?: Hotkey) => void, action?: string, allowIn?: Array<string>, persistent?: boolean): ng.hotkeys.Hotkey;
add(combo: string, description: string, callback: (event: Event, hotkey?: Hotkey) => void, action?: string, allowIn?: Array<string>, persistent?: boolean): ng.hotkeys.Hotkey;
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;
del(hotkeyObj: ng.hotkeys.Hotkey): void;
get(combo: string): ng.hotkeys.Hotkey;
get(combo: string|string[]): ng.hotkeys.Hotkey;
toggleCheatSheet(): void;
@@ -34,13 +34,13 @@ declare module ng.hotkeys {
}
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;
+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;
}
}
+143
View File
@@ -0,0 +1,143 @@
/// <reference path="../angularjs/angular.d.ts" />
/// <reference path="angular-ui-sortable.d.ts" />
var myApp = angular.module('testModule');
interface MySortableControllerScope extends ng.IScope {
items: SortableModelInfo[];
sortableOptions: ng.ui.UISortableOptions<SortableModelInfo>;
sortingLog: SortLogInfo[];
}
interface SortableModelInfo {
text: string;
value: number;
}
interface SortLogInfo {
ID: number;
Text: string;
}
myApp.controller('sortableController', function ($scope: MySortableControllerScope) {
$scope.sortableOptions = {
activate: function(e, ui) {
var jQueryEventObject: JQueryEventObject = e;
var uiSortableUIParams: ng.ui.UISortableUIParams<SortableModelInfo> = ui;
},
beforeStop: function(e, ui) {
var jQueryEventObject: JQueryEventObject = e;
var uiSortableUIParams: ng.ui.UISortableUIParams<SortableModelInfo> = ui;
},
change: function(e, ui) {
var jQueryEventObject: JQueryEventObject = e;
var uiSortableUIParams: ng.ui.UISortableUIParams<SortableModelInfo> = ui;
},
deactivate: function(e, ui) {
var jQueryEventObject: JQueryEventObject = e;
var uiSortableUIParams: ng.ui.UISortableUIParams<SortableModelInfo> = ui;
},
out: function(e, ui) {
var jQueryEventObject: JQueryEventObject = e;
var uiSortableUIParams: ng.ui.UISortableUIParams<SortableModelInfo> = ui;
},
over: function(e, ui) {
var jQueryEventObject: JQueryEventObject = e;
var uiSortableUIParams: ng.ui.UISortableUIParams<SortableModelInfo> = ui;
},
receive: function(e, ui) {
var jQueryEventObject: JQueryEventObject = e;
var uiSortableUIParams: ng.ui.UISortableUIParams<SortableModelInfo> = ui;
},
remove: function(e, ui) {
var jQueryEventObject: JQueryEventObject = e;
var uiSortableUIParams: ng.ui.UISortableUIParams<SortableModelInfo> = ui;
},
sort: function(e, ui) {
var jQueryEventObject: JQueryEventObject = e;
var uiSortableUIParams: ng.ui.UISortableUIParams<SortableModelInfo> = ui;
},
start: function(e, ui) {
var jQueryEventObject: JQueryEventObject = e;
var uiSortableUIParams: ng.ui.UISortableUIParams<SortableModelInfo> = ui;
},
stop: function(e, ui) {
var jQueryEventObject: JQueryEventObject = e;
var uiSortableUIParams: ng.ui.UISortableUIParams<SortableModelInfo> = ui;
var uiitem: ng.ui.UISortableUIItem<SortableModelInfo> = ui.item;
var uiitemscope: ng.IScope = uiitem.scope();
var uiitemsortable: ng.ui.UISortableProperties<SortableModelInfo> = uiitem.sortable;
var dropindex: number = uiitemsortable.dropindex;
var droptarget: number = uiitemsortable.droptarget;
var droptargetModel: SortableModelInfo[] = uiitemsortable.droptargetModel;
var index: number = uiitemsortable.index;
var model: SortableModelInfo = uiitemsortable.model;
var moved: SortableModelInfo = uiitemsortable.moved;
var received: Boolean = uiitemsortable.received;
var source: ng.IAugmentedJQuery = uiitemsortable.source;
var sourceModel: SortableModelInfo[] = uiitemsortable.sourceModel;
var logEntry = {
ID: $scope.sortingLog.length + 1,
Text: 'Moved element: ' + ui.item.sortable.model.text
};
$scope.sortingLog.push(logEntry);
},
update: function(e, ui) {
var jQueryEventObject: JQueryEventObject = e;
var uiSortableUIParams: ng.ui.UISortableUIParams<SortableModelInfo> = ui;
var voidcanceled: void = ui.item.sortable.cancel();
var isCanceled: Boolean = ui.item.sortable.isCanceled();
var isCustomHelperUsed: Boolean =ui.item.sortable.isCustomHelperUsed();
}
};
$scope.sortableOptions.appendTo = document.body;
$scope.sortableOptions.appendTo = angular.element(document.body);
$scope.sortableOptions.appendTo = 'body';
$scope.sortableOptions.axis = 'x';
$scope.sortableOptions.axis = 'y';
$scope.sortableOptions.axis = false;
$scope.sortableOptions.cancel = '.disabled';
$scope.sortableOptions.connectWith = '.connectedSortable';
$scope.sortableOptions.connectWith = false;
$scope.sortableOptions.containment = 'parent';
$scope.sortableOptions.containment = 'body';
$scope.sortableOptions.containment = document.body;
$scope.sortableOptions.containment = false;
$scope.sortableOptions.cursor = 'move';
$scope.sortableOptions.cursorAt = false;
$scope.sortableOptions.cursorAt = { left: 5 };
$scope.sortableOptions.delay = 300;
$scope.sortableOptions.disabled = true;
$scope.sortableOptions.distance = 5;
$scope.sortableOptions.dropOnEmpty = false;
$scope.sortableOptions.forceHelperSize = true;
$scope.sortableOptions.forcePlaceholderSize = true;
$scope.sortableOptions.grid = false;
$scope.sortableOptions.grid = [20, 10];
$scope.sortableOptions.handle = '.handle';
$scope.sortableOptions.helper = 'clone';
$scope.sortableOptions.helper = function(e: JQueryEventObject, item: ng.IAugmentedJQuery) {
return item.clone();
};
$scope.sortableOptions.items = '> li:not(.disabled)';
$scope.sortableOptions.opacity = false;
$scope.sortableOptions.opacity = 0.5;
$scope.sortableOptions.placeholder = false;
$scope.sortableOptions.placeholder = 'sortable-placeholder';
$scope.sortableOptions.revert = true;
$scope.sortableOptions.revert = 300;
$scope.sortableOptions.scroll = false;
$scope.sortableOptions.scrollSensitivity = 10;
$scope.sortableOptions.scrollSpeed = 40;
$scope.sortableOptions.tolerance = 'pointer';
$scope.sortableOptions.zIndex = 9999;
$scope.sortableOptions['ui-floating'] = undefined;
$scope.sortableOptions['ui-floating'] = null;
$scope.sortableOptions['ui-floating'] = false;
$scope.sortableOptions['ui-floating'] = true;
$scope.sortableOptions['ui-floating'] = "auto";
});
+210
View File
@@ -0,0 +1,210 @@
// Type definitions for angular.ui.sortable module v0.13+
// Project: https://github.com/angular-ui/ui-sortable
// Definitions by: Thodoris Greasidis <https://github.com/thgreasi>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare module ng.ui {
interface UISortableOptions<T> extends SortableOptions<T> {
'ui-floating'?: string|boolean;
}
interface UISortableProperties<T> {
/**
* Holds the index of the drop target that the dragged item was dropped.
*/
dropindex: number;
/**
* Holds the ui-sortable element that the dragged item was dropped on.
*/
droptarget: number;
/**
* Holds the array that is specified by the `ng-model` attribute of the [`droptarget`](#droptarget) ui-sortable element.
*/
droptargetModel: Array<T>;
/**
* Holds the original index of the item dragged.
*/
index: number;
/**
* Holds the JavaScript object that is used as the model of the dragged item, as specified by the ng-repeat of the [`source`](#source) ui-sortable element and the item's [`index`](#index).
*/
model: T;
/**
* Holds the model of the dragged item only when a sorting happens between two connected ui-sortable elements.
* In other words: `'moved' in ui.item.sortable` will return false only when a sorting is withing the same ui-sortable element ([`source`](#source) equals to the [`droptarget`](#droptarget)).
*/
moved?: T;
/**
* When sorting between two connected sortables, it will be set to true inside the `update` callback of the [`droptarget`](#droptarget).
*/
received: Boolean;
/**
* Holds the ui-sortable element that the dragged item originated from.
*/
source: ng.IAugmentedJQuery
/**
* Holds the array that is specified by the `ng-model` of the [`source`](#source) ui-sortable element.
*/
sourceModel: Array<T>;
/**
* Can be called inside the `update` callback, in order to prevent/revert a sorting.
* Should be used instead of the [jquery-ui-sortable cancel()](http://api.jqueryui.com/sortable/#method-cancel) method.
*/
cancel(): void;
/**
* Returns whether the current sorting is marked as canceled, by an earlier call to [`ui.item.sortable.cancel()`](#cancel).
*/
isCanceled(): Boolean;
/**
* Returns whether the [`helper`](http://api.jqueryui.com/sortable/#option-helper) element used for the current sorting, is one of the original ui-sortable list elements.
*/
isCustomHelperUsed(): Boolean;
}
interface UISortableUIItem<T> extends ng.IAugmentedJQuery {
sortable: UISortableProperties<T>;
}
interface UISortableUIParams<T> extends SortableUIParams {
item: UISortableUIItem<T>;
}
// Base Sortable //////////////////////////////////////////////////
interface SortableCursorAtOptions {
top?: number;
left?: number;
right?: number;
bottom?: number;
}
interface SortableHelperFunctionOption {
(event: JQueryEventObject, ui: ng.IAugmentedJQuery): JQuery;
}
interface SortableOptions<T> extends SortableEvents<T> {
/**
* jQuery, Element, Selector or string
* Default: "parent"
*/
appendTo?: any;
/**
* "X", "Y" or false
* Default: false
*/
axis?: string|boolean;
/**
* Selector
* Default: "input,textarea,button,select,option"
*/
cancel?: string;
/**
* Selector or false
* Default: false
*/
connectWith?: string|boolean;
/**
* Element, Selector, string or false
* Default: false
*/
containment?: any;
cursor?: string;
/**
* Moves the sorting element or helper so the cursor always appears to drag from the same position. Coordinates can be given as a hash using a combination of one or two keys SortableCursorAtOptions: { top, left, right, bottom }
* Default: false
*/
cursorAt?: SortableCursorAtOptions|boolean;
delay?: number;
disabled?: boolean;
distance?: number;
dropOnEmpty?: boolean;
forceHelperSize?: boolean;
forcePlaceholderSize?: boolean;
/**
* Array of numbers or false
* Default: false
*/
grid?: number[]|boolean;
/**
* Selector or Element
*/
handle?: any;
/**
* "original", "clone" or Function()
* Default: "original"
*/
helper?: string|SortableHelperFunctionOption;
/**
* Selector
*/
items?: string;
/**
* Number or false
* Default: false
*/
opacity?: number|boolean;
/**
* string or false
* Default: false
*/
placeholder?: string|boolean;
/**
* boolean or number
* Default: false
*/
revert?: number|boolean;
scroll?: boolean;
scrollSensitivity?: number;
scrollSpeed?: number;
/**
* "intersect" or "pointer"
* Default: "intersect"
*/
tolerance?: string;
zIndex?: number;
}
interface SortableUIParams {
helper: ng.IAugmentedJQuery;
item: ng.IAugmentedJQuery;
offset: any;
position: any;
originalPosition: any;
sender: ng.IAugmentedJQuery;
placeholder: ng.IAugmentedJQuery;
}
interface SortableEvent<T> {
(event: JQueryEventObject, ui: UISortableUIParams<T>): void;
}
interface SortableEvents<T> {
activate?: SortableEvent<T>;
beforeStop?: SortableEvent<T>;
change?: SortableEvent<T>;
deactivate?: SortableEvent<T>;
out?: SortableEvent<T>;
over?: SortableEvent<T>;
receive?: SortableEvent<T>;
remove?: SortableEvent<T>;
sort?: SortableEvent<T>;
start?: SortableEvent<T>;
stop?: SortableEvent<T>;
update?: SortableEvent<T>;
}
}
+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;
+25
View File
@@ -0,0 +1,25 @@
/// <reference path="arcgis-js-api.d.ts" />
import esri = require("esri");
import Map = require("esri/map");
import Point = require("esri/geometry/Point");
export = MapController;
class MapController {
map: Map;
constructor(public mapDiv: string) {
}
start() {
var point = new Point(-122.45, 37.75); // long, lat
var mapOptions: esri.MapOptions = {};
mapOptions.basemap = "topo";
mapOptions.center = point;
mapOptions.zoom = 13;
this.map = new Map(this.mapDiv, mapOptions);
}
}
@@ -0,0 +1 @@
--noImplicitAny --module amd
+16049
View File
File diff suppressed because it is too large Load Diff
+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;
}
}
+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
+9 -1
View File
@@ -5,6 +5,13 @@
/// <reference path='../webrtc/MediaStream.d.ts'/>
////////////////////
// Global object
////////////////////
interface Window {
chrome: typeof chrome;
}
////////////////////
// Alarms
////////////////////
@@ -1538,7 +1545,8 @@ declare module chrome.runtime {
}
interface Port {
postMessage: Function;
postMessage: (message: Object) => void;
disconnect: () => void;
sender?: MessageSender;
onDisconnect: chrome.events.Event;
onMessage: PortMessageEvent;
+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
+6 -5
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;
@@ -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;
}
+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' {
+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;
}
+41
View File
@@ -0,0 +1,41 @@
/// <reference path="../node/node.d.ts" />
/// <reference path="extend.d.ts" />
import assert = require('assert');
import extend = require('extend');
var objectBase = {
test: 'base'
};
var objectOne = {
test: 'one',
iamone: true
};
var objectTwo = {
test: 2,
iamtwo: true
};
var objectThree = {
iamthree: true,
depth: {
innerType: 'deep'
}
};
var extended = extend(objectBase, objectOne);
assert(extended.test === 'one');
assert(extended.iamone === true);
var moreExtended = extend(objectBase, objectOne, objectTwo);
assert(moreExtended.test === 2);
assert(moreExtended.iamone === true);
assert(moreExtended.iamtwo === true);
var deepExtended = extend(true, objectBase, objectOne, objectTwo, objectThree);
assert(deepExtended.iamone === true);
assert(moreExtended.iamtwo === true);
assert(deepExtended.iamthree === true);
assert(deepExtended.depth.innerType === 'one');
+9
View File
@@ -0,0 +1,9 @@
// Type definitions for extend v2.0.0
// Project: https://www.npmjs.com/package/extend
// Definitions by: Stefan Steinhart <https://github.com/reppners>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "extend" {
function extend(deepOrObject:boolean | Object, ...objectN: Object[]): any;
export = extend;
}
+2 -2
View File
@@ -7,7 +7,7 @@ declare function writeDataToLogFile(fileWriter:FileWriterSync): void;
function useAsyncFS(fs:FileSystem):void {
// see getAsText example in [FILE-API-ED].
fs.root.getFile("already_there.txt", null, function (f:FileEntry): void{
fs.root.getFile("already_there.txt", null, function (f): void{
// In the example of the specification, there is a following code:
//
@@ -19,7 +19,7 @@ function useAsyncFS(fs:FileSystem):void {
});
// But now we can also write to the file; see [FILE-WRITER-ED].
fs.root.getFile("logFile", {create: true}, function (f:FileEntry): void{
fs.root.getFile("logFile", {create: true}, function (f): void{
f.createWriter(writeDataToLogFile);
});
}
+23 -3
View File
@@ -197,7 +197,7 @@ interface Entry {
* @param successCallback A callback that is called to return the parent Entry.
* @param errorCallback A callback that is called when errors happen.
*/
getParent(successCallback:EntryCallback, errorCallback?:ErrorCallback):void;
getParent(successCallback:DirectoryEntryCallback, errorCallback?:ErrorCallback):void;
}
/**
@@ -223,7 +223,7 @@ interface DirectoryEntry extends Entry {
* @param successCallback A callback that is called to return the File selected or created.
* @param errorCallback A callback that is called when errors happen.
*/
getFile(path:string, options?:Flags, successCallback?:EntryCallback, errorCallback?:ErrorCallback):void;
getFile(path:string, options?:Flags, successCallback?:FileEntryCallback, errorCallback?:ErrorCallback):void;
/**
* Creates or looks up a directory.
@@ -240,7 +240,7 @@ interface DirectoryEntry extends Entry {
* @param errorCallback A callback that is called when errors happen.
*
*/
getDirectory(path:string, options?:Flags, successCallback?:EntryCallback, errorCallback?:ErrorCallback):void;
getDirectory(path:string, options?:Flags, successCallback?:DirectoryEntryCallback, errorCallback?:ErrorCallback):void;
/**
* Deletes a directory and all of its contents, if any. In the event of an error [e.g. trying to delete a directory that contains a file that cannot be removed], some of the contents of the directory may be deleted. It is an error to attempt to delete the root directory of a filesystem.
@@ -307,6 +307,26 @@ interface EntryCallback {
(entry:Entry):void;
}
/**
* This interface is the callback used to look up FileEntry objects.
*/
interface FileEntryCallback {
/**
* @param entry
*/
(entry:FileEntry):void;
}
/**
* This interface is the callback used to look up DirectoryEntry objects.
*/
interface DirectoryEntryCallback {
/**
* @param entry
*/
(entry:DirectoryEntry):void;
}
/**
* When readEntries() succeeds, the following callback is made.
*/
+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;
+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
+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;
}
+1 -1
View File
@@ -7,6 +7,6 @@
/// <reference path="../node/node.d.ts"/>
declare module "gulp-mocha" {
function mocha(setupOptions: MochaSetupOptions): NodeJS.ReadWriteStream;
function mocha(setupOptions?: MochaSetupOptions): NodeJS.ReadWriteStream;
export = mocha;
}
+6 -2
View File
@@ -10,8 +10,12 @@ declare module "gulp-replace" {
skipBinary?: boolean;
}
function replace(pattern: string, replacement: string, opts?: Options): NodeJS.ReadWriteStream;
function replace(pattern: RegExp, replacement: string, opts?: Options): NodeJS.ReadWriteStream;
interface Replacer {
(match: string): string
}
function replace(pattern: string, replacement: string | Replacer, opts?: Options): NodeJS.ReadWriteStream;
function replace(pattern: RegExp, replacement: string | Replacer, opts?: Options): NodeJS.ReadWriteStream;
export = replace;
}
+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
+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;
}
}
+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;
}
+1 -3
View File
@@ -1,7 +1,5 @@
/// <reference path="gridster.d.ts" />
var el: HTMLElement = new HTMLElement();
interface SerializeData {
x?: number;
y?: number;
@@ -18,7 +16,7 @@ var options: GridsterOptions = {
}
};
var gridster = <Gridster>$('.gridster ul').gridster(el, options).data('grister');
var gridster = <Gridster>$('.gridster ul').gridster(options).data('grister');
gridster.add_widget('<li class="new">The HTML of the widget...</li>', 2, 1);
gridster.remove_widget($('gridster li').eq(3).get(0));
var json = gridster.serialize<SerializeData>();
+1 -2
View File
@@ -160,11 +160,10 @@ interface JQuery {
/**
* Gridster
* @param el The HTMLElement that contains all the widgets.
* @param options An object with all the gridster options you want to overwrite.
* @return Gridster jQuery instance.
**/
gridster(el: HTMLElement, options?: GridsterOptions): JQuery;
gridster(options?: GridsterOptions): JQuery;
}
interface Gridster {
+26 -2
View File
@@ -3212,7 +3212,7 @@ function test_EventIsCallable() {
}
$.when<any>($.ajax("/my/page.json")).then(a => a.asdf); // is type JQueryPromise<any>
$.when($.ajax("/my/page.json")).then((a?,b?,c?) => a.asdf); // is type JQueryPromise<any>
$.when<any>($.ajax("/my/page.json")).then((a?,b?,c?) => a.asdf); // is type JQueryPromise<any>
$.when("asdf", "jkl;").done((x,y) => x.length + y.length, (x,y) => x.length + y.length);
var f1 = $.when("fetch"); // Is type JQueryPromise<string>
@@ -3370,4 +3370,28 @@ function test_promise_then_change_type() {
count().done(data => {
}).fail((exception: Error) => {
});
}
}
function test_promise_then_not_return_deferred() {
var state: string;
var deferred: JQueryDeferred<any> = $.Deferred();
state = deferred.state();
deferred = deferred.progress();
deferred = deferred.done();
deferred = deferred.fail();
deferred = deferred.always();
deferred = deferred.notify();
deferred = deferred.resolve();
deferred = deferred.reject();
promise = deferred.promise();
promise = deferred.then(function () { });
var promise: JQueryPromise<any> = $.Deferred().promise();
state = promise.state();
promise = promise.then(function () { });
promise = promise.progress();
promise = promise.done();
promise = promise.fail();
promise = promise.always();
}
+27 -70
View File
@@ -276,7 +276,15 @@ interface JQueryGenericPromise<T> {
* @param doneFilter A function that is called when the Deferred is resolved.
* @param failFilter An optional function that is called when the Deferred is rejected.
*/
then<U>(doneFilter: (value: T) => U|JQueryGenericPromise<U>, failFilter?: (reason: any) => U|JQueryGenericPromise<U>): JQueryGenericPromise<U>;
then<U>(doneFilter: (value: T, ...values: any[]) => U|JQueryPromise<U>, failFilter?: (...reasons: any[]) => U|JQueryPromise<U>, progressFilter?: (...progression: any[]) => any): JQueryPromise<U>;
/**
* Determine the current state of a Deferred object.
*/
state(): string;
// Deprecated - given no typings
pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise<any>;
}
/**
@@ -286,120 +294,81 @@ 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>;
}
/**
* Interface for the JQuery promise, part of callbacks
*/
interface JQueryPromise<T> {
interface JQueryPromise<T> extends JQueryGenericPromise<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: JQueryPromiseOperator<any, T>;
always(alwaysCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...alwaysCallbacksN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryPromise<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>[]>): JQueryPromise<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>[]>): JQueryPromise<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>;
/**
* Determine the current state of a Deferred object.
*/
state(): string;
// Deprecated - given no typings
pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise<any>;
/**
* Add handlers to be called when the Deferred object is resolved, rejected, or still in progress.
*
* @param doneFilter A function that is called when the Deferred is resolved.
* @param failFilter An optional function that is called when the Deferred is rejected.
* @param progressFilter An optional function that is called when progress notifications are sent to the Deferred.
*/
then<U>(doneFilter: (value: T) => U|JQueryGenericPromise<U>, failFilter?: (...reasons: any[]) => U|JQueryGenericPromise<U>, progressFilter?: (...progression: any[]) => any): JQueryPromise<U>;
// Because JQuery Promises Suck
/**
* Add handlers to be called when the Deferred object is resolved, rejected, or still in progress.
*
* @param doneFilter A function that is called when the Deferred is resolved.
* @param failFilter An optional function that is called when the Deferred is rejected.
* @param progressFilter An optional function that is called when progress notifications are sent to the Deferred.
*/
then<U>(doneFilter: (...values: any[]) => U|JQueryGenericPromise<U>, failFilter?: (...reasons: any[]) => U|JQueryGenericPromise<U>, progressFilter?: (...progression: any[]) => any): JQueryPromise<U>;
progress(progressCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...progressCallbackN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryPromise<T>;
}
/**
* Interface for the JQuery deferred, part of callbacks
*/
interface JQueryDeferred<T> extends JQueryPromise<T> {
interface JQueryDeferred<T> extends JQueryGenericPromise<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>;
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(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>;
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(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>;
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>): JQueryDeferred<T>;
progress(progressCallbacks: JQueryPromiseCallback<T>[]): JQueryDeferred<T>;
progress(progressCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...progressCallbackN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): 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 +376,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 +406,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.
@@ -805,19 +774,7 @@ interface JQueryStatic {
*
* @param deferreds One or more Deferred objects, or plain JavaScript objects.
*/
when<T>(...deferreds: JQueryGenericPromise<T>[]): JQueryPromise<T>;
/**
* Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events.
*
* @param deferreds One or more Deferred objects, or plain JavaScript objects.
*/
when<T>(...deferreds: T[]): JQueryPromise<T>;
/**
* Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events.
*
* @param deferreds One or more Deferred objects, or plain JavaScript objects.
*/
when<T>(...deferreds: any[]): JQueryPromise<T>;
when<T>(...deferreds: Array<T|JQueryPromise<T>/* as JQueryDeferred<T> */>): JQueryPromise<T>;
/**
* Hook directly into jQuery to override how particular CSS properties are retrieved or set, normalize CSS property naming, or create custom properties.
+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;
}
+15
View File
@@ -0,0 +1,15 @@
/// <reference path="jssha.d.ts" />
/// <reference path="../node/node.d.ts" />
var imported = require("jssha");
var shaObj1:jsSHA.jsSHA = new jsSHA("This is a Test", "TEXT", "UTF8");
var shaObj2 = new imported("This is a Test", "TEXT");
var hash1:string = shaObj2.getHash("SHA-512", "HEX");
var hash2:string = shaObj2.getHash("SHA-512", "HEX", 2);
var hash3:string = shaObj2.getHash("SHA-512", "HEX", 2, {outputUpper: false, b64Pad: "foobar"});
var format:jsSHA.OutputFormatOptions = {outputUpper: false, b64Pad: "foobar"};
var hmac1 = shaObj2.getHMAC("SecretKey", "TEXT", "SHA-512", "HEX");
var hmac2 = shaObj2.getHMAC("SecretKey", "TEXT", "SHA-512", "HEX", format);
Vendored Executable
+65
View File
@@ -0,0 +1,65 @@
// Type definitions for jsSHA
// Project: https://github.com/Caligatio/jsSHA
// Definitions by: David Li <https://github.com/randombk>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module jsSHA {
export interface OutputFormatOptions {
outputUpper : boolean;
b64Pad : string;
}
export interface jsSHA {
/**
* jsSHA is the workhorse of the library. Instantiate it with the string to
* be hashed as the parameter
*
* @constructor
* @this {jsSHA}
* @param {string} srcString The string to be hashed
* @param {string} inputFormat The format of srcString, HEX, TEXT, B64, or BYTES
* @param {string=} encoding The text encoding to use to encode the source
* string
*/
new (srcString:string, inputFormat:string, encoding?:string):jsSHA;
/**
* Returns the desired SHA hash of the string specified at instantiation
* using the specified parameters
*
* @param {string} variant The desired SHA variant (SHA-1, SHA-224,
* SHA-256, SHA-384, or SHA-512)
* @param {string} format The desired output formatting (B64, HEX, or BYTES)
* @param {number=} numRounds The number of rounds of hashing to be
* executed
* @param {{outputUpper : boolean, b64Pad : string}=} outputFormatOpts
* Hash list of output formatting options
* @return {string} The string representation of the hash in the format
* specified
*/
getHash(variant:string, format:string, numRounds?:number, outputFormatOpts?:OutputFormatOptions):string;
/**
* Returns the desired HMAC of the string specified at instantiation
* using the key and variant parameter
*
* @param {string} key The key used to calculate the HMAC
* @param {string} inputFormat The format of key, HEX, TEXT, B64, or BYTES
* @param {string} variant The desired SHA variant (SHA-1, SHA-224,
* SHA-256, SHA-384, or SHA-512)
* @param {string} outputFormat The desired output formatting
* (B64, HEX, or BYTES)
* @param {{outputUpper : boolean, b64Pad : string}=} outputFormatOpts
* associative array of output formatting options
* @return {string} The string representation of the hash in the format
* specified
*/
getHMAC(key:string, inputFormat:string, variant:string, outputFormat:string, outputFormatOpts?:OutputFormatOptions):string;
}
}
declare var jsSHA: jsSHA.jsSHA;
declare module 'jssha' {
export = jsSHA;
}
+399 -27
View File
@@ -1,7 +1,8 @@
// Type definitions for jsTree v3.0.4
// Type definitions for jsTree v3.0.9
// Project: http://www.jstree.com/
// Definitions by: Adam Pluciński <https://github.com/adaskothebeast>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// 45 commit df38535 2015-03-02 13:23 +2:00
///<reference path="../jquery/jquery.d.ts" />
@@ -14,7 +15,6 @@ interface JQueryStatic {
* @type {JSTreeStatic}
*/
jstree?: JSTreeStatic;
}
interface JQuery {
@@ -165,6 +165,11 @@ interface JSTreeStaticDefaults {
*/
dnd?: JSTreeStaticDefaultsDragNDrop;
/**
* Adds massload functionality to jsTree, so that multiple nodes can be loaded in a single request (only useful with lazy loading).
*/
massload?: JSTreeStaticDefaultsMassload;
/**
* stores all defaults for the search plugin
*/
@@ -347,6 +352,12 @@ interface JSTreeStaticDefaultsCore {
* @name $.jstree.defaults.core.force_text
*/
force_text?: boolean;
/**
* Should the node should be toggled if the text is double clicked . Defaults to `true`
* @name $.jstree.defaults.core.dblclick_toggle
*/
dblclick_toggle?: boolean;
}
interface JSTreeStaticDefaultsCoreThemes {
@@ -524,17 +535,71 @@ interface JSTreeStaticDefaultsDragNDrop {
* @plugin dnd
*/
inside_pos: any;
/**
* when starting the drag on a node that is selected this setting controls if all selected nodes are dragged or only the single node, default is `true`, which means all selected nodes are dragged when the drag is started on a selected node
* @name $.jstree.defaults.dnd.drag_selection
* @plugin dnd
*/
drag_selection: boolean;
/**
* controls whether dnd works on touch devices. If left as boolean true dnd will work the same as in desktop browsers, which in some cases may impair scrolling. If set to boolean false dnd will not work on touch devices. There is a special third option - string "selected" which means only selected nodes can be dragged on touch devices.
* @name $.jstree.defaults.dnd.touch
* @plugin dnd
*/
touch: boolean;
/**
* controls whether items can be dropped anywhere on the node, not just on the anchor, by default only the node anchor is a valid drop target. Works best with the wholerow plugin. If enabled on mobile depending on the interface it might be hard for the user to cancel the drop, since the whole tree container will be a valid drop target.
* @name $.jstree.defaults.dnd.large_drop_target
* @plugin dnd
*/
large_drop_target: boolean;
/**
* controls whether a drag can be initiated from any part of the node and not just the text/icon part, works best with the wholerow plugin. Keep in mind it can cause problems with tree scrolling on mobile depending on the interface - in that case set the touch option to "selected".
* @name $.jstree.defaults.dnd.large_drag_target
* @plugin dnd
*/
large_drag_target: boolean;
}
interface JSTreeStaticDefaultsMassload {
/**
* massload configuration
*
* It is possible to set this to a standard jQuery-like AJAX config.
* In addition to the standard jQuery ajax options here you can supply functions for `data` and `url`, the functions will be run in the current instance's scope and a param will be passed indicating which node IDs need to be loaded, the return value of those functions will be used.
*
* You can also set this to a function, that function will receive the node IDs being loaded as argument and a second param which is a function (callback) which should be called with the result.
*
* Both the AJAX and the function approach rely on the same return value - an object where the keys are the node IDs, and the value is the children of that node as an array.
*
* {
* "id1" : [{ "text" : "Child of ID1", "id" : "c1" }, { "text" : "Another child of ID1", "id" : "c2" }],
* "id2" : [{ "text" : "Child of ID2", "id" : "c3" }]
* }
*
* @name $.jstree.defaults.massload
* @plugin massload
*/
url: any;
data: any;
}
interface JSTreeStaticDefaultsSearch {
/**
* a jQuery-like AJAX config, which jstree uses if a server should be queried for results.
*
* A `str` (which is the search string) parameter will be added with the request.
* A `str` (which is the search string) parameter will be added with the request,
* an optional `inside` parameter will be added if the search is limited to a node id.
* The expected result is a JSON array with nodes that need to be opened so that matching nodes will be revealed.
* Leave this setting as `false` to not query the server. You can also set this to a function,
* which will be invoked in the instance's scope and receive 2 parameters -
* the search string and the callback to call with the array of nodes to load.
* which will be invoked in the instance's scope and receive 3 parameters - the search string,
* the callback to call with the array of nodes to load, and the optional node ID to limit the search to
* @name $.jstree.defaults.search.ajax
* @plugin search
*/
@@ -556,7 +621,7 @@ interface JSTreeStaticDefaultsSearch {
/**
* Indicates if the tree should be filtered (by default) to show only matching nodes
* (keep in mind this can be a heavy on large trees in old browsers).
* (keep in mind this can be a heavy on large trees in old browsers).
* This setting can be changed at runtime when calling the search method. Default is `false`.
* @name $.jstree.defaults.search.show_only_matches
* @plugin search
@@ -637,12 +702,65 @@ interface JSTreeStaticDefaultsUnique {
}
interface JSTree extends JQuery {
/**
* used to decorate an instance with a plugin. Used internally.
* @private
* @name plugin(deco [, opts])
* @param {String} deco the plugin to decorate with
* @param {Object} opts options for the plugin
* @return {jsTree}
*/
plugin: (deco: string, opts?: any) => JSTree;
/**
* used to decorate an instance with a plugin. Used internally.
* @private
* @name init(el, options)
* @param {DOMElement|jQuery|String} el the element we are transforming
* @param {Object} options options for this instance
* @trigger init.jstree, loading.jstree, loaded.jstree, ready.jstree, changed.jstree
*/
init: (el:any, options:any) => void;
/**
* destroy an instance
* @name destroy()
* @param {Boolean} keep_html if not set to `true` the container will be emptied, otherwise the current DOM elements will be kept intact
*/
destroy: (keep_html?: boolean) => void;
/**
* part of the destroying of an instance. Used internally.
* @private
* @name teardown()
*/
teardown: () => void;
/**
* bind all events. Used internally.
* @private
* @name bind()
*/
bind: () => any;
/**
* part of the destroying of an instance. Used internally.
* @private
* @name unbind()
*/
unbind: () => any;
/**
* trigger an event. Used internally.
* @private
* @name trigger(ev [, data])
* @param {String} ev the name of the event to trigger
* @param {Object} data additional data to pass with the event
*/
/*
* defined in JQuery
*/
// trigger: (ev: string, data?: Object) => any;
/**
* returns the jQuery extended instance container
@@ -651,6 +769,50 @@ interface JSTree extends JQuery {
*/
get_container: () => JQuery;
/**
* returns the jQuery extended main UL node inside the instance container. Used internally.
* @private
* @name get_container_ul()
* @return {jQuery}
*/
get_container_ul: () => JQuery;
/**
* gets string replacements (localization). Used internally.
* @private
* @name get_string(key)
* @param {String} key
* @return {String}
*/
get_string: (key: string) => string;
/**
* gets the first child of a DOM node. Used internally.
* @private
* @name _firstChild(dom)
* @param {DOMElement} dom
* @return {DOMElement}
*/
_firstChild: (dom: HTMLElement) => HTMLElement;
/**
* gets the next sibling of a DOM node. Used internally.
* @private
* @name _nextSibling(dom)
* @param {DOMElement} dom
* @return {DOMElement}
*/
_nextSibling: (dom: HTMLElement) => HTMLElement;
/**
* gets the previous sibling of a DOM node. Used internally.
* @private
* @name _previousSibling(dom)
* @param {DOMElement} dom
* @return {DOMElement}
*/
_previousSibling: (dom: HTMLElement) => HTMLElement;
/**
* get the JSON representation of a node (or the actual jQuery extended DOM node) by using any input (child DOM element, ID string, selector, etc)
* @name get_node(obj [, as_dom])
@@ -763,6 +925,107 @@ interface JSTree extends JQuery {
*/
load_node: (obj: any, callback: (node: any, status: boolean) => void) => boolean;
/**
* load an array of nodes (will also load unavailable nodes as soon as the appear in the structure). Used internally.
* @private
* @name _load_nodes(nodes [, callback])
* @param {array} nodes
* @param {function} callback a function to be executed once loading is complete, the function is executed in the instance's scope and receives one argument - the array passed to _load_nodes
* @param {Boolean} is_callback - if false reloads node (AP - original comment missing in source code)
*/
_load_nodes: (nodes: any[], callback?: (nodes: any[]) => void, is_callback?: boolean) => void;
/**
* loads all unloaded nodes
* @name load_all([obj, callback])
* @param {mixed} obj the node to load recursively, omit to load all nodes in the tree
* @param {function} callback a function to be executed once loading all the nodes is complete,
* @trigger load_all.jstree
*/
load_all: (obj: any, callback: () => void) => void;
/**
* handles the actual loading of a node. Used only internally.
* @private
* @name _load_node(obj [, callback])
* @param {mixed} obj
* @param {function} callback a function to be executed once loading is complete, the function is executed in the instance's scope and receives one argument - a boolean status
* @return {Boolean}
*/
_load_node: (obj: any, callback?: (status: boolean) => void) => boolean;
/**
* adds a node to the list of nodes to redraw. Used only internally.
* @private
* @name _node_changed(obj)
* @param {mixed} obj
*/
_node_changed: (obj: any) => void;
/**
* appends HTML content to the tree. Used internally.
* @private
* @name _append_html_data(obj, data)
* @param {mixed} obj the node to append to
* @param {String} data the HTML string to parse and append
* @param {function} callback function which takes boolean flag executes after append (AP: originally lack of comment)
* @trigger model.jstree, changed.jstree
*/
_append_html_data: (dom: any, data: string, cb: (flag: boolean) => void) => void;
/**
* appends JSON content to the tree. Used internally.
* @private
* @name _append_json_data(obj, data)
* @param {mixed} dom the node to append to
* @param {String} data the JSON object to parse and append
* @param {function} cb function which takes boolean flag executes after append (AP: originally lack of comment)
* @param {Boolean} force_processing internal param - do not set
* @trigger model.jstree, changed.jstree
*/
_append_json_data: (dom: any, data: string, cb: (flag: boolean) => void, force_processing: boolean) => void;
/**
* parses a node from a jQuery object and appends them to the in memory tree model. Used internally.
* @private
* @name _parse_model_from_html(d [, p, ps])
* @param {jQuery} d the jQuery object to parse
* @param {String} p the parent ID
* @param {Array} ps list of all parents
* @return {String} the ID of the object added to the model
*/
_parse_model_from_html: (d: JQuery, p?: string, ps?: any[]) => string;
/**
* parses a node from a JSON object (used when dealing with flat data, which has no nesting of children, but has id and parent properties) and appends it to the in memory tree model. Used internally.
* @private
* @name _parse_model_from_flat_json(d [, p, ps])
* @param {Object} d the JSON object to parse
* @param {String} p the parent ID
* @param {Array} ps list of all parents
* @return {String} the ID of the object added to the model
*/
_parse_model_from_flat_json: (d: any, p?: string, ps?: any[]) => string;
/**
* parses a node from a JSON object and appends it to the in memory tree model. Used internally.
* @private
* @name _parse_model_from_json(d [, p, ps])
* @param {Object} d the JSON object to parse
* @param {String} p the parent ID
* @param {Array} ps list of all parents
* @return {String} the ID of the object added to the model
*/
_parse_model_from_json: (d: any, p?: string, ps?: any[]) => string;
/**
* redraws all nodes that need to be redrawn. Used internally.
* @private
* @name _redraw()
* @trigger redraw.jstree
*/
_redraw: () => void ;
/**
* redraws all nodes that need to be redrawn or optionally - the whole tree
* @name redraw([full])
@@ -770,6 +1033,25 @@ interface JSTree extends JQuery {
*/
redraw: (full?: boolean) => void;
/**
* redraws a single node's children. Used internally.
* @private
* @name draw_children(node)
* @param {mixed} node the node whose children will be redrawn
*/
draw_children: (node: any) => void;
/**
* redraws a single node. Used internally.
* @private
* @name redraw_node(node, deep, is_callback, force_render)
* @param {mixed} node the node to redraw
* @param {Boolean} deep should child nodes be redrawn too
* @param {Boolean} is_callback is this a recursion call
* @param {Boolean} force_render should children of closed parents be drawn anyway
*/
redraw_node: (node: any, deep: boolean, is_callback: boolean, force_render: boolean) => void;
/**
* opens a node, revaling its children. If the node is not loaded it will be loaded and opened once ready.
* @name open_node(obj [, callback, animation])
@@ -781,6 +1063,14 @@ interface JSTree extends JQuery {
*/
open_node: (obj: any, callback?: any, animation?: any) => void;
/**
* opens every parent of a node (node should be loaded)
* @name _open_to(obj)
* @param {mixed} obj the node to reveal
* @private
*/
_open_to: (obj:any) => void;
/**
* closes a node, hiding its children
* @name close_node(obj [, animation])
@@ -841,6 +1131,34 @@ interface JSTree extends JQuery {
*/
disable_node: (obj: any) => boolean;
/**
* called when a node is selected by the user. Used internally.
* @private
* @name activate_node(obj, e)
* @param {mixed} obj the node
* @param {Object} e the related event
* @trigger activate_node.jstree, changed.jstree
*/
activate_node: (obj: any, e: any) => void;
/**
* applies the hover state on a node, called when a node is hovered by the user. Used internally.
* @private
* @name hover_node(obj)
* @param {mixed} obj
* @trigger hover_node.jstree
*/
hover_node: (obj: any) => void;
/**
* removes the hover state from a nodecalled when a node is no longer hovered by the user. Used internally.
* @private
* @name dehover_node(obj)
* @param {mixed} obj
* @trigger dehover_node.jstree
*/
dehover_node: (obj: any) => void;
/**
* select a node
* @name select_node(obj [, supress_event, prevent_open])
@@ -908,6 +1226,24 @@ interface JSTree extends JQuery {
*/
get_bottom_selected: (full?: any) => any[];
/**
* gets the current state of the tree so that it can be restored later with `set_state(state)`. Used internally.
* @name get_state()
* @private
* @return {Object}
*/
get_state: () => any;
/**
* sets the state of the tree. Used internally.
* @name set_state(state [, callback])
* @private
* @param {Object} state the state to restore
* @param {Function} callback an optional function to execute once the state is restored.
* @trigger set_state.jstree
*/
set_state: (state: any, callback: () => void) => void;
/**
* refreshes the tree - all nodes are reloaded with calls to `load_node`.
* @name refresh()
@@ -943,6 +1279,17 @@ interface JSTree extends JQuery {
*/
get_text: (obj: any) => string;
/**
* set the text value of a node. Used internally, please use `rename_node(obj, val)`.
* @private
* @name set_text(obj, val)
* @param {mixed} obj the node, you can pass an array to set the text on multiple nodes
* @param {String} val the new text value
* @return {Boolean}
* @trigger set_text.jstree
*/
set_text: (obj:any, val:string) => boolean;
/**
* gets a JSON representation of a node (or the whole tree)
* @name get_json([obj, options])
@@ -989,6 +1336,19 @@ interface JSTree extends JQuery {
*/
delete_node: (obj: any) => boolean;
/**
* check if an operation is premitted on the tree. Used internally.
* @private
* @name check(chk, obj, par, pos)
* @param {String} chk the operation to check, can be "create_node", "rename_node", "delete_node", "copy_node" or "move_node"
* @param {mixed} obj the node
* @param {mixed} par the parent
* @param {mixed} pos the position to insert at, or if "rename_node" - the new name
* @param {mixed} more some various additional information, for example if a "move_node" operations is triggered by DND this will be the hovered node
* @return {Boolean}
*/
check: (chk: string, obj: any, par: any, pos: any, more: any) => boolean;
/**
* get the last error
* @name last_error()
@@ -1005,9 +1365,10 @@ interface JSTree extends JQuery {
* @param {function} callback a function to call once the move is completed, receives 3 arguments - the node, the new parent and the position
* @param {Boolean} is_loaded internal parameter indicating if the parent node has been loaded
* @param {Boolean} skip_redraw internal parameter indicating if the tree should be redrawn
* @param {Boolean} instance internal parameter indicating if the node comes from another instance
* @trigger move_node.jstree
*/
move_node: (obj: any, par: any, pos?: any, callback?: (node: any, new_par: any, pos: any) => void, is_loaded?: boolean, skip_redraw?: boolean) => void;
move_node: (obj: any, par: any, pos?: any, callback?: (node: any, new_par: any, pos: any) => void, is_loaded?: boolean, skip_redraw?: boolean, origin?: boolean) => void;
/**
* copy a node to a new parent
@@ -1018,9 +1379,10 @@ interface JSTree extends JQuery {
* @param {function} callback a function to call once the move is completed, receives 3 arguments - the node, the new parent and the position
* @param {Boolean} is_loaded internal parameter indicating if the parent node has been loaded
* @param {Boolean} skip_redraw internal parameter indicating if the tree should be redrawn
* @param {Boolean} instance internal parameter indicating if the node comes from another instance
* @trigger model.jstree copy_node.jstree
*/
copy_node: (obj: any, par: any, pos?: any, callback?: (node: any, new_par: any, pos: any) => void, is_loaded?: boolean, skip_redraw?: boolean) => void;
copy_node: (obj: any, par: any, pos?: any, callback?: (node: any, new_par: any, pos: any) => void, is_loaded?: boolean, skip_redraw?: boolean, origin?: boolean) => void;
/**
* cut a node (a later call to `paste(obj)` would move the node)
@@ -1193,15 +1555,12 @@ interface JSTree extends JQuery {
show_icon: (obj: any) => void;
/**
* redraws a single node. Used internally.
* set the undetermined state where and if necessary. Used internally.
* @private
* @name redraw_node(node, deep, is_callback)
* @param {mixed} node the node to redraw
* @param {Boolean} deep should child nodes be redrawn too
* @param {Boolean} is_callback is this a recursion call
* @param {Boolean} force_render should children of closed parents be drawn anyway
* @name _undetermined()
* @plugin checkbox
*/
redraw_node: (obj: any, deep?: boolean, is_callback?: boolean, force_render?: boolean) => any;
_undetermined: () => void;
/**
* show the node checkbox icons
@@ -1232,16 +1591,6 @@ interface JSTree extends JQuery {
*/
is_undetermined: (obj: any) => boolean;
/**
* called when a node is selected by the user. Used internally.
* @private
* @name activate_node(obj, e)
* @param {mixed} obj the node
* @param {Object} e the related event
* @trigger activate_node.jstree, changed.jstree
*/
activate_node: (obj: any, e: any) => any;
/**
* check a node (only if tie_selection in checkbox settings is false, otherwise select_node will be called internally)
* @name check_node(obj)
@@ -1315,7 +1664,6 @@ interface JSTree extends JQuery {
/**
* context menu plugin
*/
teardown: () => void;
/**
* prepare and show the context menu for a node
@@ -1329,16 +1677,31 @@ interface JSTree extends JQuery {
*/
show_contextmenu: (obj: any, x?: number, y?: number, e?: any) => void;
/**
* show the prepared context menu for a node
* @name _show_contextmenu(obj, x, y, i)
* @param {mixed} obj the node
* @param {Number} x the x-coordinate relative to the document to show the menu at
* @param {Number} y the y-coordinate relative to the document to show the menu at
* @param {Number} i the object of items to show
* @plugin contextmenu
* @trigger show_contextmenu.jstree
* @private
*/
_show_contextmenu: (obj: any, x: number, y: number, i: number) => void;
/**
* used to search the tree nodes for a given string
* @name search(str [, skip_async])
* @param {String} str the search string
* @param {Boolean} skip_async if set to true server will not be queried even if configured
* @param {Boolean} show_only_matches if set to true only matching nodes will be shown (keep in mind this can be very slow on large trees or old browsers)
* @param {mixed} inside an optional node to whose children to limit the search
* @param {Boolean} append if set to true the results of this search are appended to the previous search
* @plugin search
* @trigger search.jstree
*/
search: (str: string, skip_async?: boolean, show_only_matches?: boolean) => void;
search: (str: string, skip_async?: boolean, show_only_matches?: boolean, inside?: any, append?: boolean) => void;
/**
* used to clear the last search (removes classes and shows all nodes if filtering is on)
@@ -1348,6 +1711,15 @@ interface JSTree extends JQuery {
*/
clear_search: () => void;
/**
* opens nodes that need to be opened to reveal the search results. Used only internally.
* @private
* @name _search_open(d)
* @param {Array} d an array of node IDs
* @plugin search
*/
_search_open: (d: string[]) => void;
/**
* used to sort a node's children
* @private
@@ -161,3 +161,46 @@ var indexedTexts: KnockoutObservable<{ [suffixOrPrefix: string]: string[] }> = t
// 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),
}),
});
});
+20 -1
View File
@@ -5,8 +5,27 @@
/// <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: (value: T) => TResult): KnockoutObservableArray<TResult>;
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[] }>;
-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;
+2 -2
View File
@@ -133,8 +133,8 @@ interface KnockoutAllBindingsAccessor {
}
interface KnockoutBindingHandler {
init? (element: any, valueAccessor: () => any, allBindingsAccessor: KnockoutAllBindingsAccessor, viewModel: any, bindingContext: KnockoutBindingContext): void;
update? (element: any, valueAccessor: () => any, allBindingsAccessor: KnockoutAllBindingsAccessor, viewModel: any, bindingContext: KnockoutBindingContext): void;
init?: (element: any, valueAccessor: () => any, allBindingsAccessor: KnockoutAllBindingsAccessor, viewModel: any, bindingContext: KnockoutBindingContext) => void | { controlsDescendantBindings: boolean; };
update?: (element: any, valueAccessor: () => any, allBindingsAccessor: KnockoutAllBindingsAccessor, viewModel: any, bindingContext: KnockoutBindingContext) => void;
options?: any;
preprocess?: (value: string, name: string, addBindingCallback?: (name: string, value: string) => void) => string;
}
+2 -1
View File
@@ -163,6 +163,7 @@ function test_bindings() {
ko.bindingHandlers.yourBindingName = {
init: function (element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {
return { "controlsDescendantBindings": true };
},
update: function (element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {
}
@@ -655,4 +656,4 @@ function testUnwrapUnion() {
var possibleObs: KnockoutObservable<number> | number;
var num = ko.unwrap(possibleObs);
}
}
@@ -0,0 +1,31 @@
/// <reference path="./main-bower-files.d.ts" />
/// <reference path="../gulp/gulp.d.ts" />
import gulp = require("gulp");
import mainBowerFiles = require("main-bower-files");
gulp.task("main-bower-files:simple", () => {
gulp.src(mainBowerFiles())
.pipe(gulp.dest("dist/bower"));
});
gulp.task("main-bower-files:options", () => {
var files = mainBowerFiles({
debugging: false,
env: process.env.NODE_ENV,
paths: {
bowerDirectory: "path/for/bower_components",
bowerrc: "path/for/.bowerrc",
bowerJson: "path/for/bower.json"
},
checkExistence: false,
includeDev: false,
includeSelf: false,
filter: (filepath) => {
return filepath.indexOf("search") >= 0;
}
});
gulp.src(files, { base: "path/to/bower_components" })
.pipe(gulp.dest("dist/bower"));
});
+34
View File
@@ -0,0 +1,34 @@
// Type definitions for main-bower-files
// Project: https://github.com/ck86/main-bower-files
// Definitions by: Keita Kagurazaka <https://github.com/k-kagurazaka>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare module "main-bower-files" {
interface IPaths {
bowerDirectory?: string;
bowerrc?: string;
bowerJson?: string;
}
interface IFilterFunction {
(filepath: string): boolean;
}
interface IOptions {
debugging?: boolean;
main?: string | string[] | Object;
env?: string;
paths?: IPaths | string;
checkExistence?: boolean;
includeDev?: boolean | string;
includeSelf?: boolean;
filter?: RegExp | IFilterFunction | string | string[];
}
function mainBowerFiles(options?: IOptions): string[];
export = mainBowerFiles;
}
+1
View File
@@ -17,4 +17,5 @@ declare module "memory-cache" {
export function debug(bool: boolean): void;
export function hits(): number;
export function misses(): number;
export function keys() : any;
}
+13
View File
@@ -0,0 +1,13 @@
/// <reference path="./merge-stream.d.ts" />
import stream = require("stream");
import Stream = stream.Readable;
import merge = require("merge-stream");
var stream1 = new Stream();
var stream2 = new Stream();
var merged = merge(stream1, stream2);
var stream3 = new Stream();
merged.add(stream3);
+16
View File
@@ -0,0 +1,16 @@
// Type definitions for merge-stream
// Project: https://github.com/grncdr/merge-stream
// Definitions by: Keita Kagurazaka <https://github.com/k-kagurazaka>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts"/>
declare module "merge-stream" {
interface IMergedStream extends NodeJS.ReadWriteStream {
add: (source: NodeJS.ReadableStream) => IMergedStream;
}
function merge<T extends NodeJS.ReadableStream>(...streams: T[]): IMergedStream;
export = merge;
}
+2 -1
View File
@@ -224,7 +224,8 @@ declare module moment {
diff(b: Moment): number;
diff(b: Moment, unitOfTime: string): number;
diff(b: Moment, unitOfTime: string, round: boolean): number;
toArray(): number[];
toDate(): Date;
toISOString(): string;
toJSON(): string;
+47
View File
@@ -0,0 +1,47 @@
import Polyglot = require("node-polyglot");
function instantiatePolyglot(): void {
var polyglot = new Polyglot();
var phrasedPolyglot = new Polyglot({phrases: {"hello": "Hello"}});
var localePolyglot = new Polyglot({locale: "fr"});
}
function translate(): void {
var polyglot = new Polyglot();
polyglot.extend({
"hello": "Hello",
"hello_name": "Hola, %{name}.",
"nav": {
"sidebar": {
"welcome": "Welcome"
}
},
"num_cars": "%{smart_count} car |||| %{smart_count} cars"
});
polyglot.t("hello");
polyglot.t("hello_name");
polyglot.t("nav.sidebar.welcome");
polyglot.t("num_cars", {smart_count: 0});
polyglot.t("num_cars", 0);
polyglot.t("hello_name", {name: "Spike"});
polyglot.t("i_like_to_write_in_language", {
_: "I like to write in %{language}.",
language: "Javascript"
});
polyglot.replace({
"hello": "hey",
"nav": {
"sidebar": {
"welcome": "Greetings"
}
}
});
polyglot.clear();
polyglot.locale("fr");
polyglot.locale();
}
+41
View File
@@ -0,0 +1,41 @@
// Type definitions for node-polyglot v0.4.1
// Project: https://github.com/airbnb/polyglot.js
// Definitions by: Tim Jackson-Kiely <https://github.com/timjk>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "node-polyglot" {
module Polyglot {
interface InterpolationOptions {
smart_count?: number;
_?: string;
}
interface PolyglotOptions {
phrases?: any;
locale?: string;
}
}
class Polyglot {
constructor(options?: Polyglot.PolyglotOptions);
extend(phrases: any): void;
t(phrase: string): string;
t(phrase: string, smartCount: number): string;
t(phrase: string, interpolationOptions: Polyglot.InterpolationOptions): string;
clear(): void;
replace(phrases: any): void;
locale(): string;
locale(locale: string): void;
}
export = Polyglot;
}
+36 -1
View File
@@ -349,7 +349,42 @@ declare module "http" {
pause(): void;
resume(): void;
}
export interface Agent { maxSockets: number; sockets: any; requests: any; }
export interface AgentOptions {
/**
* Keep sockets around in a pool to be used by other requests in the future. Default = false
*/
keepAlive?: boolean;
/**
* When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000.
* Only relevant if keepAlive is set to true.
*/
keepAliveMsecs?: number;
/**
* Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity
*/
maxSockets?: number;
/**
* Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256.
*/
maxFreeSockets?: number;
}
export class Agent {
maxSockets: number;
sockets: any;
requests: any;
constructor(opts?: AgentOptions);
/**
* Destroy any sockets that are currently in use by the agent.
* It is usually not necessary to do this. However, if you are using an agent with KeepAlive enabled,
* then it is best to explicitly shut down the agent when you know that it will no longer be used. Otherwise,
* sockets may hang open for quite a long time before the server terminates them.
*/
destroy(): void;
}
export var STATUS_CODES: {
[errorCode: number]: string;
+149
View File
@@ -11,6 +11,7 @@ import http = require("http");
import net = require("net");
import dgram = require("dgram");
import querystring = require('querystring');
import path = require("path");
assert(1 + 1 - 2 === 0, "The universe isn't how it should.");
@@ -154,6 +155,15 @@ module http_tests {
var code = 100;
var codeMessage = http.STATUS_CODES['400'];
var codeMessage = http.STATUS_CODES[400];
var agent: http.Agent = new http.Agent({
keepAlive: true,
keepAliveMsecs: 10000,
maxSockets: Infinity,
maxFreeSockets: 256
});
var agent: http.Agent = http.globalAgent;
}
////////////////////////////////////////////////////
@@ -177,3 +187,142 @@ console.log(escaped);
var unescaped: string = querystring.unescape(escaped);
console.log(unescaped);
// http://example.com/product/abcde.html
////////////////////////////////////////////////////
/// path tests : http://nodejs.org/api/path.html
////////////////////////////////////////////////////
module path_tests {
path.normalize('/foo/bar//baz/asdf/quux/..');
path.join('/foo', 'bar', 'baz/asdf', 'quux', '..');
// returns
//'/foo/bar/baz/asdf'
try {
path.join('foo', {}, 'bar');
}
catch(error) {
}
path.resolve('foo/bar', '/tmp/file/', '..', 'a/../subfile');
//Is similar to:
//
//cd foo/bar
//cd /tmp/file/
//cd ..
// cd a/../subfile
//pwd
path.resolve('/foo/bar', './baz')
// returns
// '/foo/bar/baz'
path.resolve('/foo/bar', '/tmp/file/')
// returns
// '/tmp/file'
path.resolve('wwwroot', 'static_files/png/', '../gif/image.gif')
// if currently in /home/myself/node, it returns
// '/home/myself/node/wwwroot/static_files/gif/image.gif'
path.isAbsolute('/foo/bar') // true
path.isAbsolute('/baz/..') // true
path.isAbsolute('qux/') // false
path.isAbsolute('.') // false
path.isAbsolute('//server') // true
path.isAbsolute('C:/foo/..') // true
path.isAbsolute('bar\\baz') // false
path.isAbsolute('.') // false
path.relative('C:\\orandea\\test\\aaa', 'C:\\orandea\\impl\\bbb')
// returns
// '..\\..\\impl\\bbb'
path.relative('/data/orandea/test/aaa', '/data/orandea/impl/bbb')
// returns
// '../../impl/bbb'
path.dirname('/foo/bar/baz/asdf/quux')
// returns
// '/foo/bar/baz/asdf'
path.basename('/foo/bar/baz/asdf/quux.html')
// returns
// 'quux.html'
path.basename('/foo/bar/baz/asdf/quux.html', '.html')
// returns
// 'quux'
path.extname('index.html')
// returns
// '.html'
path.extname('index.coffee.md')
// returns
// '.md'
path.extname('index.')
// returns
// '.'
path.extname('index')
// returns
// ''
'foo/bar/baz'.split(path.sep)
// returns
// ['foo', 'bar', 'baz']
'foo\\bar\\baz'.split(path.sep)
// returns
// ['foo', 'bar', 'baz']
console.log(process.env.PATH)
// '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin'
process.env.PATH.split(path.delimiter)
// returns
// ['/usr/bin', '/bin', '/usr/sbin', '/sbin', '/usr/local/bin']
console.log(process.env.PATH)
// 'C:\Windows\system32;C:\Windows;C:\Program Files\nodejs\'
process.env.PATH.split(path.delimiter)
// returns
// ['C:\Windows\system32', 'C:\Windows', 'C:\Program Files\nodejs\']
path.parse('/home/user/dir/file.txt')
// returns
// {
// root : "/",
// dir : "/home/user/dir",
// base : "file.txt",
// ext : ".txt",
// name : "file"
// }
path.parse('C:\\path\\dir\\index.html')
// returns
// {
// root : "C:\",
// dir : "C:\path\dir",
// base : "index.html",
// ext : ".html",
// name : "index"
// }
path.format({
root : "/",
dir : "/home/user/dir",
base : "file.txt",
ext : ".txt",
name : "file"
});
// returns
// '/home/user/dir/file.txt'
}

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