diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 650078833..aadc541df 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -180,7 +180,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](flipsnap/flipsnap.d.ts) [flipsnap.js](http://pxgrid.github.io/js-flipsnap) by [kubosho](https://github.com/kubosho), [gsino](https://github.com/gsino), [Mayuki Sawatari](https://github.com/mayuki) * [:link:](flot/jquery.flot.d.ts) [Flot](http://www.flotcharts.org) by [Matt Burland](https://github.com/burlandm) * [:link:](flux/flux.d.ts) [Flux](http://facebook.github.io/flux) by [Steve Baker](https://github.com/stkb) -* [:link:](ion.rangeSlider/ion.rangeSlider.d.ts) [for Ion.RangeSlider](https://github.com/IonDen/ion.rangeSlider) by [Douglas Eichelberger](https://github.com/dduugg) +* [:link:](ion.rangeSlider/ion.rangeSlider.d.ts) [for Ion.RangeSlider](https://github.com/IonDen/ion.rangeSlider) by [Sixin Li](https://github.com/sixinli) * [:link:](form-data/form-data.d.ts) [form-data](https://github.com/felixge/node-form-data) by [Carlos Ballesteros Velasco](https://github.com/soywiz) * [:link:](foundation/foundation.d.ts) [Foundation](http://foundation.zurb.com) by [Boris Yankov](https://github.com/borisyankov) * [:link:](fpsmeter/FPSMeter.d.ts) [FPSmeter](http://darsa.in/fpsmeter) by [Aaron Lampros](http://github.com/alampros) @@ -195,6 +195,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](geojson/geojson.d.ts) [GeoJSON Format Specification](http://geojson.org) by [Jacob Bruun](https://github.com/cobster) * [:link:](giraffe/giraffe.d.ts) [Giraffe](https://github.com/barc/backbone.giraffe) by [Matt McCray](https://github.com/darthapo) * [:link:](gldatepicker/gldatepicker.d.ts) [glDatePicker](http://glad.github.com/glDatePicker) by [Dániel Tar](https://github.com/qcz) +* [:link:](glidejs/glidejs.d.ts) [Glide.js](http://glide.jedrzejchalubek.com) by [Milan Jaros](https://github.com/milanjaros) * [:link:](glob/glob.d.ts) [Glob](https://github.com/isaacs/node-glob) by [vvakame](https://github.com/vvakame) * [:link:](glob-stream/glob-stream.d.ts) [glob-stream](http://github.com/wearefractal/glob-stream) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](globalize/globalize.d.ts) [Globalize](https://github.com/jquery/globalize) by [Boris Yankov](https://github.com/borisyankov) @@ -203,8 +204,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](google.analytics/ga.d.ts) [Google Analytics (Classic and Universal)](https://developers.google.com/analytics/devguides/collection/gajs) by [Ronnie Haakon Hegelund](http://ronniehegelund.blogspot.dk), [Pat Kujawa](http://patkujawa.com) * [:link:](gapi/gapi.d.ts) [Google API Client](https://code.google.com/p/google-api-javascript-client) by [Frank M](https://github.com/sgtfrankieboy) * [:link:](google.feeds/google.feed.api.d.ts) [Google Feed Apis](https://developers.google.com/feed) by [RodneyJT](https://github.com/RodneyJT) -* [:link:](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:](google.geolocation/google.geolocation.d.ts) [Google Geolocation](https://code.google.com/p/geo-location-javascript) by [Vincent Bortone](https://github.com/vbortone) * [:link:](gapi.pagespeedonline/gapi.pagespeedonline.d.ts) [Google Page Speed Online Api](https://developers.google.com/speed/pagespeed) by [Frank M](https://github.com/sgtfrankieboy) * [:link:](recaptcha/recaptcha.d.ts) [Google Recaptcha](https://www.google.com/recaptcha) by [Brent Jenkins](https://github.com/brentj73) * [:link:](gapi.translate/gapi.translate.d.ts) [Google Translate API](https://developers.google.com/translate) by [Frank M](https://github.com/sgtfrankieboy) @@ -344,6 +345,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](jstree/jstree.d.ts) [jsTree](http://www.jstree.com) by [Adam Pluciński](https://github.com/adaskothebeast) * [:link:](jszip/jszip.d.ts) [JSZip](http://stuk.github.com/jszip) by [mzeiher](https://github.com/mzeiher) * [:link:](jwplayer/jwplayer.d.ts) [JW Player](http://developer.longtailvideo.com/trac) by [Martin Duparc](https://github.com/martinduparc) +* [:link:](jwt-simple/jwt-simple.d.ts) [jwt-simple](https://github.com/hokaccha/node-jwt-simple) by [Ken Fukuyama](https://github.com/kenfdev) * [:link:](karma-jasmine/karma-jasmine.d.ts) [karma-jasmine plugin](https://github.com/karma-runner/karma-jasmine) by [Michel Salib](https://github.com/michelsalib) * [:link:](keyboardjs/keyboardjs.d.ts) [KeyboardJS](https://github.com/RobertWHurst/KeyboardJS) by [Vincent Bortone](https://github.com/vbortone) * [:link:](keymaster/keymaster.d.ts) [keymaster](https://github.com/madrobby/keymaster) by [Martin W. Kirst](https://github.com/nitram509) @@ -411,6 +413,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](mocha/mocha.d.ts) [mocha](http://visionmedia.github.io/mocha) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid), [otiai10](https://github.com/otiai10) * [:link:](mocha-phantomjs/mocha-phantomjs.d.ts) [mocha-phantomjs](http://metaskills.net/mocha-phantomjs) by [Erik Schierboom](https://github.com/ErikSchierboom) * [:link:](modernizr/modernizr.d.ts) [Modernizr](http://modernizr.com) by [Boris Yankov](https://github.com/borisyankov), [Theodore Brown](https://github.com/theodorejb) +* [:link:](moment-timezone/moment-timezone.d.ts) [moment-timezone.js](http://momentjs.com/timezone) by [Michel Salib](https://github.com/michelsalib) * [:link:](moment/moment.d.ts) [Moment.js](https://github.com/timrwood/moment) by [Michael Lakerveld](https://github.com/Lakerfield), [Aaron King](https://github.com/kingdango), [Hiroki Horiuchi](https://github.com/horiuchi), [Dick van den Brink](https://github.com/DickvdBrink), [Adi Dahiya](https://github.com/adidahiya) * [:link:](mongodb/mongodb.d.ts) [MongoDB](https://github.com/mongodb/node-mongodb-native) by [Boris Yankov](https://github.com/borisyankov) * [:link:](mongoose/mongoose.d.ts) [Mongoose](http://mongoosejs.com) by [horiuchi](https://github.com/horiuchi) @@ -418,6 +421,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](mousetrap/mousetrap.d.ts) [Mousetrap](http://craig.is/killing/mice) by [Dániel Tar](https://github.com/qcz) * [:link:](mousetrap/mousetrap-global-bind.d.ts) [Mousetrap 1.4.6's global-bind extension](http://craig.is/killing/mice#extensions.global) by [Andrew Bradley](https://github.com/cspotcode) * [:link:](moviedb/moviedb.d.ts) [MovieDB](https://github.com/danzajdband/moviedb) by [Basarat Ali Syed](https://github.com/basarat) +* [:link:](mozilla-spidermonkey-parser-api/mozilla-spidermonkey-parser-api.d.ts) [Mozilla SpiderMonkey Parser API](https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Parser_API) by [vvakame](https://github.com/vvakame) * [:link:](firefox/firefox.d.ts) [Mozilla Web API](https://developer.mozilla.org/en-US/docs/Web/API) by [vvakame](https://github.com/vvakame) * [:link:](localForage/localForage.d.ts) [Mozilla's localForage](https://github.com/mozilla/localforage) by [david pichsenmeister](https://github.com/3x14159265) * [:link:](msgpack/msgpack.d.ts) [msgpack.js - MessagePack JavaScript Implementation](https://github.com/uupaa/msgpack.js) by [Shinya Mochizuki](https://github.com/enrapt-mochizuki) @@ -457,7 +461,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](notifyjs/notifyjs.d.ts) [notify.js](https://github.com/alexgibson/notify.js) by [soundTricker](https://github.com/soundTricker) * [:link:](noVNC/noVNC.d.ts) [noVNC](https://github.com/kanaka/noVNC) by [Ken Smith](https://github.com/smithkl42) * [:link:](npm/npm.d.ts) [npm](https://github.com/npm/npm) by [Maxime LUCE](https://github.com/SomaticIT) -* [:link:](nprogress/NProgress.d.ts) [NProgress](https://github.com/rstacruz/nprogress) by [Judah Gabriel Himango](http://debuggerdotbreak.wordpress.com) +* [:link:](nprogress/nprogress.d.ts) [NProgress](https://github.com/rstacruz/nprogress) by [Judah Gabriel Himango](http://debuggerdotbreak.wordpress.com) * [:link:](numeraljs/numeraljs.d.ts) [Numeral.js](https://github.com/adamwdraper/Numeral-js) by [Vincent Bortone](https://github.com/vbortone) * [:link:](object-path/object-path.d.ts) [objectPath](https://github.com/mariocasciaro/object-path) by [Paulo Cesar](https://github.com/pocesar) * [:link:](oclazyload/oclazyload.d.ts) [oc.LazyLoad](https://github.com/ocombe/ocLazyLoad) by [Roland Zwaga](https://github.com/rolandzwaga) @@ -479,6 +483,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](persona/persona.d.ts) [Persona](http://www.mozilla.org/en-US/persona) by [James Frasca](https://github.com/Nycto) * [:link:](pg/pg.d.ts) [pg](https://github.com/brianc/node-postgres) by [Phips Peter](http://pspeter3.com) * [:link:](pgwmodal/pgwmodal.d.ts) [PgwModal](http://pgwjs.com/pgwmodal) by [Pine Mizune](https://github.com/pine613) +* [:link:](phantom/phantom.d.ts) [PhantomJS bridge for NodeJS](https://github.com/sgentle/phantomjs-node) by [horiuchi](https://github.com/horiuchi) * [:link:](phantomjs/phantomjs.d.ts) [PhantomJS v1.9.0 API](https://github.com/ariya/phantomjs/wiki/API-Reference) by [Jed Hunsaker](https://github.com/jedhunsaker), [Mike Keesey](https://github.com/keesey) * [:link:](phonegap/phonegap.d.ts) [PhoneGap](http://phonegap.com) by [Boris Yankov](https://github.com/borisyankov), [Dick van den Brink](https://github.com/DickvdBrink) * [:link:](devextreme/dx.phonejs.d.ts) [PhoneJS](http://js.devexpress.com/MobileDevelopment) by [DevExpress Inc.](http://devexpress.com) @@ -487,6 +492,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](pixi/pixi.d.ts) [PIXI](https://github.com/GoodBoyDigital/pixi.js) by [xperiments](http://github.com/xperiments) * [:link:](platform/platform.d.ts) [Platform](https://github.com/bestiejs/platform.js) by [Jake Hickman](https://github.com/JakeH) * [:link:](playerframework/playerFramework.d.ts) [Player Framework (MMPPF)](https://playerframework.codeplex.com) by [Ricardo Sabino](https://github.com/ricardosabino) +* [:link:](pleasejs/please.d.ts) [PleaseJS](http://www.checkman.io/please) by [Toshiya Nakakura](https://github.com/nakakura) * [:link:](podcast/podcast.d.ts) [podcast](http://github.com/maxnowack/node-podcast) by [Niklas Mollenhauer](https://github.com/nikeee) * [:link:](popcorn/popcorn.d.ts) [Popcorn](https://github.com/mozilla/popcorn-js) by [grapswiz](https://github.com/grapswiz) * [:link:](pouchDB/pouch.d.ts) [Pouch](http://pouchdb.com) by [Bill Sears](https://github.com/MrBigDog2U) @@ -504,10 +510,10 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](q-retry/q-retry.d.ts) [q-retry](https://github.com/vilic/q-retry) by [VILIC VANE](https://github.com/vilic) * [:link:](qajax/qajax.d.ts) [Qajax](https://github.com/gre/qajax) by [Boltmade](https://github.com/Boltmade) * [:link:](qunit/qunit.d.ts) [QUnit](http://qunitjs.com) by [Diullei Gomes](https://github.com/diullei) +* [:link:](rabbit.js/rabbit.js.d.ts) [rabbit.js](https://github.com/squaremo/rabbit.js) by [Wonshik Kim](https://github.com/wokim) * [:link:](raphael/raphael.d.ts) [Raphael](http://raphaeljs.com) by [CheCoxshall](https://github.com/CheCoxshall) * [:link:](ravenjs/ravenjs.d.ts) [Raven.js](https://github.com/getsentry/raven-js) by [Santi Albo](https://github.com/santialbo) -* [:link:](react/react.d.ts) [React 0.12.RC](http://facebook.github.io/react) by [Asana](https://asana.com) -* [:link:](react-addons/react-addons.d.ts) [React with Addons 0.12.RC](http://facebook.github.io/react) by [Asana](https://asana.com) +* [:link:](react/react.d.ts) [React](http://facebook.github.io/react) by [Asana](https://asana.com) * [:link:](readdir-stream/readdir-stream.d.ts) [readdir-stream](https://github.com/logicalparadox/readdir-stream) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](redis/redis.d.ts) [redis](https://github.com/mranney/node_redis) by [Carlos Ballesteros Velasco](https://github.com/soywiz), [Peter Harris](https://github.com/CodeAnimal) * [:link:](ref/ref.d.ts) [ref](https://github.com/TooTallNate/ref) by [Paul Loyd](https://github.com/loyd) @@ -516,6 +522,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](ref-union/ref-union.d.ts) [ref-union](https://github.com/TooTallNate/ref-union) by [Paul Loyd](https://github.com/loyd) * [:link:](request/request.d.ts) [request](https://github.com/mikeal/request) by [Carlos Ballesteros Velasco](https://github.com/soywiz), [bonnici](https://github.com/bonnici), [Bart van der Schoor](https://github.com/Bartvds) * [:link:](requirejs/require.d.ts) [RequireJS](http://requirejs.org) by [Josh Baldwin](https://github.com/jbaldwin) +* [:link:](rest/rest.d.ts) [rest.js](https://github.com/cujojs/rest) by [Wim Looman](https://github.com/Nemo157) * [:link:](restangular/restangular.d.ts) [Restangular](https://github.com/mgonto/restangular) by [Boris Yankov](https://github.com/borisyankov) * [:link:](rethinkdb/rethinkdb.d.ts) [Rethinkdb](http://rethinkdb.com) by [Sean Hess](https://seanhess.github.io) * [:link:](reveal/reveal.d.ts) [Reveal](https://github.com/hakimel/reveal.js) by [grapswiz](https://github.com/grapswiz) @@ -540,9 +547,11 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](rx/rx.virtualtime.d.ts) [RxJS-VirtualTime](http://rx.codeplex.com) by [gsino](http://www.codeplex.com/site/users/view/gsino), [Igor Oleinikov](https://github.com/Igorbek) * [:link:](sammyjs/sammyjs.d.ts) [Sammy.js](http://sammyjs.org) by [Boris Yankov](https://github.com/borisyankov), [Oisin Grehan](https://github.com/oising) * [:link:](select2/select2.d.ts) [Select2](http://ivaynberg.github.com/select2) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](selectize/selectize.d.ts) [Selectize](https://github.com/brianreavis/selectize.js) by [Adi Dahiya](https://github.com/adidahiya) * [:link:](selenium-webdriver/selenium-webdriver.d.ts) [Selenium WebDriverJS](https://code.google.com/p/selenium) by [Bill Armstrong](https://github.com/BillArmstrong) * [:link:](semver/semver.d.ts) [semver](https://github.com/isaacs/node-semver) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](sendgrid/sendgrid.d.ts) [sendgrid](https://github.com/sendgrid/sendgrid-nodejs) by [Maxime LUCE](https://github.com/SomaticIT) +* [:link:](sharedworker/SharedWorker.d.ts) [SharedWorker](http://www.w3.org/TR/workers) by [Toshiya Nakakura](https://github.com/nakakura) * [:link:](shelljs/shelljs.d.ts) [ShellJS](http://shelljs.org) by [Niklas Mollenhauer](https://github.com/nikeee) * [:link:](should/should.d.ts) [should.js](https://github.com/visionmedia/should.js) by [Alex Varju](https://github.com/varju), [Maxime LUCE](https://github.com/SomaticIT) * [:link:](showdown/showdown.d.ts) [Showdown](https://github.com/coreyti/showdown) by [cbowdon](https://github.com/cbowdon) @@ -551,6 +560,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](signalr/signalr.d.ts) [SignalR](http://www.asp.net/signalr) by [Boris Yankov](https://github.com/borisyankov), [T. Michael Keesey](https://github.com/keesey) * [:link:](signature_pad/signature_pad.d.ts) [signature_pad](https://github.com/szimek/signature_pad) by [Abubaker Bashir](https://github.com/AbubakerB) * [:link:](simple-cw-node/simple-cw-node.d.ts) [simple-cw-node](https://github.com/astronaughts/simple-cw-node) by [vvakame](https://github.com/vvakame) +* [:link:](jquery.simplemodal/jquery.simplemodal.d.ts) [SimpleModal](http://www.ericmmartin.com/projects/simplemodal) by [Friedrich von Never](https://github.com/ForNeVeR) * [:link:](sinon/sinon.d.ts) [Sinon](http://sinonjs.org) by [William Sears](https://github.com/mrbigdog2u) * [:link:](sinon-chai/sinon-chai.d.ts) [sinon-chai](https://github.com/domenic/sinon-chai) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid) * [:link:](sipml/sipml.d.ts) [SIPml5](http://sipml5.org) by [A. Groenenboom](https://github.com/chookies) @@ -593,6 +603,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](swiz/swiz.d.ts) [swiz](https://github.com/racker/node-swiz) by [Jeff Goddard](https://github.com/jedigo) * [:link:](tape/tape.d.ts) [tape](https://github.com/substack/tape) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](tar/tar.d.ts) [tar](https://github.com/npm/node-tar) by [Maxime LUCE](https://github.com/SomaticIT) +* [:link:](tedious/tedious.d.ts) [tedious](https://pekim.github.io/tedious) by [Rogier Schouten](https://github.com/rogierschouten) * [:link:](teechart/teechart.d.ts) [TeeChart](http://www.steema.com) by [Steema Software](https://steema.com) * [:link:](text-buffer/text-buffer.d.ts) [text-buffer](https://github.com/atom/text-buffer) by [vvakame](https://github.com/vvakame) * [:link:](text-encoding/text-encoding.d.ts) [text-encoding](https://github.com/inexorabletash/text-encoding) by [MIZUNE Pine](https://github.com/pine613) @@ -648,14 +659,14 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](vinyl-fs/vinyl-fs.d.ts) [vinyl-fs](https://github.com/wearefractal/vinyl-fs) by [vvakame](https://github.com/vvakame) * [:link:](watch/watch.d.ts) [watch](https://github.com/mikeal/watch) by [Carlos Ballesteros Velasco](https://github.com/soywiz) * [:link:](jquery.watermark/jquery.watermark.d.ts) [Watermark plugin for jQuery](http://jquery-watermark.googlecode.com) by [Anwar Javed](https://github.com/anwarjaved) -* [:link:](webaudioapi/waa.d.ts) [Web Audio API](http://www.w3.org/TR/webaudio) by [Baruch Berger](https://github.com/bbss), [Kon](http://phyzkit.net) +* [:link:](webaudioapi/waa.d.ts) [Web Audio API](http://www.w3.org/TR/webaudio) by [Baruch Berger](https://github.com/bbss), [Kon](http://phyzkit.net), [kubosho](https://github.com/kubosho) * [:link:](webaudioapi/waa-nightly.d.ts) [Web Audio API (nightly)](http://www.w3.org/TR/2012/WD-webaudio-20120802) by [Baruch Berger](https://github.com/bbss) * [:link:](webmidi/webmidi.d.ts) [Web MIDI API](http://www.w3.org/TR/webmidi) by [Toshiya Nakakura](https://github.com/nakakura) * [:link:](devextreme/dx.webappjs.d.ts) [WebAppJS](http://js.devexpress.com/WebDevelopment) by [DevExpress Inc.](http://devexpress.com) * [:link:](webcrypto/WebCrypto.d.ts) [WebCrypto](http://www.w3.org/TR/WebCryptoAPI) by [Lucas Dixon](https://github.com/iislucas) * [:link:](webrtc/MediaStream.d.ts) [WebRTC](http://dev.w3.org/2011/webrtc) by [Ken Smith](https://github.com/smithkl42) * [:link:](websocket/websocket.d.ts) [websocket](https://github.com/Worlize/WebSocket-Node) by [Paul Loyd](https://github.com/loyd) -* [:link:](when/when.d.ts) [When](https://github.com/cujojs/when) by [Derek Cicerone](https://github.com/derekcicerone) +* [:link:](when/when.d.ts) [When](https://github.com/cujojs/when) by [Derek Cicerone](https://github.com/derekcicerone), [Wim Looman](https://github.com/Nemo157) * [:link:](winjs/winjs.d.ts) [WinJS](http://try.buildwinjs.com) by [TypeScript samples](https://www.typescriptlang.org), [Adam Hewitt](https://github.com/adamhewitt627), [Craig Treasure](https://github.com/craigktreasure), [Jeff Fisher](https://github.com/xirzec) * [:link:](winrt/winrt.d.ts) [WinRT](http://msdn.microsoft.com/en-us/library/windows/apps/br211377.aspx) by [TypeScript samples](https://www.typescriptlang.org) * [:link:](winston/winston.d.ts) [winston](https://github.com/flatiron/winston) by [bonnici](https://github.com/bonnici), [Peter Harris](https://github.com/codeanimal) diff --git a/amqp-rpc/amqp-rpc-tests.ts b/amqp-rpc/amqp-rpc-tests.ts new file mode 100644 index 000000000..30d740d3e --- /dev/null +++ b/amqp-rpc/amqp-rpc-tests.ts @@ -0,0 +1,42 @@ +/// +import amqp_rpc = require('amqp-rpc'); +var rpc = amqp_rpc.factory(); + +interface Name { + name?: string; +} + +rpc.on('inc', function (param, cb) { + var prevVal = param; + var nextVal = param + 2; + cb(++param, prevVal, nextVal); +}); + +rpc.on('say.*', function (param, cb, inf) { + var arr = inf.cmd.split('.'); + var name = (param && param.name) ? param.name : 'world'; + cb(arr[1] + ' ' + name + '!'); +}); + +rpc.on('withoutCB', function (param, cb, inf) { + if (cb) { + cb('please run function without cb parameter') + } + else { + console.log('this is function withoutCB'); + } +}); + +rpc.call('inc', 5, function (param1, param2, param3) { + console.log(param1, param2, param3); +}); + +rpc.call('say.Hello', { name: 'John' }, function (msg) { + console.log('results of say.Hello:', msg); //output: Hello John! +}); + +rpc.call('withoutCB', {}, function (msg) { + console.log('withoutCB results:', msg); //output: please run function without cb parameter +}); + +rpc.call('withoutCB', {}); //output message on server side console \ No newline at end of file diff --git a/amqp-rpc/amqp-rpc.d.ts b/amqp-rpc/amqp-rpc.d.ts new file mode 100644 index 000000000..a848fd4c4 --- /dev/null +++ b/amqp-rpc/amqp-rpc.d.ts @@ -0,0 +1,68 @@ +// Type definitions for amqp-rpc v0.0.8 +// Project: https://github.com/demchenkoe/node-amqp-rpc/ +// Definitions by: Wonshik Kim +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "amqp-rpc" { + + export interface Options { + connection?: any; + url?: string; + exchangeInstance?: any; + exchange?: string; + exchange_options?: { + exclusive?: boolean; + autoDelete?: boolean; + }; + ipml_options?: { + defaultExchangeName?: string; + } + conn_options?: any; + } + + export interface CallOptions { + correlationId?: string; + autoDeleteCallback?: any; + } + + export interface HandlerOptions { + queueName?: string; + durable?: boolean; + exclusive?: boolean; + autoDelete?: boolean; + } + + export interface BroadcastOptions { + ttl?: boolean; + onResponse?: any; + context?: any; + onComplete?: any; + } + + export interface CommandInfo { + cmd?: string; + exchange?: string; + contentType?: string; + size?: number; + } + + export interface Callback { + (...args: any[]): void; + } + + export function factory(opt?: Options): amqpRPC; + + export class amqpRPC { + constructor(opt?: Options); + generateQueueName(type: string): string; + disconnect(): void; + call(cmd: string, params: T, cb?: Callback, context?: any, options?: CallOptions): string; + on(cmd: string, cb: (param?: T, cb?: Callback, info?: CommandInfo) => void, context?: any, options?: HandlerOptions): boolean; + off(cmd: string): boolean; + callBroadcast(cmd: string, params: any, options: BroadcastOptions): void; + onBroadcast(cmd: string, cb: (err: any) => void, context: any, options?: any): boolean; + offBroadcast(cmd: string): boolean; + } +} \ No newline at end of file diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index febd17873..275a727cc 100755 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -743,7 +743,7 @@ declare module ng { debugEnabled(enabled: boolean): ILogProvider; } - // We define this as separete interface so we can reopen it later for + // We define this as separate interface so we can reopen it later for // the ngMock module. interface ILogCall { (...args: any[]): void; diff --git a/backbone/backbone.d.ts b/backbone/backbone.d.ts index 8e2637604..0cb827a28 100644 --- a/backbone/backbone.d.ts +++ b/backbone/backbone.d.ts @@ -109,7 +109,7 @@ declare module Backbone { urlRoot: any; constructor(attributes?: any, options?: any); - initialize(attributes?: any): void; + initialize(attributes?: any, options?: any): void; fetch(options?: ModelFetchOptions): JQueryXHR; @@ -176,6 +176,7 @@ declare module Backbone { length: number; constructor(models?: TModel[], options?: any); + initialize(models?: TModel[], options?: any): void; fetch(options?: CollectionFetchOptions): JQueryXHR; @@ -328,6 +329,7 @@ declare module Backbone { private static extend(properties: any, classProperties?: any): any; constructor(options?: ViewOptions); + initialize(options?: ViewOptions): void; /** * Events hash or a method returning the events hash that maps events/selectors to methods on your View. diff --git a/big.js/big.js-tests.ts b/big.js/big.js-tests.ts index 6de9ee7cc..df6128314 100644 --- a/big.js/big.js-tests.ts +++ b/big.js/big.js-tests.ts @@ -230,4 +230,21 @@ function propertiesTest3() { y.c // '0' [0].toString() y.e // 0 y.s // -1 +} + +// see http://mikemcl.github.io/big.js/#faq +// "How can I simultaneously use different decimal places and/or rounding mode settings for different Big numbers?" +function testMultipleConstructors() { + + var Big10 = Big(); + + // Set the decimal places of division operations for each constructor. + Big.DP = 3; + Big10.DP = 10; + + var x = Big(5); + var y = Big10(5); + + x.div(3) // 1.667 + y.div(3) // 1.6666666667 } \ No newline at end of file diff --git a/big.js/big.js.d.ts b/big.js/big.js.d.ts index 4f6278a80..0e4ac48be 100644 --- a/big.js/big.js.d.ts +++ b/big.js/big.js.d.ts @@ -42,6 +42,9 @@ declare module BigJsLibrary { (value: string): BigJS; /** A decimal value. */ (value: BigJS): BigJS; + + /** A decimal value. */ + (): BigJS; } /** BigJS instance methods */ diff --git a/chai/chai.d.ts b/chai/chai.d.ts index a2ef1379b..ff5526189 100644 --- a/chai/chai.d.ts +++ b/chai/chai.d.ts @@ -12,8 +12,8 @@ declare module chai { stack: string; } - function expect(target: any, message?: string): Expect; - + export function expect(target: any, message?: string): Expect; + export var assert: Assert; export var config: Config; diff --git a/chrome/chrome.d.ts b/chrome/chrome.d.ts index d590eb3a9..ede0dfa40 100755 --- a/chrome/chrome.d.ts +++ b/chrome/chrome.d.ts @@ -397,7 +397,7 @@ declare module chrome.cookies { } export function getAllCookieStores(callback: (cookieStores: CookieStore[]) => void): void; - export function getAll(details: GetAllDetails, callback: (cookies: Cookie) => void): void; + export function getAll(details: GetAllDetails, callback: (cookies: Cookie[]) => void): void; export function set(details: SetDetails, callback?: (cookie?: Cookie) => void): void; export function remove(details: Details, callback?: (details: Details) => void): void; export function get(details: Details, callback: (cookie?: Cookie) => void): void; diff --git a/d3/d3.d.ts b/d3/d3.d.ts index 2f439a76f..15b1375f3 100644 --- a/d3/d3.d.ts +++ b/d3/d3.d.ts @@ -926,7 +926,7 @@ declare module D3 { (name: string, value: any, priority?: string): Transition; (name: string, valueFunction: (data: any, index: number) => any, priority?: string): Transition; }; - call(callback: (selection: Selection) => void ): Transition; + call(callback: (transition: Transition, ...args: any[]) => void, ...args: any[]): Transition; /** * Select an element from the current document */ @@ -1750,6 +1750,8 @@ declare module D3 { export interface Axis { (selection: Selection): void; + (transition: Transition.Transition): void; + scale: { (): any; (scale: any): Axis; diff --git a/esprima/esprima-tests.ts b/esprima/esprima-tests.ts index 9451e077d..d2635a404 100644 --- a/esprima/esprima-tests.ts +++ b/esprima/esprima-tests.ts @@ -7,9 +7,8 @@ var token: esprima.Token; var options: esprima.Options; var comment: Syntax.Comment; var program: Syntax.Program; -var statement: Syntax.SomeStatement; -var blockStatement: Syntax.BlockStatement; -var expression: Syntax.SomeExpression; +var statement: Syntax.Statement; +var expression: Syntax.Expression; var property: Syntax.Property; var identifier: Syntax.Identifier; var literal: Syntax.Literal; @@ -52,94 +51,136 @@ string = comment.value; // Statement // BlockStatement -string = statement.type; -statement = statement.body[0]; -comment = statement.leadingComments[0] -comment = statement.trailingComments[0] +var blockStatement: Syntax.BlockStatement; +string = blockStatement.type; +statement = blockStatement.body[0]; +comment = blockStatement.leadingComments[0]; +comment = blockStatement.trailingComments[0]; // ExpressionStatement -expression = statement.expression; +var expressionStatement: Syntax.ExpressionStatement; +expression = expressionStatement.expression; // IfStatement -expression = statement.test; -statement = statement.consequent; -statement = statement.alternate; +var ifStatement: Syntax.IfStatement; +expression = ifStatement.test; +statement = ifStatement.consequent; +statement = ifStatement.alternate; // LabeledStatement -identifier = statement.label; -statement = statement.body; +var labeledStatement: Syntax.LabeledStatement; +identifier = labeledStatement.label; +statement = labeledStatement.body; // WithStatement -expression = statement.object; +var withStatement: Syntax.WithStatement; +expression = withStatement.object; // SwitchStatement -expression = statement.discriminant; -switchCase = statement.cases[0]; -boolean = statement.lexical; +var switchStatement: Syntax.SwitchStatement; +expression = switchStatement.discriminant; +switchCase = switchStatement.cases[0]; +boolean = switchStatement.lexical; // ReturnStatement -expression = statement.argument; +var returnStatement: Syntax.ReturnStatement; +expression = returnStatement.argument; // TryStatement -blockStatement = statement.block; -catchClause = statement.handler; -catchClause = statement.guardedHandlers[0]; -blockStatement = statement.finalizer; +var tryStatement: Syntax.TryStatement; +blockStatement = tryStatement.block; +catchClause = tryStatement.handler; +catchClause = tryStatement.guardedHandlers[0]; +blockStatement = tryStatement.finalizer; // ForStatement -variableDeclaratorOrExpression = statement.init; -expression = statement.update; +var forStatement: Syntax.ForStatement; +variableDeclaratorOrExpression = forStatement.init; +expression = forStatement.update; // ForInStatement -variableDeclaratorOrExpression = statement.left; -expression = statement.right; -boolean = statement.each; +var forInStatement: Syntax.ForInStatement; +variableDeclaratorOrExpression = forInStatement.left; +expression = forInStatement.right; +boolean = forInStatement.each; // Expression // ArrayExpression -string = expression.type; -expression = expression.elements[0]; +var arrayExpression: Syntax.ArrayExpression; +string = arrayExpression.type; +expression = arrayExpression.elements[0]; // ObjectExpression -property = expression.properties[0]; +var objectExpression: Syntax.ObjectExpression; +property = objectExpression.properties[0]; string = property.type; literalOrIdentifier = property.key; expression = property.value; string = property.kind; // FunctionExpression -identifier = expression.id; -identifier = expression.params[0]; -expression = expression.defaults[0]; -identifier = expression.rest; -blockStatementOrExpression = expression.body; -boolean = expression.generator; -boolean = expression.expression; +var functionExpression: Syntax.FunctionExpression; +identifier = functionExpression.id; +identifier = functionExpression.params[0]; +expression = functionExpression.defaults[0]; +identifier = functionExpression.rest; +blockStatementOrExpression = functionExpression.body; +boolean = functionExpression.generator; +boolean = functionExpression.expression; // SequenceExpression -expression = expression.expressions[0] +var sequenceExpression: Syntax.SequenceExpression; +expression = sequenceExpression.expressions[0] // UnaryExpression -string = expression.operator; -boolean = expression.prefix; +var unaryExpression: Syntax.UnaryExpression; +string = unaryExpression.operator; +boolean = unaryExpression.prefix; // BinaryExpression -expression = expression.left; -expression = expression.right; +var binaryExpression: Syntax.BinaryExpression; +expression = binaryExpression.left; +expression = binaryExpression.right; // ConditionalExpression -expression = expression.test; -expression = expression.alternate; -expression = expression.consequent; +var conditionalExpression: Syntax.ConditionalExpression; +expression = conditionalExpression.test; +expression = conditionalExpression.alternate; +expression = conditionalExpression.consequent; -// ConditionalExpression -expression = expression.callee; -expression = expression.arguments[0]; +// NewExpression +var newExpression: Syntax.NewExpression; +expression = newExpression.callee; +expression = newExpression.arguments[0]; + +// CallExpression +var callExpression: Syntax.CallExpression; +expression = callExpression.callee; +expression = callExpression.arguments[0]; // MemberExpression -expression = expression.object; -identifierOrExpression = expression.property; -boolean = expression.computed; +var memberExpression: Syntax.MemberExpression; +expression = memberExpression.object; +identifierOrExpression = memberExpression.property; +boolean = memberExpression.computed; + +// Declarations +var functionDeclaration: Syntax.FunctionDeclaration; +identifier = functionDeclaration.id; +var params:Syntax.Identifier[] = functionDeclaration.params; +var defaults:Syntax.Expression[] = functionDeclaration.defaults; +identifier = functionDeclaration.rest; +var body:Syntax.BlockStatementOrExpression = functionDeclaration.body; +boolean = functionDeclaration.generator; +boolean = functionDeclaration.expression; + +var variableDeclaration: Syntax.VariableDeclaration; +var declarations:Syntax.VariableDeclarator[] = variableDeclaration.declarations; +string = variableDeclaration.kind; // "var" | "let" | "const" + +var variableDeclarator: Syntax.VariableDeclarator; +identifier = variableDeclarator.id; // Pattern +expression = variableDeclarator.init; // Clauses // SwitchCase diff --git a/esprima/esprima.d.ts b/esprima/esprima.d.ts index 1e603ee25..d62bb09bb 100644 --- a/esprima/esprima.d.ts +++ b/esprima/esprima.d.ts @@ -49,7 +49,7 @@ declare module esprima { // Program interface Program extends Node { - body: SomeStatement[] + body: Statement[] comments?: Comment[] } @@ -57,14 +57,13 @@ declare module esprima { interface Function extends Node { id: Identifier // | null params: Identifier[] - defaults: SomeExpression[] + defaults: Expression[] rest: Identifier // | null body: BlockStatementOrExpression generator: boolean expression: boolean } - interface BlockStatementOrExpression extends Array, BlockStatement, SomeExpression { - body: BlockStatementOrExpression + interface BlockStatementOrExpression extends BlockStatement, Expression { } // Statement @@ -73,19 +72,19 @@ declare module esprima { interface EmptyStatement extends Statement { } interface BlockStatement extends Statement { - body: SomeStatement[] + body: Statement[] } interface ExpressionStatement extends Statement { - expression: SomeExpression + expression: Expression } interface IfStatement extends Statement { - test: SomeExpression - consequent: SomeStatement - alternate: SomeStatement + test: Expression + consequent: Statement + alternate: Statement } interface LabeledStatement extends Statement { label: Identifier - body: SomeStatement + body: Statement } interface BreakStatement extends Statement { label: Identifier // | null @@ -94,19 +93,19 @@ declare module esprima { label: Identifier // | null } interface WithStatement extends Statement { - object: SomeExpression - body: SomeStatement + object: Expression + body: Statement } interface SwitchStatement extends Statement { - discriminant: SomeExpression + discriminant: Expression cases: SwitchCase[] lexical: boolean } interface ReturnStatement extends Statement { - argument: SomeExpression // | null + argument: Expression // | null } interface ThrowStatement extends Statement { - argument: SomeExpression + argument: Expression } interface TryStatement extends Statement { block: BlockStatement @@ -115,80 +114,73 @@ declare module esprima { finalizer: BlockStatement // | null } interface WhileStatement extends Statement { - test: SomeExpression - body: SomeStatement + test: Expression + body: Statement } interface DoWhileStatement extends Statement { - body: SomeStatement - test: SomeExpression + body: Statement + test: Expression } interface ForStatement extends Statement { init: VariableDeclaratorOrExpression // | null - test: SomeExpression // | null - update: SomeExpression // | null - body: SomeStatement + test: Expression // | null + update: Expression // | null + body: Statement } interface ForInStatement extends Statement { left: VariableDeclaratorOrExpression - right: SomeExpression - body: SomeStatement + right: Expression + body: Statement each: boolean } - interface VariableDeclaratorOrExpression extends VariableDeclarator, SomeExpression { + interface VariableDeclaratorOrExpression extends VariableDeclarator, Expression { } interface DebuggerStatement extends Statement { } - interface SomeStatement extends - EmptyStatement, ExpressionStatement, BlockStatement, IfStatement, - LabeledStatement, BreakStatement, ContinueStatement, WithStatement, - SwitchStatement, ReturnStatement, ThrowStatement, TryStatement, - WhileStatement, DoWhileStatement, ForStatement, ForInStatement, DebuggerStatement { - body: SomeStatementOrList - } - interface SomeStatementOrList extends Array, SomeStatement { + interface StatementOrList extends Array, Statement { } - // Declration - interface Declration extends Statement { + // Declaration + interface Declaration extends Statement { } - interface FunctionDeclration extends Declration { + interface FunctionDeclaration extends Declaration { id: Identifier params: Identifier[] // Pattern - defaults: SomeExpression[] + defaults: Expression[] rest: Identifier body: BlockStatementOrExpression generator: boolean expression: boolean } - interface VariableDeclaration extends Declration { + interface VariableDeclaration extends Declaration { declarations: VariableDeclarator[] kind: string // "var" | "let" | "const" } interface VariableDeclarator extends Node { id: Identifier // Pattern - init: SomeExpression + init: Expression } // Expression interface Expression extends Node { // | Pattern } - interface SomeExpression extends - ThisExpression, ArrayExpression, ObjectExpression, FunctionExpression, - ArrowFunctionExpression, SequenceExpression, UnaryExpression, BinaryExpression, - AssignmentExpression, UpdateExpression, LogicalExpression, ConditionalExpression, - NewExpression, CallExpression, MemberExpression { - } + //interface Expression extends + // ThisExpression, ArrayExpression, ObjectExpression, FunctionExpression, + // ArrowFunctionExpression, SequenceExpression, UnaryExpression, BinaryExpression, + // AssignmentExpression, UpdateExpression, LogicalExpression, ConditionalExpression, + // NewExpression, CallExpression, MemberExpression { + //} interface ThisExpression extends Expression { } interface ArrayExpression extends Expression { - elements: SomeExpression[] // [ Expression | null ] + elements: Expression[] // [ Expression | null ] } interface ObjectExpression extends Expression { properties: Property[] } interface Property extends Node { key: LiteralOrIdentifier // Literal | Identifier - value: SomeExpression + value: Expression kind: string // "init" | "get" | "set" } interface LiteralOrIdentifier extends Literal, Identifier { @@ -198,66 +190,66 @@ declare module esprima { interface ArrowFunctionExpression extends Function, Expression { } interface SequenceExpression extends Expression { - expressions: SomeExpression[] + expressions: Expression[] } interface UnaryExpression extends Expression { operator: string // UnaryOperator prefix: boolean - argument: SomeExpression + argument: Expression } interface BinaryExpression extends Expression { operator: string // BinaryOperator - left: SomeExpression - right: SomeExpression + left: Expression + right: Expression } interface AssignmentExpression extends Expression { operator: string // AssignmentOperator - left: SomeExpression - right: SomeExpression + left: Expression + right: Expression } interface UpdateExpression extends Expression { operator: string // UpdateOperator - argument: SomeExpression + argument: Expression prefix: boolean } interface LogicalExpression extends Expression { operator: string // LogicalOperator - left: SomeExpression - right: SomeExpression + left: Expression + right: Expression } interface ConditionalExpression extends Expression { - test: SomeExpression - alternate: SomeExpression - consequent: SomeExpression + test: Expression + alternate: Expression + consequent: Expression } interface NewExpression extends Expression { - callee: SomeExpression - arguments: SomeExpression[] + callee: Expression + arguments: Expression[] } interface CallExpression extends Expression { - callee: SomeExpression - arguments: SomeExpression[] + callee: Expression + arguments: Expression[] } interface MemberExpression extends Expression { - object: SomeExpression + object: Expression property: IdentifierOrExpression // Identifier | Expression computed: boolean } - interface IdentifierOrExpression extends Identifier, SomeExpression { + interface IdentifierOrExpression extends Identifier, Expression { } // Pattern - // interface Pattern extends Node { - // } + // interface Pattern extends Node { + // } // Clauses interface SwitchCase extends Node { - test: SomeExpression - consequent: SomeStatement[] + test: Expression + consequent: Statement[] } interface CatchClause extends Node { param: Identifier // Pattern - guard: SomeExpression + guard: Expression body: BlockStatement } diff --git a/gamepad/gamepad-tests.ts b/gamepad/gamepad-tests.ts index 48b0f8e73..4b0cddcad 100644 --- a/gamepad/gamepad-tests.ts +++ b/gamepad/gamepad-tests.ts @@ -51,9 +51,9 @@ if(pad){ for (var k = 0; k < pad.buttons.length; k++) { - var button = pad.buttons[k]; - if(button !== 0){ - console.log('pad[' + pad.index + ']: ' + 'time=' + pad.timestamp + ' id="' + pad.id + '" button[' + k + '] = ' + button); + var button = pad.buttons[k]; + if(button.pressed){ + console.log('pad[' + pad.index + ']: ' + 'time=' + pad.timestamp + ' id="' + pad.id + '" button[' + k + '] = ' + button.value); } } for (var k = 0; k < pad.axes.length; k++) diff --git a/gamepad/gamepad.d.ts b/gamepad/gamepad.d.ts index f6af65a1a..69ef795fb 100644 --- a/gamepad/gamepad.d.ts +++ b/gamepad/gamepad.d.ts @@ -36,7 +36,7 @@ declare module Gamepad{ * Array of values for all buttons of the gamepad. All button values must be linearly normalized to the range [0.0 .. 1.0]. 0.0 must mean fully unpressed, and 1.0 must mean fully pressed. It is recommended that buttons appear in decreasing importance such that the primary button, secondary button, tertiary button, and so on appear as elements 0, 1, 2, ... in the buttons array. * @readonly */ - buttons:number[]; + buttons:GamepadButton[]; } /** @@ -55,7 +55,10 @@ declare module Gamepad{ length: number; } - + export interface GamepadButton{ + pressed: boolean; + value: number; + } /* * @event gamepadconnected diff --git a/ion.rangeSlider/ion.rangeSlider-1.9.1-tests.ts b/ion.rangeSlider/ion.rangeSlider-1.9.1-tests.ts new file mode 100644 index 000000000..c04d5715f --- /dev/null +++ b/ion.rangeSlider/ion.rangeSlider-1.9.1-tests.ts @@ -0,0 +1,38 @@ +/// +/// + +var sliderInputElement = $(''); +sliderInputElement.ionRangeSlider({ + min: 10, + max: 100, + from: 30, + to: 80, + type: "single", + step: 10, + prefix: "$", + postfix: ".00", + maxPostfix: "+", + hasGrid: true, + hideMinMax: true, + hideFromTo: true, + prettify: true, + disable: false, + values: ["a", "b", "c"], + onLoad: function (obj) { + console.log(obj); + }, + onChange: function (obj) { + console.log(obj); + }, + onFinish: function (obj) { + console.log(obj); + } +}); +sliderInputElement.ionRangeSlider("update", { + min: 20, + max: 90, + from: 40, + to: 70, + step: 5 +}); +sliderInputElement.ionRangeSlider("remove"); diff --git a/ion.rangeSlider/ion.rangeSlider-1.9.1.d.ts b/ion.rangeSlider/ion.rangeSlider-1.9.1.d.ts new file mode 100644 index 000000000..b60954b3b --- /dev/null +++ b/ion.rangeSlider/ion.rangeSlider-1.9.1.d.ts @@ -0,0 +1,51 @@ +// Type definitions for for Ion.RangeSlider 1.9.1 +// Project: https://github.com/IonDen/ion.rangeSlider/ +// Definitions by: Douglas Eichelberger +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +// API documentation: http://ionden.com/a/plugins/ion.rangeSlider/en.html + +interface JQuery { + ionRangeSlider(): JQuery; + ionRangeSlider(options: IonRangeSliderOptions): JQuery; + ionRangeSlider(method: string): JQuery; + ionRangeSlider(method: string, options: IonRangeSliderOptions): JQuery; +} + +interface IonRangeSliderOptions { + disable?: boolean; + from?: number; + hasGrid?: boolean; + hideFromTo?: boolean; + hideMinMax?: boolean; + max?: number; + maxPostfix?: string; + min?: number; + onChange?: (obj: IonRangeSliderEvent) => void; + onFinish?: (obj: IonRangeSliderEvent) => void; + onLoad?: (obj: IonRangeSliderEvent) => void; + postfix?: string; + prefix?: string; + prettify?: boolean; + step?: number; + to?: number; + type?: string; + values?: any[]; +} + +interface IonRangeSliderEvent { + fromNumber: number; + fromPers: number; + fromValue?: any; + fromX: number; + fromX_pure?: number; + input: JQuery; + max: number; + min: number; + slider: JQuery; + toNumber: number; + toPers: number; + toValue?: number; + toX: number; + toX_pure?: number; +} diff --git a/ion.rangeSlider/ion.rangeSlider-tests.ts b/ion.rangeSlider/ion.rangeSlider-tests.ts index 6f1d25f0d..d233404d2 100644 --- a/ion.rangeSlider/ion.rangeSlider-tests.ts +++ b/ion.rangeSlider/ion.rangeSlider-tests.ts @@ -3,36 +3,63 @@ var sliderInputElement = $(''); sliderInputElement.ionRangeSlider({ - min: 10, - max: 100, - from: 30, - to: 80, - type: "single", - step: 10, - prefix: "$", - postfix: ".00", - maxPostfix: "+", - hasGrid: true, - hideMinMax: true, - hideFromTo: true, - prettify: true, + decorate_both: true, disable: false, - values: ["a", "b", "c"], - onLoad: function (obj) { - console.log(obj); - }, + drag_interval: false, + force_edges: false, + from: 30, + from_fixed: false, + from_max: 50, + from_min: 20, + from_shadow: false, + grid: true, + grid_margin: true, + grid_num: 4, + grid_snap: false, + hide_from_to: false, + hide_min_max: false, + keyboard: true, + keyboard_step: 1, + max: 100, + max_interval: 5, + max_postfix: "+", + min: 10, + min_interval: 5, onChange: function (obj) { console.log(obj); }, onFinish: function (obj) { console.log(obj); - } + }, + onStart: function (obj) { + console.log(obj); + }, + onUpdate: function (obj) { + console.log(obj); + }, + postfix: ".00", + prefix: "$", + prettify: function(num) { + return String(num); + }, + prettify_enabled: true, + prettify_separator: ",", + step: 10, + to: 80, + to_fixed: false, + to_max: 100, + to_min: 60, + to_shadowed: false, + type: "double", + values: ["a", "b", "c"], + values_separator: "," }); -sliderInputElement.ionRangeSlider("update", { +sliderInputElement.update({ min: 20, max: 90, from: 40, to: 70, step: 5 }); -sliderInputElement.ionRangeSlider("remove"); +sliderInputElement.reset(); +sliderInputElement.destroy(); diff --git a/ion.rangeSlider/ion.rangeSlider.d.ts b/ion.rangeSlider/ion.rangeSlider.d.ts index b60954b3b..92b5ed9b5 100644 --- a/ion.rangeSlider/ion.rangeSlider.d.ts +++ b/ion.rangeSlider/ion.rangeSlider.d.ts @@ -1,51 +1,70 @@ -// Type definitions for for Ion.RangeSlider 1.9.1 +// Type definitions for for Ion.RangeSlider 2.0.2 // Project: https://github.com/IonDen/ion.rangeSlider/ -// Definitions by: Douglas Eichelberger +// Definitions by: Sixin Li // Definitions: https://github.com/borisyankov/DefinitelyTyped // API documentation: http://ionden.com/a/plugins/ion.rangeSlider/en.html interface JQuery { + destroy(): void; ionRangeSlider(): JQuery; ionRangeSlider(options: IonRangeSliderOptions): JQuery; - ionRangeSlider(method: string): JQuery; - ionRangeSlider(method: string, options: IonRangeSliderOptions): JQuery; + reset(): void; + update(option: IonRangeSliderOptions): void; } interface IonRangeSliderOptions { + decorate_both?: boolean; disable?: boolean; + drag_interval?: boolean; + force_edges?: boolean; from?: number; - hasGrid?: boolean; - hideFromTo?: boolean; - hideMinMax?: boolean; + from_fixed?: boolean; + from_max?: number; + from_min?: number; + from_shadow?: boolean; + grid?: boolean; + grid_margin?: boolean; + grid_num?: number; + grid_snap?: boolean; + hide_from_to?: boolean; + hide_min_max?: boolean; + keyboard?: boolean; + keyboard_step?: number; max?: number; - maxPostfix?: string; + max_interval?: number; + max_postfix?: string; min?: number; + min_interval?: number; onChange?: (obj: IonRangeSliderEvent) => void; onFinish?: (obj: IonRangeSliderEvent) => void; - onLoad?: (obj: IonRangeSliderEvent) => void; + onStart?: (obj: IonRangeSliderEvent) => void; + onUpdate?: (obj: IonRangeSliderEvent) => void; postfix?: string; prefix?: string; - prettify?: boolean; + prettify?: (num: number) => string; + prettify_enabled?: boolean; + prettify_separator?: string; step?: number; to?: number; + to_fixed?: boolean; + to_max?: number; + to_min?: number; + to_shadowed?: boolean; type?: string; values?: any[]; + values_separator?: string; } interface IonRangeSliderEvent { - fromNumber: number; - fromPers: number; - fromValue?: any; - fromX: number; - fromX_pure?: number; + from: number; + from_precent: number; + from_value: any; input: JQuery; max: number; min: number; slider: JQuery; - toNumber: number; - toPers: number; - toValue?: number; - toX: number; - toX_pure?: number; + to: number; + to_precent: number; + to_value: any; } diff --git a/jquery.simplemodal/jquery.simplemodal-tests.ts b/jquery.simplemodal/jquery.simplemodal-tests.ts new file mode 100644 index 000000000..fc27d11c7 --- /dev/null +++ b/jquery.simplemodal/jquery.simplemodal-tests.ts @@ -0,0 +1,80 @@ +// Tests taken from documentation: http://www.ericmmartin.com/projects/simplemodal/ + +/// +/// + +// Chained call with no options +$("#sample").modal(); + +// Stand-alone call with no options +$.modal($("#sample")); + +// Enable overlay click-to-close +$("#sample").modal({overlayClose:true}); + +// Change overlay color and opacity +$("#sample").modal({ + opacity:80, + overlayCss: {backgroundColor:"#fff"} +}); + +// Disable focus (allows tabbing away from dialog) +$("#sample").modal({focus:false}); + +// Change min height and width +$("#sample").modal({ + minHeight:400, + minWidth: 600 +}); + +// Manually set position +$("#sample").modal({position: [10,10]}); + +// Manually set position using percentages +$("#sample").modal({position: ["50%","50%"]}); + +// Display an external page using an iframe +var src = "http://365.ericmmartin.com/"; +$.modal('