mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge pull request #4 from borisyankov/master
Merge borisyankov/DefinitelyTyped into Asana/DefinitelyTyped
This commit is contained in:
+18
-7
@@ -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)
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
/// <reference path="./amqp-rpc.d.ts" />
|
||||
import amqp_rpc = require('amqp-rpc');
|
||||
var rpc = amqp_rpc.factory();
|
||||
|
||||
interface Name {
|
||||
name?: string;
|
||||
}
|
||||
|
||||
rpc.on<number>('inc', function (param, cb) {
|
||||
var prevVal = param;
|
||||
var nextVal = param + 2;
|
||||
cb(++param, prevVal, nextVal);
|
||||
});
|
||||
|
||||
rpc.on<Name>('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<number>('inc', 5, function (param1, param2, param3) {
|
||||
console.log(param1, param2, param3);
|
||||
});
|
||||
|
||||
rpc.call<Name>('say.Hello', { name: 'John' }, function (msg) {
|
||||
console.log('results of say.Hello:', msg); //output: Hello John!
|
||||
});
|
||||
|
||||
rpc.call<any>('withoutCB', {}, function (msg) {
|
||||
console.log('withoutCB results:', msg); //output: please run function without cb parameter
|
||||
});
|
||||
|
||||
rpc.call<any>('withoutCB', {}); //output message on server side console
|
||||
Vendored
+68
@@ -0,0 +1,68 @@
|
||||
// Type definitions for amqp-rpc v0.0.8
|
||||
// Project: https://github.com/demchenkoe/node-amqp-rpc/
|
||||
// Definitions by: Wonshik Kim <https://github.com/wokim/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
|
||||
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<T>(cmd: string, params: T, cb?: Callback, context?: any, options?: CallOptions): string;
|
||||
on<T>(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;
|
||||
}
|
||||
}
|
||||
Vendored
+1
-1
@@ -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;
|
||||
|
||||
Vendored
+3
-1
@@ -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<TModel>);
|
||||
initialize(options?: ViewOptions<TModel>): void;
|
||||
|
||||
/**
|
||||
* Events hash or a method returning the events hash that maps events/selectors to methods on your View.
|
||||
|
||||
@@ -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
|
||||
}
|
||||
Vendored
+3
@@ -42,6 +42,9 @@ declare module BigJsLibrary {
|
||||
(value: string): BigJS;
|
||||
/** A decimal value. */
|
||||
(value: BigJS): BigJS;
|
||||
|
||||
/** A decimal value. */
|
||||
(): BigJS;
|
||||
}
|
||||
|
||||
/** BigJS instance methods */
|
||||
|
||||
Vendored
+2
-2
@@ -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;
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -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;
|
||||
|
||||
Vendored
+3
-1
@@ -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;
|
||||
|
||||
+92
-51
@@ -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
|
||||
|
||||
Vendored
+62
-70
@@ -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<SomeStatement>, 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>, SomeStatement {
|
||||
interface StatementOrList extends Array<Statement>, 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
|
||||
}
|
||||
|
||||
|
||||
@@ -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++)
|
||||
|
||||
Vendored
+5
-2
@@ -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
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
/// <reference path="../jquery/jquery.d.ts"/>
|
||||
/// <reference path="ion.rangeSlider-1.9.1.d.ts"/>
|
||||
|
||||
var sliderInputElement = $('<input />');
|
||||
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");
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
// Type definitions for for Ion.RangeSlider 1.9.1
|
||||
// Project: https://github.com/IonDen/ion.rangeSlider/
|
||||
// Definitions by: Douglas Eichelberger <https://github.com/dduugg>
|
||||
// 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;
|
||||
}
|
||||
@@ -3,36 +3,63 @@
|
||||
|
||||
var sliderInputElement = $('<input />');
|
||||
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();
|
||||
|
||||
Vendored
+39
-20
@@ -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 <https://github.com/dduugg>
|
||||
// Definitions by: Sixin Li <https://github.com/sixinli>
|
||||
// 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;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
// Tests taken from documentation: http://www.ericmmartin.com/projects/simplemodal/
|
||||
|
||||
/// <reference path="../jquery/jquery.d.ts"/>
|
||||
/// <reference path="jquery.simplemodal.d.ts"/>
|
||||
|
||||
// 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('<iframe src="' + src + '" height="450" width="830" style="border:0">', {
|
||||
closeHTML:"",
|
||||
containerCss:{
|
||||
backgroundColor:"#fff",
|
||||
borderColor:"#fff",
|
||||
height:450,
|
||||
padding:0,
|
||||
width:830
|
||||
},
|
||||
overlayClose:true
|
||||
});
|
||||
|
||||
// Opening animations
|
||||
$("#sample").modal({onOpen: function (dialog) {
|
||||
dialog.overlay.fadeIn('slow', function () {
|
||||
dialog.data.hide();
|
||||
dialog.container.fadeIn('slow', function () {
|
||||
dialog.data.slideDown('slow');
|
||||
});
|
||||
});
|
||||
}});
|
||||
|
||||
// Closing animations
|
||||
$("#sample").modal({onClose: function (dialog) {
|
||||
dialog.data.fadeOut('slow', function () {
|
||||
dialog.container.hide('slow', function () {
|
||||
dialog.overlay.slideUp('slow', function () {
|
||||
$.modal.close();
|
||||
});
|
||||
});
|
||||
});
|
||||
}});
|
||||
|
||||
// Default Values
|
||||
|
||||
// Example – Single Property:
|
||||
$.modal.defaults.closeClass = "modalClose";
|
||||
|
||||
// Example – Multiple Properties:
|
||||
$.extend($.modal.defaults, {
|
||||
closeClass: "modalClose",
|
||||
closeHTML: "<a href='#'>Close</a>"
|
||||
});
|
||||
+123
@@ -0,0 +1,123 @@
|
||||
// Type definitions for SimpleModal 1.4.4
|
||||
// Project: http://www.ericmmartin.com/projects/simplemodal/
|
||||
// Definitions by: Friedrich von Never <https://github.com/ForNeVeR>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../jquery/jquery.d.ts" />
|
||||
|
||||
declare module SimpleModal {
|
||||
interface SimpleModalOptions {
|
||||
/** The jQuery selector to append the elements to. For ASP.NET, use 'form'. Default: 'body'. */
|
||||
appendTo?: string;
|
||||
|
||||
/** Focus in the first visible, enabled element? Default: true. */
|
||||
focus?: boolean;
|
||||
|
||||
/** The opacity value for the overlay div, from 0 - 100. Default: 50. */
|
||||
opacity?: number;
|
||||
|
||||
/** The DOM element id for the overlay div. Default: 'simplemodal-overlay'. */
|
||||
overlayId?: string;
|
||||
|
||||
/** The CSS styling for the overlay div. Default: {}. */
|
||||
overlayCss?: Object;
|
||||
|
||||
/** The DOM element id for the container div. Default: 'simplemodal-container'. */
|
||||
containerId?: string;
|
||||
|
||||
/** The CSS styling for the container div. Default: {}. */
|
||||
containerCss?: Object;
|
||||
|
||||
/** The DOM element id for the data div. Default: 'simplemodal-data'. */
|
||||
dataId?: string;
|
||||
|
||||
/** The CSS styling for the data div. Default: {}. */
|
||||
dataCss?: Object;
|
||||
|
||||
/** The minimum height for the container. Default: null. */
|
||||
minHeight?: number;
|
||||
|
||||
/** The minimum width for the container. Default: null. */
|
||||
minWidth?: number;
|
||||
|
||||
/** The maximum height for the container. If not specified, the window height is used. Default: null. */
|
||||
maxHeight?: number;
|
||||
|
||||
/** The maximum width for the container. If not specified, the window width is used. Default: null. */
|
||||
maxWidth?: number;
|
||||
|
||||
/** Resize the container if it exceeds the browser window dimensions? Default: false. (Changed in 1.4) */
|
||||
autoResize?: boolean;
|
||||
|
||||
/** Automatically position the container upon creation and on window resize? Default: true. (Changed in 1.4) */
|
||||
autoPosition?: boolean;
|
||||
|
||||
/** Starting z-index value. Default: 1000. */
|
||||
zIndex?: number;
|
||||
|
||||
/** If true, closeHTML, escClose and overlayClose will be used if set. If false, none of them will be used. Default: true. */
|
||||
close?: boolean;
|
||||
|
||||
/** The HTML for the default close link. SimpleModal will automatically add the closeClass to this element. Default: ''. */
|
||||
closeHTML?: string;
|
||||
|
||||
/** The CSS class used to bind to the close event. Default: 'simplemodal-close'. */
|
||||
closeClass?: string;
|
||||
|
||||
/** Allow Esc keypress to close the dialog? Default: true. */
|
||||
escClose?: boolean;
|
||||
|
||||
/** Allow click on overlay to close the dialog? Default: false. */
|
||||
overlayClose?: boolean;
|
||||
|
||||
/** Position of container [top, left]. Can be number of pixels or percentage. Default: null. */
|
||||
position?: Array<any>;
|
||||
|
||||
/** Persist the data across modal calls? Only used for existing DOM elements. If true, the data will be maintained across modal calls, if false, the data will be reverted to its original state. Default: true. */
|
||||
persist?: boolean;
|
||||
|
||||
/** User will be unable to interact with the page below the modal or tab away from the dialog. If false, the overlay, iframe, and certain events will be disabled allowing the user to interact with the page below the dialog. Default: true. (Added in 1.3.4. Name changed from transient in 1.3.5) */
|
||||
modal?: boolean;
|
||||
|
||||
/** The callback function used in place of SimpleModal's open. Default: null. */
|
||||
onOpen?: (dialog: SimpleModalDialog) => void;
|
||||
|
||||
/** The callback function used after the modal dialog has opened. Default: null. */
|
||||
onShow?: (dialog: SimpleModalDialog) => void;
|
||||
|
||||
/** The callback function used in place of SimpleModal's close. Default: null. */
|
||||
onClose?: (dialog: SimpleModalDialog) => void;
|
||||
}
|
||||
|
||||
/** Sent to callbacks as a parameter. */
|
||||
interface SimpleModalDialog {
|
||||
overlay: JQuery;
|
||||
container: JQuery;
|
||||
data: any;
|
||||
iframe: JQuery;
|
||||
}
|
||||
|
||||
interface Static {
|
||||
defaults: SimpleModalOptions;
|
||||
(element: JQuery, options?: SimpleModalOptions): JQuery;
|
||||
(html: string, options?: SimpleModalOptions): JQuery;
|
||||
close(): void;
|
||||
}
|
||||
|
||||
interface JQueryExtension {
|
||||
(options?: SimpleModalOptions): JQuery;
|
||||
}
|
||||
}
|
||||
|
||||
interface JQueryStatic {
|
||||
modal: SimpleModal.Static;
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
modal: SimpleModal.JQueryExtension;
|
||||
}
|
||||
|
||||
/** Ambient wrapper so it can be loaded through require. */
|
||||
declare module 'simplemodal' {
|
||||
export = SimpleModal;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
/// <reference path='jwt-simple.d.ts' />
|
||||
|
||||
import jwt = require('jwt-simple');
|
||||
var payload = { foo: 'bar' };
|
||||
var secret:string = 'xxx';
|
||||
|
||||
// encode
|
||||
var token = jwt.encode(payload, secret);
|
||||
|
||||
// decode
|
||||
var decoded = jwt.decode(token, secret);
|
||||
console.log(decoded); //=> { foo: 'bar' }
|
||||
Vendored
+22
@@ -0,0 +1,22 @@
|
||||
// Type definitions for jwt-simple v0.2.0
|
||||
// Project: https://github.com/hokaccha/node-jwt-simple
|
||||
// Definitions by: Ken Fukuyama <https://github.com/kenfdev>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
declare module "jwt-simple" {
|
||||
/**
|
||||
* Decode jwt
|
||||
* @param token
|
||||
* @param key
|
||||
* @param noVerify
|
||||
* @api public
|
||||
*/
|
||||
export function decode(token:any, key:string, noVerify?:boolean):any;
|
||||
/**
|
||||
* Encode jwt
|
||||
* @param payload
|
||||
* @param key
|
||||
* @param algorithm default is HS256
|
||||
* @api public
|
||||
*/
|
||||
export function encode(payload:any, key:string, algorithm?:string):string;
|
||||
}
|
||||
Vendored
+1
-1
@@ -6329,7 +6329,7 @@ declare module _ {
|
||||
/**
|
||||
* Creates a function that returns value..
|
||||
**/
|
||||
constant<T>(value: T): T;
|
||||
constant<T>(value: T): () => T;
|
||||
}
|
||||
|
||||
//_.create
|
||||
|
||||
Vendored
+2
-2
@@ -281,13 +281,13 @@ declare module Marionette {
|
||||
renderModel(): any;
|
||||
}
|
||||
|
||||
class Layout<TModel extends Backbone.Model> extends ItemView<TModel> {
|
||||
class LayoutView<TModel extends Backbone.Model> extends ItemView<TModel> {
|
||||
|
||||
constructor(options?: any);
|
||||
|
||||
addRegion(name: string, definition: any): Region<TModel>;
|
||||
addRegions(regions: any): any;
|
||||
render(): Layout<TModel>;
|
||||
render(): LayoutView<TModel>;
|
||||
removeRegion(name: string);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
/// <reference path="moment-timezone.d.ts" />
|
||||
|
||||
import moment = require('moment-timezone');
|
||||
|
||||
var june = moment("2014-06-01T12:00:00Z");
|
||||
june.tz('America/Los_Angeles').format('ha z');
|
||||
|
||||
var a = moment.tz("2013-11-18 11:55", "America/Toronto");
|
||||
var b = moment.tz("May 12th 2014 8PM", "MMM Do YYYY hA", "America/Toronto");
|
||||
var c = moment.tz(1403454068850, "America/Toronto");
|
||||
|
||||
var arr = [2013, 5, 1],
|
||||
str = "2013-12-01",
|
||||
obj = { year : 2013, month : 5, day : 1 };
|
||||
|
||||
moment.tz(arr, "America/Los_Angeles");
|
||||
moment.tz(str, "America/Los_Angeles");
|
||||
moment.tz(obj, "America/Los_Angeles");
|
||||
|
||||
moment.tz.zone('America/Los_Angeles').abbr(1403465838805);
|
||||
moment.tz.zone('America/Los_Angeles').offset(1403465838805);
|
||||
|
||||
var zone = moment.tz.zone('America/New_York');
|
||||
zone.parse(Date.UTC(2012, 2, 19, 8, 30)); // 240
|
||||
|
||||
moment.tz.add('America/Los_Angeles|PST PDT|80 70|0101|1Lzm0 1zb0 Op0');
|
||||
moment.tz.add([
|
||||
'America/Los_Angeles|PST PDT|80 70|0101|1Lzm0 1zb0 Op0',
|
||||
'America/New_York|EST EDT|50 40|0101|1Lz50 1zb0 Op0'
|
||||
]);
|
||||
|
||||
moment.tz.link('America/Los_Angeles|US/Pacific');
|
||||
moment.tz.link([
|
||||
'America/Los_Angeles|US/Pacific',
|
||||
'America/New_York|US/Eastern'
|
||||
]);
|
||||
|
||||
moment.tz.load({
|
||||
zones : [],
|
||||
links : [],
|
||||
version : '2014e'
|
||||
});
|
||||
|
||||
moment.tz.names();
|
||||
Vendored
+56
@@ -0,0 +1,56 @@
|
||||
// Type definitions for moment-timezone.js 0.2.5
|
||||
// Project: http://momentjs.com/timezone/
|
||||
// Definitions by: Michel Salib <https://github.com/michelsalib>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../moment/moment.d.ts" />
|
||||
|
||||
interface Moment {
|
||||
tz(timezone: string): Moment;
|
||||
}
|
||||
|
||||
interface MomentZone {
|
||||
name: string;
|
||||
abbrs: string[];
|
||||
untils: number[];
|
||||
offsets: number[];
|
||||
|
||||
abbr(timestamp: number): string;
|
||||
offset(timestamp: number): number;
|
||||
parse(timestamp: number): number
|
||||
}
|
||||
|
||||
interface MomentTimezone {
|
||||
(date: number, timezone: string): Moment;
|
||||
(date: number[], timezone: string): Moment;
|
||||
(date: string, format: string, timezone: string): Moment;
|
||||
(date: Date, timezone: string): Moment;
|
||||
(date: Moment, timezone: string): Moment;
|
||||
(date: Object, timezone: string): Moment;
|
||||
|
||||
zone(timezone: string): MomentZone;
|
||||
|
||||
add(packedZoneString: string): void;
|
||||
add(packedZoneString: string[]): void;
|
||||
|
||||
link(packedLinkString: string): void;
|
||||
link(packedLinkString: string[]): void;
|
||||
|
||||
load(data: {
|
||||
version: string;
|
||||
links: string[];
|
||||
zones: string[];
|
||||
}): void;
|
||||
|
||||
names(): string[];
|
||||
}
|
||||
|
||||
interface MomentStatic {
|
||||
tz: MomentTimezone;
|
||||
}
|
||||
|
||||
declare module 'moment-timezone' {
|
||||
var _tmp: MomentStatic;
|
||||
|
||||
export = _tmp;
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
/// <reference path="./mozilla-spidermonkey-parser-api.d.ts" />
|
||||
|
||||
import Syntax = spiderMonkeyParserAPI.Syntax;
|
||||
|
||||
var literal:Syntax.Literal = {
|
||||
loc: {
|
||||
source: null,
|
||||
start: {
|
||||
line: 1,
|
||||
column: 10
|
||||
},
|
||||
end: {
|
||||
line: 1,
|
||||
column: 12
|
||||
}
|
||||
},
|
||||
type: "Literal",
|
||||
value: 42
|
||||
};
|
||||
|
||||
// generated by http://esprima.org/demo/parse.html?code=%22use%20strict%22%3B%0A%0Afunction%20Test%20()%20%7B%0A%7D%0A%0ATest.prototype.hello%20%3D%20function(word)%20%7B%0A%09word%20%3D%20word%20%7C%7C%20%22TypeScript%22%3B%0A%09return%20word%3B%0A%7D%3B%0A
|
||||
var program:Syntax.Program = {
|
||||
"type": "Program",
|
||||
"body": [
|
||||
<Syntax.Expression>{
|
||||
"type": "ExpressionStatement",
|
||||
"expression": <Syntax.Literal>{
|
||||
"type": "Literal",
|
||||
"value": "use strict",
|
||||
"raw": "\"use strict\""
|
||||
}
|
||||
},
|
||||
<Syntax.FunctionDeclaration>{
|
||||
"type": "FunctionDeclaration",
|
||||
"id": <Syntax.Identifier>{
|
||||
"type": "Identifier",
|
||||
"name": "Test"
|
||||
},
|
||||
"params": [],
|
||||
"defaults": [],
|
||||
"body": <Syntax.BlockStatement>{
|
||||
"type": "BlockStatement",
|
||||
"body": []
|
||||
},
|
||||
"rest": null,
|
||||
"generator": false,
|
||||
"expression": false
|
||||
},
|
||||
<Syntax.Expression>{
|
||||
"type": "ExpressionStatement",
|
||||
"expression": <Syntax.AssignmentExpression>{
|
||||
"type": "AssignmentExpression",
|
||||
"operator": "=",
|
||||
"left": <Syntax.MemberExpression>{
|
||||
"type": "MemberExpression",
|
||||
"computed": false,
|
||||
"object": <Syntax.MemberExpression>{
|
||||
"type": "MemberExpression",
|
||||
"computed": false,
|
||||
"object": <Syntax.Identifier>{
|
||||
"type": "Identifier",
|
||||
"name": "Test"
|
||||
},
|
||||
"property": <Syntax.Identifier>{
|
||||
"type": "Identifier",
|
||||
"name": "prototype"
|
||||
}
|
||||
},
|
||||
"property": <Syntax.Identifier>{
|
||||
"type": "Identifier",
|
||||
"name": "hello"
|
||||
}
|
||||
},
|
||||
"right": <Syntax.FunctionExpression>{
|
||||
"type": "FunctionExpression",
|
||||
"id": null,
|
||||
"params": [
|
||||
<Syntax.Identifier>{
|
||||
"type": "Identifier",
|
||||
"name": "word"
|
||||
}
|
||||
],
|
||||
"defaults": [],
|
||||
"body": <Syntax.BlockStatement>{
|
||||
"type": "BlockStatement",
|
||||
"body": [
|
||||
<Syntax.Expression>{
|
||||
"type": "ExpressionStatement",
|
||||
"expression": <Syntax.AssignmentExpression>{
|
||||
"type": "AssignmentExpression",
|
||||
"operator": "=",
|
||||
"left": <Syntax.Identifier>{
|
||||
"type": "Identifier",
|
||||
"name": "word"
|
||||
},
|
||||
"right": <Syntax.LogicalExpression>{
|
||||
"type": "LogicalExpression",
|
||||
"operator": "||",
|
||||
"left": <Syntax.Identifier>{
|
||||
"type": "Identifier",
|
||||
"name": "word"
|
||||
},
|
||||
"right": <Syntax.Literal>{
|
||||
"type": "Literal",
|
||||
"value": "TypeScript",
|
||||
"raw": "\"TypeScript\""
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
<Syntax.ReturnStatement>{
|
||||
"type": "ReturnStatement",
|
||||
"argument": {
|
||||
"type": "Identifier",
|
||||
"name": "word"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"rest": null,
|
||||
"generator": false,
|
||||
"expression": false
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
@@ -0,0 +1,615 @@
|
||||
// Type definitions for Mozilla SpiderMonkey Parser API 1.8.5
|
||||
// Project: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Parser_API
|
||||
// Definitions by: vvakame <https://github.com/vvakame/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module spiderMonkeyParserAPI {
|
||||
|
||||
// NOTE if property can hold null, that property to be optional.
|
||||
|
||||
module Syntax {
|
||||
/**
|
||||
* By default, Reflect.parse() produces Node objects, which are plain JavaScript objects (i.e., their prototype derives from the standard Object prototype).
|
||||
* All node types implement the following interface:
|
||||
*/
|
||||
interface Node {
|
||||
/**
|
||||
* The type field is a string representing the AST variant type.
|
||||
* Each subtype of Node is documented below with the specific string of its type field.
|
||||
* You can use this field to determine which interface a node implements.
|
||||
*/
|
||||
type: string;
|
||||
/**
|
||||
* The loc field represents the source location information of the node.
|
||||
* If the parser produced no information about the node's source location, the field is null; otherwise it is an object consisting of a start position (the position of the first character of the parsed source region) and an end position (the position of the first character after the parsed source region):
|
||||
*/
|
||||
loc?: SourceLocation;
|
||||
}
|
||||
|
||||
interface SourceLocation {
|
||||
source?: string;
|
||||
start: Position;
|
||||
end: Position;
|
||||
}
|
||||
|
||||
/**
|
||||
* Each Position object consists of a line number (1-indexed) and a column number (0-indexed):
|
||||
*/
|
||||
interface Position {
|
||||
line: number; // uint32 >= 1;
|
||||
column: number; // uint32 >= 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* A complete program source tree.
|
||||
*/
|
||||
interface Program extends Node {
|
||||
type: string; // "Program"
|
||||
body: Statement[];
|
||||
}
|
||||
|
||||
/**
|
||||
* A function declaration or expression.
|
||||
* The body of the function may be a block statement, or in the case of an expression closure, an expression.
|
||||
* If the generator flag is true, the function is a generator function, i.e., contains a yield expression in its body (other than in a nested function).
|
||||
* If the expression flag is true, the function is an expression closure and the body field is an expression.
|
||||
*/
|
||||
interface Function extends Node {
|
||||
id?: Identifier;
|
||||
params: Pattern[];
|
||||
defaults: Expression[];
|
||||
rest?: Identifier;
|
||||
body?: any; // BlockStatement | Expression;
|
||||
generator: boolean;
|
||||
expression: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Any statement.
|
||||
*/
|
||||
interface Statement extends Node {
|
||||
}
|
||||
|
||||
/**
|
||||
* An empty statement, i.e., a solitary semicolon.
|
||||
*/
|
||||
interface EmptyStatement extends Statement {
|
||||
type: string; //"EmptyStatement";
|
||||
}
|
||||
|
||||
/**
|
||||
* A block statement, i.e., a sequence of statements surrounded by braces.
|
||||
*/
|
||||
interface BlockStatement extends Statement {
|
||||
type: string; // "BlockStatement";
|
||||
body: Statement[];
|
||||
}
|
||||
|
||||
/**
|
||||
* An if statement.
|
||||
*/
|
||||
interface IfStatement extends Statement {
|
||||
type: string; // "IfStatement";
|
||||
test: Expression;
|
||||
consequent: Statement;
|
||||
alternate?: Statement;
|
||||
}
|
||||
|
||||
/**
|
||||
* A labeled statement, i.e., a statement prefixed by a break/continue label.
|
||||
*/
|
||||
interface LabeledStatement extends Statement {
|
||||
type: string; // "LabeledStatement";
|
||||
label: Identifier;
|
||||
body: Statement;
|
||||
}
|
||||
|
||||
/**
|
||||
* A break statement.
|
||||
*/
|
||||
interface BreakStatement extends Statement {
|
||||
type: string; // "BreakStatement";
|
||||
label?: Identifier;
|
||||
}
|
||||
|
||||
/**
|
||||
* A continue statement.
|
||||
*/
|
||||
interface ContinueStatement extends Statement {
|
||||
type: string; // "ContinueStatement";
|
||||
label?: Identifier;
|
||||
}
|
||||
|
||||
/**
|
||||
* A with statement.
|
||||
*/
|
||||
interface WithStatement extends Statement {
|
||||
type: string; // "WithStatement";
|
||||
object: Expression;
|
||||
body: Statement;
|
||||
}
|
||||
|
||||
/**
|
||||
* A switch statement.
|
||||
* The lexical flag is metadata indicating whether the switch statement contains any unnested let declarations (and therefore introduces a new lexical scope).
|
||||
*/
|
||||
interface SwitchStatement extends Statement {
|
||||
type: string; // "SwitchStatement";
|
||||
discriminant: Expression;
|
||||
cases: SwitchCase[];
|
||||
lexical: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* A return statement.
|
||||
*/
|
||||
interface ReturnStatement extends Statement {
|
||||
type: string; // "ReturnStatement";
|
||||
argument?: Expression;
|
||||
}
|
||||
|
||||
/**
|
||||
* A throw statement.
|
||||
*/
|
||||
interface ThrowStatement extends Statement {
|
||||
type: string; // "ThrowStatement";
|
||||
argument: Expression;
|
||||
}
|
||||
|
||||
/**
|
||||
* A try statement.
|
||||
*/
|
||||
interface TryStatement extends Statement {
|
||||
type: string; //"TryStatement";
|
||||
block: BlockStatement;
|
||||
handler?: CatchClause;
|
||||
guardedHandlers: CatchClause[];
|
||||
finalizer?: BlockStatement;
|
||||
}
|
||||
|
||||
/**
|
||||
* A while statement.
|
||||
*/
|
||||
interface WhileStatement extends Statement {
|
||||
type: string; // "WhileStatement";
|
||||
test: Expression;
|
||||
body: Statement;
|
||||
}
|
||||
|
||||
/**
|
||||
* A do/while statement.
|
||||
*/
|
||||
interface DoWhileStatement extends Statement {
|
||||
type: string; // "DoWhileStatement";
|
||||
body: Statement;
|
||||
test: Expression;
|
||||
}
|
||||
|
||||
/**
|
||||
* A for statement.
|
||||
*/
|
||||
interface ForStatement extends Statement {
|
||||
type: string; // "ForStatement";
|
||||
init?: any; // VariableDeclaration | Expression;
|
||||
test?: Expression;
|
||||
update?: Expression;
|
||||
body: Statement;
|
||||
}
|
||||
|
||||
/**
|
||||
* A for/in statement, or, if each is true, a for each/in statement.
|
||||
*/
|
||||
interface ForInStatement extends Statement {
|
||||
type: string; // "ForInStatement";
|
||||
left: any; // VariableDeclaration | Expression;
|
||||
right: Expression;
|
||||
body: Statement;
|
||||
each: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* A for/of statement.
|
||||
*/
|
||||
interface ForOfStatement extends Statement {
|
||||
type: string; // "ForOfStatement";
|
||||
left: any; // VariableDeclaration | Expression;
|
||||
right: Expression;
|
||||
body: Statement;
|
||||
}
|
||||
|
||||
/**
|
||||
* A let statement.
|
||||
*/
|
||||
interface LetStatement extends Statement {
|
||||
type: string; // "LetStatement";
|
||||
head: VariableDeclarator[];
|
||||
body: Statement;
|
||||
}
|
||||
|
||||
/**
|
||||
* A debugger statement.
|
||||
*/
|
||||
interface DebuggerStatement extends Statement {
|
||||
type: string; // "DebuggerStatement";
|
||||
}
|
||||
|
||||
/**
|
||||
* Any declaration node. Note that declarations are considered statements; this is because declarations can appear in any statement context in the language recognized by the SpiderMonkey parser.
|
||||
*/
|
||||
interface Declaration extends Statement {
|
||||
}
|
||||
|
||||
/**
|
||||
* A function declaration.
|
||||
*/
|
||||
interface FunctionDeclaration extends Function, Declaration {
|
||||
type: string; // "FunctionDeclaration";
|
||||
id: Identifier; // Note: The id field cannot be null.
|
||||
params: Pattern[];
|
||||
defaults: Expression[];
|
||||
rest?: Identifier;
|
||||
body: any; // BlockStatement | Expression;
|
||||
generator: boolean;
|
||||
expression: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* A variable declaration, via one of var, let, or const.
|
||||
*/
|
||||
interface VariableDeclaration extends Declaration {
|
||||
type: string; // "VariableDeclaration";
|
||||
declarations: VariableDeclarator[];
|
||||
kind: string; // "var" | "let" | "const";
|
||||
}
|
||||
|
||||
/**
|
||||
* A variable declarator.
|
||||
*/
|
||||
interface VariableDeclarator extends Node {
|
||||
type: string; // "VariableDeclarator";
|
||||
id: Pattern; // Note: The id field cannot be null.
|
||||
init?: Expression;
|
||||
}
|
||||
|
||||
/**
|
||||
* Any expression node.
|
||||
* Since the left-hand side of an assignment may be any expression in general, an expression can also be a pattern.
|
||||
*/
|
||||
interface Expression extends Node, Pattern {
|
||||
}
|
||||
|
||||
/**
|
||||
* A this expression.
|
||||
*/
|
||||
interface ThisExpression extends Expression {
|
||||
type: string; // "ThisExpression";
|
||||
}
|
||||
|
||||
/**
|
||||
* An array expression.
|
||||
*/
|
||||
interface ArrayExpression extends Expression {
|
||||
type: string; // "ArrayExpression";
|
||||
elements: Expression[]; // [ Expression | null ];
|
||||
}
|
||||
|
||||
/**
|
||||
* An object expression.
|
||||
*/
|
||||
interface ObjectExpression extends Expression {
|
||||
type: string; // "ObjectExpression";
|
||||
properties: Property[];
|
||||
}
|
||||
|
||||
/**
|
||||
* A literal property in an object expression can have either a string or number as its value.
|
||||
* Ordinary property initializers have a kind value "init"; getters and setters have the kind values "get" and "set", respectively.
|
||||
*/
|
||||
interface Property extends Node {
|
||||
type: string; // "Property";
|
||||
key: any; // Literal | Identifier;
|
||||
value: Expression;
|
||||
kind: string; // "init" | "get" | "set";
|
||||
}
|
||||
|
||||
/**
|
||||
* A function expression.
|
||||
*/
|
||||
interface FunctionExpression extends Function, Expression {
|
||||
type: string; // "FunctionExpression";
|
||||
id?: Identifier;
|
||||
params: Pattern[];
|
||||
defaults: Expression[];
|
||||
rest?: Identifier;
|
||||
body: any; // BlockStatement | Expression;
|
||||
generator: boolean;
|
||||
expression: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* A fat arrow function expression, i.e., `let foo = (bar) => { ... body ... }`.
|
||||
*/
|
||||
interface ArrowExpression extends Function, Expression {
|
||||
type: string; // "ArrowExpression";
|
||||
params: Pattern[];
|
||||
defaults: Expression[];
|
||||
rest?: Identifier;
|
||||
body: any; // BlockStatement | Expression;
|
||||
generator: boolean;
|
||||
expression: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* A sequence expression, i.e., a comma-separated sequence of expressions.
|
||||
*/
|
||||
interface SequenceExpression extends Expression {
|
||||
type: string; // "SequenceExpression";
|
||||
expressions: Expression[];
|
||||
}
|
||||
|
||||
/**
|
||||
* A unary operator expression.
|
||||
*/
|
||||
interface UnaryExpression extends Expression {
|
||||
type: string; // "UnaryExpression";
|
||||
operator: UnaryOperator;
|
||||
prefix: boolean;
|
||||
argument: Expression;
|
||||
}
|
||||
|
||||
/**
|
||||
* A binary operator expression.
|
||||
*/
|
||||
interface BinaryExpression extends Expression {
|
||||
type: string; // "BinaryExpression";
|
||||
operator: BinaryOperator;
|
||||
left: Expression;
|
||||
right: Expression;
|
||||
}
|
||||
|
||||
/**
|
||||
* An assignment operator expression.
|
||||
*/
|
||||
interface AssignmentExpression extends Expression {
|
||||
type: string; // "AssignmentExpression";
|
||||
operator: AssignmentOperator;
|
||||
left: Expression;
|
||||
right: Expression;
|
||||
}
|
||||
|
||||
/**
|
||||
* An update (increment or decrement) operator expression.
|
||||
*/
|
||||
interface UpdateExpression extends Expression {
|
||||
type: string; // "UpdateExpression";
|
||||
operator: UpdateOperator;
|
||||
argument: Expression;
|
||||
prefix: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* A logical operator expression.
|
||||
*/
|
||||
interface LogicalExpression extends Expression {
|
||||
type: string; // "LogicalExpression";
|
||||
operator: LogicalOperator;
|
||||
left: Expression;
|
||||
right: Expression;
|
||||
}
|
||||
|
||||
/**
|
||||
* A conditional expression, i.e., a ternary ?/: expression.
|
||||
*/
|
||||
interface ConditionalExpression extends Expression {
|
||||
type: string; // "ConditionalExpression";
|
||||
test: Expression;
|
||||
alternate: Expression;
|
||||
consequent: Expression;
|
||||
}
|
||||
|
||||
/**
|
||||
* A new expression.
|
||||
*/
|
||||
interface NewExpression extends Expression {
|
||||
type: string; // "NewExpression";
|
||||
callee: Expression;
|
||||
arguments: Expression[];
|
||||
}
|
||||
|
||||
/**
|
||||
* A function or method call expression.
|
||||
*/
|
||||
interface CallExpression extends Expression {
|
||||
type: string; // "CallExpression";
|
||||
callee: Expression;
|
||||
arguments: Expression[];
|
||||
}
|
||||
|
||||
/**
|
||||
* A member expression.
|
||||
* If computed === true, the node corresponds to a computed e1[e2] expression and property is an Expression.
|
||||
* If computed === false, the node corresponds to a static e1.x expression and property is an Identifier.
|
||||
*/
|
||||
interface MemberExpression extends Expression {
|
||||
type: string; // "MemberExpression";
|
||||
object: Expression;
|
||||
property: any; // Identifier | Expression;
|
||||
computed: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* A yield expression.
|
||||
*/
|
||||
interface YieldExpression extends Expression {
|
||||
type: string; // "YieldExpression";
|
||||
argument?: Expression;
|
||||
}
|
||||
|
||||
/**
|
||||
* An array comprehension.
|
||||
* The blocks array corresponds to the sequence of for and for each blocks.
|
||||
* The optional filter expression corresponds to the final if clause, if present.
|
||||
*/
|
||||
interface ComprehensionExpression extends Expression {
|
||||
type: string; // "ComprehensionExpression";
|
||||
body: Expression;
|
||||
blocks: ComprehensionBlock[];
|
||||
filter?: Expression;
|
||||
}
|
||||
|
||||
/**
|
||||
* A generator expression.
|
||||
* As with array comprehensions, the blocks array corresponds to the sequence of for and for each blocks, and the optional filter expression corresponds to the final if clause, if present.
|
||||
*/
|
||||
interface GeneratorExpression extends Expression {
|
||||
type: string; // "GeneratorExpression";
|
||||
body: Expression;
|
||||
blocks: ComprehensionBlock[];
|
||||
filter?: Expression;
|
||||
}
|
||||
|
||||
/**
|
||||
* A graph expression, aka "sharp literal," such as #1={ self: #1# }.
|
||||
*/
|
||||
interface GraphExpression extends Expression {
|
||||
type: string; // "GraphExpression";
|
||||
index: number; // uint32;
|
||||
expression: Literal;
|
||||
}
|
||||
|
||||
/**
|
||||
* A graph index expression, aka "sharp variable," such as #1#.
|
||||
*/
|
||||
interface GraphIndexExpression extends Expression {
|
||||
type: string; // "GraphIndexExpression";
|
||||
index: number; // uint32;
|
||||
}
|
||||
|
||||
/**
|
||||
* A let expression.
|
||||
*/
|
||||
interface LetExpression extends Expression {
|
||||
type: string; // "LetExpression";
|
||||
head: VariableDeclarator[];
|
||||
body: Expression;
|
||||
}
|
||||
|
||||
/**
|
||||
* JavaScript 1.7 introduced destructuring assignment and binding forms.
|
||||
* All binding forms (such as function parameters, variable declarations, and catch block headers) accept array and object destructuring patterns in addition to plain identifiers.
|
||||
* The left-hand sides of assignment expressions can be arbitrary expressions, but in the case where the expression is an object or array literal, it is interpreted by SpiderMonkey as a destructuring pattern.
|
||||
*
|
||||
* Since the left-hand side of an assignment can in general be any expression, in an assignment context, a pattern can be any expression.
|
||||
* In binding positions (such as function parameters, variable declarations, and catch headers), patterns can only be identifiers in the base case, not arbitrary expressions.
|
||||
*/
|
||||
interface Pattern extends Node {
|
||||
}
|
||||
|
||||
/**
|
||||
* An object-destructuring pattern. A literal property in an object pattern can have either a string or number as its value.
|
||||
*/
|
||||
interface ObjectPattern extends Pattern {
|
||||
type: string; // "ObjectPattern";
|
||||
properties: {key: any /* Literal | Identifier */; value: Pattern;}[]; // [ { key: Literal | Identifier, value: Pattern } ];
|
||||
}
|
||||
|
||||
/**
|
||||
* An array-destructuring pattern.
|
||||
*/
|
||||
interface ArrayPattern extends Pattern {
|
||||
type: string; // "ArrayPattern";
|
||||
elements: Pattern[]; // [ Pattern | null ];
|
||||
}
|
||||
|
||||
/**
|
||||
* A case (if test is an Expression) or default (if test === null) clause in the body of a switch statement.
|
||||
*/
|
||||
interface SwitchCase extends Node {
|
||||
type: string; // "SwitchCase";
|
||||
test?: Expression;
|
||||
consequent: Statement[];
|
||||
}
|
||||
|
||||
/**
|
||||
* A catch clause following a try block.
|
||||
* The optional guard property corresponds to the optional expression guard on the bound variable.
|
||||
*/
|
||||
interface CatchClause extends Node {
|
||||
type: string; // "CatchClause";
|
||||
param: Pattern;
|
||||
guard?: Expression;
|
||||
body: BlockStatement;
|
||||
}
|
||||
|
||||
/**
|
||||
* A for or for each block in an array comprehension or generator expression.
|
||||
*/
|
||||
interface ComprehensionBlock extends Node {
|
||||
type: string; // "ComprehensionBlock";
|
||||
left: Pattern;
|
||||
right: Expression;
|
||||
each: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* An identifier.
|
||||
* Note that an identifier may be an expression or a destructuring pattern.
|
||||
*/
|
||||
interface Identifier extends Node, Expression, Pattern {
|
||||
type: string; // "Identifier";
|
||||
name: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* A literal token. Note that a literal can be an expression.
|
||||
*/
|
||||
interface Literal extends Node, Expression {
|
||||
type: string; // "Literal";
|
||||
// TODO union types
|
||||
value: any; // string | boolean | null | number | RegExp;
|
||||
}
|
||||
|
||||
/**
|
||||
* A unary operator token.
|
||||
*/
|
||||
interface UnaryOperator extends String {
|
||||
// "-" | "+" | "!" | "~" | "typeof" | "void" | "delete"
|
||||
}
|
||||
|
||||
/**
|
||||
* A binary operator token.
|
||||
*/
|
||||
interface BinaryOperator extends String {
|
||||
// "==" | "!=" | "===" | "!=="
|
||||
// | "<" | "<=" | ">" | ">="
|
||||
// | "<<" | ">>" | ">>>"
|
||||
// | "+" | "-" | "*" | "/" | "%"
|
||||
// | "|" | "^" | "&" | "in"
|
||||
// | "instanceof" | ".."
|
||||
// Note: The .. operator is E4X-specific.
|
||||
}
|
||||
|
||||
/**
|
||||
* A logical operator token.
|
||||
*/
|
||||
interface LogicalOperator extends String {
|
||||
// "||" | "&&"
|
||||
}
|
||||
|
||||
/**
|
||||
* An assignment operator token.
|
||||
*/
|
||||
interface AssignmentOperator extends String {
|
||||
// "=" | "+=" | "-=" | "*=" | "/=" | "%="
|
||||
// | "<<=" | ">>=" | ">>>="
|
||||
// | "|=" | "^=" | "&="
|
||||
}
|
||||
|
||||
/**
|
||||
* An update (increment or decrement) operator token.
|
||||
*/
|
||||
interface UpdateOperator extends String {
|
||||
// "++" | "--"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
/// <reference path="mysql.d.ts" />
|
||||
|
||||
import fs = require('fs');
|
||||
import mysql = require('mysql');
|
||||
import stream = require('stream');
|
||||
|
||||
/// Connections
|
||||
var connection = mysql.createConnection({
|
||||
@@ -119,6 +121,8 @@ connection.config.queryFormat = function (query, values) {
|
||||
|
||||
connection.query("UPDATE posts SET title = :title", { title: "Hello MySQL" });
|
||||
|
||||
var s: stream.Readable = connection.query("UPDATE posts SET title = :title", { title: "Hello MySQL" }).stream({ highWaterMark: 5 });
|
||||
|
||||
connection.query('INSERT INTO posts SET ?', { title: 'test' }, function (err, result) {
|
||||
if (err) throw err;
|
||||
|
||||
@@ -243,9 +247,10 @@ query
|
||||
// all rows have been received
|
||||
});
|
||||
|
||||
var writable = fs.createWriteStream('file.txt');
|
||||
connection.query('SELECT * FROM posts')
|
||||
.stream({ highWaterMark: 5 })
|
||||
.pipe(() => { });
|
||||
.pipe(writable);
|
||||
|
||||
connection = mysql.createConnection({ multipleStatements: true });
|
||||
|
||||
|
||||
Vendored
+34
-31
@@ -3,29 +3,37 @@
|
||||
// Definitions by: William Johnston <https://github.com/wjohnsto>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module mysql {
|
||||
export interface IMySql {
|
||||
createConnection(connectionUri: string): IConnection;
|
||||
createConnection(config: IConnectionConfig): IConnection;
|
||||
///<reference path='../node/node.d.ts' />
|
||||
|
||||
createPool(config: IPoolConfig): IPool;
|
||||
declare module "mysql" {
|
||||
import stream = require("stream");
|
||||
|
||||
createPoolCluster(config?: IPoolClusterConfig): IPoolCluster;
|
||||
function createConnection(connectionUri: string): IConnection;
|
||||
function createConnection(config: IConnectionConfig): IConnection;
|
||||
function createPool(config: IPoolConfig): IPool;
|
||||
function createPoolCluster(config?: IPoolClusterConfig): IPoolCluster;
|
||||
function escape(value: any): string;
|
||||
function format(sql: string): string;
|
||||
function format(sql: string, values: Array<any>): string;
|
||||
|
||||
escape(value: any): string;
|
||||
interface IMySql {
|
||||
createConnection(connectionUri: string): IConnection;
|
||||
createConnection(config: IConnectionConfig): IConnection;
|
||||
createPool(config: IPoolConfig): IPool;
|
||||
createPoolCluster(config?: IPoolClusterConfig): IPoolCluster;
|
||||
escape(value: any): string;
|
||||
format(sql: string): string;
|
||||
format(sql: string, values: Array<any>): string;
|
||||
}
|
||||
|
||||
format(sql: string): string;
|
||||
format(sql: string, values: Array<any>): string;
|
||||
}
|
||||
|
||||
export interface IConnectionStatic {
|
||||
interface IConnectionStatic {
|
||||
createQuery(sql: string): IQuery;
|
||||
createQuery(sql: string, callback: (err: IError, ...args: any[]) => void): IQuery;
|
||||
createQuery(sql: string, values: Array<any>): IQuery;
|
||||
createQuery(sql: string, values: Array<any>, callback: (err: IError, ...args: any[]) => void): IQuery;
|
||||
}
|
||||
|
||||
export interface IConnection {
|
||||
interface IConnection {
|
||||
config: IConnectionConfig;
|
||||
|
||||
threadId: number;
|
||||
@@ -68,7 +76,7 @@ declare module mysql {
|
||||
rollback(callback: () => void): void;
|
||||
}
|
||||
|
||||
export interface IPool {
|
||||
interface IPool {
|
||||
config: IPoolConfig;
|
||||
|
||||
getConnection(callback: (err: IError, connection: IConnection) => void): void;
|
||||
@@ -80,7 +88,7 @@ declare module mysql {
|
||||
on(ev: 'error', callback: (err: IError) => void): IPool;
|
||||
}
|
||||
|
||||
export interface IPoolCluster {
|
||||
interface IPoolCluster {
|
||||
config: IPoolClusterConfig;
|
||||
|
||||
add(config: IPoolConfig): void;
|
||||
@@ -101,7 +109,7 @@ declare module mysql {
|
||||
on(ev: 'error', callback: (err: IError) => void): IPoolCluster;
|
||||
}
|
||||
|
||||
export interface IQuery {
|
||||
interface IQuery {
|
||||
/**
|
||||
* The SQL for a constructed query
|
||||
*/
|
||||
@@ -125,7 +133,7 @@ declare module mysql {
|
||||
*
|
||||
* @param options The options for the stream.
|
||||
*/
|
||||
stream(options: IStreamOptions): IQuery;
|
||||
stream(options: IStreamOptions): stream.Readable;
|
||||
|
||||
/**
|
||||
* Pipes a stream downstream, providing automatic pause/resume based on the
|
||||
@@ -142,7 +150,7 @@ declare module mysql {
|
||||
on(ev: 'end', callback: () => void): IQuery;
|
||||
}
|
||||
|
||||
export interface IQueryFunction {
|
||||
interface IQueryFunction {
|
||||
(sql: string): IQuery;
|
||||
(sql: string, callback: (err: IError, ...args: any[]) => void): IQuery;
|
||||
(sql: string, values: Array<any>): IQuery;
|
||||
@@ -157,7 +165,7 @@ declare module mysql {
|
||||
(options: IQueryOptions, values: any, callback: (err: IError, ...args: any[]) => void): IQuery;
|
||||
}
|
||||
|
||||
export interface IQueryOptions {
|
||||
interface IQueryOptions {
|
||||
/**
|
||||
* The SQL for the query
|
||||
*/
|
||||
@@ -200,7 +208,7 @@ declare module mysql {
|
||||
typeCast?: any;
|
||||
}
|
||||
|
||||
export interface IStreamOptions {
|
||||
interface IStreamOptions {
|
||||
/**
|
||||
* Sets the max buffer size in objects of a stream
|
||||
*/
|
||||
@@ -212,7 +220,7 @@ declare module mysql {
|
||||
objectMode?: any;
|
||||
}
|
||||
|
||||
export interface IConnectionOptions {
|
||||
interface IConnectionOptions {
|
||||
/**
|
||||
* The MySQL user to authenticate as
|
||||
*/
|
||||
@@ -236,7 +244,7 @@ declare module mysql {
|
||||
charset?: string;
|
||||
}
|
||||
|
||||
export interface IConnectionConfig extends IConnectionOptions {
|
||||
interface IConnectionConfig extends IConnectionOptions {
|
||||
/**
|
||||
* The hostname of the database you are connecting to. (Default: localhost)
|
||||
*/
|
||||
@@ -356,7 +364,7 @@ declare module mysql {
|
||||
ssl?: any;
|
||||
}
|
||||
|
||||
export interface IPoolConfig extends IConnectionConfig {
|
||||
interface IPoolConfig extends IConnectionConfig {
|
||||
/**
|
||||
* The milliseconds before a timeout occurs during the connection acquisition. This is slightly different from connectTimeout,
|
||||
* because acquiring a pool connection does not always involve making a connection. (Default: 10 seconds)
|
||||
@@ -382,7 +390,7 @@ declare module mysql {
|
||||
queueLimit?: number;
|
||||
}
|
||||
|
||||
export interface IPoolClusterConfig {
|
||||
interface IPoolClusterConfig {
|
||||
/**
|
||||
* If true, PoolCluster will attempt to reconnect when connection fails. (Default: true)
|
||||
*/
|
||||
@@ -403,7 +411,7 @@ declare module mysql {
|
||||
defaultSelector?: string;
|
||||
}
|
||||
|
||||
export interface ISslCredentials {
|
||||
interface ISslCredentials {
|
||||
/**
|
||||
* A string or buffer holding the PFX or PKCS12 encoded private key, certificate and CA certificates
|
||||
*/
|
||||
@@ -440,7 +448,7 @@ declare module mysql {
|
||||
ciphers?: string;
|
||||
}
|
||||
|
||||
export interface IError extends Error {
|
||||
interface IError extends Error {
|
||||
/**
|
||||
* Either a MySQL server error (e.g. 'ER_ACCESS_DENIED_ERROR'),
|
||||
* a node.js error (e.g. 'ECONNREFUSED') or an internal error
|
||||
@@ -480,8 +488,3 @@ declare module mysql {
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'mysql' {
|
||||
var mysql: mysql.IMySql;
|
||||
|
||||
export = mysql;
|
||||
}
|
||||
|
||||
@@ -18,6 +18,9 @@ function test3() {
|
||||
var sock = zmq.socket('push');
|
||||
sock.bindSync('tcp://127.0.0.1:3000');
|
||||
sock.send(['hello', 'world']);
|
||||
sock.on('message', function (buffer: Buffer) {
|
||||
//
|
||||
});
|
||||
}
|
||||
|
||||
function test4() {
|
||||
@@ -32,4 +35,6 @@ function test5() {
|
||||
sock.bind('tcp://127.0.0.1', err => {
|
||||
sock.send("some work");
|
||||
});
|
||||
}
|
||||
sock.monitor();
|
||||
sock.monitor(10);
|
||||
}
|
||||
|
||||
Vendored
+18
-2
@@ -3,6 +3,8 @@
|
||||
// Definitions by: Dave McKeown <http://github.com/davemckeown>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path='../node/node.d.ts' />
|
||||
|
||||
interface EventEmitter {}
|
||||
|
||||
declare module 'zmq' {
|
||||
@@ -144,12 +146,27 @@ declare module 'zmq' {
|
||||
*/
|
||||
send(msg: any[], flags?: number): Socket;
|
||||
|
||||
/**
|
||||
* Enable monitoring of a Socket
|
||||
*
|
||||
* @param {Number} timer interval in ms > 0 or Undefined for default
|
||||
* @return {Socket} for chaining
|
||||
*/
|
||||
monitor(interval?: number): Socket;
|
||||
|
||||
/**
|
||||
* Close the socket.
|
||||
*
|
||||
*/
|
||||
close(): Socket;
|
||||
|
||||
/**
|
||||
* Socket event
|
||||
* @param eventName {string}
|
||||
* @param callback {Function}
|
||||
*/
|
||||
on(eventName: string, callback: (buffer: Buffer) => void): void;
|
||||
|
||||
// Socket Options
|
||||
_fd: any;
|
||||
_ioevents: any;
|
||||
@@ -181,5 +198,4 @@ declare module 'zmq' {
|
||||
function socket(type: number, options?: any): Socket;
|
||||
function createSocket(type: string, options?: any): Socket;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+5
@@ -104,3 +104,8 @@ interface Nodemailer {
|
||||
createTransport(type: string, path: string): Transport;
|
||||
createXOAuthGenerator(options: XOAuthGeneratorOptions): XOAuthGenerator;
|
||||
}
|
||||
|
||||
declare module "nodemailer" {
|
||||
var nodemailer: Nodemailer;
|
||||
export = nodemailer;
|
||||
}
|
||||
|
||||
@@ -33,6 +33,34 @@ function testApiMethods(api: Pickadate.Api) {
|
||||
pickerRootElement.show();
|
||||
}
|
||||
|
||||
function testDateApiMethods(api: Pickadate.DateApi) {
|
||||
api.get('select');
|
||||
api.get('select', 'yyyy/mm/dd');
|
||||
api.get('highlight');
|
||||
api.get('highlight', 'yyyy/mm/dd');
|
||||
api.get('view');
|
||||
api.get('view', 'yyyy/mm/dd');
|
||||
api.get('min');
|
||||
api.get('min', 'yyyy/mm/dd');
|
||||
api.get('max');
|
||||
api.get('max', 'yyyy/mm/dd');
|
||||
}
|
||||
|
||||
function testTimeApiMethods(api: Pickadate.TimeApi) {
|
||||
api.get('select');
|
||||
api.get('select', 'hh:i');
|
||||
api.get('highlight');
|
||||
api.get('highlight', 'hh:i');
|
||||
api.get('view');
|
||||
api.get('view', 'hh:i');
|
||||
api.get('min');
|
||||
api.get('min', 'hh:i');
|
||||
api.get('max');
|
||||
api.get('max', 'hh:i');
|
||||
}
|
||||
|
||||
// ====================================================================================================================
|
||||
|
||||
var datePickerInput = $("input.date");
|
||||
|
||||
datePickerInput.pickadate();
|
||||
@@ -159,6 +187,7 @@ datePickerInput.pickadate('$root').show();
|
||||
datePickerInput.pickadate('_hidden').show();
|
||||
|
||||
testApiMethods(datePickerApi);
|
||||
testDateApiMethods(datePickerApi);
|
||||
|
||||
// ====================================================================================================================
|
||||
|
||||
@@ -246,4 +275,5 @@ timePickerInput.pickatime('$root').show();
|
||||
timePickerInput.pickatime('_hidden').show();
|
||||
|
||||
testApiMethods(timePickerApi);
|
||||
testTimeApiMethods(timePickerApi);
|
||||
|
||||
|
||||
Vendored
+146
-3
@@ -26,6 +26,40 @@ declare module Pickadate {
|
||||
*/
|
||||
get(field: string, format?: string): any;
|
||||
|
||||
/**
|
||||
* Returns the string value of the picker’s input element.
|
||||
*/
|
||||
get(field: "value"): string;
|
||||
|
||||
/**
|
||||
* Returns a boolean value of whether the picker is open or not.
|
||||
*/
|
||||
get(field: "open"): boolean;
|
||||
|
||||
/**
|
||||
* Returns a boolean value of whether the picker has started or not.
|
||||
*/
|
||||
get(field: "start"): boolean;
|
||||
|
||||
/**
|
||||
* Returns a unique string that is the ID of the picker and it’s element. If the element has no ID, it is set to something random.
|
||||
*/
|
||||
get(field: "id"): string;
|
||||
|
||||
/**
|
||||
* "enable" and "disable" work together to determine which item objects to disable on the picker.
|
||||
*
|
||||
* "enable" returns 1 to represent a base enabled state, meaning that specific dates or times are disabled and all others are enabled;
|
||||
* or -1 to indicate a base disabled state, meaning that specific dates or times are enabled and all others are disabled.
|
||||
*/
|
||||
get(field: "enable"): number;
|
||||
|
||||
/**
|
||||
* If "enable" is 1, returns the collection of dates or times to disable. If "enable" is -1, returns the collection of dates or
|
||||
* times to *not* disable.
|
||||
*/
|
||||
get(field: "disable"): any;
|
||||
|
||||
/**
|
||||
* Unbind callbacks that are bound using the `on` method.
|
||||
* @param methodName one of [ "open, "close", "render", "start", "stop", "set" ]
|
||||
@@ -49,7 +83,7 @@ declare module Pickadate {
|
||||
|
||||
/**
|
||||
* Refresh the picker after adding something to the holder.
|
||||
* By default, only the “face” of the picker (i.e. the box element), has its contents re-rendered.
|
||||
* By default, only the "face" of the picker (i.e. the box element), has its contents re-rendered.
|
||||
*
|
||||
* @param fromRoot whether to render the entire picker from the root up (default: false)
|
||||
*/
|
||||
@@ -100,6 +134,65 @@ declare module Pickadate {
|
||||
_hidden: JQuery;
|
||||
}
|
||||
|
||||
export interface DateApi extends Api {
|
||||
get(field: string, format?: string): any;
|
||||
|
||||
/**
|
||||
* Returns the item object or formatted string of the date that is visually selected.
|
||||
* Defaults to null when there’s no value.
|
||||
*/
|
||||
get(field: "select"): DateItem;
|
||||
get(field: "select", format: string): string;
|
||||
|
||||
/**
|
||||
* Returns the item object or formatted string of the date that is visually highlighted.
|
||||
* Defaults to "today" when there’s no value.
|
||||
*/
|
||||
get(field: "highlight"): DateItem;
|
||||
get(field: "highlight", format: string): string;
|
||||
|
||||
/**
|
||||
* Returns the item object or formatted string of the date that determines the current view.
|
||||
* Defaults to the first day of the current month when there’s no value.
|
||||
*/
|
||||
get(field: "view"): DateItem;
|
||||
get(field: "view", format: string): string;
|
||||
|
||||
/**
|
||||
* Returns the item object or formatted string of the date that determines the lower limit.
|
||||
* Defaults to a -Infinity item object when it is not explicitly set in the options or through the picker’s API.
|
||||
*/
|
||||
get(field: "min"): DateItem;
|
||||
get(field: "min", format: string): string;
|
||||
|
||||
/**
|
||||
* Returns the item object or formatted string of the date that determines the upper limit.
|
||||
* Defaults to an Infinity item object when it is not explicitly set in the options or through the picker’s API.
|
||||
*/
|
||||
get(field: "max"): DateItem;
|
||||
get(field: "max", format: string): string;
|
||||
}
|
||||
|
||||
export interface DateItem {
|
||||
// The full year.
|
||||
year: number;
|
||||
|
||||
// The month with zero-as-index.
|
||||
month: number;
|
||||
|
||||
// The date of the month.
|
||||
date: number;
|
||||
|
||||
// The day of the week with zero-as-index.
|
||||
day: number;
|
||||
|
||||
// The underlying JavaScript Date object.
|
||||
obj: Date;
|
||||
|
||||
// The "pick" value used for comparisons.
|
||||
pick: number;
|
||||
}
|
||||
|
||||
export interface DateOptions {
|
||||
// String and translations
|
||||
monthsFull?: string[];
|
||||
@@ -214,6 +307,56 @@ declare module Pickadate {
|
||||
buttonToday?: string
|
||||
}
|
||||
|
||||
export interface TimeApi extends Api {
|
||||
get(field: string, format?: string): any;
|
||||
|
||||
/**
|
||||
* Returns the item object or formatted string of the date that is visually selected.
|
||||
* Defaults to null when there’s no value.
|
||||
*/
|
||||
get(field: "select"): TimeItem;
|
||||
get(field: "select", format: string): string;
|
||||
|
||||
/**
|
||||
* Returns the item object or formatted string of the date that is visually highlighted.
|
||||
* Defaults to "now" when there’s no value.
|
||||
*/
|
||||
get(field: "highlight"): TimeItem;
|
||||
get(field: "highlight", format: string): string;
|
||||
|
||||
/**
|
||||
* Returns the item object or formatted string of the date that determines the current view.
|
||||
* Defaults to "now" when there’s no value.
|
||||
*/
|
||||
get(field: "view"): TimeItem;
|
||||
get(field: "view", format: string): string;
|
||||
|
||||
/**
|
||||
* Returns the item object or formatted string of the date that determines the lower limit.
|
||||
* Defaults to a -Infinity item object when it is not explicitly set in the options or through the picker’s API.
|
||||
*/
|
||||
get(field: "min"): TimeItem;
|
||||
get(field: "min", format: string): string;
|
||||
|
||||
/**
|
||||
* Returns the item object or formatted string of the date that determines the upper limit.
|
||||
* Defaults to an Infinity item object when it is not explicitly set in the options or through the picker’s API.
|
||||
*/
|
||||
get(field: "max"): TimeItem;
|
||||
get(field: "max", format: string): string;
|
||||
}
|
||||
|
||||
export interface TimeItem {
|
||||
// Hour of the day from 0 to 23.
|
||||
hour: number;
|
||||
|
||||
// The minutes of the hour from 0 to 59 (based on the interval).
|
||||
mins: number;
|
||||
|
||||
// The "pick" value used for comparisons.
|
||||
pick: number;
|
||||
}
|
||||
|
||||
export interface TimeOptions {
|
||||
// Translations and clear button
|
||||
clear?: string;
|
||||
@@ -291,7 +434,7 @@ interface JQuery {
|
||||
/**
|
||||
* Access the API object after initialization.
|
||||
*/
|
||||
pickadate(keyword: "picker"): Pickadate.Api;
|
||||
pickadate(keyword: "picker"): Pickadate.DateApi;
|
||||
pickadate(objectName: "$node"): JQuery;
|
||||
pickadate(objectName: "$root"): JQuery;
|
||||
pickadate(objectName: "_hidden"): JQuery;
|
||||
@@ -310,7 +453,7 @@ interface JQuery {
|
||||
pickadate(options?: Pickadate.DateOptions): JQuery;
|
||||
|
||||
|
||||
pickatime(keyword: "picker"): Pickadate.Api;
|
||||
pickatime(keyword: "picker"): Pickadate.TimeApi;
|
||||
pickatime(objectName: "$node"): JQuery;
|
||||
pickatime(objectName: "$root"): JQuery;
|
||||
pickatime(objectName: "_hidden"): JQuery;
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
///<reference path="please.d.ts" />
|
||||
|
||||
Please.make_color();
|
||||
|
||||
Please.make_color({
|
||||
golden: false,
|
||||
base_color: 'red',
|
||||
colors_returned: 100,
|
||||
format: 'rgb-string'
|
||||
});
|
||||
|
||||
Please.make_scheme({
|
||||
h: 145,
|
||||
s: .7,
|
||||
v: .6
|
||||
});
|
||||
|
||||
Please.make_scheme(
|
||||
{
|
||||
h: 145,
|
||||
s: .7,
|
||||
v: .6
|
||||
},
|
||||
{
|
||||
scheme_type: 'complement',
|
||||
format: 'hex'
|
||||
}
|
||||
);
|
||||
|
||||
Please.NAME_to_HEX("red");
|
||||
|
||||
Please.NAME_to_HSV("red");
|
||||
|
||||
Please.NAME_to_RGB("red");
|
||||
|
||||
Please.HEX_to_HSV("#ff0000");
|
||||
|
||||
Please.RGB_to_HEX({
|
||||
r: 0,
|
||||
g: 0,
|
||||
b: 0
|
||||
});
|
||||
|
||||
Please.HSV_to_RGB({
|
||||
h: 145,
|
||||
s: .7,
|
||||
v: .6
|
||||
});
|
||||
|
||||
Please.RGB_to_HSV({
|
||||
r: 0,
|
||||
g: 0,
|
||||
b: 0
|
||||
});
|
||||
|
||||
Please.HSV_to_HEX({
|
||||
h: 145,
|
||||
s: .7,
|
||||
v: .6
|
||||
});
|
||||
|
||||
Please.HEX_to_HSV("#ff0000");
|
||||
Vendored
+121
@@ -0,0 +1,121 @@
|
||||
// Type definitions for PleaseJS
|
||||
// Project: http://www.checkman.io/please/
|
||||
// Definitions by: Toshiya Nakakura <https://github.com/nakakura>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare var Please: PleaseJS.Please;
|
||||
|
||||
declare module PleaseJS{
|
||||
export interface Please{
|
||||
/***
|
||||
* generate and return a random hex string
|
||||
* @param {MakeColorOption} options
|
||||
* @returns {Array}
|
||||
*/
|
||||
make_color(options?: MakeColorOption): Array<string>;
|
||||
make_color(options?: MakeColorOption): Array<RGB>;
|
||||
make_color(options?: MakeColorOption): Array<HSV>;
|
||||
|
||||
/***
|
||||
* make a color scheme
|
||||
* @param {MakeSchemeOption} options
|
||||
* @returns {Array}
|
||||
*/
|
||||
make_scheme(base_color: HSV, options?: MakeSchemeOption): Array<string>;
|
||||
make_scheme(base_color: HSV, options?: MakeSchemeOption): Array<RGB>;
|
||||
make_scheme(base_color: HSV, options?: MakeSchemeOption): Array<HSV>;
|
||||
|
||||
/***
|
||||
* convert color name into hex string
|
||||
* @param {string} name
|
||||
* @returns {string}
|
||||
*/
|
||||
NAME_to_HEX(name: string): string;
|
||||
|
||||
/***
|
||||
* convert color name into RGB
|
||||
* @param {string} name
|
||||
* @returns {RGB}
|
||||
*/
|
||||
NAME_to_RGB(name: string): RGB;
|
||||
|
||||
/***
|
||||
* convert color name into RGB
|
||||
* @param {string} name
|
||||
* @returns {HSV}
|
||||
*/
|
||||
NAME_to_HSV(name: string): HSV;
|
||||
|
||||
/***
|
||||
* convert HEX into RGB
|
||||
* @param {string} hex
|
||||
* @returns {RGB}
|
||||
*/
|
||||
HEX_to_RGB(hex: string): RGB;
|
||||
|
||||
/***
|
||||
* convert RGB into HEX
|
||||
* @param {RGB} rgb
|
||||
* @returns {string}
|
||||
*/
|
||||
RGB_to_HEX(rgb: RGB): string;
|
||||
|
||||
/***
|
||||
* convert HSV into RGB
|
||||
* @param {HSV} hsv
|
||||
* @returns {RGB}
|
||||
*/
|
||||
HSV_to_RGB(hsv: HSV): RGB;
|
||||
|
||||
/***
|
||||
* convert RGB into HSV
|
||||
* @param {RGB} rgb
|
||||
* @returns {HSV}
|
||||
*/
|
||||
RGB_to_HSV(rgb: RGB): HSV;
|
||||
|
||||
/***
|
||||
* convert HSV into HEX
|
||||
* @param {HSV} hsv
|
||||
* @returns {string}
|
||||
*/
|
||||
HSV_to_HEX(hsv: HSV): string;
|
||||
|
||||
/***
|
||||
* convert HEX into HSV
|
||||
* @param {string} hex
|
||||
* @returns {HSV}
|
||||
*/
|
||||
HEX_to_HSV(hex: string): HSV;
|
||||
}
|
||||
|
||||
export interface MakeColorOption{
|
||||
hue?: number;
|
||||
saturation?: number;
|
||||
value?: number;
|
||||
base_color?: string;
|
||||
greyscale?: boolean;
|
||||
grayscale?: boolean;
|
||||
golden?: boolean;
|
||||
full_random?: boolean;
|
||||
colors_returned?: number;
|
||||
format?: string;
|
||||
}
|
||||
|
||||
export interface MakeSchemeOption{
|
||||
scheme_type: string;
|
||||
format: string;
|
||||
}
|
||||
|
||||
export interface RGB{
|
||||
r: number;
|
||||
g: number;
|
||||
b: number;
|
||||
}
|
||||
|
||||
export interface HSV{
|
||||
h: number;
|
||||
s: number;
|
||||
v: number;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/// <reference path="./rabbit.js.d.ts" />
|
||||
|
||||
import rabbit = require('rabbit.js');
|
||||
var context = rabbit.createContext();
|
||||
|
||||
context.on('ready', function () { console.log('ready'); });
|
||||
|
||||
var pub = context.socket<rabbit.PubSocket>('PUB');
|
||||
var sub = context.socket<rabbit.SubSocket>('SUB');
|
||||
var push = context.socket<rabbit.PushSocket>('PUSH');
|
||||
var pull = context.socket<rabbit.PullSocket>('PULL');
|
||||
var req = context.socket<rabbit.ReqSocket>('REQ');
|
||||
var rep = context.socket<rabbit.RepSocket>('REP');
|
||||
var task = context.socket<rabbit.TaskSocket>('TASK');
|
||||
var worker = context.socket<rabbit.WorkerSocket>('WORKER');
|
||||
|
||||
pub.connect('chat');
|
||||
pub.write('hello', 'utf8');
|
||||
pub.close();
|
||||
|
||||
sub.connect('chat');
|
||||
sub.on('data', function (msg: string) { console.log(msg); });
|
||||
sub.close();
|
||||
|
||||
rep.setEncoding('utf8');
|
||||
rep.on('data', function (msg: string) { rep.write('msg', 'utf8'); });
|
||||
rep.connect('uppercase');
|
||||
req.connect('uppercase', function () { req.pipe(process.stdout); });
|
||||
|
||||
push.connect('items', function () { pull.pipe(push); });
|
||||
push.close();
|
||||
pull.connect('items', function () {});
|
||||
pull.close();
|
||||
Vendored
+108
@@ -0,0 +1,108 @@
|
||||
// Type definitions for rabbit.js v0.4.2
|
||||
// Project: https://github.com/squaremo/rabbit.js
|
||||
// Definitions by: Wonshik Kim <https://github.com/wokim>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
|
||||
declare module "rabbit.js" {
|
||||
import events = require('events');
|
||||
import stream = require('stream');
|
||||
|
||||
export function createContext(url?: string): Context;
|
||||
|
||||
export class Context extends events.EventEmitter {
|
||||
public socket<T>(type: string, options?: SocketOptions):T;
|
||||
public close(callback: Function): any;
|
||||
}
|
||||
|
||||
export interface SocketOptions {
|
||||
prefetch?: any;
|
||||
expiration?: any;
|
||||
persistent?: any;
|
||||
topic?: any;
|
||||
task?: any;
|
||||
}
|
||||
|
||||
export interface Socket {
|
||||
connect(destination: string, callback?: Function): any;
|
||||
setsockopt(opt: string, value: string): any;
|
||||
close(): any;
|
||||
}
|
||||
|
||||
export class PubSocket extends stream.Writable implements Socket {
|
||||
constructor(channel: string, opts: SocketOptions);
|
||||
connect(destination: string, callback?: Function): any;
|
||||
setsockopt(opt: string, value: string): any;
|
||||
close(): any;
|
||||
|
||||
publish(topic: string, chunk: string, encoding?: string): any;
|
||||
publish(topic: string, chunk: Buffer, encoding?: string): any;
|
||||
}
|
||||
|
||||
export class SubSocket extends stream.Readable implements Socket {
|
||||
constructor(channel: string, opts: SocketOptions);
|
||||
connect(source: string, callback?: Function): any;
|
||||
setsockopt(opt: string, value: string): any;
|
||||
close(): any;
|
||||
}
|
||||
|
||||
export class PushSocket extends stream.Writable implements Socket {
|
||||
constructor(channel: string, opts: SocketOptions);
|
||||
connect(destination: string, callback?: Function): any;
|
||||
setsockopt(opt: string, value: string): any;
|
||||
close(): any;
|
||||
}
|
||||
|
||||
export class PullSocket extends stream.Readable implements Socket {
|
||||
constructor(channel: string, opts: SocketOptions);
|
||||
connect(source: string, callback?: Function): any;
|
||||
setsockopt(opt: string, value: string): any;
|
||||
close(): any;
|
||||
}
|
||||
|
||||
export class WorkerSocket extends stream.Readable implements Socket {
|
||||
constructor(channel: string, opts: SocketOptions);
|
||||
connect(source: string, callback?: Function): any;
|
||||
setsockopt(opt: string, value: string): any;
|
||||
close(): any;
|
||||
|
||||
ack(): any;
|
||||
requeue(): any;
|
||||
discard(): any;
|
||||
}
|
||||
|
||||
export interface RequestMessage {
|
||||
properties: { correlationId: number };
|
||||
content: any;
|
||||
}
|
||||
|
||||
export class ReqSocket extends stream.Duplex implements Socket {
|
||||
constructor(channel: string, opts: SocketOptions);
|
||||
connect(destination: string, callback?: Function): any;
|
||||
setsockopt(opt: string, value: string): any;
|
||||
close(): any;
|
||||
|
||||
handleReply(msg: RequestMessage): any;
|
||||
}
|
||||
|
||||
export class RepSocket extends stream.Duplex implements Socket {
|
||||
constructor(channel: string, opts: SocketOptions);
|
||||
connect(source: string, callback?: Function): any;
|
||||
setsockopt(opt: string, value: string): any;
|
||||
close(): any;
|
||||
|
||||
requeue(): any;
|
||||
discard(): any;
|
||||
}
|
||||
|
||||
export class TaskSocket extends stream.Writable implements Socket {
|
||||
constructor(channel: string, opts: SocketOptions);
|
||||
connect(destination: string, callback?: Function): any;
|
||||
setsockopt(opt: string, value: string): any;
|
||||
close(): any;
|
||||
|
||||
post(task: string, chunk: string, encoding?: string): any;
|
||||
post(task: string, chunk: Buffer, encoding?: string): any;
|
||||
}
|
||||
}
|
||||
@@ -1,139 +0,0 @@
|
||||
/// <reference path="react-addons.d.ts" />
|
||||
import React = require("react/addons");
|
||||
|
||||
var PropTypesSpecification: React.Specification<any, any> = {
|
||||
propTypes: {
|
||||
// You can declare that a prop is a specific JS primitive. By default, these
|
||||
// are all optional.
|
||||
optionalArray: React.PropTypes.array,
|
||||
optionalBool: React.PropTypes.bool,
|
||||
optionalFunc: React.PropTypes.func,
|
||||
optionalNumber: React.PropTypes.number,
|
||||
optionalObject: React.PropTypes.object,
|
||||
optionalString: React.PropTypes.string,
|
||||
|
||||
// Anything that can be rendered: numbers, strings, components or an array
|
||||
// containing these types.
|
||||
optionalRenderable: React.PropTypes.node,
|
||||
|
||||
// A React component.
|
||||
optionalComponent: React.PropTypes.component,
|
||||
|
||||
// You can also declare that a prop is an instance of a class. This uses
|
||||
// JS's instanceof operator.
|
||||
optionalMessage: React.PropTypes.instanceOf(Date),
|
||||
|
||||
// You can ensure that your prop is limited to specific values by treating
|
||||
// it as an enum.
|
||||
optionalEnum: React.PropTypes.oneOf(['News', 'Photos']),
|
||||
|
||||
// An object that could be one of many types
|
||||
optionalUnion: React.PropTypes.oneOfType([
|
||||
React.PropTypes.string,
|
||||
React.PropTypes.number,
|
||||
React.PropTypes.instanceOf(Date)
|
||||
]),
|
||||
|
||||
// An array of a certain type
|
||||
optionalArrayOf: React.PropTypes.arrayOf(React.PropTypes.number),
|
||||
|
||||
// An object with property values of a certain type
|
||||
optionalObjectOf: React.PropTypes.objectOf(React.PropTypes.number),
|
||||
|
||||
// An object taking on a particular shape
|
||||
optionalObjectWithShape: React.PropTypes.shape({
|
||||
color: React.PropTypes.string,
|
||||
fontSize: React.PropTypes.number
|
||||
}),
|
||||
|
||||
// You can chain any of the above with `isRequired` to make sure a warning
|
||||
// is shown if the prop isn't provided.
|
||||
requiredFunc: React.PropTypes.func.isRequired,
|
||||
|
||||
// A value of any data type
|
||||
requiredAny: React.PropTypes.any.isRequired,
|
||||
|
||||
// You can also specify a custom validator. It should return an Error
|
||||
// object if the validation fails. Don't `console.warn` or throw, as this
|
||||
// won't work inside `oneOfType`.
|
||||
customProp: function(props, propName, componentName) {
|
||||
if (!/matchme/.test(props[propName])) {
|
||||
return new Error('Validation failed!');
|
||||
}
|
||||
return null;
|
||||
}
|
||||
},
|
||||
render: (): React.ReactHTMLElement => {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
React.createClass(PropTypesSpecification);
|
||||
|
||||
var mountNode: Element;
|
||||
|
||||
var HelloMessage = React.createClass({displayName: 'HelloMessage',
|
||||
render: function() {
|
||||
return React.DOM.div(null, "Hello ", (<React.Component<{name: string}, any>>this).props.name);
|
||||
}
|
||||
});
|
||||
|
||||
React.render(HelloMessage({name: "John"}), mountNode);
|
||||
|
||||
var Timer = React.createClass({displayName: 'Timer',
|
||||
getInitialState: function() {
|
||||
return {secondsElapsed: 0};
|
||||
},
|
||||
tick: function() {
|
||||
(<React.Component<any, {secondsElapsed: number}>>this).setState({
|
||||
secondsElapsed: (<React.Component<any, {secondsElapsed: number}>>this).state.secondsElapsed + 1
|
||||
});
|
||||
},
|
||||
componentDidMount: function() {
|
||||
this.interval = setInterval(this.tick, 1000);
|
||||
},
|
||||
componentWillUnmount: function() {
|
||||
clearInterval(this.interval);
|
||||
},
|
||||
render: function() {
|
||||
return React.DOM.div(
|
||||
null,
|
||||
"Seconds Elapsed: ",
|
||||
(<React.Component<any, {secondsElapsed: number}>>this).state.secondsElapsed
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
React.render(Timer(null), mountNode);
|
||||
|
||||
// TestUtils
|
||||
var that: React.Component<any, any>;
|
||||
var node = that.refs['input'].getDOMNode();
|
||||
React.addons.TestUtils.Simulate.click(node);
|
||||
React.addons.TestUtils.Simulate.change(node);
|
||||
React.addons.TestUtils.Simulate.keyDown(node, {key: "Enter"});
|
||||
|
||||
var Greeting = React.createClass({displayName: 'Greeting',
|
||||
getInitialState: function() {
|
||||
return {morning: true};
|
||||
},
|
||||
render: function() {
|
||||
var me = <React.Component<{name: string}, {morning: boolean}>>this;
|
||||
return React.DOM.div(null, (me.state.morning ? "Hello" : "Goodbye "), me.props.name);
|
||||
}
|
||||
});
|
||||
|
||||
var root = React.addons.TestUtils.renderIntoDocument(Greeting({name: "John"}));
|
||||
var greeting = React.addons.TestUtils.findRenderedComponentWithType(root, Greeting);
|
||||
greeting.setState({
|
||||
morning: false
|
||||
});
|
||||
|
||||
var isImportant: boolean;
|
||||
var isRead: boolean;
|
||||
var cx = React.addons.classSet;
|
||||
var classes: string = cx({
|
||||
'message': true,
|
||||
'message-important': isImportant,
|
||||
'message-read': isRead
|
||||
});
|
||||
Vendored
-175
@@ -1,175 +0,0 @@
|
||||
// Type definitions for React with Addons 0.12.RC
|
||||
// Project: http://facebook.github.io/react/
|
||||
// Definitions by: Asana <https://asana.com>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../react/react.d.ts" />
|
||||
|
||||
declare module "react/addons" {
|
||||
export = React;
|
||||
}
|
||||
|
||||
declare module React {
|
||||
export var addons: {
|
||||
classSet: (classes: {[key: string]: boolean}) => string;
|
||||
cloneWithProps: CloneWithProps<any>;
|
||||
CSSTransitionGroup: ReactComponentFactory<CSSTransitionGroupProps>;
|
||||
LinkedStateMixin: LinkedStateMixin<any, any>;
|
||||
Perf: Perf;
|
||||
PureRenderMixin: Mixin<any, any>;
|
||||
TestUtils: TestUtils;
|
||||
TransitionGroup: ReactComponentFactory<any>;
|
||||
update(object: Object, changes: Object): Object;
|
||||
};
|
||||
|
||||
export interface CloneWithProps<P> {
|
||||
(instance: ReactComponentElement<P>, extraProps?: P): ReactComponentElement<P>;
|
||||
}
|
||||
|
||||
export interface ReactLink<T> {
|
||||
value: T;
|
||||
requestChange(newValue: T): void;
|
||||
}
|
||||
|
||||
export interface LinkedStateMixin<P, S> extends Mixin<P, S> {
|
||||
linkState<T>(key: string): ReactLink<T>;
|
||||
}
|
||||
|
||||
export interface ComponentPerfContext {
|
||||
current: string;
|
||||
owner: string;
|
||||
}
|
||||
|
||||
export interface CSSTransitionGroupProps {
|
||||
transitionName: string;
|
||||
}
|
||||
|
||||
export interface TransitionsSpecification<P, S> extends Specification<P, S> {
|
||||
componentWillEnter?(callback: () => void): void;
|
||||
componentDidEnter?(): void;
|
||||
componentWillLeave?(callback: () => void): void;
|
||||
componentDidLeave?(): void;
|
||||
}
|
||||
|
||||
export interface NumericPerfContext {
|
||||
[key: string]: number;
|
||||
}
|
||||
|
||||
export interface Measurements {
|
||||
exclusive: NumericPerfContext;
|
||||
inclusive: NumericPerfContext;
|
||||
render: NumericPerfContext;
|
||||
counts: NumericPerfContext;
|
||||
writes: NumericPerfContext;
|
||||
displayNames: {
|
||||
[key: string]: ComponentPerfContext;
|
||||
};
|
||||
totalTime: number;
|
||||
}
|
||||
|
||||
export interface Perf {
|
||||
start(): void;
|
||||
stop(): void;
|
||||
printInclusive(measurements: Measurements[]): void;
|
||||
printExclusive(measurements: Measurements[]): void;
|
||||
printWasted(measurements: Measurements[]): void;
|
||||
printDOM(measurements: Measurements[]): void;
|
||||
getLastMeasurements(): Measurements[];
|
||||
}
|
||||
|
||||
export interface TestUtils {
|
||||
Simulate: Simulate;
|
||||
renderIntoDocument<P>(instance: ReactComponentElement<P>): ReactComponentElement<P>;
|
||||
renderIntoDocument(instance: ReactHTMLElement): ReactHTMLElement;
|
||||
renderIntoDocument(instance: ReactSVGElement): ReactSVGElement;
|
||||
mockComponent(componentClass: ReactComponentFactory<any>, mockTagName?: string): TestUtils;
|
||||
isDescriptorOfType(descriptor: ReactElement<any, any>, componentClass: ReactComponentFactory<any>): boolean;
|
||||
isDOMComponent(instance: ReactElement<any, any>): boolean;
|
||||
isCompositeComponent(instance: ReactElement<any, any>): boolean;
|
||||
isCompositeComponentWithType(instance: ReactElement<any, any>, componentClass: ReactComponentFactory<any>): boolean;
|
||||
isTextComponent(instance: ReactElement<any, any>): boolean;
|
||||
findAllInRenderedTree(tree: ReactElement<any, any>, test: (component: ReactElement<any, any>) => boolean): ReactElement<any, any>[];
|
||||
scryRenderedDOMComponentsWithClass(tree: ReactElement<any, any>, className: string): ReactElement<any, any>[];
|
||||
findRenderedDOMComponentWithClass(tree: ReactElement<any, any>, className: string): ReactElement<any, any>;
|
||||
scryRenderedDOMComponentsWithTag(tree: ReactElement<any, any>, tagName: string): ReactElement<any, any>[];
|
||||
findRenderedDOMComponentWithTag(tree: ReactElement<any, any>, tagName: string): ReactElement<any, any>;
|
||||
scryRenderedComponentsWithTag(tree: ReactElement<any, any>, componentClass: Function): ReactElement<any, any>[];
|
||||
findRenderedComponentWithType<P>(tree: ReactElement<any, any>, componentClass: ReactComponentFactory<P>): Component<P, any>;
|
||||
scryRenderedComponentsWithType<P>(tree: ReactElement<any, any>, componentClass: ReactComponentFactory<P>): Component<P, any>[];
|
||||
}
|
||||
|
||||
export interface SyntheticEventData {
|
||||
altKey?: boolean;
|
||||
button?: number;
|
||||
buttons?: number;
|
||||
clientX?: number;
|
||||
clientY?: number;
|
||||
changedTouches?: TouchList;
|
||||
charCode?: boolean;
|
||||
clipboardData?: DataTransfer;
|
||||
ctrlKey?: boolean;
|
||||
deltaMode?: number;
|
||||
deltaX?: number;
|
||||
deltaY?: number;
|
||||
deltaZ?: number;
|
||||
detail?: number;
|
||||
getModifierState?(key: string): boolean;
|
||||
key?: string;
|
||||
keyCode?: number;
|
||||
locale?: string;
|
||||
location?: number;
|
||||
metaKey?: boolean;
|
||||
pageX?: number;
|
||||
pageY?: number;
|
||||
relatedTarget?: EventTarget;
|
||||
repeat?: boolean;
|
||||
screenX?: number;
|
||||
screenY?: number;
|
||||
shiftKey?: boolean;
|
||||
targetTouches?: TouchList;
|
||||
touches?: TouchList;
|
||||
view?: AbstractView;
|
||||
which?: number;
|
||||
}
|
||||
|
||||
export interface EventSimulator {
|
||||
(element: Element, eventData?: SyntheticEventData): void;
|
||||
(descriptor: ReactElement<any, any>, eventData?: SyntheticEventData): void;
|
||||
}
|
||||
|
||||
export interface Simulate {
|
||||
blur: EventSimulator;
|
||||
change: EventSimulator;
|
||||
click: EventSimulator;
|
||||
cut: EventSimulator;
|
||||
doubleClick: EventSimulator;
|
||||
drag: EventSimulator;
|
||||
dragEnd: EventSimulator;
|
||||
dragEnter: EventSimulator;
|
||||
dragExit: EventSimulator;
|
||||
dragLeave: EventSimulator;
|
||||
dragOver: EventSimulator;
|
||||
dragStart: EventSimulator;
|
||||
drop: EventSimulator;
|
||||
focus: EventSimulator;
|
||||
input: EventSimulator;
|
||||
keyDown: EventSimulator;
|
||||
keyPress: EventSimulator;
|
||||
keyUp: EventSimulator;
|
||||
mouseDown: EventSimulator;
|
||||
mouseEnter: EventSimulator;
|
||||
mouseLeave: EventSimulator;
|
||||
mouseMove: EventSimulator;
|
||||
mouseOut: EventSimulator;
|
||||
mouseOver: EventSimulator;
|
||||
mouseUp: EventSimulator;
|
||||
paste: EventSimulator;
|
||||
scroll: EventSimulator;
|
||||
submit: EventSimulator;
|
||||
touchCancel: EventSimulator;
|
||||
touchEnd: EventSimulator;
|
||||
touchMove: EventSimulator;
|
||||
touchStart: EventSimulator;
|
||||
wheel: EventSimulator;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
// Definitions by: Asana <https://asana.com>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../../react/legacy/react-0.11.d.ts" />
|
||||
/// <reference path="react-0.11.d.ts" />
|
||||
|
||||
declare module "react/addons-0.11" {
|
||||
export = React;
|
||||
@@ -0,0 +1,42 @@
|
||||
/// <reference path="react.d.ts" />
|
||||
import React = require("react/addons");
|
||||
|
||||
// TestUtils
|
||||
var that: React.CompositeComponent<any, any>;
|
||||
var node = that.refs["input"].getDOMNode();
|
||||
React.addons.TestUtils.Simulate.click(node);
|
||||
React.addons.TestUtils.Simulate.change(node);
|
||||
React.addons.TestUtils.Simulate.keyDown(node, {key: "Enter"});
|
||||
|
||||
interface GreetingProps {
|
||||
name: string;
|
||||
}
|
||||
interface GreetingState {
|
||||
morning: boolean;
|
||||
}
|
||||
interface Greeting extends React.CompositeComponent<GreetingProps, GreetingState> {
|
||||
}
|
||||
var Greeting = React.createClass({displayName: "Greeting",
|
||||
getInitialState: function() {
|
||||
return {morning: true};
|
||||
},
|
||||
render: function() {
|
||||
var me = <Greeting>this;
|
||||
return React.DOM.div(null, (me.state.morning ? "Hello" : "Goodbye "), me.props.name);
|
||||
}
|
||||
});
|
||||
|
||||
var root = React.addons.TestUtils.renderIntoDocument(React.createElement(Greeting, {name: "John"}));
|
||||
var greeting = <Greeting>React.addons.TestUtils.findRenderedComponentWithType(root, Greeting);
|
||||
greeting.setState({
|
||||
morning: false
|
||||
});
|
||||
|
||||
var isImportant: boolean;
|
||||
var isRead: boolean;
|
||||
var cx = React.addons.classSet;
|
||||
var classes: string = cx({
|
||||
"message": true,
|
||||
"message-important": isImportant,
|
||||
"message-read": isRead
|
||||
});
|
||||
+146
-67
@@ -1,64 +1,152 @@
|
||||
/// <reference path="react.d.ts" />
|
||||
import React = require("react");
|
||||
|
||||
var PropTypesSpecification: React.Specification<any, any> = {
|
||||
interface Props {
|
||||
hello: string;
|
||||
world?: string;
|
||||
foo: number;
|
||||
bar: boolean;
|
||||
}
|
||||
|
||||
interface State {
|
||||
inputValue?: string;
|
||||
seconds?: number;
|
||||
}
|
||||
|
||||
interface MyComponent extends React.CompositeComponent<Props, State> {
|
||||
reset(): void;
|
||||
}
|
||||
|
||||
var props: Props = {
|
||||
hello: "world",
|
||||
foo: 42,
|
||||
bar: true
|
||||
};
|
||||
|
||||
var container: Element;
|
||||
var INPUT_REF: string = "input";
|
||||
|
||||
//
|
||||
// Top-Level API
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
var reactClass: React.ComponentClass<Props> = React.createClass<Props>({
|
||||
getDefaultProps: () => {
|
||||
return <Props>{
|
||||
hello: undefined,
|
||||
world: "peace",
|
||||
foo: undefined,
|
||||
bar: undefined
|
||||
};
|
||||
},
|
||||
getInitialState: () => {
|
||||
return {
|
||||
inputValue: "React.js",
|
||||
seconds: 0
|
||||
};
|
||||
},
|
||||
reset: () => {
|
||||
this.replaceState(this.getInitialState());
|
||||
},
|
||||
render: () => {
|
||||
return React.DOM.div(null,
|
||||
React.DOM.input({
|
||||
ref: INPUT_REF,
|
||||
value: this.state.inputValue
|
||||
}));
|
||||
}
|
||||
});
|
||||
|
||||
var reactElement: React.ReactElement<Props> =
|
||||
React.createElement<Props>(reactClass, props);
|
||||
|
||||
var reactFactory: React.Factory<Props> =
|
||||
React.createFactory<Props>(reactClass);
|
||||
|
||||
var component: React.Component<Props> =
|
||||
React.render<Props>(reactElement, container);
|
||||
|
||||
var unmounted: boolean = React.unmountComponentAtNode(container);
|
||||
var str: string = React.renderToString(reactElement);
|
||||
var markup: string = React.renderToStaticMarkup(reactElement);
|
||||
var notValid: boolean = React.isValidElement(props); // false
|
||||
var isValid = React.isValidElement(reactElement); // true
|
||||
React.initializeTouchEvents(true);
|
||||
|
||||
//
|
||||
// React Elements
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
var type = reactElement.type;
|
||||
var elementProps: Props = reactElement.props;
|
||||
var key = reactElement.key;
|
||||
var ref: string = reactElement.ref;
|
||||
var factoryElement: React.ReactElement<Props> = reactFactory(elementProps);
|
||||
|
||||
//
|
||||
// React Components
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
var displayName: string = reactClass.displayName;
|
||||
var defaultProps: Props = reactClass.getDefaultProps();
|
||||
var propTypes: React.ValidationMap<Props> = reactClass.propTypes;
|
||||
|
||||
//
|
||||
// Component API
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
var htmlElement: Element = component.getDOMNode();
|
||||
var divElement: HTMLDivElement = component.getDOMNode<HTMLDivElement>();
|
||||
var isMounted: boolean = component.isMounted();
|
||||
component.setProps(elementProps);
|
||||
component.replaceProps(props);
|
||||
|
||||
var compComponent: React.CompositeComponent<Props, State> =
|
||||
<React.CompositeComponent<Props, State>>component;
|
||||
var initialState: State = compComponent.state;
|
||||
compComponent.setState({ inputValue: "!!!" });
|
||||
compComponent.replaceState({ inputValue: "???", seconds: 60 });
|
||||
compComponent.forceUpdate();
|
||||
|
||||
var inputRef: React.HTMLComponent =
|
||||
<React.HTMLComponent>compComponent.refs[INPUT_REF];
|
||||
var value: string = inputRef.getDOMNode<HTMLInputElement>().value;
|
||||
|
||||
var myComponent = <MyComponent>compComponent;
|
||||
myComponent.reset();
|
||||
|
||||
//
|
||||
// PropTypes
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
var PropTypesSpecification: React.ComponentSpec<any, any> = {
|
||||
propTypes: {
|
||||
// You can declare that a prop is a specific JS primitive. By default, these
|
||||
// are all optional.
|
||||
optionalArray: React.PropTypes.array,
|
||||
optionalBool: React.PropTypes.bool,
|
||||
optionalFunc: React.PropTypes.func,
|
||||
optionalNumber: React.PropTypes.number,
|
||||
optionalObject: React.PropTypes.object,
|
||||
optionalString: React.PropTypes.string,
|
||||
|
||||
// Anything that can be rendered: numbers, strings, components or an array
|
||||
// containing these types.
|
||||
optionalRenderable: React.PropTypes.node,
|
||||
|
||||
// A React component.
|
||||
optionalComponent: React.PropTypes.component,
|
||||
|
||||
// You can also declare that a prop is an instance of a class. This uses
|
||||
// JS's instanceof operator.
|
||||
optionalNode: React.PropTypes.node,
|
||||
optionalElement: React.PropTypes.element,
|
||||
optionalMessage: React.PropTypes.instanceOf(Date),
|
||||
|
||||
// You can ensure that your prop is limited to specific values by treating
|
||||
// it as an enum.
|
||||
optionalEnum: React.PropTypes.oneOf(['News', 'Photos']),
|
||||
|
||||
// An object that could be one of many types
|
||||
optionalEnum: React.PropTypes.oneOf(["News", "Photos"]),
|
||||
optionalUnion: React.PropTypes.oneOfType([
|
||||
React.PropTypes.string,
|
||||
React.PropTypes.number,
|
||||
React.PropTypes.instanceOf(Date)
|
||||
]),
|
||||
|
||||
// An array of a certain type
|
||||
optionalArrayOf: React.PropTypes.arrayOf(React.PropTypes.number),
|
||||
|
||||
// An object with property values of a certain type
|
||||
optionalObjectOf: React.PropTypes.objectOf(React.PropTypes.number),
|
||||
|
||||
// An object taking on a particular shape
|
||||
optionalObjectWithShape: React.PropTypes.shape({
|
||||
color: React.PropTypes.string,
|
||||
fontSize: React.PropTypes.number
|
||||
}),
|
||||
|
||||
// You can chain any of the above with `isRequired` to make sure a warning
|
||||
// is shown if the prop isn't provided.
|
||||
requiredFunc: React.PropTypes.func.isRequired,
|
||||
|
||||
// A value of any data type
|
||||
requiredAny: React.PropTypes.any.isRequired,
|
||||
|
||||
// You can also specify a custom validator. It should return an Error
|
||||
// object if the validation fails. Don't `console.warn` or throw, as this
|
||||
// won't work inside `oneOfType`.
|
||||
customProp: function(props, propName, componentName) {
|
||||
customProp: function(props: any, propName: string, componentName: string) {
|
||||
if (!/matchme/.test(props[propName])) {
|
||||
return new Error('Validation failed!');
|
||||
return new Error("Validation failed!");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -68,50 +156,41 @@ var PropTypesSpecification: React.Specification<any, any> = {
|
||||
}
|
||||
};
|
||||
|
||||
React.createClass(PropTypesSpecification);
|
||||
//
|
||||
// Example from http://facebook.github.io/react/
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
var mountNode: Element;
|
||||
|
||||
interface HelloMessageProps {
|
||||
name: string;
|
||||
interface TimerState {
|
||||
secondsElapsed: number;
|
||||
}
|
||||
|
||||
var HelloMessage = React.createClass<HelloMessageProps, any>({displayName: 'HelloMessage',
|
||||
render: function() {
|
||||
return React.DOM.div(null, "Hello ", (<React.Component<HelloMessageProps, any>>this).props.name);
|
||||
}
|
||||
});
|
||||
|
||||
// This code - calling a component directly - is deprecated in v0.12
|
||||
// See http://fb.me/react-legacyfactory
|
||||
React.render(HelloMessage({ name: "John" }), mountNode);
|
||||
|
||||
// Create a factory instead
|
||||
var HelloMessageFactory = React.createFactory(HelloMessage)
|
||||
React.render(HelloMessageFactory({ name: "John" }), mountNode)
|
||||
|
||||
var Timer = React.createClass({displayName: 'Timer',
|
||||
getInitialState: function() {
|
||||
return {secondsElapsed: 0};
|
||||
interface Timer extends React.CompositeComponent<{}, TimerState> {
|
||||
}
|
||||
var Timer = React.createClass({
|
||||
displayName: "Timer",
|
||||
getInitialState: () => {
|
||||
return { secondsElapsed: 0 };
|
||||
},
|
||||
tick: function() {
|
||||
(<React.Component<any, {secondsElapsed: number}>>this).setState({
|
||||
secondsElapsed: (<React.Component<any, {secondsElapsed: number}>>this).state.secondsElapsed + 1
|
||||
tick: () => {
|
||||
var me = <Timer>this;
|
||||
me.setState({
|
||||
secondsElapsed: me.state.secondsElapsed + 1
|
||||
});
|
||||
},
|
||||
componentDidMount: function() {
|
||||
componentDidMount: () => {
|
||||
this.interval = setInterval(this.tick, 1000);
|
||||
},
|
||||
componentWillUnmount: function() {
|
||||
componentWillUnmount: () => {
|
||||
clearInterval(this.interval);
|
||||
},
|
||||
render: function() {
|
||||
render: () => {
|
||||
var me = <Timer>this;
|
||||
return React.DOM.div(
|
||||
null,
|
||||
"Seconds Elapsed: ",
|
||||
(<React.Component<any, {secondsElapsed: number}>>this).state.secondsElapsed
|
||||
me.state.secondsElapsed
|
||||
);
|
||||
}
|
||||
});
|
||||
var mountNode: Element;
|
||||
React.render(React.createElement(Timer, null), mountNode);
|
||||
|
||||
React.render(Timer(), mountNode);
|
||||
Vendored
+810
-496
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,421 @@
|
||||
/// <reference path="../jquery/jquery.d.ts" />
|
||||
/// <reference path="selectize.d.ts" />
|
||||
|
||||
var $input = $(".test-input").selectize();
|
||||
var testApi = $input[0].selectize;
|
||||
|
||||
function changeListener(selection: string) {
|
||||
console.log(selection);
|
||||
}
|
||||
|
||||
testApi.on("change", changeListener);
|
||||
testApi.off("change", changeListener);
|
||||
testApi.off("change");
|
||||
|
||||
// All code examples below taken from https://github.com/brianreavis/selectize.js/blob/master/examples
|
||||
|
||||
// API example
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
var $select = $('#select-tools').selectize({
|
||||
maxItems: null,
|
||||
valueField: 'id',
|
||||
labelField: 'title',
|
||||
searchField: 'title',
|
||||
options: [
|
||||
{id: 1, title: 'Spectrometer', url: 'http://en.wikipedia.org/wiki/Spectrometers'},
|
||||
{id: 2, title: 'Star Chart', url: 'http://en.wikipedia.org/wiki/Star_chart'},
|
||||
{id: 3, title: 'Electrical Tape', url: 'http://en.wikipedia.org/wiki/Electrical_tape'}
|
||||
],
|
||||
create: false
|
||||
});
|
||||
|
||||
var control = $select[0].selectize;
|
||||
|
||||
$('#button-clear').on('click', function() {
|
||||
control.clear();
|
||||
});
|
||||
$('#button-clearoptions').on('click', function() {
|
||||
control.clearOptions();
|
||||
});
|
||||
$('#button-addoption').on('click', function() {
|
||||
control.addOption({
|
||||
id: 4,
|
||||
title: 'Something New',
|
||||
url: 'http://google.com'
|
||||
});
|
||||
});
|
||||
$('#button-additem').on('click', function() {
|
||||
control.addItem(2);
|
||||
});
|
||||
$('#button-setvalue').on('click', function() {
|
||||
control.setValue([2, 3]);
|
||||
});
|
||||
|
||||
|
||||
// Cities example
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
var xhr: XMLHttpRequest;
|
||||
var select_state: Selectize.IApi<string, any>;
|
||||
var select_city: Selectize.IApi<string, any>;
|
||||
var $select_state: JQuery;
|
||||
var $select_city: JQuery;
|
||||
|
||||
$select_state = $('#select-state').selectize({
|
||||
onChange: function(value) {
|
||||
if (!value.length) return;
|
||||
select_city.disable();
|
||||
select_city.clearOptions();
|
||||
select_city.load(function(callback) {
|
||||
xhr && xhr.abort();
|
||||
xhr = $.ajax({
|
||||
url: 'http://www.corsproxy.com/api.sba.gov/geodata/primary_city_links_for_state_of/' + value + '.json',
|
||||
success: function(results) {
|
||||
select_city.enable();
|
||||
callback(results);
|
||||
},
|
||||
error: function() {
|
||||
callback();
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$select_city = $('#select-city').selectize({
|
||||
valueField: 'name',
|
||||
labelField: 'name',
|
||||
searchField: ['name']
|
||||
});
|
||||
|
||||
select_city = $select_city[0].selectize;
|
||||
select_state = $select_state[0].selectize;
|
||||
select_city.disable();
|
||||
|
||||
|
||||
// Confirm example
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
$('#input-tags').selectize({
|
||||
delimiter: ',',
|
||||
persist: false,
|
||||
onDelete: function(values) {
|
||||
return confirm(values.length > 1 ? 'Are you sure you want to remove these ' + values.length + ' items?' : 'Are you sure you want to remove "' + values[0] + '"?');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Contacts example
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
interface Person {
|
||||
first_name: string;
|
||||
last_name: string;
|
||||
email: string;
|
||||
}
|
||||
|
||||
var REGEX_EMAIL = '([a-z0-9!#$%&\'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&\'*+/=?^_`{|}~-]+)*@' +
|
||||
'(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)';
|
||||
var formatPerson = (name: Person) => {
|
||||
return $.trim((name.first_name || '') + ' ' + (name.last_name || ''));
|
||||
};
|
||||
|
||||
$('#select-to').selectize({
|
||||
persist: false,
|
||||
maxItems: null,
|
||||
valueField: 'email',
|
||||
labelField: 'name',
|
||||
searchField: ['first_name', 'last_name', 'email'],
|
||||
sortField: [
|
||||
{field: 'first_name', direction: 'asc'},
|
||||
{field: 'last_name', direction: 'asc'}
|
||||
],
|
||||
options: [
|
||||
{email: 'nikola@tesla.com', first_name: 'Nikola', last_name: 'Tesla'},
|
||||
{email: 'brian@thirdroute.com', first_name: 'Brian', last_name: 'Reavis'},
|
||||
{email: 'someone@gmail.com'}
|
||||
],
|
||||
render: {
|
||||
item: function(item: Person, escape: (input: any) => string) {
|
||||
var name = formatPerson(item);
|
||||
return '<div>' +
|
||||
(name ? '<span class="name">' + escape(name) + '</span>' : '') +
|
||||
(item.email ? '<span class="email">' + escape(item.email) + '</span>' : '') +
|
||||
'</div>';
|
||||
},
|
||||
option: function(item: Person, escape: (input: any) => string) {
|
||||
var name = formatPerson(item);
|
||||
var label = name || item.email;
|
||||
var caption = name ? item.email : null;
|
||||
return '<div>' +
|
||||
'<span class="label">' + escape(label) + '</span>' +
|
||||
(caption ? '<span class="caption">' + escape(caption) + '</span>' : '') +
|
||||
'</div>';
|
||||
}
|
||||
},
|
||||
createFilter: function(input: string) {
|
||||
var regexpA = new RegExp('^' + REGEX_EMAIL + '$', 'i');
|
||||
var regexpB = new RegExp('^([^<]*)\<' + REGEX_EMAIL + '\>$', 'i');
|
||||
return regexpA.test(input) || regexpB.test(input);
|
||||
},
|
||||
create: function(input: string): any {
|
||||
if ((new RegExp('^' + REGEX_EMAIL + '$', 'i')).test(input)) {
|
||||
return {email: input};
|
||||
}
|
||||
var match = input.match(new RegExp('^([^<]*)\<' + REGEX_EMAIL + '\>$', 'i'));
|
||||
if (match) {
|
||||
var name = $.trim(match[1]);
|
||||
var pos_space = name.indexOf(' ');
|
||||
var first_name = name.substring(0, pos_space);
|
||||
var last_name = name.substring(pos_space + 1);
|
||||
return {
|
||||
email: match[2],
|
||||
first_name: first_name,
|
||||
last_name: last_name
|
||||
};
|
||||
}
|
||||
alert('Invalid email address.');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Create filter example
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
$('#select-words-regex').selectize({
|
||||
create: true,
|
||||
createFilter: $('#regex').val()
|
||||
});
|
||||
$('#select-words-length').selectize({
|
||||
create: true,
|
||||
createFilter: function(input: string) { return input.length >= parseInt($('#length').val(), 10); }
|
||||
});
|
||||
var unique: Selectize.IApi<string, string> = $('#select-words-unique').selectize({
|
||||
create: true,
|
||||
createFilter: function(input: string) {
|
||||
input = input.toLowerCase();
|
||||
return $.grep(<string[]> unique.getValue(), function(value) {
|
||||
return value.toLowerCase() === input;
|
||||
}).length == 0;
|
||||
}
|
||||
})[0].selectize;
|
||||
|
||||
|
||||
// Customization example
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
interface Link {
|
||||
title: string;
|
||||
url: string;
|
||||
}
|
||||
|
||||
$('#select-links').selectize({
|
||||
theme: 'links',
|
||||
maxItems: null,
|
||||
valueField: 'id',
|
||||
searchField: 'title',
|
||||
options: [
|
||||
{id: 1, title: 'DIY', url: 'https://diy.org'},
|
||||
{id: 2, title: 'Google', url: 'http://google.com'},
|
||||
{id: 3, title: 'Yahoo', url: 'http://yahoo.com'},
|
||||
],
|
||||
render: {
|
||||
option: function(data: Link, escape: (input: any) => string) {
|
||||
return '<div class="option">' +
|
||||
'<span class="title">' + escape(data.title) + '</span>' +
|
||||
'<span class="url">' + escape(data.url) + '</span>' +
|
||||
'</div>';
|
||||
},
|
||||
item: function(data: Link, escape: (input: any) => string) {
|
||||
return '<div class="item"><a href="' + escape(data.url) + '">' + escape(data.title) + '</a></div>';
|
||||
}
|
||||
},
|
||||
create: function(input: string) {
|
||||
return {
|
||||
id: 0,
|
||||
title: input,
|
||||
url: '#'
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Events
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
var eventHandler = function(name: string) {
|
||||
return function() {
|
||||
console.log(name, arguments);
|
||||
$('#log').append('<div><span class="name">' + name + '</span></div>');
|
||||
};
|
||||
};
|
||||
var $select = $('#select-state').selectize({
|
||||
create : true,
|
||||
onChange : eventHandler('onChange'),
|
||||
onItemAdd : eventHandler('onItemAdd'),
|
||||
onItemRemove : eventHandler('onItemRemove'),
|
||||
onOptionAdd : eventHandler('onOptionAdd'),
|
||||
onOptionRemove : eventHandler('onOptionRemove'),
|
||||
onDropdownOpen : eventHandler('onDropdownOpen'),
|
||||
onDropdownClose : eventHandler('onDropdownClose'),
|
||||
onInitialize : eventHandler('onInitialize'),
|
||||
});
|
||||
|
||||
|
||||
// Github example
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
interface Repository {
|
||||
fork: string;
|
||||
name: string;
|
||||
description: string;
|
||||
language: string;
|
||||
watchers: number;
|
||||
forks: string;
|
||||
username: string;
|
||||
}
|
||||
|
||||
$('#select-repo').selectize({
|
||||
valueField: 'url',
|
||||
labelField: 'name',
|
||||
searchField: 'name',
|
||||
options: [],
|
||||
create: false,
|
||||
render: {
|
||||
option: function(item: Repository, escape: (input: any) => string) {
|
||||
return '<div>' +
|
||||
'<span class="title">' +
|
||||
'<span class="name"><i class="icon ' + (item.fork ? 'fork' : 'source') + '"></i>' + escape(item.name) + '</span>' +
|
||||
'<span class="by">' + escape(item.username) + '</span>' +
|
||||
'</span>' +
|
||||
'<span class="description">' + escape(item.description) + '</span>' +
|
||||
'<ul class="meta">' +
|
||||
(item.language ? '<li class="language">' + escape(item.language) + '</li>' : '') +
|
||||
'<li class="watchers"><span>' + escape(item.watchers) + '</span> watchers</li>' +
|
||||
'<li class="forks"><span>' + escape(item.forks) + '</span> forks</li>' +
|
||||
'</ul>' +
|
||||
'</div>';
|
||||
}
|
||||
},
|
||||
score: function(search) {
|
||||
var score = this.getScoreFunction(search);
|
||||
return function(item: Repository) {
|
||||
return score(item) * (1 + Math.min(item.watchers / 100, 1));
|
||||
};
|
||||
},
|
||||
load: function(query, callback) {
|
||||
if (!query.length) return callback();
|
||||
$.ajax({
|
||||
url: 'https://api.github.com/legacy/repos/search/' + encodeURIComponent(query),
|
||||
type: 'GET',
|
||||
error: function() {
|
||||
callback();
|
||||
},
|
||||
success: function(res) {
|
||||
callback(res.repositories.slice(0, 10));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Lock example
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
$('select').selectize({create: true});
|
||||
$('#select-locked-empty')[0].selectize.lock();
|
||||
$('#select-locked-single')[0].selectize.lock();
|
||||
$('#select-locked')[0].selectize.lock();
|
||||
|
||||
|
||||
// Movies example
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
$('#select-movie').selectize({
|
||||
valueField: 'title',
|
||||
labelField: 'title',
|
||||
searchField: 'title',
|
||||
options: [],
|
||||
create: false,
|
||||
render: {
|
||||
option: function(item, escape) {
|
||||
var actors: any[] = [];
|
||||
for (var i = 0, n = item.abridged_cast.length; i < n; i++) {
|
||||
actors.push('<span>' + escape(item.abridged_cast[i].name) + '</span>');
|
||||
}
|
||||
return '<div>' +
|
||||
'<img src="' + escape(item.posters.thumbnail) + '" alt="">' +
|
||||
'<span class="title">' +
|
||||
'<span class="name">' + escape(item.title) + '</span>' +
|
||||
'</span>' +
|
||||
'<span class="description">' + escape(item.synopsis || 'No synopsis available at this time.') + '</span>' +
|
||||
'<span class="actors">' + (actors.length ? 'Starring ' + actors.join(', ') : 'Actors unavailable') + '</span>' +
|
||||
'</div>';
|
||||
}
|
||||
},
|
||||
load: function(query, callback) {
|
||||
if (!query.length) return callback();
|
||||
$.ajax({
|
||||
url: 'http://api.rottentomatoes.com/api/public/v1.0/movies.json',
|
||||
type: 'GET',
|
||||
dataType: 'jsonp',
|
||||
data: {
|
||||
q: query,
|
||||
page_limit: 10,
|
||||
apikey: '3qqmdwbuswut94jv4eua3j85'
|
||||
},
|
||||
error: function() {
|
||||
callback();
|
||||
},
|
||||
success: function(res) {
|
||||
console.log(res.movies);
|
||||
callback(res.movies);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Optgroups
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
$("#select-car").selectize({
|
||||
options: [
|
||||
{id: 'avenger', make: 'dodge', model: 'Avenger'},
|
||||
{id: 'caliber', make: 'dodge', model: 'Caliber'},
|
||||
{id: 'caravan-grand-passenger', make: 'dodge', model: 'Caravan Grand Passenger'},
|
||||
{id: 'challenger', make: 'dodge', model: 'Challenger'},
|
||||
{id: 'ram-1500', make: 'dodge', model: 'Ram 1500'},
|
||||
{id: 'viper', make: 'dodge', model: 'Viper'},
|
||||
{id: 'a3', make: 'audi', model: 'A3'},
|
||||
{id: 'a6', make: 'audi', model: 'A6'},
|
||||
{id: 'r8', make: 'audi', model: 'R8'},
|
||||
{id: 'rs-4', make: 'audi', model: 'RS 4'},
|
||||
{id: 's4', make: 'audi', model: 'S4'},
|
||||
{id: 's8', make: 'audi', model: 'S8'},
|
||||
{id: 'tt', make: 'audi', model: 'TT'},
|
||||
{id: 'avalanche', make: 'chevrolet', model: 'Avalanche'},
|
||||
{id: 'aveo', make: 'chevrolet', model: 'Aveo'},
|
||||
{id: 'cobalt', make: 'chevrolet', model: 'Cobalt'},
|
||||
{id: 'silverado', make: 'chevrolet', model: 'Silverado'},
|
||||
{id: 'suburban', make: 'chevrolet', model: 'Suburban'},
|
||||
{id: 'tahoe', make: 'chevrolet', model: 'Tahoe'},
|
||||
{id: 'trail-blazer', make: 'chevrolet', model: 'TrailBlazer'},
|
||||
],
|
||||
optgroups: [
|
||||
{id: 'dodge', name: 'Dodge'},
|
||||
{id: 'audi', name: 'Audi'},
|
||||
{id: 'chevrolet', name: 'Chevrolet'}
|
||||
],
|
||||
labelField: 'model',
|
||||
valueField: 'id',
|
||||
optgroupField: 'make',
|
||||
optgroupLabelField: 'name',
|
||||
optgroupValueField: 'id',
|
||||
optgroupOrder: ['chevrolet', 'dodge', 'audi'],
|
||||
searchField: ['model'],
|
||||
plugins: ['optgroup_columns'],
|
||||
openOnFocus: false
|
||||
});
|
||||
|
||||
Vendored
+598
@@ -0,0 +1,598 @@
|
||||
// Type definitions for Selectize 0.11.2
|
||||
// Project: https://github.com/brianreavis/selectize.js
|
||||
// Definitions by: Adi Dahiya <https://github.com/adidahiya>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../jquery/jquery.d.ts"/>
|
||||
|
||||
declare module Selectize {
|
||||
// see https://github.com/brianreavis/selectize.js/blob/master/docs/usage.md
|
||||
// option identifiers are parameterized by T; data is parameterized by U
|
||||
interface IOptions<T, U> {
|
||||
|
||||
// General
|
||||
// ------------------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* The string to separate items by. This option is only used when Selectize is instantiated from a
|
||||
* <input type="text"> element.
|
||||
*
|
||||
* Default: ','
|
||||
*/
|
||||
delimiter?: string;
|
||||
|
||||
/**
|
||||
* Enable or disable international character support.
|
||||
*
|
||||
* Default: true
|
||||
*/
|
||||
diacritics?: boolean;
|
||||
|
||||
/**
|
||||
* Allows the user to create a new items that aren't in the list of options.
|
||||
* This option can be any of the following: "true", "false" (disabled), or a function that accepts two
|
||||
* arguments: "input" and "callback". The callback should be invoked with the final data for the option.
|
||||
*
|
||||
* Default: false
|
||||
*/
|
||||
create?: any;
|
||||
|
||||
/**
|
||||
* If true, when user exits the field (clicks outside of input or presses ESC) new option is created and
|
||||
* selected (if `create`-option is enabled).
|
||||
*
|
||||
* Default: false
|
||||
*/
|
||||
createOnBlur?: boolean;
|
||||
|
||||
/**
|
||||
* Specifies a RegExp or String containing a regular expression that the current search filter must match to
|
||||
* be allowed to be created. May also be a predicate function that takes the filter text and returns whether
|
||||
* it is allowed.
|
||||
*
|
||||
* Default: null
|
||||
*/
|
||||
createFilter?: any;
|
||||
|
||||
/**
|
||||
* Toggles match highlighting within the dropdown menu.
|
||||
*
|
||||
* Default: true
|
||||
*/
|
||||
highlight?: boolean;
|
||||
|
||||
/**
|
||||
* If false, items created by the user will not show up as available options once they are unselected.
|
||||
*
|
||||
* Default: true
|
||||
*/
|
||||
persist?: boolean;
|
||||
|
||||
/**
|
||||
* Show the dropdown immediately when the control receives focus.
|
||||
*
|
||||
* Default: true
|
||||
*/
|
||||
openOnFocus?: boolean;
|
||||
|
||||
/**
|
||||
* The max number of items to render at once in the dropdown list of options.
|
||||
*
|
||||
* Default: 1000
|
||||
*/
|
||||
maxOptions?: number;
|
||||
|
||||
/**
|
||||
* The max number of items the user can select.
|
||||
*
|
||||
* Default: Infinity
|
||||
*/
|
||||
maxItems?: number;
|
||||
|
||||
/**
|
||||
* If true, the items that are currently selected will not be shown in the dropdown list of available options.
|
||||
*
|
||||
* Default: false
|
||||
*/
|
||||
hideSelected?: boolean;
|
||||
|
||||
/**
|
||||
* If true, Selectize will treat any options with a "" value like normal. This defaults to false to
|
||||
* accomodate the common <select> practice of having the first empty option act as a placeholder.
|
||||
*
|
||||
* Default: false
|
||||
*/
|
||||
allowEmptyOption?: boolean;
|
||||
|
||||
/**
|
||||
* The animation duration (in milliseconds) of the scroll animation triggered when going [up] and [down] in
|
||||
* the options dropdown.
|
||||
*
|
||||
* Default: 60
|
||||
*/
|
||||
scrollDuration?: number;
|
||||
|
||||
/**
|
||||
* The number of milliseconds to wait before requesting options from the server or null.
|
||||
* If null, throttling is disabled.
|
||||
*
|
||||
* Default: 300
|
||||
*/
|
||||
loadThrottle?: number;
|
||||
|
||||
/**
|
||||
* If true, the "load" function will be called upon control initialization (with an empty search).
|
||||
* Alternatively it can be set to "focus" to call the "load" function when control receives focus.
|
||||
*
|
||||
* Default: false
|
||||
*/
|
||||
preload?: any;
|
||||
|
||||
/**
|
||||
* The element the dropdown menu is appended to. This should be "body" or null.
|
||||
* If null, the dropdown will be appended as a child of the selectize control.
|
||||
*
|
||||
* Default: null
|
||||
*/
|
||||
dropdownParent?: string;
|
||||
|
||||
/**
|
||||
* Sets if the "Add..." option should be the default selection in the dropdown.
|
||||
*
|
||||
* Default: false
|
||||
*/
|
||||
addPrecedence?: boolean;
|
||||
|
||||
/**
|
||||
* If true, the tab key will choose the currently selected item.
|
||||
*
|
||||
* Default: false
|
||||
*/
|
||||
selectOnTab?: boolean;
|
||||
|
||||
// Data / Searching
|
||||
// ------------------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Options available to select; array of objects. If your element is <select> with <option>s specified this
|
||||
* property gets populated accordingly. Setting this property is convenient if you have your data as an
|
||||
* array and want to automatically generate the <option>s.
|
||||
*
|
||||
* Default: []
|
||||
*/
|
||||
options?: U[];
|
||||
|
||||
/**
|
||||
* The <option> attribute from which to read JSON data about the option.
|
||||
*
|
||||
* Default: "data-data"
|
||||
*/
|
||||
dataAttr?: string;
|
||||
|
||||
/**
|
||||
* The name of the property to use as the "value" when an item is selected.
|
||||
*
|
||||
* Default: "value"
|
||||
*/
|
||||
valueField?: string;
|
||||
|
||||
/**
|
||||
* The name of the option group property that serves as its unique identifier.
|
||||
*
|
||||
* Default: "value"
|
||||
*/
|
||||
optgroupValueField?: string;
|
||||
|
||||
/**
|
||||
* The name of the property to render as an option / item label (not needed when custom rendering
|
||||
* functions are defined).
|
||||
*
|
||||
* Default: "text"
|
||||
*/
|
||||
labelField?: string;
|
||||
|
||||
/**
|
||||
* The name of the property to render as an option group label (not needed when custom rendering
|
||||
* functions are defined).
|
||||
*
|
||||
* Default: "label"
|
||||
*/
|
||||
optgroupLabelField?: string;
|
||||
|
||||
/**
|
||||
* The name of the property to group items by.
|
||||
*
|
||||
* Default: "optgroup"
|
||||
*/
|
||||
optgroupField?: string;
|
||||
|
||||
/**
|
||||
* A single field or an array of fields to sort by. Each item in the array should be an object containing at
|
||||
* least a "field" property. Optionally, "direction" can be set to "asc" or "desc". The order of the array
|
||||
* defines the sort precedence.
|
||||
*
|
||||
* Unless present, a special "$score" field will be automatically added to the beginning of the sort list.
|
||||
* This will make results sorted primarily by match quality (descending).
|
||||
*
|
||||
* Default: "$order"
|
||||
*/
|
||||
sortField?: any;
|
||||
|
||||
/**
|
||||
* An array of property names to analyze when filtering options.
|
||||
*
|
||||
* Default: ["text"]
|
||||
*/
|
||||
searchField?: any;
|
||||
|
||||
/**
|
||||
* When searching for multiple terms (separated by a space), this is the operator used. Can be "and" or "or".
|
||||
*
|
||||
* Default: "and"
|
||||
*/
|
||||
searchConjunction?: string;
|
||||
|
||||
/**
|
||||
* An array of optgroup values that indicates the order they should be listed in in the dropdown.
|
||||
* If not provided, groups will be ordered by the ranking of the options within them.
|
||||
*
|
||||
* Default: null
|
||||
*/
|
||||
optgroupOrder?: string[];
|
||||
|
||||
/**
|
||||
* Copy the original input classes to the Dropdown element.
|
||||
*
|
||||
* Default: true
|
||||
*/
|
||||
copyClassesToDropdown?: boolean;
|
||||
|
||||
// Callbacks
|
||||
// ------------------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Invoked when new options should be loaded from the server.
|
||||
*/
|
||||
load?(query: string, callback: Function): any;
|
||||
|
||||
/**
|
||||
* Overrides the scoring function used to sort available options. The provided function should return a
|
||||
* function that returns a number greater than or equal to zero to represent the "score" of an item
|
||||
* (the function's first argument). If 0, the option is declared not a match.
|
||||
*/
|
||||
score?(search: ISearch): (item: any) => number;
|
||||
|
||||
/**
|
||||
* Invoked once the control is completely initialized.
|
||||
*/
|
||||
onInitialize?(): any;
|
||||
|
||||
/**
|
||||
* Invoked when the value of the control changes.
|
||||
*
|
||||
* If single select, value is of type T.
|
||||
* If multi select, value is of type T[].
|
||||
*/
|
||||
onChange?(value: any): any;
|
||||
|
||||
/**
|
||||
* Invoked when an item is selected.
|
||||
*/
|
||||
onItemAdd?(value: T, item: JQuery): any;
|
||||
|
||||
/**
|
||||
* Invoked when an item is deselected.
|
||||
*/
|
||||
onItemRemove?(value: T): any;
|
||||
|
||||
/**
|
||||
* Invoked when the control is manually cleared via the clear() method.
|
||||
*/
|
||||
onClear?(): any;
|
||||
|
||||
/**
|
||||
* Invoked when the user attempts to delete the current selection.
|
||||
*/
|
||||
onDelete?(values: T[]): any;
|
||||
|
||||
/**
|
||||
* Invoked when a new option is added to the available options list.
|
||||
*/
|
||||
onOptionAdd?(value: T, data: U): any;
|
||||
|
||||
/**
|
||||
* Invoked when an option is removed from the available options.
|
||||
*/
|
||||
onOptionRemove?(value: T): any;
|
||||
|
||||
/**
|
||||
* Invoked when the dropdown opens.
|
||||
*/
|
||||
onDropdownOpen?(dropdown: JQuery): any;
|
||||
|
||||
/**
|
||||
* Invoked when the dropdown closes.
|
||||
*/
|
||||
onDropdownClose?(dropdown: JQuery): any;
|
||||
|
||||
/**
|
||||
* Invoked when the user types while filtering options.
|
||||
*/
|
||||
onType?(srt: string): any;
|
||||
|
||||
/**
|
||||
* Invoked when new options have been loaded and added to the control (via the "load" option or "load" API method).
|
||||
*/
|
||||
onLoad?(data: U[]): any;
|
||||
|
||||
// Rendering
|
||||
// ------------------------------------------------------------------------------------------------------------
|
||||
|
||||
render?: ICustomRenderers<U>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom rendering functions. Each function should accept two arguments: "data" and "escape" and return
|
||||
* HTML (string) with a single root element. The "escape" argument is a function that takes a string and
|
||||
* escapes all special HTML characters. This is very important to use to prevent XSS vulnerabilities.
|
||||
*/
|
||||
interface ICustomRenderers<U> {
|
||||
// An option in the dropdown list of available options.
|
||||
option?(data: U, escape: (input: string) => string): string;
|
||||
|
||||
// An item the user has selected.
|
||||
item?(data: U, escape: (input: string) => string): string;
|
||||
|
||||
// The "create new" option at the bottom of the dropdown. The data contains one property: "input"
|
||||
// (which is what the user has typed).
|
||||
option_create?(data: U, escape: (input: string) => string): string;
|
||||
|
||||
// The header of an option group.
|
||||
optgroup_header?(data: U, escape: (input: string) => string): string;
|
||||
|
||||
// The wrapper for an optgroup. The "html" property in the data will be the raw html of the optgroup's header
|
||||
// and options.
|
||||
optgroup?(data: U, escape: (input: string) => string): string;
|
||||
}
|
||||
|
||||
// see https://github.com/brianreavis/selectize.js/blob/master/docs/api.md
|
||||
interface IApi<T, U> {
|
||||
|
||||
// Dropdown Options
|
||||
// ------------------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Adds an available option. If it already exists, nothing will happen.
|
||||
* Note: this does not refresh the options list dropdown (use refreshOptions() for that).
|
||||
*/
|
||||
addOption(data: U): void;
|
||||
|
||||
/**
|
||||
* Updates an option available for selection. If it is visible in the selected items or options dropdown,
|
||||
* it will be re-rendered automatically.
|
||||
*/
|
||||
updateOption(value: T, data: U): void;
|
||||
|
||||
/**
|
||||
* Removes the option identified by the given value.
|
||||
*/
|
||||
removeOption(value: T): void;
|
||||
|
||||
/**
|
||||
* Removes all options from the control.
|
||||
*/
|
||||
clearOptions(): void;
|
||||
|
||||
/**
|
||||
* Retrieves the jQuery element for the option identified by the given value.
|
||||
*/
|
||||
getOption(value: T): any;
|
||||
|
||||
/**
|
||||
* Retrieves the jQuery element for the previous or next option, relative to the currently highlighted option.
|
||||
* The "direction" argument should be 1 for "next" or -1 for "previous".
|
||||
*/
|
||||
getAdjacentOption(value: T, direction: number): void;
|
||||
|
||||
/**
|
||||
* Refreshes the list of available options shown in the autocomplete dropdown menu.
|
||||
*/
|
||||
refreshOptions(triggerDropdown: boolean): void;
|
||||
|
||||
// Selected Items
|
||||
// ------------------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Resets / clears all selected items from the control.
|
||||
*/
|
||||
clear(): void;
|
||||
|
||||
/**
|
||||
* Returns the jQuery element of the item matching the given value.
|
||||
*/
|
||||
getItem(value: T): JQuery;
|
||||
|
||||
/**
|
||||
* "Selects" an item. Adds it to the list at the current caret position.
|
||||
*/
|
||||
addItem(value: T): void;
|
||||
|
||||
/**
|
||||
* Removes the selected item matching the provided value.
|
||||
*/
|
||||
removeItem(value: T): void;
|
||||
|
||||
/**
|
||||
* Invokes the "create" method provided in the selectize options that should provide the data for the
|
||||
* new item, given the user input. Once this completes, it will be added to the item list.
|
||||
*/
|
||||
createItem(value: T): void;
|
||||
|
||||
/**
|
||||
* Re-renders the selected item lists.
|
||||
*/
|
||||
refreshItems(): void;
|
||||
|
||||
// Optgroups
|
||||
// ------------------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Registers a new optgroup for options to be bucketed into.
|
||||
* The "id" argument refers to a value of the property in option identified by the "optgroupField" setting.
|
||||
*/
|
||||
addOptionGroup(id: string, data: U): void;
|
||||
|
||||
// Events
|
||||
// ------------------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Adds an event listener.
|
||||
*/
|
||||
on(eventName: string, handler: Function): void;
|
||||
|
||||
/**
|
||||
* Removes an event listener. If no handler is provided, all event listeners are removed.
|
||||
*/
|
||||
off(eventName: string, handler?: Function): void;
|
||||
|
||||
/**
|
||||
* Triggers event listeners.
|
||||
*/
|
||||
trigger(eventName: string, ...args: any[]): void;
|
||||
|
||||
// Dropdown Actions
|
||||
// ------------------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Shows the autocomplete dropdown containing the available options.
|
||||
*/
|
||||
open(): void;
|
||||
|
||||
/**
|
||||
* Closes the autocomplete dropdown menu.
|
||||
*/
|
||||
close(): void;
|
||||
|
||||
/**
|
||||
* Calculates and applies the appropriate position of the dropdown.
|
||||
*/
|
||||
positionDropdown(): void;
|
||||
|
||||
// Other
|
||||
// ------------------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Destroys the control and unbinds event listeners so that it can be garbage collected.
|
||||
*/
|
||||
destroy(): void;
|
||||
|
||||
/**
|
||||
* Loads options by invoking the the provided function. The function should accept one argument (callback)
|
||||
* and invoke the callback with the results once they are available.
|
||||
*/
|
||||
load(callback: (results: any) => any): void;
|
||||
|
||||
/**
|
||||
* Brings the control into focus.
|
||||
*/
|
||||
focus(): void;
|
||||
|
||||
/**
|
||||
* Forces the control out of focus.
|
||||
*/
|
||||
blur(): void;
|
||||
|
||||
/**
|
||||
* Disables user input on the control (note: the control can still receive focus).
|
||||
*/
|
||||
lock(): void;
|
||||
|
||||
/**
|
||||
* Re-enables user input on the control.
|
||||
*/
|
||||
unlock(): void;
|
||||
|
||||
/**
|
||||
* Disables user input on the control completely. While disabled, it cannot receive focus.
|
||||
*/
|
||||
disable(): void;
|
||||
|
||||
/**
|
||||
* Enables the control so that it can respond to focus and user input.
|
||||
*/
|
||||
enable(): void;
|
||||
|
||||
/**
|
||||
* Returns the value of the control. If multiple items can be selected (e.g. <select multiple>), this
|
||||
* returns an array. If only one item can be selected, this returns a string.
|
||||
*/
|
||||
getValue(): any;
|
||||
|
||||
/**
|
||||
* Resets the selected items to the given value(s).
|
||||
*/
|
||||
setValue(value: T): void;
|
||||
setValue(value: T[]): void;
|
||||
|
||||
/**
|
||||
* Moves the caret to the specified position ("index" being the index in the list of selected items).
|
||||
*/
|
||||
setCaret(index: number): void;
|
||||
|
||||
/**
|
||||
* Returns whether or not the user can select more items.
|
||||
*/
|
||||
isFull(): boolean;
|
||||
|
||||
/**
|
||||
* Clears the render cache. Takes an optional template argument (e.g. "option", "item") to clear only that cache.
|
||||
*/
|
||||
clearCache(template?: string): void;
|
||||
}
|
||||
|
||||
interface ISearchToken {
|
||||
regex: RegExp;
|
||||
string: string;
|
||||
}
|
||||
|
||||
interface ISearchResult {
|
||||
id: string;
|
||||
score: number;
|
||||
}
|
||||
|
||||
interface ISearch {
|
||||
/**
|
||||
* Original search options.
|
||||
*/
|
||||
options: any;
|
||||
|
||||
/**
|
||||
* The raw user input
|
||||
*/
|
||||
query: string;
|
||||
|
||||
/**
|
||||
* An array containing parsed search tokens. A token is an object containing two properties: "string" and "regex".
|
||||
*/
|
||||
tokens: ISearchToken[];
|
||||
|
||||
/**
|
||||
* The total number of results.
|
||||
*/
|
||||
total: number;
|
||||
|
||||
/**
|
||||
* A list of matched results. Each result is an object containing two properties: "score" and "id".
|
||||
*/
|
||||
items: ISearchResult[];
|
||||
}
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
selectize(options?: Selectize.IOptions<any, any>): JQuery;
|
||||
}
|
||||
|
||||
interface HTMLElement {
|
||||
selectize: Selectize.IApi<any, any>;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
///<reference path="SharedWorker.d.ts" />
|
||||
|
||||
var worker_with_name = new SharedWorker('worker.js', "worker");
|
||||
|
||||
var worker = new SharedWorker('worker.js');
|
||||
|
||||
worker.port.onmessage = function(e) {
|
||||
console.log(e);
|
||||
};
|
||||
Vendored
+29
@@ -0,0 +1,29 @@
|
||||
// Type definitions for SharedWorker
|
||||
// Project: http://www.w3.org/TR/workers/
|
||||
// Definitions by: Toshiya Nakakura <https://github.com/nakakura>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module SharedWorker {
|
||||
interface AbstractWorker extends EventTarget {
|
||||
onerror: (ev: ErrorEvent) => any;
|
||||
}
|
||||
|
||||
export interface SharedWorker extends AbstractWorker {
|
||||
/**
|
||||
* the value it was assigned by the object's constructor.
|
||||
* It represents the MessagePort for communicating with the shared worker.
|
||||
* @type {MessagePort}
|
||||
*/
|
||||
port: MessagePort;
|
||||
}
|
||||
}
|
||||
|
||||
declare var SharedWorker: {
|
||||
prototype: SharedWorker.SharedWorker;
|
||||
/***
|
||||
*
|
||||
* @param {string} stringUrl Pathname to JavaScript file
|
||||
* @param {string} name Name of the worker to execute
|
||||
*/
|
||||
new (stringUrl: string, name?: string): SharedWorker.SharedWorker;
|
||||
};
|
||||
Vendored
+12
@@ -31,6 +31,10 @@ declare module SigmaJs{
|
||||
(key: string): string;
|
||||
}
|
||||
|
||||
interface CustomShapes {
|
||||
init(sigma: Sigma): void;
|
||||
}
|
||||
|
||||
interface DragNodes {
|
||||
(sigma: Sigma, renderer: Renderer): DragNodes;
|
||||
}
|
||||
@@ -78,8 +82,10 @@ declare module SigmaJs{
|
||||
interface Node {
|
||||
color?: string;
|
||||
id: string;
|
||||
image?: any;
|
||||
label?: string;
|
||||
size?: number;
|
||||
type?: string;
|
||||
x?: number;
|
||||
y?: number;
|
||||
}
|
||||
@@ -107,6 +113,10 @@ declare module SigmaJs{
|
||||
type?: string;
|
||||
}
|
||||
|
||||
interface ShapeLibrary {
|
||||
enumerate(): any;
|
||||
}
|
||||
|
||||
interface Sigma {
|
||||
addRenderer(): Renderer;
|
||||
addRenderer(configs: RendererConfigs): Renderer;
|
||||
@@ -253,3 +263,5 @@ declare module SigmaJs{
|
||||
}
|
||||
|
||||
declare var sigma: SigmaJs.SigmaFactory;
|
||||
declare var CustomShapes: SigmaJs.CustomShapes;
|
||||
declare var ShapeLibrary: SigmaJs.CustomShapes;
|
||||
|
||||
+2
-1
@@ -23,10 +23,11 @@ declare module SocketIOClient {
|
||||
interface Socket {
|
||||
on(event: string, fn: Function): Socket;
|
||||
once(event: string, fn: Function): Socket;
|
||||
off(event: string, fn: Function): Socket;
|
||||
off(event?: string, fn?: Function): Socket;
|
||||
emit(event: string, ...args: any[]): Socket;
|
||||
listeners(event: string): Function[];
|
||||
hasListeners(event: string): boolean;
|
||||
connected: boolean;
|
||||
}
|
||||
|
||||
interface ManagerStatic {
|
||||
|
||||
Vendored
+4
-4
@@ -27,10 +27,10 @@ declare module SocketIO {
|
||||
adapter(v: any): Server;
|
||||
origins(v: string): Server;
|
||||
sockets: Namespace;
|
||||
attach(srv: any, opts: any): Server;
|
||||
attach(port: number, opts: any): Server;
|
||||
listen(srv: any, opts: any): Server;
|
||||
listen(port: number, opts: any): Server;
|
||||
attach(srv: any, opts?: any): Server;
|
||||
attach(port: number, opts?: any): Server;
|
||||
listen(srv: any, opts?: any): Server;
|
||||
listen(port: number, opts?: any): Server;
|
||||
bind(srv: any): Server;
|
||||
onconnection(socket: any): Server;
|
||||
of(nsp: string): Namespace;
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
|
||||
/// <reference path="tedious.d.ts" />
|
||||
|
||||
"use strict";
|
||||
|
||||
import tedious = require("tedious");
|
||||
|
||||
var config: tedious.ConnectionConfig = {
|
||||
userName: "rogier",
|
||||
password: "rogiers password",
|
||||
server: "127.0.0.1",
|
||||
options: {
|
||||
database: "somedb",
|
||||
instance: "someinstance"
|
||||
}
|
||||
}
|
||||
|
||||
var connection = new tedious.Connection(config);
|
||||
connection.on("connect", (): void => {
|
||||
console.log("hurray");
|
||||
});
|
||||
|
||||
connection.beginTransaction((error: Error): void => {}, "some name");
|
||||
connection.rollbackTransaction((error: Error): void => {});
|
||||
connection.commitTransaction((error: Error): void => {});
|
||||
|
||||
|
||||
var request = new tedious.Request("SELECT * FROM foo", (error: Error, rowCount: number): void => {
|
||||
});
|
||||
request.on("row", (row: tedious.ColumnValue[]): void => {
|
||||
});
|
||||
connection.execSql(request);
|
||||
|
||||
|
||||
Vendored
+526
@@ -0,0 +1,526 @@
|
||||
// Type definitions for tedious 1.8.0
|
||||
// Project: https://pekim.github.io/tedious
|
||||
// Definitions by: Rogier Schouten <https://github.com/rogierschouten>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
///<reference path='../node/node.d.ts' />
|
||||
|
||||
declare module 'tedious' {
|
||||
|
||||
import events = require("events");
|
||||
|
||||
export interface ColumnType {
|
||||
/**
|
||||
* The column's type, such as VarChar, Int or Binary.
|
||||
*/
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface ColumnMetaData {
|
||||
/**
|
||||
* The column's name
|
||||
*/
|
||||
colName: string;
|
||||
|
||||
/**
|
||||
* The column type.
|
||||
*/
|
||||
type: ColumnType;
|
||||
|
||||
/**
|
||||
* The precision. Only applicable to numeric and decimal.
|
||||
*/
|
||||
precision?: number;
|
||||
|
||||
/**
|
||||
* The scale. Only applicable to numeric, decimal, time, datetime2 and datetimeoffset.
|
||||
*/
|
||||
scale?: number;
|
||||
|
||||
/**
|
||||
* The length, for char, varchar, nvarchar and varbinary.
|
||||
*/
|
||||
dataLength?: number;
|
||||
}
|
||||
|
||||
export interface DebugOptions {
|
||||
/**
|
||||
* A boolean, controlling whether debug events will be emitted with text describing packet details (default: false).
|
||||
*/
|
||||
packet?: boolean;
|
||||
|
||||
/**
|
||||
* A boolean, controlling whether debug events will be emitted with text describing packet data details (default: false).
|
||||
*/
|
||||
data?: boolean;
|
||||
|
||||
/**
|
||||
* A boolean, controlling whether debug events will be emitted with text describing packet payload details (default: false).
|
||||
*/
|
||||
payload?: boolean;
|
||||
|
||||
/**
|
||||
* A boolean, controlling whether debug events will be emitted with text describing token stream tokens (default: false).
|
||||
*/
|
||||
token?: boolean;
|
||||
}
|
||||
|
||||
export enum ISOLATION_LEVEL {
|
||||
NO_CHANGE = 0x00,
|
||||
READ_UNCOMMITTED = 0x01,
|
||||
READ_COMMITTED = 0x02,
|
||||
REPEATABLE_READ = 0x03,
|
||||
SERIALIZABLE = 0x04,
|
||||
SNAPSHOT = 0x05
|
||||
}
|
||||
|
||||
/**
|
||||
* Unfortunately these aren't valid JavaScript identifiers
|
||||
* so I cannot list the values here as enum values
|
||||
7_1 = 0x71000001,
|
||||
7_2 = 0x72090002,
|
||||
7_3_A = 0x730A0003,
|
||||
7_3_B = 0x730B0003,
|
||||
7_4 = 0x74000004
|
||||
*/
|
||||
export var TDS_VERSION: { [index: string]: number };
|
||||
|
||||
export interface TediousType {
|
||||
type: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface TediousTypes {
|
||||
BigInt: TediousType;
|
||||
Binary: TediousType;
|
||||
Bit: TediousType;
|
||||
BitN: TediousType;
|
||||
Char: TediousType;
|
||||
DateN: TediousType;
|
||||
DateTime2N: TediousType;
|
||||
DateTime: TediousType;
|
||||
DateTimeN: TediousType;
|
||||
DateTimeOffsetN: TediousType;
|
||||
Decimal: TediousType;
|
||||
DecimalN: TediousType;
|
||||
Float: TediousType;
|
||||
FloatN: TediousType;
|
||||
Image: TediousType;
|
||||
Int: TediousType;
|
||||
IntN: TediousType;
|
||||
Money: TediousType;
|
||||
MoneyN: TediousType;
|
||||
NChar: TediousType;
|
||||
NText: TediousType;
|
||||
NVarChar: TediousType;
|
||||
Null: TediousType;
|
||||
Numeric: TediousType;
|
||||
NumericN: TediousType;
|
||||
Real: TediousType;
|
||||
SmallDateTime: TediousType;
|
||||
SmallInt : TediousType;
|
||||
SmallMoney: TediousType;
|
||||
TVP: TediousType;
|
||||
Text: TediousType;
|
||||
TimeN: TediousType;
|
||||
TinyInt: TediousType;
|
||||
UDT: TediousType;
|
||||
UniqueIdentifierN: TediousType;
|
||||
VarBinary: TediousType;
|
||||
VarChar: TediousType;
|
||||
Xml: TediousType;
|
||||
}
|
||||
|
||||
export var TYPES: TediousTypes;
|
||||
|
||||
export interface ConnectionOptions {
|
||||
|
||||
/**
|
||||
* Port to connect to (default: 1433). Mutually exclusive with options.instanceName.
|
||||
*/
|
||||
port?: number;
|
||||
|
||||
/**
|
||||
* The instance name to connect to. The SQL Server Browser service must be running on the database server,
|
||||
* and UDP port 1444 on the database server must be reachable. (no default) Mutually exclusive with options.port.
|
||||
*/
|
||||
instanceName?: string;
|
||||
|
||||
/**
|
||||
* Database to connect to (default: dependent on server configuration).
|
||||
*/
|
||||
database?: string;
|
||||
|
||||
/**
|
||||
* By default, if the database requestion by options.database cannot be accessed,
|
||||
* the connection will fail with an error. However, if options.fallbackToDefaultDb is set to true,
|
||||
* then the user's default database will be * used instead (Default: false).
|
||||
*/
|
||||
fallbackToDefaultDb?: boolean;
|
||||
|
||||
/**
|
||||
* The number of milliseconds before the attempt to connect is considered failed (default: 15000).
|
||||
*/
|
||||
connectTimeout?: number;
|
||||
|
||||
/**
|
||||
* The number of milliseconds before a request is considered failed, or 0 for no timeout (default: 15000).
|
||||
*/
|
||||
requestTimeout?: number;
|
||||
|
||||
/**
|
||||
* The number of milliseconds before the cancel (abort) of a request is considered failed (default: 5000).
|
||||
*/
|
||||
cancelTimeout?: number;
|
||||
|
||||
/**
|
||||
* The size of TDS packets (subject to negotiation with the server). Should be a power of 2. (default: 4096).
|
||||
*/
|
||||
packetSize?: number;
|
||||
|
||||
/**
|
||||
* A boolean determining whether to pass time values in UTC or local time. (default: true).
|
||||
*/
|
||||
useUTC?: boolean;
|
||||
|
||||
/**
|
||||
* A boolean determining whether to rollback a transaction automatically if any error is encountered
|
||||
* during the given transaction's execution. This sets the value for SET XACT_ABORT during the initial
|
||||
* SQL phase of a connection (documentation).
|
||||
*/
|
||||
abortTransactionOnError?: boolean;
|
||||
|
||||
/**
|
||||
* A string indicating which network interface (ip addres) to use when connecting to SQL Server.
|
||||
*/
|
||||
localAddress?: string;
|
||||
|
||||
/**
|
||||
* A boolean determining whether to return rows as arrays or key-value collections. (default: false).
|
||||
*/
|
||||
useColumnNames?: boolean;
|
||||
|
||||
/**
|
||||
* A boolean, controlling whether the column names returned will have the first letter converted
|
||||
* to lower case (true) or not. This value is ignored if you provide a columnNameReplacer. (default: false).
|
||||
*/
|
||||
camelCaseColumns?: boolean;
|
||||
|
||||
/**
|
||||
* A function with parameters (columnName, index, columnMetaData) and returning a string. If provided,
|
||||
* this will be called once per column per result-set. The returned value will be used instead of the
|
||||
* SQL-provided column name on row and meta data objects. This allows you to dynamically convert between
|
||||
* naming conventions. (default: null).
|
||||
*/
|
||||
columnNameReplacer?: (columnName: string, index: number, columnMetaData: ColumnMetaData) => string;
|
||||
|
||||
/**
|
||||
* Debug options
|
||||
*/
|
||||
debug?: DebugOptions;
|
||||
|
||||
/**
|
||||
* The default isolation level that transactions will be run with. (default: READ_COMMITED).
|
||||
*/
|
||||
isolationLevel?: ISOLATION_LEVEL;
|
||||
|
||||
/**
|
||||
* The default isolation level for new connections. All out-of-transaction queries are executed with this setting. (default: READ_COMMITED)
|
||||
*/
|
||||
connectionIsolationLevel?: ISOLATION_LEVEL;
|
||||
|
||||
/**
|
||||
* A boolean, determining whether the connection will request read only access from a SQL Server Availability Group. For more information, see here. (default: false).
|
||||
*/
|
||||
readOnlyIntent?: boolean;
|
||||
|
||||
/**
|
||||
* A boolean determining whether or not the connection will be encrypted. Set to true if you're on Windows Azure. (default: false).
|
||||
*/
|
||||
encrypt?: boolean;
|
||||
|
||||
/**
|
||||
* When encryption is used, an object may be supplied that will be used for the first argument when calling tls.createSecurePair (default: {}).
|
||||
*/
|
||||
cryptoCredentialsDetails?: Object;
|
||||
|
||||
/**
|
||||
* A boolean, that when true will expose received rows in Requests' done* events. See done, doneInProc and doneProc. (default: false)
|
||||
* Caution: If many row are received, enabling this option could result in excessive memory usage.
|
||||
*/
|
||||
rowCollectionOnDone?: boolean;
|
||||
|
||||
/**
|
||||
* A boolean, that when true will expose received rows in Requests' completion callback. See new Request. (default: false)
|
||||
* Caution: If many row are received, enabling this option could result in excessive memory usage.
|
||||
*/
|
||||
rowCollectionOnRequestCompletion?: boolean;
|
||||
|
||||
/**
|
||||
* The version of TDS to use. If server doesn't support specified version, negotiated version is used instead. (default: 7_4).
|
||||
* Take this from tedious.TDS_VERSION.7_4 .
|
||||
*/
|
||||
tdsVersion?: number;
|
||||
}
|
||||
|
||||
export interface ConnectionConfig {
|
||||
/**
|
||||
* User name to use for authentication.
|
||||
*/
|
||||
userName?: string;
|
||||
|
||||
/**
|
||||
* Password to use for authentication.
|
||||
*/
|
||||
password?: string;
|
||||
|
||||
/**
|
||||
* Hostname to connect to.
|
||||
*/
|
||||
server?: string;
|
||||
|
||||
/**
|
||||
* Once you set domain, driver will connect to SQL Server using domain login.
|
||||
*/
|
||||
domain?: string;
|
||||
|
||||
/**
|
||||
* Further options
|
||||
*/
|
||||
options?: ConnectionOptions;
|
||||
}
|
||||
|
||||
export interface ParameterOptions {
|
||||
// for VarChar, NVarChar, VarBinary
|
||||
length?: number;
|
||||
// precision for Numeric, Decimal
|
||||
precision?: number;
|
||||
// scale for Numeric, Decimal, Time, DateTime2, DateTimeOffset
|
||||
scale?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of each column in the Request#row event
|
||||
*/
|
||||
export interface ColumnValue {
|
||||
metadata: ColumnMetaData;
|
||||
value: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* A Request instance represents a request that can be executed on a connection
|
||||
* @event 'columnMetadata' This event, describing result set columns, will be emitted before row events are emitted. This event may be emited multiple times when more than one recordset is produced by the statement.
|
||||
* @event 'row' A row resulting from execution of the SQL statement
|
||||
* @event 'done' All rows from a result set have been provided (through row events). This token is used to indicate the completion of a SQL statement. As multiple SQL statements can be sent to the server in a single SQL batch, multiple done events can be generated. An done event is emited for each SQL statement in the SQL batch except variable declarations. For execution of SQL statements within stored procedures, doneProc and doneInProc events are used in place of done events.
|
||||
* @event 'doneInProc' Indicates the completion status of a SQL statement within a stored procedure. All rows from a statement in a stored procedure have been provided (through row events).
|
||||
* @event 'doneProc' Indicates the completion status of a stored procedure. This is also generated for stored procedures executed through SQL statements.
|
||||
* @event 'returnValue' A value for an output parameter (that was added to the request with addOutputParameter(...)). See also Using Parameters.
|
||||
*/
|
||||
export class Request extends events.EventEmitter {
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param sql The SQL statement to be executed (or a procedure name, if the request is to be used with connection.callProcedure).
|
||||
* @param callback The callback is called when the request has completed, either successfully or with an error. If an error occurs during execution of the statement(s), then err will describe the error.
|
||||
* As only one request at a time may be executed on a connection, another request should not be initiated until this callback is called.
|
||||
* rowCount: The number of rows emitted as result of executing the SQL statement.
|
||||
* rows: Rows as a result of executing the SQL statement. Will only be avaiable if Connection's config.options.rowCollectionOnRequestCompletion is true.
|
||||
*/
|
||||
constructor(sql: string, callback: (error: Error, rowCount: number, rows: any[]) => void);
|
||||
|
||||
/**
|
||||
* Add an input parameter to the request.
|
||||
* @param name The parameter name. This should correspond to a parameter in the SQL, or a parameter that a called procedure expects. The name should not start '@'.
|
||||
* @param type One of the supported data types.
|
||||
* @param value The value that the parameter is to be given. The Javascript type of the argument should match that documented for data types.
|
||||
* @param options Additional type options. Optional.
|
||||
*/
|
||||
addParameter(name: string, type: TediousType, value: any, options?: ParameterOptions): void;
|
||||
|
||||
/**
|
||||
* Add an output parameter to the request. The parameter's value will be provide by an emitted returnValue event.
|
||||
* @param name The parameter name. This should correspond to a parameter in the SQL, or a parameter that a called procedure expects.
|
||||
* @param type One of the supported data types.
|
||||
* @param value The value that the parameter is to be given. The Javascript type of the argument should match that documented for data types. Optional.
|
||||
* @param options Additional type options. Optional.
|
||||
*/
|
||||
addOutputParameter(name: string, type: TediousType, value?: any, options?: ParameterOptions): void;
|
||||
}
|
||||
|
||||
export interface BulkLoadColumnOpts extends ParameterOptions {
|
||||
// indicates whether the column accepts NULL values.
|
||||
nullable: boolean;
|
||||
// If the name of the column is different from the name of the property found on rowObj arguments passed to , then you can use this option to specify the property name.
|
||||
objName?: string;
|
||||
}
|
||||
|
||||
export interface BulkLoad {
|
||||
|
||||
/**
|
||||
* Adds a column to the bulk load. The column definitions should match the table you are trying to insert into. Attempting to call addColumn after the first row has been added will throw an exception.
|
||||
* @param name The name of the column.
|
||||
* @param type One of the supported data types.
|
||||
* @param options Additional column type information. At a minimum, nullable must be set to true or false.
|
||||
*/
|
||||
addColumn(name: string, type: TediousType, options: BulkLoadColumnOpts): void;
|
||||
|
||||
/**
|
||||
* Adds a row to the bulk insert. This method accepts arguments in three different formats:
|
||||
* @param rowObj An object of key/value pairs representing column name (or objName) and value.
|
||||
*/
|
||||
addRow(row: Object): void;
|
||||
/**
|
||||
* Adds a row to the bulk insert. This method accepts arguments in three different formats:
|
||||
* @param columnArray An array representing the values of each column in the same order which they were added to the bulkLoad object.
|
||||
*/
|
||||
addRow(columnArray: any[]): void;
|
||||
/**
|
||||
* Adds a row to the bulk insert. This method accepts arguments in three different formats:
|
||||
* @param args If there are at least two columns, values can be passed as multiple arguments instead of an array. They must be in the same order the columns were added in.
|
||||
*/
|
||||
addRow(...args: any[]): void;
|
||||
|
||||
/**
|
||||
* This is simply a helper utility function which returns a CREATE TABLE SQL statement based on the columns added to the bulkLoad object. This may be particularly handy when you want to insert into a temporary table (a table which starts with #). A side note on bulk inserting into temporary tables: if you want to access a local temporary table after executing the bulk load, you'll need to use the same connection and execute your requests using connection.execSqlBatch instead of .execSql.
|
||||
*/
|
||||
getTableCreationSql(): string;
|
||||
}
|
||||
|
||||
/**
|
||||
* message interface used by the infoMessage and errorMessage events of Connection
|
||||
*/
|
||||
export interface InfoObject {
|
||||
/**
|
||||
* Error number
|
||||
*/
|
||||
number: number;
|
||||
/**
|
||||
* The error state, used as a modifier to the error number.
|
||||
*/
|
||||
state: any;
|
||||
/**
|
||||
* The class (severity) of the error. A class of less than 10 indicates an informational message.
|
||||
*/
|
||||
class: number;
|
||||
/**
|
||||
* The message text.
|
||||
*/
|
||||
message: string;
|
||||
/**
|
||||
* The stored procedure name (if a stored procedure generated the message).
|
||||
*/
|
||||
procName: string;
|
||||
/**
|
||||
* The line number in the SQL batch or stored procedure that caused the error. Line numbers begin at 1; therefore, if the line number is not applicable to the message, the value of LineNumber will be 0.
|
||||
*/
|
||||
lineNumber: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Connection
|
||||
* @event 'connect' The attempt to connect and validate has completed.
|
||||
* @event 'end' The connection has ended. This may be as a result of the client calling close(), the server closing the connection, or a network error.
|
||||
* @event 'error' Internal error occurs.
|
||||
* @event 'debug' A debug message is available. It may be logged or ignored.
|
||||
* @event 'infoMessage' The server has issued an information message.
|
||||
* @event 'errorMessage' The server has issued an error message.
|
||||
* @event 'databaseChange' The server has reported that the active database has changed. This may be as a result of a sucessful login, or a use statement.
|
||||
* @event 'languageChange' The server has reported that the language has changed.
|
||||
* @event 'charsetChange' The server has reported that the charset has changed.
|
||||
* @event 'secure' A secure connection has been established.
|
||||
*/
|
||||
export class Connection extends events.EventEmitter {
|
||||
|
||||
constructor(config: ConnectionConfig);
|
||||
|
||||
/**
|
||||
* Start a transaction. As only one request at a time may be executed on
|
||||
* a connection, another request should not be initiated until this callback is called.
|
||||
* @param callback The callback is called when the request to start the transaction has completed, either successfully or with an error. If an error occured then err will describe the error.
|
||||
* @param name A string representing a name to associate with the transaction. Optional, and defaults to an empty string. Required when isolationLevel is present.
|
||||
* @param isolationLevel The isolation level that the transaction is to be run with.
|
||||
*/
|
||||
beginTransaction(callback: (error?: Error) => void, name?: string, isolationLevel?: ISOLATION_LEVEL): void;
|
||||
|
||||
/**
|
||||
* Commit a transaction.
|
||||
* There should be an active transaction. That is, beginTransaction should have been previously called.
|
||||
* @param callback The callback is called when the request to commit the transaction has completed, either successfully or with an error. If an error occured then err will describe the error.
|
||||
* As only one request at a time may be executed on a connection, another request should not be initiated until this callback is called.
|
||||
*/
|
||||
commitTransaction(callback: (error: Error) => void): void;
|
||||
|
||||
/**
|
||||
* Rollback a transaction. There should be an active transaction. That is, beginTransaction should have been previously called.
|
||||
* @param callback The callback is called when the request to rollback the transaction has completed, either successfully or with an error. If an error occured then err will describe the error.
|
||||
* As only one request at a time may be executed on a connection, another request should not be initiated until this callback is called.
|
||||
*/
|
||||
rollbackTransaction(callback: (error: Error) => void): void;
|
||||
|
||||
/**
|
||||
* Prepare the SQL represented by the request. The request can then be used in subsequent calls to execute and unprepare
|
||||
* @param request A Request object representing the request. Parameters only require a name and type. Parameter values are ignored.
|
||||
*/
|
||||
prepare(request: Request): void;
|
||||
|
||||
/**
|
||||
* Release the SQL Server resources associated with a previously prepared request.
|
||||
*/
|
||||
unprepare(request: Request): void;
|
||||
|
||||
/**
|
||||
* Call a stored procedure represented by request.
|
||||
*/
|
||||
callProcedure(request: Request): void;
|
||||
|
||||
/**
|
||||
* Execute the SQL represented by request.
|
||||
* As sp_executesql is used to execute the SQL, if the same SQL is executed multiples times using this function, the SQL Server query optimizer is likely to reuse the execution plan it generates for the first execution.
|
||||
* Beware of the way that scoping rules apply, and how they may affect local temp tables. If you're running in to scoping issues, then execSqlBatch may be a better choice. See also issue #24.
|
||||
*/
|
||||
execSql(request: Request): void;
|
||||
|
||||
/**
|
||||
* Execute the SQL batch represented by request. There is no param support, and unlike execSql, it is not likely that SQL Server will reuse the execution plan it generates for the SQL.
|
||||
* In almost all cases, execSql will be a better choice.
|
||||
*/
|
||||
execSqlBatch(request: Request): void;
|
||||
|
||||
/**
|
||||
* Execute previously prepared SQL, using the supplied parameters.
|
||||
* @param request A previously prepared Request.
|
||||
* @param parameters An object whose names correspond to the names of parameters that were added to the request before it was prepared. The object's values are passed as the parameters' values when the request is executed.
|
||||
*/
|
||||
execute(request: Request, parameters: {}): void;
|
||||
|
||||
/**
|
||||
* Creates a new BulkLoad instance.
|
||||
* @param tableName The name of the table to bulk-insert into.
|
||||
* @param callback A function which will be called after the BulkLoad finishes executing. rowCount will equal the number of rows inserted.
|
||||
*/
|
||||
newBulkLoad(tableName: string, callback: (error: Error, rowCount: number) => void): BulkLoad;
|
||||
|
||||
/**
|
||||
* Executes a BulkLoad.
|
||||
*/
|
||||
execBulkLoad(bulkLoad: BulkLoad): void;
|
||||
|
||||
/**
|
||||
* Reset the connection to its initial state. Can be useful for connection pool implementations.
|
||||
* @param callback The callback is called when the connection reset has completed, either successfully or with an error. If an error occured then err will describe the error.
|
||||
* As only one request at a time may be executed on a connection, another request should not be initiated until this callback is called.
|
||||
*/
|
||||
reset(callback: (error: Error) => void): void;
|
||||
|
||||
/**
|
||||
* Cancel currently executed request.
|
||||
*/
|
||||
cancel(): void;
|
||||
|
||||
/**
|
||||
* Closes the connection to the database. The end will be emmited once the connection has been closed.
|
||||
*/
|
||||
close(): void;
|
||||
|
||||
}
|
||||
}
|
||||
Vendored
+1
-1
@@ -3189,7 +3189,7 @@ declare module THREE {
|
||||
* Sets this quaternion from rotation component of m. Adapted from http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm.
|
||||
*/
|
||||
setFromRotationMatrix(m: Matrix4): Quaternion;
|
||||
setFromUnitVectors(vFrom: Vector3, vTo: Vector4): Quaternion;
|
||||
setFromUnitVectors(vFrom: Vector3, vTo: Vector3): Quaternion;
|
||||
/**
|
||||
* Inverts this quaternion.
|
||||
*/
|
||||
|
||||
@@ -1,218 +1,219 @@
|
||||
/// <reference path="timezonecomplete.d.ts" />
|
||||
|
||||
import tc = require("timezonecomplete");
|
||||
|
||||
var b: boolean;
|
||||
var n: number;
|
||||
var s: string;
|
||||
var w: tc.WeekDay;
|
||||
|
||||
n = tc.timeUnitToMilliseconds(tc.TimeUnit.Month);
|
||||
b = tc.isLeapYear(2014);
|
||||
n = tc.daysInMonth(2014, 10);
|
||||
n = tc.daysInYear(2014);
|
||||
n = tc.dayOfYear(2014, 1, 2);
|
||||
w = tc.firstWeekDayOfMonth(2014, 1, tc.WeekDay.Sunday);
|
||||
w = tc.lastWeekDayOfMonth(2014, 1, tc.WeekDay.Sunday);
|
||||
n = tc.weekDayOnOrAfter(2014, 1, 14, tc.WeekDay.Monday);
|
||||
n = tc.weekDayOnOrBefore(2014, 1, 14, tc.WeekDay.Monday);
|
||||
n = tc.secondOfDay(13, 59, 59);
|
||||
n = tc.weekOfMonth(2014, 1, 1);
|
||||
|
||||
// DURATION
|
||||
|
||||
var d: tc.Duration;
|
||||
var d1: tc.Duration = tc.Duration.hours(24);
|
||||
var d2: tc.Duration = tc.Duration.minutes(24);
|
||||
var d3: tc.Duration = tc.Duration.seconds(24);
|
||||
var d4: tc.Duration = tc.Duration.milliseconds(24);
|
||||
var d5: tc.Duration = tc.hours(24);
|
||||
var d6: tc.Duration = tc.minutes(24);
|
||||
var d7: tc.Duration = tc.seconds(24);
|
||||
var d8: tc.Duration = tc.milliseconds(24);
|
||||
var d9: tc.Duration = new tc.Duration(24);
|
||||
var d10: tc.Duration = new tc.Duration("00:01");
|
||||
var d11: tc.Duration = d6.clone();
|
||||
var d12: tc.Duration = new tc.Duration(4, tc.TimeUnit.Second);
|
||||
|
||||
n = d7.wholeHours();
|
||||
n = d7.hours();
|
||||
n = d7.minutes();
|
||||
n = d7.minute();
|
||||
n = d7.seconds();
|
||||
n = d7.second();
|
||||
n = d7.milliseconds();
|
||||
n = d7.millisecond();
|
||||
s = d7.sign();
|
||||
b = d7.lessThan(d6);
|
||||
b = d7.greaterThan(d6);
|
||||
d = d7.min(d6);
|
||||
d = d7.max(d6);
|
||||
d = d7.multiply(3);
|
||||
d = d7.divide(0.3);
|
||||
d = d7.add(d6);
|
||||
d = d7.sub(d6);
|
||||
s = d7.toString();
|
||||
|
||||
// TIMEZONE
|
||||
|
||||
var t: tc.TimeZone;
|
||||
var k: tc.TimeZoneKind;
|
||||
|
||||
t = tc.TimeZone.local();
|
||||
t = tc.TimeZone.utc();
|
||||
t = tc.TimeZone.zone(2);
|
||||
t = tc.TimeZone.zone("+01:00");
|
||||
t = tc.local();
|
||||
t = tc.utc();
|
||||
t = tc.zone(2);
|
||||
t = tc.zone("+01:00");
|
||||
t = tc.zone("Europe/Amsterdam", false);
|
||||
s = t.name();
|
||||
k = t.kind();
|
||||
b = t.equals(t);
|
||||
b = t.isUtc();
|
||||
b = t.dst();
|
||||
n = t.offsetForUtc(2014, 1, 1, 13, 0, 5, 123);
|
||||
n = t.offsetForZone(2014, 1, 1, 13, 0, 5, 123);
|
||||
n = t.offsetForUtcDate(new Date(2014, 1, 1, 13, 0, 5, 123), tc.DateFunctions.Get);
|
||||
n = t.offsetForZoneDate(new Date(2014, 1, 1, 13, 0, 5, 123), tc.DateFunctions.GetUTC);
|
||||
s = t.toString();
|
||||
s = tc.TimeZone.offsetToString(2);
|
||||
n = tc.TimeZone.stringToOffset("+00:01");
|
||||
|
||||
// REALTIMESOURCE
|
||||
|
||||
var date: Date = (new tc.RealTimeSource()).now();
|
||||
|
||||
// DATETIME
|
||||
|
||||
var dt: tc.DateTime;
|
||||
|
||||
var ts: tc.TimeSource = tc.DateTime.timeSource;
|
||||
|
||||
dt = tc.DateTime.nowLocal();
|
||||
dt = tc.DateTime.nowUtc();
|
||||
dt = tc.DateTime.now(tc.TimeZone.local());
|
||||
dt = tc.nowLocal();
|
||||
dt = tc.nowUtc();
|
||||
dt = tc.now(tc.TimeZone.local());
|
||||
dt = new tc.DateTime();
|
||||
dt = new tc.DateTime("2014-01-01T13:05:01.123 UTC");
|
||||
dt = new tc.DateTime("2014-01-01T13:05:01.123", tc.TimeZone.utc());
|
||||
dt = new tc.DateTime(date, tc.DateFunctions.Get);
|
||||
dt = new tc.DateTime(date, tc.DateFunctions.Get, tc.TimeZone.utc());
|
||||
dt = new tc.DateTime(2014, 1, 1, 13, 5, 1, 123);
|
||||
dt = new tc.DateTime(2014, 1, 1, 13, 5, 1, 123, tc.TimeZone.utc());
|
||||
dt = new tc.DateTime(89949284);
|
||||
dt = new tc.DateTime(89949284, tc.TimeZone.utc());
|
||||
dt = dt.clone();
|
||||
t = dt.zone();
|
||||
n = dt.offset();
|
||||
n = dt.year();
|
||||
n = dt.month();
|
||||
n = dt.day();
|
||||
n = dt.hour();
|
||||
n = dt.minute();
|
||||
n = dt.second();
|
||||
n = dt.weekNumber();
|
||||
n = dt.weekOfMonth();
|
||||
n = dt.secondOfDay();
|
||||
n = dt.dayOfYear();
|
||||
n = dt.millisecond();
|
||||
n = dt.unixUtcMillis();
|
||||
n = dt.utcYear();
|
||||
n = dt.utcMonth();
|
||||
n = dt.utcDay();
|
||||
n = dt.utcHour();
|
||||
n = dt.utcMinute();
|
||||
n = dt.utcSecond();
|
||||
n = dt.utcMillisecond();
|
||||
n = dt.utcWeekNumber();
|
||||
n = dt.utcWeekOfMonth();
|
||||
n = dt.utcSecondOfDay();
|
||||
n = dt.utcDayOfYear();
|
||||
s = dt.format("%Y-%m-%d");
|
||||
dt.convert(tc.TimeZone.local());
|
||||
dt = dt.toZone(tc.TimeZone.utc());
|
||||
date = dt.toDate();
|
||||
dt = dt.add(tc.Duration.seconds(2));
|
||||
dt = dt.add(2, tc.TimeUnit.Year);
|
||||
dt = dt.add(2, tc.TimeUnit.Month);
|
||||
dt = dt.add(2, tc.TimeUnit.Week);
|
||||
dt = dt.add(2, tc.TimeUnit.Day);
|
||||
dt = dt.add(2, tc.TimeUnit.Hour);
|
||||
dt = dt.add(2, tc.TimeUnit.Minute);
|
||||
dt = dt.add(2, tc.TimeUnit.Second);
|
||||
dt = dt.addLocal(2, tc.TimeUnit.Second);
|
||||
dt = dt.sub(tc.Duration.seconds(2));
|
||||
dt = dt.sub(2, tc.TimeUnit.Year);
|
||||
dt = dt.sub(2, tc.TimeUnit.Month);
|
||||
dt = dt.sub(2, tc.TimeUnit.Week);
|
||||
dt = dt.sub(2, tc.TimeUnit.Day);
|
||||
dt = dt.sub(2, tc.TimeUnit.Hour);
|
||||
dt = dt.sub(2, tc.TimeUnit.Minute);
|
||||
dt = dt.sub(2, tc.TimeUnit.Second);
|
||||
dt = dt.subLocal(2, tc.TimeUnit.Second);
|
||||
d = dt.diff(new tc.DateTime(9289234, tc.TimeZone.local()));
|
||||
b = dt.lessThan(new tc.DateTime(9289234, tc.TimeZone.local()));
|
||||
b = dt.lessEqual(new tc.DateTime(9289234, tc.TimeZone.local()));
|
||||
b = dt.greaterThan(new tc.DateTime(9289234, tc.TimeZone.local()));
|
||||
b = dt.greaterEqual(new tc.DateTime(9289234, tc.TimeZone.local()));
|
||||
dt = dt.min(new tc.DateTime(9289234, tc.TimeZone.local()));
|
||||
dt = dt.max(new tc.DateTime(9289234, tc.TimeZone.local()));
|
||||
s = dt.toIsoString();
|
||||
s = dt.toString();
|
||||
s = dt.toUtcString();
|
||||
|
||||
var wd: tc.WeekDay;
|
||||
wd = dt.weekDay();
|
||||
wd = dt.utcWeekDay();
|
||||
|
||||
// PERIOD
|
||||
|
||||
s = tc.periodDstToString(tc.PeriodDst.RegularIntervals);
|
||||
s = tc.periodDstToString(tc.PeriodDst.RegularLocalTime);
|
||||
|
||||
var p: tc.Period;
|
||||
|
||||
p = new tc.Period(tc.DateTime.nowLocal(), 1, tc.TimeUnit.Hour, tc.PeriodDst.RegularLocalTime);
|
||||
dt = p.start();
|
||||
n = p.amount();
|
||||
var tu: tc.TimeUnit = p.unit();
|
||||
var pd: tc.PeriodDst = p.dst();
|
||||
dt = p.findFirst(tc.DateTime.nowLocal());
|
||||
dt = p.findNext(dt);
|
||||
s = p.toIsoString();
|
||||
s = p.toString();
|
||||
b = p.isBoundary(dt);
|
||||
|
||||
|
||||
// GLOBALS
|
||||
d = tc.min(tc.Duration.seconds(2), tc.Duration.seconds(3));
|
||||
d = tc.max(tc.Duration.seconds(2), tc.Duration.seconds(3));
|
||||
|
||||
dt = tc.min(new tc.DateTime(2), new tc.DateTime(3));
|
||||
dt = tc.max(new tc.DateTime(2), new tc.DateTime(3));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <reference path="timezonecomplete.d.ts" />
|
||||
|
||||
import tc = require("timezonecomplete");
|
||||
|
||||
var b: boolean;
|
||||
var n: number;
|
||||
var s: string;
|
||||
var w: tc.WeekDay;
|
||||
|
||||
n = tc.timeUnitToMilliseconds(tc.TimeUnit.Month);
|
||||
b = tc.isLeapYear(2014);
|
||||
n = tc.daysInMonth(2014, 10);
|
||||
n = tc.daysInYear(2014);
|
||||
n = tc.dayOfYear(2014, 1, 2);
|
||||
w = tc.firstWeekDayOfMonth(2014, 1, tc.WeekDay.Sunday);
|
||||
w = tc.lastWeekDayOfMonth(2014, 1, tc.WeekDay.Sunday);
|
||||
n = tc.weekDayOnOrAfter(2014, 1, 14, tc.WeekDay.Monday);
|
||||
n = tc.weekDayOnOrBefore(2014, 1, 14, tc.WeekDay.Monday);
|
||||
n = tc.secondOfDay(13, 59, 59);
|
||||
n = tc.weekOfMonth(2014, 1, 1);
|
||||
|
||||
// DURATION
|
||||
|
||||
var d: tc.Duration;
|
||||
var d1: tc.Duration = tc.Duration.hours(24);
|
||||
var d2: tc.Duration = tc.Duration.minutes(24);
|
||||
var d3: tc.Duration = tc.Duration.seconds(24);
|
||||
var d4: tc.Duration = tc.Duration.milliseconds(24);
|
||||
var d5: tc.Duration = tc.hours(24);
|
||||
var d6: tc.Duration = tc.minutes(24);
|
||||
var d7: tc.Duration = tc.seconds(24);
|
||||
var d8: tc.Duration = tc.milliseconds(24);
|
||||
var d9: tc.Duration = new tc.Duration(24);
|
||||
var d10: tc.Duration = new tc.Duration("00:01");
|
||||
var d11: tc.Duration = d6.clone();
|
||||
var d12: tc.Duration = new tc.Duration(4, tc.TimeUnit.Second);
|
||||
|
||||
n = d7.wholeHours();
|
||||
n = d7.hours();
|
||||
n = d7.minutes();
|
||||
n = d7.minute();
|
||||
n = d7.seconds();
|
||||
n = d7.second();
|
||||
n = d7.milliseconds();
|
||||
n = d7.millisecond();
|
||||
s = d7.sign();
|
||||
b = d7.lessThan(d6);
|
||||
b = d7.greaterThan(d6);
|
||||
d = d7.min(d6);
|
||||
d = d7.max(d6);
|
||||
d = d7.multiply(3);
|
||||
d = d7.divide(0.3);
|
||||
d = d7.add(d6);
|
||||
d = d7.sub(d6);
|
||||
s = d7.toString();
|
||||
|
||||
// TIMEZONE
|
||||
|
||||
var t: tc.TimeZone;
|
||||
var k: tc.TimeZoneKind;
|
||||
|
||||
t = tc.TimeZone.local();
|
||||
t = tc.TimeZone.utc();
|
||||
t = tc.TimeZone.zone(2);
|
||||
t = tc.TimeZone.zone("+01:00");
|
||||
t = tc.local();
|
||||
t = tc.utc();
|
||||
t = tc.zone(2);
|
||||
t = tc.zone("+01:00");
|
||||
t = tc.zone("Europe/Amsterdam", false);
|
||||
s = t.name();
|
||||
k = t.kind();
|
||||
b = t.equals(t);
|
||||
b = t.isUtc();
|
||||
b = t.dst();
|
||||
n = t.offsetForUtc(2014, 1, 1, 13, 0, 5, 123);
|
||||
n = t.offsetForZone(2014, 1, 1, 13, 0, 5, 123);
|
||||
n = t.offsetForUtcDate(new Date(2014, 1, 1, 13, 0, 5, 123), tc.DateFunctions.Get);
|
||||
n = t.offsetForZoneDate(new Date(2014, 1, 1, 13, 0, 5, 123), tc.DateFunctions.GetUTC);
|
||||
s = t.toString();
|
||||
s = tc.TimeZone.offsetToString(2);
|
||||
n = tc.TimeZone.stringToOffset("+00:01");
|
||||
|
||||
// REALTIMESOURCE
|
||||
|
||||
var date: Date = (new tc.RealTimeSource()).now();
|
||||
|
||||
// DATETIME
|
||||
|
||||
var dt: tc.DateTime;
|
||||
|
||||
var ts: tc.TimeSource = tc.DateTime.timeSource;
|
||||
|
||||
dt = tc.DateTime.nowLocal();
|
||||
dt = tc.DateTime.nowUtc();
|
||||
dt = tc.DateTime.now(tc.TimeZone.local());
|
||||
dt = tc.nowLocal();
|
||||
dt = tc.nowUtc();
|
||||
dt = tc.now(tc.TimeZone.local());
|
||||
dt = new tc.DateTime();
|
||||
dt = new tc.DateTime("2014-01-01T13:05:01.123 UTC");
|
||||
dt = new tc.DateTime("2014-01-01T13:05:01.123", tc.TimeZone.utc());
|
||||
dt = new tc.DateTime(date, tc.DateFunctions.Get);
|
||||
dt = new tc.DateTime(date, tc.DateFunctions.Get, tc.TimeZone.utc());
|
||||
dt = new tc.DateTime(2014, 1, 1, 13, 5, 1, 123);
|
||||
dt = new tc.DateTime(2014, 1, 1, 13, 5, 1, 123, tc.TimeZone.utc());
|
||||
dt = new tc.DateTime(89949284);
|
||||
dt = new tc.DateTime(89949284, tc.TimeZone.utc());
|
||||
dt = dt.clone();
|
||||
t = dt.zone();
|
||||
n = dt.offset();
|
||||
n = dt.year();
|
||||
n = dt.month();
|
||||
n = dt.day();
|
||||
n = dt.hour();
|
||||
n = dt.minute();
|
||||
n = dt.second();
|
||||
n = dt.weekNumber();
|
||||
n = dt.weekOfMonth();
|
||||
n = dt.secondOfDay();
|
||||
n = dt.dayOfYear();
|
||||
n = dt.millisecond();
|
||||
n = dt.unixUtcMillis();
|
||||
n = dt.utcYear();
|
||||
n = dt.utcMonth();
|
||||
n = dt.utcDay();
|
||||
n = dt.utcHour();
|
||||
n = dt.utcMinute();
|
||||
n = dt.utcSecond();
|
||||
n = dt.utcMillisecond();
|
||||
n = dt.utcWeekNumber();
|
||||
n = dt.utcWeekOfMonth();
|
||||
n = dt.utcSecondOfDay();
|
||||
n = dt.utcDayOfYear();
|
||||
s = dt.format("%Y-%m-%d");
|
||||
dt.convert(tc.TimeZone.local());
|
||||
dt = dt.toZone(tc.TimeZone.utc());
|
||||
date = dt.toDate();
|
||||
dt = dt.add(tc.Duration.seconds(2));
|
||||
dt = dt.add(2, tc.TimeUnit.Year);
|
||||
dt = dt.add(2, tc.TimeUnit.Month);
|
||||
dt = dt.add(2, tc.TimeUnit.Week);
|
||||
dt = dt.add(2, tc.TimeUnit.Day);
|
||||
dt = dt.add(2, tc.TimeUnit.Hour);
|
||||
dt = dt.add(2, tc.TimeUnit.Minute);
|
||||
dt = dt.add(2, tc.TimeUnit.Second);
|
||||
dt = dt.addLocal(2, tc.TimeUnit.Second);
|
||||
dt = dt.sub(tc.Duration.seconds(2));
|
||||
dt = dt.sub(2, tc.TimeUnit.Year);
|
||||
dt = dt.sub(2, tc.TimeUnit.Month);
|
||||
dt = dt.sub(2, tc.TimeUnit.Week);
|
||||
dt = dt.sub(2, tc.TimeUnit.Day);
|
||||
dt = dt.sub(2, tc.TimeUnit.Hour);
|
||||
dt = dt.sub(2, tc.TimeUnit.Minute);
|
||||
dt = dt.sub(2, tc.TimeUnit.Second);
|
||||
dt = dt.subLocal(2, tc.TimeUnit.Second);
|
||||
d = dt.diff(new tc.DateTime(9289234, tc.TimeZone.local()));
|
||||
b = dt.lessThan(new tc.DateTime(9289234, tc.TimeZone.local()));
|
||||
b = dt.lessEqual(new tc.DateTime(9289234, tc.TimeZone.local()));
|
||||
b = dt.greaterThan(new tc.DateTime(9289234, tc.TimeZone.local()));
|
||||
b = dt.greaterEqual(new tc.DateTime(9289234, tc.TimeZone.local()));
|
||||
dt = dt.min(new tc.DateTime(9289234, tc.TimeZone.local()));
|
||||
dt = dt.max(new tc.DateTime(9289234, tc.TimeZone.local()));
|
||||
s = dt.toIsoString();
|
||||
s = dt.toString();
|
||||
s = dt.toUtcString();
|
||||
dt = dt.startOfDay();
|
||||
|
||||
var wd: tc.WeekDay;
|
||||
wd = dt.weekDay();
|
||||
wd = dt.utcWeekDay();
|
||||
|
||||
// PERIOD
|
||||
|
||||
s = tc.periodDstToString(tc.PeriodDst.RegularIntervals);
|
||||
s = tc.periodDstToString(tc.PeriodDst.RegularLocalTime);
|
||||
|
||||
var p: tc.Period;
|
||||
|
||||
p = new tc.Period(tc.DateTime.nowLocal(), 1, tc.TimeUnit.Hour, tc.PeriodDst.RegularLocalTime);
|
||||
dt = p.start();
|
||||
n = p.amount();
|
||||
var tu: tc.TimeUnit = p.unit();
|
||||
var pd: tc.PeriodDst = p.dst();
|
||||
dt = p.findFirst(tc.DateTime.nowLocal());
|
||||
dt = p.findNext(dt);
|
||||
s = p.toIsoString();
|
||||
s = p.toString();
|
||||
b = p.isBoundary(dt);
|
||||
|
||||
|
||||
// GLOBALS
|
||||
d = tc.min(tc.Duration.seconds(2), tc.Duration.seconds(3));
|
||||
d = tc.max(tc.Duration.seconds(2), tc.Duration.seconds(3));
|
||||
|
||||
dt = tc.min(new tc.DateTime(2), new tc.DateTime(3));
|
||||
dt = tc.max(new tc.DateTime(2), new tc.DateTime(3));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+5
@@ -627,6 +627,11 @@ declare module '__timezonecomplete/datetime' {
|
||||
* @return this - other
|
||||
*/
|
||||
diff(other: DateTime): duration.Duration;
|
||||
/**
|
||||
* Chops off the time part, yields the same date at 00:00:00.000
|
||||
* @return a new DateTime
|
||||
*/
|
||||
startOfDay(): DateTime;
|
||||
/**
|
||||
* @return True iff (this < other)
|
||||
*/
|
||||
|
||||
Vendored
+1
-1
@@ -218,7 +218,7 @@ declare module Bloodhound
|
||||
/**
|
||||
* A compare function used to sort matched datums for a given query.
|
||||
*/
|
||||
sorter?: (a: T, b: T) => T[];
|
||||
sorter?: (a: T, b: T) => number;
|
||||
/**
|
||||
*An array of datums or a function that returns an array of datums.
|
||||
*/
|
||||
|
||||
@@ -81,11 +81,20 @@ declare var footstepsBuffer: any;
|
||||
panner.connect(wet3);
|
||||
dry3.connect(masterDry);
|
||||
wet3.connect(reverb);
|
||||
|
||||
|
||||
// Start the sources now.
|
||||
source1.start(0);
|
||||
source2.start(0);
|
||||
// MEMO: should be when parameter is 0
|
||||
// http://www.w3.org/TR/webaudio/#AudioBufferSourceNode
|
||||
source2.start();
|
||||
source3.start(0);
|
||||
|
||||
// Stop the sources are 2 seconds later.
|
||||
source1.stop(2);
|
||||
// MEMO: should be when parameter is 0
|
||||
// http://www.w3.org/TR/webaudio/#AudioBufferSourceNode
|
||||
source2.stop();
|
||||
source3.stop(2);
|
||||
};
|
||||
|
||||
()=>{
|
||||
|
||||
Vendored
+3
-3
@@ -1,6 +1,6 @@
|
||||
// Type definitions for Web Audio API
|
||||
// Project: http://www.w3.org/TR/webaudio/
|
||||
// Definitions by: Baruch Berger <https://github.com/bbss>, Kon <http://phyzkit.net/>
|
||||
// Definitions by: Baruch Berger <https://github.com/bbss>, Kon <http://phyzkit.net/>, kubosho <https://github.com/kubosho>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/**
|
||||
@@ -545,14 +545,14 @@ interface AudioBufferSourceNode extends AudioSourceNode {
|
||||
* @param offset the offset time in the buffer (in seconds) where playback will begin. This parameter is optional with a default value of 0 (playing back from the beginning of the buffer).
|
||||
* @param duration the duration of the portion (in seconds) to be played. This parameter is optional, with the default value equal to the total duration of the AudioBuffer minus the offset parameter. Thus if neither offset nor duration are specified then the implied duration is the total duration of the AudioBuffer.
|
||||
*/
|
||||
start(when: number, offset?: number, duration?: number): void;
|
||||
start(when?: number, offset?: number, duration?: number): void;
|
||||
|
||||
/**
|
||||
* Schedules a sound to stop playback at an exact time. Please see deprecation section for the old method name.
|
||||
*
|
||||
* The when parameter describes at what time (in seconds) the sound should stop playing. It is in the same time coordinate system as AudioContext.currentTime. If 0 is passed in for this value or if the value is less than currentTime, then the sound will stop playing immediately. stop must only be called one time and only after a call to start or stop, or an exception will be thrown.
|
||||
*/
|
||||
stop(when: number): void;
|
||||
stop(when?: number): void;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -0,0 +1,184 @@
|
||||
/// <reference path="when.d.ts" />
|
||||
|
||||
import when = require("when");
|
||||
|
||||
class ForeignPromise<T> {
|
||||
constructor(private value: T) {
|
||||
}
|
||||
|
||||
then<U>(onFulfilled: (value: T) => U, onRejected?: (reason: any) => U) { return new ForeignPromise<U>(onFulfilled(this.value)); }
|
||||
};
|
||||
|
||||
var promise: when.Promise<number>;
|
||||
var foreign = new ForeignPromise<number>(1);
|
||||
var error = new Error("boom!");
|
||||
|
||||
// TODO: with TypeScript 1.4 a lot of these functions should change to use PromiseOrValue<T>
|
||||
// type PromiseOrValue<T> = Promise<T> | T;
|
||||
|
||||
/* * * * * * *
|
||||
* Core *
|
||||
* * * * * * */
|
||||
|
||||
/* when(x) */
|
||||
|
||||
promise = when(1);
|
||||
promise = when(when(1));
|
||||
promise = when(foreign);
|
||||
|
||||
/* when(x, f) */
|
||||
|
||||
promise = when(1, val => val + val);
|
||||
promise = when(when(1), val => val + val);
|
||||
promise = when(foreign, val => val + val);
|
||||
|
||||
/* when.try(f, ...args) */
|
||||
|
||||
promise = when.attempt(() => 1);
|
||||
|
||||
promise = when.attempt((a: number) => a + a, 1);
|
||||
promise = when.attempt((a: number) => a + a, when(1));
|
||||
|
||||
promise = when.attempt((a: number, b: number) => a + b, 1, 2);
|
||||
promise = when.attempt((a: number, b: number) => a + b, 1, when(2));
|
||||
promise = when.attempt((a: number, b: number) => a + b, when(1), 2);
|
||||
promise = when.attempt((a: number, b: number) => a + b, when(1), when(2));
|
||||
|
||||
promise = when.attempt((a: number, b: number, c: number) => a + b + c, 1, 2, 3);
|
||||
promise = when.attempt((a: number, b: number, c: number) => a + b + c, 1, when(2), 3);
|
||||
promise = when.attempt((a: number, b: number, c: number) => a + b + c, when(1), 2, 3);
|
||||
promise = when.attempt((a: number, b: number, c: number) => a + b + c, when(1), when(2), 3);
|
||||
promise = when.attempt((a: number, b: number, c: number) => a + b + c, 1, 2, when(3));
|
||||
promise = when.attempt((a: number, b: number, c: number) => a + b + c, 1, when(2), when(3));
|
||||
promise = when.attempt((a: number, b: number, c: number) => a + b + c, when(1), 2, when(3));
|
||||
promise = when.attempt((a: number, b: number, c: number) => a + b + c, when(1), when(2), when(3));
|
||||
|
||||
/* when.lift(f) */
|
||||
|
||||
// TODO: This is the major issue with lack of union types, it's not possible to represent the return type of when.lift without them.
|
||||
|
||||
var liftedFunc0: () => when.Promise<number> = when.lift(() => 2);
|
||||
var liftedFunc1: (a: when.Promise<number>) => when.Promise<number> = when.lift((a: number) => a + a);
|
||||
var liftedFunc2: (a: when.Promise<number>, b: when.Promise<number>) => when.Promise<number> = when.lift((a: number, b: number) => a + b);
|
||||
var liftedFunc3: (a: when.Promise<number>, b: when.Promise<number>, c: when.Promise<number>) => when.Promise<number> = when.lift((a: number, b: number, c: number) => a + b + c);
|
||||
|
||||
/* when.join(...promises) */
|
||||
|
||||
var joinedPromise: when.Promise<number[]> = when.join(when(1), when(2), when(3));
|
||||
|
||||
/* when.promise(resolver) */
|
||||
|
||||
promise = when.promise<number>(resolve => resolve(5));
|
||||
promise = when.promise<number>((resolve, reject) => reject(error));
|
||||
|
||||
/* when.resolve(x) */
|
||||
|
||||
promise = when.resolve(1);
|
||||
promise = when.resolve(promise);
|
||||
promise = when.resolve(foreign);
|
||||
|
||||
/* when.reject(error) */
|
||||
|
||||
promise = when.reject<number>(error);
|
||||
|
||||
/* when.defer() */
|
||||
|
||||
var deferred = when.defer<number>();
|
||||
promise = deferred.promise;
|
||||
deferred.resolve(1);
|
||||
deferred.reject(error);
|
||||
|
||||
/* * * * * * * *
|
||||
* Promise *
|
||||
* * * * * * * */
|
||||
|
||||
/* promise.done(handleResult, handleError) */
|
||||
|
||||
when(1).done((val: number) => console.log(val));
|
||||
when(1).done((val: number) => console.log(val), (err: any) => console.log(err));
|
||||
|
||||
/* promise.then(onFulfilled) */
|
||||
|
||||
promise = when(1).then((val: number) => val + val);
|
||||
promise = when(1).then((val: number) => when(val + val));
|
||||
|
||||
promise = when(1).then((val: number) => val + val, (err: any) => 2);
|
||||
promise = when(1).then((val: number) => when(val + val), (err: any) => 2);
|
||||
|
||||
/* promise.spread(onFulfilledArray) */
|
||||
|
||||
// TODO: Work out how to do this...
|
||||
// promise = when([1, 2, 3]).spread((a: number, b: number) => a + b);
|
||||
// promise = when([1, 2, 3]).spread((a: number, b: number) => when(a + b));
|
||||
|
||||
/* promise.fold(combine, promise2) */
|
||||
|
||||
promise = when(1).fold((a: number, b: number) => a + b, 2);
|
||||
promise = when(1).fold((a: number, b: number) => a + b, when(2));
|
||||
|
||||
promise = when(1).fold((a: number, b: number) => when(a + b), 2);
|
||||
promise = when(1).fold((a: number, b: number) => when(a + b), when(2));
|
||||
|
||||
/* promise.catch(onRejected) */
|
||||
|
||||
promise = when(1).catch((err: any) => 2);
|
||||
promise = when(1).catch((err: any) => when(2));
|
||||
|
||||
promise = when(1).catch((err: any) => err.good, (err: any) => 2);
|
||||
promise = when(1).catch((err: any) => err.good, (err: any) => when(2));
|
||||
|
||||
//TODO: error constructor predicate
|
||||
|
||||
promise = when(1).otherwise((err: any) => 2);
|
||||
promise = when(1).otherwise((err: any) => when(2));
|
||||
|
||||
promise = when(1).otherwise((err: any) => err.good, (err: any) => 2);
|
||||
promise = when(1).otherwise((err: any) => err.good, (err: any) => when(2));
|
||||
|
||||
/* promise.finally(cleanup) */
|
||||
|
||||
promise = when(1).finally(() => console.log('Cleaning up'));
|
||||
|
||||
promise = when(1).ensure(() => console.log('Cleaning up'));
|
||||
|
||||
/* promise.yield(x) */
|
||||
|
||||
promise = when(true).yield(1);
|
||||
promise = when(true).yield(when(2));
|
||||
|
||||
/* promise.else(x) */
|
||||
|
||||
promise = when(1).else(2);
|
||||
promise = when(1).else(2);
|
||||
|
||||
promise = when(1).orElse(2);
|
||||
promise = when(1).orElse(2);
|
||||
|
||||
/* promise.tap(onFulfilledSideEffect) */
|
||||
|
||||
promise = when(1).tap(val => console.log(val));
|
||||
|
||||
/* promise.delay(milliseconds) */
|
||||
|
||||
promise = when(1).delay(1000);
|
||||
|
||||
/* promise.timeout(milliseconds, reason) */
|
||||
|
||||
promise = when(1).timeout(1000);
|
||||
promise = when(1).timeout(1000, new Error('Too SLOW!'));
|
||||
|
||||
/* promise.inspect() */
|
||||
|
||||
var status: {
|
||||
state: string;
|
||||
value?: number;
|
||||
reason?: any;
|
||||
};
|
||||
|
||||
status = when(1).inspect()
|
||||
|
||||
/* promise.with(thisArg) */
|
||||
|
||||
promise = when(1).with(2);
|
||||
|
||||
promise = when(1).withThis(2);
|
||||
Vendored
+82
-1
@@ -1,9 +1,44 @@
|
||||
// Type definitions for When 2.4.0
|
||||
// Project: https://github.com/cujojs/when
|
||||
// Definitions by: Derek Cicerone <https://github.com/derekcicerone>
|
||||
// Definitions by: Derek Cicerone <https://github.com/derekcicerone>, Wim Looman <https://github.com/Nemo157>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare function When<T>(value: When.Promise<T>): When.Promise<T>;
|
||||
declare function When<T>(value: When.Thenable<T>): When.Promise<T>;
|
||||
declare function When<T>(value: T): When.Promise<T>;
|
||||
|
||||
declare function When<T, U>(value: When.Promise<T>, transform: (val: T) => U): When.Promise<U>;
|
||||
declare function When<T, U>(value: When.Thenable<T>, transform: (val: T) => U): When.Promise<U>;
|
||||
declare function When<T, U>(value: T, transform: (val: T) => U): When.Promise<U>;
|
||||
|
||||
declare module When {
|
||||
function attempt<T>(f: () => T): Promise<T>;
|
||||
|
||||
function attempt<T, A>(f: (a: A) => T, a: Promise<A>): Promise<T>;
|
||||
function attempt<T, A>(f: (a: A) => T, a: A): Promise<T>;
|
||||
|
||||
function attempt<T, A, B>(f: (a: A, b: B) => T, a: Promise<A>, b: Promise<B>): Promise<T>;
|
||||
function attempt<T, A, B>(f: (a: A, b: B) => T, a: Promise<A>, b: B): Promise<T>;
|
||||
function attempt<T, A, B>(f: (a: A, b: B) => T, a: A, b: Promise<B>): Promise<T>;
|
||||
function attempt<T, A, B>(f: (a: A, b: B) => T, a: A, b: B): Promise<T>;
|
||||
|
||||
function attempt<T, A, B, C>(f: (a: A, b: B, c: C) => T, a: Promise<A>, b: Promise<B>, c: Promise<C>): Promise<T>;
|
||||
function attempt<T, A, B, C>(f: (a: A, b: B, c: C) => T, a: Promise<A>, b: Promise<B>, c: C): Promise<T>;
|
||||
function attempt<T, A, B, C>(f: (a: A, b: B, c: C) => T, a: Promise<A>, b: B, c: Promise<C>): Promise<T>;
|
||||
function attempt<T, A, B, C>(f: (a: A, b: B, c: C) => T, a: Promise<A>, b: B, c: C): Promise<T>;
|
||||
function attempt<T, A, B, C>(f: (a: A, b: B, c: C) => T, a: A, b: Promise<B>, c: Promise<C>): Promise<T>;
|
||||
function attempt<T, A, B, C>(f: (a: A, b: B, c: C) => T, a: A, b: Promise<B>, c: C): Promise<T>;
|
||||
function attempt<T, A, B, C>(f: (a: A, b: B, c: C) => T, a: A, b: B, c: Promise<C>): Promise<T>;
|
||||
function attempt<T, A, B, C>(f: (a: A, b: B, c: C) => T, a: A, b: B, c: C): Promise<T>;
|
||||
|
||||
function lift<T>(f: () => T): () => Promise<T>;
|
||||
function lift<T, A>(f: (a: A) => T): (a: Promise<A>) => Promise<T>;
|
||||
function lift<T, A, B>(f: (a: A, b: B) => T): (a: Promise<A>, b: Promise<B>) => Promise<T>;
|
||||
function lift<T, A, B, C>(f: (a: A, b: B, c: C) => T): (a: Promise<A>, b: Promise<B>, c: Promise<C>) => Promise<T>;
|
||||
|
||||
function promise<T>(resolver: (resolve: (value: T) => void, reject: (reason: any) => void) => void): Promise<T>;
|
||||
|
||||
function reject<T>(reason: any): Promise<T>;
|
||||
|
||||
/**
|
||||
* Return a promise that will resolve only once all the supplied promisesOrValues
|
||||
@@ -45,6 +80,7 @@ declare module When {
|
||||
* - rejected with promiseOrValue's reason after it is rejected
|
||||
*/
|
||||
function resolve<T>(promise: Promise<T>): Promise<T>;
|
||||
function resolve<T>(foreign: Thenable<T>): Promise<T>;
|
||||
function resolve<T>(value?: T): Promise<T>;
|
||||
|
||||
interface Deferred<T> {
|
||||
@@ -59,17 +95,62 @@ declare module When {
|
||||
catch<U>(onRejected?: (reason: any) => Promise<U>): Promise<U>;
|
||||
catch<U>(onRejected?: (reason: any) => U): Promise<U>;
|
||||
|
||||
catch<U>(filter: (reason: any) => boolean, onRejected?: (reason: any) => Promise<U>): Promise<U>;
|
||||
catch<U>(filter: (reason: any) => boolean, onRejected?: (reason: any) => U): Promise<U>;
|
||||
|
||||
// Make sure you test any usage of these overloads, exceptionType must
|
||||
// be a constructor with prototype set to an instance of Error.
|
||||
catch<U>(exceptionType: any, onRejected?: (reason: any) => Promise<U>): Promise<U>;
|
||||
catch<U>(exceptionType: any, onRejected?: (reason: any) => U): Promise<U>;
|
||||
|
||||
finally(onFulfilledOrRejected: Function): Promise<T>;
|
||||
|
||||
ensure(onFulfilledOrRejected: Function): Promise<T>;
|
||||
|
||||
inspect(): Snapshot<T>;
|
||||
|
||||
yield<U>(value: Promise<U>): Promise<U>;
|
||||
yield<U>(value: U): Promise<U>;
|
||||
|
||||
else(value: T): Promise<T>;
|
||||
orElse(value: T): Promise<T>;
|
||||
|
||||
tap(onFulfilledSideEffect: (value: T) => void): Promise<T>;
|
||||
|
||||
delay(milliseconds: number): Promise<T>;
|
||||
|
||||
timeout(milliseconds: number, reason?: any): Promise<T>;
|
||||
|
||||
with(thisArg: any): Promise<T>;
|
||||
withThis(thisArg: any): Promise<T>;
|
||||
|
||||
otherwise<U>(onRejected?: (reason: any) => Promise<U>): Promise<U>;
|
||||
otherwise<U>(onRejected?: (reason: any) => U): Promise<U>;
|
||||
|
||||
otherwise<U>(predicate: (reason: any) => boolean, onRejected?: (reason: any) => Promise<U>): Promise<U>;
|
||||
otherwise<U>(predicate: (reason: any) => boolean, onRejected?: (reason: any) => U): Promise<U>;
|
||||
|
||||
// Make sure you test any usage of these overloads, exceptionType must
|
||||
// be a constructor with prototype set to an instance of Error.
|
||||
otherwise<U>(exceptionType: any, onRejected?: (reason: any) => Promise<U>): Promise<U>;
|
||||
otherwise<U>(exceptionType: any, onRejected?: (reason: any) => U): Promise<U>;
|
||||
|
||||
then<U>(onFulfilled: (value: T) => Promise<U>, onRejected?: (reason: any) => Promise<U>, onProgress?: (update: any) => void): Promise<U>;
|
||||
then<U>(onFulfilled: (value: T) => Promise<U>, onRejected?: (reason: any) => U, onProgress?: (update: any) => void): Promise<U>;
|
||||
then<U>(onFulfilled: (value: T) => U, onRejected?: (reason: any) => Promise<U>, onProgress?: (update: any) => void): Promise<U>;
|
||||
then<U>(onFulfilled: (value: T) => U, onRejected?: (reason: any) => U, onProgress?: (update: any) => void): Promise<U>;
|
||||
|
||||
done<U>(onFulfilled: (value: T) => void, onRejected?: (reason: any) => void): void;
|
||||
|
||||
fold<U, V>(combine: (value1: T, value2: V) => Promise<U>, value2: V): Promise<U>;
|
||||
fold<U, V>(combine: (value1: T, value2: V) => Promise<U>, value2: Promise<V>): Promise<U>;
|
||||
|
||||
fold<U, V>(combine: (value1: T, value2: V) => U, value2: V): Promise<U>;
|
||||
fold<U, V>(combine: (value1: T, value2: V) => U, value2: Promise<V>): Promise<U>;
|
||||
}
|
||||
|
||||
interface Thenable<T> {
|
||||
then<U>(onFulfilled: (value: T) => U, onRejected?: (reason: any) => U): Thenable<U>;
|
||||
}
|
||||
|
||||
interface Snapshot<T> {
|
||||
|
||||
Reference in New Issue
Block a user