mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -5,6 +5,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](acc-wizard/acc-wizard.d.ts) [acc-wizard](https://github.com/sathomas/acc-wizard) by [Cyril Schumacher](https://github.com/cyrilschumacher)
|
||||
* [:link:](accounting/accounting.d.ts) [accounting.js](http://josscrowcroft.github.io/accounting.js) by [Sergey Gerasimov](https://github.com/gerich-home)
|
||||
* [:link:](ace/ace.d.ts) [Ace Ajax.org Cloud9 Editor](http://ace.ajax.org) by [Diullei Gomes](https://github.com/Diullei)
|
||||
* [:link:](acorn/acorn.d.ts) [Acorn](https://github.com/marijnh/acorn) by [RReverser](https://github.com/RReverser)
|
||||
* [:link:](add2home/add2home.d.ts) [add2home](http://cubiq.org/add-to-home-screen) by [James Wilkins](http://www.codeplex.com/site/users/view/jamesnw)
|
||||
* [:link:](adm-zip/adm-zip.d.ts) [adm-zip](https://github.com/cthackers/adm-zip) by [John Vilk](https://github.com/jvilk)
|
||||
* [:link:](alertify/alertify.d.ts) [alertify](http://fabien-d.github.io/alertify.js) by [John Jeffery](http://github.com/jjeffery)
|
||||
@@ -12,6 +13,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](amplifyjs/amplifyjs.d.ts) [AmplifyJs](http://amplifyjs.com) by [Jonas Eriksson](https://github.com/joeriks)
|
||||
* [:link:](amqp-rpc/amqp-rpc.d.ts) [amqp-rpc](https://github.com/demchenkoe/node-amqp-rpc) by [Wonshik Kim](https://github.com/wokim)
|
||||
* [:link:](angular-file-upload/angular-file-upload.d.ts) [Angular File Upload](https://github.com/danialfarid/angular-file-upload) by [John Reilly](https://github.com/johnnyreilly)
|
||||
* [:link:](angular-growl-v2/angular-growl-v2.d.ts) [Angular Growl 2 v.0.7.3](http://janstevens.github.io/angular-growl-2) by [Tadeusz Hucal](https://github.com/mkp05)
|
||||
* [:link:](angularjs/angular.d.ts) [Angular JS](http://angularjs.org) by [Diego Vilar](http://github.com/diegovilar)
|
||||
* [:link:](angularjs/angular-animate.d.ts) [Angular JS (ngAnimate module)](http://angularjs.org) by [Michel Salib](https://github.com/michelsalib), [Adi Dahiya](https://github.com/adidahiya), [Raphael Schweizer](https://github.com/rasch)
|
||||
* [:link:](angularjs/angular-cookies.d.ts) [Angular JS (ngCookies module)](http://angularjs.org) by [Diego Vilar](http://github.com/diegovilar)
|
||||
@@ -41,6 +43,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](any-db/any-db.d.ts) [any-db](https://github.com/grncdr/node-any-db) by [Rogier Schouten](https://github.com/rogierschouten)
|
||||
* [:link:](any-db-transaction/any-db-transaction.d.ts) [any-db-transaction](https://github.com/grncdr/node-any-db-transaction) by [Rogier Schouten](https://github.com/rogierschouten)
|
||||
* [:link:](cordova/cordova.d.ts) [Apache Cordova](http://cordova.apache.org) by [Microsoft Open Technologies Inc.](http://msopentech.com)
|
||||
* [:link:](cordova-plugin-email-composer/cordova-plugin-email-composer.d.ts) [Apache Cordova Email Composer plugin](https://github.com/katzer/cordova-plugin-email-composer) by [Dave Taylor](http://davetayls.me)
|
||||
* [:link:](polymer/polymer.app-router.d.ts) [app-router](https://github.com/erikringsmuth/app-router) by [Louis Grignon](https://github.com/lgrignon)
|
||||
* [:link:](appframework/appframework.d.ts) [AppFramework](http://app-framework-software.intel.com) by [kyo_ago](https://github.com/kyo-ago)
|
||||
* [:link:](arbiter/Arbiter.d.ts) [Arbiter.js](http://arbiterjs.com) by [Arash Shakery](https://github.com/arash16)
|
||||
@@ -57,6 +60,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](atpl/atpl.d.ts) [atpl](https://github.com/soywiz/atpl.js) by [Carlos Ballesteros Velasco](https://github.com/soywiz)
|
||||
* [:link:](auth0/auth0.d.ts) [Auth0.js](http://auth0.com) by [Robert McLaws](https://github.com/advancedrei)
|
||||
* [:link:](auth0.widget/auth0.widget.d.ts) [Auth0Widget.js](http://auth0.com) by [Robert McLaws](https://github.com/advancedrei)
|
||||
* [:link:](auth0.lock/auth0.lock.d.ts) [Auth0Widget.js](http://auth0.com) by [Robert McLaws](https://github.com/advancedrei)
|
||||
* [:link:](autobahn/autobahn.d.ts) [AutobahnJS](http://autobahn.ws/js) by [Elad Zelingher](https://github.com/darkl)
|
||||
* [:link:](aws-sdk/aws-sdk.d.ts) [aws-sdk](https://github.com/aws/aws-sdk-js) by [midknight41](https://github.com/midknight41)
|
||||
* [:link:](axios/axios.d.ts) [axios](https://github.com/mzabriskie/axios) by [Marcel Buesing](https://github.com/marcelbuesing)
|
||||
* [:link:](node-azure/azure.d.ts) [Azure SDK for Node](https://github.com/WindowsAzure/azure-sdk-for-node) by [Andrew Gaspar](https://github.com/AndrewGaspar), [Anti Veeranna](https://github.com/antiveeranna), [Maxime LUCE](https://github.com/SomaticIT)
|
||||
@@ -83,8 +88,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](bootstrap-notify/bootstrap-notify.d.ts) [bootstrap-notify](https://github.com/Nijikokun/bootstrap-notify) by [Blake Niemyjski](https://github.com/niemyjski)
|
||||
* [:link:](bootstrap.datepicker/bootstrap.datepicker.d.ts) [bootstrap.datepicker](https://github.com/eternicode/bootstrap-datepicker) by [Boris Yankov](https://github.com/borisyankov)
|
||||
* [:link:](bootstrap.paginator/bootstrap.paginator.d.ts) [bootstrap.paginator](https://github.com/lyonlai/bootstrap-paginator) by [derikwhittaker](https://github.com/derikwhittaker)
|
||||
* [:link:](bootstrap.timepicker/bootstrap.timepicker.d.ts) [bootstrap.timepicker](https://github.com/jdewit/bootstrap-timepicker) by [derikwhittaker](https://github.com/derikwhittaker)
|
||||
* [:link:](box2d/box2dweb.d.ts) [bootstrap.timepicker](http://code.google.com/p/box2dweb) by [jbaldwin](https://github.com/jbaldwin)
|
||||
* [:link:](bootstrap.timepicker/bootstrap.timepicker.d.ts) [bootstrap.timepicker](https://github.com/jdewit/bootstrap-timepicker) by [derikwhittaker](https://github.com/derikwhittaker)
|
||||
* [:link:](breeze/breeze.d.ts) [Breeze 1.5.x](http://www.breezejs.com) by [Boris Yankov](https://github.com/borisyankov), [IdeaBlade](https://github.com/IdeaBlade/Breeze)
|
||||
* [:link:](browser-harness/browser-harness.d.ts) [Browser Harness](https://github.com/scriby/browser-harness) by [Chris Scribner](https://github.com/scriby)
|
||||
* [:link:](browser-sync/browser-sync.d.ts) [browser-sync](http://www.browsersync.io) by [Asana](https://asana.com)
|
||||
@@ -191,7 +196,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](errorhandler/errorhandler.d.ts) [errorhandler](https://github.com/expressjs/errorhandler) by [Santi Albo](https://github.com/santialbo)
|
||||
* [:link:](es6-promise/es6-promise.d.ts) [es6-promise](https://github.com/jakearchibald/ES6-Promise) by [François de Campredon](https://github.com/fdecampredon), [vvakame](https://github.com/vvakame)
|
||||
* [:link:](escape-latex/escape-latex.d.ts) [escape-latex](https://github.com/dangmai/escape-latex) by [Oliver Schneider](https://github.com/olsio)
|
||||
* [:link:](esprima/esprima.d.ts) [Esprima](http://esprima.org) by [teppeis](https://github.com/teppeis)
|
||||
* [:link:](esprima/esprima.d.ts) [Esprima](http://esprima.org) by [teppeis](https://github.com/teppeis), [RReverser](https://github.com/RReverser)
|
||||
* [:link:](estree/estree.d.ts) [ESTree AST specification](https://github.com/estree/estree) by [RReverser](https://github.com/RReverser)
|
||||
* [:link:](event-loop-lag/event-loop-lag.d.ts) [event-loop-lag](https://github.com/pebble/event-loop-lag) by [Rogier Schouten](https://github.com/rogierschouten)
|
||||
* [:link:](eventemitter2/eventemitter2.d.ts) [EventEmitter2](https://github.com/asyncly/EventEmitter2) by [ryiwamoto](https://github.com/ryiwamoto)
|
||||
* [:link:](eventemitter3/eventemitter3.d.ts) [EventEmitter3](https://github.com/primus/eventemitter3) by [Yuichi Murata](https://github.com/mrk21)
|
||||
@@ -239,6 +245,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](fs-finder/fs-finder.d.ts) [fs-finder](https://github.com/sakren/node-fs-finder) by [Michael Zabka](https://github.com/misak113)
|
||||
* [:link:](fs-mock/fs-mock.d.ts) [fs-mock](https://github.com/sakren/node-fs-mock) by [Rogier Schouten](https://github.com/rogierschouten)
|
||||
* [:link:](ftdomdelegate/ftdomdelegate.d.ts) [ftdomdelegate](https://github.com/ftlabs/ftdomdelegate) by [Christian Holm Nielsen](https://github.com/dotnetnerd)
|
||||
* [:link:](ftp/ftp.d.ts) [ftp](https://github.com/mscdex/node-ftp) by [Rogier Schouten](https://github.com/rogierschouten)
|
||||
* [:link:](ftpd/ftpd.d.ts) [ftpd](https://github.com/sstur/nodeftpd) by [Rogier Schouten](https://github.com/rogierschouten)
|
||||
* [:link:](fullCalendar/fullCalendar.d.ts) [FullCalendar](http://arshaw.com/fullcalendar) by [Neil Stalker](https://github.com/nestalk)
|
||||
* [:link:](fuse/fuse.d.ts) [Fuse.js](https://github.com/krisk/Fuse) by [Greg Smith](https://github.com/smrq)
|
||||
* [:link:](jquery-galleria/jquery-galleria.d.ts) [galleria.js](https://github.com/aino/galleria) by [Robert Imig](https://github.com/rimig)
|
||||
@@ -299,6 +307,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](hapi/hapi.d.ts) [hapi](http://github.com/spumko/hapi) by [Jason Swearingen](http://github.com/jasonswearingen)
|
||||
* [:link:](hasher/hasher.d.ts) [Hasher.js](https://github.com/millermedeiros/hasher) by [flyfishMT](https://github.com/flyfishMT)
|
||||
* [:link:](hashmap/hashmap.d.ts) [HashMap](https://github.com/flesler/hashmap) by [Rafał Wrzeszcz](http://wrzasq.pl)
|
||||
* [:link:](he/he.d.ts) [he](https://github.com/mathiasbynens/he) by [Simon Edwards](https://github.com/sedwards2009)
|
||||
* [:link:](Headroom/headroom.d.ts) [headroom.js](http://wicky.nillia.ms/headroom.js) by [Jakub Olek](https://github.com/hakubo)
|
||||
* [:link:](heatmap.js/heatmap.d.ts) [heatmap.js](https://github.com/pa7/heatmap.js) by [Yang Guan](https://github.com/lookuptable)
|
||||
* [:link:](hellojs/hellojs.d.ts) [hello.js](http://adodson.com/hello.js) by [Pavel Zika](https://github.com/PavelPZ)
|
||||
@@ -319,6 +328,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](icheck/icheck.d.ts) [iCheck](http://damirfoy.com/iCheck) by [Dániel Tar](https://github.com/qcz)
|
||||
* [:link:](imagemagick/imagemagick.d.ts) [imagemagick](http://github.com/rsms/node-imagemagick) by [Carlos Ballesteros Velasco](https://github.com/soywiz)
|
||||
* [:link:](imap/imap.d.ts) [imap](https://www.npmjs.com/package/imap) by [Peter Snider](https://github.com/psnider)
|
||||
* [:link:](imgur-rest-api/imgur-rest-api.d.ts) [Imgur REST API v3](https://api.imgur.com) by [Luke William Westby](http://github.com/lukewestby)
|
||||
* [:link:](impress/impress.d.ts) [Impress.js](https://github.com/bartaz/impress.js) by [Boris Yankov](https://github.com/borisyankov)
|
||||
* [:link:](inflection/inflection.d.ts) [inflection](https://github.com/dreamerslab/node.inflection) by [Shogo Iwano](https://github.com/shiwano)
|
||||
* [:link:](ini/ini.d.ts) [ini](https://github.com/isaacs/ini) by [Marcin Porębski](https://github.com/marcinporebski)
|
||||
@@ -357,7 +367,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](jquery.contextMenu/jquery.contextMenu.d.ts) [jQuery contextMenu](http://medialize.github.com/jQuery-contextMenu) by [Natan Vivo](https://github.com/nvivo)
|
||||
* [:link:](jquery.cookie/jquery.cookie.d.ts) [jQuery Cookie Plugin](https://github.com/carhartl/jquery-cookie) by [Roy Goode](https://github.com/RoyGoode)
|
||||
* [:link:](jquery.cycle2/jquery.cycle2.d.ts) [jQuery Cycle2 version (build 20140216)](http://jquery.malsup.com/cycle2) by [Donny Nadolny](https://github.com/dnadolny)
|
||||
* [:link:](jquery.dataTables/jquery.dataTables.d.ts) [JQuery DataTables](http://www.datatables.net) by [Armin Sander](https://github.com/pragmatrix)
|
||||
* [:link:](jquery.dataTables/jquery.dataTables.d.ts) [JQuery DataTables](http://www.datatables.net) by [Kiarash Ghiaseddin](https://github.com/Silver-Connection/DefinitelyTyped), [Omid Rad](https://github.com/omidkrad), [Armin Sander](https://github.com/pragmatrix)
|
||||
* [:link:](jquery.fileupload/jquery.fileupload.d.ts) [jQuery File Upload Plugin](https://github.com/blueimp/jQuery-File-Upload) by [Rob Alarcon](https://github.com/rob-alarcon)
|
||||
* [:link:](jquery.joyride/jquery.joyride.d.ts) [jQuery JoyRide Plugin](https://github.com/zurb/joyride) by [Vincent Bortone](https://github.com/vbortone)
|
||||
* [:link:](jqgrid/jqgrid.d.ts) [jQuery jqgrid Plugin](https://github.com/tonytomov/jqGrid) by [Lokesh Peta](https://github.com/lokeshpeta)
|
||||
@@ -376,6 +386,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](jquery.ui.datetimepicker/jquery.ui.datetimepicker.d.ts) [jQuery UI DateTimePicker](http://trentrichardson.com/examples/timepicker) by [dougajmcdonald](https://github.com/dougajmcdonald)
|
||||
* [:link:](jquery.ui.layout/jquery.ui.layout.d.ts) [jQuery UI Layout Plug-in](http://layout.jquery-dev.net) by [Steve Fenton](https://github.com/Steve-Fenton)
|
||||
* [:link:](jquery.timepicker/jquery.timepicker.d.ts) [jQuery UI Timepicker](http://fgelinas.com/code/timepicker) by [Anwar Javed](https://github.com/anwarjaved)
|
||||
* [:link:](jquery-fullscreen/jquery-fullscreen.d.ts) [jquery-fullscreen](https://github.com/kayahr/jquery-fullscreen-plugin) by [Bruno Grieder](https://github.com/bgrieder)
|
||||
* [:link:](jquery-handsontable/jquery-handsontable.d.ts) [jquery-handsontable](http://handsontable.com) by [Ted John](https://github.com/intelorca)
|
||||
* [:link:](jquery.menuaim/jquery.menuaim.d.ts) [jQuery-menu-aim](https://github.com/kamens/jQuery-menu-aim) by [Robert Fonseca-Ensor](http://www.robfe.com)
|
||||
* [:link:](jquery.pjax/jquery.pjax.d.ts) [jquery-pjax](https://github.com/defunkt/jquery-pjax) by [Junle Li](https://github.com/lijunle)
|
||||
@@ -449,6 +460,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](keymaster/keymaster.d.ts) [keymaster](https://github.com/madrobby/keymaster) by [Martin W. Kirst](https://github.com/nitram509)
|
||||
* [:link:](keypress/keypress.d.ts) [Keypress](https://github.com/dmauro/Keypress) by [Roger Chen](https://github.com/rcchen)
|
||||
* [:link:](kineticjs/kineticjs.d.ts) [KineticJS](http://kineticjs.com) by [Basarat Ali Syed](http://www.github.com/basarat), [Ralph de Ruijter](http://www.superdopey.nl/techblog)
|
||||
* [:link:](knex/knex.d.ts) [Knex.js](https://github.com/tgriesser/knex) by [Qubo](https://github.com/tkQubo)
|
||||
* [:link:](knockback/knockback.d.ts) [Knockback.js](http://kmalakoff.github.io/knockback) by [Boris Yankov](https://github.com/borisyankov)
|
||||
* [:link:](knockout/knockout.d.ts) [Knockout](http://knockoutjs.com) by [Boris Yankov](https://github.com/borisyankov), [Igor Oleinikov](https://github.com/Igorbek), [Clément Bourgeois](https://github.com/moonpyk)
|
||||
* [:link:](knockout.deferred.updates/knockout.deferred.updates.d.ts) [Knockout Deferred Updates](https://github.com/mbest/knockout-deferred-updates) by [Sebastián Galiano](https://github.com/sgaliano)
|
||||
@@ -488,6 +500,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](log4javascript/log4javascript.d.ts) [log4javascript](http://log4javascript.org) by [Markus Wagner](https://github.com/Ritzlgrmft)
|
||||
* [:link:](log4js/log4js.d.ts) [log4js](https://github.com/nomiddlename/log4js-node) by [Kentaro Okuno](http://github.com/armorik83)
|
||||
* [:link:](logg/logg.d.ts) [logg](https://github.com/dpup/node-logg) by [Bret Little](https://github.com/blittle)
|
||||
* [:link:](loggly/loggly.d.ts) [loggly](https://github.com/nodejitsu/node-loggly) by [Ray Martone](https://github.com/rmartone)
|
||||
* [:link:](logrotate-stream/logrotate-stream.d.ts) [logrotate-stream](https://github.com/dstokes/logrotate-stream) by [Rogier Schouten](https://github.com/rogierschouten)
|
||||
* [:link:](lolex/lolex.d.ts) [lolex](https://github.com/sinonjs/lolex) by [Wim Looman](https://github.com/Nemo157)
|
||||
* [:link:](long/long.d.ts) [Long.js](https://github.com/dcodeIO/Long.js) by [Toshihide Hara](https://github.com/kerug)
|
||||
@@ -585,8 +598,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](xml2js/xml2js.d.ts) [node-xml2js](https://github.com/Leonidas-from-XIV/node-xml2js) by [Michel Salib](https://github.com/michelsalib), [Jason McNeil](https://github.com/jasonrm)
|
||||
* [:link:](node/node.d.ts) [Node.js](http://nodejs.org) by [Microsoft TypeScript](http://typescriptlang.org), [DefinitelyTyped](https://github.com/borisyankov/DefinitelyTyped)
|
||||
* [:link:](restify/restify.d.ts) [node.js REST framework](https://github.com/mcavage/node-restify) by [Bret Little](https://github.com/blittle)
|
||||
* [:link:](acl/acl-mongodbBackend.d.ts) [node_acl](https://github.com/optimalbits/node_acl) by [Qubo](https://github.com/tkQubo)
|
||||
* [:link:](acl/acl.d.ts) [node_acl](https://github.com/optimalbits/node_acl) by [Qubo](https://github.com/tkQubo)
|
||||
* [:link:](acl/acl-mongodbBackend.d.ts) [node_acl](https://github.com/optimalbits/node_acl) by [Qubo](https://github.com/tkQubo)
|
||||
* [:link:](acl/acl-redisBackend.d.ts) [node_acl](https://github.com/optimalbits/node_acl) by [Qubo](https://github.com/tkQubo)
|
||||
* [:link:](mdns/mdns.d.ts) [node_mdns](https://github.com/agnat/node_mdns) by [Stefan Steinhart](https://github.com/reppners)
|
||||
* [:link:](node_redis/node_redis.d.ts) [node_redis](https://github.com/mranney/node_redis) by [Boris Yankov](https://github.com/borisyankov)
|
||||
@@ -597,16 +610,18 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](nopt/nopt.d.ts) [nopt](https://github.com/npm/nopt) by [jbondc](https://github.com/jbondc)
|
||||
* [:link:](notifyjs/notifyjs.d.ts) [notify.js](https://github.com/alexgibson/notify.js) by [soundTricker](https://github.com/soundTricker)
|
||||
* [:link:](notify/notify.d.ts) [Notify.js](https://github.com/jpillora/notifyjs) by [Xiaohan Zhang](https://github.com/hellochar)
|
||||
* [:link:](nouislider/nouislider.d.ts) [nouislider](https://github.com/leongersen/noUiSlider) by [Corey Jepperson](https://github.com/acoreyj)
|
||||
* [:link:](wnumb/wnumb.d.ts) [nouislider](https://github.com/leongersen/wnumb) by [Corey Jepperson](https://github.com/acoreyj)
|
||||
* [:link:](nouislider/nouislider.d.ts) [nouislider](https://github.com/leongersen/noUiSlider) by [Corey Jepperson](https://github.com/acoreyj)
|
||||
* [:link:](noVNC/noVNC.d.ts) [noVNC](https://github.com/kanaka/noVNC) by [Ken Smith](https://github.com/smithkl42)
|
||||
* [:link:](npm/npm.d.ts) [npm](https://github.com/npm/npm) by [Maxime LUCE](https://github.com/SomaticIT)
|
||||
* [: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-hash/object-hash.d.ts) [object-hash](https://github.com/puleos/object-hash) by [Michael Zabka](https://github.com/misak113)
|
||||
* [:link:](object-path/object-path.d.ts) [objectPath](https://github.com/mariocasciaro/object-path) by [Paulo Cesar](https://github.com/pocesar)
|
||||
* [:link:](object-path/object-path.d.ts) [objectPath v0.9.x](https://github.com/mariocasciaro/object-path) by [Paulo Cesar](https://github.com/pocesar)
|
||||
* [:link:](oboe/oboe.d.ts) [oboe](https://github.com/jimhigson/oboe.js) by [Jared Klopper](https://github.com/optical)
|
||||
* [:link:](oclazyload/oclazyload.d.ts) [oc.LazyLoad](https://github.com/ocombe/ocLazyLoad) by [Roland Zwaga](https://github.com/rolandzwaga)
|
||||
* [:link:](on-finished/on-finished.d.ts) [on-finished](https://github.com/jshttp/on-finished) by [Honza Dvorsky](http://github.com/czechboy0)
|
||||
* [:link:](onsenui/onsenui.d.ts) [Onsen UI](http://onsen.io) by [Fran Dios](https://github.com/frankdiox)
|
||||
* [:link:](open/open.d.ts) [open](https://github.com/jjrdn/node-open) by [Bart van der Schoor](https://github.com/Bartvds)
|
||||
* [:link:](openlayers/openlayers.d.ts) [OpenLayers.js](https://github.com/openlayers/openlayers) by [Ilya Bolkhovsky](https://github.com/bolhovsky)
|
||||
* [:link:](opn/opn.d.ts) [opn](https://github.com/sindresorhus/opn) by [Shinnosuke Watanabe](https://github.com/shinnn)
|
||||
@@ -631,6 +646,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [: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:](photoswipe/photoswipe.d.ts) [PhotoSwipe](http://photoswipe.com) by [Xiaohan Zhang](https://github.com/hellochar)
|
||||
* [:link:](physijs/physijs.d.ts) [Physijs](http://chandlerprall.github.io/Physijs) by [Satoru Kimura](https://github.com/gyohk)
|
||||
* [:link:](pickadate/pickadate.d.ts) [pickadate.js](https://github.com/amsul/pickadate.js) by [Adi Dahiya](https://github.com/adidahiya)
|
||||
* [:link:](pixi/pixi.d.ts) [PIXI](https://github.com/GoodBoyDigital/pixi.js) by [xperiments](http://github.com/xperiments)
|
||||
@@ -641,8 +657,11 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](podcast/podcast.d.ts) [podcast](http://github.com/maxnowack/node-podcast) by [Niklas Mollenhauer](https://github.com/nikeee)
|
||||
* [:link:](poly2tri/poly2tri.d.ts) [poly2tri](http://github.com/r3mi/poly2tri.js) by [Elemar Junior](https://github.com/elemarjr)
|
||||
* [:link:](polymer/polymer.d.ts) [polymer](https://github.com/polymer) by [Louis Grignon](https://github.com/lgrignon)
|
||||
* [:link:](polymer/polymer.paper-dialog.d.ts) [polymer's paper-dialog](https://github.com/Polymer/paper-dialog) by [Louis Grignon](https://github.com/lgrignon)
|
||||
* [:link:](polymer/polymer.core-overlay.d.ts) [polymer's paper-toast](https://github.com/Polymer/core-selector) by [Louis Grignon](https://github.com/lgrignon)
|
||||
* [:link:](polymer/polymer.paper-toast.d.ts) [polymer's paper-toast](https://github.com/Polymer/paper-toast) by [Louis Grignon](https://github.com/lgrignon)
|
||||
* [:link:](polymer/polymer.core-drawer-panel.d.ts) [polymer's paper-toast](https://github.com/Polymer/core-drawer-panel) by [Louis Grignon](https://github.com/lgrignon)
|
||||
* [:link:](polymer/polymer.core-selector.d.ts) [polymer's paper-toast](https://github.com/Polymer/core-selector) by [Louis Grignon](https://github.com/lgrignon)
|
||||
* [: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)
|
||||
* [:link:](power-assert/power-assert.d.ts) [power-assert](https://github.com/twada/power-assert) by [vvakame](https://github.com/vvakame)
|
||||
@@ -717,6 +736,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [: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:](sequelize/sequelize.d.ts) [Sequelize 2.0.0 dev13](http://sequelizejs.com) by [samuelneff](https://github.com/samuelneff), [Peter Harris](https://github.com/codeanimal)
|
||||
* [:link:](on-headers/on-headers.d.ts) [serve-favicon](https://github.com/jshttp/on-headers) by [John Jeffery](https://github.com/jjeffery)
|
||||
* [:link:](serve-favicon/serve-favicon.d.ts) [serve-favicon](https://github.com/expressjs/serve-favicon) by [Uros Smolnik](https://github.com/urossmolnik)
|
||||
* [:link:](serve-static/serve-static.d.ts) [serve-static](https://github.com/expressjs/serve-static) by [Uros Smolnik](https://github.com/urossmolnik)
|
||||
* [:link:](sharedworker/SharedWorker.d.ts) [SharedWorker](http://www.w3.org/TR/workers) by [Toshiya Nakakura](https://github.com/nakakura)
|
||||
@@ -735,6 +755,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](sipml/sipml.d.ts) [SIPml5](http://sipml5.org) by [A. Groenenboom](https://github.com/chookies)
|
||||
* [:link:](sjcl/sjcl.d.ts) [sjcl](http://crypto.stanford.edu/sjcl) by [Eugene Chernyshov](https://github.com/Evgenus)
|
||||
* [:link:](slickgrid/SlickGrid.d.ts) [SlickGrid](https://github.com/mleibman/SlickGrid) by [Josh Baldwin](https://github.com/jbaldwin)
|
||||
* [:link:](slickgrid/slick.autotooltips.d.ts) [SlickGrid AutoToolTips Plugin](https://github.com/mleibman/SlickGrid) by [Ryo Iwamoto](https://github.com/ryiwamoto)
|
||||
* [:link:](slickgrid/slick.headerbuttons.d.ts) [SlickGrid HeaderButtons Plugin](https://github.com/mleibman/SlickGrid) by [Derek Cicerone](https://github.com/derekcicerone)
|
||||
* [:link:](slickgrid/slick.rowselectionmodel.d.ts) [SlickGrid RowSelectionModel Plugin](https://github.com/mleibman/SlickGrid) by [Derek Cicerone](https://github.com/derekcicerone)
|
||||
* [:link:](smoothie/smoothie.d.ts) [Smoothie Charts](https://github.com/joewalnes/smoothie) by [Drew Noakes](https://drewnoakes.com), [Mike H. Hawley](https://github.com/mikehhawley)
|
||||
@@ -753,6 +774,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](sprintf/sprintf.d.ts) [sprintff](https://github.com/maritz/node-sprintff) by [Carlos Ballesteros Velasco](https://github.com/soywiz)
|
||||
* [:link:](sharepoint/SharePoint.d.ts) [sptypescript](http://sptypescript.codeplex.com) by [Stanislav Vyshchepan](http://gandjustas.blogspot.ru), [Andrey Markeev](http://markeev.com)
|
||||
* [:link:](sqlite3/sqlite3.d.ts) [sqlite3](https://github.com/mapbox/node-sqlite3) by [Nick Malaguti](https://github.com/nmalaguti)
|
||||
* [:link:](squirejs/squirejs.d.ts) [Squire](https://github.com/iammerrick/Squire.js) by [Bradley Ayers](https://github.com/bradleyayers)
|
||||
* [:link:](stack-mapper/stack-mapper.d.ts) [stack-mapper](https://github.com/thlorenz/stack-mapper) by [Rogier Schouten](https://github.com/rogierschouten)
|
||||
* [:link:](stampit/stampit.d.ts) [stampit](https://github.com/ericelliott/stampit) by [Vasyl Boroviak](https://github.com/koresar)
|
||||
* [:link:](stats/stats.d.ts) [Stats.js r12](http://github.com/mrdoob/stats.js) by [Gregory Dalton](https://github.com/gregolai)
|
||||
@@ -774,6 +796,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](swig/swig.d.ts) [swig](http://github.com/paularmstrong/swig) by [Peter Harris](https://github.com/CodeAnimal), [Carlos Ballesteros Velasco](https://github.com/soywiz)
|
||||
* [:link:](swiper/swiper.d.ts) [Swiper](https://github.com/nolimits4web/Swiper) by [Sebastián Galiano](https://github.com/sgaliano)
|
||||
* [:link:](swipeview/swipeview.d.ts) [SwipeView](http://cubiq.org/swipeview) by [Boris Yankov](https://github.com/borisyankov)
|
||||
* [:link:](switchery/switchery.d.ts) [switchery](https://github.com/abpetkov/switchery) by [Bruno Grieder](https://github.com/bgrieder)
|
||||
* [: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)
|
||||
@@ -803,7 +826,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](timezonecomplete/timezonecomplete.d.ts) [timezonecomplete](https://github.com/SpiritIT/timezonecomplete) by [Rogier Schouten](https://github.com/rogierschouten)
|
||||
* [:link:](tv4/tv4.d.ts) [Tiny Validator tv4](https://github.com/geraintluff/tv4) by [Bart van der Schoor](https://github.com/Bartvds)
|
||||
* [:link:](tinycolor/tinycolor.d.ts) [tinycolor](https://github.com/bgrins/TinyColor) by [Mordechai Zuber](https://github.com/M-Zuber)
|
||||
* [:link:](titanium/titanium.d.ts) [Titanium Movile 3.1.3.GA](http://www.appcelerator.com) by [Airam Rguez](https://github.com/airamrguez)
|
||||
* [:link:](titanium/titanium.d.ts) [Titanium Mobile](http://www.appcelerator.com) by [Craig Younkins](https://github.com/cyounkins)
|
||||
* [:link:](tmp/tmp.d.ts) [tmp](https://www.npmjs.com/package/tmp) by [Jared Klopper](https://github.com/optical)
|
||||
* [:link:](toastr/toastr.d.ts) [Toastr](https://github.com/CodeSeven/toastr) by [Boris Yankov](https://github.com/borisyankov)
|
||||
* [:link:](sencha_touch/SenchaTouch.d.ts) [Touch](http://www.sencha.com/products/touch) by [Brian Kotek](https://github.com/brian428)
|
||||
@@ -818,6 +841,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](type-detect/type-detect.d.ts) [type-detect](https://github.com/chaijs/type-detect) by [Bart van der Schoor](https://github.com/Bartvds)
|
||||
* [:link:](typeahead/typeahead.d.ts) [typeahead.js](http://twitter.github.io/typeahead.js) by [Ivaylo Gochkov](https://github.com/igochkov), [Gidon Junge](https://github.com/gjunge)
|
||||
* [:link:](typescript/typescript.d.ts) [TypeScript API](http://www.typescriptlang.org) by [Microsoft TypeScript](http://typescriptlang.org)
|
||||
* [:link:](typescript-deferred/typescript-deferred.d.ts) [typescript-deferred](https://github.com/DirtyHairy/typescript-deferred) by [Christian Speckner](https://github.com/DirtyHairy)
|
||||
* [:link:](typescript-services/typescriptServices.d.ts) [TypeScript-Services](https://www.npmjs.org/package/typescript-services) by [Basarat Ali Syed](http://github.com/basarat)
|
||||
* [:link:](unity-webapi/unity-webapi.d.ts) [Ubuntu Unity Web API](https://launchpad.net/libunity-webapps) by [John Vrbanac](jhttps://github.com/jmvrbanac)
|
||||
* [:link:](underscore/underscore.d.ts) [Underscore](http://underscorejs.org) by [Boris Yankov](https://github.com/borisyankov), [Josh Baldwin](https://github.com/jbaldwin)
|
||||
@@ -834,6 +858,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](validator/validator.d.ts) [validator.js](https://github.com/chriso/validator.js) by [tgfjt](https://github.com/tgfjt)
|
||||
* [:link:](vega/vega.d.ts) [Vega](http://trifacta.github.io/vega) by [Tom Crockett](http://github.com/pelotom)
|
||||
* [:link:](velocity-animate/velocity-animate.d.ts) [Velocity](http://velocityjs.org) by [Greg Smith](https://github.com/smrq)
|
||||
* [:link:](vex-js/vex-js.d.ts) [Vex](https://github.com/HubSpot/vex) by [Greg Cohan](https://github.com/gdcohan)
|
||||
* [:link:](videojs/videojs.d.ts) [Video.js](https://github.com/zencoder/video-js) by [Vincent Bortone](https://github.com/vbortone)
|
||||
* [:link:](vimeo/froogaloop.d.ts) [Vimeo](http://developer.vimeo.com/player/js-api) by [Daz Wilkin](https://github.com/DazWilkin)
|
||||
* [:link:](vinyl/vinyl.d.ts) [vinyl](https://github.com/wearefractal/vinyl) by [vvakame](https://github.com/vvakame), [jedmao](https://github.com/jedmao)
|
||||
@@ -847,12 +872,14 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](webmidi/webmidi.d.ts) [Web MIDI API](http://www.w3.org/TR/webmidi) by [Toshiya Nakakura](https://github.com/nakakura)
|
||||
* [:link:](webspeechapi/webspeechapi.d.ts) [Web Speech API](https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html) by [SaschaNaz](https://github.com/saschanaz)
|
||||
* [:link:](webcola/webcola.d.ts) [webcola](https://github.com/tgdwyer/WebCola) by [Qinfeng Chen](https://github.com/qinfchen)
|
||||
* [:link:](webcomponents.js/webcomponents.js.d.ts) [webcomponents.js](https://github.com/webcomponents/webcomponentsjs) by [Adi Dahiya](https://github.com/adidahiya)
|
||||
* [:link:](webcrypto/WebCrypto.d.ts) [WebCrypto](http://www.w3.org/TR/WebCryptoAPI) by [Lucas Dixon](https://github.com/iislucas)
|
||||
* [:link:](webix/webix.d.ts) [Webix UI](http://webix.com) by [Maksim Kozhukh](http://github.com/mkozhukh)
|
||||
* [: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), [Wim Looman](https://github.com/Nemo157)
|
||||
* [:link:](which/which.d.ts) [which](https://github.com/isaacs/node-which) by [vvakame](https://github.com/vvakame)
|
||||
* [:link:](jquery.window/jquery.window.d.ts) [Window plugin for jQuery](http://fstoke.me/jquery/window) by [Ryan Graham](https://github.com/ryan-codingintrigue)
|
||||
* [:link:](windows-service/windows-service.d.ts) [windows-service](https://bitbucket.org/stephenwvickers/node-windows-service) by [Rogier Schouten](https://github.com/rogierschouten)
|
||||
* [:link:](winjs/winjs.d.ts) [WinJS](http://try.buildwinjs.com) by [TypeScript samples](https://www.typescriptlang.org), [Adam Hewitt](https://github.com/adamhewitt627), [Craig Treasure](https://github.com/craigktreasure), [Jeff Fisher](https://github.com/xirzec)
|
||||
* [:link:](winrt/winrt.d.ts) [WinRT](http://msdn.microsoft.com/en-us/library/windows/apps/br211377.aspx) by [TypeScript samples](https://www.typescriptlang.org)
|
||||
@@ -866,6 +893,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](xpath/xpath.d.ts) [xpath](https://github.com/goto100/xpath) by [Andrew Bradley](https://github.com/cspotcode)
|
||||
* [:link:](xregexp/xregexp.d.ts) [XRegExp](http://xregexp.com) by [Bart van der Schoor](https://github.com/Bartvds)
|
||||
* [:link:](xsockets/XSockets.d.ts) [XSockets.NET](http://xsockets.net) by [Jeffery Grajkowski](https://github.com/pushplay)
|
||||
* [:link:](yamljs/yamljs.d.ts) [yamljs](https://github.com/jeremyfa/yaml.js) by [Tim Jonischkat](http://www.tim-jonischkat.de)
|
||||
* [:link:](yargs/yargs.d.ts) [yargs](https://github.com/chevex/yargs) by [Martin Poelstra](https://github.com/poelstra)
|
||||
* [:link:](yeoman-generator/yeoman-generator.d.ts) [yeoman-generator](https://github.com/yeoman/generator) by [Kentaro Okuno](http://github.com/armorik83)
|
||||
* [:link:](yosay/yosay.d.ts) [yosay](https://github.com/yeoman/yosay) by [Kentaro Okuno](http://github.com/armorik83)
|
||||
|
||||
30
acorn/acorn-tests.ts
Normal file
30
acorn/acorn-tests.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
/// <reference path="../estree/estree.d.ts" />
|
||||
/// <reference path="acorn.d.ts" />
|
||||
|
||||
import acorn = require('acorn');
|
||||
|
||||
var token: acorn.Token;
|
||||
var tokens: acorn.Token[];
|
||||
var comment: acorn.Comment;
|
||||
var comments: acorn.Comment[];
|
||||
var program: ESTree.Program;
|
||||
var any: any;
|
||||
var string: string;
|
||||
|
||||
// acorn
|
||||
string = acorn.version;
|
||||
program = acorn.parse('code');
|
||||
program = acorn.parse('code', {range: true, onToken: tokens, onComment: comments});
|
||||
program = acorn.parse('code', {
|
||||
ranges: true,
|
||||
onToken: (token) => tokens.push(token),
|
||||
onComment: (isBlock, text, start, end) => { }
|
||||
});
|
||||
|
||||
// Token
|
||||
token = tokens[0];
|
||||
string = token.type.label;
|
||||
any = token.value;
|
||||
|
||||
// Comment
|
||||
string = comment.value;
|
||||
67
acorn/acorn.d.ts
vendored
Normal file
67
acorn/acorn.d.ts
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
// Type definitions for Acorn v1.0.1
|
||||
// Project: https://github.com/marijnh/acorn
|
||||
// Definitions by: RReverser <https://github.com/RReverser>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../estree/estree.d.ts" />
|
||||
|
||||
declare module acorn {
|
||||
var version: string;
|
||||
function parse(input: string, options?: Options): ESTree.Program;
|
||||
function parseExpressionAt(input: string, pos: number, options?: Options): ESTree.Expression;
|
||||
var defaultOptions: Options;
|
||||
|
||||
interface TokenType {
|
||||
label: string;
|
||||
keyword: string;
|
||||
beforeExpr: boolean;
|
||||
startsExpr: boolean;
|
||||
isLoop: boolean;
|
||||
isAssign: boolean;
|
||||
prefix: boolean;
|
||||
postfix: boolean;
|
||||
binop: number;
|
||||
updateContext: (prevType: TokenType) => any;
|
||||
}
|
||||
|
||||
interface AbstractToken {
|
||||
start: number;
|
||||
end: number;
|
||||
loc: ESTree.SourceLocation;
|
||||
range: [number, number];
|
||||
}
|
||||
|
||||
interface Token extends AbstractToken {
|
||||
type: TokenType;
|
||||
value: any;
|
||||
}
|
||||
|
||||
interface Comment extends AbstractToken {
|
||||
type: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
interface Options {
|
||||
ecmaVersion?: number;
|
||||
sourceType?: string;
|
||||
onInsertedSemicolon?: (lastTokEnd: number, lastTokEndLoc?: ESTree.Position) => any;
|
||||
onTrailingComma?: (lastTokEnd: number, lastTokEndLoc?: ESTree.Position) => any;
|
||||
allowReserved?: boolean;
|
||||
allowReturnOutsideFunction?: boolean;
|
||||
allowImportExportEverywhere?: boolean;
|
||||
allowHashBang?: boolean;
|
||||
locations?: boolean;
|
||||
onToken?: ((token: Token) => any) | Token[];
|
||||
onComment?: ((isBlock: boolean, text: string, start: number, end: number, startLoc?: ESTree.Position, endLoc?: ESTree.Position) => any) | Comment[];
|
||||
ranges?: boolean;
|
||||
program?: ESTree.Program;
|
||||
sourceFile?: string;
|
||||
directSourceFile?: string;
|
||||
preserveParens?: boolean;
|
||||
plugins?: { [name: string]: Function; };
|
||||
}
|
||||
}
|
||||
|
||||
declare module "acorn" {
|
||||
export = acorn
|
||||
}
|
||||
53
angular-growl-v2/angular-growl-v2-test.ts
Normal file
53
angular-growl-v2/angular-growl-v2-test.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
/// <reference path="angular-growl-v2.d.ts" />
|
||||
|
||||
var app = angular.module("ag", ["pascalprecht.translate", "$httpProvider"]);
|
||||
|
||||
app.config((growlProvider:angular.growl.IGrowlProvider, $httpProvider:angular.IHttpProvider) => {
|
||||
var ttl:angular.growl.IGrowlTTLConfig = {
|
||||
success: 5000,
|
||||
error: 4000
|
||||
};
|
||||
|
||||
growlProvider.globalTimeToLive(ttl);
|
||||
growlProvider.globalTimeToLive(5000);
|
||||
growlProvider.globalDisableCloseButton(true);
|
||||
growlProvider.globalDisableIcons(true);
|
||||
growlProvider.globalReversedOrder(false);
|
||||
growlProvider.globalDisableCountDown(true);
|
||||
growlProvider.messageVariableKey("someKey");
|
||||
growlProvider.globalInlineMessages(false);
|
||||
growlProvider.globalPosition("top-center");
|
||||
growlProvider.messagesKey("someKey");
|
||||
growlProvider.messageTextKey("someKey");
|
||||
growlProvider.messageTitleKey("someKey");
|
||||
growlProvider.messageSeverityKey("someKey");
|
||||
growlProvider.onlyUniqueMessages(false);
|
||||
|
||||
$httpProvider.interceptors.push(growlProvider.serverMessagesInterceptor);
|
||||
});
|
||||
|
||||
app.controller("Ctrl", ($scope:angular.IScope, growl:angular.growl.IGrowlService) => {
|
||||
var config:angular.growl.IGrowlMessageConfig = {
|
||||
ttl: 5000,
|
||||
disableCountDown: true,
|
||||
disableCloseButton: true
|
||||
};
|
||||
|
||||
var message = "Some message";
|
||||
|
||||
growl.warning(message);
|
||||
growl.warning(message, config);
|
||||
growl.error(message);
|
||||
growl.error(message, config);
|
||||
growl.info(message);
|
||||
growl.info(message, config);
|
||||
growl.success(message);
|
||||
growl.success(message, config);
|
||||
growl.general(message);
|
||||
growl.general(message, config);
|
||||
growl.general(message, config, "error");
|
||||
growl.onlyUnique();
|
||||
growl.reverseOrder();
|
||||
growl.inlineMessages();
|
||||
growl.position();
|
||||
});
|
||||
211
angular-growl-v2/angular-growl-v2.d.ts
vendored
Normal file
211
angular-growl-v2/angular-growl-v2.d.ts
vendored
Normal file
@@ -0,0 +1,211 @@
|
||||
// Type definitions for Angular Growl 2 v.0.7.3
|
||||
// Project: http://janstevens.github.io/angular-growl-2
|
||||
// Definitions by: Tadeusz Hucal <https://github.com/mkp05>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../angularjs/angular.d.ts" />
|
||||
|
||||
declare module angular.growl {
|
||||
|
||||
/**
|
||||
* Global Time-To-Leave configuration.
|
||||
*/
|
||||
interface IGrowlTTLConfig {
|
||||
success?: number;
|
||||
error?: number;
|
||||
warning?: number;
|
||||
info?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom configuration used in single message call.
|
||||
*/
|
||||
interface IGrowlMessageConfig {
|
||||
title?: string;
|
||||
ttl?: number;
|
||||
disableCountDown?: boolean;
|
||||
disableIcons?: boolean;
|
||||
disableCloseButton?: boolean;
|
||||
referenceId?: number;
|
||||
onclose?: Function;
|
||||
onopen?: Function;
|
||||
}
|
||||
|
||||
/**
|
||||
* Growl message with configuration.
|
||||
*/
|
||||
interface IGrowlMessage extends IGrowlMessageConfig {
|
||||
text: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Growl service provider.
|
||||
*/
|
||||
interface IGrowlProvider extends angular.IServiceProvider {
|
||||
/**
|
||||
* Pre-defined server error interceptor.
|
||||
*/
|
||||
serverMessagesInterceptor: (string|Function)[];
|
||||
|
||||
/**
|
||||
* Set default TTL settings.
|
||||
* @param ttl configuration of TTL for different type of message
|
||||
*/
|
||||
globalTimeToLive(ttl: IGrowlTTLConfig): void;
|
||||
/**
|
||||
* Set default TTL settings.
|
||||
* @param ttl ttl in milliseconds
|
||||
*/
|
||||
globalTimeToLive(ttl: number): void;
|
||||
/**
|
||||
* Set default setting for disabling close button.
|
||||
* @param disableCloseButton
|
||||
*/
|
||||
globalDisableCloseButton(disableCloseButton: boolean): void;
|
||||
/**
|
||||
* Set default setting for disabling icons.
|
||||
* @param disableIcons
|
||||
*/
|
||||
globalDisableIcons(disableIcons: boolean): void;
|
||||
/**
|
||||
* Set reversing order of displaying new messages.
|
||||
* @param reverseOrder
|
||||
*/
|
||||
globalReversedOrder(reverseOrder: boolean): void
|
||||
/**
|
||||
* Set default setting for displaying message disappear countdown.
|
||||
* @param disableCountDown
|
||||
*/
|
||||
globalDisableCountDown(disableCountDown: boolean): void;
|
||||
/**
|
||||
* Set default allowance for inline messages.
|
||||
* @param inline
|
||||
*/
|
||||
globalInlineMessages(inline: boolean): void;
|
||||
/**
|
||||
* Set default message position.
|
||||
* @param position
|
||||
*/
|
||||
globalPosition(position: string): void;
|
||||
/**
|
||||
* Enable/disable displaying only unique messages.
|
||||
* @param onlyUniqueMessages
|
||||
*/
|
||||
onlyUniqueMessages(onlyUniqueMessages: boolean): void;
|
||||
|
||||
/**
|
||||
* Set key where messages are stored (for http interceptor).
|
||||
* @param messageVariableKey
|
||||
*/
|
||||
messagesKey(messageKey: string): void;
|
||||
/**
|
||||
* Set key where message text is stored (for http interceptor).
|
||||
* @param messageVariableKey
|
||||
*/
|
||||
messageTextKey(messageTextKey: string): void;
|
||||
/**
|
||||
* Set key where title of message is stored (for http interceptor).
|
||||
* @param messageVariableKey
|
||||
*/
|
||||
messageTitleKey(messageTitleKey: string): void;
|
||||
/**
|
||||
* Set key where severity of message is stored (for http interceptor).
|
||||
* @param messageVariableKey
|
||||
*/
|
||||
messageSeverityKey(messageSeverityKey: string): void;
|
||||
/**
|
||||
* Set key where variables for message are stored (for http interceptor).
|
||||
* @param messageVariableKey
|
||||
*/
|
||||
messageVariableKey(messageVariableKey: string): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Growl service.
|
||||
*/
|
||||
interface IGrowlService {
|
||||
/**
|
||||
* Show warning message.
|
||||
* @param message text to display (or code for angular-translate)
|
||||
*/
|
||||
warning(message: string): IGrowlMessage;
|
||||
/**
|
||||
* Show warning message.
|
||||
* @param message text to display (or code for angular-translate)
|
||||
* @param config additional message configuration
|
||||
*/
|
||||
warning(message: string, config: IGrowlMessageConfig): IGrowlMessage;
|
||||
|
||||
/**
|
||||
* Show error message.
|
||||
* @param message text to display (or code for angular-translate)
|
||||
*/
|
||||
error(message: string): IGrowlMessage;
|
||||
/**
|
||||
* Show error message.
|
||||
* @param message text to display (or code for angular-translate)
|
||||
* @param config additional message configuration
|
||||
*/
|
||||
error(message: string, config: IGrowlMessageConfig): IGrowlMessage;
|
||||
|
||||
/**
|
||||
* Show information message.
|
||||
* @param message text to display (or code for angular-translate)
|
||||
*/
|
||||
info(message: string): IGrowlMessage;
|
||||
/**
|
||||
* Show information message.
|
||||
* @param message text to display (or code for angular-translate)
|
||||
* @param config additional message configuration
|
||||
*/
|
||||
info(message: string, config: IGrowlMessageConfig): IGrowlMessage;
|
||||
|
||||
/**
|
||||
* Show success message.
|
||||
* @param message text to display (or code for angular-translate)
|
||||
* @param config additional message configuration
|
||||
*/
|
||||
success(message: string): IGrowlMessage;
|
||||
/**
|
||||
* Show success message.
|
||||
* @param message text to display (or code for angular-translate)
|
||||
*/
|
||||
success(message: string, config: IGrowlMessageConfig): IGrowlMessage;
|
||||
|
||||
/**
|
||||
* Show message (generic).
|
||||
* @param message text to display (or code for angular-translate)
|
||||
*/
|
||||
general(message: string): IGrowlMessage;
|
||||
/**
|
||||
* Show message (generic).
|
||||
* @param message text to display (or code for angular-translate)
|
||||
* @param config additional message configuration
|
||||
*/
|
||||
general(message: string, config: IGrowlMessageConfig): IGrowlMessage;
|
||||
/**
|
||||
* Show message (generic).
|
||||
* @param message text to display (or code for angular-translate)
|
||||
* @param config additional message configuration
|
||||
* @param severity message severity (error, warning, success, info).
|
||||
*/
|
||||
general(message: string, config: IGrowlMessageConfig, severity: string): IGrowlMessage;
|
||||
|
||||
/**
|
||||
* Get current setting for displaying only unique messages.
|
||||
*/
|
||||
onlyUnique(): boolean;
|
||||
/**
|
||||
* Get current setting for reversing messages order.
|
||||
*/
|
||||
reverseOrder(): boolean;
|
||||
/**
|
||||
* Get current allowance for inline messages.
|
||||
*/
|
||||
inlineMessages(): boolean;
|
||||
/**
|
||||
* Get current messages position.
|
||||
*/
|
||||
position(): string;
|
||||
}
|
||||
}
|
||||
18
angular-material/angular-material.d.ts
vendored
18
angular-material/angular-material.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Angular Material 0.8.3+ (ng.material module)
|
||||
// Type definitions for Angular Material 0.8.3+ (angular.material module)
|
||||
// Project: https://github.com/angular/material
|
||||
// Definitions by: Matt Traynham <https://github.com/mtraynham>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
@@ -12,14 +12,14 @@ declare module angular.material {
|
||||
controller?: any;
|
||||
locals?: {[index: string]: any};
|
||||
targetEvent?: any;
|
||||
resolve?: {[index: string]: ng.IPromise<any>}
|
||||
resolve?: {[index: string]: angular.IPromise<any>}
|
||||
controllerAs?: string;
|
||||
parent?: Element;
|
||||
disableParentScroll?: boolean;
|
||||
}
|
||||
|
||||
interface MDBottomSheetService {
|
||||
show(options: MDBottomSheetOptions): ng.IPromise<any>;
|
||||
show(options: MDBottomSheetOptions): angular.IPromise<any>;
|
||||
hide(response?: any): void;
|
||||
cancel(response?: any): void;
|
||||
}
|
||||
@@ -49,14 +49,14 @@ declare module angular.material {
|
||||
controller?: any;
|
||||
locals?: {[index: string]: any};
|
||||
bindToController?: boolean;
|
||||
resolve?: {[index: string]: ng.IPromise<any>}
|
||||
resolve?: {[index: string]: angular.IPromise<any>}
|
||||
controllerAs?: string;
|
||||
parent?: Element;
|
||||
onComplete?: Function;
|
||||
}
|
||||
|
||||
interface MDDialogService {
|
||||
show(dialog: MDDialogOptions|MDPresetDialog<any>): ng.IPromise<any>;
|
||||
show(dialog: MDDialogOptions|MDPresetDialog<any>): angular.IPromise<any>;
|
||||
confirm(): MDConfirmDialog;
|
||||
alert(): MDAlertDialog;
|
||||
hide(response?: any): void;
|
||||
@@ -64,7 +64,7 @@ declare module angular.material {
|
||||
}
|
||||
|
||||
interface MDIcon {
|
||||
(path: string): ng.IPromise<Element>;
|
||||
(path: string): angular.IPromise<Element>;
|
||||
}
|
||||
|
||||
interface MDIconProvider {
|
||||
@@ -110,14 +110,14 @@ declare module angular.material {
|
||||
controller?: any;
|
||||
locals?: {[index: string]: any};
|
||||
bindToController?: boolean;
|
||||
resolve?: {[index: string]: ng.IPromise<any>}
|
||||
resolve?: {[index: string]: angular.IPromise<any>}
|
||||
controllerAs?: string;
|
||||
parent?: Element;
|
||||
}
|
||||
|
||||
interface MDToastService {
|
||||
show(optionsOrPreset: MDToastOptions|MDToastPreset<any>): ng.IPromise<any>;
|
||||
showSimple(): ng.IPromise<any>;
|
||||
show(optionsOrPreset: MDToastOptions|MDToastPreset<any>): angular.IPromise<any>;
|
||||
showSimple(): angular.IPromise<any>;
|
||||
simple(): MDSimpleToastPreset;
|
||||
build(): MDToastPreset<any>;
|
||||
updateContent(): void;
|
||||
|
||||
@@ -190,15 +190,15 @@ declare module angular.ui.bootstrap {
|
||||
/**
|
||||
* a promise that is resolved when a modal is closed and rejected when a modal is dismissed
|
||||
*/
|
||||
result: ng.IPromise<any>;
|
||||
result: angular.IPromise<any>;
|
||||
|
||||
/**
|
||||
* a promise that is resolved when a modal gets opened after downloading content's template and resolving all variables
|
||||
*/
|
||||
opened: ng.IPromise<any>;
|
||||
opened: angular.IPromise<any>;
|
||||
}
|
||||
|
||||
interface IModalScope extends ng.IScope {
|
||||
interface IModalScope extends angular.IScope {
|
||||
/**
|
||||
* Those methods make it easy to close a modal window without a need to create a dedicated controller
|
||||
*/
|
||||
@@ -623,7 +623,7 @@ declare module angular.ui.bootstrap {
|
||||
*
|
||||
* @return A promise that is resolved when the transition finishes.
|
||||
*/
|
||||
(element: ng.IAugmentedJQuery, trigger: any, options?: ITransitionServiceOptions): ng.IPromise<ng.IAugmentedJQuery>;
|
||||
(element: angular.IAugmentedJQuery, trigger: any, options?: ITransitionServiceOptions): angular.IPromise<angular.IAugmentedJQuery>;
|
||||
}
|
||||
|
||||
interface ITransitionServiceOptions {
|
||||
|
||||
6
angular-ui-router/angular-ui-router.d.ts
vendored
6
angular-ui-router/angular-ui-router.d.ts
vendored
@@ -62,7 +62,7 @@ declare module angular.ui {
|
||||
reloadOnSearch?: boolean;
|
||||
}
|
||||
|
||||
interface IStateProvider extends IServiceProvider {
|
||||
interface IStateProvider extends ng.IServiceProvider {
|
||||
state(name:string, config:IState): IStateProvider;
|
||||
state(config:IState): IStateProvider;
|
||||
decorator(name?: string, decorator?: (state: IState, parent: Function) => any): any;
|
||||
@@ -81,7 +81,7 @@ declare module angular.ui {
|
||||
type(name: string, definition: any, definitionFn?: any): any;
|
||||
}
|
||||
|
||||
interface IUrlRouterProvider extends IServiceProvider {
|
||||
interface IUrlRouterProvider extends ng.IServiceProvider {
|
||||
when(whenPath: RegExp, handler: Function): IUrlRouterProvider;
|
||||
when(whenPath: RegExp, handler: any[]): IUrlRouterProvider;
|
||||
when(whenPath: RegExp, toPath: string): IUrlRouterProvider;
|
||||
@@ -143,7 +143,7 @@ declare module angular.ui {
|
||||
*
|
||||
* @param options Options object.
|
||||
*/
|
||||
go(to: string, params?: {}, options?: IStateOptions): IPromise<any>;
|
||||
go(to: string, params?: {}, options?: IStateOptions): ng.IPromise<any>;
|
||||
transitionTo(state: string, params?: {}, updateLocation?: boolean): void;
|
||||
transitionTo(state: string, params?: {}, options?: IStateOptions): void;
|
||||
includes(state: string, params?: {}): boolean;
|
||||
|
||||
35
angularjs/angular.d.ts
vendored
35
angularjs/angular.d.ts
vendored
@@ -452,9 +452,9 @@ declare module angular {
|
||||
$invalid: boolean;
|
||||
$submitted: boolean;
|
||||
$error: any;
|
||||
$addControl(control: ng.INgModelController): void;
|
||||
$removeControl(control: ng.INgModelController): void;
|
||||
$setValidity(validationErrorKey: string, isValid: boolean, control: ng.INgModelController): void;
|
||||
$addControl(control: INgModelController): void;
|
||||
$removeControl(control: INgModelController): void;
|
||||
$setValidity(validationErrorKey: string, isValid: boolean, control: INgModelController): void;
|
||||
$setDirty(): void;
|
||||
$setPristine(): void;
|
||||
$commitViewValue(): void;
|
||||
@@ -509,7 +509,7 @@ declare module angular {
|
||||
}
|
||||
|
||||
interface IAsyncModelValidators {
|
||||
[index: string]: (...args: any[]) => ng.IPromise<boolean>;
|
||||
[index: string]: (...args: any[]) => IPromise<boolean>;
|
||||
}
|
||||
|
||||
interface IModelParser {
|
||||
@@ -665,6 +665,7 @@ declare module angular {
|
||||
// TODO undocumented, so we need to get it from the source code
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
interface IBrowserService {
|
||||
defer: ng.ITimeoutService;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
@@ -931,11 +932,19 @@ declare module angular {
|
||||
/**
|
||||
* Combines multiple promises into a single promise that is resolved when all of the input promises are resolved.
|
||||
*
|
||||
* Returns a single promise that will be resolved with an array/hash of values, each value corresponding to the promise at the same index/key in the promises array/hash. If any of the promises is resolved with a rejection, this resulting promise will be rejected with the same rejection value.
|
||||
* Returns a single promise that will be resolved with an array of values, each value corresponding to the promise at the same index in the promises array. If any of the promises is resolved with a rejection, this resulting promise will be rejected with the same rejection value.
|
||||
*
|
||||
* @param promises An array or hash of promises.
|
||||
* @param promises An array of promises.
|
||||
*/
|
||||
all(promises: IPromise<any>[]|{ [id: string]: IPromise<any>; }): IPromise<any[]>;
|
||||
all(promises: IPromise<any>[]): IPromise<any[]>;
|
||||
/**
|
||||
* Combines multiple promises into a single promise that is resolved when all of the input promises are resolved.
|
||||
*
|
||||
* Returns a single promise that will be resolved with a hash of values, each value corresponding to the promise at the same key in the promises hash. If any of the promises is resolved with a rejection, this resulting promise will be rejected with the same rejection value.
|
||||
*
|
||||
* @param promises A hash of promises.
|
||||
*/
|
||||
all(promises: { [id: string]: IPromise<any>; }): IPromise<{ [id: string]: any; }>;
|
||||
/**
|
||||
* Creates a Deferred object which represents a task which will finish in the future.
|
||||
*/
|
||||
@@ -1573,12 +1582,12 @@ declare module angular {
|
||||
* $delegate - The original service instance, which can be monkey patched, configured, decorated or delegated to.
|
||||
*/
|
||||
decorator(name: string, inlineAnnotatedFunction: any[]): void;
|
||||
factory(name: string, serviceFactoryFunction: Function): ng.IServiceProvider;
|
||||
factory(name: string, inlineAnnotatedFunction: any[]): ng.IServiceProvider;
|
||||
provider(name: string, provider: ng.IServiceProvider): ng.IServiceProvider;
|
||||
provider(name: string, serviceProviderConstructor: Function): ng.IServiceProvider;
|
||||
service(name: string, constructor: Function): ng.IServiceProvider;
|
||||
value(name: string, value: any): ng.IServiceProvider;
|
||||
factory(name: string, serviceFactoryFunction: Function): IServiceProvider;
|
||||
factory(name: string, inlineAnnotatedFunction: any[]): IServiceProvider;
|
||||
provider(name: string, provider: IServiceProvider): IServiceProvider;
|
||||
provider(name: string, serviceProviderConstructor: Function): IServiceProvider;
|
||||
service(name: string, constructor: Function): IServiceProvider;
|
||||
value(name: string, value: any): IServiceProvider;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
13
auth0.lock/auth0.lock-tests.ts
Normal file
13
auth0.lock/auth0.lock-tests.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
/// <reference path="../auth0/auth0.d.ts" />
|
||||
/// <reference path="auth0.lock.d.ts" />
|
||||
|
||||
var lock: Auth0LockStatic = new Auth0Lock("dsa7d77dsa7d7", "mine.auth0.com");
|
||||
|
||||
lock.showSignin({
|
||||
connections: ["facebook", "google-oauth2", "twitter", "Username-Password-Authentication"],
|
||||
icon: "https://contoso.com/logo-32.png",
|
||||
socialBigButtons: true
|
||||
},
|
||||
() => {
|
||||
// The Auth0 Widget is now loaded.
|
||||
});
|
||||
80
auth0.lock/auth0.lock.d.ts
vendored
Normal file
80
auth0.lock/auth0.lock.d.ts
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
// Type definitions for Auth0Widget.js
|
||||
// Project: http://auth0.com
|
||||
// Definitions by: Robert McLaws <https://github.com/advancedrei>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../auth0/auth0.d.ts" />
|
||||
|
||||
interface Auth0LockPopupOptions {
|
||||
width: number;
|
||||
height: number;
|
||||
left: number;
|
||||
top: number;
|
||||
}
|
||||
|
||||
interface Auth0LockOptions {
|
||||
authParams?: any;
|
||||
callbackURL?: string;
|
||||
connections?: string[];
|
||||
container?: string;
|
||||
closable?: boolean;
|
||||
dict?: any;
|
||||
defaultUserPasswordConnection?: string;
|
||||
defaultADUsernameFromEmailPrefix?: boolean;
|
||||
disableResetAction?: boolean;
|
||||
disableSignupAction?: boolean;
|
||||
focusInput?: boolean;
|
||||
forceJSONP?: boolean;
|
||||
gravatar?: boolean;
|
||||
integratedWindowsLogin?: boolean;
|
||||
loginAfterSignup?: boolean;
|
||||
popup?: boolean;
|
||||
popupOptions?: Auth0LockPopupOptions;
|
||||
rememberLastLogin?: boolean;
|
||||
resetLink?: string;
|
||||
responseType?: string;
|
||||
signupLink?: string;
|
||||
socialBigButtons?: boolean;
|
||||
sso?: boolean;
|
||||
theme?: string;
|
||||
usernameStyle?: any;
|
||||
}
|
||||
|
||||
interface Auth0LockConstructorOptions {
|
||||
cdn?: string;
|
||||
assetsUrl?: string;
|
||||
useCordovaSocialPlugins?: boolean;
|
||||
}
|
||||
|
||||
interface Auth0LockStatic {
|
||||
new (clientId: string, domain: string, options?: Auth0LockConstructorOptions): Auth0LockStatic;
|
||||
|
||||
show(): void;
|
||||
show(options: Auth0LockOptions): void;
|
||||
show(callback: (error?: Auth0Error, profile?: Auth0UserProfile, token?: string) => void) : void;
|
||||
show(options: Auth0LockOptions, callback: (error?: Auth0Error, profile?: Auth0UserProfile, token?: string) => void) : void;
|
||||
|
||||
showSignin(): void;
|
||||
showSignin(options: Auth0LockOptions): void;
|
||||
showSignin(callback: (error?: Auth0Error, profile?: Auth0UserProfile, token?: string) => void) : void;
|
||||
showSignin(options: Auth0LockOptions, callback: (error?: Auth0Error, profile?: Auth0UserProfile, token?: string) => void) : void;
|
||||
|
||||
showSignup(): void;
|
||||
showSignup(options: Auth0LockOptions): void;
|
||||
showSignup(callback: (error?: Auth0Error) => void) : void;
|
||||
showSignup(options: Auth0LockOptions, callback: (error?: Auth0Error) => void) : void;
|
||||
|
||||
showReset(): void;
|
||||
showReset(options: Auth0LockOptions): void;
|
||||
showReset(callback: (error?: Auth0Error) => void) : void;
|
||||
showReset(options: Auth0LockOptions, callback: (error?: Auth0Error) => void) : void;
|
||||
|
||||
hide(callback: () => void): void;
|
||||
logout(callback: () => void): void;
|
||||
}
|
||||
|
||||
declare var Auth0Lock: Auth0LockStatic;
|
||||
|
||||
declare module "Auth0Lock" {
|
||||
export = Auth0Lock;
|
||||
}
|
||||
47
autobahn/autobahn-tests.ts
Normal file
47
autobahn/autobahn-tests.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
/// <reference path="autobahn.d.ts"/>
|
||||
|
||||
class MyClass {
|
||||
add2Count: number = 0;
|
||||
session: autobahn.Session;
|
||||
|
||||
constructor(session: autobahn.Session) {
|
||||
this.session = session;
|
||||
}
|
||||
|
||||
add2(args: Array<number>): number {
|
||||
this.add2Count++;
|
||||
return args[0] + args[1];
|
||||
}
|
||||
|
||||
onEvent(args: Array<any>): void {
|
||||
console.log("Event:", args[0]);
|
||||
}
|
||||
}
|
||||
|
||||
function test_client() {
|
||||
var options: autobahn.IConnectionOptions =
|
||||
{ url: 'ws://127.0.0.1:8080/ws', realm: 'realm1' };
|
||||
|
||||
var connection = new autobahn.Connection(options);
|
||||
|
||||
connection.onopen = session => {
|
||||
var myInstance = new MyClass(session);
|
||||
|
||||
// 1) subscribe to a topic
|
||||
session.subscribe('com.myapp.hello', myInstance.onEvent);
|
||||
|
||||
// 2) publish an event
|
||||
session.publish('com.myapp.hello', ['Hello, world!']);
|
||||
|
||||
// 3) register a procedure for remoting
|
||||
session.register('com.myapp.add2', myInstance.add2);
|
||||
|
||||
// 4) call a remote procedure
|
||||
session.call<number>('com.myapp.add2', [2, 3]).then(
|
||||
res => {
|
||||
console.log("Result:", res);
|
||||
});
|
||||
};
|
||||
|
||||
connection.open();
|
||||
}
|
||||
195
autobahn/autobahn.d.ts
vendored
Normal file
195
autobahn/autobahn.d.ts
vendored
Normal file
@@ -0,0 +1,195 @@
|
||||
// Type definitions for AutobahnJS v0.9.6
|
||||
// Project: http://autobahn.ws/js/
|
||||
// Definitions by: Elad Zelingher <https://github.com/darkl/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../when/when.d.ts" />
|
||||
declare module autobahn {
|
||||
|
||||
export class Session {
|
||||
id: number;
|
||||
realm: string;
|
||||
isOpen: boolean;
|
||||
features: any;
|
||||
caller_disclose_me: boolean;
|
||||
publisher_disclose_me: boolean;
|
||||
subscriptions: ISubscription[][];
|
||||
registrations: IRegistration[];
|
||||
|
||||
constructor(transport: ITransport, defer: DeferFactory, challenge: OnChallengeHandler);
|
||||
|
||||
join(realm: string, authmethods: string[], authid: string): void;
|
||||
|
||||
leave(reason: string, message: string): void;
|
||||
|
||||
call<TResult>(procedure: string, args?: any[], kwargs?: any, options?: ICallOptions): When.Promise<TResult>;
|
||||
|
||||
publish(topic: string, args?: any[], kwargs?: any, options?: IPublishOptions): When.Promise<IPublication>;
|
||||
|
||||
subscribe(topic: string, handler: SubscribeHandler, options?: ISubscribeOptions): When.Promise<ISubscription>;
|
||||
|
||||
register(procedure: string, endpoint: RegisterEndpoint, options?: IRegisterOptions): When.Promise<IRegistration>;
|
||||
|
||||
unsubscribe(subscription: ISubscription): When.Promise<any>;
|
||||
|
||||
unregister(registration: IRegistration): When.Promise<any>;
|
||||
|
||||
prefix(prefix: string, uri: string): void;
|
||||
|
||||
resolve(curie: string): string;
|
||||
|
||||
onjoin: (roleFeatures: any) => void;
|
||||
onleave: (reason: string, details: any) => void;
|
||||
}
|
||||
|
||||
interface IInvocation {
|
||||
caller?: number;
|
||||
progress?: boolean;
|
||||
procedure: string;
|
||||
}
|
||||
|
||||
interface IEvent {
|
||||
publication: number;
|
||||
publisher?: number;
|
||||
topic: string;
|
||||
}
|
||||
|
||||
interface IResult {
|
||||
args: any[];
|
||||
kwargs: any;
|
||||
}
|
||||
|
||||
interface IError {
|
||||
error: string;
|
||||
args: any[];
|
||||
kwargs: any;
|
||||
}
|
||||
|
||||
type SubscribeHandler = (args?: any[], kwargs?: any, details?: IEvent) => void;
|
||||
|
||||
interface ISubscription {
|
||||
topic: string;
|
||||
handler: SubscribeHandler;
|
||||
options: ISubscribeOptions;
|
||||
session: Session;
|
||||
id: number;
|
||||
active: boolean;
|
||||
unsubscribe(): When.Promise<any>;
|
||||
}
|
||||
|
||||
type RegisterEndpoint = (args?: any[], kwargs?: any, details?: IInvocation) => void;
|
||||
|
||||
interface IRegistration {
|
||||
procedure: string;
|
||||
endpoint: RegisterEndpoint;
|
||||
options: IRegisterOptions;
|
||||
session: Session;
|
||||
id: number;
|
||||
active: boolean;
|
||||
unregister(): When.Promise<any>;
|
||||
}
|
||||
|
||||
interface IPublication {
|
||||
id: number;
|
||||
}
|
||||
|
||||
interface ICallOptions {
|
||||
timeout?: number;
|
||||
receive_progress?: boolean;
|
||||
disclose_me?: boolean;
|
||||
}
|
||||
|
||||
interface IPublishOptions {
|
||||
exclude?: number[];
|
||||
eligible?: number[];
|
||||
disclose_me? : Boolean;
|
||||
}
|
||||
|
||||
interface ISubscribeOptions {
|
||||
match? : string;
|
||||
}
|
||||
|
||||
interface IRegisterOptions {
|
||||
disclose_caller?: boolean;
|
||||
}
|
||||
|
||||
export class Connection {
|
||||
constructor(options?: IConnectionOptions);
|
||||
|
||||
open(): void;
|
||||
|
||||
close(reason: string, message: string): void;
|
||||
|
||||
onopen: (session: Session, details: any) => void;
|
||||
onclose: (reason: string, details: any) => boolean;
|
||||
}
|
||||
|
||||
interface ITransportDefinition {
|
||||
url?: string;
|
||||
protocols?: string[];
|
||||
type: string;
|
||||
}
|
||||
|
||||
type DeferFactory = () => any;
|
||||
|
||||
type OnChallengeHandler = (session: Session, method: string, extra: any) => When.Promise<string>;
|
||||
|
||||
interface IConnectionOptions {
|
||||
use_es6_promises?: boolean;
|
||||
// use explicit deferred factory, e.g. jQuery.Deferred or Q.defer
|
||||
use_deferred?: DeferFactory;
|
||||
transports?: ITransportDefinition[];
|
||||
retry_if_unreachable?: boolean;
|
||||
max_retries?: number;
|
||||
initial_retry_delay?: number;
|
||||
max_retry_delay?: number;
|
||||
retry_delay_growth?: number;
|
||||
retry_delay_jitter?: number;
|
||||
url?: string;
|
||||
protocols?: string[];
|
||||
onchallenge?: (session: Session, method: string, extra: any) => OnChallengeHandler;
|
||||
realm?: string;
|
||||
authmethods?: string[];
|
||||
authid?: string;
|
||||
}
|
||||
|
||||
interface ICloseEventDetails {
|
||||
wasClean: boolean;
|
||||
reason: string;
|
||||
code: number;
|
||||
}
|
||||
|
||||
interface ITransport {
|
||||
onopen: () => void;
|
||||
onmessage: (message: any[]) => void;
|
||||
onclose: (details: ICloseEventDetails) => void;
|
||||
|
||||
send(message: any[]): void;
|
||||
close(errorCode: number, reason?: string): void;
|
||||
}
|
||||
|
||||
interface ITransportFactory {
|
||||
//constructor(options: any);
|
||||
type: string;
|
||||
create(): ITransport;
|
||||
}
|
||||
|
||||
interface ITransports {
|
||||
register(name: string, factory: any): void;
|
||||
isRegistered(name: string): boolean;
|
||||
get(name: string): any;
|
||||
list(): any[];
|
||||
}
|
||||
|
||||
interface ILog {
|
||||
debug(...args: any[]): void;
|
||||
}
|
||||
|
||||
interface IUtil {
|
||||
assert(condition: boolean, message: string): void;
|
||||
}
|
||||
|
||||
var util: IUtil;
|
||||
var log: ILog;
|
||||
var transports: ITransports;
|
||||
}
|
||||
@@ -1,23 +1,18 @@
|
||||
/// <reference path="axios.d.ts" />
|
||||
|
||||
interface InputBody {
|
||||
random: number;
|
||||
}
|
||||
enum HttpMethod { GET, PUT, POST, DELETE, CONNECT, HEAD, OPTIONS, TRACE, PATCH }
|
||||
enum ResponseType { arraybuffer, blob, document, json, text }
|
||||
|
||||
interface Repository {
|
||||
id: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
function convenientGet () {
|
||||
axios.get<Repository, InputBody>("https://api.github.com/repos/mzabriskie/axios")
|
||||
.then(r => console.log(r.config.data.random));
|
||||
}
|
||||
axios.get<Repository>("https://api.github.com/repos/mzabriskie/axios")
|
||||
.then(r => console.log(r.config.method));
|
||||
|
||||
function get() {
|
||||
axios<Repository, any>({
|
||||
url: "https://api.github.com/repos/mzabriskie/axios",
|
||||
method: Axios.HTTPMethod.GET,
|
||||
headers: {},
|
||||
}).then(r => console.log("ID:" + r.data.id + " Name: " + r.data.name));
|
||||
}
|
||||
axios<Repository>({
|
||||
url: "https://api.github.com/repos/mzabriskie/axios",
|
||||
method: HttpMethod[HttpMethod.GET],
|
||||
headers: {},
|
||||
}).then(r => console.log("ID:" + r.data.id + " Name: " + r.data.name));
|
||||
|
||||
29
axios/axios.d.ts
vendored
29
axios/axios.d.ts
vendored
@@ -6,8 +6,6 @@
|
||||
/// <reference path="../es6-promise/es6-promise.d.ts"/>
|
||||
|
||||
declare module Axios {
|
||||
export enum HTTPMethod { GET, PUT, POST, DELETE, CONNECT, HEAD, OPTIONS, TRACE, PATCH }
|
||||
export enum ResponseType { arraybuffer, blob, document, json, text }
|
||||
|
||||
/**
|
||||
* <T> - request body data type
|
||||
@@ -46,7 +44,7 @@ declare module Axios {
|
||||
* indicates the type of data that the server will respond with
|
||||
* options are 'arraybuffer', 'blob', 'document', 'json', 'text'
|
||||
*/
|
||||
responseType?: Axios.ResponseType;
|
||||
responseType?: string;
|
||||
|
||||
/**
|
||||
* name of the cookie to use as a value for xsrf token
|
||||
@@ -65,14 +63,15 @@ declare module Axios {
|
||||
*/
|
||||
interface AxiosXHRConfig<T> extends AxiosXHRConfigBase<T> {
|
||||
/**
|
||||
* server URL that will be used for the request
|
||||
* server URL that will be used for the request, options are:
|
||||
* GET, PUT, POST, DELETE, CONNECT, HEAD, OPTIONS, TRACE, PATCH
|
||||
*/
|
||||
url: string;
|
||||
|
||||
/**
|
||||
* request method to be used when making the request
|
||||
*/
|
||||
method?: Axios.HTTPMethod;
|
||||
method?: string;
|
||||
|
||||
/**
|
||||
* data to be sent as the request body
|
||||
@@ -86,7 +85,7 @@ declare module Axios {
|
||||
* <T> - expected response type,
|
||||
* <U> - request body data type
|
||||
*/
|
||||
interface AxiosXHR<T, U> {
|
||||
interface AxiosXHR<T> {
|
||||
/**
|
||||
* Response that was provided by the server
|
||||
*/
|
||||
@@ -110,7 +109,7 @@ declare module Axios {
|
||||
/**
|
||||
* config that was provided to `axios` for the request
|
||||
*/
|
||||
config: AxiosXHRConfig<U>;
|
||||
config: AxiosXHRConfig<T>;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -119,40 +118,40 @@ declare module Axios {
|
||||
*/
|
||||
interface AxiosStatic {
|
||||
|
||||
<T, U>(config: AxiosXHRConfig<U>): Promise<AxiosXHR<T, U>>;
|
||||
<T>(config: AxiosXHRConfig<T>): Promise<AxiosXHR<T>>;
|
||||
|
||||
new <T, U>(config: AxiosXHRConfig<U>): Promise<AxiosXHR<T, U>>;
|
||||
new <T>(config: AxiosXHRConfig<T>): Promise<AxiosXHR<T>>;
|
||||
|
||||
/**
|
||||
* convenience alias, method = GET
|
||||
*/
|
||||
get<T, U>(url: string, config?: AxiosXHRConfigBase<U>): Promise<AxiosXHR<T, U>>;
|
||||
get<T>(url: string, config?: AxiosXHRConfigBase<T>): Promise<AxiosXHR<T>>;
|
||||
|
||||
|
||||
/**
|
||||
* convenience alias, method = DELETE
|
||||
*/
|
||||
delete<T, U>(url: string, config?: AxiosXHRConfigBase<U>): Promise<AxiosXHR<T, U>>;
|
||||
delete<T>(url: string, config?: AxiosXHRConfigBase<T>): Promise<AxiosXHR<T>>;
|
||||
|
||||
/**
|
||||
* convenience alias, method = HEAD
|
||||
*/
|
||||
head<T, U>(url: string, config?: AxiosXHRConfigBase<U>): Promise<AxiosXHR<T, U>>;
|
||||
head<T>(url: string, config?: AxiosXHRConfigBase<T>): Promise<AxiosXHR<T>>;
|
||||
|
||||
/**
|
||||
* convenience alias, method = POST
|
||||
*/
|
||||
post<T, U>(url: string, data?: any, config?: AxiosXHRConfigBase<U>): Promise<AxiosXHR<T, U>>;
|
||||
post<T>(url: string, data?: any, config?: AxiosXHRConfigBase<T>): Promise<AxiosXHR<T>>;
|
||||
|
||||
/**
|
||||
* convenience alias, method = PUT
|
||||
*/
|
||||
put<T, U>(url: string, data?: any, config?: AxiosXHRConfigBase<U>): Promise<AxiosXHR<T, U>>;
|
||||
put<T>(url: string, data?: any, config?: AxiosXHRConfigBase<T>): Promise<AxiosXHR<T>>;
|
||||
|
||||
/**
|
||||
* convenience alias, method = PATCH
|
||||
*/
|
||||
patch<T, U>(url: string, data?: any, config?: AxiosXHRConfigBase<U>): Promise<AxiosXHR<T, U>>;
|
||||
patch<T>(url: string, data?: any, config?: AxiosXHRConfigBase<T>): Promise<AxiosXHR<T>>;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
2
backbone/backbone.d.ts
vendored
2
backbone/backbone.d.ts
vendored
@@ -238,7 +238,7 @@ declare module Backbone {
|
||||
initial(n: number): TModel[];
|
||||
inject(iterator: (memo: any, element: TModel, index: number) => any, initialMemo: any, context?: any): any;
|
||||
isEmpty(object: any): boolean;
|
||||
invoke(methodName: string, arguments?: any[]): any;
|
||||
invoke(methodName: string, args?: any[]): any;
|
||||
last(): TModel;
|
||||
last(n: number): TModel[];
|
||||
lastIndexOf(element: TModel, fromIndex?: number): number;
|
||||
|
||||
68
bootstrap-touchspin/bootstrap-touchspin-tests.ts
Normal file
68
bootstrap-touchspin/bootstrap-touchspin-tests.ts
Normal file
@@ -0,0 +1,68 @@
|
||||
/// <reference path="../jquery/jquery.d.ts" />
|
||||
/// <reference path="bootstrap-touchspin.d.ts" />
|
||||
|
||||
$(function () {
|
||||
// Example 1 from http://www.virtuosoft.eu/code/bootstrap-touchspin/
|
||||
$("input[name='demo1']").TouchSpin({
|
||||
min: 0,
|
||||
max: 100,
|
||||
step: 0.1,
|
||||
decimals: 2,
|
||||
boostat: 5,
|
||||
maxboostedstep: 10,
|
||||
postfix: '%'
|
||||
});
|
||||
|
||||
// Example 2 from http://www.virtuosoft.eu/code/bootstrap-touchspin/
|
||||
$("input[name='demo2']").TouchSpin({
|
||||
min: -1000000000,
|
||||
max: 1000000000,
|
||||
stepinterval: 50,
|
||||
maxboostedstep: 10000000,
|
||||
prefix: '$'
|
||||
});
|
||||
|
||||
// Example 3 from http://www.virtuosoft.eu/code/bootstrap-touchspin/
|
||||
$("input[name='demo_vertical']").TouchSpin({
|
||||
verticalbuttons: true
|
||||
});
|
||||
|
||||
// Example 4 from http://www.virtuosoft.eu/code/bootstrap-touchspin/
|
||||
$("input[name='demo_vertical2']").TouchSpin({
|
||||
verticalbuttons: true,
|
||||
verticalupclass: 'glyphicon glyphicon-plus',
|
||||
verticaldownclass: 'glyphicon glyphicon-minus'
|
||||
});
|
||||
|
||||
// Example 5 from http://www.virtuosoft.eu/code/bootstrap-touchspin/
|
||||
$("input[name='demo3']").TouchSpin();
|
||||
|
||||
// Example 6 from http://www.virtuosoft.eu/code/bootstrap-touchspin/
|
||||
$("input[name='demo3_21']").TouchSpin({
|
||||
initval: 40
|
||||
});
|
||||
|
||||
// Example 7 from http://www.virtuosoft.eu/code/bootstrap-touchspin/
|
||||
$("input[name='demo4']").TouchSpin({
|
||||
postfix: "a button",
|
||||
postfix_extraclass: "btn btn-default"
|
||||
});
|
||||
|
||||
// Example 8 from http://www.virtuosoft.eu/code/bootstrap-touchspin/
|
||||
$("input[name='demo4_2']").TouchSpin({
|
||||
postfix: "a button",
|
||||
postfix_extraclass: "btn btn-default"
|
||||
});
|
||||
|
||||
// Example 9 from http://www.virtuosoft.eu/code/bootstrap-touchspin/
|
||||
$("input[name='demo5']").TouchSpin({
|
||||
prefix: "pre",
|
||||
postfix: "post"
|
||||
});
|
||||
|
||||
// Example 10 from http://www.virtuosoft.eu/code/bootstrap-touchspin/
|
||||
$("input[name='demo6']").TouchSpin({
|
||||
buttondown_class: "btn btn-link",
|
||||
buttonup_class: "btn btn-link"
|
||||
});
|
||||
});
|
||||
130
bootstrap-touchspin/bootstrap-touchspin.d.ts
vendored
Normal file
130
bootstrap-touchspin/bootstrap-touchspin.d.ts
vendored
Normal file
@@ -0,0 +1,130 @@
|
||||
// Type definitions for Bootstrap TouchSpin
|
||||
// Project: http://www.virtuosoft.eu/code/bootstrap-touchspin/
|
||||
// Definitions by: Albin Sunnanbo <https://github.com/albinsunnanbo>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../jquery/jquery.d.ts" />
|
||||
|
||||
/**
|
||||
* TouchSpinOptions. All options are optional
|
||||
*/
|
||||
interface TouchSpinOptions {
|
||||
/**
|
||||
* Applied when no explicit value is set on the input with the value attribute.
|
||||
* Empty string means that the value remains empty on initialization.
|
||||
*/
|
||||
initval?: number | string;
|
||||
|
||||
/**
|
||||
* Minimum value.
|
||||
*/
|
||||
min?: number;
|
||||
|
||||
/**
|
||||
* Maximum value.
|
||||
*/
|
||||
max?: number;
|
||||
|
||||
/**
|
||||
* Incremental/decremental step on up/down change.
|
||||
*/
|
||||
step?: number;
|
||||
|
||||
/**
|
||||
* How to force the value to be divisible by step value: 'none' | 'round' | 'floor' | 'ceil'
|
||||
*/
|
||||
forcestepdivisibility?: string;
|
||||
|
||||
/**
|
||||
* Number of decimal points.
|
||||
*/
|
||||
decimals?: number;
|
||||
|
||||
/**
|
||||
* Refresh rate of the spinner in milliseconds.
|
||||
*/
|
||||
stepinterval?: number;
|
||||
|
||||
/**
|
||||
* Time in milliseconds before the spinner starts to spin.
|
||||
*/
|
||||
stepintervaldelay?: number;
|
||||
|
||||
/**
|
||||
* Enables the traditional up/down buttons.
|
||||
*/
|
||||
verticalbuttons?: boolean;
|
||||
|
||||
/**
|
||||
* Class of the up button with vertical buttons mode enabled.
|
||||
*/
|
||||
verticalupclass?: string;
|
||||
|
||||
/**
|
||||
* Class of the down button with vertical buttons mode enabled.
|
||||
*/
|
||||
verticaldownclass?: string;
|
||||
|
||||
/**
|
||||
* Text before the input.
|
||||
*/
|
||||
prefix?: string;
|
||||
|
||||
/**
|
||||
* Text after the input.
|
||||
*/
|
||||
postfix?: string;
|
||||
|
||||
/**
|
||||
* Extra class(es) for prefix.
|
||||
*/
|
||||
prefix_extraclass?: string;
|
||||
|
||||
/**
|
||||
* Extra class(es) for postfix.
|
||||
*/
|
||||
postfix_extraclass?: string;
|
||||
|
||||
/**
|
||||
* If enabled, the the spinner is continually becoming faster as holding the button.
|
||||
*/
|
||||
booster?: boolean;
|
||||
|
||||
/**
|
||||
* Boost at every nth step.
|
||||
*/
|
||||
boostat?: number;
|
||||
|
||||
/**
|
||||
* Maximum step when boosted.
|
||||
*/
|
||||
maxboostedstep?: number | boolean;
|
||||
|
||||
/**
|
||||
* Enables the mouse wheel to change the value of the input.
|
||||
*/
|
||||
mousewheel?: boolean;
|
||||
|
||||
/**
|
||||
* Class(es) of down button.
|
||||
*/
|
||||
buttondown_class?: string;
|
||||
|
||||
/**
|
||||
* Class(es) of up button.
|
||||
*/
|
||||
buttonup_class?: string;
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
/**
|
||||
* Initialize TouchSpin
|
||||
*/
|
||||
TouchSpin(): JQuery;
|
||||
|
||||
/**
|
||||
* Inialize TouchSpin with options
|
||||
* @param options a TouchSpinOptions object with one or more options
|
||||
*/
|
||||
TouchSpin(options: TouchSpinOptions): JQuery;
|
||||
}
|
||||
@@ -3,7 +3,6 @@
|
||||
import core = breeze.core;
|
||||
import config = breeze.config;
|
||||
|
||||
|
||||
function test_dataType() {
|
||||
var typ = breeze.DataType.DateTime;
|
||||
var nm = typ.getName();
|
||||
@@ -888,4 +887,4 @@ function test_config() {
|
||||
config.registerType(f1, "myCtor");
|
||||
s = config.stringifyPad;
|
||||
o = config.typeRegistry;
|
||||
}
|
||||
}
|
||||
|
||||
28
calq/calq-tests.ts
Normal file
28
calq/calq-tests.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
/// <reference path="calq.d.ts" />
|
||||
function calq_base()
|
||||
{
|
||||
calq.init("bfff14a4e0225789be3d9d22c4bb42a1");
|
||||
|
||||
calq.init("bfff14a4e0225789be3d9d22c4bb42a1", { your: "config" });
|
||||
|
||||
calq.action.track("Product Review", {"Rating": 9.0});
|
||||
|
||||
calq.action.trackSale("Product Sale", { "Product Id": 149, "Product Name": "Dinosaur T-Shirt XL" }, "USD",10);
|
||||
|
||||
calq.action.trackHTMLLink('Link', { 'Target': 'Calq'});
|
||||
|
||||
calq.action.trackPageView();
|
||||
|
||||
calq.action.trackPageView("Custom Action");
|
||||
|
||||
calq.action.setGlobalProperty("Referral Source", "Google Campaign");
|
||||
}
|
||||
|
||||
function calq_people()
|
||||
{
|
||||
calq.user.identify("1001");
|
||||
|
||||
calq.user.clear();
|
||||
|
||||
calq.user.profile( { "Company": "MegaCorp", "$email": "super_customer1@notarealemail.com" });
|
||||
}
|
||||
34
calq/calq.d.ts
vendored
Normal file
34
calq/calq.d.ts
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
// Type definitions for calq
|
||||
// Project: https://calq.io/docs/client/javascript/reference
|
||||
// Definitions by: Eirik Hoem <https://github.com/eirikhm>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
interface Calq
|
||||
{
|
||||
action:Calq.Action;
|
||||
user:Calq.User;
|
||||
|
||||
init(writeKey:string, options?:{[index:string]:any}):void;
|
||||
}
|
||||
|
||||
declare module Calq
|
||||
{
|
||||
interface Action
|
||||
{
|
||||
track(action:string, params?:{[index:string]:any}):void;
|
||||
trackSale(action:string, params:{[index:string]:any}, currency:string, amount:number):void;
|
||||
trackHTMLLink(action:string, params?:{[index:string]:any}):void;
|
||||
trackPageView(action?:string):void;
|
||||
setGlobalProperty(name:string,value:any):void;
|
||||
}
|
||||
|
||||
interface User
|
||||
{
|
||||
identify(userId:string):void;
|
||||
clear():void;
|
||||
profile(params:{[index:string]:any}):void;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
declare var calq:Calq;
|
||||
@@ -252,12 +252,12 @@ var myPolarAreaChart = new Chart(ctx).PolarArea(polarAreaData, {
|
||||
|
||||
var myPolarAreaChartLegend: string = myPolarAreaChart.generateLegend();
|
||||
var myPolarAreaChartImage: string = myPolarAreaChart.toBase64Image();
|
||||
myPolarAreaChart.addData([{
|
||||
myPolarAreaChart.addData({
|
||||
value: 120,
|
||||
color: "#4D5360",
|
||||
highlight: "#616774",
|
||||
label: "Dark Grey"
|
||||
}], 0);
|
||||
}, 0);
|
||||
myPolarAreaChart.clear();
|
||||
myPolarAreaChart.removeData(0);
|
||||
myPolarAreaChart.resize();
|
||||
@@ -301,12 +301,12 @@ var myPieChart = new Chart(ctx).Pie(pieData, {
|
||||
|
||||
var myPieChartLegend: string = myPieChart.generateLegend();
|
||||
var myPieChartImage: string = myPieChart.toBase64Image();
|
||||
myPieChart.addData([{
|
||||
myPieChart.addData({
|
||||
value: 120,
|
||||
color: "#4D5360",
|
||||
highlight: "#616774",
|
||||
label: "Dark Grey"
|
||||
}], 0);
|
||||
}, 0);
|
||||
myPieChart.clear();
|
||||
myPieChart.removeData(0);
|
||||
myPieChart.resize();
|
||||
@@ -329,12 +329,12 @@ var myDoughnutChart = new Chart(ctx).Doughnut(pieData, {
|
||||
|
||||
var myDoughnutChartLegend: string = myDoughnutChart.generateLegend();
|
||||
var myDoughnutChartImage: string = myDoughnutChart.toBase64Image();
|
||||
myPieChart.addData([{
|
||||
myPieChart.addData({
|
||||
value: 120,
|
||||
color: "#4D5360",
|
||||
highlight: "#616774",
|
||||
label: "Dark Grey"
|
||||
}], 0);
|
||||
}, 0);
|
||||
myDoughnutChart.clear();
|
||||
myDoughnutChart.removeData(0);
|
||||
myDoughnutChart.resize();
|
||||
|
||||
3
chartjs/chart.d.ts
vendored
3
chartjs/chart.d.ts
vendored
@@ -113,8 +113,9 @@ interface LinearInstance extends ChartInstance {
|
||||
interface CircularInstance extends ChartInstance {
|
||||
getSegmentsAtEvent: (event: Event) => {}[];
|
||||
update: () => void;
|
||||
addData: (valuesArray: CircularChartData[], index: number) => void;
|
||||
addData: (valuesArray: CircularChartData, index?: number) => void;
|
||||
removeData: (index: number) => void;
|
||||
segments: Array<CircularChartData>;
|
||||
}
|
||||
|
||||
interface LineChartOptions extends ChartOptions {
|
||||
|
||||
21
chosen/chosen.jquery.d.ts
vendored
21
chosen/chosen.jquery.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Chosen.JQuery 0.9
|
||||
// Type definitions for Chosen.JQuery 1.4.2
|
||||
// Project: http://harvesthq.github.com/chosen/
|
||||
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
@@ -8,18 +8,23 @@
|
||||
|
||||
interface ChosenOptions {
|
||||
allow_single_deselect?: boolean;
|
||||
disable_search_threshold?: number;
|
||||
disable_search?: boolean;
|
||||
disable_search_threshold?: number;
|
||||
enable_split_word_search?: boolean;
|
||||
inherit_select_classes?: boolean;
|
||||
max_selected_options?: number;
|
||||
no_results_text?: string;
|
||||
placeholder_text_multiple?: string;
|
||||
placeholder_text_single?: string;
|
||||
search_contains?: boolean;
|
||||
single_backstroke_delete?: boolean;
|
||||
max_selected_options?: number;
|
||||
placeholder_text_multiple?: string;
|
||||
placeholder_text?: string;
|
||||
placeholder_text_single?: string;
|
||||
no_results_text?: string;
|
||||
width?: number;
|
||||
display_disabled_options?: boolean;
|
||||
display_selected_options?: boolean;
|
||||
include_group_label_in_selected?: boolean;
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
chosen(): JQuery;
|
||||
chosen(options: ChosenOptions): JQuery;
|
||||
}
|
||||
}
|
||||
|
||||
31
circular-json/circular-json-tests.ts
Normal file
31
circular-json/circular-json-tests.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
/// <reference path="circular-json.d.ts" />
|
||||
|
||||
import CircularJSON = require('circular-json');
|
||||
|
||||
var replacer = (key: any, val: any) => {
|
||||
return val;
|
||||
}
|
||||
|
||||
var replacerArray = ['a', 'x'];
|
||||
|
||||
// implements JSON interface
|
||||
var json_obj: JSON = CircularJSON;
|
||||
|
||||
CircularJSON.parse('{"a":"b"}');
|
||||
|
||||
CircularJSON.parse('{"a":"b"}', replacer);
|
||||
|
||||
// just stringify a value
|
||||
CircularJSON.stringify({a: 'b'});
|
||||
|
||||
// do replacements for part of the object
|
||||
CircularJSON.stringify({a: 'b'}, replacer);
|
||||
CircularJSON.stringify({a: 'b'}, replacerArray);
|
||||
|
||||
// add whitespace to the output
|
||||
CircularJSON.stringify({a: 'b'}, replacer, 5);
|
||||
CircularJSON.stringify({a: 'b'}, replacerArray, 5);
|
||||
|
||||
// do not actually set up a re-parseable object
|
||||
CircularJSON.stringify({a: 'b'}, replacer, 5, true);
|
||||
CircularJSON.stringify({a: 'b'}, replacerArray, 5, true);
|
||||
15
circular-json/circular-json.d.ts
vendored
Normal file
15
circular-json/circular-json.d.ts
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
// Type definitions for circular-json v0.1.6
|
||||
// Project: https://github.com/WebReflection/circular-json
|
||||
// Definitions by: Jonathan Pevarnek <https://github.com/jpevarnek/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module 'circular-json' {
|
||||
interface ICircularJSON extends JSON {
|
||||
parse(text: string, reviver?: (key: any, value: any) => any): any;
|
||||
stringify(value: any, replacer?: ((key: string, value: any) => any) | any[], space?: any, placeholder?: boolean): string;
|
||||
}
|
||||
|
||||
var CircularJSON: ICircularJSON;
|
||||
|
||||
export = CircularJSON;
|
||||
}
|
||||
6
cordova-ionic/cordova-ionic.d.ts
vendored
6
cordova-ionic/cordova-ionic.d.ts
vendored
@@ -5,10 +5,6 @@
|
||||
|
||||
/// <reference path="./plugins/keyboard.d.ts" />
|
||||
|
||||
interface Cordova {
|
||||
plugins:Plugins;
|
||||
}
|
||||
|
||||
interface Plugins {
|
||||
interface CordovaPlugins {
|
||||
Keyboard:Ionic.Keyboard;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
/// <reference path="../cordova/cordova.d.ts" />
|
||||
/// <reference path="./cordova-plugin-email-composer.d.ts" />
|
||||
|
||||
cordova.plugins.email.isAvailable((isAvailable) => {}, {});
|
||||
cordova.plugins.email.open({
|
||||
to: ['foo@bar.com'],
|
||||
body: 'foo bar'
|
||||
});
|
||||
cordova.plugins.email.open();
|
||||
cordova.plugins.email.open({}, () => {});
|
||||
cordova.plugins.email.open({}, () => {}, {});
|
||||
|
||||
cordova.plugins.email.openDraft({
|
||||
to: ['foo@bar.com'],
|
||||
body: 'foo bar'
|
||||
});
|
||||
cordova.plugins.email.openDraft();
|
||||
cordova.plugins.email.openDraft({}, () => {});
|
||||
cordova.plugins.email.openDraft({}, () => {}, {});
|
||||
33
cordova-plugin-email-composer/cordova-plugin-email-composer.d.ts
vendored
Normal file
33
cordova-plugin-email-composer/cordova-plugin-email-composer.d.ts
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
// Type definitions for Apache Cordova Email Composer plugin
|
||||
// Project: https://github.com/katzer/cordova-plugin-email-composer
|
||||
// Definitions by: Dave Taylor <http://davetayls.me>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* The plugin provides access to the standard interface that manages the
|
||||
* editing and sending an email message
|
||||
*/
|
||||
interface CordovaPluginEmailComposer {
|
||||
/** Determine if the device is capable to send emails */
|
||||
isAvailable(callback:(isAvailable:boolean) => void, scope?:any):void;
|
||||
/** Open a pre-filled email draft */
|
||||
open(options?:ICordovaPluginEmailComposerOpenOptions, callback?:() => void, scope?:any):void;
|
||||
openDraft(options?:ICordovaPluginEmailComposerOpenOptions, callback?:() => void, scope?:any):void;
|
||||
}
|
||||
|
||||
interface ICordovaPluginEmailComposerOpenOptions {
|
||||
/** An configured email account is required to send emails */
|
||||
to?:string[];
|
||||
body?:string;
|
||||
cc?:string[];
|
||||
bcc?:string[];
|
||||
/** Attachments can be either base64 encoded datas, files from the the device storage or assets from within the www folder */
|
||||
attachments?:any[];
|
||||
subject?:string;
|
||||
/** The default value for isHTML is true */
|
||||
isHtml?:boolean;
|
||||
}
|
||||
|
||||
interface CordovaPlugins {
|
||||
email:CordovaPluginEmailComposer;
|
||||
}
|
||||
4
cordova/cordova.d.ts
vendored
4
cordova/cordova.d.ts
vendored
@@ -43,8 +43,12 @@ interface Cordova {
|
||||
define(moduleName: string, factory: (require: any, exports: any, module: any) => any): void;
|
||||
/** Access a Cordova module by name. */
|
||||
require(moduleName: string): any;
|
||||
/** Namespace for Cordova plugin functionality */
|
||||
plugins:CordovaPlugins;
|
||||
}
|
||||
|
||||
interface CordovaPlugins {}
|
||||
|
||||
interface Document {
|
||||
addEventListener(type: "deviceready", listener: (ev: Event) => any, useCapture?: boolean): void;
|
||||
addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void;
|
||||
|
||||
@@ -476,7 +476,7 @@ function callenderView() {
|
||||
.style("text-anchor", "middle")
|
||||
.text(function (d) { return d; });
|
||||
|
||||
var rect = svg.selectAll(".day")
|
||||
var rect: D3.UpdateSelection = svg.selectAll(".day")
|
||||
.data(function (d) { return d3.time.days(new Date(d, 0, 1), new Date(d + 1, 0, 1)); })
|
||||
.enter().append("rect")
|
||||
.attr("class", "day")
|
||||
@@ -960,7 +960,7 @@ function forcedBasedLabelPlacemant() {
|
||||
|
||||
var anchorLink = vis.selectAll("line.anchorLink").data(labelAnchorLinks)//.enter().append("svg:line").attr("class", "anchorLink").style("stroke", "#999");
|
||||
|
||||
var anchorNode = vis.selectAll("g.anchorNode").data(force2.nodes()).enter().append("svg:g").attr("class", "anchorNode");
|
||||
var anchorNode: D3.Selection = vis.selectAll("g.anchorNode").data(force2.nodes()).enter().append("svg:g").attr("class", "anchorNode");
|
||||
anchorNode.append("svg:circle").attr("r", 0).style("fill", "#FFF");
|
||||
anchorNode.append("svg:text").text(function (d, i) {
|
||||
return i % 2 == 0 ? "" : d.node.label
|
||||
@@ -1404,7 +1404,7 @@ function quadtree() {
|
||||
.attr("width", function (d) { return d.width; } )
|
||||
.attr("height", function (d) { return d.height; } );
|
||||
|
||||
var point = svg.selectAll(".point")
|
||||
var point: D3.Selection = svg.selectAll(".point")
|
||||
.data(data)
|
||||
.enter().append("circle")
|
||||
.attr("class", "point")
|
||||
@@ -2656,4 +2656,18 @@ function multiTest() {
|
||||
.attr("class", "x axis")
|
||||
.attr("transform", "translate(0," + height + ")")
|
||||
.call(xAxis);
|
||||
}
|
||||
}
|
||||
|
||||
// Tests miscellaneous keyboard events
|
||||
function keyboardEventsTest() {
|
||||
var keyPressed: string;
|
||||
d3.select("body").on("keydown", () => {
|
||||
if (d3.event.metaKey) {
|
||||
keyPressed = "meta";
|
||||
} else if (d3.event.ctrlKey) {
|
||||
keyPressed = "ctrl";
|
||||
} else if (d3.event.altKey) {
|
||||
keyPressed = "alt";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
151
d3/d3.d.ts
vendored
151
d3/d3.d.ts
vendored
@@ -12,19 +12,19 @@ declare module D3 {
|
||||
/**
|
||||
* Returns the empty selection
|
||||
*/
|
||||
(): Selection;
|
||||
(): _Selection<any>;
|
||||
/**
|
||||
* Selects the first element that matches the specified selector string
|
||||
*
|
||||
* @param selector Selection String to match
|
||||
*/
|
||||
(selector: string): Selection;
|
||||
(selector: string): _Selection<any>;
|
||||
/**
|
||||
* Selects the specified node
|
||||
*
|
||||
* @param element Node element to select
|
||||
*/
|
||||
(element: EventTarget): Selection;
|
||||
(element: EventTarget): _Selection<any>;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -36,13 +36,13 @@ declare module D3 {
|
||||
*
|
||||
* @param selector Selection String to match
|
||||
*/
|
||||
(selector: string): Selection;
|
||||
(selector: string): _Selection<any>;
|
||||
/**
|
||||
* Selects the specified array of elements
|
||||
*
|
||||
* @param elements Array of node elements to select
|
||||
*/
|
||||
(elements: EventTarget[]): Selection;
|
||||
(elements: EventTarget[]): _Selection<any>;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -57,7 +57,9 @@ declare module D3 {
|
||||
x: number;
|
||||
y: number;
|
||||
keyCode: number;
|
||||
altKey: any;
|
||||
altKey?: boolean;
|
||||
ctrlKey?: boolean;
|
||||
metaKey?: boolean;
|
||||
type: string;
|
||||
}
|
||||
|
||||
@@ -458,7 +460,7 @@ declare module D3 {
|
||||
/**
|
||||
* Returns the root selection
|
||||
*/
|
||||
selection(): Selection;
|
||||
selection(): _Selection<any>;
|
||||
ns: {
|
||||
/**
|
||||
* The map of registered namespace prefixes
|
||||
@@ -726,56 +728,56 @@ declare module D3 {
|
||||
format(rows: any[]): string;
|
||||
}
|
||||
|
||||
export interface Selection extends Selectors, Array<any> {
|
||||
export interface _Selection<T> extends Selectors, Array<any> {
|
||||
attr: {
|
||||
(name: string): string;
|
||||
(name: string, value: any): Selection;
|
||||
(name: string, valueFunction: (data: any, index: number) => any): Selection;
|
||||
(attrValueMap : Object): Selection;
|
||||
(name: string, value: any): _Selection<T>;
|
||||
(name: string, valueFunction: (data: T, index: number) => any): _Selection<T>;
|
||||
(attrValueMap: Object): _Selection<T>;
|
||||
};
|
||||
|
||||
classed: {
|
||||
(name: string): boolean;
|
||||
(name: string, value: any): Selection;
|
||||
(name: string, valueFunction: (data: any, index: number) => any): Selection;
|
||||
(classValueMap: Object): Selection;
|
||||
(name: string, value: any): _Selection<T>;
|
||||
(name: string, valueFunction: (data: T, index: number) => any): _Selection<T>;
|
||||
(classValueMap: Object): _Selection<T>;
|
||||
};
|
||||
|
||||
style: {
|
||||
(name: string): string;
|
||||
(name: string, value: any, priority?: string): Selection;
|
||||
(name: string, valueFunction: (data: any, index: number) => any, priority?: string): Selection;
|
||||
(styleValueMap : Object): Selection;
|
||||
(name: string, value: any, priority?: string): _Selection<T>;
|
||||
(name: string, valueFunction: (data: T, index: number) => any, priority?: string): _Selection<T>;
|
||||
(styleValueMap: Object): _Selection<T>;
|
||||
};
|
||||
|
||||
property: {
|
||||
(name: string): void;
|
||||
(name: string, value: any): Selection;
|
||||
(name: string, valueFunction: (data: any, index: number) => any): Selection;
|
||||
(propertyValueMap : Object): Selection;
|
||||
(name: string, value: any): _Selection<T>;
|
||||
(name: string, valueFunction: (data: T, index: number) => any): _Selection<T>;
|
||||
(propertyValueMap: Object): _Selection<T>;
|
||||
};
|
||||
|
||||
text: {
|
||||
(): string;
|
||||
(value: any): Selection;
|
||||
(valueFunction: (data: any, index: number) => any): Selection;
|
||||
(value: any): _Selection<T>;
|
||||
(valueFunction: (data: T, index: number) => any): _Selection<T>;
|
||||
};
|
||||
|
||||
html: {
|
||||
(): string;
|
||||
(value: any): Selection;
|
||||
(valueFunction: (data: any, index: number) => any): Selection;
|
||||
(value: any): _Selection<T>;
|
||||
(valueFunction: (data: T, index: number) => any): _Selection<T>;
|
||||
};
|
||||
|
||||
append: (name: string) => Selection;
|
||||
insert: (name: string, before: string) => Selection;
|
||||
remove: () => Selection;
|
||||
append: (name: string) => _Selection<T>;
|
||||
insert: (name: string, before: string) => _Selection<T>;
|
||||
remove: () => _Selection<T>;
|
||||
empty: () => boolean;
|
||||
|
||||
data: {
|
||||
(values: (data: any, index?: number) => any[], key?: (data: any, index?: number) => any): UpdateSelection;
|
||||
(values: any[], key?: (data: any, index?: number) => any): UpdateSelection;
|
||||
(): any[];
|
||||
<U>(values: (data: T, index?: number) => U[], key?: (data: U, index?: number) => any): _UpdateSelection<U>;
|
||||
<U>(values: U[], key?: (data: U, index?: number) => any): _UpdateSelection<U>;
|
||||
(): T[];
|
||||
};
|
||||
|
||||
datum: {
|
||||
@@ -789,36 +791,31 @@ declare module D3 {
|
||||
* element. The function is then used to set each element's data. A null value will
|
||||
* delete the bound data. This operator has no effect on the index.
|
||||
*/
|
||||
(values: (data: any, index: number) => any): UpdateSelection;
|
||||
<U>(values: (data: U, index: number) => any): _UpdateSelection<U>;
|
||||
/**
|
||||
* Sets the element's bound data to the specified value on all selected elements.
|
||||
* Unlike the D3.Selection.data method, this method does not compute a join (and thus
|
||||
* does not compute enter and exit selections).
|
||||
* @param values The same data to be given to all elements.
|
||||
*/
|
||||
(values: any): UpdateSelection;
|
||||
<U>(values: U): _UpdateSelection<U>;
|
||||
/**
|
||||
* Returns the bound datum for the first non-null element in the selection.
|
||||
* This is generally useful only if you know the selection contains exactly one element.
|
||||
*/
|
||||
(): any;
|
||||
/**
|
||||
* Returns the bound datum for the first non-null element in the selection.
|
||||
* This is generally useful only if you know the selection contains exactly one element.
|
||||
*/
|
||||
<T>(): T;
|
||||
(): T;
|
||||
};
|
||||
|
||||
filter: {
|
||||
(filter: (data: any, index: number) => boolean, thisArg?: any): UpdateSelection;
|
||||
(filter: string): UpdateSelection;
|
||||
(filter: (data: T, index: number) => boolean, thisArg?: any): _UpdateSelection<T>;
|
||||
(filter: string): _UpdateSelection<T>;
|
||||
};
|
||||
|
||||
call(callback: (selection: Selection, ...args: any[]) => void, ...args: any[]): Selection;
|
||||
each(eachFunction: (data: any, index: number) => any): Selection;
|
||||
call(callback: (selection: _Selection<T>, ...args: any[]) => void, ...args: any[]): _Selection<T>;
|
||||
each(eachFunction: (data: T, index: number) => any): _Selection<T>;
|
||||
on: {
|
||||
(type: string): (data: any, index: number) => any;
|
||||
(type: string, listener: (data: any, index: number) => any, capture?: boolean): Selection;
|
||||
(type: string, listener: (data: any, index: number) => any, capture?: boolean): _Selection<T>;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -840,38 +837,44 @@ declare module D3 {
|
||||
* to compare, and should return either a negative, positive, or zero value to indicate
|
||||
* their relative order.
|
||||
*/
|
||||
sort<T>(comparator?: (a: T, b: T) => number): Selection;
|
||||
sort(comparator?: (a: T, b: T) => number): _Selection<T>;
|
||||
|
||||
/**
|
||||
* Re-inserts elements into the document such that the document order matches the selection
|
||||
* order. This is equivalent to calling sort() if the data is already sorted, but much
|
||||
* faster.
|
||||
*/
|
||||
order: () => Selection;
|
||||
order: () => _Selection<T>;
|
||||
|
||||
/**
|
||||
* Returns the first non-null element in the current selection. If the selection is empty,
|
||||
* returns null.
|
||||
*/
|
||||
node: <T extends Element>() => T;
|
||||
node: <E extends Element>() => E;
|
||||
}
|
||||
|
||||
export interface EnterSelection {
|
||||
append: (name: string) => Selection;
|
||||
insert: (name: string, before?: string) => Selection;
|
||||
select: (selector: string) => Selection;
|
||||
export interface Selection extends _Selection<any> { }
|
||||
|
||||
export interface _EnterSelection<T> {
|
||||
append: (name: string) => _Selection<T>;
|
||||
insert: (name: string, before?: string) => _Selection<T>;
|
||||
select: (selector: string) => _Selection<T>;
|
||||
empty: () => boolean;
|
||||
node: () => Element;
|
||||
call: (callback: (selection: EnterSelection) => void) => EnterSelection;
|
||||
call: (callback: (selection: _EnterSelection<T>) => void) => _EnterSelection<T>;
|
||||
size: () => number;
|
||||
}
|
||||
|
||||
export interface UpdateSelection extends Selection {
|
||||
enter: () => EnterSelection;
|
||||
update: () => Selection;
|
||||
exit: () => Selection;
|
||||
export interface EnterSelection extends _EnterSelection<any> { }
|
||||
|
||||
export interface _UpdateSelection<T> extends _Selection<T> {
|
||||
enter: () => _EnterSelection<T>;
|
||||
update: () => _Selection<T>;
|
||||
exit: () => _Selection<T>;
|
||||
}
|
||||
|
||||
export interface UpdateSelection extends _UpdateSelection<any> { }
|
||||
|
||||
export interface NestKeyValue {
|
||||
key: string;
|
||||
values: any;
|
||||
@@ -1279,6 +1282,13 @@ declare module D3 {
|
||||
(angle: (d : any) => number): PieLayout
|
||||
(angle: (d : any, i: number) => number): PieLayout;
|
||||
};
|
||||
padAngle: {
|
||||
(): number;
|
||||
(angle: number): PieLayout;
|
||||
(angle: () => number): PieLayout;
|
||||
(angle: (d : any) => number): PieLayout
|
||||
(angle: (d : any, i: number) => number): PieLayout;
|
||||
};
|
||||
}
|
||||
|
||||
export interface ArcDescriptor {
|
||||
@@ -1363,7 +1373,20 @@ declare module D3 {
|
||||
(number:number): ForceLayout;
|
||||
(accessor: (d: any, index: number) => number): ForceLayout;
|
||||
};
|
||||
|
||||
/**
|
||||
* If distance is specified, sets the maximum distance over which
|
||||
* charge forces are applied. If distance is not specified, returns
|
||||
* the current maximum charge distance, which defaults to infinity.
|
||||
* Specifying a finite charge distance improves the performance of
|
||||
* the force layout and produces a more localized layout;
|
||||
* distance-limited charge forces are especially useful in
|
||||
* conjunction with custom gravity.
|
||||
*/
|
||||
chargeDistance: {
|
||||
(): number;
|
||||
(distance: number): ForceLayout;
|
||||
(accessor: (d: any, index: number) => number): ForceLayout;
|
||||
};
|
||||
theta: {
|
||||
(): number;
|
||||
(number:number): ForceLayout;
|
||||
@@ -1727,14 +1750,14 @@ declare module D3 {
|
||||
export interface Symbol {
|
||||
type: (symbolType: string | ((datum: any, index: number) => string)) => Symbol;
|
||||
size: (size: number | ((datum: any, index: number) => number)) => Symbol;
|
||||
(datum:any, index:number): string;
|
||||
(datum?: any, index?: number): string;
|
||||
}
|
||||
|
||||
export interface Brush {
|
||||
/**
|
||||
* Draws or redraws this brush into the specified selection of elements
|
||||
*/
|
||||
(selection: Selection): void;
|
||||
(selection: _Selection<any>): void;
|
||||
/**
|
||||
* Gets or sets the x-scale associated with the brush
|
||||
*/
|
||||
@@ -1802,7 +1825,7 @@ declare module D3 {
|
||||
}
|
||||
|
||||
export interface Axis {
|
||||
(selection: Selection): void;
|
||||
(selection: _Selection<any>): void;
|
||||
(transition: Transition.Transition): void;
|
||||
|
||||
scale: {
|
||||
@@ -1944,13 +1967,13 @@ declare module D3 {
|
||||
/**
|
||||
* Get the interpolation accessor.
|
||||
*/
|
||||
(): string;
|
||||
(): string | ((points: number[][]) => string);
|
||||
/**
|
||||
* Set the interpolation accessor.
|
||||
*
|
||||
* @param interpolate The interpolation mode
|
||||
*/
|
||||
(interpolate: string): Line;
|
||||
(interpolate: string | ((points: number[][]) => string)): Line;
|
||||
};
|
||||
/**
|
||||
* Get or set the cardinal spline tension.
|
||||
@@ -2240,13 +2263,13 @@ declare module D3 {
|
||||
/**
|
||||
* Get the interpolation accessor.
|
||||
*/
|
||||
(): string;
|
||||
(): string | ((points: number[][]) => string);
|
||||
/**
|
||||
* Set the interpolation accessor.
|
||||
*
|
||||
* @param interpolate The interpolation mode
|
||||
*/
|
||||
(interpolate: string): Area;
|
||||
(interpolate: string | ((points: number[][]) => string)): Area;
|
||||
};
|
||||
/**
|
||||
* Get or set the cardinal spline tension.
|
||||
@@ -2775,7 +2798,7 @@ declare module D3 {
|
||||
* registering the necessary event listeners to support
|
||||
* panning and zooming.
|
||||
*/
|
||||
(selection: Selection): void;
|
||||
(selection: _Selection<any>): void;
|
||||
|
||||
/**
|
||||
* Registers a listener to receive events
|
||||
|
||||
8
dompurify/dompurify-tests.ts
Normal file
8
dompurify/dompurify-tests.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
/// <reference path="dompurify.d.ts" />
|
||||
|
||||
import dompurify = require('dompurify');
|
||||
|
||||
dompurify.sanitize('<script>alert("hi")</script>');
|
||||
dompurify.addHook('beforeSanitizeElements', (el, data, config) => {
|
||||
return el;
|
||||
});
|
||||
15
dompurify/dompurify.d.ts
vendored
Normal file
15
dompurify/dompurify.d.ts
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
// Type definitions for DOM Purify
|
||||
// Project: https://github.com/cure53/DOMPurify
|
||||
// Definitions by: Dave Taylor <http://davetayls.me>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
interface IDOMPurify {
|
||||
sanitize(s:string):string;
|
||||
addHook(hook:string, cb:(currentNode:Element, data:any, config:any) => Element):void;
|
||||
}
|
||||
|
||||
declare var DOMPurify:IDOMPurify;
|
||||
|
||||
declare module 'dompurify' {
|
||||
export = DOMPurify;
|
||||
}
|
||||
6
drop/drop.d.ts
vendored
6
drop/drop.d.ts
vendored
@@ -9,6 +9,12 @@ declare module drop {
|
||||
|
||||
interface DropStatic {
|
||||
new(options: IDropOptions): Drop;
|
||||
createContext(options: IDropContextOptions): DropStatic;
|
||||
}
|
||||
|
||||
interface IDropContextOptions {
|
||||
classPrefix?: string;
|
||||
defaults?: IDropOptions;
|
||||
}
|
||||
|
||||
interface IDropOptions {
|
||||
|
||||
18
ember/ember.d.ts
vendored
18
ember/ember.d.ts
vendored
@@ -444,7 +444,7 @@ declare module Ember {
|
||||
static metaForProperty(key: string): {};
|
||||
static isClass: boolean;
|
||||
static isMethod: boolean;
|
||||
static initializer(arguments?: ApplicationInitializerArguments): void;
|
||||
static initializer(args?: ApplicationInitializerArguments): void;
|
||||
/**
|
||||
Call advanceReadiness after any asynchronous setup logic has completed.
|
||||
Each call to deferReadiness must be matched by a call to advanceReadiness
|
||||
@@ -1318,9 +1318,9 @@ declare module Ember {
|
||||
Creates an instance of the class.
|
||||
@param arguments A hash containing values with which to initialize the newly instantiated object.
|
||||
**/
|
||||
static create<T extends Mixin>(arguments?: {}): T;
|
||||
static create<T extends Mixin>(args: {}): T;
|
||||
detect(obj: any): boolean;
|
||||
reopen<T extends Mixin>(arguments?: {}): T;
|
||||
reopen<T extends Mixin>(args?: {}): T;
|
||||
}
|
||||
class MutableArray implements Array, MutableEnumberable {
|
||||
addArrayObserver(target: any, opts?: EnumerableConfigurationOptions): any[];
|
||||
@@ -1581,17 +1581,17 @@ declare module Ember {
|
||||
/**
|
||||
Creates a subclass of the Object class.
|
||||
**/
|
||||
static extend<T>(arguments?: CoreObjectArguments): T;
|
||||
static extend<T>(mixins? : Mixin, arguments?: CoreObjectArguments): T;
|
||||
static extend<T>(args?: CoreObjectArguments): T;
|
||||
static extend<T>(mixins? : Mixin, args?: CoreObjectArguments): T;
|
||||
/**
|
||||
Creates an instance of the class.
|
||||
@param arguments A hash containing values with which to initialize the newly instantiated object.
|
||||
**/
|
||||
static create<T extends {}>(arguments?: {}): T;
|
||||
static create<T extends {}>(args?: {}): T;
|
||||
/**
|
||||
Equivalent to doing extend(arguments).create(). If possible use the normal create method instead.
|
||||
**/
|
||||
static createWithMixins<T extends {}>(arguments?: {}): T;
|
||||
static createWithMixins<T extends {}>(args?: {}): T;
|
||||
static detect(obj: any): boolean;
|
||||
static detectInstance(obj: any): boolean;
|
||||
/**
|
||||
@@ -1608,13 +1608,13 @@ declare module Ember {
|
||||
Augments a constructor's prototype with additional properties and functions.
|
||||
To add functions and properties to the constructor itself, see reopenClass.
|
||||
**/
|
||||
static reopen<T extends {}>(arguments?: {}): T;
|
||||
static reopen<T extends {}>(args?: {}): T;
|
||||
/**
|
||||
Augments a constructor's own properties and functions.
|
||||
To add functions and properties to instances of a constructor by extending the
|
||||
constructor's prototype see reopen.
|
||||
**/
|
||||
static reopenClass<T extends {}>(arguments?: {}): T;
|
||||
static reopenClass<T extends {}>(args?: {}): T;
|
||||
static isClass: boolean;
|
||||
static isMethod: boolean;
|
||||
addObserver: ModifyObserver;
|
||||
|
||||
4
errorhandler/errorhandler.d.ts
vendored
4
errorhandler/errorhandler.d.ts
vendored
@@ -7,6 +7,6 @@
|
||||
|
||||
declare module "errorhandler" {
|
||||
import express = require('express');
|
||||
function e(): express.ErrorRequestHandler;
|
||||
function e(options?: {log?: any}): express.ErrorRequestHandler;
|
||||
export = e;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,27 +1,12 @@
|
||||
/// <reference path="../estree/estree.d.ts" />
|
||||
/// <reference path="esprima.d.ts" />
|
||||
|
||||
import esprima = require('esprima');
|
||||
import Syntax = esprima.Syntax;
|
||||
|
||||
var token: esprima.Token;
|
||||
var options: esprima.Options;
|
||||
var comment: Syntax.Comment;
|
||||
var program: Syntax.Program;
|
||||
var statement: Syntax.Statement;
|
||||
var expression: Syntax.Expression;
|
||||
var property: Syntax.Property;
|
||||
var identifier: Syntax.Identifier;
|
||||
var literal: Syntax.Literal;
|
||||
var switchCase: Syntax.SwitchCase;
|
||||
var catchClause: Syntax.CatchClause;
|
||||
var variableDeclaratorOrExpression: Syntax.VariableDeclaratorOrExpression;
|
||||
var literalOrIdentifier: Syntax.LiteralOrIdentifier;
|
||||
var blockStatementOrExpression: Syntax.BlockStatementOrExpression;
|
||||
var identifierOrExpression: Syntax.IdentifierOrExpression;
|
||||
var any: any;
|
||||
var comment: esprima.Comment;
|
||||
var program: ESTree.Program;
|
||||
var string: string;
|
||||
var boolean: boolean;
|
||||
var number: number;
|
||||
|
||||
// esprima
|
||||
string = esprima.version;
|
||||
@@ -34,171 +19,5 @@ token = esprima.tokenize('code', {range: true})[0];
|
||||
string = token.type;
|
||||
string = token.value;
|
||||
|
||||
// Program
|
||||
string = program.type;
|
||||
statement = program.body[0];
|
||||
comment = program.comments[0]
|
||||
|
||||
// Location
|
||||
number = program.loc.start.line;
|
||||
number = program.loc.start.column;
|
||||
number = program.loc.end.line;
|
||||
number = program.loc.end.column;
|
||||
number = program.range[0];
|
||||
|
||||
// Comment
|
||||
string = comment.value;
|
||||
|
||||
// Statement
|
||||
// BlockStatement
|
||||
var blockStatement: Syntax.BlockStatement;
|
||||
string = blockStatement.type;
|
||||
statement = blockStatement.body[0];
|
||||
comment = blockStatement.leadingComments[0];
|
||||
comment = blockStatement.trailingComments[0];
|
||||
|
||||
// ExpressionStatement
|
||||
var expressionStatement: Syntax.ExpressionStatement;
|
||||
expression = expressionStatement.expression;
|
||||
|
||||
// IfStatement
|
||||
var ifStatement: Syntax.IfStatement;
|
||||
expression = ifStatement.test;
|
||||
statement = ifStatement.consequent;
|
||||
statement = ifStatement.alternate;
|
||||
|
||||
// LabeledStatement
|
||||
var labeledStatement: Syntax.LabeledStatement;
|
||||
identifier = labeledStatement.label;
|
||||
statement = labeledStatement.body;
|
||||
|
||||
// WithStatement
|
||||
var withStatement: Syntax.WithStatement;
|
||||
expression = withStatement.object;
|
||||
|
||||
// SwitchStatement
|
||||
var switchStatement: Syntax.SwitchStatement;
|
||||
expression = switchStatement.discriminant;
|
||||
switchCase = switchStatement.cases[0];
|
||||
boolean = switchStatement.lexical;
|
||||
|
||||
// ReturnStatement
|
||||
var returnStatement: Syntax.ReturnStatement;
|
||||
expression = returnStatement.argument;
|
||||
|
||||
// TryStatement
|
||||
var tryStatement: Syntax.TryStatement;
|
||||
blockStatement = tryStatement.block;
|
||||
catchClause = tryStatement.handler;
|
||||
catchClause = tryStatement.guardedHandlers[0];
|
||||
blockStatement = tryStatement.finalizer;
|
||||
|
||||
// ForStatement
|
||||
var forStatement: Syntax.ForStatement;
|
||||
variableDeclaratorOrExpression = forStatement.init;
|
||||
expression = forStatement.update;
|
||||
|
||||
// ForInStatement
|
||||
var forInStatement: Syntax.ForInStatement;
|
||||
variableDeclaratorOrExpression = forInStatement.left;
|
||||
expression = forInStatement.right;
|
||||
boolean = forInStatement.each;
|
||||
|
||||
// Expression
|
||||
// ArrayExpression
|
||||
var arrayExpression: Syntax.ArrayExpression;
|
||||
string = arrayExpression.type;
|
||||
expression = arrayExpression.elements[0];
|
||||
|
||||
// ObjectExpression
|
||||
var objectExpression: Syntax.ObjectExpression;
|
||||
property = objectExpression.properties[0];
|
||||
string = property.type;
|
||||
literalOrIdentifier = property.key;
|
||||
expression = property.value;
|
||||
string = property.kind;
|
||||
|
||||
// FunctionExpression
|
||||
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
|
||||
var sequenceExpression: Syntax.SequenceExpression;
|
||||
expression = sequenceExpression.expressions[0]
|
||||
|
||||
// UnaryExpression
|
||||
var unaryExpression: Syntax.UnaryExpression;
|
||||
string = unaryExpression.operator;
|
||||
boolean = unaryExpression.prefix;
|
||||
|
||||
// BinaryExpression
|
||||
var binaryExpression: Syntax.BinaryExpression;
|
||||
expression = binaryExpression.left;
|
||||
expression = binaryExpression.right;
|
||||
|
||||
// ConditionalExpression
|
||||
var conditionalExpression: Syntax.ConditionalExpression;
|
||||
expression = conditionalExpression.test;
|
||||
expression = conditionalExpression.alternate;
|
||||
expression = conditionalExpression.consequent;
|
||||
|
||||
// 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
|
||||
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
|
||||
string = switchCase.type;
|
||||
expression = switchCase.test;
|
||||
statement = switchCase.consequent[0];
|
||||
|
||||
// CatchClause
|
||||
string = catchClause.type;
|
||||
identifier = catchClause.param;
|
||||
expression = catchClause.guard;
|
||||
blockStatement = catchClause.body;
|
||||
|
||||
// Misc
|
||||
// Identifier
|
||||
string = identifier.type;
|
||||
string = identifier.name;
|
||||
|
||||
// Literal
|
||||
string = literal.type;
|
||||
any = literal.value;
|
||||
|
||||
254
esprima/esprima.d.ts
vendored
254
esprima/esprima.d.ts
vendored
@@ -1,18 +1,24 @@
|
||||
// Type definitions for Esprima v1.2.0
|
||||
// Type definitions for Esprima v2.1.0
|
||||
// Project: http://esprima.org
|
||||
// Definitions by: teppeis <https://github.com/teppeis/>
|
||||
// Definitions by: teppeis <https://github.com/teppeis>, RReverser <https://github.com/RReverser>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../estree/estree.d.ts" />
|
||||
|
||||
declare module esprima {
|
||||
var version: string;
|
||||
function parse(code: string, options?: Options): Syntax.Program;
|
||||
function tokenize(code: string, options?: Options): Array<Token>;
|
||||
var version: string
|
||||
function parse(code: string, options?: Options): ESTree.Program
|
||||
function tokenize(code: string, options?: Options): Array<Token>
|
||||
|
||||
interface Token {
|
||||
type: string
|
||||
value: string
|
||||
}
|
||||
|
||||
interface Comment extends ESTree.Node {
|
||||
value: string
|
||||
}
|
||||
|
||||
interface Options {
|
||||
loc?: boolean
|
||||
range?: boolean
|
||||
@@ -23,244 +29,6 @@ declare module esprima {
|
||||
tolerant?: boolean
|
||||
source?: boolean
|
||||
}
|
||||
|
||||
module Syntax {
|
||||
// Node
|
||||
interface Node {
|
||||
type: string
|
||||
loc?: LineLocation
|
||||
range?: number[]
|
||||
leadingComments?: Comment[]
|
||||
trailingComments?: Comment[]
|
||||
}
|
||||
interface LineLocation {
|
||||
start: Position
|
||||
end: Position
|
||||
}
|
||||
interface Position {
|
||||
line: number
|
||||
column: number
|
||||
}
|
||||
|
||||
// Comment
|
||||
interface Comment extends Node {
|
||||
value: string
|
||||
}
|
||||
|
||||
// Program
|
||||
interface Program extends Node {
|
||||
body: Statement[]
|
||||
comments?: Comment[]
|
||||
}
|
||||
|
||||
// Function
|
||||
interface Function extends Node {
|
||||
id: Identifier // | null
|
||||
params: Identifier[]
|
||||
defaults: Expression[]
|
||||
rest: Identifier // | null
|
||||
body: BlockStatementOrExpression
|
||||
generator: boolean
|
||||
expression: boolean
|
||||
}
|
||||
interface BlockStatementOrExpression extends BlockStatement, Expression {
|
||||
}
|
||||
|
||||
// Statement
|
||||
interface Statement extends Node {
|
||||
}
|
||||
interface EmptyStatement extends Statement {
|
||||
}
|
||||
interface BlockStatement extends Statement {
|
||||
body: Statement[]
|
||||
}
|
||||
interface ExpressionStatement extends Statement {
|
||||
expression: Expression
|
||||
}
|
||||
interface IfStatement extends Statement {
|
||||
test: Expression
|
||||
consequent: Statement
|
||||
alternate: Statement
|
||||
}
|
||||
interface LabeledStatement extends Statement {
|
||||
label: Identifier
|
||||
body: Statement
|
||||
}
|
||||
interface BreakStatement extends Statement {
|
||||
label: Identifier // | null
|
||||
}
|
||||
interface ContinueStatement extends Statement {
|
||||
label: Identifier // | null
|
||||
}
|
||||
interface WithStatement extends Statement {
|
||||
object: Expression
|
||||
body: Statement
|
||||
}
|
||||
interface SwitchStatement extends Statement {
|
||||
discriminant: Expression
|
||||
cases: SwitchCase[]
|
||||
lexical: boolean
|
||||
}
|
||||
interface ReturnStatement extends Statement {
|
||||
argument: Expression // | null
|
||||
}
|
||||
interface ThrowStatement extends Statement {
|
||||
argument: Expression
|
||||
}
|
||||
interface TryStatement extends Statement {
|
||||
block: BlockStatement
|
||||
handler: CatchClause // | null
|
||||
guardedHandlers: CatchClause[]
|
||||
finalizer: BlockStatement // | null
|
||||
}
|
||||
interface WhileStatement extends Statement {
|
||||
test: Expression
|
||||
body: Statement
|
||||
}
|
||||
interface DoWhileStatement extends Statement {
|
||||
body: Statement
|
||||
test: Expression
|
||||
}
|
||||
interface ForStatement extends Statement {
|
||||
init: VariableDeclaratorOrExpression // | null
|
||||
test: Expression // | null
|
||||
update: Expression // | null
|
||||
body: Statement
|
||||
}
|
||||
interface ForInStatement extends Statement {
|
||||
left: VariableDeclaratorOrExpression
|
||||
right: Expression
|
||||
body: Statement
|
||||
each: boolean
|
||||
}
|
||||
interface VariableDeclaratorOrExpression extends VariableDeclarator, Expression {
|
||||
}
|
||||
interface DebuggerStatement extends Statement {
|
||||
}
|
||||
interface StatementOrList extends Array<Statement>, Statement {
|
||||
}
|
||||
|
||||
// Declaration
|
||||
interface Declaration extends Statement {
|
||||
}
|
||||
interface FunctionDeclaration extends Declaration {
|
||||
id: Identifier
|
||||
params: Identifier[] // Pattern
|
||||
defaults: Expression[]
|
||||
rest: Identifier
|
||||
body: BlockStatementOrExpression
|
||||
generator: boolean
|
||||
expression: boolean
|
||||
}
|
||||
interface VariableDeclaration extends Declaration {
|
||||
declarations: VariableDeclarator[]
|
||||
kind: string // "var" | "let" | "const"
|
||||
}
|
||||
interface VariableDeclarator extends Node {
|
||||
id: Identifier // Pattern
|
||||
init: Expression
|
||||
}
|
||||
|
||||
// Expression
|
||||
interface Expression extends Node { // | Pattern
|
||||
}
|
||||
//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: Expression[] // [ Expression | null ]
|
||||
}
|
||||
interface ObjectExpression extends Expression {
|
||||
properties: Property[]
|
||||
}
|
||||
interface Property extends Node {
|
||||
key: LiteralOrIdentifier // Literal | Identifier
|
||||
value: Expression
|
||||
kind: string // "init" | "get" | "set"
|
||||
}
|
||||
interface LiteralOrIdentifier extends Literal, Identifier {
|
||||
}
|
||||
interface FunctionExpression extends Function, Expression {
|
||||
}
|
||||
interface ArrowFunctionExpression extends Function, Expression {
|
||||
}
|
||||
interface SequenceExpression extends Expression {
|
||||
expressions: Expression[]
|
||||
}
|
||||
interface UnaryExpression extends Expression {
|
||||
operator: string // UnaryOperator
|
||||
prefix: boolean
|
||||
argument: Expression
|
||||
}
|
||||
interface BinaryExpression extends Expression {
|
||||
operator: string // BinaryOperator
|
||||
left: Expression
|
||||
right: Expression
|
||||
}
|
||||
interface AssignmentExpression extends Expression {
|
||||
operator: string // AssignmentOperator
|
||||
left: Expression
|
||||
right: Expression
|
||||
}
|
||||
interface UpdateExpression extends Expression {
|
||||
operator: string // UpdateOperator
|
||||
argument: Expression
|
||||
prefix: boolean
|
||||
}
|
||||
interface LogicalExpression extends Expression {
|
||||
operator: string // LogicalOperator
|
||||
left: Expression
|
||||
right: Expression
|
||||
}
|
||||
interface ConditionalExpression extends Expression {
|
||||
test: Expression
|
||||
alternate: Expression
|
||||
consequent: Expression
|
||||
}
|
||||
interface NewExpression extends Expression {
|
||||
callee: Expression
|
||||
arguments: Expression[]
|
||||
}
|
||||
interface CallExpression extends Expression {
|
||||
callee: Expression
|
||||
arguments: Expression[]
|
||||
}
|
||||
interface MemberExpression extends Expression {
|
||||
object: Expression
|
||||
property: IdentifierOrExpression // Identifier | Expression
|
||||
computed: boolean
|
||||
}
|
||||
interface IdentifierOrExpression extends Identifier, Expression {
|
||||
}
|
||||
|
||||
// Pattern
|
||||
// interface Pattern extends Node {
|
||||
// }
|
||||
|
||||
// Clauses
|
||||
interface SwitchCase extends Node {
|
||||
test: Expression
|
||||
consequent: Statement[]
|
||||
}
|
||||
interface CatchClause extends Node {
|
||||
param: Identifier // Pattern
|
||||
guard: Expression
|
||||
body: BlockStatement
|
||||
}
|
||||
|
||||
// Misc
|
||||
interface Identifier extends Node, Expression { // | Pattern
|
||||
name: string
|
||||
}
|
||||
interface Literal extends Node, Expression {
|
||||
value: any // string | boolean | null | number | RegExp
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
declare module "esprima" {
|
||||
|
||||
177
estree/estree-tests.ts
Normal file
177
estree/estree-tests.ts
Normal file
@@ -0,0 +1,177 @@
|
||||
/// <reference path="estree.d.ts" />
|
||||
|
||||
var program: ESTree.Program;
|
||||
var statement: ESTree.Statement;
|
||||
var expression: ESTree.Expression;
|
||||
var property: ESTree.Property;
|
||||
var identifier: ESTree.Identifier;
|
||||
var literal: ESTree.Literal;
|
||||
var switchCase: ESTree.SwitchCase;
|
||||
var catchClause: ESTree.CatchClause;
|
||||
var pattern: ESTree.Pattern;
|
||||
var assignmentPattern: ESTree.AssignmentPattern;
|
||||
var variableDeclaratorOrExpression: ESTree.VariableDeclaration | ESTree.Expression;
|
||||
var literalOrIdentifier: ESTree.Literal | ESTree.Identifier;
|
||||
var blockStatementOrExpression: ESTree.BlockStatement | ESTree.Expression;
|
||||
var identifierOrExpression: ESTree.Expression;
|
||||
var any: any;
|
||||
var string: string;
|
||||
var boolean: boolean;
|
||||
var number: number;
|
||||
|
||||
// Program
|
||||
string = program.type;
|
||||
statement = program.body[0];
|
||||
|
||||
// Location
|
||||
number = program.loc.start.line;
|
||||
number = program.loc.start.column;
|
||||
number = program.loc.end.line;
|
||||
number = program.loc.end.column;
|
||||
number = program.range[0];
|
||||
|
||||
// Statement
|
||||
// BlockStatement
|
||||
var blockStatement: ESTree.BlockStatement;
|
||||
string = blockStatement.type;
|
||||
statement = blockStatement.body[0];
|
||||
|
||||
// ExpressionStatement
|
||||
var expressionStatement: ESTree.ExpressionStatement;
|
||||
expression = expressionStatement.expression;
|
||||
|
||||
// IfStatement
|
||||
var ifStatement: ESTree.IfStatement;
|
||||
expression = ifStatement.test;
|
||||
statement = ifStatement.consequent;
|
||||
statement = ifStatement.alternate;
|
||||
|
||||
// LabeledStatement
|
||||
var labeledStatement: ESTree.LabeledStatement;
|
||||
identifier = labeledStatement.label;
|
||||
statement = labeledStatement.body;
|
||||
|
||||
// WithStatement
|
||||
var withStatement: ESTree.WithStatement;
|
||||
expression = withStatement.object;
|
||||
|
||||
// SwitchStatement
|
||||
var switchStatement: ESTree.SwitchStatement;
|
||||
expression = switchStatement.discriminant;
|
||||
switchCase = switchStatement.cases[0];
|
||||
boolean = switchStatement.lexical;
|
||||
|
||||
// ReturnStatement
|
||||
var returnStatement: ESTree.ReturnStatement;
|
||||
expression = returnStatement.argument;
|
||||
|
||||
// TryStatement
|
||||
var tryStatement: ESTree.TryStatement;
|
||||
blockStatement = tryStatement.block;
|
||||
catchClause = tryStatement.handler;
|
||||
blockStatement = tryStatement.finalizer;
|
||||
|
||||
// ForStatement
|
||||
var forStatement: ESTree.ForStatement;
|
||||
variableDeclaratorOrExpression = forStatement.init;
|
||||
expression = forStatement.update;
|
||||
|
||||
// ForInStatement
|
||||
var forInStatement: ESTree.ForInStatement;
|
||||
variableDeclaratorOrExpression = forInStatement.left;
|
||||
expression = forInStatement.right;
|
||||
|
||||
// Expression
|
||||
// ArrayExpression
|
||||
var arrayExpression: ESTree.ArrayExpression;
|
||||
string = arrayExpression.type;
|
||||
expression = arrayExpression.elements[0];
|
||||
|
||||
// ObjectExpression
|
||||
var objectExpression: ESTree.ObjectExpression;
|
||||
property = objectExpression.properties[0];
|
||||
string = property.type;
|
||||
expression = property.key;
|
||||
expression = property.value;
|
||||
string = property.kind;
|
||||
|
||||
// FunctionExpression
|
||||
var functionExpression: ESTree.FunctionExpression;
|
||||
identifier = functionExpression.id;
|
||||
assignmentPattern = <ESTree.AssignmentPattern>functionExpression.params[0];
|
||||
pattern = assignmentPattern.left;
|
||||
expression = assignmentPattern.right;
|
||||
blockStatementOrExpression = functionExpression.body;
|
||||
boolean = functionExpression.generator;
|
||||
|
||||
// SequenceExpression
|
||||
var sequenceExpression: ESTree.SequenceExpression;
|
||||
expression = sequenceExpression.expressions[0]
|
||||
|
||||
// UnaryExpression
|
||||
var unaryExpression: ESTree.UnaryExpression;
|
||||
string = unaryExpression.operator;
|
||||
boolean = unaryExpression.prefix;
|
||||
|
||||
// BinaryExpression
|
||||
var binaryExpression: ESTree.BinaryExpression;
|
||||
expression = binaryExpression.left;
|
||||
expression = binaryExpression.right;
|
||||
|
||||
// ConditionalExpression
|
||||
var conditionalExpression: ESTree.ConditionalExpression;
|
||||
expression = conditionalExpression.test;
|
||||
expression = conditionalExpression.alternate;
|
||||
expression = conditionalExpression.consequent;
|
||||
|
||||
// NewExpression
|
||||
var newExpression: ESTree.NewExpression;
|
||||
expression = newExpression.callee;
|
||||
expression = newExpression.arguments[0];
|
||||
|
||||
// CallExpression
|
||||
var callExpression: ESTree.CallExpression;
|
||||
expression = callExpression.callee;
|
||||
expression = callExpression.arguments[0];
|
||||
|
||||
// MemberExpression
|
||||
var memberExpression: ESTree.MemberExpression;
|
||||
expression = memberExpression.object;
|
||||
identifierOrExpression = memberExpression.property;
|
||||
boolean = memberExpression.computed;
|
||||
|
||||
// Declarations
|
||||
var functionDeclaration: ESTree.FunctionDeclaration;
|
||||
identifier = functionDeclaration.id;
|
||||
var params:ESTree.Pattern[] = functionDeclaration.params;
|
||||
var body:ESTree.BlockStatement | ESTree.Expression = functionDeclaration.body;
|
||||
boolean = functionDeclaration.generator;
|
||||
|
||||
var variableDeclaration: ESTree.VariableDeclaration;
|
||||
var declarations:ESTree.VariableDeclarator[] = variableDeclaration.declarations;
|
||||
string = variableDeclaration.kind; // "var" | "let" | "const"
|
||||
|
||||
var variableDeclarator: ESTree.VariableDeclarator;
|
||||
pattern = variableDeclarator.id; // Pattern
|
||||
expression = variableDeclarator.init;
|
||||
|
||||
// Clauses
|
||||
// SwitchCase
|
||||
string = switchCase.type;
|
||||
expression = switchCase.test;
|
||||
statement = switchCase.consequent[0];
|
||||
|
||||
// CatchClause
|
||||
string = catchClause.type;
|
||||
pattern = catchClause.param;
|
||||
expression = catchClause.guard;
|
||||
blockStatement = catchClause.body;
|
||||
|
||||
// Misc
|
||||
// Identifier
|
||||
string = identifier.type;
|
||||
string = identifier.name;
|
||||
|
||||
// Literal
|
||||
string = literal.type;
|
||||
any = literal.value;
|
||||
369
estree/estree.d.ts
vendored
Normal file
369
estree/estree.d.ts
vendored
Normal file
@@ -0,0 +1,369 @@
|
||||
// Type definitions for ESTree AST specification
|
||||
// Project: https://github.com/estree/estree
|
||||
// Definitions by: RReverser <https://github.com/RReverser>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module ESTree {
|
||||
interface Node {
|
||||
type: string;
|
||||
loc?: SourceLocation;
|
||||
range?: [number, number];
|
||||
}
|
||||
|
||||
interface SourceLocation {
|
||||
source?: string;
|
||||
start: Position;
|
||||
end: Position;
|
||||
}
|
||||
|
||||
interface Position {
|
||||
line: number;
|
||||
column: number;
|
||||
}
|
||||
|
||||
interface Program extends Node {
|
||||
body: Array<Statement>;
|
||||
sourceType: string;
|
||||
}
|
||||
|
||||
interface Function extends Node {
|
||||
id?: Identifier;
|
||||
params: Array<Pattern>;
|
||||
body: BlockStatement | Expression;
|
||||
generator: boolean;
|
||||
}
|
||||
|
||||
interface Statement extends Node {}
|
||||
|
||||
interface EmptyStatement extends Statement {}
|
||||
|
||||
interface BlockStatement extends Statement {
|
||||
body: Array<Statement>;
|
||||
}
|
||||
|
||||
interface ExpressionStatement extends Statement {
|
||||
expression: Expression;
|
||||
}
|
||||
|
||||
interface IfStatement extends Statement {
|
||||
test: Expression;
|
||||
consequent: Statement;
|
||||
alternate?: Statement;
|
||||
}
|
||||
|
||||
interface LabeledStatement extends Statement {
|
||||
label: Identifier;
|
||||
body: Statement;
|
||||
}
|
||||
|
||||
interface BreakStatement extends Statement {
|
||||
label?: Identifier;
|
||||
}
|
||||
|
||||
interface ContinueStatement extends Statement {
|
||||
label?: Identifier;
|
||||
}
|
||||
|
||||
interface WithStatement extends Statement {
|
||||
object: Expression;
|
||||
body: Statement;
|
||||
}
|
||||
|
||||
interface SwitchStatement extends Statement {
|
||||
discriminant: Expression;
|
||||
cases: Array<SwitchCase>;
|
||||
lexical: boolean;
|
||||
}
|
||||
|
||||
interface ReturnStatement extends Statement {
|
||||
argument?: Expression;
|
||||
}
|
||||
|
||||
interface ThrowStatement extends Statement {
|
||||
argument: Expression;
|
||||
}
|
||||
|
||||
interface TryStatement extends Statement {
|
||||
block: BlockStatement;
|
||||
handler?: CatchClause;
|
||||
finalizer?: BlockStatement;
|
||||
}
|
||||
|
||||
interface WhileStatement extends Statement {
|
||||
test: Expression;
|
||||
body: Statement;
|
||||
}
|
||||
|
||||
interface DoWhileStatement extends Statement {
|
||||
body: Statement;
|
||||
test: Expression;
|
||||
}
|
||||
|
||||
interface ForStatement extends Statement {
|
||||
init?: VariableDeclaration | Expression;
|
||||
test?: Expression;
|
||||
update?: Expression;
|
||||
body: Statement;
|
||||
}
|
||||
|
||||
interface ForInStatement extends Statement {
|
||||
left: VariableDeclaration | Expression;
|
||||
right: Expression;
|
||||
body: Statement;
|
||||
}
|
||||
|
||||
interface DebuggerStatement extends Statement {}
|
||||
|
||||
interface Declaration extends Statement {}
|
||||
|
||||
interface FunctionDeclaration extends Function, Declaration {
|
||||
id: Identifier;
|
||||
}
|
||||
|
||||
interface VariableDeclaration extends Declaration {
|
||||
declarations: Array<VariableDeclarator>;
|
||||
kind: string;
|
||||
}
|
||||
|
||||
interface VariableDeclarator extends Node {
|
||||
id: Pattern;
|
||||
init?: Expression;
|
||||
}
|
||||
|
||||
interface Expression extends Node {}
|
||||
|
||||
interface ThisExpression extends Expression {}
|
||||
|
||||
interface ArrayExpression extends Expression {
|
||||
elements: Array<Expression | SpreadElement>;
|
||||
}
|
||||
|
||||
interface ObjectExpression extends Expression {
|
||||
properties: Array<Property>;
|
||||
}
|
||||
|
||||
interface Property extends Node {
|
||||
key: Expression;
|
||||
value: Expression;
|
||||
kind: string;
|
||||
method: boolean;
|
||||
shorthand: boolean;
|
||||
computed: boolean;
|
||||
}
|
||||
|
||||
interface FunctionExpression extends Function, Expression {}
|
||||
|
||||
interface SequenceExpression extends Expression {
|
||||
expressions: Array<Expression>;
|
||||
}
|
||||
|
||||
interface UnaryExpression extends Expression {
|
||||
operator: UnaryOperator;
|
||||
prefix: boolean;
|
||||
argument: Expression;
|
||||
}
|
||||
|
||||
interface BinaryExpression extends Expression {
|
||||
operator: BinaryOperator;
|
||||
left: Expression;
|
||||
right: Expression;
|
||||
}
|
||||
|
||||
interface AssignmentExpression extends Expression {
|
||||
operator: AssignmentOperator;
|
||||
left: Pattern | MemberExpression;
|
||||
right: Expression;
|
||||
}
|
||||
|
||||
interface UpdateExpression extends Expression {
|
||||
operator: UpdateOperator;
|
||||
argument: Expression;
|
||||
prefix: boolean;
|
||||
}
|
||||
|
||||
interface LogicalExpression extends Expression {
|
||||
operator: LogicalOperator;
|
||||
left: Expression;
|
||||
right: Expression;
|
||||
}
|
||||
|
||||
interface ConditionalExpression extends Expression {
|
||||
test: Expression;
|
||||
alternate: Expression;
|
||||
consequent: Expression;
|
||||
}
|
||||
|
||||
interface CallExpression extends Expression {
|
||||
callee: Expression | Super;
|
||||
arguments: Array<Expression | SpreadElement>;
|
||||
}
|
||||
|
||||
interface NewExpression extends CallExpression {}
|
||||
|
||||
interface MemberExpression extends Expression, Pattern {
|
||||
object: Expression | Super;
|
||||
property: Expression;
|
||||
computed: boolean;
|
||||
}
|
||||
|
||||
interface Pattern extends Node {}
|
||||
|
||||
interface SwitchCase extends Node {
|
||||
test?: Expression;
|
||||
consequent: Array<Statement>;
|
||||
}
|
||||
|
||||
interface CatchClause extends Node {
|
||||
param: Pattern;
|
||||
guard: any;
|
||||
body: BlockStatement;
|
||||
}
|
||||
|
||||
interface Identifier extends Node, Expression, Pattern {
|
||||
name: string;
|
||||
}
|
||||
|
||||
interface Literal extends Node, Expression {
|
||||
value?: string | boolean | number | RegExp;
|
||||
}
|
||||
|
||||
interface RegexLiteral extends Literal {
|
||||
regex: {
|
||||
pattern: string;
|
||||
flags: string;
|
||||
};
|
||||
}
|
||||
|
||||
type UnaryOperator = string;
|
||||
|
||||
type BinaryOperator = string;
|
||||
|
||||
type LogicalOperator = string;
|
||||
|
||||
type AssignmentOperator = string;
|
||||
|
||||
type UpdateOperator = string;
|
||||
|
||||
interface ForOfStatement extends ForInStatement {}
|
||||
|
||||
interface Super extends Node {}
|
||||
|
||||
interface SpreadElement extends Node {
|
||||
argument: Expression;
|
||||
}
|
||||
|
||||
interface ArrowFunctionExpression extends Function, Expression {
|
||||
expression: boolean;
|
||||
}
|
||||
|
||||
interface YieldExpression extends Expression {
|
||||
argument?: Expression;
|
||||
}
|
||||
|
||||
interface TemplateLiteral extends Expression {
|
||||
quasis: Array<TemplateElement>;
|
||||
expressions: Array<Expression>;
|
||||
}
|
||||
|
||||
interface TaggedTemplateExpression extends Expression {
|
||||
tag: Expression;
|
||||
quasi: TemplateLiteral;
|
||||
}
|
||||
|
||||
interface TemplateElement extends Node {
|
||||
tail: boolean;
|
||||
value: {
|
||||
cooked: string;
|
||||
value: string;
|
||||
};
|
||||
}
|
||||
|
||||
interface AssignmentProperty extends Property {
|
||||
value: Pattern;
|
||||
kind: string;
|
||||
method: boolean;
|
||||
}
|
||||
|
||||
interface ObjectPattern extends Pattern {
|
||||
properties: Array<AssignmentProperty>;
|
||||
}
|
||||
|
||||
interface ArrayPattern extends Pattern {
|
||||
elements: Array<Pattern>;
|
||||
}
|
||||
|
||||
interface RestElement extends Pattern {
|
||||
argument: Pattern;
|
||||
}
|
||||
|
||||
interface AssignmentPattern extends Pattern {
|
||||
left: Pattern;
|
||||
right: Expression;
|
||||
}
|
||||
|
||||
interface Class extends Node {
|
||||
id?: Identifier;
|
||||
superClass: Expression;
|
||||
body: ClassBody;
|
||||
}
|
||||
|
||||
interface ClassBody extends Node {
|
||||
body: Array<MethodDefinition>;
|
||||
}
|
||||
|
||||
interface MethodDefinition extends Node {
|
||||
key: Identifier;
|
||||
value: FunctionExpression;
|
||||
kind: string;
|
||||
computed: boolean;
|
||||
static: boolean;
|
||||
}
|
||||
|
||||
interface ClassDeclaration extends Class, Declaration {
|
||||
id: Identifier;
|
||||
}
|
||||
|
||||
interface ClassExpression extends Class, Expression {}
|
||||
|
||||
interface MetaProperty extends Expression {
|
||||
meta: Identifier;
|
||||
property: Identifier;
|
||||
}
|
||||
|
||||
interface ImportDeclaration extends Node {
|
||||
specifiers: Array<ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier>;
|
||||
source: Literal;
|
||||
}
|
||||
|
||||
interface ImportSpecifier {
|
||||
imported: Identifier;
|
||||
local: Identifier;
|
||||
}
|
||||
|
||||
interface ImportDefaultSpecifier {
|
||||
local: Identifier;
|
||||
}
|
||||
|
||||
interface ImportNamespaceSpecifier {
|
||||
local: Identifier;
|
||||
}
|
||||
|
||||
interface ExportNamedDeclaration extends Node {
|
||||
declaration?: Declaration;
|
||||
specifiers: Array<ExportSpecifier>;
|
||||
source?: Literal;
|
||||
}
|
||||
|
||||
interface ExportSpecifier {
|
||||
exported: Identifier;
|
||||
local: Identifier;
|
||||
}
|
||||
|
||||
interface ExportDefaultDeclaration extends Node {
|
||||
declaration: Declaration | Expression;
|
||||
}
|
||||
|
||||
interface ExportAllDeclaration extends Node {
|
||||
source: Literal;
|
||||
}
|
||||
}
|
||||
21
express-debug/express-debug-tests.ts
Normal file
21
express-debug/express-debug-tests.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
/// <reference path="express-debug.d.ts" />
|
||||
|
||||
import express = require('express');
|
||||
import debug = require('express-debug');
|
||||
var app = express();
|
||||
|
||||
debug(app, {
|
||||
depth: 4,
|
||||
theme: 'public/css/debug.css',
|
||||
extra_panels: [{
|
||||
name: 'mypanel',
|
||||
template: '/absolute/path/to/mypanel.jade',
|
||||
process: function(locals) {
|
||||
return { locals: { mypanel: true, }};
|
||||
}
|
||||
}],
|
||||
panels: ['locals', 'request', 'session'],
|
||||
path: '/express-debug',
|
||||
extra_attrs: '',
|
||||
sort: false,
|
||||
});
|
||||
83
express-debug/express-debug.d.ts
vendored
Normal file
83
express-debug/express-debug.d.ts
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
// Type definitions for express-debug 1.1.1
|
||||
// Project: https://github.com/devoidfury/express-debug
|
||||
// Definitions by: Federico Bond <https://github.com/federicobond/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/* =================== USAGE ===================
|
||||
|
||||
import debug = require('express-debug');
|
||||
debug(app, options);
|
||||
|
||||
=============================================== */
|
||||
|
||||
/// <reference path="../express/express.d.ts" />
|
||||
|
||||
declare module "express-debug" {
|
||||
import express = require('express');
|
||||
|
||||
interface CustomPanel {
|
||||
name: string;
|
||||
|
||||
template: string;
|
||||
|
||||
process(locals: any): any;
|
||||
|
||||
standalone?: boolean;
|
||||
|
||||
initialize?(req: express.Request): void;
|
||||
|
||||
finalize?(req: express.Request): void;
|
||||
|
||||
pre_render?(req: express.Request): void;
|
||||
|
||||
post_render?(req: express.Request): void;
|
||||
|
||||
options?: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* Node.js middleware for serving a favicon.
|
||||
*/
|
||||
function debug(app: express.Application, settings?: {
|
||||
/**
|
||||
* How deep to recurse through printed objects. This is the default unless the
|
||||
* print_obj function is passed an options object with a 'depth' property.
|
||||
*/
|
||||
depth?: number;
|
||||
|
||||
/**
|
||||
* Absolute path to a css file to include and override EDT's default css.
|
||||
*/
|
||||
theme?: string;
|
||||
|
||||
/**
|
||||
* Additional panels to show.
|
||||
*/
|
||||
extra_panels?: CustomPanel[];
|
||||
|
||||
/**
|
||||
* Allows changing the default panel.
|
||||
*/
|
||||
panels?: string[];
|
||||
|
||||
/**
|
||||
* Path to render standalone express-debug.
|
||||
*/
|
||||
path?: string;
|
||||
|
||||
/**
|
||||
* If you need to add arbitrary attributes to the containing element of EDT,
|
||||
* this allows you to.
|
||||
*/
|
||||
extra_attrs?: string;
|
||||
|
||||
/**
|
||||
* Global option to determine sort order of printed object values. false for
|
||||
* default order, true for basic default sort, or a function to use for sort.
|
||||
*/
|
||||
sort?: boolean | ((a: number, b: number) => number);
|
||||
|
||||
}): void;
|
||||
|
||||
export = debug;
|
||||
}
|
||||
2
formidable/formidable.d.ts
vendored
2
formidable/formidable.d.ts
vendored
@@ -25,7 +25,7 @@ declare module "formidable" {
|
||||
onPart: (part: Part) => void;
|
||||
|
||||
handlePart(part: Part): void;
|
||||
parse(req: http.ServerRequest, callback?: (err: any, fields: Fields, files: Files) => any): void;
|
||||
parse(req: http.IncomingMessage, callback?: (err: any, fields: Fields, files: Files) => any): void;
|
||||
}
|
||||
|
||||
export interface Fields {
|
||||
|
||||
28
ftp/ftp-tests.ts
Normal file
28
ftp/ftp-tests.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
/// <reference path="ftp.d.ts" />
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
|
||||
import Client = require("ftp");
|
||||
import fs = require("fs");
|
||||
|
||||
var c = new Client();
|
||||
c.on('ready', (): void => {
|
||||
c.get('foo.txt', function(err: Error, stream: NodeJS.ReadableStream): void {
|
||||
if (err) throw err;
|
||||
stream.once('close', function(): void {
|
||||
c.end();
|
||||
});
|
||||
stream.pipe(fs.createWriteStream('foo.local-copy.txt'));
|
||||
});
|
||||
});
|
||||
// connect to localhost:21 as anonymous
|
||||
c.connect();
|
||||
|
||||
c.connect({
|
||||
host: "127.0.0.1",
|
||||
port: 21,
|
||||
username: "Boo",
|
||||
password: "secret"
|
||||
});
|
||||
|
||||
|
||||
|
||||
294
ftp/ftp.d.ts
vendored
Normal file
294
ftp/ftp.d.ts
vendored
Normal file
@@ -0,0 +1,294 @@
|
||||
// Type definitions for ftp 0.3.8
|
||||
// Project: https://github.com/mscdex/node-ftp
|
||||
// Definitions by: Rogier Schouten <https://github.com/rogierschouten>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
|
||||
declare module "ftp" {
|
||||
|
||||
import events = require("events");
|
||||
import tls = require("tls");
|
||||
|
||||
module Client {
|
||||
|
||||
/**
|
||||
* Options for Client#connect()
|
||||
*/
|
||||
export interface Options {
|
||||
/**
|
||||
* The hostname or IP address of the FTP server. Default: 'localhost'
|
||||
*/
|
||||
host?: string;
|
||||
/**
|
||||
* The port of the FTP server. Default: 21
|
||||
*/
|
||||
port?: number;
|
||||
/**
|
||||
* Set to true for both control and data connection encryption, 'control' for control connection encryption only, or 'implicit' for
|
||||
* implicitly encrypted control connection (this mode is deprecated in modern times, but usually uses port 990) Default: false
|
||||
*/
|
||||
secure?: string|boolean;
|
||||
/**
|
||||
* Additional options to be passed to tls.connect(). Default: (none)
|
||||
*/
|
||||
secureOptions?: tls.ConnectionOptions;
|
||||
/**
|
||||
* Username for authentication. Default: 'anonymous'
|
||||
*/
|
||||
user?: string;
|
||||
/**
|
||||
* Password for authentication. Default: 'anonymous@'
|
||||
*/
|
||||
password?: string;
|
||||
/**
|
||||
* How long (in milliseconds) to wait for the control connection to be established. Default: 10000
|
||||
*/
|
||||
connTimeout?: number;
|
||||
/**
|
||||
* How long (in milliseconds) to wait for a PASV data connection to be established. Default: 10000
|
||||
*/
|
||||
pasvTimeout?: number;
|
||||
/**
|
||||
* How often (in milliseconds) to send a 'dummy' (NOOP) command to keep the connection alive. Default: 10000
|
||||
*/
|
||||
keepalive?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Element returned by Client#list()
|
||||
*/
|
||||
export interface ListingElement {
|
||||
/**
|
||||
* A single character denoting the entry type: 'd' for directory, '-' for file (or 'l' for symlink on **\*NIX only**).
|
||||
*/
|
||||
"type": string;
|
||||
/**
|
||||
* The name of the entry
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The size of the entry in bytes
|
||||
*/
|
||||
size: string;
|
||||
/**
|
||||
* The last modified date of the entry
|
||||
*/
|
||||
date: Date;
|
||||
/**
|
||||
* The various permissions for this entry **(*NIX only)**
|
||||
*/
|
||||
rights?: {
|
||||
/**
|
||||
* An empty string or any combination of 'r', 'w', 'x'.
|
||||
*/
|
||||
user: string;
|
||||
/**
|
||||
* An empty string or any combination of 'r', 'w', 'x'.
|
||||
*/
|
||||
group: string;
|
||||
/**
|
||||
* An empty string or any combination of 'r', 'w', 'x'.
|
||||
*/
|
||||
other: string;
|
||||
};
|
||||
/**
|
||||
* The user name or ID that this entry belongs to **(*NIX only)**.
|
||||
*/
|
||||
owner?: string;
|
||||
/**
|
||||
* The group name or ID that this entry belongs to **(*NIX only)**.
|
||||
*/
|
||||
group?: string;
|
||||
/**
|
||||
* For symlink entries, this is the symlink's target **(*NIX only)**.
|
||||
*/
|
||||
target?: string;
|
||||
/**
|
||||
* True if the sticky bit is set for this entry **(*NIX only)**.
|
||||
*/
|
||||
sticky?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* FTP client.
|
||||
*
|
||||
* Events:
|
||||
* @event greeting(< string >msg) - Emitted after connection. msg is the text the server sent upon connection.
|
||||
* @event ready() - Emitted when connection and authentication were sucessful.
|
||||
* @event close(< boolean >hadErr) - Emitted when the connection has fully closed.
|
||||
* @event end() - Emitted when the connection has ended.
|
||||
* @event error(< Error >err) - Emitted when an error occurs. In case of protocol-level errors, err contains
|
||||
* a 'code' property that references the related 3-digit FTP response code.
|
||||
*/
|
||||
class Client extends events.EventEmitter {
|
||||
|
||||
/**
|
||||
* Creates and returns a new FTP client instance.
|
||||
*/
|
||||
constructor();
|
||||
|
||||
/**
|
||||
* Connects to an FTP server.
|
||||
*/
|
||||
connect(config?: Client.Options): void;
|
||||
|
||||
/**
|
||||
* Closes the connection to the server after any/all enqueued commands have been executed.
|
||||
*/
|
||||
end(): void;
|
||||
|
||||
/**
|
||||
* Closes the connection to the server immediately.
|
||||
*/
|
||||
destroy(): void;
|
||||
|
||||
/**
|
||||
* Retrieves the directory listing of path.
|
||||
* @param path defaults to the current working directory.
|
||||
* @param useCompression defaults to false.
|
||||
*/
|
||||
list(path: string, useCompression: boolean, callback: (error: Error, listing: Client.ListingElement[]) => void): void;
|
||||
list(path: string, callback: (error: Error, listing: Client.ListingElement[]) => void): void;
|
||||
list(useCompression: boolean, callback: (error: Error, listing: Client.ListingElement[]) => void): void;
|
||||
list(callback: (error: Error, listing: Client.ListingElement[]) => void): void;
|
||||
|
||||
/**
|
||||
* Retrieves a file at path from the server. useCompression defaults to false
|
||||
*/
|
||||
get(path: string, callback: (error: Error, stream: NodeJS.ReadableStream) => void): void;
|
||||
get(path: string, useCompression: boolean, callback: (error: Error, stream: NodeJS.ReadableStream) => void): void;
|
||||
|
||||
/**
|
||||
* Sends data to the server to be stored as destPath.
|
||||
* @param input can be a ReadableStream, a Buffer, or a path to a local file.
|
||||
* @param destPath
|
||||
* @param useCompression defaults to false.
|
||||
*/
|
||||
put(input: NodeJS.ReadableStream|Buffer|string, destPath: string, useCompression: boolean, callback: (error: Error) => void): void;
|
||||
put(input: NodeJS.ReadableStream|Buffer|string, destPath: string, callback: (error: Error) => void): void;
|
||||
|
||||
/**
|
||||
* Same as put(), except if destPath already exists, it will be appended to instead of overwritten.
|
||||
* @param input can be a ReadableStream, a Buffer, or a path to a local file.
|
||||
* @param destPath
|
||||
* @param useCompression defaults to false.
|
||||
*/
|
||||
append(input: NodeJS.ReadableStream|Buffer|string, destPath: string, useCompression: boolean, callback: (error: Error) => void): void;
|
||||
append(input: NodeJS.ReadableStream|Buffer|string, destPath: string, callback: (error: Error) => void): void;
|
||||
|
||||
/**
|
||||
* Renames oldPath to newPath on the server
|
||||
*/
|
||||
rename(oldPath: string, newPath: string, callback: (error: Error) => void): void;
|
||||
|
||||
/**
|
||||
* Logout the user from the server.
|
||||
*/
|
||||
logout(callback: (error: Error) => void): void;
|
||||
|
||||
/**
|
||||
* Delete a file on the server
|
||||
*/
|
||||
delete(path: string, callback: (error: Error) => void): void;
|
||||
|
||||
/**
|
||||
* Changes the current working directory to path. callback has 2 parameters: < Error >err, < string >currentDir.
|
||||
* Note: currentDir is only given if the server replies with the path in the response text.
|
||||
*/
|
||||
cwd(path: string, callback: (error: Error, currentDir?: string) => void): void;
|
||||
|
||||
/**
|
||||
* Aborts the current data transfer (e.g. from get(), put(), or list())
|
||||
*/
|
||||
abort(callback: (error: Error) => void): void;
|
||||
|
||||
/**
|
||||
* Sends command (e.g. 'CHMOD 755 foo', 'QUOTA') using SITE. callback has 3 parameters:
|
||||
* < Error >err, < _string >responseText, < integer >responseCode.
|
||||
*/
|
||||
site(command: string, callback: (error: Error, responseText: string, responseCode: number) => void): void;
|
||||
|
||||
/**
|
||||
* Retrieves human-readable information about the server's status.
|
||||
*/
|
||||
status(callback: (error: Error, status: string) => void): void;
|
||||
|
||||
/**
|
||||
* Sets the transfer data type to ASCII.
|
||||
*/
|
||||
ascii(callback: (error: Error) => void): void;
|
||||
|
||||
/**
|
||||
* Sets the transfer data type to binary (default at time of connection).
|
||||
*/
|
||||
binary(callback: (error: Error) => void): void;
|
||||
|
||||
/**
|
||||
* Optional "standard" commands (RFC 959)
|
||||
* Creates a new directory, path, on the server. recursive is for enabling a 'mkdir -p' algorithm and defaults to false
|
||||
*/
|
||||
mkdir(path: string, recursive: boolean, callback: (error: Error) => void): void;
|
||||
mkdir(path: string, callback: (error: Error) => void): void;
|
||||
|
||||
|
||||
/**
|
||||
* Optional "standard" commands (RFC 959)
|
||||
* Removes a directory, path, on the server. If recursive, this call will delete the contents of the directory if it is not empty
|
||||
*/
|
||||
rmdir(path: string, recursive: boolean, callback: (error: Error) => void): void;
|
||||
rmdir(path: string, callback: (error: Error) => void): void;
|
||||
|
||||
/**
|
||||
* Optional "standard" commands (RFC 959)
|
||||
* Changes the working directory to the parent of the current directory
|
||||
*/
|
||||
cdup(callback: (error: Error) => void): void;
|
||||
|
||||
/**
|
||||
* Optional "standard" commands (RFC 959)
|
||||
* Retrieves the current working directory
|
||||
*/
|
||||
pwd(callback: (error: Error, path: string) => void): void;
|
||||
|
||||
/**
|
||||
* Optional "standard" commands (RFC 959)
|
||||
* Retrieves the server's operating system.
|
||||
*/
|
||||
system(callback: (error: Error, OS: string) => void): void;
|
||||
|
||||
/**
|
||||
* Optional "standard" commands (RFC 959)
|
||||
* Similar to list(), except the directory is temporarily changed to path to retrieve the directory listing.
|
||||
* This is useful for servers that do not handle characters like spaces and quotes in directory names well for the LIST command.
|
||||
* This function is "optional" because it relies on pwd() being available.
|
||||
*/
|
||||
listSafe(path: string, useCompression: boolean, callback: (error: Error, listing: Client.ListingElement[]) => void): void;
|
||||
listSafe(path: string, callback: (error: Error, listing: Client.ListingElement[]) => void): void;
|
||||
listSafe(useCompression: boolean, callback: (error: Error, listing: Client.ListingElement[]) => void): void;
|
||||
listSafe(callback: (error: Error, listing: Client.ListingElement[]) => void): void;
|
||||
|
||||
/**
|
||||
* Extended commands (RFC 3659)
|
||||
* Retrieves the size of path
|
||||
*/
|
||||
size(path: string, callback: (error: Error, size: number) => void): void;
|
||||
|
||||
/**
|
||||
* Extended commands (RFC 3659)
|
||||
* Retrieves the last modified date and time for path
|
||||
*/
|
||||
lastMod(path: string, callback: (error: Error, lastMod: Date) => void): void;
|
||||
|
||||
/**
|
||||
* Extended commands (RFC 3659)
|
||||
* Sets the file byte offset for the next file transfer action (get/put) to byteOffset
|
||||
*/
|
||||
restart(byteOffset: number, callback: (error: Error) => void): void;
|
||||
|
||||
}
|
||||
|
||||
export = Client;
|
||||
}
|
||||
32
ftpd/ftpd-tests.ts
Normal file
32
ftpd/ftpd-tests.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
/// <reference path="ftpd.d.ts" />
|
||||
|
||||
import ftpd = require("ftpd");
|
||||
|
||||
var options: ftpd.FtpServerOptions = {
|
||||
pasvPortRangeStart: 4000,
|
||||
pasvPortRangeEnd: 5000,
|
||||
getInitialCwd: function(connection: ftpd.FtpConnection, callback: (error: Error, path: string) => void): void {
|
||||
callback(null, "boo");
|
||||
},
|
||||
getRoot: function(connection: ftpd.FtpConnection): string {
|
||||
return '/';
|
||||
}
|
||||
};
|
||||
|
||||
var host: string = '10.0.0.42';
|
||||
|
||||
var server = new ftpd.FtpServer(host, options);
|
||||
|
||||
server.on('client:connected', function(conn: ftpd.FtpConnection): void {
|
||||
conn.on('command:user', function(user: string, success: () => void, failure: () => void): void {
|
||||
success();
|
||||
});
|
||||
conn.on('command:pass', function(
|
||||
pass: string,
|
||||
success: (username: string, fs?: ftpd.FtpFileSystem) => void,
|
||||
failure: () => void) {
|
||||
success("Rogier");
|
||||
});
|
||||
});
|
||||
|
||||
server.listen(21);
|
||||
202
ftpd/ftpd.d.ts
vendored
Normal file
202
ftpd/ftpd.d.ts
vendored
Normal file
@@ -0,0 +1,202 @@
|
||||
// Type definitions for ftpd 0.2.11
|
||||
// Project: https://github.com/sstur/nodeftpd
|
||||
// Definitions by: Rogier Schouten <https://github.com/rogierschouten>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
|
||||
declare module "ftpd" {
|
||||
|
||||
import events = require("events");
|
||||
import fs = require("fs");
|
||||
import net = require("net");
|
||||
import tls = require("tls");
|
||||
|
||||
/**
|
||||
* Options for FtpServer constructor
|
||||
*/
|
||||
export interface FtpServerOptions {
|
||||
/**
|
||||
* Gets the initial working directory for the user. Called after user is authenticated
|
||||
* Typical cases where you would want/need the callback involve retrieving configurations from external datasources and suchlike.
|
||||
*/
|
||||
getInitialCwd: (connection: FtpConnection, callback?: (error: Error, path: string) => void) => void|string;
|
||||
/**
|
||||
* Gets the root directory for the user relative to the CWD. Called after getInitialCwd. The user is not able to escape this directory.
|
||||
* Typical cases where you would want/need the callback involve retrieving configurations from external datasources and suchlike.
|
||||
*/
|
||||
getRoot: (connection: FtpConnection, callback?: (error: Error, path: string) => void) => void|string;
|
||||
/**
|
||||
* If set to true, then files which the client uploads are buffered in memory and then written to disk using writeFile.
|
||||
* If false, files are written using writeStream.
|
||||
*/
|
||||
useWriteFile?: boolean;
|
||||
/**
|
||||
* If set to true, then files which the client uploads are slurped using 'readFile'.
|
||||
* If false, files are read using readStream.
|
||||
*/
|
||||
useReadFile?: boolean;
|
||||
/**
|
||||
* Determines the maximum file size (in bytes) for which uploads are buffered in memory before being written to disk.
|
||||
* Has an effect only if useWriteFile is set to true.
|
||||
* If uploadMaxSlurpSize is not set, then there is no limit on buffer size.
|
||||
*/
|
||||
uploadMaxSlurpSize?: number;
|
||||
/**
|
||||
* The maximum number of concurrent calls to fs.stat which will be made when processing a LIST request. Default 5.
|
||||
*/
|
||||
maxStatsAtOnce?: number;
|
||||
/**
|
||||
* A function which can be used as the argument of an array's sort method. Used to sort filenames for directory listings.
|
||||
* See [https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/sort] for more info.
|
||||
*/
|
||||
filenameSortFunc?: (a: string, b: string) => number;
|
||||
/**
|
||||
* A function which is applied to each filename before sorting.
|
||||
* If set to false, filenames are unaltered.
|
||||
*/
|
||||
filenameSortMap?: ((a: string) => string) | boolean;
|
||||
/**
|
||||
* If this is set, then filenames are not sorted in responses to the LIST and NLST commands.
|
||||
*/
|
||||
dontSortFilenames?: boolean;
|
||||
/**
|
||||
* If set to true, then LIST and NLST treat the characters ? and * as literals instead of as wildcards.
|
||||
*/
|
||||
noWildcards?: boolean;
|
||||
/**
|
||||
* If this is set, the server will allow explicit TLS authentication. Value should be a dictionary which is suitable as the options argument of tls.createServer.
|
||||
*/
|
||||
tlsOptions?: tls.TlsOptions;
|
||||
/**
|
||||
* If this is set to true, and tlsOptions is also set, then the server will not allow logins over non-secure connections.
|
||||
* Default false
|
||||
*/
|
||||
tlsOnly?: boolean;
|
||||
/**
|
||||
* I obviously set this to true when tlsOnly is on -someone needs to update this.
|
||||
*/
|
||||
allowUnauthorizedTls?: boolean;
|
||||
/**
|
||||
* Integer, specifies the lower-bound port (min port) for creating PASV connections
|
||||
*/
|
||||
pasvPortRangeStart?: number;
|
||||
/**
|
||||
* Integer, specifies the upper-bound port (max port) for creating PASV connections
|
||||
*/
|
||||
pasvPortRangeEnd?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents one Ftp connection. Incomplete type definition.
|
||||
*
|
||||
* @event command:user (username: string, success: () => void, failure: () => void)
|
||||
* @event command:pass (password: string, success: (username: string, fs?: FtpFileSystem) => void, failure: () => void)
|
||||
* The server raises a command:pass event which is given pass, success and failure arguments.
|
||||
* On successful login, success should be called with a username argument. It may also optionally
|
||||
* be given a second argument, which should be an object providing an implementation of the API for Node's fs module.
|
||||
*/
|
||||
export class FtpConnection extends events.EventEmitter {
|
||||
server: FtpServer;
|
||||
socket: net.Socket;
|
||||
pasv: net.Server;
|
||||
dataSocket: net.Socket; // the actual data socket
|
||||
mode: string;
|
||||
username: string;
|
||||
cwd: string;
|
||||
root: string;
|
||||
hasQuit: boolean;
|
||||
// State for handling TLS upgrades.
|
||||
secure: boolean;
|
||||
pbszReceived: boolean;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Optional mock fs implementation to set in the command:pass event of FtpConnection
|
||||
*/
|
||||
export interface FtpFileSystem {
|
||||
unlink: (path: string, callback?: (err?: NodeJS.ErrnoException) => void) => void;
|
||||
readdir: (path: string, callback?: (err: NodeJS.ErrnoException, files: string[]) => void) => void;
|
||||
mkdir: ((path: string, callback?: (err?: NodeJS.ErrnoException) => void) => void)
|
||||
| ((path: string, mode: number, callback?: (err?: NodeJS.ErrnoException) => void) => void)
|
||||
| ((path: string, mode: string, callback?: (err?: NodeJS.ErrnoException) => void) => void);
|
||||
open: ((path: string, flags: string, callback?: (err: NodeJS.ErrnoException, fd: number) => any) => void)
|
||||
| ((path: string, flags: string, mode: number, callback?: (err: NodeJS.ErrnoException, fd: number) => any) => void)
|
||||
| ((path: string, flags: string, mode: string, callback?: (err: NodeJS.ErrnoException, fd: number) => any) => void);
|
||||
close: (fd: number, callback?: (err?: NodeJS.ErrnoException) => void) => void;
|
||||
rmdir: (path: string, callback?: (err?: NodeJS.ErrnoException) => void) => void;
|
||||
rename: (oldPath: string, newPath: string, callback?: (err?: NodeJS.ErrnoException) => void) => void;
|
||||
/**
|
||||
* specific object properties: { mode, isDirectory(), size, mtime }
|
||||
*/
|
||||
stat: (path: string, callback?: (err: NodeJS.ErrnoException, stats: fs.Stats) => any) => void;
|
||||
/**
|
||||
* if useReadFile option is not set or is false
|
||||
*/
|
||||
createReadStream?: (path: string, options?: {
|
||||
flags?: string;
|
||||
encoding?: string;
|
||||
fd?: string;
|
||||
mode?: string;
|
||||
bufferSize?: number;
|
||||
}) => fs.ReadStream;
|
||||
/**
|
||||
* if useWriteFile option is not set or is false
|
||||
*/
|
||||
createWriteStream?: (path: string, options?: {
|
||||
flags?: string;
|
||||
encoding?: string;
|
||||
string?: string;
|
||||
}) => fs.WriteStream;
|
||||
/**
|
||||
* if useReadFile option is set to 'true'
|
||||
*/
|
||||
readFile?:
|
||||
((filename: string, encoding: string, callback: (err: NodeJS.ErrnoException, data: string) => void) => void)
|
||||
| ((filename: string, options: { encoding: string; flag?: string; }, callback: (err: NodeJS.ErrnoException, data: string) => void) => void)
|
||||
| ((filename: string, options: { flag?: string; }, callback: (err: NodeJS.ErrnoException, data: Buffer) => void) => void)
|
||||
| ((filename: string, callback: (err: NodeJS.ErrnoException, data: Buffer) => void ) => void);
|
||||
/**
|
||||
* if useWriteFile option is set to 'true'
|
||||
*/
|
||||
writeFile?:
|
||||
((filename: string, data: any, callback?: (err: NodeJS.ErrnoException) => void) => void)
|
||||
| ((filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void) => void)
|
||||
| ((filename: string, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void) => void);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* FTP server
|
||||
*
|
||||
* Events:
|
||||
* @event close net.Server close event
|
||||
* @event error net.Server error event
|
||||
* @event client:connected (connection: FtpConnection)
|
||||
*/
|
||||
export class FtpServer extends events.EventEmitter {
|
||||
|
||||
/**
|
||||
* @param host host is a string representation of the IP address clients use to connect to the FTP server.
|
||||
* It's imperative that this actually reflects the remote IP the clients use to access the server,
|
||||
* as this IP will be used in the establishment of PASV data connections. If this IP is not the one clients use to connect,
|
||||
* you will see some strange behavior from the client side (hangs).
|
||||
* @param options See test.js for a simple example.
|
||||
*/
|
||||
constructor(host: string, options: FtpServerOptions);
|
||||
|
||||
/**
|
||||
* Start listening, see net.Server.listen()
|
||||
*/
|
||||
public listen(port: number, host?: string, backlog?: number, listeningListener?: () => void): void;
|
||||
|
||||
/**
|
||||
* Stop listening
|
||||
*/
|
||||
public close(callback?: () => void): void;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
49
googlemaps/google.maps.d.ts
vendored
49
googlemaps/google.maps.d.ts
vendored
@@ -1345,6 +1345,55 @@ declare module google.maps {
|
||||
}
|
||||
|
||||
export module places {
|
||||
|
||||
export class AutocompleteService extends MVCObject {
|
||||
constructor();
|
||||
getPlacePredictions(request: AutocompletionRequest, callback: (result: AutocompletePrediction[], status: PlacesServiceStatus) => void): void;
|
||||
getQueryPredictions(request: QueryAutocompletionRequest, callback: (result: QueryAutocompletePrediction[], status: PlacesServiceStatus) => void): void;
|
||||
}
|
||||
|
||||
export interface AutocompletionRequest {
|
||||
input: string;
|
||||
bounds?: LatLngBounds;
|
||||
componentRestrictions?: ComponentRestrictions;
|
||||
location?: LatLng;
|
||||
offset?: number;
|
||||
radius?: number;
|
||||
types?: string[];
|
||||
}
|
||||
|
||||
export interface QueryAutocompletionRequest {
|
||||
input: string;
|
||||
bounds?: LatLngBounds;
|
||||
location?: LatLng;
|
||||
offset?: number;
|
||||
radius?: number;
|
||||
}
|
||||
|
||||
export interface AutocompletePrediction {
|
||||
description: string;
|
||||
matched_substrings: PredictionSubstring[];
|
||||
place_id: string;
|
||||
terms: PredictionTerm[];
|
||||
types: string[]
|
||||
}
|
||||
|
||||
export interface PredictionTerm {
|
||||
offset: number;
|
||||
value: string;
|
||||
}
|
||||
|
||||
export interface PredictionSubstring {
|
||||
length: number;
|
||||
offset: number;
|
||||
}
|
||||
|
||||
export interface QueryAutocompletePrediction {
|
||||
description: string;
|
||||
matched_substrings: PredictionSubstring[];
|
||||
place_id: string;
|
||||
terms: PredictionTerm[];
|
||||
}
|
||||
|
||||
export class Autocomplete extends MVCObject {
|
||||
constructor (inputField: HTMLInputElement, opts?: AutocompleteOptions);
|
||||
|
||||
21
grecaptcha/grecaptcha-tests.ts
Normal file
21
grecaptcha/grecaptcha-tests.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
/// <reference path="grecaptcha.d.ts" />
|
||||
|
||||
var params: ReCaptchaV2.Parameters = {
|
||||
"sitekey": "mySuperSecretKey",
|
||||
"theme": "black", // no type-checking here.
|
||||
"type": "image",
|
||||
"tabindex": 5,
|
||||
"callback": (response: string) => { },
|
||||
"expired-callback": () => { },
|
||||
}
|
||||
|
||||
var id1: number = grecaptcha.render("foo");
|
||||
var id2: number = grecaptcha.render("foo", params);
|
||||
var id3: number = grecaptcha.render(document.getElementById("foo"));
|
||||
var id4: number = grecaptcha.render(document.getElementById("foo"), params);
|
||||
|
||||
// response takes a number and returns a string
|
||||
var response1: string = grecaptcha.getResponse(id1);
|
||||
|
||||
// reset takes a number
|
||||
grecaptcha.reset(id1);
|
||||
67
grecaptcha/grecaptcha.d.ts
vendored
Normal file
67
grecaptcha/grecaptcha.d.ts
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
// Type definitions for Google Recaptcha v2
|
||||
// Project: https://www.google.com/recaptcha
|
||||
// Definitions by: Kristof Mattei <http://kristofmattei.be>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare var grecaptcha: ReCaptchaV2.ReCaptcha;
|
||||
|
||||
declare module ReCaptchaV2
|
||||
{
|
||||
class ReCaptcha
|
||||
{
|
||||
/**
|
||||
* Renders the container as a reCAPTCHA widget and returns the ID of the newly created widget.
|
||||
* @param container The HTML element to render the reCAPTCHA widget. Specify either the ID of the container (string) or the DOM element itself.
|
||||
* @param parameters An object containing parameters as key=value pairs, for example, {"sitekey": "your_site_key", "theme": "light"}. See @see render parameters.
|
||||
* @return the ID of the newly created widget.
|
||||
**/
|
||||
render(container: (string | HTMLElement), parameters?: Parameters): number;
|
||||
/**
|
||||
* Resets the reCAPTCHA widget.
|
||||
* @param opt_widget_id Optional widget ID, defaults to the first widget created if unspecified.
|
||||
**/
|
||||
reset(opt_widget_id?: number): void;
|
||||
/**
|
||||
* Gets the response for the reCAPTCHA widget.
|
||||
* @param opt_widget_id Optional widget ID, defaults to the first widget created if unspecified.
|
||||
* @return the response of the reCAPTCHA widget.
|
||||
**/
|
||||
getResponse(opt_widget_id?: number): string;
|
||||
}
|
||||
|
||||
interface Parameters
|
||||
{
|
||||
/**
|
||||
* Your sitekey.
|
||||
**/
|
||||
sitekey: string;
|
||||
/**
|
||||
* Optional. The color theme of the widget.
|
||||
* Accepted values: "light", "dark"
|
||||
* @default "light"
|
||||
**/
|
||||
theme?: string;
|
||||
/**
|
||||
* Optional. The type of CAPTCHA to serve.
|
||||
* Accepted values: "audio ", "image"
|
||||
* @default "image"
|
||||
**/
|
||||
type?: string;
|
||||
/**
|
||||
* Optional. The tabindex of the widget and challenge.
|
||||
* If other elements in your page use tabindex, it should be set to make user navigation easier.
|
||||
**/
|
||||
tabindex?: number;
|
||||
/**
|
||||
* Optional. Your callback function that's executed when the user submits a successful CAPTCHA response.
|
||||
* The user's response, g-recaptcha-response, will be the input for your callback function.
|
||||
**/
|
||||
callback?: (response: string) => void;
|
||||
/**
|
||||
* Optional. Your callback function that's executed when the recaptcha response expires and the user needs to solve a new CAPTCHA.
|
||||
**/
|
||||
// Notice to the reader
|
||||
// I need to surround this object with quotes, this will however break intellisense in VS 2013.
|
||||
"expired-callback"?: () => void;
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,12 @@ plugin.register.attributes = {
|
||||
version: "1.0.0"
|
||||
};
|
||||
|
||||
// optional options parameter
|
||||
server.register({}, function (err) {});
|
||||
|
||||
// optional options.routes.vhost parameter
|
||||
server.register({}, { select: 'api', routes: { prefix: '/prefix' } }, function (err) {});
|
||||
|
||||
//server.pack.register(plugin, (err: Object) => {
|
||||
// if (err) { throw err; }
|
||||
//});
|
||||
@@ -76,5 +82,18 @@ server.route([{
|
||||
}
|
||||
}]);
|
||||
|
||||
// config.validate parameters should be optional
|
||||
server.route([{
|
||||
method: 'GET',
|
||||
path: '/hello2',
|
||||
handler: function(request: Hapi.Request, reply: Function) {
|
||||
reply('hello world2');
|
||||
},
|
||||
config: {
|
||||
validate: {
|
||||
}
|
||||
}
|
||||
}]);
|
||||
|
||||
// Start the server
|
||||
server.start();
|
||||
|
||||
32
hapi/hapi.d.ts
vendored
32
hapi/hapi.d.ts
vendored
@@ -147,11 +147,11 @@ declare module "hapi" {
|
||||
};
|
||||
|
||||
/** options passed to the mimos module (https://github.com/hapijs/mimos) when generating the mime database used by the server and accessed via server.mime.*/
|
||||
mime: any;
|
||||
mime?: any;
|
||||
/** if true, does not load the inert (file and directory support), h2o2 (proxy support), and vision (views support) plugins automatically. The plugins can be loaded manually after construction. Defaults to false (plugins loaded). */
|
||||
minimal: boolean;
|
||||
minimal?: boolean;
|
||||
/** plugin-specific configuration which can later be accessed via server.settings.plugins. plugins is an object where each key is a plugin name and the value is the configuration. Note the difference between server.settings.plugins which is used to store static configuration values and server.plugins which is meant for storing run-time state. Defaults to {}.*/
|
||||
plugins: IDictionary<any>;
|
||||
plugins?: IDictionary<any>;
|
||||
|
||||
}
|
||||
|
||||
@@ -568,7 +568,7 @@ declare module "hapi" {
|
||||
optionsthe server validation options.
|
||||
next(err, value)the callback function called when validation is completed.
|
||||
*/
|
||||
headers: boolean | IJoi | IValidationFunction;
|
||||
headers?: boolean | IJoi | IValidationFunction;
|
||||
|
||||
|
||||
/** validation rules for incoming request path parameters, after matching the path against the route and extracting any parameters then stored in request.params.Values allowed:
|
||||
@@ -579,7 +579,7 @@ declare module "hapi" {
|
||||
valuethe object containing the path parameters.
|
||||
optionsthe server validation options.
|
||||
next(err, value)the callback function called when validation is completed. */
|
||||
params: boolean | IJoi | IValidationFunction;
|
||||
params?: boolean | IJoi | IValidationFunction;
|
||||
/** validation rules for an incoming request URI query component (the key- value part of the URI between '?' and '#').The query is parsed into its individual key- value pairs (using the qs module) and stored in request.query prior to validation.Values allowed:
|
||||
trueany query parameters allowed (no validation performed).This is the default.
|
||||
falseno query parameters allowed.
|
||||
@@ -588,7 +588,7 @@ declare module "hapi" {
|
||||
valuethe object containing the query parameters.
|
||||
optionsthe server validation options.
|
||||
next(err, value)the callback function called when validation is completed. */
|
||||
query: boolean | IJoi | IValidationFunction;
|
||||
query?: boolean | IJoi | IValidationFunction;
|
||||
/** validation rules for an incoming request payload (request body).Values allowed:
|
||||
trueany payload allowed (no validation performed).This is the default.
|
||||
falseno payload allowed.
|
||||
@@ -597,9 +597,9 @@ declare module "hapi" {
|
||||
valuethe object containing the payload object.
|
||||
optionsthe server validation options.
|
||||
next(err, value)the callback function called when validation is completed. */
|
||||
payload: boolean | IJoi | IValidationFunction;
|
||||
payload?: boolean | IJoi | IValidationFunction;
|
||||
/** an optional object with error fields copied into every validation error response. */
|
||||
errorFields: any;
|
||||
errorFields?: any;
|
||||
/** determines how to handle invalid requests.Allowed values are:
|
||||
'error'return a Bad Request (400) error response.This is the default value.
|
||||
'log'log the error but continue processing the request.
|
||||
@@ -609,9 +609,9 @@ declare module "hapi" {
|
||||
replythe continuation reply interface.
|
||||
sourcethe source of the invalid field (e.g. 'path', 'query', 'payload').
|
||||
errorthe error object prepared for the client response (including the validation function error under error.data). */
|
||||
failAction: string | IRouteFailFunction;
|
||||
failAction?: string | IRouteFailFunction;
|
||||
/** options to pass to Joi.Useful to set global options such as stripUnknown or abortEarly (the complete list is available here: https://github.com/hapijs/joi#validatevalue-schema-options-callback ).Defaults to no options. */
|
||||
options: any;
|
||||
options?: any;
|
||||
};
|
||||
/** define timeouts for processing durations: */
|
||||
timeout?: {
|
||||
@@ -726,7 +726,7 @@ declare module "hapi" {
|
||||
a relative or absolute file path string (relative paths are resolved based on the route files configuration).
|
||||
a function with the signature function(request) which returns the relative or absolute file path.
|
||||
an object with the following options */
|
||||
file: string | IRequestHandler<void> |IFileHandlerConfig;
|
||||
file?: string | IRequestHandler<void> |IFileHandlerConfig;
|
||||
/** directory - generates a directory endpoint for serving static content from a directory. Routes using the directory handler must include a path parameter at the end of the path string (e.g. /path/to/somewhere/{param} where the parameter name does not matter). The path parameter can use any of the parameter options (e.g. {param} for one level files only, {param?} for one level files or the directory root, {param*} for any level, or {param*3} for a specific level). If additional path parameters are present, they are ignored for the purpose of selecting the file system resource. The directory handler is an object with the following options:
|
||||
path - (required) the directory root path (relative paths are resolved based on the route files configuration). Value can be:
|
||||
a single path string used as the prefix for any resources requested by appending the request path parameter to the provided string.
|
||||
@@ -738,7 +738,7 @@ declare module "hapi" {
|
||||
redirectToSlash - optional boolean, determines if requests for a directory without a trailing slash are redirected to the same path with the missing slash. Useful for ensuring relative links inside the response are resolved correctly. Disabled when the server config router.stripTrailingSlash is true.Defaults to false.
|
||||
lookupCompressed - optional boolean, instructs the file processor to look for the same filename with the '.gz' suffix for a pre-compressed version of the file to serve if the request supports content encoding. Defaults to false.
|
||||
defaultExtension - optional string, appended to file requests if the requested file is not found. Defaults to no extension.*/
|
||||
directory: {
|
||||
directory?: {
|
||||
path: string |Array<string> | IRequestHandler<string> | IRequestHandler<Array<string>>;
|
||||
index?: boolean;
|
||||
listing?: boolean;
|
||||
@@ -748,7 +748,7 @@ declare module "hapi" {
|
||||
defaultExtension?: string;
|
||||
};
|
||||
proxy?: IProxyHandlerConfig;
|
||||
view: string | {
|
||||
view?: string | {
|
||||
template: string;
|
||||
context: {
|
||||
payload: any;
|
||||
@@ -757,7 +757,7 @@ declare module "hapi" {
|
||||
pre: any;
|
||||
}
|
||||
};
|
||||
config: {
|
||||
config?: {
|
||||
handler: any;
|
||||
bind: any;
|
||||
app: any;
|
||||
@@ -2051,11 +2051,13 @@ declare module "hapi" {
|
||||
register(plugins: any|any[], options: {
|
||||
select: string|string[];
|
||||
routes: {
|
||||
prefix: string; vhost: string|string[]
|
||||
prefix: string; vhost?: string|string[]
|
||||
};
|
||||
}
|
||||
, callback: (err: any) => void):void;
|
||||
|
||||
register(plugins: any|any[], callback: (err: any) => void):void;
|
||||
|
||||
/**server.render(template, context, [options], callback)
|
||||
Utilizes the server views manager to render a template where:
|
||||
template - the template filename and path, relative to the views manager templates path (path or relativeTo).
|
||||
|
||||
52
he/he-tests.ts
Normal file
52
he/he-tests.ts
Normal file
@@ -0,0 +1,52 @@
|
||||
/// <reference path="he.d.ts" />
|
||||
|
||||
import he = require('he');
|
||||
|
||||
function main() {
|
||||
var result: string;
|
||||
|
||||
result = he.encode('foo \xa9 bar \u2260 baz qux');
|
||||
// 'foo © bar ≠ baz qux'
|
||||
|
||||
he.encode('foo \0 bar');
|
||||
// 'foo \0 bar'
|
||||
|
||||
// Passing an `options` object to `encode`, to explicitly disallow named references:
|
||||
he.encode('foo \xa9 bar \u2260 baz qux', {
|
||||
'useNamedReferences': false
|
||||
});
|
||||
|
||||
he.encode('foo \xa9 bar \u2260 baz qux', {
|
||||
'encodeEverything': true
|
||||
});
|
||||
|
||||
he.encode('foo \xa9 bar \u2260 baz qux', {
|
||||
'encodeEverything': true,
|
||||
'useNamedReferences': true
|
||||
});
|
||||
|
||||
he.encode('\x01', {
|
||||
'strict': false
|
||||
});
|
||||
// ''
|
||||
|
||||
he.encode('foo © and & ampersand', {
|
||||
'allowUnsafeSymbols': true
|
||||
});
|
||||
|
||||
// Override the global default setting:
|
||||
he.encode.options.useNamedReferences = true;
|
||||
|
||||
he.decode('foo © bar ≠ baz 𝌆 qux');
|
||||
|
||||
he.decode('foo&bar', {
|
||||
'isAttributeValue': false
|
||||
});
|
||||
|
||||
he.decode('foo&bar', {
|
||||
'strict': false
|
||||
});
|
||||
|
||||
he.decode.options.isAttributeValue = true;
|
||||
he.escape('<img src=\'x\' onerror="prompt(1)">');
|
||||
}
|
||||
114
he/he.d.ts
vendored
Normal file
114
he/he.d.ts
vendored
Normal file
@@ -0,0 +1,114 @@
|
||||
// Type definitions for he v0.5.0
|
||||
// Project: https://github.com/mathiasbynens/he
|
||||
// Definitions by: Simon Edwards <https://github.com/sedwards2009>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
// he - "HTML Entities" - A high quality pair of HTML encode and decode functions.
|
||||
|
||||
declare module "he" {
|
||||
|
||||
var version: string;
|
||||
|
||||
interface EncodeOptions {
|
||||
/**
|
||||
* The default value for the useNamedReferences option is false. This
|
||||
* means that encode() will not use any named character references
|
||||
* (e.g. ©) in the output — hexadecimal escapes (e.g. ©) will
|
||||
* be used instead. Set it to true to enable the use of named references.
|
||||
*/
|
||||
useNamedReferences?: boolean;
|
||||
|
||||
/**
|
||||
* The default value for the encodeEverything option is false. This means
|
||||
* that encode() will not use any character references for printable ASCII
|
||||
* symbols that don’t need escaping. Set it to true to encode every symbol
|
||||
* in the input string. When set to true, this option takes precedence over
|
||||
* allowUnsafeSymbols (i.e. setting the latter to true in such a case has
|
||||
* no effect).
|
||||
*/
|
||||
encodeEverything?: boolean;
|
||||
|
||||
/**
|
||||
* The default value for the strict option is false. This means that
|
||||
* encode() will encode any HTML text content you feed it, even if it
|
||||
* contains any symbols that cause parse errors. To throw an error when such
|
||||
* invalid HTML is encountered, set the strict option to true. This option
|
||||
* makes it possible to use he as part of HTML parsers and HTML validators.
|
||||
*/
|
||||
strict?: boolean;
|
||||
|
||||
/**
|
||||
* The default value for the allowUnsafeSymbols option is false. This means
|
||||
* that characters that are unsafe for use in HTML content (&, <, >, ", ',
|
||||
* and `) will be encoded. When set to true, only non-ASCII characters will
|
||||
* be encoded. If the encodeEverything option is set to true, this option
|
||||
* will be ignored.
|
||||
*/
|
||||
allowUnsafeSymbols?: boolean;
|
||||
}
|
||||
|
||||
interface Encode {
|
||||
/**
|
||||
* Encode a string of text
|
||||
*
|
||||
* This function takes a string of text and encodes (by default) any symbols
|
||||
* that aren’t printable ASCII symbols and &, <, >, ", ', and `, replacing
|
||||
* them with character references.
|
||||
*
|
||||
* As long as the input string contains allowed code points only, the return
|
||||
* value of this function is always valid HTML. Any (invalid) code points
|
||||
* that cannot be represented using a character reference in the input are
|
||||
* not encoded.
|
||||
*/
|
||||
(text: string, options?: EncodeOptions): string;
|
||||
|
||||
options: EncodeOptions;
|
||||
}
|
||||
var encode: Encode;
|
||||
|
||||
interface DecodeOptions {
|
||||
/**
|
||||
* The default value for the isAttributeValue option is false. This means
|
||||
* that decode() will decode the string as if it were used in a text
|
||||
* context in an HTML document. HTML has different rules for parsing
|
||||
* character references in attribute values — set this option to true to
|
||||
* treat the input string as if it were used as an attribute value.
|
||||
*/
|
||||
isAttributeValue?: boolean;
|
||||
|
||||
/**
|
||||
* The default value for the strict option is false. This means that
|
||||
* decode() will decode any HTML text content you feed it, even if it
|
||||
* contains any entities that cause parse errors. To throw an error when
|
||||
* such invalid HTML is encountered, set the strict option to true. This
|
||||
* option makes it possible to use he as part of HTML parsers and HTML
|
||||
* validators.
|
||||
*/
|
||||
strict?: boolean;
|
||||
}
|
||||
|
||||
interface Decode {
|
||||
/**
|
||||
* Decode a string of HTML text
|
||||
*
|
||||
* This function takes a string of HTML and decodes any named and numerical
|
||||
* character references in it using the algorithm described in section
|
||||
* 12.2.4.69 of the HTML spec.
|
||||
*/
|
||||
(html: string, options?: DecodeOptions): string;
|
||||
|
||||
options: DecodeOptions;
|
||||
}
|
||||
var decode: Decode;
|
||||
|
||||
/**
|
||||
* Escape XML entities
|
||||
*
|
||||
* This function takes a string of text and escapes it for use in text
|
||||
* contexts in XML or HTML documents. Only the following characters are
|
||||
* escaped: &, <, >, ", ', and `.
|
||||
*/
|
||||
function escape(text: string): string;
|
||||
|
||||
var unescape: Decode;
|
||||
}
|
||||
103
imgur-rest-api/imgur-rest-api-tests.ts
Normal file
103
imgur-rest-api/imgur-rest-api-tests.ts
Normal file
@@ -0,0 +1,103 @@
|
||||
/// <reference path="imgur-rest-api.d.ts" />
|
||||
|
||||
function testAccount(account: ImgurRestApi.Account) : ImgurRestApi.Account {
|
||||
return account;
|
||||
}
|
||||
|
||||
function testAccountSettings(accountSettings: ImgurRestApi.AccountSettings) : ImgurRestApi.AccountSettings {
|
||||
return accountSettings;
|
||||
}
|
||||
|
||||
function testAlbum(album: ImgurRestApi.Album) : ImgurRestApi.Album {
|
||||
return album;
|
||||
}
|
||||
|
||||
function testAlbumImages(album: ImgurRestApi.Album) : ImgurRestApi.Image {
|
||||
return album.images[0];
|
||||
}
|
||||
|
||||
function testComment(comment: ImgurRestApi.Comment) : ImgurRestApi.Comment {
|
||||
return comment;
|
||||
}
|
||||
|
||||
function testConversation(conversation: ImgurRestApi.Conversation) : ImgurRestApi.Conversation {
|
||||
return conversation;
|
||||
}
|
||||
|
||||
function testCustomGallery(customGallery: ImgurRestApi.CustomGallery) : ImgurRestApi.CustomGallery {
|
||||
return customGallery;
|
||||
}
|
||||
|
||||
function testGalleryItem(galleryItem: ImgurRestApi.GalleryItem) : ImgurRestApi.GalleryItem {
|
||||
return galleryItem;
|
||||
}
|
||||
|
||||
function testGalleryAlbum(galleryItem: ImgurRestApi.GalleryItem) : ImgurRestApi.GalleryAlbum {
|
||||
if(galleryItem.is_album) {
|
||||
var galleryAlbum = <ImgurRestApi.GalleryAlbum> galleryItem;
|
||||
return galleryAlbum;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function testGalleryImage(galleryItem: ImgurRestApi.GalleryItem) : ImgurRestApi.GalleryImage {
|
||||
if(!galleryItem.is_album) {
|
||||
var galleryImage = <ImgurRestApi.GalleryImage> galleryItem;
|
||||
return galleryImage;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function testGalleryProfile(galleryProfile: ImgurRestApi.GalleryProfile) : ImgurRestApi.GalleryProfile {
|
||||
return galleryProfile;
|
||||
}
|
||||
|
||||
function testImage(image: ImgurRestApi.Image) : ImgurRestApi.Image {
|
||||
return image;
|
||||
}
|
||||
|
||||
function testMemeMeta(meta: ImgurRestApi.MemeMetadata) : ImgurRestApi.MemeMetadata {
|
||||
return meta;
|
||||
}
|
||||
|
||||
function testMessage(message: ImgurRestApi.Message) : ImgurRestApi.Message {
|
||||
return message;
|
||||
}
|
||||
|
||||
function testAccountNotificationsReply(accountNotif: ImgurRestApi.AccountNotifications) : ImgurRestApi.Notification<ImgurRestApi.Comment> {
|
||||
return accountNotif.replies[0];
|
||||
}
|
||||
|
||||
function testAccountNotificationsMessage(accountNotif: ImgurRestApi.AccountNotifications) : ImgurRestApi.Notification<ImgurRestApi.Conversation> {
|
||||
return accountNotif.messages[0];
|
||||
}
|
||||
|
||||
function testTag(tag: ImgurRestApi.Tag) : ImgurRestApi.Tag {
|
||||
return tag;
|
||||
}
|
||||
|
||||
function testTagVote(tagVote: ImgurRestApi.TagVote) : ImgurRestApi.TagVote {
|
||||
return tagVote;
|
||||
}
|
||||
|
||||
function testTopic(topic: ImgurRestApi.Topic) : ImgurRestApi.Topic {
|
||||
return topic;
|
||||
}
|
||||
|
||||
function testVote(vote: ImgurRestApi.Vote) : ImgurRestApi.Vote {
|
||||
return vote;
|
||||
}
|
||||
|
||||
function testResponseWithError(response: ImgurRestApi.Response<ImgurRestApi.GalleryProfile>) : ImgurRestApi.Error {
|
||||
if(response.success === false) {
|
||||
return <ImgurRestApi.Error> response.data;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function testResponseWithValue(response: ImgurRestApi.Response<ImgurRestApi.GalleryProfile>) : ImgurRestApi.GalleryProfile {
|
||||
if(response.success === true) {
|
||||
return <ImgurRestApi.GalleryProfile> response.data;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
252
imgur-rest-api/imgur-rest-api.d.ts
vendored
Normal file
252
imgur-rest-api/imgur-rest-api.d.ts
vendored
Normal file
@@ -0,0 +1,252 @@
|
||||
// Type definitions for Imgur REST API v3
|
||||
// Project: https://api.imgur.com/
|
||||
// Definitions by: Luke William Westby <http://github.com/lukewestby>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module ImgurRestApi {
|
||||
|
||||
interface Response<T> {
|
||||
data: any; //T|Error;
|
||||
status: number;
|
||||
success: boolean;
|
||||
}
|
||||
|
||||
interface Account {
|
||||
id: number;
|
||||
url: string;
|
||||
bio: string;
|
||||
reputation: number;
|
||||
created: number;
|
||||
pro_expiration: any; //number|boolean;
|
||||
}
|
||||
|
||||
interface AccountSettings {
|
||||
email: string;
|
||||
high_quality: boolean;
|
||||
public_images: boolean;
|
||||
album_privacy: string;
|
||||
pro_expiration: any; //number|boolean;
|
||||
accepted_gallery_terms: boolean;
|
||||
active_emails: Array<string>;
|
||||
messaging_enabled: boolean;
|
||||
blocked_users: Array<BlockedUser>;
|
||||
}
|
||||
|
||||
interface Album {
|
||||
id: string;
|
||||
title: string;
|
||||
description: string;
|
||||
datetime: number;
|
||||
cover: string;
|
||||
cover_width: number;
|
||||
cover_height: number;
|
||||
account_url?: string;
|
||||
account_id?: number;
|
||||
privacy: string;
|
||||
layout: string;
|
||||
views: number;
|
||||
link: string;
|
||||
favorite: boolean;
|
||||
nsfw?: boolean;
|
||||
section: string;
|
||||
order: number;
|
||||
deletehash?: string;
|
||||
images_count: number;
|
||||
images: Array<Image>;
|
||||
}
|
||||
|
||||
interface BlockedUser {
|
||||
blocked_id: number;
|
||||
blocked_url: string;
|
||||
}
|
||||
|
||||
interface Comment {
|
||||
id: number;
|
||||
image_id: string;
|
||||
comment: string;
|
||||
author: string;
|
||||
author_id: number;
|
||||
on_album: boolean;
|
||||
album_cover: string;
|
||||
ups: number;
|
||||
downs: number;
|
||||
points: number;
|
||||
datetime: number;
|
||||
parent_id: number;
|
||||
deleted: boolean;
|
||||
vote?: string;
|
||||
children: Array<Comment>
|
||||
}
|
||||
|
||||
interface Conversation {
|
||||
id: number;
|
||||
last_message_preview: string;
|
||||
datetime: number;
|
||||
with_account_id: number;
|
||||
with_account: string;
|
||||
message_count: number;
|
||||
messages?: Array<Message>;
|
||||
done?: boolean;
|
||||
page?: number;
|
||||
}
|
||||
|
||||
interface CustomGallery {
|
||||
account_url: string;
|
||||
link: string;
|
||||
tags: Array<string>
|
||||
item_count: number;
|
||||
items: Array<GalleryItem>;
|
||||
}
|
||||
|
||||
interface GalleryItem {
|
||||
id: string;
|
||||
title: string;
|
||||
description: string;
|
||||
datetime: number;
|
||||
account_url?: string;
|
||||
account_id?: number;
|
||||
ups: number;
|
||||
downs: number;
|
||||
score: number;
|
||||
is_album: boolean;
|
||||
views: number;
|
||||
link: string;
|
||||
vote?: string;
|
||||
favorite: boolean;
|
||||
nsfw?: boolean;
|
||||
comment_count: number;
|
||||
topic: string;
|
||||
topic_id: number;
|
||||
}
|
||||
|
||||
interface GalleryAlbum extends GalleryItem {
|
||||
cover: string;
|
||||
cover_width: number;
|
||||
cover_height: number;
|
||||
privacy: string;
|
||||
layout: string;
|
||||
images_count: number;
|
||||
images: Array<Image>;
|
||||
}
|
||||
|
||||
interface GalleryImage extends GalleryItem {
|
||||
type: string;
|
||||
animated: boolean;
|
||||
width: number;
|
||||
height: number;
|
||||
size: number;
|
||||
bandwidth: number;
|
||||
deletehash?: string;
|
||||
gifv?: string;
|
||||
mp4?: string;
|
||||
webm?: string;
|
||||
looping?: boolean;
|
||||
section: string;
|
||||
}
|
||||
|
||||
interface GalleryProfile {
|
||||
total_gallery_comments: number;
|
||||
total_gallery_favorites: number;
|
||||
total_gallery_submissions: number;
|
||||
trophies: Array<Trophy>;
|
||||
}
|
||||
|
||||
interface Trophy {
|
||||
id: number;
|
||||
name: string;
|
||||
name_clean: string;
|
||||
description: string;
|
||||
data: string;
|
||||
data_link: string;
|
||||
datetime: number;
|
||||
image: string;
|
||||
}
|
||||
|
||||
interface Image {
|
||||
id: string;
|
||||
title: string;
|
||||
description: string;
|
||||
datetime: number;
|
||||
type: string;
|
||||
animated: boolean;
|
||||
width: number;
|
||||
height: number;
|
||||
size: number;
|
||||
views: number;
|
||||
bandwidth: number;
|
||||
deletehash?: string;
|
||||
name?: string;
|
||||
section: string;
|
||||
link: string;
|
||||
gifv?: string;
|
||||
mp4?: string;
|
||||
webm?: string;
|
||||
looping?: boolean;
|
||||
vote?: string;
|
||||
favorite: boolean;
|
||||
nsfw?: boolean;
|
||||
account_url?: string;
|
||||
account_id?: number;
|
||||
}
|
||||
|
||||
interface MemeMetadata {
|
||||
meme_name: string;
|
||||
top_text: string;
|
||||
bottom_text: string;
|
||||
bg_image: string;
|
||||
}
|
||||
|
||||
interface Message {
|
||||
id: number;
|
||||
from: string;
|
||||
account_id: number;
|
||||
sender_id: number;
|
||||
body: string;
|
||||
conversation_id: number;
|
||||
datetime: number;
|
||||
}
|
||||
|
||||
interface Notification<T> {
|
||||
id: number;
|
||||
account_id: number;
|
||||
viewed: boolean;
|
||||
content: T;
|
||||
}
|
||||
|
||||
interface AccountNotifications {
|
||||
replies: Array<Notification<Comment>>;
|
||||
messages: Array<Notification<Conversation>>;
|
||||
}
|
||||
|
||||
interface Tag {
|
||||
name: string;
|
||||
followers: number;
|
||||
total_items: number;
|
||||
following?: boolean;
|
||||
items: Array<GalleryItem>
|
||||
}
|
||||
|
||||
interface TagVote {
|
||||
ups: number;
|
||||
downs: number;
|
||||
name: string;
|
||||
author: string;
|
||||
}
|
||||
|
||||
interface Topic {
|
||||
id: number;
|
||||
name: string;
|
||||
description: string;
|
||||
}
|
||||
|
||||
interface Vote {
|
||||
ups: number;
|
||||
downs: number;
|
||||
}
|
||||
|
||||
interface Error {
|
||||
error: string;
|
||||
request: string;
|
||||
method: string;
|
||||
}
|
||||
}
|
||||
36
jquery-fullscreen/jquery-fullscreen-tests.ts
Normal file
36
jquery-fullscreen/jquery-fullscreen-tests.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
/// <reference path="jquery-fullscreen.d.ts"/>
|
||||
|
||||
//
|
||||
// Examples from https://github.com/kayahr/jquery-fullscreen-plugin
|
||||
//
|
||||
|
||||
function enteringFullScreen() {
|
||||
|
||||
$(document).fullScreen(true);
|
||||
$('#myVideo').fullScreen(true);
|
||||
}
|
||||
|
||||
function exitingFullScreen() {
|
||||
|
||||
$(document).fullScreen(false);
|
||||
$('#myVideo').fullScreen(false);
|
||||
}
|
||||
|
||||
|
||||
function queryingFullScreenMode() {
|
||||
|
||||
//The method returns the current fullscreen element (or true if browser doesn't support this) when fullscreen mode is active,
|
||||
// false if not active or null when the browser does not support fullscreen mode at all
|
||||
var isFullScreen = $(document).fullScreen() != null;
|
||||
}
|
||||
|
||||
function fullScreenNotifications() {
|
||||
|
||||
$(document).bind("fullscreenchange", () => {
|
||||
console.log("Fullscreen " + ($(document).fullScreen() ? "on" : "off"));
|
||||
});
|
||||
|
||||
$(document).bind("fullscreenerror", () => {
|
||||
alert("Browser rejected fullscreen change");
|
||||
});
|
||||
}
|
||||
28
jquery-fullscreen/jquery-fullscreen.d.ts
vendored
Normal file
28
jquery-fullscreen/jquery-fullscreen.d.ts
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
// Type definitions for jquery-fullscreen 1.1.5
|
||||
// Project: https://github.com/kayahr/jquery-fullscreen-plugin
|
||||
// Definitions by: Bruno Grieder <https://github.com/bgrieder>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../jquery/jquery.d.ts"/>
|
||||
|
||||
interface JQuery {
|
||||
|
||||
/**
|
||||
* You can either switch the whole page or a single HTML element to fullscreen mode
|
||||
* This only works when the code was triggered by a user interaction (For example a onclick event on a button). Browsers don't allow entering fullscreen mode without user interaction.
|
||||
* Fullscreen mode is always exited via the document but this plugin allows it also via any HTML element. The owner document of the selected HTML element is used
|
||||
*/
|
||||
fullScreen(fullScreen: boolean): JQuery | boolean;
|
||||
|
||||
/**
|
||||
* The method returns the current fullscreen element (or true if browser doesn't support this) when fullscreen mode is active,
|
||||
* false if not active or null when the browser does not support fullscreen mode at all
|
||||
*/
|
||||
fullScreen(): boolean;
|
||||
|
||||
/**
|
||||
* The plugin provides another method for simple fullscreen mode toggling
|
||||
*/
|
||||
toggleFullScreen(): JQuery | boolean;
|
||||
}
|
||||
|
||||
23
jquery-jsonrpcclient/jquery-jsonrpcclient-tests.ts
Normal file
23
jquery-jsonrpcclient/jquery-jsonrpcclient-tests.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
/// <reference path="../jquery/jquery.d.ts"/>
|
||||
/// <reference path="jquery-jsonrpcclient.d.ts"/>
|
||||
|
||||
var foo = new $.JsonRpcClient({ ajaxUrl: '/backend/jsonrpc' });
|
||||
foo.call(
|
||||
'bar', ['A parameter', 'B parameter'],
|
||||
function (result) { alert('Foo bar answered: ' + result.my_answer); },
|
||||
function (error) { console.log('There was an error', error); }
|
||||
);
|
||||
|
||||
|
||||
var foo = new $.JsonRpcClient({ ajaxUrl: '/backend/jsonrpc' });
|
||||
foo.batch(
|
||||
function (batch) {
|
||||
batch.call('bar', ['A parameter', 'B parameter'], function () { }, function () { });
|
||||
batch.call('baz', { parameters: 'could be object' }, function () { }, function () { });
|
||||
},
|
||||
function (all_result_array) { alert('All done.'); },
|
||||
function (error_data) { alert('Error in batch response.'); }
|
||||
);
|
||||
|
||||
var foo = new $.JsonRpcClient({ ajaxUrl: '/backend/jsonrpc', socketUrl: 'ws://example.com/' });
|
||||
foo.call('bar', ['param'], function () { }, function () { });
|
||||
97
jquery-jsonrpcclient/jquery-jsonrpcclient.d.ts
vendored
Normal file
97
jquery-jsonrpcclient/jquery-jsonrpcclient.d.ts
vendored
Normal file
@@ -0,0 +1,97 @@
|
||||
// Type definitions for jquery.jsonrpc 0.7.0
|
||||
// Project: https://github.com/Textalk/jquery.jsonrpcclient.js
|
||||
// Definitions by: Maksim Karelov <https://github.com/Ty3uK>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../jquery/jquery.d.ts" />
|
||||
|
||||
interface JsonRpcClientOptions extends JQueryAjaxSettings {
|
||||
ajaxUrl?: string;
|
||||
headers?: {[key:string]: any};
|
||||
sockerUrl?: string;
|
||||
onmessage?: () => void;
|
||||
onopen?: () => void;
|
||||
onclose?: () => void;
|
||||
onerror?: () => void;
|
||||
getSockect?: (onmessageCb: () => void) => WebSocket;
|
||||
}
|
||||
|
||||
interface JsonRpcClient {
|
||||
/**
|
||||
* @fn call
|
||||
* @memberof JsonRpcClient
|
||||
*
|
||||
* @param {string} method The method to run on JSON-RPC server.
|
||||
* @param {object|array} params The params; an array or object.
|
||||
* @param {function} successCb A callback for successful request.
|
||||
* @param {function} errorCb A callback for error.
|
||||
*
|
||||
* @return {object} Returns the deferred object that $.ajax returns or {null} for websockets
|
||||
*/
|
||||
call(method: string, params: Object | Array<any>, successCb: (result: any) => void, errorCb: (result: any) => void): JQueryDeferred<JQueryXHR>;
|
||||
|
||||
/**
|
||||
* Notify sends a command to the server that won't need a response. In http, there is probably
|
||||
* an empty response - that will be dropped, but in ws there should be no response at all.
|
||||
*
|
||||
* This is very similar to call, but has no id and no handling of callbacks.
|
||||
*
|
||||
* @fn notify
|
||||
* @memberof JsonRpcClient
|
||||
*
|
||||
* @param {string} method The method to run on JSON-RPC server.
|
||||
* @param {object|array} params The params; an array or object.
|
||||
*
|
||||
* @return {object} Returns the deferred object that $.ajax returns or {null} for websockets
|
||||
*/
|
||||
notify(method: string, params: Object | Array<any>): JQueryDeferred<JQueryXHR>;
|
||||
|
||||
/**
|
||||
* Make a batch-call by using a callback.
|
||||
*
|
||||
* The callback will get an object "batch" as only argument. On batch, you can call the methods
|
||||
* "call" and "notify" just as if it was a normal JsonRpcClient object, and all calls will be
|
||||
* sent as a batch call then the callback is done.
|
||||
*
|
||||
* @fn batch
|
||||
* @memberof JsonRpcClient
|
||||
*
|
||||
* @param {function} callback This function will get a batch handler to run call and notify on.
|
||||
* @param {function} allDoneCb A callback function to call after all results have been handled.
|
||||
* @param {function} errorCb A callback function to call if there is an error from the server.
|
||||
* Note, that batch calls should always get an overall success, and the
|
||||
* only error
|
||||
*/
|
||||
batch(callback: (batch: JsonRpcClient) => void, allDoneCb: (result: any) => void, errorCb: (error: any) => void): void;
|
||||
}
|
||||
|
||||
interface JsonRpcClientFactory {
|
||||
/**
|
||||
* @fn new
|
||||
* @memberof JsonRpcClient
|
||||
*
|
||||
* @param {object} options An object stating the backends:
|
||||
* ajaxUrl A url (relative or absolute) to a http(s) backend.
|
||||
* headers An object that will be passed along to $.ajax in options.headers
|
||||
* xhrFields An object that will be passed along to $.ajax in options.xhrFields
|
||||
* socketUrl A url (relative of absolute) to a ws(s) backend.
|
||||
* onmessage A socket message handler for other messages (non-responses).
|
||||
* onopen A socket onopen handler. (Not used for custom getSocket.)
|
||||
* onclose A socket onclose handler. (Not used for custom getSocket.)
|
||||
* onerror A socket onerror handler. (Not used for custom getSocket.)
|
||||
* getSocket A function returning a WebSocket or null.
|
||||
* It must take an onmessage_cb and bind it to the onmessage event
|
||||
* (or chain it before/after some other onmessage handler).
|
||||
* Or, it could return null if no socket is available.
|
||||
* The returned instance must have readyState <= 1, and if less than 1,
|
||||
* react to onopen binding.
|
||||
* timeout (optional) A number of ms to wait before timing out and failing a
|
||||
* call. If specified a setTimeout will be used to keep track of calls
|
||||
* made through a websocket.
|
||||
*/
|
||||
new (options?: JsonRpcClientOptions): JsonRpcClient;
|
||||
}
|
||||
|
||||
interface JQueryStatic {
|
||||
JsonRpcClient: JsonRpcClientFactory;
|
||||
}
|
||||
479
jquery.dataTables/jquery.dataTables-1.9.4.d.ts
vendored
Executable file
479
jquery.dataTables/jquery.dataTables-1.9.4.d.ts
vendored
Executable file
@@ -0,0 +1,479 @@
|
||||
// Type definitions for JQuery DataTables 1.9.4
|
||||
// Project: http://www.datatables.net
|
||||
// Definitions by: Armin Sander <https://github.com/pragmatrix/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
// missing:
|
||||
// - Static methods that are defined in JQueryStatic.fn are not typed.
|
||||
// - Plugin and extension definitions are not typed.
|
||||
|
||||
interface JQuery
|
||||
{
|
||||
dataTable(param? :DataTables.Options) : DataTables.DataTable;
|
||||
}
|
||||
|
||||
declare module DataTables
|
||||
{
|
||||
export interface DataTable
|
||||
{
|
||||
/// Perform a jQuery selector action on the table's TR elements (from the tbody) and return the resulting jQuery object.
|
||||
$(selector:string, opts?:RowParams): JQuery;
|
||||
$(selector:Node[], opts?:RowParams): JQuery;
|
||||
$(selector:JQuery, opts?:RowParams): JQuery;
|
||||
|
||||
/// Almost identical to $ in operation, but in this case returns the data for the matched rows.
|
||||
_(selector:string, opts?:RowParams): any[];
|
||||
_(selector:Node[], opts?:RowParams): any[];
|
||||
_(selector:JQuery, opts?:RowParams): any[];
|
||||
|
||||
/// Add a single new row or multiple rows of data to the table.
|
||||
fnAddData(data:any, redraw?:boolean) : number[];
|
||||
|
||||
/// This function will make DataTables recalculate the column sizes.
|
||||
fnAdjustColumnSizing(redraw? : boolean) : void;
|
||||
|
||||
/// Quickly and simply clear a table
|
||||
fnClearTable(redraw? : boolean) : void;
|
||||
|
||||
/// The exact opposite of 'opening' a row, this function will close any rows which are currently 'open'.
|
||||
fnClose(node: Node) : number;
|
||||
|
||||
/// Remove a row for the table
|
||||
fnDeleteRow(index: number, callback?: () => void, redraw?: boolean) : any[];
|
||||
fnDeleteRow(tr: Node, callback?: () => void, redraw?: boolean) : any[];
|
||||
|
||||
/// Restore the table to it's original state in the DOM by removing all of DataTables enhancements,
|
||||
/// alterations to the DOM structure of the table and event listeners.
|
||||
fnDestroy(remove?: boolean) : void;
|
||||
|
||||
/// Redraw the table
|
||||
fnDraw(complete? : boolean) : void;
|
||||
|
||||
/// Filter the input based on data
|
||||
fnFilter(input: string, column? : number, regex?: boolean, smart? : boolean, showGlobal?: boolean, caseInsensitive? : boolean) : void;
|
||||
|
||||
/// Get the data for the whole table, an individual row or an individual cell based on the provided parameters.
|
||||
fnGetData(row?: Node, col? : number) : any;
|
||||
fnGetData(row?: number, col? : number) : any;
|
||||
|
||||
/// Get an array of the TR nodes that are used in the table's body.
|
||||
fnGetNodes(row? : number) : any; // Node[] | Node
|
||||
|
||||
/// Get the array indexes of a particular cell from it's DOM element and column index including hidden columns
|
||||
fnGetPosition(node: Node) : any; // number | number[]
|
||||
|
||||
/// Check to see if a row is 'open' or not.
|
||||
fnIsOpen(tr: Node) : boolean;
|
||||
|
||||
/// This function will place a new row directly after a row which is currently on display on the page,
|
||||
/// with the HTML contents that is passed into the function.
|
||||
fnOpen(node: Node, html: string, clazz: string) : Node;
|
||||
fnOpen(node: Node, html: Node, clazz: string) : Node;
|
||||
fnOpen(node: Node, html: JQuery, clazz: string) : Node;
|
||||
|
||||
/// Change the pagination - provides the internal logic for pagination in a simple API function.
|
||||
fnPageChange(action: string, redraw?: boolean) : void;
|
||||
fnPageChange(page: number, redraw?: boolean) : void;
|
||||
|
||||
/// Show a particular column
|
||||
fnSetColumnVis(column: number, show: boolean, redraw?: boolean) : void;
|
||||
|
||||
/// Get the settings for a particular table for external manipulation
|
||||
fnSettings() : Settings;
|
||||
|
||||
/// Sort the table by a particular column
|
||||
fnSort(col: number) : void;
|
||||
fnSort(col: any[][]) : void;
|
||||
|
||||
/// Attach a sort listener to an element for a given column
|
||||
fnSortListener(node: Node, column: number, callback? : () => void): void;
|
||||
|
||||
/// Update a table cell or row - this method will accept either a single value to update the cell with,
|
||||
/// an array of values with one element for each column or an object in the same format as the original data source.
|
||||
fnUpdate(data: any, row: Node, column?:number, redraw?: boolean, action? : boolean) : number;
|
||||
fnUpdate(data: any, dataIndex: number, column?:number, redraw?: boolean, action? : boolean) : number;
|
||||
|
||||
/// Provide a common method for plug-ins to check the version of DataTables being used,
|
||||
/// in order to ensure compatibility.
|
||||
fnVersionCheck(version: string) : boolean;
|
||||
}
|
||||
|
||||
export interface Static
|
||||
{
|
||||
/// Provide a common method for plug-ins to check the version of DataTables being used,
|
||||
/// in order to ensure compatibility.
|
||||
fnVersionCheck(version: string) : boolean;
|
||||
|
||||
/// Check if a TABLE node is a DataTable table already or not.
|
||||
fnIsDataTable(table: Node) : boolean;
|
||||
|
||||
/// Get all DataTable tables that have been initialised.
|
||||
fnTables(visible? : boolean) : Node[];
|
||||
}
|
||||
|
||||
export interface RowParams
|
||||
{
|
||||
/// Select TR elements that meet the current filter criterion ("applied") or all TR elements (i.e. no filter).
|
||||
filter?: string;
|
||||
|
||||
/// Order of the TR elements in the processed array.
|
||||
/// Can be either 'current', whereby the current sorting of the table is used, or
|
||||
/// 'original' whereby the original order the data was read into the table is used.
|
||||
order?: string;
|
||||
|
||||
/// Limit the selection to the currently displayed page
|
||||
/// ("current") or not ("all"). If 'current' is given, then order is assumed to be
|
||||
/// 'current' and filter is 'applied', regardless of what they might be given as.
|
||||
page?: string;
|
||||
}
|
||||
|
||||
export interface Options
|
||||
{
|
||||
aaData?: any[];
|
||||
aaSorting?: any[];
|
||||
aaSortingFixed?: any[];
|
||||
ajax?: any;
|
||||
aLengthMenu?: any[];
|
||||
aoColumns?: ColumnOptions[];
|
||||
aoColumnDefs?: ColumnDef[];
|
||||
aoSearchCols?: any[];
|
||||
asStripClasses?: string[];
|
||||
bAutoWidth?: boolean;
|
||||
bDeferRender?: boolean;
|
||||
bDestroy?: boolean;
|
||||
bFilter?: boolean;
|
||||
bInfo?: boolean;
|
||||
bJQueryUI?: boolean;
|
||||
bLengthChange?: boolean;
|
||||
bPaginate?: boolean;
|
||||
bProcessing?: boolean;
|
||||
bRetrieve?: boolean;
|
||||
bScrollAutoCss?: boolean;
|
||||
bScrollCollapse?: boolean;
|
||||
bScrollInfinite?: boolean;
|
||||
bServerSide?: boolean;
|
||||
bSort?: boolean;
|
||||
bSortCellsTop?: boolean;
|
||||
bSortClasses?: boolean;
|
||||
bStateSave?: boolean;
|
||||
fnCookieCallback?: CookieCallback;
|
||||
fnCreatedRow?: RowCreatedCallback;
|
||||
fnDrawCallback?: DrawCallback;
|
||||
fnFooterCallback?: FooterCallback;
|
||||
fnFormatNumber?: FormatNumber;
|
||||
fnHeaderCallback?: HeaderCallback;
|
||||
fnInfoCallback?: InfoCallback;
|
||||
fnInitComplete?: InitComplete;
|
||||
fnPreDrawCallback?: PreDrawCallback;
|
||||
fnRowCallback?: RowCallback;
|
||||
|
||||
fnStateLoadCallback?: StateLoadCallback;
|
||||
fnStateLoadParams?: StateLoadParams;
|
||||
fnStateLoaded?: StateLoaded;
|
||||
fnStateSaveCallback?: StateSaveCallback;
|
||||
fnStateSaveParams?: StateSaveParams;
|
||||
iCookieDuration?: number;
|
||||
iDeferLoading?: any;
|
||||
iDisplayLength?: number;
|
||||
iDisplayStart?: number;
|
||||
iScrollLoadGap?: number;
|
||||
iTabIndex?: number;
|
||||
oLanguage?: LanguageOptions;
|
||||
oSearch?: any;
|
||||
sAjaxDataProp?: string;
|
||||
sAjaxSource?: string;
|
||||
sCookiePrefix?: string;
|
||||
sDom?: string;
|
||||
sPaginationType?: string;
|
||||
sScrollX?: string;
|
||||
sScrollXInner?: string;
|
||||
sScrollY?: string;
|
||||
sServerMethod? : string;
|
||||
}
|
||||
|
||||
export interface LanguageOptions
|
||||
{
|
||||
oAria? : AriaOptions;
|
||||
oPaginate? : PaginateOptions;
|
||||
sEmptyTable?: string;
|
||||
sInfo?: string;
|
||||
sInfoEmpty?: string;
|
||||
sInfoFiltered?: string;
|
||||
sInfoPostFix?: string;
|
||||
sInfoThousands?: string;
|
||||
sLengthMenu?: string;
|
||||
sLoadingRecords?: string;
|
||||
sProcessing?: string;
|
||||
sSearch?: string;
|
||||
sUrl?: string;
|
||||
sZeroRecords?: string;
|
||||
}
|
||||
|
||||
export interface AriaOptions
|
||||
{
|
||||
sSortAscending?: string;
|
||||
sSortDescending?: string;
|
||||
}
|
||||
|
||||
export interface PaginateOptions
|
||||
{
|
||||
sFirst?: string;
|
||||
sLast?: string;
|
||||
sNext?: string;
|
||||
sPrevious?: string;
|
||||
}
|
||||
|
||||
export interface ColumnOptions
|
||||
{
|
||||
aDataSort?: number[];
|
||||
asSorting?: string[];
|
||||
bSearchable? : boolean;
|
||||
bSortable? : boolean;
|
||||
bVisible? : boolean;
|
||||
_bAutoType? : boolean;
|
||||
fnCreatedCell?: CreatedCell;
|
||||
iDataSort?: number;
|
||||
mData?: any;
|
||||
mRender?: any;
|
||||
sCellType?: string;
|
||||
sClass?: string;
|
||||
sContentPadding?: string;
|
||||
sDefaultContent?: string;
|
||||
sName?: string;
|
||||
sSortDataType?: string;
|
||||
sSortingClass?: string;
|
||||
sTitle?: string;
|
||||
sType?: string;
|
||||
sWidth?: string;
|
||||
}
|
||||
|
||||
export interface ColumnDef extends ColumnOptions
|
||||
{
|
||||
aTargets: any[];
|
||||
}
|
||||
|
||||
export interface Settings
|
||||
{
|
||||
oFeatures : Features;
|
||||
oScroll: ScrollingSettings;
|
||||
oLanguage : { fnInfoCallback : InfoCallback; };
|
||||
oBrowser : { bScrollOversize : boolean; };
|
||||
aanFeatures: Node[][];
|
||||
aoData: Row[];
|
||||
aiDisplay: number[];
|
||||
aiDisplayMaster: number[];
|
||||
aoColumns: Column[];
|
||||
aoHeader: any[];
|
||||
aoFooter: any[];
|
||||
asDataSearch: string[];
|
||||
oPreviousSearch: any;
|
||||
aoPreSearchCols: any[];
|
||||
aaSorting: any[][];
|
||||
aaSortingFixed: any[][];
|
||||
asStripeClasses: string[];
|
||||
asDestroyStripes: string[];
|
||||
sDestroyWidth: number;
|
||||
aoRowCallback: RowCallback[];
|
||||
aoHeaderCallback: HeaderCallback[];
|
||||
aoFooterCallback: FooterCallback[];
|
||||
aoDrawCallback: DrawCallback[];
|
||||
aoRowCreatedCallback: RowCreatedCallback[];
|
||||
aoPreDrawCallback: PreDrawCallback[];
|
||||
aoInitComplete: InitComplete[];
|
||||
aoStateSaveParams: StateSaveParams[];
|
||||
aoStateLoadParams: StateLoadParams[];
|
||||
aoStateLoaded: StateLoaded[];
|
||||
sTableId: string;
|
||||
nTable: Node;
|
||||
nTHead: Node;
|
||||
nTFoot: Node;
|
||||
nTBody: Node;
|
||||
nTableWrapper: Node;
|
||||
bDeferLoading: boolean;
|
||||
bInitialized: boolean;
|
||||
aoOpenRows: any[];
|
||||
sDom: string;
|
||||
sPaginationType: string;
|
||||
iCookieDuration: number;
|
||||
sCookiePrefix: string;
|
||||
fnCookieCallback: CookieCallback;
|
||||
aoStateSave: StateSaveCallback[];
|
||||
aoStateLoad: StateLoadCallback[];
|
||||
oLoadedState: any;
|
||||
sAjaxSource: string;
|
||||
sAjaxDataProp: string;
|
||||
bAjaxDataGet: boolean;
|
||||
jqXHR: any;
|
||||
fnServerData: any;
|
||||
aoServerParams: any[];
|
||||
sServerMethod: string;
|
||||
fnFormatNumber: FormatNumber;
|
||||
aLengthMenu: any[];
|
||||
iDraw: number;
|
||||
bDrawing: boolean;
|
||||
iDrawError: number;
|
||||
_iDisplayLength: number;
|
||||
_iDisplayStart: number;
|
||||
_iDisplayEnd: number;
|
||||
_iRecordsTotal: number;
|
||||
_iRecordsDisplay: number;
|
||||
bJUI: boolean;
|
||||
oClasses: any;
|
||||
bFiltered: boolean;
|
||||
bSorted: boolean;
|
||||
bSortCellsTop: boolean;
|
||||
oInit: any;
|
||||
aoDestroyCallback: any[];
|
||||
fnRecordsTotal: () => number;
|
||||
fnRecordsDisplay: () => number;
|
||||
fnDisplayEnd: () => number;
|
||||
oInstance : any;
|
||||
sInstance: string;
|
||||
iTabIndex: number;
|
||||
nScrollHead: Node;
|
||||
nScrollFoot: Node;
|
||||
}
|
||||
|
||||
export interface Features
|
||||
{
|
||||
bAutoWidth: boolean;
|
||||
bDeferRender: boolean;
|
||||
bFilter: boolean;
|
||||
bInfo: boolean;
|
||||
bLengthChange: boolean;
|
||||
bPaginate: boolean;
|
||||
bProcessing: boolean;
|
||||
bServerSide: boolean;
|
||||
bSort: boolean;
|
||||
bSortClasses: boolean;
|
||||
bStateSave: boolean;
|
||||
}
|
||||
|
||||
export interface ScrollingSettings
|
||||
{
|
||||
bAutoCss : boolean;
|
||||
bCollapse: boolean;
|
||||
bInfinite: boolean;
|
||||
iBarWidth: number;
|
||||
iLoadGap: number;
|
||||
sX: string;
|
||||
sY: string;
|
||||
}
|
||||
|
||||
export interface Row
|
||||
{
|
||||
nTr: Node;
|
||||
_aData: any;
|
||||
_aSortData: any[];
|
||||
_anHidden: Node[];
|
||||
_sRowStripe: string;
|
||||
}
|
||||
|
||||
export interface Column
|
||||
{
|
||||
aDataSort: any;
|
||||
asSorting: string[];
|
||||
bSearchable : boolean;
|
||||
bSortable : boolean;
|
||||
bVisible : boolean;
|
||||
_bAutoType : boolean;
|
||||
fnCreatedCell: CreatedCell;
|
||||
fnGetData: (data: any, specific: string) => any;
|
||||
fnSetData: (data: any, value: any) => void;
|
||||
mData: any;
|
||||
mRender: any;
|
||||
nTh: Node;
|
||||
nIf: Node;
|
||||
sClass: string;
|
||||
sContentPadding: string;
|
||||
sDefaultContent: string;
|
||||
sName: string;
|
||||
sSortDataType: string;
|
||||
sSortingClass: string;
|
||||
sSortingClassJUI: string;
|
||||
sTitle: string;
|
||||
sType: string;
|
||||
sWidth: string;
|
||||
sWidthOrig: string;
|
||||
}
|
||||
|
||||
export interface CookieCallback
|
||||
{
|
||||
(name: string, data: any, expires: string, path: string, cookie: string) : void;
|
||||
}
|
||||
|
||||
export interface RowCreatedCallback
|
||||
{
|
||||
(row: Node, data: any[], dataIndex: number) : void;
|
||||
}
|
||||
|
||||
export interface DrawCallback
|
||||
{
|
||||
(settings: Settings) : void;
|
||||
}
|
||||
|
||||
export interface FooterCallback
|
||||
{
|
||||
(foot: Element, data: any[], start:number, end:number, display: number[]) : void;
|
||||
}
|
||||
|
||||
export interface FormatNumber
|
||||
{
|
||||
(toFormat: number) : string;
|
||||
}
|
||||
|
||||
export interface HeaderCallback
|
||||
{
|
||||
(head: Element, data: any[], start:number, end:number, display: number[]) : void;
|
||||
}
|
||||
|
||||
export interface InfoCallback
|
||||
{
|
||||
(settings: Settings, start: number, end: number, max:number, total: number, pre: string) : string;
|
||||
}
|
||||
|
||||
export interface InitComplete
|
||||
{
|
||||
(settings: Settings, json: any) : void;
|
||||
}
|
||||
|
||||
export interface PreDrawCallback
|
||||
{
|
||||
(settings: Settings) : boolean;
|
||||
}
|
||||
|
||||
export interface RowCallback
|
||||
{
|
||||
(row : Settings, data: any[], displayIndex: number, displayIndexFull: number) : void;
|
||||
}
|
||||
|
||||
export interface StateLoadCallback
|
||||
{
|
||||
(settings: Settings) : any;
|
||||
}
|
||||
|
||||
export interface StateLoadParams
|
||||
{
|
||||
(settings: Settings, data: any) : void;
|
||||
}
|
||||
|
||||
export interface StateLoaded
|
||||
{
|
||||
(settings: Settings, data: any) : void;
|
||||
}
|
||||
|
||||
export interface StateSaveCallback
|
||||
{
|
||||
(settings: any, data:any) : void;
|
||||
}
|
||||
|
||||
export interface StateSaveParams
|
||||
{
|
||||
(settings: any, data:any) : void;
|
||||
}
|
||||
|
||||
export interface CreatedCell
|
||||
{
|
||||
(nTd: Node, cellData: any, rowData: any, row: number, col: number) : void;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
2307
jquery.dataTables/jquery.dataTables.d.ts
vendored
2307
jquery.dataTables/jquery.dataTables.d.ts
vendored
File diff suppressed because it is too large
Load Diff
125
jquery.pickadate/jquery.pickadate.d.ts
vendored
125
jquery.pickadate/jquery.pickadate.d.ts
vendored
@@ -39,6 +39,7 @@ interface pickadateOptions extends pickerOptions {
|
||||
formatSubmit?: string; // e.g. 'yyyy/mm/dd'
|
||||
hiddenPrefix?: string; // default undefined
|
||||
hiddenSuffix?: string; // default '_submit'
|
||||
hiddenName?: boolean; // default undefined
|
||||
|
||||
// Dropdown selectors
|
||||
selectYears?: any; // Specify the number of years selectable using an even integer - half before and half after the year in focus:
|
||||
@@ -223,23 +224,21 @@ interface TimePickerSetThings extends SetThings {
|
||||
interval?: any;
|
||||
}
|
||||
|
||||
interface PickerObject {
|
||||
interface PickerObject<TPickerObject, TItemObject extends PickerItemObject, TOptions extends SetThings> {
|
||||
/** The picker's relative input element wrapped as a jQuery object. */
|
||||
$node: JQuery;
|
||||
|
||||
/** The picker's relative root holder element wrapped as a jQuery object. */
|
||||
$root: JQuery;
|
||||
}
|
||||
|
||||
interface DatePickerObject extends PickerObject {
|
||||
open(withoutFocus?: boolean): DatePickerObject;
|
||||
close(withFocus?: boolean): DatePickerObject;
|
||||
open(withoutFocus?: boolean): TPickerObject;
|
||||
close(withFocus?: boolean): TPickerObject;
|
||||
|
||||
/** Rebuild the picker. */
|
||||
start(): DatePickerObject;
|
||||
start(): TPickerObject;
|
||||
|
||||
/** Destroy the picker. */
|
||||
stop(): DatePickerObject;
|
||||
stop(): TPickerObject;
|
||||
|
||||
/**
|
||||
* Refresh the picker box after adding something to the holder.
|
||||
@@ -247,10 +246,10 @@ interface DatePickerObject extends PickerObject {
|
||||
* has it’s contents re-rendered. To render the entire picker from
|
||||
* the root up, pass true as the first argument.
|
||||
*/
|
||||
render(entirePicker?: boolean): DatePickerObject;
|
||||
render(entirePicker?: boolean): TPickerObject;
|
||||
|
||||
/** Clear the value in the picker's input element. */
|
||||
clear(): DatePickerObject;
|
||||
clear(): TPickerObject;
|
||||
|
||||
/** Short for picker.get('value') */
|
||||
get(): string;
|
||||
@@ -262,19 +261,19 @@ interface DatePickerObject extends PickerObject {
|
||||
get(thing: 'value'): string;
|
||||
|
||||
/** Returns the item object that is visually selected. */
|
||||
get(thing: 'select'): DatePickerItemObject;
|
||||
get(thing: 'select'): TItemObject;
|
||||
|
||||
/** Returns the item object that is visually highlighted. */
|
||||
get(thing: 'highlight'): DatePickerItemObject;
|
||||
get(thing: 'highlight'): TItemObject;
|
||||
|
||||
/** Returns the item object that sets the current view. */
|
||||
get(thing: 'view'): DatePickerItemObject;
|
||||
get(thing: 'view'): TItemObject;
|
||||
|
||||
/** Returns the item object that limits the picker's lower range. */
|
||||
get(thing: 'min'): DatePickerItemObject;
|
||||
get(thing: 'min'): TItemObject;
|
||||
|
||||
/** Returns the item object that limits the picker's upper range. */
|
||||
get(thing: 'max'): DatePickerItemObject;
|
||||
get(thing: 'max'): TItemObject;
|
||||
|
||||
/** Returns a boolean value of whether the picker is open or not. */
|
||||
get(thing: 'open'): boolean;
|
||||
@@ -292,99 +291,29 @@ interface DatePickerObject extends PickerObject {
|
||||
get(thing: string, format: string): string;
|
||||
|
||||
/** Set the properties, objects, and states to change the state of the picker. */
|
||||
set(thing: string, value?: any): DatePickerObject;
|
||||
set(things: SetThings): DatePickerObject;
|
||||
set(thing: string, value?: any, options?: any): TPickerObject;
|
||||
set(things: TOptions, options?: any): TPickerObject;
|
||||
|
||||
/** Bind callbacks to get fired off when the relative picker method is called. */
|
||||
on(methodName, callback: () => void ): DatePickerObject;
|
||||
on(methodName, callback: () => void): TPickerObject;
|
||||
|
||||
/** Bind multiple callbacks at once to get fired off when the relative picker method is called. */
|
||||
on(callbackObject: CallbackObject): DatePickerObject;
|
||||
on(callbackObject: CallbackObject): TPickerObject;
|
||||
|
||||
/** Trigger callbacks that have been queued up using the the on method. */
|
||||
trigger(event: string): DatePickerObject;
|
||||
trigger(event: string): TPickerObject;
|
||||
}
|
||||
|
||||
interface TimePickerObject extends PickerObject {
|
||||
open(withoutFocus?: boolean): TimePickerObject;
|
||||
close(withFocus?: boolean): TimePickerObject;
|
||||
|
||||
/** Rebuild the picker. */
|
||||
start(): TimePickerObject;
|
||||
|
||||
/** Destroy the picker. */
|
||||
stop(): TimePickerObject;
|
||||
|
||||
/**
|
||||
* Refresh the picker box after adding something to the holder.
|
||||
* By default, only the "face" of the picker (i.e. the box element)
|
||||
* has it’s contents re-rendered. To render the entire picker from
|
||||
* the root up, pass true as the first argument.
|
||||
*/
|
||||
render(entirePicker?: boolean): TimePickerObject;
|
||||
|
||||
/** Clear the value in the picker's input element. */
|
||||
clear(): TimePickerObject;
|
||||
|
||||
/** Short for picker.get('value') */
|
||||
get(): string;
|
||||
|
||||
/** Get the properties, objects, and states that make up the current state of the picker. */
|
||||
get(thing: string): any;
|
||||
|
||||
/** Returns the string value of the picker's input element. */
|
||||
get(thing: 'value'): string;
|
||||
|
||||
/** Returns the item object that is visually selected. */
|
||||
get(thing: 'select'): TimePickerItemObject;
|
||||
|
||||
/** Returns the item object that is visually highlighted. */
|
||||
get(thing: 'highlight'): TimePickerItemObject;
|
||||
|
||||
/** Returns the item object that sets the current view. */
|
||||
get(thing: 'view'): TimePickerItemObject;
|
||||
|
||||
/** Returns the item object that limits the picker's lower range. */
|
||||
get(thing: 'min'): TimePickerItemObject;
|
||||
|
||||
/** Returns the item object that limits the picker's upper range. */
|
||||
get(thing: 'max'): TimePickerItemObject;
|
||||
|
||||
/** Returns a boolean value of whether the picker is open or not. */
|
||||
get(thing: 'open'): boolean;
|
||||
|
||||
/** Returns a boolean value of whether the picker has started or not. */
|
||||
get(thing: 'start'): boolean;
|
||||
|
||||
/** Returns a unique 9-digit integer that is the ID of the picker. */
|
||||
get(thing: 'id'): number;
|
||||
|
||||
/** Returns an array of items that determine which item objects to disable on the picker. */
|
||||
get(thing: 'disable'): any[];
|
||||
|
||||
/** Returns a formatted string for the item object specified by `thing` */
|
||||
get(thing: string, format: string): string;
|
||||
|
||||
/** Set the properties, objects, and states to change the state of the picker. */
|
||||
set(thing: string, value?: any): TimePickerObject;
|
||||
set(things: TimePickerSetThings): TimePickerObject;
|
||||
|
||||
/** Bind callbacks to get fired off when the relative picker method is called. */
|
||||
on(methodName, callback: () => void ): TimePickerObject;
|
||||
|
||||
/** Bind multiple callbacks at once to get fired off when the relative picker method is called. */
|
||||
on(callbackObject: CallbackObject): TimePickerObject;
|
||||
|
||||
/** Trigger callbacks that have been queued up using the the on method. */
|
||||
trigger(event: string): TimePickerObject;
|
||||
}
|
||||
interface DatePickerObject extends PickerObject<DatePickerObject, DatePickerItemObject, SetThings> { }
|
||||
interface TimePickerObject extends PickerObject<TimePickerObject, TimePickerItemObject, TimePickerSetThings> { }
|
||||
|
||||
interface JQuery {
|
||||
pickadate(options?: pickadateOptions): HTMLInputElement;
|
||||
pickatime(options?: pickatimeOptions): HTMLInputElement;
|
||||
pickadate(methodName: "picker"): DatePickerObject;
|
||||
pickadate(methodName: string): any;
|
||||
pickadate(options?: pickadateOptions): JQuery;
|
||||
|
||||
pickatime(methodName: "picker"): TimePickerObject;
|
||||
pickatime(methodName: string): any;
|
||||
pickatime(options?: pickatimeOptions): JQuery;
|
||||
}
|
||||
|
||||
interface HTMLInputElement {
|
||||
pickadate(picker: string): DatePickerObject;
|
||||
pickatime(picker: string): TimePickerObject;
|
||||
}
|
||||
|
||||
139
jquery.window/jquery.window-tests.ts
Normal file
139
jquery.window/jquery.window-tests.ts
Normal file
@@ -0,0 +1,139 @@
|
||||
/// <reference path="../jquery/jquery.d.ts"/>
|
||||
/// <reference path="jquery.window.d.ts"/>
|
||||
|
||||
function example_1() {
|
||||
$.window({
|
||||
title: "Cyclops Studio",
|
||||
url: "http://apps.fstoke.me/"
|
||||
});
|
||||
}
|
||||
|
||||
function example_2() {
|
||||
$.window({
|
||||
showModal: true,
|
||||
modalOpacity: 0.5,
|
||||
icon: "http://www.fstoke.me/favicon.ico",
|
||||
title: "Professional JavaScript for Web Developers",
|
||||
content: $("#window_block2").html(), // load window_block2 html content
|
||||
footerContent: "<img style=\"vertical-align:middle;\" src=\"img/ star.png\"> This is a nice plugin :^)"
|
||||
});
|
||||
};
|
||||
|
||||
function example_3() {
|
||||
// prepare customerized static attributes, see static attributes
|
||||
// Note: you should call this method before starting to create window instances, or windows might display wrong.
|
||||
$.window.prepare({
|
||||
dock: 'bottom', // change the dock direction: 'left', 'right', 'top', 'bottom'
|
||||
animationSpeed: 200, // set animation speed
|
||||
minWinLong: 180 // set minimized window long dimension width in pixel
|
||||
});
|
||||
|
||||
// limit window within body
|
||||
$.window({
|
||||
icon: 'http://www.fstoke.me/favicon.ico',
|
||||
title: "This window only can be dragged within body boundary",
|
||||
content: "<div style=\"padding: 10px; font - weight:bold; \">I only can be dragged within body element." +
|
||||
"<br><br>Really? Really? You can try it... :)</div>",
|
||||
checkBoundary: true,
|
||||
x: 80,
|
||||
y: 80
|
||||
});
|
||||
|
||||
// limit window within a element
|
||||
$("#my_boundary_panel").window({
|
||||
icon: 'http://mail.google.com/favicon.ico',
|
||||
title: "This window only can be dragged within its parent element",
|
||||
content: "<div style=\"border: 15px solid green; padding: 10px; font - weight:bold; \">I only can be dragged within my boss...@@</div>",
|
||||
checkBoundary: true,
|
||||
width: 200,
|
||||
height: 160,
|
||||
maxWidth: 400,
|
||||
maxHeight: 300,
|
||||
x: 80,
|
||||
y: 80
|
||||
});
|
||||
|
||||
// assign the dock area
|
||||
$.window.prepare({
|
||||
dock: 'bottom', // change the dock direction: 'left', 'right', 'top', 'bottom'
|
||||
dockArea: $('#myDockArea'), // set the dock area
|
||||
animationSpeed: 200, // set animation speed
|
||||
minWinLong: 180 // set minimized window long dimension width in pixel
|
||||
});
|
||||
}
|
||||
|
||||
function example_4() {
|
||||
$.window({
|
||||
title: "Un-draggable & Un-resizable Window",
|
||||
content: "<div style=\"padding: 10px; font - weight:bold; \">I can't be dragged...<br>" +
|
||||
"I can't be resized too...<br><br>Of course, maximize and minimize are also disabled... <br><br>" +
|
||||
"So... What can I do? I only can be closed. @_@</div>",
|
||||
draggable: false,
|
||||
resizable: false,
|
||||
maximizable: false,
|
||||
minimizable: false,
|
||||
showModal: true
|
||||
});
|
||||
}
|
||||
|
||||
function example_5() {
|
||||
var log = console.log;
|
||||
$.window({
|
||||
title: "complext window",
|
||||
content: $("#window_block5").html(), // load window_block5 html content
|
||||
x: 150, // the x-axis value on screen, if -1 means put on screen center
|
||||
y: 100, // the y-axis value on screen, if -1 means put on screen center
|
||||
width: 600, // window width
|
||||
height: 300, // window height
|
||||
minWidth: 200, // the minimum width, if -1 means no checking
|
||||
minHeight: 100, // the minimum height, if -1 means no checking
|
||||
maxWidth: 700, // the minimum width, if -1 means no checking
|
||||
maxHeight: 400, // the minimum height, if -1 means no checking
|
||||
scrollable: false, // a boolean flag to show scroll bar or not
|
||||
onOpen: (wnd: JQueryWindow.Window) => { // a callback function while container is added into body
|
||||
alert('open');
|
||||
},
|
||||
onShow: (wnd: JQueryWindow.Window) => { // a callback function while whole window display routine is finished
|
||||
alert('show');
|
||||
},
|
||||
onClose: (wnd: JQueryWindow.Window) => { // a callback function while user click close button
|
||||
alert('close');
|
||||
},
|
||||
onSelect: (wnd: JQueryWindow.Window) => { // a callback function while user select the window
|
||||
log('select');
|
||||
},
|
||||
onUnselect: (wnd: JQueryWindow.Window) => { // a callback function while window unselected
|
||||
log('unelect');
|
||||
},
|
||||
onDrag: (wnd: JQueryWindow.Window) => { // a callback function while window is going to drag
|
||||
log('drag');
|
||||
},
|
||||
afterDrag: (wnd: JQueryWindow.Window) => { // a callback function after window dragged
|
||||
log('after dragged');
|
||||
},
|
||||
onResize: (wnd: JQueryWindow.Window) => { // a callback function while window is going to resize
|
||||
log('resize');
|
||||
},
|
||||
afterResize: (wnd: JQueryWindow.Window) => { // a callback function after window resized
|
||||
log('after resized');
|
||||
},
|
||||
onMinimize: (wnd: JQueryWindow.Window) => { // a callback function while window is going to minimize
|
||||
log('minimize');
|
||||
},
|
||||
afterMinimize: (wnd: JQueryWindow.Window) => { // a callback function after window minimized
|
||||
log('after minimized');
|
||||
},
|
||||
onMaximize: (wnd: JQueryWindow.Window) => { // a callback function while window is going to maximize
|
||||
log('maximize');
|
||||
},
|
||||
afterMaximize: (wnd: JQueryWindow.Window) => { // a callback function after window maximized
|
||||
log('after maximized');
|
||||
},
|
||||
onCascade: (wnd: JQueryWindow.Window) => { // a callback function while window is going to cascade
|
||||
log('cascade');
|
||||
},
|
||||
afterCascade: (wnd: JQueryWindow.Window) => { // a callback function after window cascaded
|
||||
log('after cascaded');
|
||||
}
|
||||
});
|
||||
}
|
||||
460
jquery.window/jquery.window.d.ts
vendored
Normal file
460
jquery.window/jquery.window.d.ts
vendored
Normal file
@@ -0,0 +1,460 @@
|
||||
// Type definitions for Window plugin for jQuery 5.0.4
|
||||
// Project: http://fstoke.me/jquery/window/
|
||||
// Definitions by: Ryan Graham <https://github.com/ryan-codingintrigue/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../jquery/jquery.d.ts"/>
|
||||
|
||||
declare module JQueryWindow {
|
||||
// Instance methods
|
||||
interface Window {
|
||||
/**
|
||||
get window id
|
||||
**/
|
||||
getWindowId(): string;
|
||||
/**
|
||||
get window container's parent panel, it's a jQuery object
|
||||
**/
|
||||
getCaller(): JQuery;
|
||||
/**
|
||||
get window container panel, it's a jQuery object
|
||||
**/
|
||||
getContainer(): JQuery;
|
||||
/**
|
||||
get window header panel, it's a jQuery object
|
||||
**/
|
||||
getHeader(): JQuery;
|
||||
/**
|
||||
get window frame panel, it's a jQuery object
|
||||
**/
|
||||
getFrame(): JQuery;
|
||||
/**
|
||||
get window footer panel, it's a jQuery object
|
||||
**/
|
||||
getFooter(): JQuery;
|
||||
/**
|
||||
set current window as screen center
|
||||
**/
|
||||
alignCenter(): void;
|
||||
/**
|
||||
set current window as horizontal center
|
||||
**/
|
||||
alignHorizontalCenter(): void;
|
||||
/**
|
||||
set current window as vertical center
|
||||
**/
|
||||
alignVerticalCenter(): void;
|
||||
/**
|
||||
select current window, it will increase the original z-index value with 2
|
||||
**/
|
||||
select(): void;
|
||||
/**
|
||||
unselect current window, it will set the z-index as original options.z
|
||||
**/
|
||||
unselect(): void;
|
||||
/**
|
||||
move current window to target position or shift it by passed distance
|
||||
**/
|
||||
move(x: number, y: number, bShift: boolean): void;
|
||||
/**
|
||||
resize current window to target width/height
|
||||
**/
|
||||
resize(width: number, height: number): void;
|
||||
/**
|
||||
maximize current window
|
||||
**/
|
||||
maximize(): void;
|
||||
/**
|
||||
minimize current window
|
||||
**/
|
||||
minimize(): void;
|
||||
/**
|
||||
restore current window, it could be maximized or cascade status
|
||||
**/
|
||||
restore(): void;
|
||||
/**
|
||||
close current window
|
||||
**/
|
||||
close(quiet: boolean): void;
|
||||
/**
|
||||
hide current window
|
||||
**/
|
||||
hide(): void;
|
||||
/**
|
||||
show current window
|
||||
**/
|
||||
show(): void;
|
||||
/**
|
||||
change window title
|
||||
**/
|
||||
setTitle(title: string): void;
|
||||
/**
|
||||
change iframe url
|
||||
**/
|
||||
setUrl(url: string): void;
|
||||
/**
|
||||
change frame content
|
||||
**/
|
||||
setContent(content: string|JQuery|HTMLElement): void;
|
||||
/**
|
||||
change footer content
|
||||
**/
|
||||
setFooterContent(content: string|JQuery|HTMLElement): void;
|
||||
/**
|
||||
get window title text
|
||||
**/
|
||||
getTitle(): string;
|
||||
/**
|
||||
get url string
|
||||
**/
|
||||
getUrl(): string;
|
||||
/**
|
||||
get frame html content
|
||||
**/
|
||||
getContent(): string;
|
||||
/**
|
||||
get footer html content
|
||||
**/
|
||||
getFooterContent(): string;
|
||||
/**
|
||||
get window maximized status
|
||||
**/
|
||||
isMaximized(): boolean;
|
||||
/**
|
||||
get window minmized status
|
||||
**/
|
||||
isMinimized(): boolean;
|
||||
/**
|
||||
get window selected status
|
||||
**/
|
||||
isSelected(): boolean;
|
||||
/**
|
||||
set window icon
|
||||
**/
|
||||
setIcon(iconUrl: string): void;
|
||||
/**
|
||||
show window icon
|
||||
**/
|
||||
showIcon(): void;
|
||||
/**
|
||||
hide window icon
|
||||
**/
|
||||
hideIcon(): void;
|
||||
}
|
||||
|
||||
// Static methods
|
||||
interface Static {
|
||||
(options: WindowOptions): JQueryWindow.Window;
|
||||
/**
|
||||
initialize with customerized static setting attributes
|
||||
**/
|
||||
prepare(options?: StaticOptions): void;
|
||||
/**
|
||||
close all created windows
|
||||
**/
|
||||
closeAll(quiet?: boolean): void;
|
||||
/**
|
||||
hide all created windows
|
||||
**/
|
||||
hideAll(): void;
|
||||
/**
|
||||
show all created windows
|
||||
**/
|
||||
showAll(): void;
|
||||
/**
|
||||
return all created windows instance
|
||||
**/
|
||||
getAll(): Array<JQueryWindow.Window>;
|
||||
/**
|
||||
get the window instance by passed window id
|
||||
**/
|
||||
getWindow(windowId: string): JQueryWindow.Window;
|
||||
/**
|
||||
get the selected window instance
|
||||
**/
|
||||
getSelectedWindow(): JQueryWindow.Window;
|
||||
}
|
||||
|
||||
// Static options
|
||||
interface StaticOptions {
|
||||
/**
|
||||
the direction of minimized window dock at. the available values are [left, right, top, bottom]
|
||||
**/
|
||||
dock?: string;
|
||||
/**
|
||||
the area which the windows will dock at
|
||||
**/
|
||||
dockArea?: JQuery|HTMLElement;
|
||||
/**
|
||||
the speed of animations: maximize, minimize, restore, shift, in milliseconds
|
||||
**/
|
||||
animationSpeed?: number;
|
||||
/**
|
||||
the narrow dimension of minimized window
|
||||
**/
|
||||
minWinNarrow?: number;
|
||||
/**
|
||||
the long dimension of minimized window
|
||||
**/
|
||||
minWinLong?: number;
|
||||
/**
|
||||
to handle browser scrollbar when window status changed(maximize, minimize, cascade)
|
||||
**/
|
||||
handleScrollbar?: boolean;
|
||||
/**
|
||||
to decide show log in firebug, IE8, chrome console
|
||||
**/
|
||||
showLog?: boolean;
|
||||
}
|
||||
|
||||
// Instance options
|
||||
interface WindowOptions {
|
||||
/**
|
||||
an icon image url string. if this attribute is given, it will force to replace the original favicon of remote page on window. or you can set it as null to hide icon.
|
||||
**/
|
||||
icon?: string;
|
||||
/**
|
||||
the title text of window
|
||||
**/
|
||||
title: string;
|
||||
/**
|
||||
the target url of iframe ready to load.
|
||||
**/
|
||||
url?: string;
|
||||
/**
|
||||
this attribute only works when url is null. when passing a jquery object or a element, it will clone the original one to append.
|
||||
**/
|
||||
content?: string|JQuery|HTMLElement;
|
||||
/**
|
||||
same as content attribute, but it's put on footer panel.
|
||||
**/
|
||||
footerContent?: string|JQuery|HTMLElement;
|
||||
/**
|
||||
container extra class
|
||||
**/
|
||||
containerClass?: string;
|
||||
/**
|
||||
header extra class
|
||||
**/
|
||||
headerClass?: string;
|
||||
/**
|
||||
frame extra class
|
||||
**/
|
||||
frameClass?: string;
|
||||
/**
|
||||
footer extra class
|
||||
**/
|
||||
footerClass?: string;
|
||||
/**
|
||||
selected header extra class
|
||||
**/
|
||||
selectedHeaderClass?: string;
|
||||
/**
|
||||
the x-axis value on screen(or caller element), if -1 means put on screen(or caller element) center
|
||||
**/
|
||||
x?: number;
|
||||
/**
|
||||
the y-axis value on screen(or caller element), if -1 means put on screen(or caller element) center
|
||||
**/
|
||||
y?: number;
|
||||
/**
|
||||
the css z-index value
|
||||
**/
|
||||
z?: number;
|
||||
/**
|
||||
window width
|
||||
**/
|
||||
width?: number;
|
||||
/**
|
||||
window height
|
||||
**/
|
||||
height?: number;
|
||||
/**
|
||||
the minimum width, if -1 means no checking
|
||||
**/
|
||||
minWidth?: number;
|
||||
/**
|
||||
the minimum height, if -1 means no checking
|
||||
**/
|
||||
minHeight?: number;
|
||||
/**
|
||||
the maximum width, if -1 means no checking
|
||||
**/
|
||||
maxWidth?: number;
|
||||
/**
|
||||
the maximum height, if -1 means no checking
|
||||
**/
|
||||
maxHeight?: number;
|
||||
/**
|
||||
to control show modal on background
|
||||
**/
|
||||
showModal?: boolean;
|
||||
/**
|
||||
the opacity of modal dialog
|
||||
**/
|
||||
modalOpacity?: number;
|
||||
/**
|
||||
to control show footer panel
|
||||
**/
|
||||
showFooter?: boolean;
|
||||
/**
|
||||
to control display window as round corner
|
||||
**/
|
||||
showRoundCorner?: boolean;
|
||||
/**
|
||||
to control window closable
|
||||
**/
|
||||
closable?: boolean;
|
||||
/**
|
||||
to control window minimizable
|
||||
**/
|
||||
minimizable?: boolean;
|
||||
/**
|
||||
to control window maximizable
|
||||
**/
|
||||
maximizable?: boolean;
|
||||
/**
|
||||
to control window with remote url could be bookmarked
|
||||
**/
|
||||
bookmarkable?: boolean;
|
||||
/**
|
||||
to control window draggable
|
||||
**/
|
||||
draggable?: boolean;
|
||||
/**
|
||||
to control window resizable
|
||||
**/
|
||||
resizable?: boolean;
|
||||
/**
|
||||
to show scroll bar or not
|
||||
**/
|
||||
scrollable?: boolean;
|
||||
/**
|
||||
to check window dialog overflow html body or caller element
|
||||
**/
|
||||
checkBoundary?: boolean;
|
||||
/**
|
||||
to limit window only can be dragged within browser window. this attribute only works when checkBoundary is true and caller is null.
|
||||
**/
|
||||
withinBrowserWindow?: boolean;
|
||||
/**
|
||||
to describe the customized button display and callback function
|
||||
**/
|
||||
custBtns?: Array<JQueryWindow.Button>;
|
||||
/**
|
||||
a callback function while container is added into body
|
||||
**/
|
||||
onOpen?: (wnd: JQueryWindow.Window) => void;
|
||||
/**
|
||||
a callback function while whole window display routine is finished
|
||||
**/
|
||||
onShow?: (wnd: JQueryWindow.Window) => void;
|
||||
/**
|
||||
a callback function while user click close button
|
||||
**/
|
||||
onClose?: (wnd: JQueryWindow.Window) => void;
|
||||
/**
|
||||
a callback function while user select the window
|
||||
**/
|
||||
onSelect?: (wnd: JQueryWindow.Window) => void;
|
||||
/**
|
||||
a callback function while window unselected
|
||||
**/
|
||||
onUnselect?: (wnd: JQueryWindow.Window) => void;
|
||||
/**
|
||||
a callback function while window is going to drag
|
||||
**/
|
||||
onDrag?: (wnd: JQueryWindow.Window) => void;
|
||||
/**
|
||||
a callback function after window dragged
|
||||
**/
|
||||
afterDrag?: (wnd: JQueryWindow.Window) => void;
|
||||
/**
|
||||
a callback function while window is going to resize
|
||||
**/
|
||||
onResize?: (wnd: JQueryWindow.Window) => void;
|
||||
/**
|
||||
a callback function after window resized
|
||||
**/
|
||||
afterResize?: (wnd: JQueryWindow.Window) => void;
|
||||
/**
|
||||
a callback function while window is going to minimize
|
||||
**/
|
||||
onMinimize?: (wnd: JQueryWindow.Window) => void;
|
||||
/**
|
||||
a callback function after window minimized
|
||||
**/
|
||||
afterMinimize?: (wnd: JQueryWindow.Window) => void;
|
||||
/**
|
||||
a callback function while window is going to maximize
|
||||
**/
|
||||
onMaximize?: (wnd: JQueryWindow.Window) => void;
|
||||
/**
|
||||
a callback function after window maximized
|
||||
**/
|
||||
afterMaximize?: (wnd: JQueryWindow.Window) => void;
|
||||
/**
|
||||
a callback function while window is going to cascade
|
||||
**/
|
||||
onCascade?: (wnd: JQueryWindow.Window) => void;
|
||||
/**
|
||||
a callback function after window cascaded
|
||||
**/
|
||||
afterCascade?: (wnd: JQueryWindow.Window) => void;
|
||||
/**
|
||||
a callback function while iframe ready to connect remoting url. this attribute only works while url attribute is given
|
||||
**/
|
||||
onIframeStart?: (wnd: JQueryWindow.Window) => void;
|
||||
/**
|
||||
a callback function while iframe load finished. this attribute only works while url attribute is given
|
||||
**/
|
||||
onIframeEnd?: (wnd: JQueryWindow.Window) => void;
|
||||
/**
|
||||
if null means no check, or pass a string to show warning message while iframe is going to redirect current top page
|
||||
**/
|
||||
iframeRedirectCheckMsg?: string;
|
||||
/**
|
||||
random the new created window position, it only works when options x,y value both are -1
|
||||
**/
|
||||
createRandomOffset?: { x: number; y: number };
|
||||
}
|
||||
|
||||
// Button definition
|
||||
interface Button {
|
||||
/**
|
||||
|
||||
**/
|
||||
id: string;
|
||||
/**
|
||||
|
||||
**/
|
||||
title?: string;
|
||||
/**
|
||||
|
||||
**/
|
||||
clazz?: string;
|
||||
/**
|
||||
|
||||
**/
|
||||
style?: string;
|
||||
/**
|
||||
|
||||
**/
|
||||
image: string;
|
||||
/**
|
||||
|
||||
**/
|
||||
callback: (btn: JQueryWindow.Button, wnd: JQueryWindow.Window) => void;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Register with JQuery instance
|
||||
interface JQuery {
|
||||
window(options: JQueryWindow.WindowOptions): JQueryWindow.Window;
|
||||
}
|
||||
|
||||
// Register with JQuery static
|
||||
interface JQueryStatic {
|
||||
window: JQueryWindow.Static;
|
||||
}
|
||||
55
jsonpath/jsonpath-tests.ts
Normal file
55
jsonpath/jsonpath-tests.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
/// <reference path="jsonpath.d.ts" />
|
||||
|
||||
import jp = require('jsonpath');
|
||||
|
||||
var data: any;
|
||||
|
||||
/**
|
||||
* jp.query(obj, pathExpression)
|
||||
* Find elements in obj matching pathExpression. Returns an array of elements that satisfy the provided JSONPath expression, or an empty array if none were matched.
|
||||
*/
|
||||
var authors = jp.query(data, '$..author');
|
||||
|
||||
/**
|
||||
* jp.paths(obj, pathExpression)
|
||||
* Find elements in obj matching pathExpression. Returns an array of element paths that satisfy the provided JSONPath expression. Each path is itself an array of keys representing the location within obj of the matching element.
|
||||
*/
|
||||
var paths = jp.paths(data, '$..author');
|
||||
|
||||
/**
|
||||
* jp.nodes(obj, pathExpression)
|
||||
* Find elements and their corresponding paths in obj matching pathExpression. Returns an array of node objects where each node has a path containing an array of keys representing the location within obj, and a value pointing to the matched element.
|
||||
*/
|
||||
var nodes = jp.nodes(data, '$..author');
|
||||
|
||||
/**
|
||||
* jp.value(obj, pathExpression, [newValue])
|
||||
* Returns the value of the first element matching pathExpression. If newValue is provided, sets the value of the first matching element and returns the new value.
|
||||
*/
|
||||
var value = jp.value(data, '$.store..price');
|
||||
jp.value(data, '$.store..price', 12.5);
|
||||
|
||||
/**
|
||||
* jp.parent(obj, pathExpression)
|
||||
* Returns the parent of the first matching element.
|
||||
*/
|
||||
var parent = jp.parent(data, '$.store..price');
|
||||
|
||||
/**
|
||||
* jp.apply(obj, pathExpression, fn)
|
||||
* Runs the supplied function fn on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.
|
||||
*/
|
||||
var nodes = jp.apply(data, '$..author', (value: string) => { return value.toUpperCase() });
|
||||
|
||||
/**
|
||||
* jp.parse(pathExpression)
|
||||
* Parse the provided JSONPath expression into path components and their associated operations.
|
||||
*/
|
||||
var path = jp.parse('$..author');
|
||||
|
||||
/**
|
||||
* jp.stringify(path)
|
||||
* Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by jp.nodes for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by jp.parse.
|
||||
*/
|
||||
var pathExpression = jp.stringify(['$', 'store', 'book', 0, 'author']);
|
||||
|
||||
21
jsonpath/jsonpath.d.ts
vendored
Normal file
21
jsonpath/jsonpath.d.ts
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
// Type definitions for jsonpath 0.1.3
|
||||
// Project: https://www.npmjs.org/package/jsonpath
|
||||
// Definitions by: Hiroki Horiuchi <https://github.com/horiuchi>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module "jsonpath" {
|
||||
|
||||
type PathComponent = string|number;
|
||||
|
||||
export function query(obj: any, pathExpression: string): any[];
|
||||
export function paths(obj: any, pathExpression: string): PathComponent[][];
|
||||
export function nodes(obj: any, pathExpression: string): { path: PathComponent[]; value: any; }[];
|
||||
export function value(obj: any, pathExpression: string): any;
|
||||
export function value(obj: any, pathExpression: string, newValue: any): any;
|
||||
export function parent(obj: any, pathExpression: string): any;
|
||||
export function apply(obj: any, pathExpression: string, fn: (x: any) => any): { path: PathComponent[]; value: any; }[];
|
||||
export function parse(pathExpression: string): any[];
|
||||
export function stringify(path: PathComponent[]): string;
|
||||
|
||||
}
|
||||
|
||||
569
knex/knex-test.ts
Normal file
569
knex/knex-test.ts
Normal file
@@ -0,0 +1,569 @@
|
||||
/// <reference path='knex.d.ts' />
|
||||
/// <reference path='../lodash/lodash.d.ts' />
|
||||
import Knex = require('knex');
|
||||
import _ = require('lodash');
|
||||
'use strict';
|
||||
// Initializing the Library
|
||||
var knex = Knex({
|
||||
client: 'sqlite3',
|
||||
connection: {
|
||||
filename: "./mydb.sqlite"
|
||||
}
|
||||
});
|
||||
|
||||
var knex = Knex({
|
||||
client: 'mysql',
|
||||
connection: {
|
||||
socketPath : '/path/to/socket.sock',
|
||||
user : 'your_database_user',
|
||||
password : 'your_database_password',
|
||||
database : 'myapp_test'
|
||||
}
|
||||
});
|
||||
|
||||
// Pooling
|
||||
var knex = Knex({
|
||||
client: 'mysql',
|
||||
connection: {
|
||||
host : '127.0.0.1',
|
||||
user : 'your_database_user',
|
||||
password : 'your_database_password',
|
||||
database : 'myapp_test'
|
||||
},
|
||||
pool: {
|
||||
min: 0,
|
||||
max: 7
|
||||
}
|
||||
});
|
||||
|
||||
// Migrations
|
||||
var knex = Knex({
|
||||
client: 'mysql',
|
||||
connection: {
|
||||
host : '127.0.0.1',
|
||||
user : 'your_database_user',
|
||||
password : 'your_database_password',
|
||||
database : 'myapp_test'
|
||||
},
|
||||
migrations: {
|
||||
tableName: 'migrations'
|
||||
}
|
||||
});
|
||||
|
||||
// Knex Query Builder
|
||||
knex.select('title', 'author', 'year').from('books');
|
||||
knex.select().table('books');
|
||||
|
||||
knex.avg('sum_column1').from(function() {
|
||||
this.sum('column1 as sum_column1').from('t1').groupBy('column1').as('t1')
|
||||
}).as('ignored_alias');
|
||||
|
||||
knex.column('title', 'author', 'year').select().from('books');
|
||||
knex.column(['title', 'author', 'year']).select().from('books');
|
||||
knex.select('*').from('users');
|
||||
|
||||
knex('users').where({
|
||||
first_name: 'Test',
|
||||
last_name: 'User'
|
||||
}).select('id');
|
||||
|
||||
knex('users').where('id', 1);
|
||||
|
||||
knex('users').where(() => {
|
||||
this.where('id', 1).orWhere('id', '>', 10)
|
||||
}).orWhere({name: 'Tester'});
|
||||
|
||||
knex('users').where('votes', '>', 100);
|
||||
|
||||
var subquery = knex('users').where('votes', '>', 100).andWhere('status', 'active').orWhere('name', 'John').select('id');
|
||||
knex('accounts').where('id', 'in', subquery);
|
||||
|
||||
knex.select('name').from('users')
|
||||
.whereIn('id', [1, 2, 3])
|
||||
.orWhereIn('id', [4, 5, 6]);
|
||||
|
||||
var subquery = knex.select('id').from('accounts');
|
||||
knex.select('name').from('users')
|
||||
.whereIn('account_id', subquery);
|
||||
|
||||
knex('users')
|
||||
.where('name', '=', 'John')
|
||||
.orWhere(function() {
|
||||
this.where('votes', '>', 100).andWhere('title', '<>', 'Admin');
|
||||
});
|
||||
|
||||
knex('users').whereNotIn('id', [1, 2, 3]);
|
||||
|
||||
knex('users').where('name', 'like', '%Test%').orWhereNotIn('id', [1, 2, 3]);
|
||||
|
||||
knex('users').whereNull('updated_at');
|
||||
|
||||
knex('users').whereNotNull('created_at');
|
||||
|
||||
knex('users').whereExists(function() {
|
||||
this.select('*').from('accounts').whereRaw('users.account_id = accounts.id');
|
||||
});
|
||||
|
||||
knex('users').whereExists(knex.select('*').from('accounts').whereRaw('users.account_id = accounts.id'));
|
||||
|
||||
knex('users').whereNotExists(function() {
|
||||
this.select('*').from('accounts').whereRaw('users.account_id = accounts.id');
|
||||
});
|
||||
|
||||
knex('users').whereBetween('votes', [1, 100]);
|
||||
|
||||
knex('users').whereNotBetween('votes', [1, 100]);
|
||||
|
||||
knex('users').whereRaw('id = ?', [1]);
|
||||
|
||||
// Join methods
|
||||
knex('users')
|
||||
.join('contacts', 'users.id', '=', 'contacts.user_id')
|
||||
.select('users.id', 'contacts.phone');
|
||||
|
||||
knex('users')
|
||||
.join('contacts', 'users.id', 'contacts.user_id')
|
||||
.select('users.id', 'contacts.phone');
|
||||
|
||||
knex.select('*').from('users').join('accounts', function() {
|
||||
this.on('accounts.id', '=', 'users.account_id').orOn('accounts.owner_id', '=', 'users.id')
|
||||
});
|
||||
|
||||
knex.select('*').from('users').join('accounts', 'accounts.type', knex.raw('?', ['admin']));
|
||||
|
||||
knex.from('users').innerJoin('accounts', 'users.id', 'accounts.user_id');
|
||||
|
||||
knex.table('users').innerJoin('accounts', 'users.id', '=', 'accounts.user_id');
|
||||
|
||||
knex('users').innerJoin('accounts', function() {
|
||||
this.on('accounts.id', '=', 'users.account_id').orOn('accounts.owner_id', '=', 'users.id')
|
||||
});
|
||||
|
||||
knex.select('*').from('users').leftJoin('accounts', 'users.id', 'accounts.user_id');
|
||||
|
||||
knex.select('*').from('users').leftJoin('accounts', function() {
|
||||
this.on('accounts.id', '=', 'users.account_id').orOn('accounts.owner_id', '=', 'users.id')
|
||||
});
|
||||
|
||||
knex.select('*').from('users').leftOuterJoin('accounts', 'users.id', 'accounts.user_id');
|
||||
|
||||
knex.select('*').from('users').leftOuterJoin('accounts', function() {
|
||||
this.on('accounts.id', '=', 'users.account_id').orOn('accounts.owner_id', '=', 'users.id')
|
||||
});
|
||||
|
||||
knex.select('*').from('users').rightJoin('accounts', 'users.id', 'accounts.user_id');
|
||||
|
||||
knex.select('*').from('users').rightJoin('accounts', function() {
|
||||
this.on('accounts.id', '=', 'users.account_id').orOn('accounts.owner_id', '=', 'users.id')
|
||||
});
|
||||
|
||||
knex.select('*').from('users').rightOuterJoin('accounts', 'users.id', 'accounts.user_id');
|
||||
|
||||
knex.select('*').from('users').rightOuterJoin('accounts', function() {
|
||||
this.on('accounts.id', '=', 'users.account_id').orOn('accounts.owner_id', '=', 'users.id')
|
||||
});
|
||||
|
||||
knex.select('*').from('users').outerJoin('accounts', 'users.id', 'accounts.user_id');
|
||||
|
||||
knex.select('*').from('users').outerJoin('accounts', function() {
|
||||
this.on('accounts.id', '=', 'users.account_id').orOn('accounts.owner_id', '=', 'users.id')
|
||||
});
|
||||
|
||||
knex.select('*').from('users').fullOuterJoin('accounts', 'users.id', 'accounts.user_id');
|
||||
|
||||
knex.select('*').from('users').fullOuterJoin('accounts', function() {
|
||||
this.on('accounts.id', '=', 'users.account_id').orOn('accounts.owner_id', '=', 'users.id')
|
||||
});
|
||||
|
||||
knex.select('*').from('users').crossJoin('accounts', 'users.id', 'accounts.user_id');
|
||||
|
||||
knex.select('*').from('accounts').joinRaw('natural full join table1').where('id', 1);
|
||||
|
||||
knex.select('*').from('accounts').join(knex.raw('natural full join table1')).where('id', 1);
|
||||
|
||||
knex('customers')
|
||||
.distinct('first_name', 'last_name')
|
||||
.select();
|
||||
|
||||
knex('users').groupBy('count');
|
||||
|
||||
knex.select('year', knex.raw('SUM(profit)')).from('sales').groupByRaw('year WITH ROLLUP');
|
||||
|
||||
knex('users').orderBy('name', 'desc');
|
||||
|
||||
knex.select('*').from('table').orderByRaw('col NULLS LAST DESC');
|
||||
|
||||
knex('books').insert({title: 'Slaughterhouse Five'});
|
||||
|
||||
knex('coords').insert([{x: 20}, {y: 30}, {x: 10, y: 20}]);
|
||||
|
||||
knex.insert([{title: 'Great Gatsby'}, {title: 'Fahrenheit 451'}], 'id').into('books');
|
||||
|
||||
knex('books')
|
||||
.returning('id')
|
||||
.insert({title: 'Slaughterhouse Five'});
|
||||
|
||||
knex('books')
|
||||
.returning('id')
|
||||
.insert([{title: 'Great Gatsby'}, {title: 'Fahrenheit 451'}]);
|
||||
|
||||
knex('books')
|
||||
.where('published_date', '<', 2000)
|
||||
.update({
|
||||
status: 'archived'
|
||||
});
|
||||
|
||||
knex('books').update('title', 'Slaughterhouse Five');
|
||||
|
||||
knex('accounts')
|
||||
.where('activated', false)
|
||||
.del();
|
||||
|
||||
var someExternalMethod: Function;
|
||||
|
||||
knex.transaction(function(trx) {
|
||||
knex('books').transacting(trx).insert({name: 'Old Books'})
|
||||
.then(function(resp) {
|
||||
var id = resp[0];
|
||||
return someExternalMethod(id, trx);
|
||||
})
|
||||
.then(trx.commit)
|
||||
.catch(trx.rollback);
|
||||
|
||||
}).then(function() {
|
||||
console.log('Transaction complete.');
|
||||
}).catch(function(err) {
|
||||
console.error(err);
|
||||
});
|
||||
|
||||
knex.transaction(function(trx) {
|
||||
knex('tableName')
|
||||
.transacting(trx)
|
||||
.forUpdate()
|
||||
.select('*');
|
||||
|
||||
knex('tableName')
|
||||
.transacting(trx)
|
||||
.forShare()
|
||||
.select('*')
|
||||
});
|
||||
|
||||
knex('users').count('active');
|
||||
|
||||
knex('users').min('age');
|
||||
|
||||
knex('users').min('age as a');
|
||||
|
||||
knex('users').max('age');
|
||||
|
||||
knex('users').max('age as a');
|
||||
|
||||
knex('users').sum('products');
|
||||
|
||||
knex('users').sum('products as p');
|
||||
|
||||
knex('users').avg('age');
|
||||
|
||||
knex('users').avg('age as a');
|
||||
|
||||
knex('accounts')
|
||||
.where('userid', '=', 1)
|
||||
.increment('balance', 10);
|
||||
|
||||
knex('accounts').where('userid', '=', 1).decrement('balance', 5);
|
||||
|
||||
knex('accounts').truncate();
|
||||
|
||||
knex.table('users').pluck('id').then(function(ids) {
|
||||
console.log(ids);
|
||||
});
|
||||
|
||||
knex.table('users').first('id', 'name').then(function(row) {
|
||||
console.log(row);
|
||||
});
|
||||
|
||||
// Using trx as a query builder:
|
||||
knex.transaction(function(trx) {
|
||||
|
||||
var info: any;
|
||||
var books: any[] = [
|
||||
{title: 'Canterbury Tales'},
|
||||
{title: 'Moby Dick'},
|
||||
{title: 'Hamlet'}
|
||||
];
|
||||
|
||||
return trx
|
||||
.insert({name: 'Old Books'}, 'id')
|
||||
.into('catalogues')
|
||||
.then(function(ids) {
|
||||
return Promise.map(books, function(book) {
|
||||
book.catalogue_id = ids[0];
|
||||
// Some validation could take place here.
|
||||
return trx.insert(info).into('books');
|
||||
});
|
||||
});
|
||||
})
|
||||
.then(function(inserts) {
|
||||
console.log(inserts.length + ' new books saved.');
|
||||
})
|
||||
.catch(function(error) {
|
||||
// If we get here, that means that neither the 'Old Books' catalogues insert,
|
||||
// nor any of the books inserts will have taken place.
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
// Using trx as a transaction object:
|
||||
knex.transaction(function(trx) {
|
||||
|
||||
var info: any;
|
||||
var books: any[] = [
|
||||
{title: 'Canterbury Tales'},
|
||||
{title: 'Moby Dick'},
|
||||
{title: 'Hamlet'}
|
||||
];
|
||||
|
||||
knex.insert({name: 'Old Books'}, 'id')
|
||||
.into('catalogues')
|
||||
.transacting(trx)
|
||||
.then(function(ids) {
|
||||
return Promise.map(books, function(book) {
|
||||
book.catalogue_id = ids[0];
|
||||
|
||||
// Some validation could take place here.
|
||||
|
||||
return knex.insert(info).into('books').transacting(trx);
|
||||
});
|
||||
})
|
||||
.then(trx.commit)
|
||||
.catch(trx.rollback);
|
||||
})
|
||||
.then(function(inserts) {
|
||||
console.log(inserts.length + ' new books saved.');
|
||||
})
|
||||
.catch(function(error) {
|
||||
// If we get here, that means that neither the 'Old Books' catalogues insert,
|
||||
// nor any of the books inserts will have taken place.
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
knex.schema.createTable('users', function (table) {
|
||||
table.increments();
|
||||
table.string('name');
|
||||
table.timestamps();
|
||||
});
|
||||
|
||||
knex.schema.renameTable('users', 'old_users');
|
||||
|
||||
knex.schema.dropTable('users');
|
||||
|
||||
knex.schema.hasTable('users').then(function(exists) {
|
||||
if (!exists) {
|
||||
return knex.schema.createTable('users', function(t) {
|
||||
t.increments('id').primary();
|
||||
t.string('first_name', 100);
|
||||
t.string('last_name', 100);
|
||||
t.text('bio');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
var tableName: string;
|
||||
var columnName: string;
|
||||
knex.schema.hasColumn(tableName, columnName);
|
||||
|
||||
knex.schema.dropTableIfExists('users');
|
||||
|
||||
knex.schema.table('users', function (table) {
|
||||
table.dropColumn('name');
|
||||
table.string('first_name');
|
||||
table.string('last_name');
|
||||
});
|
||||
|
||||
knex.schema.raw("SET sql_mode='TRADITIONAL'")
|
||||
.table('users', function (table) {
|
||||
table.dropColumn('name');
|
||||
table.string('first_name');
|
||||
table.string('last_name');
|
||||
});
|
||||
|
||||
knex('users')
|
||||
.select(knex.raw('count(*) as user_count, status'))
|
||||
.where(knex.raw(1))
|
||||
.orWhere(knex.raw('status <> ?', [1]))
|
||||
.groupBy('status');
|
||||
|
||||
knex.raw('select * from users where id = ?', [1]).then(function(resp) {
|
||||
// ...
|
||||
});
|
||||
|
||||
(() => {
|
||||
var subcolumn = knex.raw('select avg(salary) from employee where dept_no = e.dept_no')
|
||||
.wrap('(', ') avg_sal_dept');
|
||||
|
||||
knex.select('e.lastname', 'e.salary', subcolumn)
|
||||
.from('employee as e')
|
||||
.whereRaw('dept_no = e.dept_no');
|
||||
})();
|
||||
|
||||
(() => {
|
||||
var subcolumn = knex.avg('salary')
|
||||
.from('employee')
|
||||
.whereRaw('dept_no = e.dept_no')
|
||||
.as('avg_sal_dept');
|
||||
|
||||
knex.select('e.lastname', 'e.salary', subcolumn)
|
||||
.from('employee as e')
|
||||
.whereRaw('dept_no = e.dept_no');
|
||||
})();
|
||||
|
||||
var x: number;
|
||||
knex.select('name').from('users')
|
||||
.where('id', '>', 20)
|
||||
.andWhere('id', '<', 200)
|
||||
.limit(10)
|
||||
.offset(x)
|
||||
.then(function(rows: any) {
|
||||
return _.pluck(rows, 'name');
|
||||
})
|
||||
.then(function(names: any) {
|
||||
return knex.select('id').from('nicknames').whereIn('nickname', names);
|
||||
})
|
||||
.then(function(rows) {
|
||||
console.log(rows);
|
||||
})
|
||||
.catch(function(error) {
|
||||
console.error(error)
|
||||
});
|
||||
|
||||
knex.select('*').from('users').where({name: 'Tim'})
|
||||
.then(function(rows) {
|
||||
return knex.insert({user_id: rows[0].id, name: 'Test'}, 'id').into('accounts');
|
||||
}).then(function(id) {
|
||||
console.log('Inserted Account ' + id);
|
||||
}).catch(function(error) {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
knex.insert({id: 1, name: 'Test'}, 'id').into('accounts')
|
||||
.catch(function(error) {
|
||||
console.error(error);
|
||||
}).then(function() {
|
||||
return knex.select('*').from('accounts').where('id', 1);
|
||||
}).then(function(rows) {
|
||||
console.log(rows[0]);
|
||||
}).catch(function(error) {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
var query: any;
|
||||
query.then(function(x: any) {
|
||||
// doSideEffectsHere(x);
|
||||
return x;
|
||||
});
|
||||
|
||||
knex.select('name').from('users').limit(10).map(function(row: any) {
|
||||
return row.name;
|
||||
}).then(function(names) {
|
||||
console.log(names);
|
||||
}).catch(function(e) {
|
||||
console.error(e);
|
||||
});
|
||||
|
||||
knex.select('name').from('users').limit(10).reduce(function(memo: any, row: any) {
|
||||
memo.names.push(row.name);
|
||||
memo.count++;
|
||||
return memo;
|
||||
}, {count: 0, names: []}).then(function(obj) {
|
||||
console.log(obj);
|
||||
}).catch(function(e) {
|
||||
console.error(e);
|
||||
});
|
||||
|
||||
knex.select('name').from('users')
|
||||
.limit(10)
|
||||
.bind(console)
|
||||
.then(console.log)
|
||||
.catch(console.error);
|
||||
|
||||
var values: any[];
|
||||
// Without return:
|
||||
knex.insert(values).into('users')
|
||||
.then(function() {
|
||||
return {inserted: true};
|
||||
});
|
||||
|
||||
knex.insert(values).into('users').return({inserted: true});
|
||||
|
||||
knex.select('name').from('users')
|
||||
.where('id', '>', 20)
|
||||
.andWhere('id', '<', 200)
|
||||
.limit(10)
|
||||
.offset(x)
|
||||
.exec(function(err: any, rows: any[]) {
|
||||
if (err) return console.error(err);
|
||||
knex.select('id').from('nicknames').whereIn('nickname', _.pluck(rows, 'name'))
|
||||
.exec(function(err: any, rows: any[]) {
|
||||
if (err) return console.error(err);
|
||||
console.log(rows);
|
||||
});
|
||||
});
|
||||
|
||||
// Retrieve the stream:
|
||||
var stream = knex.select('*').from('users').stream();
|
||||
var writableStream: any;
|
||||
stream.pipe(writableStream);
|
||||
|
||||
// With options:
|
||||
var stream = knex.select('*').from('users').stream({highWaterMark: 5});
|
||||
stream.pipe(writableStream);
|
||||
|
||||
// Use as a promise:
|
||||
(() => {
|
||||
|
||||
var stream = knex.select('*').from('users').where(knex.raw('id = ?', [1])).stream(function(stream: any) {
|
||||
stream.pipe(writableStream);
|
||||
}).then(function() {
|
||||
// ...
|
||||
}).catch(function(e: Error) {
|
||||
console.error(e);
|
||||
});
|
||||
|
||||
})();
|
||||
|
||||
var stream = knex.select('*').from('users').pipe(writableStream);
|
||||
var app: any;
|
||||
|
||||
knex.select('*')
|
||||
.from('users')
|
||||
.on('query', function(data: any) {
|
||||
app.log(data);
|
||||
})
|
||||
.then(function() {
|
||||
// ...
|
||||
});
|
||||
|
||||
knex.select('*').from('users').where(knex.raw('id = ?', [1])).toString();
|
||||
|
||||
knex.select('*').from('users').where(knex.raw('id = ?', [1])).toSQL();
|
||||
|
||||
//
|
||||
// Migrations
|
||||
//
|
||||
var config = { };
|
||||
knex.migrate.make(name, config);
|
||||
knex.migrate.make(name);
|
||||
|
||||
knex.migrate.latest(config);
|
||||
knex.migrate.latest();
|
||||
|
||||
knex.migrate.rollback(config);
|
||||
knex.migrate.rollback();
|
||||
|
||||
knex.migrate.currentversion(config);
|
||||
knex.migrate.currentversion();
|
||||
|
||||
knex.seed.make(name, config);
|
||||
knex.seed.make(name);
|
||||
|
||||
knex.seed.run(config);
|
||||
knex.seed.run();
|
||||
457
knex/knex.d.ts
vendored
Normal file
457
knex/knex.d.ts
vendored
Normal file
@@ -0,0 +1,457 @@
|
||||
// Type definitions for Knex.js
|
||||
// Project: https://github.com/tgriesser/knex
|
||||
// Definitions by: Qubo <https://github.com/tkQubo>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../bluebird/bluebird.d.ts" />
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
|
||||
declare module "knex" {
|
||||
import Promise = require("bluebird");
|
||||
import events = require("events");
|
||||
|
||||
type Callback = Function;
|
||||
type Client = Function;
|
||||
type Value = string|number|boolean|Date;
|
||||
type ColumnName = string|Raw|QueryBuilder;
|
||||
|
||||
module KnexStatic {
|
||||
interface ConfigStatic { }
|
||||
}
|
||||
|
||||
interface KnexStatic {
|
||||
(config: Config): Knex;
|
||||
}
|
||||
|
||||
interface Knex extends QueryInterface { }
|
||||
|
||||
interface Knex {
|
||||
(tableName?: string): QueryBuilder;
|
||||
VERSION: string;
|
||||
__knex__: string;
|
||||
|
||||
raw: RawBuilder;
|
||||
transaction: <R>(transactionScope: ((trx: Transaction) => void)) => Promise<any>;
|
||||
destroy(callback: Function): void;
|
||||
destroy(): Promise<void>;
|
||||
|
||||
client: any;
|
||||
migrate: any;
|
||||
seed: any;
|
||||
fn: any;
|
||||
}
|
||||
|
||||
//
|
||||
// QueryInterface
|
||||
//
|
||||
|
||||
interface QueryInterface {
|
||||
select: Select;
|
||||
as: As;
|
||||
columns: Select;
|
||||
column: Select;
|
||||
from: Table;
|
||||
into: Table;
|
||||
table: Table;
|
||||
distinct: Distinct;
|
||||
|
||||
// Joins
|
||||
join: Join;
|
||||
joinRaw: JoinRaw;
|
||||
innerJoin: Join;
|
||||
leftJoin: Join;
|
||||
leftOuterJoin: Join;
|
||||
rightJoin: Join;
|
||||
rightOuterJoin: Join;
|
||||
outerJoin: Join;
|
||||
fullOuterJoin: Join;
|
||||
crossJoin: Join;
|
||||
|
||||
// Wheres
|
||||
where: Where;
|
||||
andWhere: Where;
|
||||
orWhere: Where;
|
||||
whereRaw: WhereRaw;
|
||||
whereWrapped: WhereWrapped;
|
||||
havingWrapped: WhereWrapped;
|
||||
orWhereRaw: WhereRaw;
|
||||
whereExists: WhereExists;
|
||||
orWhereExists: WhereExists;
|
||||
whereNotExists: WhereExists;
|
||||
orWhereNotExists: WhereExists;
|
||||
whereIn: WhereIn;
|
||||
orWhereIn: WhereIn;
|
||||
whereNotIn: WhereIn;
|
||||
orWhereNotIn: WhereIn;
|
||||
whereNull: WhereNull;
|
||||
orWhereNull: WhereNull;
|
||||
whereNotNull: WhereNull;
|
||||
orWhereNotNull: WhereNull;
|
||||
whereBetween: WhereBetween;
|
||||
whereNotBetween: WhereBetween;
|
||||
orWhereBetween: WhereBetween;
|
||||
orWhereNotBetween: WhereBetween;
|
||||
|
||||
// Group by
|
||||
groupBy: GroupBy;
|
||||
groupByRaw: RawQueryBuilder;
|
||||
|
||||
// Order by
|
||||
orderBy: OrderBy;
|
||||
orderByRaw: RawQueryBuilder;
|
||||
|
||||
// Union
|
||||
union: Union;
|
||||
unionAll(callback: Function): QueryBuilder;
|
||||
|
||||
// Having
|
||||
having: Having;
|
||||
havingRaw: RawQueryBuilder;
|
||||
orHaving: Having;
|
||||
orHavingRaw: RawQueryBuilder;
|
||||
|
||||
// Paging
|
||||
offset(offset: number): QueryBuilder;
|
||||
limit(limit: number): QueryBuilder;
|
||||
|
||||
// Aggregation
|
||||
count(columnName?: string): QueryBuilder;
|
||||
min(columnName: string): QueryBuilder;
|
||||
max(columnName: string): QueryBuilder;
|
||||
sum(columnName: string): QueryBuilder;
|
||||
avg(columnName: string): QueryBuilder;
|
||||
increment(columnName: string, amount?: number): QueryBuilder;
|
||||
decrement(columnName: string, amount?: number): QueryBuilder;
|
||||
|
||||
// Others
|
||||
first(...columns: string[]): QueryBuilder;
|
||||
|
||||
debug(enabled?: boolean): QueryBuilder;
|
||||
pluck(column: string): QueryBuilder;
|
||||
|
||||
insert(data: any, returning?: string): QueryBuilder;
|
||||
update(data: any, returning?: string): QueryBuilder;
|
||||
update(columnName: string, value: Value, returning?: string): QueryBuilder;
|
||||
returning(column: string): QueryBuilder;
|
||||
|
||||
del(returning?: string): QueryBuilder;
|
||||
delete(returning?: string): QueryBuilder;
|
||||
truncate(): QueryBuilder;
|
||||
|
||||
transacting(trx: Transaction): QueryBuilder;
|
||||
connection(connection: any): QueryBuilder;
|
||||
}
|
||||
|
||||
interface As {
|
||||
(columnName: string): QueryBuilder;
|
||||
}
|
||||
|
||||
interface Select extends ColumnNameQueryBuilder {
|
||||
}
|
||||
|
||||
interface Table {
|
||||
(tableName: string): QueryBuilder;
|
||||
(callback: Function): QueryBuilder;
|
||||
}
|
||||
|
||||
interface Distinct extends ColumnNameQueryBuilder {
|
||||
}
|
||||
|
||||
interface Join {
|
||||
(raw: Raw): QueryBuilder;
|
||||
(tableName: string, callback: Function): QueryBuilder;
|
||||
(tableName: string, column1: string, column2: string): QueryBuilder;
|
||||
(tableName: string, column1: string, raw: Raw): QueryBuilder;
|
||||
(tableName: string, column1: string, operator: string, column2: string): QueryBuilder;
|
||||
}
|
||||
|
||||
interface JoinRaw {
|
||||
(tableName: string, binding?: Value): QueryBuilder;
|
||||
}
|
||||
|
||||
interface Where extends WhereRaw, WhereWrapped, WhereNull {
|
||||
(object: Object): QueryBuilder;
|
||||
(columnName: string, value: Value): QueryBuilder;
|
||||
(columnName: string, operator: string, value: Value): QueryBuilder;
|
||||
(columnName: string, operator: string, query: QueryBuilder): QueryBuilder;
|
||||
}
|
||||
|
||||
interface WhereRaw extends RawQueryBuilder {
|
||||
(condition: boolean): QueryBuilder;
|
||||
}
|
||||
|
||||
interface WhereWrapped {
|
||||
(callback: Function): QueryBuilder;
|
||||
}
|
||||
|
||||
interface WhereNull {
|
||||
(columnName: string): QueryBuilder;
|
||||
}
|
||||
|
||||
interface WhereIn {
|
||||
(columnName: string, values: Value[]): QueryBuilder;
|
||||
(columnName: string, callback: Function): QueryBuilder;
|
||||
(columnName: string, query: QueryBuilder): QueryBuilder;
|
||||
}
|
||||
|
||||
interface WhereBetween {
|
||||
(columnName: string, range: [Value, Value]): QueryBuilder;
|
||||
}
|
||||
|
||||
interface WhereExists {
|
||||
(callback: Function): QueryBuilder;
|
||||
(query: QueryBuilder): QueryBuilder;
|
||||
}
|
||||
|
||||
interface WhereNull {
|
||||
(columnName: string): QueryBuilder;
|
||||
}
|
||||
|
||||
interface WhereIn {
|
||||
(columnName: string, values: Value[]): QueryBuilder;
|
||||
}
|
||||
|
||||
interface GroupBy extends RawQueryBuilder, ColumnNameQueryBuilder {
|
||||
}
|
||||
|
||||
interface OrderBy {
|
||||
(columnName: string, direction?: string): QueryBuilder;
|
||||
}
|
||||
|
||||
interface Union {
|
||||
(callback: Function, wrap?: boolean): QueryBuilder;
|
||||
(callbacks: Function[], wrap?: boolean): QueryBuilder;
|
||||
(...callbacks: Function[]): QueryBuilder;
|
||||
// (...callbacks: Function[], wrap?: boolean): QueryInterface;
|
||||
}
|
||||
|
||||
interface Having extends RawQueryBuilder, WhereWrapped {
|
||||
(tableName: string, column1: string, operator: string, column2: string): QueryBuilder;
|
||||
}
|
||||
|
||||
// commons
|
||||
|
||||
interface ColumnNameQueryBuilder {
|
||||
(...columnNames: ColumnName[]): QueryBuilder;
|
||||
(columnNames: ColumnName[]): QueryBuilder;
|
||||
}
|
||||
|
||||
interface RawQueryBuilder {
|
||||
(sql: string, ...bindings: Value[]): QueryBuilder;
|
||||
(sql: string, bindings: Value[]): QueryBuilder;
|
||||
(raw: Raw): QueryBuilder;
|
||||
}
|
||||
|
||||
// Raw
|
||||
|
||||
interface Raw extends events.EventEmitter, ChainableInterface {
|
||||
wrap(before: string, after: string): Raw;
|
||||
}
|
||||
|
||||
interface RawBuilder {
|
||||
(value: Value): Raw;
|
||||
(sql: string, ...bindings: Value[]): Raw;
|
||||
(sql: string, bindings: Value[]): Raw;
|
||||
}
|
||||
|
||||
//
|
||||
// QueryBuilder
|
||||
//
|
||||
|
||||
interface QueryBuilder extends QueryInterface, ChainableInterface {
|
||||
or: QueryBuilder;
|
||||
and: QueryBuilder;
|
||||
|
||||
//TODO: Promise?
|
||||
columnInfo(column?: string): Promise<ColumnInfo>;
|
||||
|
||||
forUpdate(): QueryBuilder;
|
||||
forShare(): QueryBuilder;
|
||||
|
||||
toSQL(): Sql;
|
||||
|
||||
on(event: string, callback: Function): QueryBuilder;
|
||||
}
|
||||
|
||||
interface Sql {
|
||||
method: string;
|
||||
options: any;
|
||||
bindings: Value[];
|
||||
sql: string;
|
||||
}
|
||||
|
||||
//
|
||||
// Chainable interface
|
||||
//
|
||||
|
||||
interface ChainableInterface extends Promise<any> {
|
||||
toQuery(): string;
|
||||
options(options: any): QueryBuilder;
|
||||
stream(options?: any, callback?: (builder: QueryBuilder) => any): QueryBuilder;
|
||||
stream(callback?: (builder: QueryBuilder) => any): QueryBuilder;
|
||||
pipe(writable: any): QueryBuilder;
|
||||
exec(callback: Function): QueryBuilder;
|
||||
}
|
||||
|
||||
interface Transaction extends QueryBuilder {
|
||||
commit: any;
|
||||
rollback: any;
|
||||
}
|
||||
|
||||
//
|
||||
// Schema builder
|
||||
//
|
||||
|
||||
interface Knex {
|
||||
schema: SchemaBuilder;
|
||||
}
|
||||
|
||||
interface SchemaBuilder {
|
||||
createTable(tableName: string, callback: (tableBuilder: CreateTableBuilder) => any): Promise<void>;
|
||||
renameTable(oldTableName: string, newTableName: string): Promise<void>;
|
||||
dropTable(tableName: string): Promise<void>;
|
||||
hasTable(tableName: string): Promise<boolean>;
|
||||
hasColumn(tableName: string, columnName: string): Promise<boolean>;
|
||||
table(tableName: string, callback: (tableBuilder: AlterTableBuilder) => any): Promise<void>;
|
||||
dropTableIfExists(tableName: string): Promise<void>;
|
||||
raw(statement: string): SchemaBuilder;
|
||||
}
|
||||
|
||||
interface TableBuilder {
|
||||
increments(columnName?: string): ColumnBuilder;
|
||||
dropColumn(columnName: string): TableBuilder;
|
||||
dropColumns(...columnNames: string[]): TableBuilder;
|
||||
renameColumn(from: string, to: string): ColumnBuilder;
|
||||
integer(columnName: string): ColumnBuilder;
|
||||
bigInteger(columnName: string): ColumnBuilder;
|
||||
text(columnName: string, textType?: string): ColumnBuilder;
|
||||
string(columnName: string, length?: number): ColumnBuilder;
|
||||
float(columnName: string, precision?: number, scale?: number): ColumnBuilder;
|
||||
decimal(columnName: string, precision?: number, scale?: number): ColumnBuilder;
|
||||
boolean(columnName: string): ColumnBuilder;
|
||||
date(columnName: string): ColumnBuilder;
|
||||
dateTime(columnName: string): ColumnBuilder;
|
||||
time(columnName: string): ColumnBuilder;
|
||||
timestamp(columnName: string): ColumnBuilder;
|
||||
timestamps(): ColumnBuilder;
|
||||
binary(columnName: string): ColumnBuilder;
|
||||
enum(columnName: string): ColumnBuilder;
|
||||
enu(columnName: string): ColumnBuilder;
|
||||
json(columnName: string): ColumnBuilder;
|
||||
uuid(columnName: string): ColumnBuilder;
|
||||
comment(val: string): TableBuilder;
|
||||
specificType(columnName: string, type: string): ColumnBuilder;
|
||||
}
|
||||
|
||||
interface CreateTableBuilder extends TableBuilder {
|
||||
}
|
||||
|
||||
interface MySqlTableBuilder extends CreateTableBuilder {
|
||||
engine(val: string): CreateTableBuilder;
|
||||
charset(val: string): CreateTableBuilder;
|
||||
collate(val: string): CreateTableBuilder;
|
||||
}
|
||||
|
||||
interface AlterTableBuilder extends TableBuilder {
|
||||
}
|
||||
|
||||
interface MySqlAlterTableBuilder extends AlterTableBuilder {
|
||||
}
|
||||
|
||||
interface ColumnBuilder {
|
||||
index(indexName?: string): ColumnBuilder;
|
||||
primary(): ColumnBuilder;
|
||||
unique(): ColumnBuilder;
|
||||
references(columnName: string): ReferencingColumnBuilder;
|
||||
onDelete(command: string): ColumnBuilder;
|
||||
onUpdate(command: string): ColumnBuilder;
|
||||
defaultTo(value: Value): ColumnBuilder;
|
||||
unsigned(): ColumnBuilder;
|
||||
notNullable(): ColumnBuilder;
|
||||
nullable(): ColumnBuilder;
|
||||
comment(value: string): ColumnBuilder;
|
||||
}
|
||||
|
||||
interface PostgreSqlColumnBuilder extends ColumnBuilder {
|
||||
index(indexName?: string, indexType?: string): ColumnBuilder;
|
||||
}
|
||||
|
||||
interface ReferencingColumnBuilder {
|
||||
inTable(tableName: string): ColumnBuilder;
|
||||
}
|
||||
|
||||
interface AlterColumnBuilder extends ColumnBuilder {
|
||||
}
|
||||
|
||||
interface MySqlAlterColumnBuilder extends AlterColumnBuilder {
|
||||
first(): AlterColumnBuilder;
|
||||
after(columnName: string): AlterColumnBuilder;
|
||||
}
|
||||
|
||||
//
|
||||
// Configurations
|
||||
//
|
||||
|
||||
interface ColumnInfo {
|
||||
defaultValue: Value;
|
||||
type: string;
|
||||
maxLength: number;
|
||||
nullable: boolean;
|
||||
}
|
||||
|
||||
interface Config {
|
||||
client?: string;
|
||||
dialect?: string;
|
||||
connection: string|ConnectionConfig|
|
||||
Sqlite3ConnectionConfig|SocketConnectionConfig;
|
||||
pool?: PoolConfig;
|
||||
migrations?: MigrationConfig;
|
||||
}
|
||||
|
||||
interface ConnectionConfig {
|
||||
host: string;
|
||||
user: string;
|
||||
password: string;
|
||||
database: string;
|
||||
debug?: boolean;
|
||||
}
|
||||
|
||||
/** Used with SQLite3 adapter */
|
||||
interface Sqlite3ConnectionConfig {
|
||||
filename: string;
|
||||
debug?: boolean;
|
||||
}
|
||||
|
||||
interface SocketConnectionConfig {
|
||||
socketPath: string;
|
||||
user: string;
|
||||
password: string;
|
||||
database: string;
|
||||
debug?: boolean;
|
||||
}
|
||||
|
||||
interface PoolConfig {
|
||||
name?: string;
|
||||
create?: Function;
|
||||
destroy?: Function;
|
||||
min?: number;
|
||||
max?: number;
|
||||
refreshIdle?: boolean;
|
||||
idleTimeoutMillis?: number;
|
||||
reapIntervalMillis?: number;
|
||||
returnToHead?: boolean;
|
||||
priorityRange?: number;
|
||||
validate?: Function;
|
||||
log?: boolean;
|
||||
}
|
||||
|
||||
interface MigrationConfig {
|
||||
database?: string;
|
||||
directory?: string;
|
||||
extension?: string;
|
||||
tableName?: string;
|
||||
}
|
||||
|
||||
var _: KnexStatic;
|
||||
export = _;
|
||||
}
|
||||
@@ -26,3 +26,39 @@ sourceItems.push(9);
|
||||
|
||||
sourceItems.push(10);
|
||||
// evenSquares now contains [36, 16, 4, 100]
|
||||
|
||||
// Testing mapping options
|
||||
|
||||
interface IComplexItem {
|
||||
value: string;
|
||||
dispose(): void;
|
||||
}
|
||||
|
||||
var complexItems = sourceItems.map({
|
||||
mapping: x => {
|
||||
var item: IComplexItem = {
|
||||
value: (x * x).toString(),
|
||||
dispose: () => { }
|
||||
};
|
||||
|
||||
return item;
|
||||
},
|
||||
disposeItem: (item: IComplexItem) => item.dispose()
|
||||
});
|
||||
|
||||
var complexItems2 = sourceItems.map({
|
||||
mappingWithDisposeCallback: x => {
|
||||
return {
|
||||
mappedValue: (x * x).toString(),
|
||||
dispose: () => { }
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// Test disposal
|
||||
|
||||
evenSquares.dispose();
|
||||
|
||||
complexItems.dispose();
|
||||
|
||||
complexItems2.dispose();
|
||||
|
||||
21
knockout.projections/knockout.projections.d.ts
vendored
21
knockout.projections/knockout.projections.d.ts
vendored
@@ -5,8 +5,21 @@
|
||||
|
||||
/// <reference path="../knockout/knockout.d.ts" />
|
||||
|
||||
interface KnockoutObservableArrayFunctions<T> {
|
||||
|
||||
map<TResult>(mapping: (value: T) => TResult): KnockoutObservableArray<TResult>;
|
||||
filter(predicate: (value: T) => boolean): KnockoutObservableArray<T>;
|
||||
interface KnockoutMappedObservableArray<T> extends KnockoutObservableArray<T>, KnockoutSubscription {
|
||||
}
|
||||
|
||||
interface KnockoutObservableArrayFunctions<T> {
|
||||
map<TResult>(mappingOptions: {
|
||||
mappingWithDisposeCallback: (value: T) => {
|
||||
mappedValue: TResult;
|
||||
dispose: () => void;
|
||||
};
|
||||
}): KnockoutMappedObservableArray<TResult>;
|
||||
map<TResult>(mappingOptions: {
|
||||
mapping: (value: T) => TResult;
|
||||
disposeItem?: (mappedItem: TResult) => void;
|
||||
}): KnockoutMappedObservableArray<TResult>;
|
||||
map<TResult>(mappingOptions: (value: T) => TResult): KnockoutMappedObservableArray<TResult>;
|
||||
|
||||
filter(predicate: (value: T) => boolean): KnockoutMappedObservableArray<T>;
|
||||
}
|
||||
|
||||
2
knockout/knockout.d.ts
vendored
2
knockout/knockout.d.ts
vendored
@@ -574,7 +574,7 @@ interface KnockoutComputedContext {
|
||||
declare module KnockoutComponentTypes {
|
||||
|
||||
interface Config {
|
||||
viewModel: ViewModelFunction | ViewModelSharedInstance | ViewModelFactoryFunction | AMDModule;
|
||||
viewModel?: ViewModelFunction | ViewModelSharedInstance | ViewModelFactoryFunction | AMDModule;
|
||||
template: string | Node[]| DocumentFragment | TemplateElement | AMDModule;
|
||||
}
|
||||
|
||||
|
||||
892
leaflet/leaflet.d.ts
vendored
892
leaflet/leaflet.d.ts
vendored
File diff suppressed because it is too large
Load Diff
28
less-middleware/less-middleware-tests.ts
Normal file
28
less-middleware/less-middleware-tests.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
/// <reference path="less-middleware.d.ts" />
|
||||
|
||||
import express = require('express');
|
||||
import lessMiddleware = require('less-middleware');
|
||||
var app = express();
|
||||
|
||||
app.use(lessMiddleware('public', {
|
||||
cacheFile: null,
|
||||
debug: false,
|
||||
dest: 'dest',
|
||||
force: false,
|
||||
once: false,
|
||||
pathRoot: 'root',
|
||||
postprocess: {
|
||||
css: function(css, req) { return css; },
|
||||
},
|
||||
preprocess: {
|
||||
less: function(src, req) { return src; },
|
||||
path: function(pathname, req) { return pathname; },
|
||||
importPaths: function(paths, req) { return paths; }
|
||||
},
|
||||
render: {
|
||||
compress: 'auto',
|
||||
yuicompress: false,
|
||||
paths: ['foo', 'bar']
|
||||
},
|
||||
storeCss: function(css, req, next) {},
|
||||
}));
|
||||
108
less-middleware/less-middleware.d.ts
vendored
Normal file
108
less-middleware/less-middleware.d.ts
vendored
Normal file
@@ -0,0 +1,108 @@
|
||||
// Type definitions for less-middleware 2.0.1
|
||||
// Project: https://github.com/emberfeather/less.js-middleware
|
||||
// Definitions by: Federico Bond <https://github.com/federicobond/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/* =================== USAGE ===================
|
||||
|
||||
import lessMiddleware = require('less-middleware');
|
||||
app.use(lessMiddleware(source, options));
|
||||
|
||||
=============================================== */
|
||||
|
||||
/// <reference path="../express/express.d.ts" />
|
||||
|
||||
declare module "less-middleware" {
|
||||
import express = require('express');
|
||||
|
||||
/**
|
||||
* Middleware created to allow processing of Less files for Connect JS framework
|
||||
* and by extension the Express JS framework
|
||||
*/
|
||||
function lessMiddleware(source: string, options?: {
|
||||
/**
|
||||
* Show more verbose logging?
|
||||
*/
|
||||
debug?: boolean;
|
||||
|
||||
/**
|
||||
* Destination directory to output the compiled .css files.
|
||||
*/
|
||||
dest?: string;
|
||||
|
||||
/**
|
||||
* Always re-compile less files on each request.
|
||||
*/
|
||||
force?: boolean;
|
||||
|
||||
/**
|
||||
* Only recompile once after each server restart.
|
||||
* Useful for reducing disk i/o on production.
|
||||
*/
|
||||
once?: boolean;
|
||||
|
||||
/**
|
||||
* Common root of the source and destination.
|
||||
* It is prepended to both the source and destination before being used.
|
||||
*/
|
||||
pathRoot?: string;
|
||||
|
||||
/**
|
||||
* Object containing functions relevant to preprocessing data.
|
||||
*/
|
||||
postprocess?: {
|
||||
|
||||
/**
|
||||
* Function that modifies the compiled css output before being stored.
|
||||
*/
|
||||
css?(css: string, req: express.Request): string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Object containing functions relevant to preprocessing data.
|
||||
*/
|
||||
preprocess?: {
|
||||
|
||||
/**
|
||||
* Function that modifies the raw less output before being parsed and compiled.
|
||||
*/
|
||||
less?(css: string, req: express.Request): string;
|
||||
|
||||
/**
|
||||
* Function that modifies the less pathname before being loaded from the filesystem.
|
||||
*/
|
||||
path?(pathname: string, req: express.Request): string;
|
||||
|
||||
/**
|
||||
* Function that modifies the import paths used by the less parser per request.
|
||||
*/
|
||||
importPaths?(paths: string[], req: express.Request): string[];
|
||||
};
|
||||
|
||||
/**
|
||||
* Options for the less render.
|
||||
*/
|
||||
render?: {
|
||||
|
||||
compress?: string;
|
||||
yuicompress?: boolean;
|
||||
paths?: string[];
|
||||
};
|
||||
|
||||
/**
|
||||
* Function that is in charge of storing the css in the filesystem.
|
||||
*/
|
||||
storeCss?(pathname: string, css: string, req: express.Request, next: Function): void;
|
||||
|
||||
/**
|
||||
* Path to a JSON file that will be used to cache less data across server restarts.
|
||||
* This can greatly speed up initial load time after a server restart - if the less
|
||||
* files haven't changed and the css files still exist, specifying this option will
|
||||
* mean that the less files don't need to be recompiled after a server restart.
|
||||
*/
|
||||
cacheFile?: string;
|
||||
|
||||
}): express.RequestHandler;
|
||||
|
||||
export = lessMiddleware;
|
||||
}
|
||||
@@ -2,33 +2,12 @@
|
||||
|
||||
import less = require("less");
|
||||
|
||||
declare var __dirname: string;
|
||||
|
||||
less.render('.class { width: (1 + 1) }', (e, css) => console.log(css));
|
||||
|
||||
var parser: less.Parser = new less.Parser;
|
||||
|
||||
parser.parse('.class { width: (1 + 1) }', function (err, tree) {
|
||||
if (err) return console.error(err);
|
||||
tree.toCSS();
|
||||
less.render(".class { width: (1 + 1) }").then((output) => {
|
||||
console.log(output.css);
|
||||
});
|
||||
|
||||
var parser2 = new less.Parser({
|
||||
paths: ['.', './lib'],
|
||||
filename: 'style.less'
|
||||
less.render("fail").then((output) => {
|
||||
throw new Error("promise should have been rejected");
|
||||
}, () => {
|
||||
console.log("rejected as expected");
|
||||
});
|
||||
|
||||
parser2.parse('.class { width: (1 + 1) }', (e, tree) => tree.toCSS({ compress: true }));
|
||||
|
||||
var lessParser = new less.Parser({
|
||||
paths: [__dirname],
|
||||
filename: "out.less"
|
||||
});
|
||||
|
||||
lessParser.parse('.class { width: (1 + 1) }', function (err, tree) {
|
||||
tree.rules.forEach(function (rule) {
|
||||
if (rule.path) {
|
||||
console.log(rule.path);
|
||||
}
|
||||
});
|
||||
});
|
||||
591
less/less.d.ts
vendored
591
less/less.d.ts
vendored
@@ -1,556 +1,75 @@
|
||||
// Type definitions for LESS
|
||||
// Project: http://lesscss.org/
|
||||
// Definitions by: AndrewGaspar <https://github.com/AndrewGaspar>
|
||||
// Definitions by: Tom Hasner <https://github.com/thasner>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module less {
|
||||
class LessError {
|
||||
constructor(e: Error, env);
|
||||
declare module Less {
|
||||
// Promise definitions from ../es6-promise/es6-promise.d.ts
|
||||
interface Thenable<R> {
|
||||
then<U>(onFulfilled?: (value: R) => U | Thenable<U>, onRejected?: (error: any) => U | Thenable<U>): Thenable<U>;
|
||||
}
|
||||
|
||||
type: any;
|
||||
message: string;
|
||||
class Promise<R> implements Thenable<R> {
|
||||
constructor(callback: (resolve : (value?: R | Thenable<R>) => void, reject: (error?: any) => void) => void);
|
||||
|
||||
then<U>(onFulfilled?: (value: R) => U | Thenable<U>, onRejected?: (error: any) => U | Thenable<U>): Promise<U>;
|
||||
|
||||
catch<U>(onRejected?: (error: any) => U | Thenable<U>): Promise<U>;
|
||||
|
||||
finally<U>(finallyCallback: () => any): Promise<U>;
|
||||
}
|
||||
|
||||
interface RootFileInfo {
|
||||
filename: string;
|
||||
index;
|
||||
line: number;
|
||||
callLine: number;
|
||||
callExtract;
|
||||
stack;
|
||||
column;
|
||||
extract: any[];
|
||||
relativeUrls: boolean;
|
||||
rootpath: string;
|
||||
currentDirectory: string;
|
||||
entryPath: string;
|
||||
rootFilename: string;
|
||||
}
|
||||
|
||||
class PluginManager {
|
||||
constructor(less: LessStatic);
|
||||
}
|
||||
|
||||
interface Plugin {
|
||||
install: (less: LessStatic, pluginManager: PluginManager) => void;
|
||||
}
|
||||
|
||||
interface SourceMapOption {
|
||||
sourceMapURL: string;
|
||||
sourceMapBasepath: string;
|
||||
sourceMapRootpath: string;
|
||||
outputSourceFiles: boolean;
|
||||
sourceMapFileInline: boolean;
|
||||
}
|
||||
|
||||
interface Options {
|
||||
contents?;
|
||||
rootpath?: string;
|
||||
files?;
|
||||
paths?: string[];
|
||||
mime?: string;
|
||||
sourceMap?: SourceMapOption;
|
||||
filename?: string;
|
||||
optimization?: number;
|
||||
dumpLineNumbers?: boolean;
|
||||
strictImports?;
|
||||
entryPath?: string;
|
||||
relativeUrls?;
|
||||
errback? (path: string, paths: string[], callback: Function, env: Options);
|
||||
frames?;
|
||||
compress?: boolean;
|
||||
plugins: Plugin[];
|
||||
rootFileInfo?: RootFileInfo;
|
||||
}
|
||||
|
||||
export module tree {
|
||||
export module mixin { // TODO
|
||||
export class Call {
|
||||
|
||||
}
|
||||
|
||||
export class Definition extends Ruleset {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
export module functions {
|
||||
export function rgb(r: number, g: number, b: number): Color;
|
||||
export function rgba(r: number, g: number, b: number, a: number): Color;
|
||||
export function hsl(h: number, s?: number, l?: number): Color;
|
||||
export function hsla(h: number, s?: number, l?: number, a?: number): Color;
|
||||
export function hsv(h: number, s: number, v: number): Color;
|
||||
export function hsva(h: number, s: number, v: number, a: number): Color;
|
||||
export function hue(color: Color): Dimension;
|
||||
export function saturation(color: Color): Dimension;
|
||||
export function lightness(color: Color): Dimension;
|
||||
export function red(color: Color): Dimension;
|
||||
export function green(color: Color): Dimension;
|
||||
export function blue(color: Color): Dimension;
|
||||
export function alpha(color: Color): Dimension;
|
||||
export function luma(color: Color): Dimension;
|
||||
export function saturate(color: Color, amount: IValuableNumber): Color;
|
||||
export function desaturate(color: Color, amount: IValuableNumber): Color;
|
||||
export function lighten(color: Color, amount: IValuableNumber): Color;
|
||||
export function darken(color: Color, amount: IValuableNumber): Color;
|
||||
export function fadein(color: Color, amount: IValuableNumber): Color;
|
||||
export function fadeout(color: Color, amount: IValuableNumber): Color;
|
||||
export function fade(color: Color, amount: IValuableNumber): Color;
|
||||
export function spin(color: Color, amount: IValuableNumber): Color;
|
||||
export function mix(color1: Color, color2: Color, weight: Dimension): Color;
|
||||
export function greyscale(color: Color): Color;
|
||||
export function contrast(color: Color, dark?: Color, light?: Color, threshold?: IValuableNumber): Color;
|
||||
export function contrast(color: Color, dark?: Color, light?: Color, threshold?: number): Color;
|
||||
export function e(str: string): Anonymous;
|
||||
export function e(str: JavaScript): Anonymous;
|
||||
export function escape(str: IValuableString): Anonymous;
|
||||
export function unit(val: IValuableNumber, unit?: ICSSable): Dimension;
|
||||
export function round(n: Dimension, f?: IValuableNumber): Dimension;
|
||||
export function round(n: number, f?: IValuableNumber): number;
|
||||
export function ceil(n: number): number;
|
||||
export function ceil(n: Dimension): Dimension;
|
||||
export function floor(n: number): number;
|
||||
export function floor(n: Dimension): Dimension;
|
||||
export function argb(color: Color): Anonymous;
|
||||
export function percentage(n: IValuableNumber): Dimension;
|
||||
export function color(n: Quoted): Color;
|
||||
export function iscolor(n): Keyword;
|
||||
export function isnumber(n): Keyword;
|
||||
export function isstring(n): Keyword;
|
||||
export function iskeyword(n): Keyword;
|
||||
export function isurl(n): Keyword;
|
||||
export function ispixel(n): Keyword;
|
||||
export function ispercentage(n): Keyword;
|
||||
export function isem(n): Keyword;
|
||||
export function multiply(color1: Color, color2: Color): Color;
|
||||
export function screen(color1: Color, color2: Color): Color;
|
||||
export function overlay(color1: Color, color2: Color): Color;
|
||||
export function softlight(color1: Color, color2: Color): Color;
|
||||
export function hardlight(color1: Color, color2: Color): Color;
|
||||
export function difference(color1: Color, color2: Color): Color;
|
||||
export function exclusion(color1: Color, color2: Color): Color;
|
||||
export function average(color1: Color, color2: Color): Color;
|
||||
export function negation(color1: Color, color2: Color): Color;
|
||||
export function tint(color: Color, amount: Dimension): Color;
|
||||
export function shade(color: Color, amount: Dimension): Color;
|
||||
}
|
||||
|
||||
export var colors: any; // Could be module - got lazy
|
||||
|
||||
interface HasDebugInfo {
|
||||
debugInfo: DebugInfo;
|
||||
}
|
||||
|
||||
interface DebugInfo {
|
||||
lineNumber;
|
||||
fileName: string;
|
||||
}
|
||||
|
||||
interface HSL {
|
||||
h: number;
|
||||
s: number;
|
||||
l: number;
|
||||
a: number;
|
||||
}
|
||||
|
||||
interface DebugInfoFunction {
|
||||
(env: Options, ctx: HasDebugInfo): string;
|
||||
asComment(ctx: HasDebugInfo): string;
|
||||
asMediaQuery(ctx: HasDebugInfo): string;
|
||||
}
|
||||
|
||||
interface RuleContainer {
|
||||
[name: string]: Rule;
|
||||
}
|
||||
|
||||
interface ICSSable {
|
||||
toCSS(ctx?, env?: Options): string;
|
||||
}
|
||||
|
||||
interface IEvalable {
|
||||
eval(env: Options): IEvalable;
|
||||
}
|
||||
|
||||
interface IInjectable extends ICSSable, IEvalable {}
|
||||
|
||||
interface IOperable {
|
||||
operate(op: Operation, other: IOperable): IOperable;
|
||||
}
|
||||
|
||||
interface IComparable {
|
||||
compare(x: IComparable): number;
|
||||
}
|
||||
|
||||
interface IColorable {
|
||||
toColor(): Color;
|
||||
}
|
||||
|
||||
interface IValuableNumber {
|
||||
value: number;
|
||||
}
|
||||
|
||||
interface IValuableString {
|
||||
value: string;
|
||||
}
|
||||
|
||||
export class Color implements IOperable, IInjectable, IComparable {
|
||||
constructor(rgb: string, a: number);
|
||||
constructor(rgb: number[], a: number);
|
||||
|
||||
rgb: number[];
|
||||
alpha: number;
|
||||
eval(): Color;
|
||||
toCSS(): string;
|
||||
operate(op: Operation, other: Color): Color;
|
||||
operate(op: Operation, other: IColorable): Color;
|
||||
toHSL(): HSL;
|
||||
toARGB(): string;
|
||||
compare(x: Color): number;
|
||||
}
|
||||
|
||||
export class Directive implements IInjectable {
|
||||
constructor(name, value);
|
||||
|
||||
name;
|
||||
value: ICSSable;
|
||||
ruleset: Ruleset;
|
||||
|
||||
toCSS(ctx?, env?: Options): string;
|
||||
eval(env: Options): Directive;
|
||||
|
||||
variable(name);
|
||||
find();
|
||||
rulesets();
|
||||
}
|
||||
|
||||
export class Operation implements IEvalable {
|
||||
constructor(op, operands);
|
||||
|
||||
op: string;
|
||||
operands: IEvalable;
|
||||
|
||||
eval(env: Options): IEvalable;
|
||||
|
||||
operate(op: string, a: number, b: number): number;
|
||||
}
|
||||
|
||||
export class Dimension implements IColorable, IInjectable, IOperable, IComparable {
|
||||
constructor(value: number, unit: string);
|
||||
|
||||
value: number;
|
||||
unit: string;
|
||||
|
||||
eval(): Dimension;
|
||||
toColor(): Color;
|
||||
toCSS(): string;
|
||||
operate(op: Operation, other: Dimension): Dimension;
|
||||
compare(other: IComparable): number;
|
||||
}
|
||||
|
||||
export class Keyword implements IInjectable, IComparable {
|
||||
constructor(value: string);
|
||||
|
||||
value: string;
|
||||
|
||||
eval(): Keyword;
|
||||
toCSS(): string;
|
||||
compare(other: IComparable): number;
|
||||
|
||||
static True: Keyword;
|
||||
static False: Keyword;
|
||||
}
|
||||
|
||||
export class Variable implements IEvalable {
|
||||
constructor(name: string, index, file: string);
|
||||
|
||||
name: string;
|
||||
index;
|
||||
file: string;
|
||||
|
||||
eval(env: Options): IEvalable;
|
||||
}
|
||||
|
||||
export class AbstractRuleset implements IEvalable {
|
||||
selectors: Selector[];
|
||||
rules: any[];
|
||||
strictImports;
|
||||
|
||||
eval(env: Options): Ruleset;
|
||||
evalImports(env: Options): void;
|
||||
makeImportant(): Ruleset;
|
||||
matchArgs(args: any): boolean;
|
||||
resetCache(): void;
|
||||
variables(): RuleContainer;
|
||||
variable(): Rule;
|
||||
rulesets(): Ruleset[];
|
||||
find(selector: Selector, self: Rule): Rule[];
|
||||
joinSelectors(paths: string[], context: any[][], selectors: Selector[]): void;
|
||||
joinSelector(paths: string[], context: any[][], selector: Selector): void;
|
||||
mergeElementsOnToSelectors(elements: Element[], selectors: Selector[]): void;
|
||||
}
|
||||
|
||||
export class Ruleset extends AbstractRuleset {
|
||||
constructor(selectors: Selector[], rules: Rule[], strictImports);
|
||||
|
||||
toCSS(context?: any[][], env?: Options): string;
|
||||
}
|
||||
|
||||
export class Element implements IInjectable {
|
||||
constructor(combinator: Combinator, value, index);
|
||||
|
||||
combinator: Combinator;
|
||||
value;
|
||||
index;
|
||||
|
||||
eval(env: Options): Element;
|
||||
toCSS(env?: Options): string;
|
||||
}
|
||||
|
||||
export class Combinator implements ICSSable {
|
||||
constructor(value: string);
|
||||
|
||||
value: string;
|
||||
|
||||
toCSS(env?: Options): string;
|
||||
}
|
||||
|
||||
export class Selector implements IInjectable {
|
||||
constructor(elements: Element[]);
|
||||
|
||||
match(other: Selector): boolean;
|
||||
eval(env: Options): Selector;
|
||||
toCSS(env?: Options): string;
|
||||
}
|
||||
|
||||
export class Quoted implements IInjectable, IComparable {
|
||||
constructor(str: string, content: string, escaped: boolean, i);
|
||||
|
||||
escaped: boolean;
|
||||
value: string;
|
||||
quote: string;
|
||||
index;
|
||||
|
||||
toCSS(): string;
|
||||
eval(env: Options): Quoted;
|
||||
compare(x: IComparable): number;
|
||||
}
|
||||
|
||||
export class Expression implements IInjectable {
|
||||
constructor(value: IEvalable[]);
|
||||
|
||||
value: IEvalable[];
|
||||
|
||||
eval(env: Options): IEvalable;
|
||||
toCSS(env?: Options): string;
|
||||
}
|
||||
|
||||
export class Rule implements IInjectable {
|
||||
constructor(name: string, value?: Value, important?: string, index?, inline?: boolean);
|
||||
|
||||
name: string;
|
||||
value: Value;
|
||||
important: string;
|
||||
index;
|
||||
inline: boolean;
|
||||
|
||||
toCSS(env?: Options): string;
|
||||
eval(context): Rule;
|
||||
|
||||
makeImportant(): Rule;
|
||||
}
|
||||
|
||||
export class Shorthand implements IInjectable {
|
||||
constructor(a: ICSSable, b: ICSSable);
|
||||
|
||||
a: ICSSable;
|
||||
b: ICSSable;
|
||||
|
||||
toCSS(env?: Options): string;
|
||||
eval(): Shorthand;
|
||||
}
|
||||
|
||||
export class Call implements IInjectable {
|
||||
constructor(name: string, args: IEvalable[], index, filename: string);
|
||||
|
||||
name: string;
|
||||
args: IEvalable[];
|
||||
index;
|
||||
filename: string;
|
||||
|
||||
eval(env: Options): IEvalable;
|
||||
toCSS(env?: Options): string;
|
||||
}
|
||||
|
||||
export class URL implements IInjectable {
|
||||
constructor(val, rootpath: string);
|
||||
|
||||
value;
|
||||
rootpath: string;
|
||||
|
||||
toCSS(): string;
|
||||
eval(ctx): URL;
|
||||
}
|
||||
|
||||
export class Alpha implements IInjectable {
|
||||
constructor(val);
|
||||
|
||||
value;
|
||||
|
||||
toCSS(): string;
|
||||
eval(env: Options): Alpha;
|
||||
}
|
||||
|
||||
export class Import implements IInjectable {
|
||||
constructor(path, imports, features: ICSSable, once: boolean, index, rootpath);
|
||||
|
||||
once: boolean;
|
||||
index;
|
||||
features: ICSSable;
|
||||
rootpath;
|
||||
path: string;
|
||||
css: boolean;
|
||||
|
||||
toCSS(env?: Options): string;
|
||||
eval(env: Options): IEvalable;
|
||||
}
|
||||
|
||||
export class Comment implements IInjectable {
|
||||
constructor(value: string, silent);
|
||||
|
||||
value: string;
|
||||
silent: boolean;
|
||||
|
||||
toCSS(env?: Options): string;
|
||||
eval(): Comment;
|
||||
}
|
||||
|
||||
export class Anonymous implements IInjectable, IComparable {
|
||||
constructor(value: string);
|
||||
|
||||
value: string;
|
||||
|
||||
toCSS(): string;
|
||||
eval(): Anonymous;
|
||||
compare(x): number;
|
||||
}
|
||||
|
||||
export class Value implements IInjectable {
|
||||
constructor(value: IEvalable[]);
|
||||
|
||||
value: IEvalable[];
|
||||
is: string;
|
||||
|
||||
eval(env: Options): IEvalable;
|
||||
toCSS(env?: Options): string;
|
||||
}
|
||||
|
||||
export class JavaScript implements IEvalable {
|
||||
constructor(expression: string, index, escaped: boolean);
|
||||
|
||||
escaped: boolean;
|
||||
expression: string;
|
||||
index;
|
||||
|
||||
eval(env: Options): IEvalable;
|
||||
}
|
||||
|
||||
export class Assignment implements IInjectable {
|
||||
constructor(key: string, val);
|
||||
constructor(key: string, val: ICSSable);
|
||||
constructor(key: string, val: IEvalable);
|
||||
|
||||
key: string;
|
||||
value;
|
||||
|
||||
toCSS(): string;
|
||||
eval(env: Options): Assignment;
|
||||
}
|
||||
|
||||
export class Condition {
|
||||
constructor(op: string, l, r, i, negate: boolean);
|
||||
|
||||
op: string;
|
||||
lvalue;
|
||||
rvalue;
|
||||
index;
|
||||
negate: boolean;
|
||||
|
||||
eval(env: Options): boolean;
|
||||
}
|
||||
|
||||
export class Paren implements IInjectable {
|
||||
constructor(node: IInjectable);
|
||||
value: IInjectable;
|
||||
|
||||
toCSS(env?: Options): string;
|
||||
eval(env: Options): Paren;
|
||||
}
|
||||
|
||||
export class Media implements IInjectable {
|
||||
constructor(value, features);
|
||||
|
||||
selectors: Selector[];
|
||||
features: Value;
|
||||
ruleset: Ruleset;
|
||||
|
||||
toCSS(ctx?, env?: Options): string;
|
||||
eval(env: Options): IEvalable;
|
||||
|
||||
variable(name): Rule;
|
||||
rulesets(): Ruleset[];
|
||||
find(selector: Selector, self: Rule): Rule[];
|
||||
|
||||
emptySelectors(): Selector[];
|
||||
evalTop(env: Options): IEvalable;
|
||||
evalNested(env: Options): Ruleset;
|
||||
permute(arr: any[]): any[];
|
||||
bubbleSelectors(selectors: Selector[]): void;
|
||||
}
|
||||
|
||||
export class Ratio implements IInjectable {
|
||||
constructor(value: string);
|
||||
|
||||
value: string;
|
||||
|
||||
toCSS(env?: Options): string;
|
||||
eval(): Ratio;
|
||||
}
|
||||
|
||||
export class UnicodeDescriptor implements IInjectable {
|
||||
constructor(value: string);
|
||||
|
||||
value: string;
|
||||
|
||||
toCSS(env?: Options): string;
|
||||
eval(): UnicodeDescriptor;
|
||||
}
|
||||
|
||||
export class Attribute implements IInjectable {
|
||||
constructor(value: string);
|
||||
|
||||
value: string;
|
||||
|
||||
toCSS(env?: Options): string;
|
||||
genCSS(env: Options, output): string;
|
||||
eval(): Attribute;
|
||||
}
|
||||
|
||||
export var debugInfo: DebugInfoFunction;
|
||||
export function find(obj: any[], fun: Function): any;
|
||||
export function jsify(obj: any): string;
|
||||
export function operate(op: string, a: number, b: number): number;
|
||||
|
||||
export var True: Keyword;
|
||||
export var False: Keyword;
|
||||
interface RenderOutput {
|
||||
css: string;
|
||||
map: string;
|
||||
imports: string[];
|
||||
}
|
||||
}
|
||||
|
||||
class ParserNode extends tree.AbstractRuleset {
|
||||
toCSS(): string;
|
||||
toCSS(options: { compress: boolean; }, variables?): string;
|
||||
}
|
||||
interface LessStatic {
|
||||
render(input: string, callback: (output: Less.RenderOutput) => void): void;
|
||||
render(input: string, options: Less.Options, callback: (output: Less.RenderOutput) => void): void;
|
||||
|
||||
export class Parser {
|
||||
constructor(env?: Options);
|
||||
render(input: string): Less.Promise<Less.RenderOutput>;
|
||||
render(input: string, options: Less.Options): Less.Promise<Less.RenderOutput>;
|
||||
|
||||
imports: {
|
||||
paths: string[];
|
||||
queue: string[];
|
||||
files;
|
||||
contents;
|
||||
mime: string;
|
||||
error;
|
||||
push(path: string, callback: (e, root, imported) => void);
|
||||
}; // TODO
|
||||
|
||||
parse: (str: string, callback: (error: LessError, root: ParserNode) => void ) => void;
|
||||
|
||||
parsers: { // Major TODO
|
||||
};
|
||||
}
|
||||
|
||||
export function render(input: string, callback: (e, css: string) => void): void;
|
||||
export function render(input: string, options: Options,
|
||||
callback: (e, css: string) => void): void;
|
||||
|
||||
export function formatError(ctx, options: { color: boolean; }): string;
|
||||
export function writeError(ctx, options: { color: boolean; }): void;
|
||||
|
||||
export var version: number[];
|
||||
version: number[];
|
||||
}
|
||||
|
||||
declare module "less" {
|
||||
export = less;
|
||||
export = less;
|
||||
}
|
||||
|
||||
declare var less: LessStatic;
|
||||
|
||||
@@ -565,6 +565,8 @@ result = <number>_.sample([1, 2, 3, 4]);
|
||||
result = <number[]>_.sample([1, 2, 3, 4], 2);
|
||||
|
||||
result = <number[]>_.shuffle([1, 2, 3, 4, 5, 6]);
|
||||
result = <_.LoDashArrayWrapper<number>>_([1, 2, 3]).shuffle();
|
||||
result = <_.LoDashArrayWrapper<_.Dictionary<string>>>_(<{ [index: string]: string; }>{ 'key1': 'test1', 'key2': 'test2' }).shuffle();
|
||||
|
||||
result = <number>_.size([1, 2]);
|
||||
result = <number>_.size({ 'one': 1, 'two': 2, 'three': 3 });
|
||||
|
||||
26
lodash/lodash.d.ts
vendored
26
lodash/lodash.d.ts
vendored
@@ -4398,6 +4398,20 @@ declare module _ {
|
||||
shuffle<T>(collection: Dictionary<T>): T[];
|
||||
}
|
||||
|
||||
interface LoDashArrayWrapper<T> {
|
||||
/**
|
||||
* @see _.shuffle
|
||||
**/
|
||||
shuffle(): LoDashArrayWrapper<T>;
|
||||
}
|
||||
|
||||
interface LoDashObjectWrapper<T> {
|
||||
/**
|
||||
* @see _.shuffle
|
||||
**/
|
||||
shuffle(): LoDashArrayWrapper<T>;
|
||||
}
|
||||
|
||||
//_.size
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
@@ -5731,6 +5745,18 @@ declare module _ {
|
||||
**/
|
||||
isEmpty(value: any): boolean;
|
||||
}
|
||||
|
||||
//_.isError
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
* Checks if value is an Error, EvalError, RangeError, ReferenceError, SyntaxError, TypeError,
|
||||
* or URIError object.
|
||||
* @param value The value to check.
|
||||
* @return True if value is an error object, else false.
|
||||
*/
|
||||
isError(value: any): boolean;
|
||||
}
|
||||
|
||||
|
||||
//_.isEqual
|
||||
interface LoDashStatic {
|
||||
|
||||
12
loggly/loggly-tests.ts
Normal file
12
loggly/loggly-tests.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
/// <reference path='./loggly.d.ts' />
|
||||
import loggly = require("loggly");
|
||||
|
||||
var options: loggly.LogglyOptions = {
|
||||
token: "YOUR_TOKEN",
|
||||
subdomain: "YOUR_DOMAIN",
|
||||
tags: ["NodeJS"],
|
||||
json: true
|
||||
};
|
||||
|
||||
var client: loggly.Loggly = loggly.createClient(options)
|
||||
client.log('hello world');
|
||||
1
loggly/loggly-tests.ts.tscparams
Normal file
1
loggly/loggly-tests.ts.tscparams
Normal file
@@ -0,0 +1 @@
|
||||
--noImplicitAny --module commonjs --target es5
|
||||
25
loggly/loggly.d.ts
vendored
Normal file
25
loggly/loggly.d.ts
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
// Type definitions for loggly 1.0.8
|
||||
// Project: https://github.com/nodejitsu/node-loggly
|
||||
// Definitions by: Ray Martone <https://github.com/rmartone>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
declare module "loggly" {
|
||||
|
||||
interface LogglyOptions {
|
||||
token: string;
|
||||
subdomain: string;
|
||||
tags?: string[];
|
||||
json?: boolean;
|
||||
host?: string;
|
||||
auth?: {
|
||||
username: string;
|
||||
password: string;
|
||||
}
|
||||
}
|
||||
|
||||
interface Loggly {
|
||||
log(message: any, tags?: string[], callback?: (err: any, results: any) => void): void;
|
||||
log(message: any, callback?: (err: any, results: any) => void): void;
|
||||
}
|
||||
|
||||
function createClient(options: LogglyOptions): Loggly;
|
||||
}
|
||||
@@ -7,7 +7,7 @@
|
||||
import util = require('util');
|
||||
import Client = require('mariasql');
|
||||
|
||||
var c:Client = new Client(),
|
||||
var c:mariasql.MariaClient = new Client(),
|
||||
inspect = util.inspect;
|
||||
|
||||
c.connect({
|
||||
|
||||
183
mariasql/mariasql.d.ts
vendored
183
mariasql/mariasql.d.ts
vendored
@@ -3,95 +3,100 @@
|
||||
// Definitions by: MichaelBennett <https://github.com/bennett000/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module mariasql {
|
||||
export interface MariaCallBackError {
|
||||
(error:Error):void
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
interface MariaCallBackError {
|
||||
(error:Error):void
|
||||
}
|
||||
|
||||
interface MariaCallBackResult {
|
||||
(result:MariaResult):void
|
||||
}
|
||||
|
||||
interface MariaCallBackRow {
|
||||
(result:Array<any>):void
|
||||
}
|
||||
|
||||
interface MariaCallBackBoolean {
|
||||
(result:boolean):void
|
||||
}
|
||||
|
||||
interface MariaCallBackObject {
|
||||
(result:Object):void
|
||||
}
|
||||
|
||||
interface MariaCallBackVoid {
|
||||
():void
|
||||
}
|
||||
|
||||
interface Dictionary {
|
||||
[index: string]: any;
|
||||
}
|
||||
|
||||
interface MariaPreparedQuery {
|
||||
(values:Dictionary):string;
|
||||
(values:Array<any>):string;
|
||||
}
|
||||
|
||||
interface ClientConfig {
|
||||
host: string;
|
||||
user: string;
|
||||
password: string;
|
||||
db?: string;
|
||||
port?: number;
|
||||
unixSocket?: string;
|
||||
keepQueries?: boolean;
|
||||
multiStatements?: boolean;
|
||||
connTimeout?: number;
|
||||
pingInterval?: number;
|
||||
secureAuth?: boolean;
|
||||
compress?: boolean;
|
||||
ssl?:any;
|
||||
local_infile?: boolean;
|
||||
read_default_group?: string;
|
||||
charset?: string;
|
||||
}
|
||||
|
||||
declare class MariaResult {
|
||||
on(signal:string, cb:MariaCallBackObject):MariaResult; // signal 'end'
|
||||
on(signal:string, cb:MariaCallBackError):MariaResult; // signal 'error'
|
||||
on(signal:string, cb:MariaCallBackRow):MariaResult; // signal 'row'
|
||||
on(signal:string, cb:MariaCallBackVoid):MariaResult; // signal 'abort'
|
||||
abort():void;
|
||||
}
|
||||
|
||||
declare class MariaQuery {
|
||||
on(signal:string, cb:MariaCallBackResult):MariaQuery; // signal 'result'
|
||||
on(signal:string, cb:MariaCallBackVoid):MariaQuery; // signal 'end'
|
||||
on(signal:string, cb:MariaCallBackVoid):MariaQuery; // signal 'abort'
|
||||
on(signal:string, cb:MariaCallBackError):MariaQuery; // signal 'error'
|
||||
abort():void;
|
||||
}
|
||||
|
||||
declare class MariaClient {
|
||||
connect(config:ClientConfig):void;
|
||||
end():void;
|
||||
destroy():void;
|
||||
escape(query:string):string;
|
||||
query(q:string, placeHolders?:Dictionary, useArray?:boolean):MariaQuery;
|
||||
query(q:string, placeHolders?:Array<any>, useArray?:boolean):MariaQuery;
|
||||
query(q:string, useArray?:boolean):MariaQuery;
|
||||
prepare(query:string): MariaPreparedQuery;
|
||||
isMariaDB():boolean;
|
||||
on(signal:string, cb:MariaCallBackError): MariaClient; // signal 'error'
|
||||
on(signal:string, cb:MariaCallBackObject): MariaClient; // signal 'close'
|
||||
on(signal:string, cb:MariaCallBackVoid): MariaClient; // signal 'connect'
|
||||
connected: boolean;
|
||||
threadId: string;
|
||||
}
|
||||
|
||||
declare module 'mariasql' {
|
||||
export = MariaClient;
|
||||
export interface MariaCallBackResult {
|
||||
(result:MariaResult):void
|
||||
}
|
||||
|
||||
export interface MariaCallBackRow {
|
||||
(result:Array<any>):void
|
||||
}
|
||||
|
||||
export interface MariaCallBackBoolean {
|
||||
(result:boolean):void
|
||||
}
|
||||
|
||||
export interface MariaCallBackObject {
|
||||
(result:Object):void
|
||||
}
|
||||
|
||||
export interface MariaCallBackVoid {
|
||||
():void
|
||||
}
|
||||
|
||||
export interface Dictionary {
|
||||
[index: string]: any;
|
||||
}
|
||||
|
||||
export interface MariaPreparedQuery {
|
||||
(values:Dictionary):string;
|
||||
(values:Array<any>):string;
|
||||
}
|
||||
|
||||
export interface ClientConfig {
|
||||
host: string;
|
||||
user: string;
|
||||
password: string;
|
||||
db?: string;
|
||||
port?: number;
|
||||
unixSocket?: string;
|
||||
keepQueries?: boolean;
|
||||
multiStatements?: boolean;
|
||||
connTimeout?: number;
|
||||
pingInterval?: number;
|
||||
secureAuth?: boolean;
|
||||
compress?: boolean;
|
||||
ssl?:any;
|
||||
local_infile?: boolean;
|
||||
read_default_group?: string;
|
||||
charset?: string;
|
||||
}
|
||||
|
||||
export interface MariaResult {
|
||||
on(signal:string, cb:MariaCallBackObject):MariaResult; // signal 'end'
|
||||
on(signal:string, cb:MariaCallBackError):MariaResult; // signal 'error'
|
||||
on(signal:string, cb:MariaCallBackRow):MariaResult; // signal 'row'
|
||||
on(signal:string, cb:MariaCallBackVoid):MariaResult; // signal 'abort'
|
||||
abort():void;
|
||||
}
|
||||
|
||||
export interface MariaQuery {
|
||||
on(signal:string, cb:MariaCallBackResult):MariaQuery; // signal 'result'
|
||||
on(signal:string, cb:MariaCallBackVoid):MariaQuery; // signal 'end'
|
||||
on(signal:string, cb:MariaCallBackVoid):MariaQuery; // signal 'abort'
|
||||
on(signal:string, cb:MariaCallBackError):MariaQuery; // signal 'error'
|
||||
abort():void;
|
||||
}
|
||||
|
||||
export interface MariaClient {
|
||||
connect(config:ClientConfig):void;
|
||||
end():void;
|
||||
destroy():void;
|
||||
escape(query:string):string;
|
||||
query(q:string, placeHolders?:Dictionary, useArray?:boolean):MariaQuery;
|
||||
query(q:string, placeHolders?:Array<any>, useArray?:boolean):MariaQuery;
|
||||
query(q:string, useArray?:boolean):MariaQuery;
|
||||
prepare(query:string): MariaPreparedQuery;
|
||||
isMariaDB():boolean;
|
||||
on(signal:string, cb:MariaCallBackError): MariaClient; // signal 'error'
|
||||
on(signal:string, cb:MariaCallBackObject): MariaClient; // signal 'close'
|
||||
on(signal:string, cb:MariaCallBackVoid): MariaClient; // signal 'connect'
|
||||
connected: boolean;
|
||||
threadId: string;
|
||||
}
|
||||
|
||||
export interface Client {
|
||||
new ():MariaClient;
|
||||
():MariaClient;
|
||||
prototype: MariaClient;
|
||||
}
|
||||
}
|
||||
|
||||
declare module "mariasql" {
|
||||
var Client:mariasql.Client;
|
||||
export = Client;
|
||||
}
|
||||
4
marionette/marionette.d.ts
vendored
4
marionette/marionette.d.ts
vendored
@@ -38,7 +38,7 @@ declare module Backbone {
|
||||
include(value: any): boolean;
|
||||
initial(): View<TModel>;
|
||||
initial(n: number): View<TModel>[];
|
||||
invoke(methodName: string, arguments?: any[]): any;
|
||||
invoke(methodName: string, args?: any[]): any;
|
||||
isEmpty(object: any): boolean;
|
||||
last(): View<TModel>;
|
||||
last(n: number): View<TModel>[];
|
||||
@@ -533,7 +533,7 @@ declare module Marionette {
|
||||
* Calls the method named by methodName on each value in the collection. Any extra
|
||||
* arguments passed to invoke will be forwarded on to the method invocation.
|
||||
*/
|
||||
invoke(methodName: string, arguments?: any[]): any;
|
||||
invoke(methodName: string, args?: any[]): any;
|
||||
|
||||
/**
|
||||
* Returns true if the RegionManager contains no regions.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Meteor Type Definitions
|
||||
|
||||
These are the definitions for version 1.0.3.1 of Meteor.
|
||||
These are the definitions for version 1.1.0.1 of Meteor.
|
||||
|
||||
Although these definitions can be downloaded separately for use, the recommended way to use these definitions in a Meteor application is by installing the
|
||||
[typescript-libs](https://atmospherejs.com/meteortypescript/typescript-libs) Meteor smart package from atmosphere. The smart package contains TypeScript
|
||||
@@ -16,25 +16,21 @@ to generate the official [Meteor docs] (http://docs.meteor.com/).
|
||||
|
||||
## Usage
|
||||
|
||||
1. If you are using the smart package, add a symbolic link to the definitions from within some directory within your project (e.g. ".typescript" or "lib"). The
|
||||
definitions can be found somewhere deep within `<project_root_dir>/.meteor/...`. The following will probably work:
|
||||
1. Add a symbolic link to the definitions from within some directory within your project (e.g. ".typescript" or "lib"). The definitions can be found somewhere
|
||||
deep within `<project_root_dir>/.meteor/...`. The following will probably work:
|
||||
|
||||
$ ln -s ../.meteor/local/build/programs/server/assets/packages/meteortypescript_typescript-libs/definitions package_defs
|
||||
|
||||
|
||||
If the definitions can't be found within the .meteor directory, you will have to manually pull down the definitions from github and add them to your project:
|
||||
<https://github.com/meteor-typescript/meteor-typescript-libs>
|
||||
|
||||
If you are just using the *meteor.d.ts* file from this source, you can just add the file to any directory in your project (e.g. ".typescript" or "lib").
|
||||
|
||||
2. Install the [Typescript compiler for Meteor](https://github.com/meteor-typescript/meteor-typescript-compiler) or an [IDE which can transpile TypeScript to JavaScript](#transpiling-typescript).
|
||||
3. From the typescript files, add references. Reference the definition files with a single line:
|
||||
|
||||
/// <reference path=".typescript/package_defs/all-definitions.d.ts" /> (substitute path in your project)
|
||||
|
||||
|
||||
Or you can reference definition files individually:
|
||||
|
||||
|
||||
/// <reference path=".typescript/package_defs/meteor.d.ts" /> (substitue path in your project)
|
||||
/// <reference path=".typescript/package_defs/underscore.d.ts" />
|
||||
/// <reference path=".typescript/package_defs/jquery.d.ts" />
|
||||
@@ -46,26 +42,28 @@ definitions can be found somewhere deep within `<project_root_dir>/.meteor/...`.
|
||||
|
||||
### References
|
||||
|
||||
Try to stay away from referencing *file.ts*, rather generate a *file.d.ts* using `tsc --reference file.ts`, and reference it in your file. Compilation will
|
||||
be much faster and code cleaner - it's always better to split definition from implemention.
|
||||
Meteor code can run on the client and the server, for this reason you should try to stay away from referencing *file.ts* directly: you may get unexpected results.
|
||||
Rather generate a *file.d.ts* using `tsc --reference file.ts`, and reference it in your file.
|
||||
|
||||
Compilation will be much faster and code cleaner - it's always better to split definition from implementation anyways.
|
||||
|
||||
### Templates
|
||||
|
||||
When specifying template *helpers*, *events*, and functions for *created*, *rendered*, and *destroyed*, you will need to use a "bracket notation" instead of the "dot notation":
|
||||
With the exception of the **body** and **head** templates, Meteor's Template dot notation cannot be used (ie. *Template.mytemplate*). Thanks to Typescript static typing checks, you will need to used the *bracket notation* to access the Template.
|
||||
|
||||
Template['myTemplateName']['helpers']({
|
||||
|
||||
Template['myTemplateName'].helpers({
|
||||
foo: function () {
|
||||
return Session.get("foo");
|
||||
}
|
||||
});
|
||||
|
||||
Template['myTemplateName']['rendered'] = function ( ) { ... }
|
||||
Template['myTemplateName'].rendered = function ( ) { ... }
|
||||
|
||||
|
||||
This is because TypeScript enforces typing and it will throw an error saying "myTemplateName" does not exist when using the dot notation.
|
||||
### Form fields
|
||||
|
||||
### Accessing a Form field
|
||||
|
||||
Trying to read a form field value? use `(<HTMLInputElement>evt.target).value`.
|
||||
Form fields typically need to be casted to <HTMLInputElement>. For instance to read a form field value, use `(<HTMLInputElement>evt.target).value`.
|
||||
|
||||
### Global variables
|
||||
|
||||
@@ -77,7 +75,7 @@ Preface any global variable declarations with a TypeScript "declare var" stateme
|
||||
|
||||
### Collections
|
||||
|
||||
The majority of extra work required to use TypeScript with Meteor is creating and maintaining the collection interfaces. However, doing so also provides the
|
||||
The majority of extra work required to use TypeScript with Meteor is creating and maintaining the collection interfaces. However, doing so also provides the
|
||||
additional benefit of succinctly documenting collection schema definitions (that are actually enforced).
|
||||
|
||||
To define collections, you will need to create an interface representing the collection and then declare a Collection type variable with that interface type (as a generic):
|
||||
@@ -113,7 +111,7 @@ for all of you custom definitions. e.g. contents of ".typescript/custom_defs/cu
|
||||
/// <reference path='paraview_helpers.d.ts'/>
|
||||
/// <reference path='handsontable.d.ts'/>
|
||||
/// <reference path='utility_helpers.ts'/>
|
||||
|
||||
|
||||
|
||||
## Transpiling TypeScript
|
||||
|
||||
@@ -132,4 +130,4 @@ Then, within WebStorm, go to Preferences -> File Watchers -> "+" symbol and add
|
||||
|
||||
Last option, is to compile code from the command line. With node and the typescript compiler installed:
|
||||
|
||||
$ tsc *.ts
|
||||
$ tsc *.ts
|
||||
|
||||
@@ -8,21 +8,15 @@
|
||||
|
||||
|
||||
/*********************************** Begin setup for tests ******************************/
|
||||
|
||||
// A developer must declare a var Template like this in a separate file to use this TypeScript type definition file
|
||||
//interface ITemplate {
|
||||
// adminDashboard: Meteor.Template;
|
||||
// chat: Meteor.Template;
|
||||
//}
|
||||
//declare var Template: ITemplate;
|
||||
|
||||
var Rooms = new Mongo.Collection('rooms');
|
||||
var Messages = new Mongo.Collection('messages');
|
||||
var Monkeys = new Mongo.Collection('monkeys');
|
||||
var x = new Mongo.Collection('x');
|
||||
var y = new Mongo.Collection('y');
|
||||
|
||||
var check = function(str1, str2) {};
|
||||
interface MonkeyDAO {
|
||||
_id: string;
|
||||
name: string;
|
||||
}
|
||||
var Monkeys = new Mongo.Collection<MonkeyDAO>('monkeys');
|
||||
//var x = new Mongo.Collection<xDAO>('x');
|
||||
//var y = new Mongo.Collection<yDAO>('y');
|
||||
/********************************** End setup for tests *********************************/
|
||||
|
||||
|
||||
@@ -98,8 +92,8 @@ Tracker.autorun(function () {
|
||||
});
|
||||
|
||||
console.log("Current room has " +
|
||||
Counts.find(Session.get("roomId")).count +
|
||||
" messages.");
|
||||
Counts.find(Session.get("roomId")).count +
|
||||
" messages.");
|
||||
|
||||
/**
|
||||
* From Publish and Subscribe, Meteor.subscribe section
|
||||
@@ -124,7 +118,7 @@ Meteor.methods({
|
||||
|
||||
var you_want_to_throw_an_error = true;
|
||||
if (you_want_to_throw_an_error)
|
||||
throw new Meteor.Error("404", "Can't find my pants");
|
||||
throw new Meteor.Error("404", "Can't find my pants");
|
||||
return "some return value";
|
||||
},
|
||||
|
||||
@@ -146,15 +140,15 @@ var result = Meteor.call('foo', 1, 2);
|
||||
// DA: I added the "var" keyword in there
|
||||
|
||||
interface ChatroomsDAO {
|
||||
_id?: string;
|
||||
_id?: string;
|
||||
}
|
||||
interface MessagesDAO {
|
||||
_id?: string;
|
||||
_id?: string;
|
||||
}
|
||||
var Chatrooms = new Mongo.Collection<ChatroomsDAO>("chatrooms");
|
||||
Messages = new Mongo.Collection<MessagesDAO>("messages");
|
||||
|
||||
var myMessages = Messages.find({userId: Session.get('myUserId')}).fetch();
|
||||
var myMessages = <MessagesDAO> Messages.find({userId: Session.get('myUserId')}).fetch();
|
||||
|
||||
Messages.insert({text: "Hello, world!"});
|
||||
|
||||
@@ -171,10 +165,10 @@ Posts.insert({title: "Hello world", body: "First post"});
|
||||
* since there is already a Collection constructor with a different signature
|
||||
*
|
||||
var Scratchpad = new Mongo.Collection;
|
||||
for (var i = 0; i < 10; i++)
|
||||
Scratchpad.insert({number: i * 2});
|
||||
assert(Scratchpad.find({number: {$lt: 9}}).count() === 5);
|
||||
**/
|
||||
for (var i = 0; i < 10; i++)
|
||||
Scratchpad.insert({number: i * 2});
|
||||
assert(Scratchpad.find({number: {$lt: 9}}).count() === 5);
|
||||
**/
|
||||
|
||||
var Animal = function (doc) {
|
||||
// _.extend(this, doc);
|
||||
@@ -185,11 +179,16 @@ Animal.prototype = {
|
||||
makeNoise: function () {
|
||||
console.log(this.sound);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
interface AnimalDAO {
|
||||
_id: string;
|
||||
makeNoise: () => void;
|
||||
}
|
||||
|
||||
|
||||
// Define a Collection that uses Animal as its document
|
||||
var Animals = new Mongo.Collection("Animals", {
|
||||
var Animals = new Mongo.Collection<AnimalDAO>("Animals", {
|
||||
transform: function (doc) { return new Animal(doc); }
|
||||
});
|
||||
|
||||
@@ -225,8 +224,8 @@ Template['adminDashboard'].events({
|
||||
Meteor.methods({
|
||||
declareWinners: function () {
|
||||
Players.update({score: {$gt: 10}},
|
||||
{$addToSet: {badges: "Winner"}},
|
||||
{multi: true});
|
||||
{$addToSet: {badges: "Winner"}},
|
||||
{multi: true});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -348,7 +347,7 @@ Session.equals("key", value);
|
||||
*/
|
||||
Meteor.publish("userData", function () {
|
||||
return Meteor.users.find({_id: this.userId},
|
||||
{fields: {'other': 1, 'things': 1}});
|
||||
{fields: {'other': 1, 'things': 1}});
|
||||
});
|
||||
|
||||
Meteor.users.deny({update: function () { return true; }});
|
||||
@@ -412,8 +411,8 @@ Accounts.emailTemplates.enrollAccount.subject = function (user) {
|
||||
};
|
||||
Accounts.emailTemplates.enrollAccount.text = function (user, url) {
|
||||
return "You have been selected to participate in building a better future!"
|
||||
+ " To activate your account, simply click the link below:\n\n"
|
||||
+ url;
|
||||
+ " To activate your account, simply click the link below:\n\n"
|
||||
+ url;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -424,6 +423,36 @@ Template['adminDashboard'].helpers({
|
||||
return Session.get("foo");
|
||||
}
|
||||
});
|
||||
Template['newTemplate'].helpers({
|
||||
helperName: function () {
|
||||
}
|
||||
});
|
||||
|
||||
Template['newTemplate'].created = function () {
|
||||
|
||||
};
|
||||
|
||||
Template['newTemplate'].rendered = function () {
|
||||
|
||||
};
|
||||
|
||||
Template['newTemplate'].destroyed = function () {
|
||||
|
||||
};
|
||||
|
||||
Template['newTemplate'].events({
|
||||
'click .something': function (event) {
|
||||
}
|
||||
});
|
||||
|
||||
Template.registerHelper('testHelper', function() {
|
||||
return 'tester';
|
||||
});
|
||||
|
||||
var instance = Template.instance();
|
||||
var data = Template.currentData();
|
||||
var data = Template.parentData(1);
|
||||
var body = Template.body;
|
||||
|
||||
/**
|
||||
* From Match section
|
||||
@@ -481,10 +510,9 @@ Tracker.autorun(function (c) {
|
||||
* From Deps, Deps.Computation
|
||||
*/
|
||||
if (Tracker.active) {
|
||||
Tracker.onInvalidate(function () {
|
||||
x.destroy();
|
||||
y.finalize();
|
||||
});
|
||||
Tracker.onInvalidate(function () {
|
||||
console.log('invalidated');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -494,15 +522,15 @@ var weather = "sunny";
|
||||
var weatherDep = new Tracker.Dependency;
|
||||
|
||||
var getWeather = function () {
|
||||
weatherDep.depend();
|
||||
return weather;
|
||||
weatherDep.depend();
|
||||
return weather;
|
||||
};
|
||||
|
||||
var setWeather = function (w) {
|
||||
weather = w;
|
||||
// (could add logic here to only call changed()
|
||||
// if the new value is different from the old)
|
||||
weatherDep.changed();
|
||||
weather = w;
|
||||
// (could add logic here to only call changed()
|
||||
// if the new value is different from the old)
|
||||
weatherDep.changed();
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -512,7 +540,7 @@ Meteor.methods({checkTwitter: function (userId) {
|
||||
check(userId, String);
|
||||
this.unblock();
|
||||
var result = HTTP.call("GET", "http://api.twitter.com/xyz",
|
||||
{params: {user: userId}});
|
||||
{params: {user: userId}});
|
||||
if (result.statusCode === 200)
|
||||
return true
|
||||
return false;
|
||||
@@ -520,12 +548,12 @@ Meteor.methods({checkTwitter: function (userId) {
|
||||
|
||||
|
||||
HTTP.call("POST", "http://api.twitter.com/xyz",
|
||||
{data: {some: "json", stuff: 1}},
|
||||
function (error, result) {
|
||||
if (result.statusCode === 200) {
|
||||
Session.set("twizzled", true);
|
||||
}
|
||||
});
|
||||
{data: {some: "json", stuff: 1}},
|
||||
function (error, result) {
|
||||
if (result.statusCode === 200) {
|
||||
Session.set("twizzled", true);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* From Email, Email.send section
|
||||
@@ -542,9 +570,9 @@ Meteor.methods({
|
||||
|
||||
// In your client code: asynchronously send an email
|
||||
Meteor.call('sendEmail',
|
||||
'alice@example.com',
|
||||
'Hello from Meteor!',
|
||||
'This is a test of Email.send.');
|
||||
'alice@example.com',
|
||||
'Hello from Meteor!',
|
||||
'This is a test of Email.send.');
|
||||
|
||||
var testTemplate = new Blaze.Template();
|
||||
var testView = new Blaze.View();
|
||||
@@ -562,8 +590,8 @@ Blaze.toHTMLWithData(testTemplate, function() {});
|
||||
Blaze.toHTMLWithData(testView, {test: 1});
|
||||
Blaze.toHTMLWithData(testView, function() {});
|
||||
|
||||
var reactiveVar1 = new ReactiveVar('test value');
|
||||
var reactiveVar2 = new ReactiveVar('test value', function(oldVal) { return true; });
|
||||
var reactiveVar1 = new ReactiveVar<string>('test value');
|
||||
var reactiveVar2 = new ReactiveVar<string>('test value', function(oldVal) { return true; });
|
||||
|
||||
var varValue: string = reactiveVar1.get();
|
||||
reactiveVar1.set('new value');
|
||||
1176
meteor/meteor.d.ts
vendored
1176
meteor/meteor.d.ts
vendored
File diff suppressed because it is too large
Load Diff
4
mocha/mocha.d.ts
vendored
4
mocha/mocha.d.ts
vendored
@@ -37,10 +37,10 @@ interface MochaSetupOptions {
|
||||
reporter?: any;
|
||||
|
||||
// bail on the first test failure
|
||||
bail?: Boolean;
|
||||
bail?: boolean;
|
||||
|
||||
// ignore global leaks
|
||||
ignoreLeaks?: Boolean;
|
||||
ignoreLeaks?: boolean;
|
||||
|
||||
// grep string or regexp to filter tests with
|
||||
grep?: any;
|
||||
|
||||
@@ -8,11 +8,16 @@ 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 d = moment.tz("May 12th 2014 8PM", "MMM Do YYYY hA", true, "America/Toronto");
|
||||
|
||||
a.tz();
|
||||
|
||||
var arr = [2013, 5, 1],
|
||||
str = "2013-12-01",
|
||||
obj = { year : 2013, month : 5, day : 1 };
|
||||
|
||||
moment.tz("America/Los_Angeles");
|
||||
|
||||
moment.tz(arr, "America/Los_Angeles");
|
||||
moment.tz(str, "America/Los_Angeles");
|
||||
moment.tz(obj, "America/Los_Angeles");
|
||||
|
||||
3
moment-timezone/moment-timezone.d.ts
vendored
3
moment-timezone/moment-timezone.d.ts
vendored
@@ -7,6 +7,7 @@
|
||||
|
||||
declare module moment {
|
||||
interface Moment {
|
||||
tz(): string;
|
||||
tz(timezone: string): Moment;
|
||||
}
|
||||
|
||||
@@ -27,9 +28,11 @@ interface MomentZone {
|
||||
}
|
||||
|
||||
interface MomentTimezone {
|
||||
(timezone: string): moment.Moment;
|
||||
(date: number, timezone: string): moment.Moment;
|
||||
(date: number[], timezone: string): moment.Moment;
|
||||
(date: string, format: string, timezone: string): moment.Moment;
|
||||
(date: string, format: string, useStrict: boolean, timezone: string): moment.Moment;
|
||||
(date: Date, timezone: string): moment.Moment;
|
||||
(date: moment.Moment, timezone: string): moment.Moment;
|
||||
(date: Object, timezone: string): moment.Moment;
|
||||
|
||||
2
mongoose/mongoose.d.ts
vendored
2
mongoose/mongoose.d.ts
vendored
@@ -128,7 +128,7 @@ declare module "mongoose" {
|
||||
versionKey?: boolean;
|
||||
}
|
||||
|
||||
export interface Model<T extends Document> {
|
||||
export interface Model<T extends Document> extends NodeJS.EventEmitter {
|
||||
new(doc: Object): T;
|
||||
|
||||
aggregate(...aggregations: Object[]): Aggregate<T[]>;
|
||||
|
||||
@@ -1,127 +0,0 @@
|
||||
/// <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
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
@@ -1,614 +0,0 @@
|
||||
// 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?: 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?: 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: VariableDeclaration | Expression;
|
||||
right: Expression;
|
||||
body: Statement;
|
||||
each: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* A for/of statement.
|
||||
*/
|
||||
interface ForOfStatement extends Statement {
|
||||
type: string; // "ForOfStatement";
|
||||
left: 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: 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: 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: 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: 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: 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: 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";
|
||||
value?: string | boolean | 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 {
|
||||
// "++" | "--"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -63,7 +63,7 @@ selectionProvider.selectedItems = [];
|
||||
selectionProvider.selectedIndex = 1;
|
||||
selectionProvider.lastClickedRow = {};
|
||||
selectionProvider.ignoreSelectedItemChanges = false;
|
||||
selectionProvider.pKeyParser = <ng.ICompiledExpression>{};
|
||||
selectionProvider.pKeyParser = <angular.ICompiledExpression>{};
|
||||
selectionProvider.ChangeSelection({}, {});
|
||||
nr = selectionProvider.getSelection({});
|
||||
nr = selectionProvider.getSelectionIndex({});
|
||||
@@ -256,15 +256,15 @@ nr = gridScope.totalRowWidth();
|
||||
a = gridScope.headerScrollerDim();
|
||||
|
||||
var gridInstance: ngGrid.IGridInstance = <ngGrid.IGridInstance>{};
|
||||
gridInstance.$canvas = <ng.IAugmentedJQuery>{};
|
||||
gridInstance.$viewport = <ng.IAugmentedJQuery>{};
|
||||
gridInstance.$groupPanel = <ng.IAugmentedJQuery>{};
|
||||
gridInstance.$footerPanel = <ng.IAugmentedJQuery>{};
|
||||
gridInstance.$headerScroller = <ng.IAugmentedJQuery>{};
|
||||
gridInstance.$headerContainer = <ng.IAugmentedJQuery>{};
|
||||
gridInstance.$headers = <ng.IAugmentedJQuery>{};
|
||||
gridInstance.$topPanel = <ng.IAugmentedJQuery>{};
|
||||
gridInstance.$root = <ng.IAugmentedJQuery>{};
|
||||
gridInstance.$canvas = <angular.IAugmentedJQuery>{};
|
||||
gridInstance.$viewport = <angular.IAugmentedJQuery>{};
|
||||
gridInstance.$groupPanel = <angular.IAugmentedJQuery>{};
|
||||
gridInstance.$footerPanel = <angular.IAugmentedJQuery>{};
|
||||
gridInstance.$headerScroller = <angular.IAugmentedJQuery>{};
|
||||
gridInstance.$headerContainer = <angular.IAugmentedJQuery>{};
|
||||
gridInstance.$headers = <angular.IAugmentedJQuery>{};
|
||||
gridInstance.$topPanel = <angular.IAugmentedJQuery>{};
|
||||
gridInstance.$root = <angular.IAugmentedJQuery>{};
|
||||
gridInstance.config = <ngGrid.IGridOptions>{};
|
||||
gridInstance.data = {};
|
||||
gridInstance.elementDims = <ngGrid.IElementDimension>{};
|
||||
@@ -290,7 +290,7 @@ gridInstance.clearSortingData();
|
||||
gridInstance.configureColumnWidths();
|
||||
gridInstance.fixColumnIndexes();
|
||||
gridInstance.fixGroupIndexes();
|
||||
var p:ng.IPromise<any> = gridInstance.getTemplate('');
|
||||
var p:angular.IPromise<any> = gridInstance.getTemplate('');
|
||||
p = gridInstance.init();
|
||||
p = gridInstance.initTemplates();
|
||||
gridInstance.minRowsToRender();
|
||||
@@ -302,12 +302,12 @@ gridInstance.sortColumnsInit();
|
||||
gridInstance.sortData(<ngGrid.IColumn>{}, {});
|
||||
|
||||
var test_styleProvider:ngGrid.IStyleProvider = new ngStyleProvider(<ngGrid.IGridScope>{}, <ngGrid.IGridInstance>{});
|
||||
var test_searchProvider:ngGrid.ISearchProvider = new ngSearchProvider(<ngGrid.IGridScope>{}, <ngGrid.IGridInstance>{}, <ng.IFilterService>{});
|
||||
var test_selectionProvider:ngGrid.ISelectionProvider = new ngSelectionProvider(<ngGrid.IGridInstance>{}, <ngGrid.IGridScope>{}, <ng.IParseService>{});
|
||||
var test_eventProvider:ngGrid.IEventProvider = new ngEventProvider(<ngGrid.IGridInstance>{}, <ngGrid.IGridScope>{}, <ngGrid.service.IDomUtilityService>{}, <ng.ITimeoutService>{});
|
||||
var test_searchProvider:ngGrid.ISearchProvider = new ngSearchProvider(<ngGrid.IGridScope>{}, <ngGrid.IGridInstance>{}, <angular.IFilterService>{});
|
||||
var test_selectionProvider:ngGrid.ISelectionProvider = new ngSelectionProvider(<ngGrid.IGridInstance>{}, <ngGrid.IGridScope>{}, <angular.IParseService>{});
|
||||
var test_eventProvider:ngGrid.IEventProvider = new ngEventProvider(<ngGrid.IGridInstance>{}, <ngGrid.IGridScope>{}, <ngGrid.service.IDomUtilityService>{}, <angular.ITimeoutService>{});
|
||||
var test_aggregate:ngGrid.IAggregate = new ngAggregate({}, <ngGrid.IRowFactory>{}, 10, true);
|
||||
var test_renderedRange:ngGrid.IRenderedRange = new ngRenderedRange(1, 2);
|
||||
var test_dimension:ngGrid.IDimension = new ngDimension({});
|
||||
var test_row:ngGrid.IRow = new ngRow({}, <ngGrid.IRowConfig>{}, <ngGrid.ISelectionProvider>{}, 0, {});
|
||||
var test_column:ngGrid.IColumn = new ngColumn(<ngGrid.IGridOptions>{}, <ngGrid.IGridScope>{}, <ngGrid.IGridInstance>{}, <ngGrid.service.IDomUtilityService>{}, <ng.ITemplateCacheService>{}, {});
|
||||
var test_column:ngGrid.IColumn = new ngColumn(<ngGrid.IGridOptions>{}, <ngGrid.IGridScope>{}, <ngGrid.IGridInstance>{}, <ngGrid.service.IDomUtilityService>{}, <angular.ITemplateCacheService>{}, {});
|
||||
var test_footer:ngGrid.IFooter = new ngFooter(<ngGrid.IGridScope>{}, <ngGrid.IGridInstance>{});
|
||||
|
||||
42
ng-grid/ng-grid.d.ts
vendored
42
ng-grid/ng-grid.d.ts
vendored
@@ -30,9 +30,9 @@ declare module ngGrid {
|
||||
export interface IDomAccessProvider {
|
||||
previousColumn:IColumn;
|
||||
grid:IGridInstance;
|
||||
changeUserSelect(elm:ng.IAugmentedJQuery, value:string):void;
|
||||
changeUserSelect(elm:angular.IAugmentedJQuery, value:string):void;
|
||||
focusCellElement($scope:IGridScope, index:number):void;
|
||||
selectionHandlers($scope:IGridScope, elm:ng.IAugmentedJQuery):void;
|
||||
selectionHandlers($scope:IGridScope, elm:angular.IAugmentedJQuery):void;
|
||||
}
|
||||
|
||||
export interface IStyleProviderStatic {
|
||||
@@ -43,7 +43,7 @@ declare module ngGrid {
|
||||
}
|
||||
|
||||
export interface ISearchProviderStatic {
|
||||
new($scope:IGridScope, grid:IGridInstance, $filter:ng.IFilterService):ISearchProvider;
|
||||
new($scope:IGridScope, grid:IGridInstance, $filter:angular.IFilterService):ISearchProvider;
|
||||
}
|
||||
|
||||
export interface ISearchProvider {
|
||||
@@ -53,7 +53,7 @@ declare module ngGrid {
|
||||
}
|
||||
|
||||
export interface ISelectionProviderStatic {
|
||||
new(grid:IGridInstance, $scope:IGridScope, $parse:ng.IParseService):ISelectionProvider;
|
||||
new(grid:IGridInstance, $scope:IGridScope, $parse:angular.IParseService):ISelectionProvider;
|
||||
}
|
||||
|
||||
export interface ISelectionProvider {
|
||||
@@ -62,7 +62,7 @@ declare module ngGrid {
|
||||
selectedIndex:number;
|
||||
lastClickedRow:any;
|
||||
ignoreSelectedItemChanges:boolean;
|
||||
pKeyParser:ng.ICompiledExpression;
|
||||
pKeyParser:angular.ICompiledExpression;
|
||||
ChangeSelection(rowItem:any, event:any):void;
|
||||
getSelection(entity:any):number;
|
||||
getSelectionIndex(entity:any):number;
|
||||
@@ -71,7 +71,7 @@ declare module ngGrid {
|
||||
}
|
||||
|
||||
export interface IEventProviderStatic {
|
||||
new(grid:IGridInstance, $scope:IGridScope, domUtilityService:service.IDomUtilityService, $timeout:ng.ITimeoutService):IEventProvider;
|
||||
new(grid:IGridInstance, $scope:IGridScope, domUtilityService:service.IDomUtilityService, $timeout:angular.ITimeoutService):IEventProvider;
|
||||
}
|
||||
|
||||
export interface IEventProvider {
|
||||
@@ -203,7 +203,7 @@ declare module ngGrid {
|
||||
}
|
||||
|
||||
export interface IColumnStatic {
|
||||
new(config:IGridOptions, $scope:IGridScope, grid:IGridInstance, domUtilityService:service.IDomUtilityService, $templateCache:ng.ITemplateCacheService, $utils:any):IColumn;
|
||||
new(config:IGridOptions, $scope:IGridScope, grid:IGridInstance, domUtilityService:service.IDomUtilityService, $templateCache:angular.ITemplateCacheService, $utils:any):IColumn;
|
||||
}
|
||||
|
||||
export interface IColumn {
|
||||
@@ -251,7 +251,7 @@ declare module ngGrid {
|
||||
setVars(fromCol:IColumn):void;
|
||||
}
|
||||
|
||||
export interface IGridScope extends ng.IScope {
|
||||
export interface IGridScope extends angular.IScope {
|
||||
elementsNeedMeasuring:boolean;
|
||||
columns:any[];
|
||||
renderedRows:any[];
|
||||
@@ -292,15 +292,15 @@ declare module ngGrid {
|
||||
}
|
||||
|
||||
export interface IGridInstance {
|
||||
$canvas:ng.IAugmentedJQuery;
|
||||
$viewport:ng.IAugmentedJQuery;
|
||||
$groupPanel:ng.IAugmentedJQuery;
|
||||
$footerPanel:ng.IAugmentedJQuery;
|
||||
$headerScroller:ng.IAugmentedJQuery;
|
||||
$headerContainer:ng.IAugmentedJQuery;
|
||||
$headers:ng.IAugmentedJQuery;
|
||||
$topPanel:ng.IAugmentedJQuery;
|
||||
$root:ng.IAugmentedJQuery;
|
||||
$canvas:angular.IAugmentedJQuery;
|
||||
$viewport:angular.IAugmentedJQuery;
|
||||
$groupPanel:angular.IAugmentedJQuery;
|
||||
$footerPanel:angular.IAugmentedJQuery;
|
||||
$headerScroller:angular.IAugmentedJQuery;
|
||||
$headerContainer:angular.IAugmentedJQuery;
|
||||
$headers:angular.IAugmentedJQuery;
|
||||
$topPanel:angular.IAugmentedJQuery;
|
||||
$root:angular.IAugmentedJQuery;
|
||||
config:IGridOptions;
|
||||
data:any;
|
||||
elementDims:IElementDimension;
|
||||
@@ -327,9 +327,9 @@ declare module ngGrid {
|
||||
configureColumnWidths():void;
|
||||
fixColumnIndexes():void;
|
||||
fixGroupIndexes():void;
|
||||
getTemplate(key:string):ng.IPromise<any>;
|
||||
init():ng.IPromise<any>;
|
||||
initTemplates():ng.IPromise<any>;
|
||||
getTemplate(key:string):angular.IPromise<any>;
|
||||
init():angular.IPromise<any>;
|
||||
initTemplates():angular.IPromise<any>;
|
||||
minRowsToRender():void;
|
||||
refreshDomSizes():void;
|
||||
resizeOnData(col:IColumn):void;
|
||||
@@ -602,7 +602,7 @@ declare module ngGrid {
|
||||
eventStorage:any;
|
||||
numberOfGrids:number;
|
||||
immediate:number;
|
||||
AssignGridContainers($scope:IGridScope, rootel:ng.IAugmentedJQuery, grid:IGridInstance):void;
|
||||
AssignGridContainers($scope:IGridScope, rootel:angular.IAugmentedJQuery, grid:IGridInstance):void;
|
||||
getRealWidth(obj:IDimension):number;
|
||||
UpdateGridLayout($scope:IGridScope, grid:IGridInstance):void;
|
||||
setStyleText(grid:IGridInstance, css:string):void;
|
||||
|
||||
4
node-azure/azure.d.ts
vendored
4
node-azure/azure.d.ts
vendored
@@ -832,8 +832,8 @@ declare module "azure" {
|
||||
whereKeys(partitionKey: string, rowKey: string): TableQuery;
|
||||
whereNextKeys(partitionKey: string, rowKey: string): TableQuery;
|
||||
where(condition: string, ...values: string[]): TableQuery;
|
||||
and(condition: string, ...arguments: string[]): TableQuery;
|
||||
or(condition: string, ...arguments: string[]): TableQuery;
|
||||
and(condition: string, ...args: string[]): TableQuery;
|
||||
or(condition: string, ...args: string[]): TableQuery;
|
||||
top(integer: number): TableQuery;
|
||||
toQueryObject(): any;
|
||||
toPath(): string;
|
||||
|
||||
83
node/node.d.ts
vendored
83
node/node.d.ts
vendored
@@ -282,15 +282,10 @@ declare module "http" {
|
||||
address(): { port: number; family: string; address: string; };
|
||||
maxHeadersCount: number;
|
||||
}
|
||||
export interface ServerRequest extends events.EventEmitter, stream.Readable {
|
||||
method: string;
|
||||
url: string;
|
||||
headers: any;
|
||||
trailers: string;
|
||||
httpVersion: string;
|
||||
setEncoding(encoding?: string): void;
|
||||
pause(): void;
|
||||
resume(): void;
|
||||
/**
|
||||
* @deprecated Use IncomingMessage
|
||||
*/
|
||||
export interface ServerRequest extends IncomingMessage {
|
||||
connection: net.Socket;
|
||||
}
|
||||
export interface ServerResponse extends events.EventEmitter, stream.Writable {
|
||||
@@ -340,15 +335,35 @@ declare module "http" {
|
||||
end(str: string, encoding?: string, cb?: Function): void;
|
||||
end(data?: any, encoding?: string): void;
|
||||
}
|
||||
export interface ClientResponse extends events.EventEmitter, stream.Readable {
|
||||
statusCode: number;
|
||||
export interface IncomingMessage extends events.EventEmitter, stream.Readable {
|
||||
httpVersion: string;
|
||||
headers: any;
|
||||
rawHeaders: string[];
|
||||
trailers: any;
|
||||
setEncoding(encoding?: string): void;
|
||||
pause(): void;
|
||||
resume(): void;
|
||||
rawTrailers: any;
|
||||
setTimeout(msecs: number, callback: Function): NodeJS.Timer;
|
||||
/**
|
||||
* Only valid for request obtained from http.Server.
|
||||
*/
|
||||
method?: string;
|
||||
/**
|
||||
* Only valid for request obtained from http.Server.
|
||||
*/
|
||||
url?: string;
|
||||
/**
|
||||
* Only valid for response obtained from http.ClientRequest.
|
||||
*/
|
||||
statusCode?: number;
|
||||
/**
|
||||
* Only valid for response obtained from http.ClientRequest.
|
||||
*/
|
||||
statusMessage?: string;
|
||||
socket: net.Socket;
|
||||
}
|
||||
/**
|
||||
* @deprecated Use IncomingMessage
|
||||
*/
|
||||
export interface ClientResponse extends IncomingMessage { }
|
||||
|
||||
export interface AgentOptions {
|
||||
/**
|
||||
@@ -390,10 +405,10 @@ declare module "http" {
|
||||
[errorCode: number]: string;
|
||||
[errorCode: string]: string;
|
||||
};
|
||||
export function createServer(requestListener?: (request: ServerRequest, response: ServerResponse) =>void ): Server;
|
||||
export function createServer(requestListener?: (request: IncomingMessage, response: ServerResponse) =>void ): Server;
|
||||
export function createClient(port?: number, host?: string): any;
|
||||
export function request(options: any, callback?: Function): ClientRequest;
|
||||
export function get(options: any, callback?: Function): ClientRequest;
|
||||
export function request(options: any, callback?: (res: IncomingMessage) => void): ClientRequest;
|
||||
export function get(options: any, callback?: (res: IncomingMessage) => void): ClientRequest;
|
||||
export var globalAgent: Agent;
|
||||
}
|
||||
|
||||
@@ -563,8 +578,8 @@ declare module "https" {
|
||||
};
|
||||
export interface Server extends tls.Server { }
|
||||
export function createServer(options: ServerOptions, requestListener?: Function): Server;
|
||||
export function request(options: RequestOptions, callback?: (res: http.ClientResponse) =>void ): http.ClientRequest;
|
||||
export function get(options: RequestOptions, callback?: (res: http.ClientResponse) =>void ): http.ClientRequest;
|
||||
export function request(options: RequestOptions, callback?: (res: http.IncomingMessage) =>void ): http.ClientRequest;
|
||||
export function get(options: RequestOptions, callback?: (res: http.IncomingMessage) =>void ): http.ClientRequest;
|
||||
export var globalAgent: Agent;
|
||||
}
|
||||
|
||||
@@ -1036,6 +1051,36 @@ declare module "path" {
|
||||
export var delimiter: string;
|
||||
export function parse(p: string): ParsedPath;
|
||||
export function format(pP: ParsedPath): string;
|
||||
|
||||
export module posix {
|
||||
export function normalize(p: string): string;
|
||||
export function join(...paths: any[]): string;
|
||||
export function resolve(...pathSegments: any[]): string;
|
||||
export function isAbsolute(p: string): boolean;
|
||||
export function relative(from: string, to: string): string;
|
||||
export function dirname(p: string): string;
|
||||
export function basename(p: string, ext?: string): string;
|
||||
export function extname(p: string): string;
|
||||
export var sep: string;
|
||||
export var delimiter: string;
|
||||
export function parse(p: string): ParsedPath;
|
||||
export function format(pP: ParsedPath): string;
|
||||
}
|
||||
|
||||
export module win32 {
|
||||
export function normalize(p: string): string;
|
||||
export function join(...paths: any[]): string;
|
||||
export function resolve(...pathSegments: any[]): string;
|
||||
export function isAbsolute(p: string): boolean;
|
||||
export function relative(from: string, to: string): string;
|
||||
export function dirname(p: string): string;
|
||||
export function basename(p: string, ext?: string): string;
|
||||
export function extname(p: string): string;
|
||||
export var sep: string;
|
||||
export var delimiter: string;
|
||||
export function parse(p: string): ParsedPath;
|
||||
export function format(pP: ParsedPath): string;
|
||||
}
|
||||
}
|
||||
|
||||
declare module "string_decoder" {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user